* [PATCH v2][ 1/3] chipidea: usbmisc_imx: Allow USB OTG to work on mx51
@ 2014-04-07 16:03 Denis Carikli
2014-04-07 16:04 ` [PATCH v2][ 2/3] ARM: dts: mbimxsd51 baseboard: Add USB support Denis Carikli
2014-04-07 16:04 ` [PATCH v2][ 3/3] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support Denis Carikli
0 siblings, 2 replies; 6+ messages in thread
From: Denis Carikli @ 2014-04-07 16:03 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@freescale.com>
The field PLLDIVVALUE of register PHY_CTRL_1 selects the reference clock source
for the PHY:
00 = sysclock uses 19.2 MHz
01 = sysclock uses 24 MHz
10 = sysclock uses 26 MHz
11 = sysclock uses 27 MHz
The reset value for this field is 10 according to the reference manual, and
even though this reset value works for mx53, it does not work for mx51.
So instead of relying on the reset value for the PLLDIVVALUE field, explicitly
set it to 01 so that a 24MHz clock can be selected for the PHY and allowing both
mx51 and mx53 to have USB OTG port functional.
Succesfully tested 'g_ether' on a imx51-babbage and on a imx53-qsb boards.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/usb/chipidea/usbmisc_imx.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index cd061ab..f6c4f3c 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -26,11 +26,14 @@
#define MX27_OTG_PM_BIT BIT(24)
#define MX53_USB_OTG_PHY_CTRL_0_OFFSET 0x08
+#define MX53_USB_OTG_PHY_CTRL_1_OFFSET 0x0c
#define MX53_USB_UH2_CTRL_OFFSET 0x14
#define MX53_USB_UH3_CTRL_OFFSET 0x18
#define MX53_BM_OVER_CUR_DIS_H1 BIT(5)
#define MX53_BM_OVER_CUR_DIS_OTG BIT(8)
#define MX53_BM_OVER_CUR_DIS_UHx BIT(30)
+#define MX53_USB_PHYCTRL1_PLLDIV_MASK 0x3
+#define MX53_USB_PLL_DIV_24_MHZ 0x01
#define MX6_BM_OVER_CUR_DIS BIT(7)
@@ -111,6 +114,13 @@ static int usbmisc_imx53_init(struct imx_usbmisc_data *data)
if (data->index > 3)
return -EINVAL;
+ /* Select a 24 MHz reference clock for the PHY */
+ reg = usbmisc->base + MX53_USB_OTG_PHY_CTRL_1_OFFSET;
+ val = readl(reg);
+ val &= ~MX53_USB_PHYCTRL1_PLLDIV_MASK;
+ val |= MX53_USB_PLL_DIV_24_MHZ;
+ writel(val, usbmisc->base + MX53_USB_OTG_PHY_CTRL_1_OFFSET);
+
if (data->disable_oc) {
spin_lock_irqsave(&usbmisc->lock, flags);
switch (data->index) {
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2][ 2/3] ARM: dts: mbimxsd51 baseboard: Add USB support.
2014-04-07 16:03 [PATCH v2][ 1/3] chipidea: usbmisc_imx: Allow USB OTG to work on mx51 Denis Carikli
@ 2014-04-07 16:04 ` Denis Carikli
2014-04-08 11:57 ` Shawn Guo
2014-04-07 16:04 ` [PATCH v2][ 3/3] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support Denis Carikli
1 sibling, 1 reply; 6+ messages in thread
From: Denis Carikli @ 2014-04-07 16:04 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Denis Carikli <denis@eukrea.com>
---
Changelog v1->v2:
- This patch has been splitted out of my previous imx25/35/51 USB patchset.
It's made from the "ARM: dts: i.MX51: Add a second usbphy." and the
"ARM: dts: mbimxsd51 baseboard: Add USB host support" patchset.
- USB OTG support was added.
- The second USB phy was moved outside of imx51.dtsi
- "phy_type = "ulpi";" was added to the usbh1 node, like with the imx51 babbage.
- Now depends on the "chipidea: usbmisc_imx: Allow USB OTG to work on mx51" patch
which is queued by Peter Chen.
---
.../boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts | 58 ++++++++++++++++++++
1 file changed, 58 insertions(+)
diff --git a/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts
index 5cec4f3..8b1098e 100644
--- a/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts
+++ b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts
@@ -57,6 +57,20 @@
fsl,mux-int-port = <2>;
fsl,mux-ext-port = <3>;
};
+
+ usbphy {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "simple-bus";
+
+ usbh1phy: usbh1phy at 0 {
+ compatible = "usb-nop-xceiv";
+ reg = <0>;
+ clocks = <&clks IMX5_CLK_USB_PHY_GATE>;
+ clock-names = "main_clk";
+ clock-frequency = <19200000>;
+ };
+ };
};
&audmux {
@@ -151,6 +165,29 @@
MX51_PAD_CSI1_D9__GPIO3_13 0x1f5
>;
};
+
+ pinctrl_usbh1: usbh1grp {
+ fsl,pins = <
+ MX51_PAD_USBH1_CLK__USBH1_CLK 0x1e5
+ MX51_PAD_USBH1_DIR__USBH1_DIR 0x1e5
+ MX51_PAD_USBH1_NXT__USBH1_NXT 0x1e5
+ MX51_PAD_USBH1_DATA0__USBH1_DATA0 0x1e5
+ MX51_PAD_USBH1_DATA1__USBH1_DATA1 0x1e5
+ MX51_PAD_USBH1_DATA2__USBH1_DATA2 0x1e5
+ MX51_PAD_USBH1_DATA3__USBH1_DATA3 0x1e5
+ MX51_PAD_USBH1_DATA4__USBH1_DATA4 0x1e5
+ MX51_PAD_USBH1_DATA5__USBH1_DATA5 0x1e5
+ MX51_PAD_USBH1_DATA6__USBH1_DATA6 0x1e5
+ MX51_PAD_USBH1_DATA7__USBH1_DATA7 0x1e5
+ MX51_PAD_USBH1_STP__USBH1_STP 0x1e5
+ >;
+ };
+
+ pinctrl_usbh1_vbus: usbh1-vbusgrp {
+ fsl,pins = <
+ MX51_PAD_EIM_CS3__GPIO2_28 0x1f5
+ >;
+ };
};
};
@@ -173,3 +210,24 @@
fsl,uart-has-rtscts;
status = "okay";
};
+
+&usbh1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_usbh1>;
+ fsl,usbphy = <&usbh1phy>;
+ dr_mode = "host";
+ phy_type = "ulpi";
+ status = "okay";
+};
+
+&usbotg {
+ dr_mode = "otg";
+ phy_type = "utmi_wide";
+ status = "okay";
+};
+
+&usbphy0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_usbh1_vbus>;
+ reset-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
+};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2][ 3/3] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support.
2014-04-07 16:03 [PATCH v2][ 1/3] chipidea: usbmisc_imx: Allow USB OTG to work on mx51 Denis Carikli
2014-04-07 16:04 ` [PATCH v2][ 2/3] ARM: dts: mbimxsd51 baseboard: Add USB support Denis Carikli
@ 2014-04-07 16:04 ` Denis Carikli
2014-04-08 11:58 ` Shawn Guo
2014-05-12 15:04 ` Shawn Guo
1 sibling, 2 replies; 6+ messages in thread
From: Denis Carikli @ 2014-04-07 16:04 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Denis Carikli <denis@eukrea.com>
---
Changelog v1->v2:
- Rebased.
---
arch/arm/configs/imx_v6_v7_defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index ca9f59a..5129f01 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -209,8 +209,10 @@ CONFIG_USB_STORAGE=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_HOST=y
+CONFIG_USB_OTG_FSM=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_MXS_PHY=y
+CONFIG_USB_ULPI=y
CONFIG_USB_GADGET=y
CONFIG_USB_ETH=y
CONFIG_MMC=y
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2][ 2/3] ARM: dts: mbimxsd51 baseboard: Add USB support.
2014-04-07 16:04 ` [PATCH v2][ 2/3] ARM: dts: mbimxsd51 baseboard: Add USB support Denis Carikli
@ 2014-04-08 11:57 ` Shawn Guo
0 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2014-04-08 11:57 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 07, 2014 at 06:04:00PM +0200, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis@eukrea.com>
> ---
> Changelog v1->v2:
> - This patch has been splitted out of my previous imx25/35/51 USB patchset.
> It's made from the "ARM: dts: i.MX51: Add a second usbphy." and the
> "ARM: dts: mbimxsd51 baseboard: Add USB host support" patchset.
> - USB OTG support was added.
> - The second USB phy was moved outside of imx51.dtsi
> - "phy_type = "ulpi";" was added to the usbh1 node, like with the imx51 babbage.
> - Now depends on the "chipidea: usbmisc_imx: Allow USB OTG to work on mx51" patch
> which is queued by Peter Chen.
> ---
> .../boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts | 58 ++++++++++++++++++++
> 1 file changed, 58 insertions(+)
Applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2][ 3/3] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support.
2014-04-07 16:04 ` [PATCH v2][ 3/3] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support Denis Carikli
@ 2014-04-08 11:58 ` Shawn Guo
2014-05-12 15:04 ` Shawn Guo
1 sibling, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2014-04-08 11:58 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 07, 2014 at 06:04:01PM +0200, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis@eukrea.com>
> ---
> Changelog v1->v2:
> - Rebased.
> ---
> arch/arm/configs/imx_v6_v7_defconfig | 2 ++
> 1 file changed, 2 insertions(+)
Applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2][ 3/3] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support.
2014-04-07 16:04 ` [PATCH v2][ 3/3] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support Denis Carikli
2014-04-08 11:58 ` Shawn Guo
@ 2014-05-12 15:04 ` Shawn Guo
1 sibling, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2014-05-12 15:04 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 07, 2014 at 06:04:01PM +0200, Denis Carikli wrote:
> Signed-off-by: Denis Carikli <denis@eukrea.com>
> ---
> Changelog v1->v2:
> - Rebased.
> ---
> arch/arm/configs/imx_v6_v7_defconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
> index ca9f59a..5129f01 100644
> --- a/arch/arm/configs/imx_v6_v7_defconfig
> +++ b/arch/arm/configs/imx_v6_v7_defconfig
> @@ -209,8 +209,10 @@ CONFIG_USB_STORAGE=y
> CONFIG_USB_CHIPIDEA=y
> CONFIG_USB_CHIPIDEA_UDC=y
> CONFIG_USB_CHIPIDEA_HOST=y
> +CONFIG_USB_OTG_FSM=y
Per discussion [1], I have to drop the patch from my tree for now.
Shawn
[1] http://thread.gmane.org/gmane.linux.ports.arm.kernel/323949
> CONFIG_NOP_USB_XCEIV=y
> CONFIG_USB_MXS_PHY=y
> +CONFIG_USB_ULPI=y
> CONFIG_USB_GADGET=y
> CONFIG_USB_ETH=y
> CONFIG_MMC=y
> --
> 1.7.9.5
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-05-12 15:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-07 16:03 [PATCH v2][ 1/3] chipidea: usbmisc_imx: Allow USB OTG to work on mx51 Denis Carikli
2014-04-07 16:04 ` [PATCH v2][ 2/3] ARM: dts: mbimxsd51 baseboard: Add USB support Denis Carikli
2014-04-08 11:57 ` Shawn Guo
2014-04-07 16:04 ` [PATCH v2][ 3/3] ARM: imx_v6_v7_defconfig: Enable drivers for i.MX51 USB Host support Denis Carikli
2014-04-08 11:58 ` Shawn Guo
2014-05-12 15:04 ` Shawn Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).