From patchwork Mon Jan 27 09:42:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 3541771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D5B349F391 for ; Mon, 27 Jan 2014 09:43:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FF8C20122 for ; Mon, 27 Jan 2014 09:43:39 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0975120123 for ; Mon, 27 Jan 2014 09:43:33 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7ij2-0001xO-4Q; Mon, 27 Jan 2014 09:43:28 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7iiz-0007LC-Gr; Mon, 27 Jan 2014 09:43:25 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W7iiw-0007Ka-06 for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2014 09:43:22 +0000 Received: from weser.hi.pengutronix.de ([2001:6f8:1178:2:fa0f:41ff:fe58:4010]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1W7iia-00015S-De; Mon, 27 Jan 2014 10:43:00 +0100 Message-ID: <1390815772.4847.9.camel@weser.hi.pengutronix.de> Subject: Re: imx6: usbhc2/3 and HSIC From: Lucas Stach To: Christian Gmeiner Date: Mon, 27 Jan 2014 10:42:52 +0100 In-Reply-To: References: X-Mailer: Evolution 3.8.5-2+b1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:fa0f:41ff:fe58:4010 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140127_044322_386174_516344CF X-CRM114-Status: GOOD ( 22.09 ) X-Spam-Score: -2.4 (--) Cc: "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Regards, Lucas ------------------------------>8------------------------------------ From 5af9a0597a329a2c4af012fd0fb54f525b45f625 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 28 Jan 2013 13:08:08 +0100 Subject: [PATCH] ARM/USB i.MX6: Add HSIC support On i.MX6 HOST2 and HOST3 are HSIC only ports. These have the special requirement that they need the to set a pullup on the strobe line after initialization. Fortunately only one routing option for the HSIC ports exist, so we can put the pinmux setup completely into the i.MX6 dtsi file. Signed-off-by: Sascha Hauer Signed-off-by: Lucas Stach --- arch/arm/boot/dts/imx6q.dtsi | 32 ++++++++++++++++++++++++++++++++ arch/arm/boot/dts/imx6qdl.dtsi | 8 ++++++++ drivers/usb/chipidea/ci13xxx_imx.c | 10 ++++++++++ drivers/usb/chipidea/usbmisc_imx.c | 5 +++++ 4 files changed, 55 insertions(+) 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; }