add usb support for mx6 board
Subsystems (2)
cover add usb support for mx6 board
Add usb support for mx6qarm2 mx6sabresd mx6sxsabresd mx6slevk. Mainly add pad settings and ehci power settings. Also introduce a new function to set IOMUXC GPR registers, because mx6sabresd usb needs that function to work.
This patch set only contains board related settings for usb and a new gpr function. ehci_hcd_init and otg power polarity in ehci-mx6.c are not touched. Thus usb start can not work fine. As this is new feature support, post this patch set for review first.
In future patch, related patch that maybe bugfix to make usb start fine will be sent out.
Peng Fan (5):
imx:mx6sxsabresd add usb support imx:mx6slevk add usb support arm:imx-common introduce a new function to set gpr imx:mx6qarm2 add usb support imx:mx6sabresd add usb support
arch/arm/imx-common/iomux-v3.c | 25 ++++++++++++++ board/freescale/mx6qarm2/mx6qarm2.c | 27 +++++++++++++++ board/freescale/mx6sabresd/mx6sabresd.c | 53 +++++++++++++++++++++++++++++ board/freescale/mx6slevk/mx6slevk.c | 29 ++++++++++++++++ board/freescale/mx6sxsabresd/mx6sxsabresd.c | 29 ++++++++++++++++ include/configs/mx6qarm2.h | 14 ++++++++ include/configs/mx6sabresd.h | 14 ++++++++ include/configs/mx6slevk.h | 14 ++++++++ include/configs/mx6sxsabresd.h | 14 ++++++++ 9 files changed, 219 insertions(+)
Signature · 1 line
1.8.4.5
PATCH 1/5 imx:mx6sxsabresd add usb support
Add usb support for mx6sxsabresd board.
--- board/freescale/mx6sxsabresd/mx6sxsabresd.c | 29 +++++++++++++++++++++++++++++ include/configs/mx6sxsabresd.h | 14 ++++++++++++++ 2 files changed, 43 insertions(+)
board/freescale/mx6sxsabresd/mx6sxsabresd.c +29 -0
@@ -296,3 +296,32 @@ int checkboard(void)return 0 ; } + +#ifdef CONFIG_USB_EHCI_MX6 +iomux_v3_cfg_t const usb_otg1_pads[] = { +MX6_PAD_GPIO1_IO09__USB_OTG1_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +MX6_PAD_GPIO1_IO10__ANATOP_OTG1_ID |MUX_PAD_CTRL (NO_PAD_CTRL ) +}; + +iomux_v3_cfg_t const usb_otg2_pads[] = { +MX6_PAD_GPIO1_IO12__USB_OTG2_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +}; + +int board_ehci_hcd_init (int port) +{ +switch (port) { +case 0 : +imx_iomux_v3_setup_multiple_pads (usb_otg1_pads, +ARRAY_SIZE (usb_otg1_pads)); +break ; +case 1 : +imx_iomux_v3_setup_multiple_pads (usb_otg2_pads, +ARRAY_SIZE (usb_otg2_pads)); +break ; +default : +printf ("MXC USB port %d not yet supported\n" , port); +return 1 ; + } +return 0 ; +} +#endif
include/configs/mx6sxsabresd.h +14 -0
@@ -198,6 +198,20 @@#define CONFIG_PHYLIB #define CONFIG_PHY_ATHEROS + +#define CONFIG_CMD_USB +#ifdef CONFIG_CMD_USB +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_USB_STORAGE +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET +#define CONFIG_USB_HOST_ETHER +#define CONFIG_USB_ETHER_ASIX +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +#endif +#define CONFIG_CMD_PCI #ifdef CONFIG_CMD_PCI #define CONFIG_PCI
Signature · 1 line
1.8.4.5
PATCH 1/5 imx:mx6sxsabresd add usb support
Hi Peng,
Quoted 61 lines · Peng Fan
Add usb support for mx6sxsabresd board.
Signed-off-by Peng Fan <[email protected]>Signed-off-by Ye.Li <[email protected]>--- board/freescale/mx6sxsabresd/mx6sxsabresd.c | 29 +++++++++++++++++++++++++++++ include/configs/mx6sxsabresd.h | 14 ++++++++++++++ 2 files changed, 43 insertions(+)board/freescale/mx6sxsabresd/mx6sxsabresd.c +29
-0@@ -296,3 +296,32 @@ int checkboard(void)return 0 ; } + +#ifdef CONFIG_USB_EHCI_MX6 +iomux_v3_cfg_t const usb_otg1_pads[] = { +MX6_PAD_GPIO1_IO09__USB_OTG1_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +MX6_PAD_GPIO1_IO10__ANATOP_OTG1_ID |MUX_PAD_CTRL (NO_PAD_CTRL ) +}; + +iomux_v3_cfg_t const usb_otg2_pads[] = { +MX6_PAD_GPIO1_IO12__USB_OTG2_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +}; + +int board_ehci_hcd_init (int port) +{ +switch (port) { +case 0 : +imx_iomux_v3_setup_multiple_pads (usb_otg1_pads, +ARRAY_SIZE (usb_otg1_pads)); +break ; +case 1 : +imx_iomux_v3_setup_multiple_pads (usb_otg2_pads, +ARRAY_SIZE (usb_otg2_pads)); +break ; +default : +printf ("MXC USB port %d not yet supported\n" , port); +return 1 ; + } +return 0 ; +} +#endif include/configs/mx6sxsabresd.h +7
-0@@ -198,6 +198,20 @@#define CONFIG_PHYLIB #define CONFIG_PHY_ATHEROS + +#define CONFIG_CMD_USB +#ifdef CONFIG_CMD_USB +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_USB_STORAGE +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
include/configs/mx6sxsabresd.h line 217
Quoted 10 lines
include/configs/mx6sxsabresd.h +7
-0+#define CONFIG_USB_HOST_ETHER +#define CONFIG_USB_ETHER_ASIX +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +#endif +#define CONFIG_CMD_PCI #ifdef CONFIG_CMD_PCI #define CONFIG_PCI
The OTG power polarity setting in ehci-imx6 driver is opposed with the board design. So without changing the polarity setting, we have to use GPIO to control the power switch.
Best regards,
Ye Li
Fabio Estevam
reviewerPATCH 1/5 imx:mx6sxsabresd add usb support
In reply to Peng FanQuoted 17 lines · Peng Fan
Add usb support for mx6sxsabresd board.
Signed-off-by Peng Fan <[email protected]>Signed-off-by Ye.Li <[email protected]>--- board/freescale/mx6sxsabresd/mx6sxsabresd.c | 29 +++++++++++++++++++++++++++++ include/configs/mx6sxsabresd.h | 14 ++++++++++++++ 2 files changed, 43 insertions(+)board/freescale/mx6sxsabresd/mx6sxsabresd.c +0
-0@@ -296,3 +296,32 @@ int checkboard(void)return 0 ; }
board/freescale/mx6sxsabresd/mx6sxsabresd.c int checkboard(void) · line 308
Quoted 10 lines
board/freescale/mx6sxsabresd/mx6sxsabresd.c +10
-0+ +#ifdef CONFIG_USB_EHCI_MX6 +iomux_v3_cfg_t const usb_otg1_pads[] = { +MX6_PAD_GPIO1_IO09__USB_OTG1_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +MX6_PAD_GPIO1_IO10__ANATOP_OTG1_ID |MUX_PAD_CTRL (NO_PAD_CTRL ) +}; + +iomux_v3_cfg_t const usb_otg2_pads[] = { +MX6_PAD_GPIO1_IO12__USB_OTG2_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +};
Please make both 'static'
Quoted 6 lines
board/freescale/mx6sxsabresd/mx6sxsabresd.c +6
-0+ +int board_ehci_hcd_init (int port) +{ +switch (port) { +case 0 : + imx_iomux_v3_setup_multiple_pads(usb_otg1_pads,
board/freescale/mx6sxsabresd/mx6sxsabresd.c int checkboard(void) · line 324
Quoted 10 lines
board/freescale/mx6sxsabresd/mx6sxsabresd.c +10
-0+ ARRAY_SIZE(usb_otg1_pads)); +break ; +case 1 : +imx_iomux_v3_setup_multiple_pads (usb_otg2_pads, +ARRAY_SIZE (usb_otg2_pads)); +break ; +default : +printf ("MXC USB port %d not yet supported\n" , port); +return 1 ; + }
Please return -EINVAL.
PATCH 1/5 imx:mx6sxsabresd add usb support
In reply to Peng FanHi Peng,
Quoted 36 lines · Peng Fan
Add usb support for mx6sxsabresd board.
Signed-off-by Peng Fan <[email protected]>Signed-off-by Ye.Li <[email protected]>--- board/freescale/mx6sxsabresd/mx6sxsabresd.c | 29 +++++++++++++++++++++++++++++ include/configs/mx6sxsabresd.h | 14 ++++++++++++++ 2 files changed, 43 insertions(+)board/freescale/mx6sxsabresd/mx6sxsabresd.c +19
-0@@ -296,3 +296,32 @@ int checkboard(void)return 0 ; } + +#ifdef CONFIG_USB_EHCI_MX6 +iomux_v3_cfg_t const usb_otg1_pads[] = { +MX6_PAD_GPIO1_IO09__USB_OTG1_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +MX6_PAD_GPIO1_IO10__ANATOP_OTG1_ID |MUX_PAD_CTRL (NO_PAD_CTRL ) +}; + +iomux_v3_cfg_t const usb_otg2_pads[] = { +MX6_PAD_GPIO1_IO12__USB_OTG2_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +}; + +int board_ehci_hcd_init (int port) +{ +switch (port) { +case 0 : +imx_iomux_v3_setup_multiple_pads (usb_otg1_pads, +ARRAY_SIZE (usb_otg1_pads)); +break ; +case 1 :
board/freescale/mx6sxsabresd/mx6sxsabresd.c int checkboard(void) · line 327
Quoted 10 lines
board/freescale/mx6sxsabresd/mx6sxsabresd.c +10
-0+imx_iomux_v3_setup_multiple_pads (usb_otg2_pads, +ARRAY_SIZE (usb_otg2_pads)); +break ; +default : +printf ("MXC USB port %d not yet supported\n" , port); + return 1; + } +return 0 ; +} +#endif
Frankly, I am expecting that this function power up the bus instead of pin multiplexing. If the pins are reserved for USB, why should we set the pinmux each time board_ehci_hcd_init() is called ? And, in any case, pins are not reset after their usage for USB. You can move this setup in board_init() or in another init function.
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 1/5 imx:mx6sxsabresd add usb support
Hi,
? 11/3/2014 8:28 PM, Stefano Babic ??:
Quoted 47 lines
Hi Peng,
Quoted 44 lines · Peng Fan
Add usb support for mx6sxsabresd board.
Signed-off-by Peng Fan <[email protected]>Signed-off-by Ye.Li <[email protected]>--- board/freescale/mx6sxsabresd/mx6sxsabresd.c | 29 +++++++++++++++++++++++++++++ include/configs/mx6sxsabresd.h | 14 ++++++++++++++ 2 files changed, 43 insertions(+)board/freescale/mx6sxsabresd/mx6sxsabresd.c +27
-0@@ -296,3 +296,32 @@ int checkboard(void)return 0 ; } + +#ifdef CONFIG_USB_EHCI_MX6 +iomux_v3_cfg_t const usb_otg1_pads[] = { +MX6_PAD_GPIO1_IO09__USB_OTG1_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +MX6_PAD_GPIO1_IO10__ANATOP_OTG1_ID |MUX_PAD_CTRL (NO_PAD_CTRL ) +}; + +iomux_v3_cfg_t const usb_otg2_pads[] = { +MX6_PAD_GPIO1_IO12__USB_OTG2_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +}; + +int board_ehci_hcd_init (int port) +{ +switch (port) { +case 0 : +imx_iomux_v3_setup_multiple_pads (usb_otg1_pads, +ARRAY_SIZE (usb_otg1_pads)); +break ; +case 1 : +imx_iomux_v3_setup_multiple_pads (usb_otg2_pads, +ARRAY_SIZE (usb_otg2_pads)); +break ; +default : +printf ("MXC USB port %d not yet supported\n" , port); +return 1 ; + } +return 0 ;
Quoted 8 lines
board/freescale/mx6sxsabresd/mx6sxsabresd.c int checkboard(void) · line 327
Quoted 2 lines
board/freescale/mx6sxsabresd/mx6sxsabresd.c +2
-0+} +#endif Frankly, I am expecting that this function power up the bus instead of pin multiplexing. If the pins are reserved for USB, why should we set the pinmux each time
board_ehci_hcd_init()is called ? And, in any case, pins are not reset after their usage for USB. You can move this setup inboard_init()or in another init function.
Because otg power problem which is pointed out by Ye Li, I'll do power enable/disable in board_ehci_power function and move the pin settings to board_init.
And sent patch v2.
Thanks,
Peng.
Quoted 4 lines
Best regards,
Stefano Babic
PATCH 2/5 imx:mx6slevk add usb support
In reply to Peng FanAdd usb support for mx6slevk board.
--- board/freescale/mx6slevk/mx6slevk.c | 29 +++++++++++++++++++++++++++++ include/configs/mx6slevk.h | 14 ++++++++++++++ 2 files changed, 43 insertions(+)
board/freescale/mx6slevk/mx6slevk.c +29 -0
@@ -182,3 +182,32 @@ int checkboard(void)return 0 ; } + +#ifdef CONFIG_USB_EHCI_MX6 +iomux_v3_cfg_t const usb_otg1_pads[] = { +MX6_PAD_KEY_COL4__USB_USBOTG1_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +MX6_PAD_EPDC_PWRCOM__ANATOP_USBOTG1_ID |MUX_PAD_CTRL (NO_PAD_CTRL ) +}; + +iomux_v3_cfg_t const usb_otg2_pads[] = { +MX6_PAD_KEY_COL5__USB_USBOTG2_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +}; + +int board_ehci_hcd_init (int port) +{ +switch (port) { +case 0 : +imx_iomux_v3_setup_multiple_pads (usb_otg1_pads, +ARRAY_SIZE (usb_otg1_pads)); +break ; +case 1 : +imx_iomux_v3_setup_multiple_pads (usb_otg2_pads, +ARRAY_SIZE (usb_otg2_pads)); +break ; +default : +printf ("MXC USB port %d not yet supported\n" , port); +return 1 ; + } +return 0 ; +} +#endif
include/configs/mx6slevk.h +14 -0
@@ -210,4 +210,18 @@#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0#endif +/* USB Configs */ +#define CONFIG_CMD_USB +#ifdef CONFIG_CMD_USB +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_USB_STORAGE +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET +#define CONFIG_USB_HOST_ETHER +#define CONFIG_USB_ETHER_ASIX +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 +#endif +#endif /* __CONFIG_H */
Signature · 1 line
1.8.4.5
Fabio Estevam
reviewerPATCH 2/5 imx:mx6slevk add usb support
board/freescale/mx6slevk/mx6slevk.c int checkboard(void) · line 188
Quoted 5 lines · Peng Fan
}
board/freescale/mx6slevk/mx6slevk.c +4
-0+ +#ifdef CONFIG_USB_EHCI_MX6 +iomux_v3_cfg_t const usb_otg1_pads[] = { + MX6_PAD_KEY_COL4__USB_USBOTG1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL),
This can be 'static'.
Quoted 4 lines
board/freescale/mx6slevk/mx6slevk.c +4
-0+int board_ehci_hcd_init (int port) +{ +switch (port) { +case 0 :
board/freescale/mx6slevk/mx6slevk.c int checkboard(void) · line 209
Quoted 10 lines
board/freescale/mx6slevk/mx6slevk.c +10
-0+imx_iomux_v3_setup_multiple_pads (usb_otg1_pads, +ARRAY_SIZE (usb_otg1_pads)); +break ; +case 1 : +imx_iomux_v3_setup_multiple_pads (usb_otg2_pads, +ARRAY_SIZE (usb_otg2_pads)); +break ; +default : +printf ("MXC USB port %d not yet supported\n" , port); +return 1 ;
It would be better to return -EINVAL instead.
PATCH 3/5 arm:imx-common introduce a new function to set gpr
In reply to Peng FanAdd a new function mxc_iomux_set_gpr_register to
set the iomux gpr register.
32-bit general purpose registers according to SoC
requirements for any usage.
--- arch/arm/imx-common/iomux-v3.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
arch/arm/imx-common/iomux-v3.c +25 -0
@@ -77,3 +77,28 @@ void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list, p += stride; } } + +/* +* Configure the IOMUX General Purpose Registers. +* +* @group, which gpr register to configure. +* @start_bit, the first bit to set +* @num_bits, how many bits to set +* @value, the value will be set to [start_bits...start_bits+num_bits-1] +*/ +void mxc_iomux_set_gpr_register (int group,int start_bit,int num_bits, +int value) +{ +int i =0 ; +u32 reg; + + reg =readl (base + group *4 ); +while (num_bits) { + reg &= ~(1 << (start_bit + i)); + i++; + num_bits--; + } + + reg |= (value << start_bit); +writel (reg, base + group *4 ); +}
Signature · 1 line
1.8.4.5
PATCH 3/5 arm:imx-common introduce a new function to set gpr
Hi Peng,
Quoted 36 lines · Peng Fan
Add a new function
mxc_iomux_set_gpr_registerto
set the iomux gpr register.32-bit general purpose registers according to SoC
requirements for any usage.Signed-off-by Peng Fan <[email protected]>Signed-off-by Ye.Li <[email protected]>Signed-off-by Nitin Garg <[email protected]>--- arch/arm/imx-common/iomux-v3.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)arch/arm/imx-common/iomux-v3.c +15
-0@@ -77,3 +77,28 @@ void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list, p += stride; } } + +/* +* Configure the IOMUX General Purpose Registers. +* +* @group, which gpr register to configure. +* @start_bit, the first bit to set +* @num_bits, how many bits to set +* @value, the value will be set to [start_bits...start_bits+num_bits-1] +*/ +void mxc_iomux_set_gpr_register (int group,int start_bit,int num_bits, +int value) +{ +int i =0 ; +u32 reg; +
arch/arm/imx-common/iomux-v3.c void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list, · line 104
Quoted 10 lines
arch/arm/imx-common/iomux-v3.c +10
-0+ reg =readl (base + group *4 ); +while (num_bits) { + reg &= ~(1 << (start_bit + i)); + i++; + num_bits--; + } + + reg |= (value << start_bit); +writel (reg, base + group *4 ); +}
This function is already in my previous patch (http://patchwork.ozlabs.org/patch/405013/). The function name is changed to imx_iomux_set_gpr_register.
Best regards,
Ye Li
PATCH 3/5 arm:imx-common introduce a new function to set gpr
Quoted 44 lines · On 11/01/2014 03:39 PM, Li Ye-B37916 wrote:
Hi Peng,
Quoted 39 lines · Peng Fan
Add a new function
mxc_iomux_set_gpr_registerto
set the iomux gpr register.32-bit general purpose registers according to SoC
requirements for any usage.Signed-off-by Peng Fan <[email protected]>Signed-off-by Ye.Li <[email protected]>Signed-off-by Nitin Garg <[email protected]>--- arch/arm/imx-common/iomux-v3.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)arch/arm/imx-common/iomux-v3.c +18
-0@@ -77,3 +77,28 @@ void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list, p += stride; } } + +/* +* Configure the IOMUX General Purpose Registers. +* +* @group, which gpr register to configure. +* @start_bit, the first bit to set +* @num_bits, how many bits to set +* @value, the value will be set to [start_bits...start_bits+num_bits-1] +*/ +void mxc_iomux_set_gpr_register (int group,int start_bit,int num_bits, +int value) +{ +int i =0 ; +u32 reg; + + reg =readl (base + group *4 ); +while (num_bits) { + reg &= ~(1 << (start_bit + i));
Quoted 9 lines
arch/arm/imx-common/iomux-v3.c void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list, · line 104
Quoted 7 lines
arch/arm/imx-common/iomux-v3.c +7
-0+ i++; + num_bits--; + } + + reg |= (value << start_bit); +writel (reg, base + group *4 ); +}This function is already in my previous patch (http://patchwork.ozlabs.org/patch/405013/). The function name is changed to
imx_iomux_set_gpr_register.
oh. I missed this piece of code.
Then please ignore this patch set. Sorry for troubles.
Regards,
Peng.
Quoted 7 lines
Best regards,
Ye Li
PATCH 3/5 arm:imx-common introduce a new function to set gpr
In reply to Peng FanDear Peng Fan,
Quoted 5 lines · In message <[email protected]> you wrote:
Add a new function
mxc_iomux_set_gpr_registerto
set the iomux gpr register.32-bit general purpose registers according to SoC
requirements for any usage.
...
Quoted 8 lines
+/*
+ * Configure the IOMUX General Purpose Registers.
+ *
+ * @group, which gpr register to configure.
+ * @start_bit, the first bit to set
+ * @num_bits, how many bits to set
+ * @value, the value will be set to [start_bits...start_bits+num_bits-1]
+ */
Can you please rework the API and use a mask instead of counting bits? Relying on bit numbers is error prone and inherently non-portable.
Use the standard register access macros (like setbits, clrbits, clrsetbits) as example, please.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de All I ask is a chance to prove that money can't make me happy.
PATCH 4/5 imx:mx6qarm2 add usb support
In reply to Peng FanAdd usb support for mx6qarm2 board.
--- board/freescale/mx6qarm2/mx6qarm2.c | 27 +++++++++++++++++++++++++++ include/configs/mx6qarm2.h | 14 ++++++++++++++ 2 files changed, 41 insertions(+)
board/freescale/mx6qarm2/mx6qarm2.c +27 -0
@@ -237,3 +237,30 @@ int checkboard(void)return 0 ; } + +#ifdef CONFIG_USB_EHCI_MX6 +iomux_v3_cfg_t const usb_otg_pads[] = { +MX6_PAD_EIM_D22__USB_OTG_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +MX6_PAD_GPIO_1__USB_OTG_ID |MUX_PAD_CTRL (NO_PAD_CTRL ), +}; + +int board_ehci_hcd_init (int port) +{ +switch (port) { +case 0 : +imx_iomux_v3_setup_multiple_pads (usb_otg_pads, +ARRAY_SIZE (usb_otg_pads)); + +/* +* set daisy chain for otg_pin_id on 6q. +* for 6dl, this bit is reserved +*/ +mxc_iomux_set_gpr_register (1 ,13 ,1 ,1 ); +break ; +default : +printf ("MXC USB port %d not yet supported\n" , port); +return 1 ; + } +return 0 ; +} +#endif
include/configs/mx6qarm2.h +14 -0
@@ -189,4 +189,18 @@#define CONFIG_OF_LIBFDT #define CONFIG_CMD_BOOTZ +/* USB Configs */ +#define CONFIG_CMD_USB +#ifdef CONFIG_CMD_USB +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_USB_STORAGE +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET +#define CONFIG_USB_HOST_ETHER +#define CONFIG_USB_ETHER_ASIX +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 1 +#endif +#endif /* __CONFIG_H */
Signature · 1 line
1.8.4.5
PATCH 5/5 imx:mx6sabresd add usb support
In reply to Peng FanAdd usb support for mx6sabresd.
--- board/freescale/mx6sabresd/mx6sabresd.c | 53 +++++++++++++++++++++++++++++++++ include/configs/mx6sabresd.h | 14 +++++++++ 2 files changed, 67 insertions(+)
board/freescale/mx6sabresd/mx6sabresd.c +53 -0
@@ -546,3 +546,56 @@ int checkboard(void)puts ("Board: MX6-SabreSD\n" );return 0 ; } + +#ifdef CONFIG_USB_EHCI_MX6 +iomux_v3_cfg_t const usb_otg_pads[] = { +MX6_PAD_EIM_D22__USB_OTG_PWR |MUX_PAD_CTRL (NO_PAD_CTRL ), +MX6_PAD_ENET_RX_ER__USB_OTG_ID |MUX_PAD_CTRL (NO_PAD_CTRL ), +}; + +iomux_v3_cfg_t const usb_hc1_pads[] = { +MX6_PAD_ENET_TXD1__GPIO1_IO29 |MUX_PAD_CTRL (NO_PAD_CTRL ), +}; + +int board_ehci_hcd_init (int port) +{ +switch (port) { +case 0 : +imx_iomux_v3_setup_multiple_pads (usb_otg_pads, +ARRAY_SIZE (usb_otg_pads)); + +/* +* set daisy chain for otg_pin_id on 6q. +* for 6dl, this bit is reserved. +*/ +mxc_iomux_set_gpr_register (1 ,13 ,1 ,0 ); +break ; +case 1 : +imx_iomux_v3_setup_multiple_pads (usb_hc1_pads, +ARRAY_SIZE (usb_hc1_pads)); +break ; +default : +printf ("MXC USB port %d not yet supported\n" , port); +return 1 ; + } +return 0 ; +} + +int board_ehci_power (int port,int on) +{ +switch (port) { +case 0 : +break ; +case 1 : +if (on) +gpio_direction_output (IMX_GPIO_NR (1 ,29 ),1 ); +else +gpio_direction_output (IMX_GPIO_NR (1 ,29 ),0 ); +break ; +default : +printf ("MXC USB port %d not yet supported\n" , port); +return 1 ; + } +return 0 ; +} +#endif
include/configs/mx6sabresd.h +14 -0
@@ -54,4 +54,18 @@#define CONFIG_POWER_PFUZE100 #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08 +/* USB Configs */ +#define CONFIG_CMD_USB +#ifdef CONFIG_CMD_USB +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_USB_STORAGE +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET +#define CONFIG_USB_HOST_ETHER +#define CONFIG_USB_ETHER_ASIX +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 +#define CONFIG_USB_MAX_CONTROLLER_COUNT 1/* Enabled USB controller number */ +#endif +#endif /* __MX6QSABRESD_CONFIG_H */
Signature · 1 line
1.8.4.5