usb/mx6q: USB EHCI support for MX6Q boards
Subsystems (4)
cover usb/mx6q: USB EHCI support for MX6Q boards
Wolfgang Grandegger (2):
usb/ehci: Add USB support for the MX6Q
mx6qsabrelite: add and enable USB Host 1 support
arch/arm/cpu/armv7/mx6/clock.c | 13 ++ arch/arm/include/asm/arch-mx6/imx-regs.h | 3 + board/freescale/mx6qsabrelite/mx6qsabrelite.c | 12 ++ drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-mx6.c | 205 +++++++++++++++++++++++++ include/configs/mx6qsabrelite.h | 15 ++ 6 files changed, 249 insertions(+), 0 deletions(-) create mode 100644 drivers/usb/host/ehci-mx6.c
Signature · 1 line
1.7.7.6
PATCH 1/2 usb/ehci: Add USB support for the MX6Q
Currently, only USB Host 1 is supported.
--- arch/arm/cpu/armv7/mx6/clock.c | 13 ++ arch/arm/include/asm/arch-mx6/imx-regs.h | 3 + drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-mx6.c | 205 ++++++++++++++++++++++++++++++ 4 files changed, 222 insertions(+), 0 deletions(-) create mode 100644 drivers/usb/host/ehci-mx6.c
arch/arm/cpu/armv7/mx6/clock.c +13 -0
@@ -36,6 +36,19 @@ enum pll_clocks {struct imx_ccm_reg *imx_ccm = (struct imx_ccm_reg *)CCM_BASE_ADDR ; +void enable_usboh3_clk (unsigned char enable) +{ +u32 reg; + + reg =__raw_readl (&imx_ccm->CCGR6); +if (enable) + reg |=MXC_CCM_CCGR_CG_MASK <<MXC_CCM_CCGR0_CG0_OFFSET ; +else + reg &= ~(MXC_CCM_CCGR_CG_MASK <<MXC_CCM_CCGR0_CG0_OFFSET ); +__raw_writel (reg, &imx_ccm->CCGR6); + +} +static u32 decode_pll (enum pll_clocks pll,u32 infreq) {u32 div;
arch/arm/include/asm/arch-mx6/imx-regs.h +3 -0
@@ -111,6 +111,9 @@#define KPP_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x38000)#define WDOG1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x3C000)#define WDOG2_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x40000) +#define ANATOP_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x48000) +#define USB_PHY0_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x49000) +#define USB_PHY1_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x4a000)#define CCM_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x44000)#define ANATOP_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x48000)#define SNVS_BASE_ADDR (AIPS1_OFF_BASE_ADDR + 0x4C000)
drivers/usb/host/Makefile +1 -0
@@ -43,6 +43,7 @@ endif COBJS-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o COBJS-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o COBJS-$(CONFIG_USB_EHCI_MX5) += ehci-mx5.o +COBJS-$(CONFIG_USB_EHCI_MX6) += ehci-mx6.o COBJS-$(CONFIG_USB_EHCI_PPC4XX) += ehci-ppc4xx.o COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o COBJS-$(CONFIG_USB_EHCI_KIRKWOOD) += ehci-kirkwood.o
drivers/usb/host/ehci-mx6.c new file +205 -0
205 lines not on this page · raw message
Signature · 1 line
1.7.7.6
PATCH 1/2 usb/ehci: Add USB support for the MX6Q
Hi Wolfgang,
Quoted 36 lines · Wolfgang Grandegger
Currently, only USB Host 1 is supported.
Cc Remy Bohmer <[email protected]>Signed-off-by Wolfgang Grandegger <[email protected]>--- arch/arm/cpu/armv7/mx6/clock.c | 13 ++ arch/arm/include/asm/arch-mx6/imx-regs.h | 3 + drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-mx6.c | 205 ++++++++++++++++++++++++++++++ 4 files changed, 222 insertions(+), 0 deletions(-) create mode 100644 drivers/usb/host/ehci-mx6.carch/arm/cpu/armv7/mx6/clock.c +13
-0@@ -36,6 +36,19 @@ enum pll_clocks {struct imx_ccm_reg *imx_ccm = (struct imx_ccm_reg *)CCM_BASE_ADDR ; +void enable_usboh3_clk (unsigned char enable) +{ +u32 reg; + + reg =__raw_readl (&imx_ccm->CCGR6); +if (enable) + reg |=MXC_CCM_CCGR_CG_MASK <<MXC_CCM_CCGR0_CG0_OFFSET ; +else + reg &= ~(MXC_CCM_CCGR_CG_MASK <<MXC_CCM_CCGR0_CG0_OFFSET ); +__raw_writel (reg, &imx_ccm->CCGR6); + +} +static u32 decode_pll (enum pll_clocks pll,u32 infreq) {u32 div;
...
Quoted 5 lines
drivers/usb/host/ehci-mx6.c new file +0
-0
...
drivers/usb/host/ehci-mx6.c line 171
Quoted 5 lines
drivers/usb/host/ehci-mx6.c new file +5
-0+int ehci_hcd_init (void ) +{ +struct usb_ehci *ehci; + +enable_usboh3_clk (1 );
ehci-mx6.c: In function 'ehci_hcd_init':
ehci-mx6.c:171: warning: implicit declaration of function 'enable_usboh3_clk'
Best regards
Dirk
PATCH 2/2 mx6qsabrelite: add and enable USB Host 1 support
In reply to Wolfgang Grandegger--- board/freescale/mx6qsabrelite/mx6qsabrelite.c | 12 ++++++++++++ include/configs/mx6qsabrelite.h | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-)
board/freescale/mx6qsabrelite/mx6qsabrelite.c +12 -0
@@ -77,6 +77,18 @@ static void setup_iomux_uart(void)imx_iomux_v3_setup_multiple_pads (uart2_pads,ARRAY_SIZE (uart2_pads)); } +#ifdef CONFIG_USB_EHCI_MX6 +int board_ehci_hcd_init (int port) +{ +imx_iomux_v3_setup_multiple_pads (usb_pads,ARRAY_SIZE (usb_pads)); + +/* Reset USB hub */ +gpio_direction_output (204 ,0 );/* GPIO 7-12 */ +mdelay (2 ); +gpio_set_value (204 ,1 ); +} +#endif +#ifdef CONFIG_FSL_ESDHC struct fsl_esdhc_cfg usdhc_cfg[2 ] = { {USDHC3_BASE_ADDR, 1},
include/configs/mx6qsabrelite.h +15 -0
@@ -56,6 +56,21 @@#define CONFIG_CMD_FAT #define CONFIG_DOS_PARTITION +#if 1 +/* USB Configs */ +#define CONFIG_CMD_USB +#define CONFIG_CMD_FAT +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_USB_STORAGE +#define CONFIG_USB_HOST_ETHER +#define CONFIG_USB_ETHER_ASIX +#define CONFIG_USB_ETHER_SMSC95XX +#define CONFIG_MXC_USB_PORT 1 +#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS 0 +#endif +/* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE #define CONFIG_CONS_INDEX 1
Signature · 1 line
1.7.7.6
Fabio Estevam
reviewerPATCH 2/2 mx6qsabrelite: add and enable USB Host 1 support
Quoted 7 lines · Wolfgang Grandegger
include/configs/mx6qsabrelite.h +0
-0@@ -56,6 +56,21 @@?#define
CONFIG_CMD_FAT
?#defineCONFIG_DOS_PARTITION+#if 1
Please remove this.
Quoted 24 lines
include/configs/mx6qsabrelite.h +14
-0+/* USB Configs */ +#define CONFIG_CMD_USB +#define CONFIG_CMD_FAT +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX6 +#define CONFIG_USB_STORAGE +#define CONFIG_USB_HOST_ETHER +#define CONFIG_USB_ETHER_ASIX +#define CONFIG_USB_ETHER_SMSC95XX +#define CONFIG_MXC_USB_PORT ? ?1 +#define CONFIG_MXC_USB_PORTSC ?(PORT_PTS_UTMI | PORT_PTS_PTW) +#define CONFIG_MXC_USB_FLAGS ? 0 +#endif +?/* allow to overwrite serial and ethaddr */
?#defineCONFIG_ENV_OVERWRITE
?#defineCONFIG_CONS_INDEX? ? ? ? ? ? ?1
--
1.7.7.6_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH 2/2 mx6qsabrelite: add and enable USB Host 1 support
In reply to Wolfgang GrandeggerHi Wolfgang,
Quoted 13 lines · Wolfgang Grandegger
Cc Stefano Babic <[email protected]>Cc Jason Liu <[email protected]>Signed-off-by Wolfgang Grandegger <[email protected]>--- board/freescale/mx6qsabrelite/mx6qsabrelite.c | 12 ++++++++++++ include/configs/mx6qsabrelite.h | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-)board/freescale/mx6qsabrelite/mx6qsabrelite.c +0
-0
board/freescale/mx6qsabrelite/mx6qsabrelite.c static void setup_iomux_uart(void) · line 83
Quoted 7 lines
board/freescale/mx6qsabrelite/mx6qsabrelite.c +4
-0@@ -77,6 +77,18 @@ static void setup_iomux_uart(void)imx_iomux_v3_setup_multiple_pads (uart2_pads,ARRAY_SIZE (uart2_pads)); } +#ifdef CONFIG_USB_EHCI_MX6 +int board_ehci_hcd_init (int port) +{ +imx_iomux_v3_setup_multiple_pads (usb_pads,ARRAY_SIZE (usb_pads));
Where is the definition of 'usb_pads'?
mx6qsabrelite.c: error: 'usb_pads' undeclared (first use in this function)
board/freescale/mx6qsabrelite/mx6qsabrelite.c static void setup_iomux_uart(void) · line 86
Quoted 2 lines
board/freescale/mx6qsabrelite/mx6qsabrelite.c +2
-0+/* Reset USB hub */ +gpio_direction_output (204 ,0 );/* GPIO 7-12 */
With
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=7861b0f3eb638df23b992f89229c3b416634b6fa
we might want to use something like
gpio_direction_output(GPIO_NUMBER(7, 12), 0);
?
Same below for gpio_set_value() ?
board/freescale/mx6qsabrelite/mx6qsabrelite.c static void setup_iomux_uart(void) · line 89
Quoted 3 lines
board/freescale/mx6qsabrelite/mx6qsabrelite.c +3
-0+mdelay (2 ); +gpio_set_value (204 ,1 ); +}
mx6qsabrelite.c: warning: no return statement in function returning non-void
Best regards
Dirk
PATCH 2/2 mx6qsabrelite: add and enable USB Host 1 support
Hi Dirk,
Quoted 21 lines · Dirk Behme
Hi Wolfgang,
Quoted 18 lines · Wolfgang Grandegger
Cc Stefano Babic <[email protected]>Cc Jason Liu <[email protected]>Signed-off-by Wolfgang Grandegger <[email protected]>--- board/freescale/mx6qsabrelite/mx6qsabrelite.c | 12 ++++++++++++ include/configs/mx6qsabrelite.h | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-)board/freescale/mx6qsabrelite/mx6qsabrelite.c +0
-0@@ -77,6 +77,18 @@ static void setup_iomux_uart(void)imx_iomux_v3_setup_multiple_pads (uart2_pads,ARRAY_SIZE (uart2_pads)); }
Quoted 6 lines
board/freescale/mx6qsabrelite/mx6qsabrelite.c static void setup_iomux_uart(void) · line 83
Quoted 4 lines
board/freescale/mx6qsabrelite/mx6qsabrelite.c +4
-0+#ifdef CONFIG_USB_EHCI_MX6 +int board_ehci_hcd_init (int port) +{ +imx_iomux_v3_setup_multiple_pads (usb_pads,ARRAY_SIZE (usb_pads));Where is the definition of '
usb_pads'?
Oops, that hunk gets lost when rebasing to head of u-boot-imx in a hurry:
@@ -122,6 +122,10 @@ iomux_v3_cfg_t enet_pads2[] = {
MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL | MUX_PAD_CTRL(ENET_PAD_CTRL),
};
+iomux_v3_cfg_t usb_pads[] = {
+ MX6Q_PAD_GPIO_17__GPIO_7_12 | MUX_PAD_CTRL(NO_PAD_CTRL),
+};
+
static void setup_iomux_enet(void)
{
gpio_direction_output(87, 0); /* GPIO 3-23 */Will be fixed in v2.
Quoted 6 lines
mx6qsabrelite.c: error: 'usb_pads' undeclared (first use in this function)board/freescale/mx6qsabrelite/mx6qsabrelite.c static void setup_iomux_uart(void) · line 86
Quoted 2 lines
board/freescale/mx6qsabrelite/mx6qsabrelite.c +2
-0+/* Reset USB hub */ +gpio_direction_output (204 ,0 );/* GPIO 7-12 */
Quoted 8 lines
With
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=commitdiff;h=7861b0f3eb638df23b992f89229c3b416634b6fa
we might want to use something like
gpio_direction_output(GPIO_NUMBER(7, 12), 0);
OK, unfortunately, that file is full of such calls using the number directly ==> seperate patch.
Quoted 10 lines
?
Same below for
gpio_set_value()?board/freescale/mx6qsabrelite/mx6qsabrelite.c static void setup_iomux_uart(void) · line 89
Quoted 3 lines
board/freescale/mx6qsabrelite/mx6qsabrelite.c +3
-0+mdelay (2 ); +gpio_set_value (204 ,1 ); +}
mx6qsabrelite.c: warning: no return statement in function returning non-void
Puh, v1 is obviously crap... will send v2 in a second, sorry.
Wolfgang.