Message ID | 1390815772.4847.9.camel@weser.hi.pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Lucas 2014-01-27 Lucas Stach <l.stach@pengutronix.de>: > Hi Christian, > > Am Montag, den 27.01.2014, 10:22 +0100 schrieb Christian Gmeiner: >> Hi all... >> >> does anyone used the usbhc2 or usbhc3 in HSIC mode? I am trying my >> luck but I do not >> get it to work. Is there anything special I need to take care of? >> > I remember we had this working on a board back in the 3.10 days. The > only thing I remember which is specific to HSIC is in the attached > patch. This isn't really clean and should be done in a better way for > mainline, but maybe it provides some pointers for you. > Thanks for the small patch... I got it almost working - the HSIC device seems to have some problems. I hope to find some time soon to get this stuff into mainline. greets -- Christian Gmeiner, MSc
2014-01-27 17:42 GMT+01:00 Christian Gmeiner <christian.gmeiner@gmail.com>: > Hi Lucas > > 2014-01-27 Lucas Stach <l.stach@pengutronix.de>: >> Hi Christian, >> >> Am Montag, den 27.01.2014, 10:22 +0100 schrieb Christian Gmeiner: >>> Hi all... >>> >>> does anyone used the usbhc2 or usbhc3 in HSIC mode? I am trying my >>> luck but I do not >>> get it to work. Is there anything special I need to take care of? >>> >> I remember we had this working on a board back in the 3.10 days. The >> only thing I remember which is specific to HSIC is in the attached >> patch. This isn't really clean and should be done in a better way for >> mainline, but maybe it provides some pointers for you. >> > > Thanks for the small patch... I got it almost working - the HSIC > device seems to have some problems. > I hope to find some time soon to get this stuff into mainline. > It does not work :( Here are some logs: http://dpaste.com/hold/1617947/ It looks like EHCI takes over and does one port (the HSIC?). The problem seems now that the port never changes its status to connected, but I am 100% sure that there is a LAN9730 [1] connected to that usbhc. [1] http://www.microchip.com/wwwproducts/Devices.aspx?product=LAN9730 greets -- Christian Gmeiner, MSc https://soundcloud.com/christian-gmeiner
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index 21e675848bd1..18ffb5f91439 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -253,6 +253,38 @@ }; }; + usbh2 { + pinctrl_usbh2: usbh2grp { + fsl,pins = < + MX6Q_PAD_RGMII_TXC__USB_H2_DATA 0x13030 + MX6Q_PAD_RGMII_TX_CTL__USB_H2_STROBE 0x13030 + >; + }; + + pinctrl_usbh2_enabled: usbh2grp-enabled { + fsl,pins = < + MX6Q_PAD_RGMII_TXC__USB_H2_DATA 0x13030 + MX6Q_PAD_RGMII_TX_CTL__USB_H2_STROBE 0x17030 + >; + }; + }; + + usbh3 { + pinctrl_usbh3: usbh3grp-1 { + fsl,pins = < + MX6Q_PAD_RGMII_RX_CTL__USB_H3_DATA 0x13030 + MX6Q_PAD_RGMII_RXC__USB_H3_STROBE 0x13030 + >; + }; + + pinctrl_usbh3_enabled: usbh3grp-enabled { + fsl,pins = < + MX6Q_PAD_RGMII_RX_CTL__USB_H3_DATA 0x13030 + MX6Q_PAD_RGMII_RXC__USB_H3_STROBE 0x17030 + >; + }; + }; + usdhc2 { pinctrl_usdhc2_1: usdhc2grp-1 { fsl,pins = < diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 9e8296e4c343..884c512eff04 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -626,7 +626,11 @@ interrupts = <0 41 0x04>; clocks = <&clks 162>; fsl,usbmisc = <&usbmisc 2>; + phy_type = "hsic"; status = "disabled"; + pinctrl-names = "default", "enabled"; + pinctrl-0 = <&pinctrl_usbh2>; + pinctrl-1 = <&pinctrl_usbh2_enabled>; }; usbh3: usb@02184600 { @@ -635,7 +639,11 @@ interrupts = <0 42 0x04>; clocks = <&clks 162>; fsl,usbmisc = <&usbmisc 3>; + phy_type = "hsic"; status = "disabled"; + pinctrl-names = "default", "enabled"; + pinctrl-0 = <&pinctrl_usbh3>; + pinctrl-1 = <&pinctrl_usbh3_enabled>; }; usbmisc: usbmisc: usbmisc@02184800 { diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c index 2ec9052c7bb7..f770328d4901 100644 --- a/drivers/usb/chipidea/ci13xxx_imx.c +++ b/drivers/usb/chipidea/ci13xxx_imx.c @@ -99,6 +99,7 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) struct resource *res; int ret; struct usb_phy *phy; + struct pinctrl *pinctrl; if (of_find_property(pdev->dev.of_node, "fsl,usbmisc", NULL) && !usbmisc_ops) @@ -197,6 +198,15 @@ static int ci13xxx_imx_probe(struct platform_device *pdev) pm_runtime_no_callbacks(&pdev->dev); pm_runtime_enable(&pdev->dev); + pinctrl = devm_pinctrl_get(&pdev->dev); + if (!IS_ERR(pinctrl)) { + struct pinctrl_state *state; + + state = pinctrl_lookup_state(pinctrl, "enabled"); + if (!IS_ERR(state)) + pinctrl_select_state(pinctrl, state); + } + return 0; disable_device: diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c index 588bae8eef5e..e29c5aa51b07 100644 --- a/drivers/usb/chipidea/usbmisc_imx.c +++ b/drivers/usb/chipidea/usbmisc_imx.c @@ -145,6 +145,11 @@ static int usbmisc_imx6q_init(struct device *dev) spin_unlock_irqrestore(&usbmisc->lock, flags); } + if (usbdev->index == 2 || usbdev->index == 3) { + writel(0x00003000, usbmisc->base + usbdev->index * 4); + writel(0x80001842, usbmisc->base + 0x8 + usbdev->index * 4); + } + return 0; }