MX5x USB support
Subsystems (4)
cover MX5x USB support
This patchset adds the USB support for MX5x. Most of the code is based on work of Wolfgang Grandegger with modifications done by various other authors. I also included version of ULPI support code cleaned up by Igor Grinberg.
NOTE: I'd really love to get this code into .12 release. Remy, Wolfgang, do you think it'd be possible? I'd really help adoption of the MX5x USB code greatly as well as cleanup of the ULPI code (which is sadly in a bad shape).
Jana Rapava (1):
USB: Add generic ULPI layer and a viewport
Marek Vasut (4):
USB: MX5: Abstract out mx51 USB pixmux configuration
USB: MX5: Add MX5 usb post-init callback
USB: EHCI: Allow EHCI post-powerup configuration in board files
USB: efikamx: Enable USB on EfikaMX and EfikaSB
Wolfgang Grandegger (4):
USB: MX5: add helper functions to enable USB clocks
USB: MX5: add generic USB EHCI support for mx51 and mx53
USB: mx53loco: add end enable USB host support on port 1
USB: mx51evk: add end enable USB host support on port 1
Makefile | 1 + arch/arm/cpu/armv7/mx5/clock.c | 72 +++++++ arch/arm/include/asm/arch-mx5/clock.h | 5 + arch/arm/include/asm/arch-mx5/crm_regs.h | 3 + board/efikamx/Makefile | 4 + board/efikamx/efikamx-usb.c | 210 +++++++++++++++++++++ board/efikamx/efikamx.c | 15 ++ board/freescale/mx51evk/mx51evk.c | 62 ++++++ board/freescale/mx53loco/mx53loco.c | 10 + drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-hcd.c | 12 +- drivers/usb/host/ehci-mx5.c | 255 +++++++++++++++++++++++++ drivers/usb/ulpi/Makefile | 44 +++++ drivers/usb/ulpi/ulpi-viewport.c | 118 ++++++++++++ drivers/usb/ulpi/ulpi.c | 227 +++++++++++++++++++++++ include/configs/efikamx.h | 47 ++++- include/configs/mx51evk.h | 13 ++ include/configs/mx53loco.h | 13 ++ include/usb/ehci-fsl.h | 16 ++ include/usb/ulpi.h | 298 ++++++++++++++++++++++++++++++ 20 files changed, 1418 insertions(+), 8 deletions(-) create mode 100644 board/efikamx/efikamx-usb.c create mode 100644 drivers/usb/host/ehci-mx5.c create mode 100644 drivers/usb/ulpi/Makefile create mode 100644 drivers/usb/ulpi/ulpi-viewport.c create mode 100644 drivers/usb/ulpi/ulpi.c create mode 100644 include/usb/ulpi.h
Signature · 1 line
1.7.7.1
PATCH 1/9 USB: MX5: add helper functions to enable USB clocks
From: Wolfgang Grandegger <[email protected]>
V2: Fix spacing in crm_regs.h
--- arch/arm/cpu/armv7/mx5/clock.c | 72 ++++++++++++++++++++++++++++++ arch/arm/include/asm/arch-mx5/clock.h | 5 ++ arch/arm/include/asm/arch-mx5/crm_regs.h | 3 + 3 files changed, 80 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/mx5/clock.c +72 -0
@@ -50,6 +50,78 @@ struct mxc_pll_reg *mxc_plls[PLL_CLOCKS] = {struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)MXC_CCM_BASE ; +void set_usboh3_clk (void ) +{ +unsigned int reg; + + reg =readl (&mxc_ccm->cscmr1) & + ~MXC_CCM_CSCMR1_USBOH3_CLK_SEL_MASK ; + reg |=1 <<MXC_CCM_CSCMR1_USBOH3_CLK_SEL_OFFSET ; +writel (reg, &mxc_ccm->cscmr1); + + reg =readl (&mxc_ccm->cscdr1); + reg &= ~MXC_CCM_CSCDR1_USBOH3_CLK_PODF_MASK ; + reg &= ~MXC_CCM_CSCDR1_USBOH3_CLK_PRED_MASK ; + reg |=4 <<MXC_CCM_CSCDR1_USBOH3_CLK_PRED_OFFSET ; + reg |=1 <<MXC_CCM_CSCDR1_USBOH3_CLK_PODF_OFFSET ; + +writel (reg, &mxc_ccm->cscdr1); +} + +void enable_usboh3_clk (unsigned char enable) +{ +unsigned int reg; + + reg =readl (&mxc_ccm->CCGR2); +if (enable) + reg |=1 <<MXC_CCM_CCGR2_CG14_OFFSET ; +else + reg &= ~(1 <<MXC_CCM_CCGR2_CG14_OFFSET ); +writel (reg, &mxc_ccm->CCGR2); +} + +void set_usb_phy1_clk (void ) +{ +unsigned int reg; + + reg =readl (&mxc_ccm->cscmr1); + reg &= ~MXC_CCM_CSCMR1_USB_PHY_CLK_SEL ; +writel (reg, &mxc_ccm->cscmr1); +} + +void enable_usb_phy1_clk (unsigned char enable) +{ +unsigned int reg; + + reg =readl (&mxc_ccm->CCGR4); +if (enable) + reg |=1 <<MXC_CCM_CCGR4_CG5_OFFSET ; +else + reg &= ~(1 <<MXC_CCM_CCGR4_CG5_OFFSET ); +writel (reg, &mxc_ccm->CCGR4); +} + +void set_usb_phy2_clk (void ) +{ +unsigned int reg; + + reg =readl (&mxc_ccm->cscmr1); + reg &= ~MXC_CCM_CSCMR1_USB_PHY_CLK_SEL ; +writel (reg, &mxc_ccm->cscmr1); +} + +void enable_usb_phy2_clk (unsigned char enable) +{ +unsigned int reg; + + reg =readl (&mxc_ccm->CCGR4); +if (enable) + reg |=1 <<MXC_CCM_CCGR4_CG6_OFFSET ; +else + reg &= ~(1 <<MXC_CCM_CCGR4_CG6_OFFSET ); +writel (reg, &mxc_ccm->CCGR4); +} +/* * Calculate the frequency of PLLn. */
arch/arm/include/asm/arch-mx5/clock.h +5 -0
@@ -40,4 +40,9 @@ u32 imx_get_uartclk(void);u32 imx_get_fecclk (void );unsigned int mxc_get_clock (enum mxc_clock clk); +void set_usb_phy2_clk (void ); +void enable_usb_phy2_clk (unsigned char enable); +void set_usboh3_clk (void ); +void enable_usboh3_clk (unsigned char enable); +#endif /* __ASM_ARCH_CLOCK_H */
arch/arm/include/asm/arch-mx5/crm_regs.h +3 -0
@@ -195,7 +195,10 @@ struct mxc_ccm_reg {/* Define the bits in register CCGRx */ #define MXC_CCM_CCGR_CG_MASK 0x3 +#define MXC_CCM_CCGR4_CG5_OFFSET 10 +#define MXC_CCM_CCGR4_CG6_OFFSET 12#define MXC_CCM_CCGR5_CG5_OFFSET 10 +#define MXC_CCM_CCGR2_CG14_OFFSET 28/* Define the bits in register CLPCR */ #define MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS (0x1 << 18)
Signature · 1 line
1.7.7.1
PATCH 2/9 USB: MX5: add generic USB EHCI support for mx51 and mx53
In reply to Marek VasutFrom: Wolfgang Grandegger <[email protected]>
It's derived from ehci-mxc and uses the header files of the ehci-fsl interface. The callback board_ehci_hcd_init() has been introduced to allow for board-specific setup when USB is started.
--- drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-mx5.c | 174 +++++++++++++++++++++++++++++++++++++++++++ include/usb/ehci-fsl.h | 10 +++ 3 files changed, 185 insertions(+), 0 deletions(-) create mode 100644 drivers/usb/host/ehci-mx5.c
drivers/usb/host/Makefile +1 -0
@@ -42,6 +42,7 @@ COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o 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_PPC4XX) += ehci-ppc4xx.o COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o COBJS-$(CONFIG_USB_EHCI_KIRKWOOD) += ehci-kirkwood.o
drivers/usb/host/ehci-mx5.c new file +174 -0
174 lines not on this page · raw message
include/usb/ehci-fsl.h +10 -0
@@ -243,4 +243,14 @@ struct usb_ehci { u8 res14[0xafc]; }; +/* +* For MXC SOCs +*/ +#define MXC_EHCI_POWER_PINS_ENABLED (1 << 5) +#define MXC_EHCI_TTL_ENABLED (1 << 6) +#define MXC_EHCI_INTERNAL_PHY (1 << 7) + +/* Board-specific initialization */ +int board_ehci_hcd_init (int port); +#endif /* _EHCI_FSL_H */
Signature · 1 line
1.7.7.1
PATCH 3/9 USB: MX5: Abstract out mx51 USB pixmux configuration
In reply to Marek Vasut--- drivers/usb/host/ehci-mx5.c | 71 +++++++++++++++++++++++++++++++++++++++++++ include/usb/ehci-fsl.h | 6 ++++ 2 files changed, 77 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-mx5.c +71 -0
@@ -58,6 +58,77 @@/* USB_CTRL_1 */ #define MXC_USB_CTRL_UH1_EXT_CLK_EN (1 << 25) +/* USB pin configuration */ +#define USB_PAD_CONFIG (PAD_CTL_PKE_ENABLE | PAD_CTL_SRE_FAST | \ + PAD_CTL_DRV_HIGH | PAD_CTL_100K_PU | \ + PAD_CTL_HYS_ENABLE | PAD_CTL_PUE_PULL) + +#ifdef CONFIG_MX51 +/* +* Configure the MX51 USB H1 IOMUX +*/ +void setup_iomux_usb_h1 (void ) +{ +mxc_request_iomux (MX51_PIN_USBH1_STP ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_STP ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_USBH1_CLK ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_CLK ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_USBH1_DIR ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_DIR ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_USBH1_NXT ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_NXT ,USB_PAD_CONFIG ); + +mxc_request_iomux (MX51_PIN_USBH1_DATA0 ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_DATA0 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_USBH1_DATA1 ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_DATA1 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_USBH1_DATA2 ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_DATA2 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_USBH1_DATA3 ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_DATA3 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_USBH1_DATA4 ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_DATA4 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_USBH1_DATA5 ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_DATA5 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_USBH1_DATA6 ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_DATA6 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_USBH1_DATA7 ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_DATA7 ,USB_PAD_CONFIG ); +} + +/* +* Configure the MX51 USB H2 IOMUX +*/ +void setup_iomux_usb_h2 (void ) +{ +mxc_request_iomux (MX51_PIN_EIM_A24 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_A24 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_EIM_A25 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_A25 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_EIM_A26 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_A26 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_EIM_A27 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_A27 ,USB_PAD_CONFIG ); + +mxc_request_iomux (MX51_PIN_EIM_D16 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_D16 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_EIM_D17 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_D17 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_EIM_D18 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_D18 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_EIM_D19 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_D19 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_EIM_D20 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_D20 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_EIM_D21 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_D21 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_EIM_D22 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_D22 ,USB_PAD_CONFIG ); +mxc_request_iomux (MX51_PIN_EIM_D23 ,IOMUX_CONFIG_ALT2 ); +mxc_iomux_set_pad (MX51_PIN_EIM_D23 ,USB_PAD_CONFIG ); +} +#endif +int mxc_set_usbcontrol (int port,unsigned int flags) {unsigned int v;
include/usb/ehci-fsl.h +6 -0
@@ -253,4 +253,10 @@ struct usb_ehci {/* Board-specific initialization */ int board_ehci_hcd_init (int port); +/* CPU-specific abstracted-out IOMUX init */ +#ifdef CONFIG_MX51 +void setup_iomux_usb_h1 (void ); +void setup_iomux_usb_h2 (void ); +#endif +#endif /* _EHCI_FSL_H */
Signature · 1 line
1.7.7.1
PATCH 4/9 USB: MX5: Add MX5 usb post-init callback
In reply to Marek VasutThis is useful for USB Transceivers init etc.
--- drivers/usb/host/ehci-mx5.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-)
drivers/usb/host/ehci-mx5.c +12 -2
@@ -22,6 +22,7 @@#include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> #include <asm/arch/mx5x_pins.h> +#include <asm/arch/iomux.h> #include "ehci.h" #include "ehci-core.h"
@@ -198,6 +199,13 @@ int mxc_set_usbcontrol(int port, unsigned int flags)return ret; } +void __board_ehci_hcd_postinit (struct usb_ehci *ehci,int port) +{ +} + +void board_ehci_hcd_postinit (struct usb_ehci *ehci,int port) + __attribute((weak,alias ("__board_ehci_hcd_postinit" ))); +int ehci_hcd_init (void ) {struct usb_ehci *ehci;
@@ -217,7 +225,7 @@ int ehci_hcd_init(void)enable_usb_phy2_clk (1 );mdelay (1 ); -/* do board specific initialization */ +/* Do board specific initialization */ board_ehci_hcd_init (CONFIG_MXC_USB_PORT ); ehci = (struct usb_ehci *)(OTG_BASE_ADDR +
@@ -231,9 +239,11 @@ int ehci_hcd_init(void)setbits_le32 (&ehci->portsc,USB_EN );mxc_set_usbcontrol (CONFIG_MXC_USB_PORT ,CONFIG_MXC_USB_FLAGS ); -mdelay (10 ); +/* Do board specific post-initialization */ +board_ehci_hcd_postinit (ehci,CONFIG_MXC_USB_PORT ); +return 0 ; }
Signature · 1 line
1.7.7.1
PATCH 5/9 USB: mx53loco: add end enable USB host support on port 1
In reply to Marek VasutFrom: Wolfgang Grandegger <[email protected]>
--- board/freescale/mx53loco/mx53loco.c | 10 ++++++++++ include/configs/mx53loco.h | 13 +++++++++++++ 2 files changed, 23 insertions(+), 0 deletions(-)
board/freescale/mx53loco/mx53loco.c +10 -0
@@ -78,6 +78,16 @@ static void setup_iomux_uart(void) PAD_CTL_ODE_OPENDRAIN_ENABLE); } +#ifdef CONFIG_USB_EHCI_MX5 +void board_ehci_hcd_init (int port) +{ +/* request VBUS power enable pin, GPIO[8}, gpio7 */ +mxc_request_iomux (MX53_PIN_ATA_DA_2 ,IOMUX_CONFIG_ALT1 ); +gpio_direction_output (IOMUX_TO_GPIO (MX53_PIN_ATA_DA_2 ),0 ); +gpio_set_value (IOMUX_TO_GPIO (MX53_PIN_ATA_DA_2 ),1 ); +} +#endif +static void setup_iomux_fec (void ) {/*FEC_MDIO*/
include/configs/mx53loco.h +13 -0
@@ -72,6 +72,19 @@#define CONFIG_CMD_MII #define CONFIG_CMD_NET +/* USB Configs */ +#define CONFIG_CMD_USB +#define CONFIG_CMD_FAT +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX5 +#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 +/* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE #define CONFIG_CONS_INDEX 1
Signature · 1 line
1.7.7.1
PATCH 6/9 USB: mx51evk: add end enable USB host support on port 1
In reply to Marek VasutFrom: Wolfgang Grandegger <[email protected]>
--- board/freescale/mx51evk/mx51evk.c | 62 +++++++++++++++++++++++++++++++++++++ include/configs/mx51evk.h | 13 ++++++++ 2 files changed, 75 insertions(+), 0 deletions(-)
board/freescale/mx51evk/mx51evk.c +62 -0
@@ -35,6 +35,7 @@#include <pmic.h> #include <fsl_pmic.h> #include <mc13892.h> +#include <usb/ehci-fsl.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -172,6 +173,64 @@ static void setup_iomux_spi(void) }#endif +#ifdef CONFIG_USB_EHCI_MX5 +#define MX51EVK_USBH1_HUB_RST IOMUX_TO_GPIO(MX51_PIN_GPIO1_7)/* GPIO1_7 */ +#define MX51EVK_USBH1_STP IOMUX_TO_GPIO(MX51_PIN_USBH1_STP)/* GPIO1_27 */ +#define MX51EVK_USB_CLK_EN_B IOMUX_TO_GPIO(MX51_PIN_EIM_D18)/* GPIO2_1 */ +#define MX51EVK_USB_PHY_RESET IOMUX_TO_GPIO(MX51_PIN_EIM_D21)/* GPIO2_5 */ + +#define USBH1_PAD (PAD_CTL_SRE_FAST | PAD_CTL_DRV_HIGH | \ + PAD_CTL_100K_PU | PAD_CTL_PUE_PULL | \ + PAD_CTL_PKE_ENABLE | PAD_CTL_HYS_ENABLE) +#define GPIO_PAD (PAD_CTL_DRV_HIGH | PAD_CTL_PKE_ENABLE | \ + PAD_CTL_SRE_FAST) +#define NO_PAD (1 << 16) + +static void setup_usb_h1 (void ) +{ +setup_iomux_usb_h1 (); + +/* GPIO_1_7 for USBH1 hub reset */ +mxc_request_iomux (MX51_PIN_GPIO1_7 ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_GPIO1_7 ,NO_PAD ); + +/* GPIO_2_1 */ +mxc_request_iomux (MX51_PIN_EIM_D17 ,IOMUX_CONFIG_ALT1 ); +mxc_iomux_set_pad (MX51_PIN_EIM_D17 ,GPIO_PAD ); + +/* GPIO_2_5 for USB PHY reset */ +mxc_request_iomux (MX51_PIN_EIM_D21 ,IOMUX_CONFIG_ALT1 ); +mxc_iomux_set_pad (MX51_PIN_EIM_D21 ,GPIO_PAD ); +} + +void board_ehci_hcd_init (int port) +{ +/* Set USBH1_STP to GPIO and toggle it */ +mxc_request_iomux (MX51_PIN_USBH1_STP ,IOMUX_CONFIG_GPIO ); +mxc_iomux_set_pad (MX51_PIN_USBH1_STP ,USBH1_PAD ); + +gpio_direction_output (MX51EVK_USBH1_STP ,0 ); +gpio_direction_output (MX51EVK_USB_PHY_RESET ,0 ); +mdelay (10 ); +gpio_set_value (MX51EVK_USBH1_STP ,1 ); + +/* Set back USBH1_STP to be function */ +mxc_request_iomux (MX51_PIN_USBH1_STP ,IOMUX_CONFIG_ALT0 ); +mxc_iomux_set_pad (MX51_PIN_USBH1_STP ,USBH1_PAD ); + +/* De-assert USB PHY RESETB */ +gpio_set_value (MX51EVK_USB_PHY_RESET ,1 ); + +/* Drive USB_CLK_EN_B line low */ +gpio_direction_output (MX51EVK_USB_CLK_EN_B ,0 ); + +/* Reset USB hub */ +gpio_direction_output (MX51EVK_USBH1_HUB_RST ,0 ); +mdelay (2 ); +gpio_set_value (MX51EVK_USBH1_HUB_RST ,1 ); +} +#endif +static void power_init (void ) {unsigned int val;
@@ -391,6 +450,9 @@ int board_early_init_f(void) {setup_iomux_uart ();setup_iomux_fec (); +#ifdef CONFIG_USB_EHCI_MX5 +setup_usb_h1 (); +#endif return 0 ; }
include/configs/mx51evk.h +13 -0
@@ -110,6 +110,19 @@#define CONFIG_CMD_MII #define CONFIG_CMD_NET +/* USB Configs */ +#define CONFIG_CMD_USB +#define CONFIG_CMD_FAT +#define CONFIG_USB_EHCI +#define CONFIG_USB_EHCI_MX5 +#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_ULPI +#define CONFIG_MXC_USB_FLAGS MXC_EHCI_POWER_PINS_ENABLED +/* allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE #define CONFIG_CONS_INDEX 1
Signature · 1 line
1.7.7.1
PATCH 7/9 USB: EHCI: Allow EHCI post-powerup configuration in board files
In reply to Marek VasutThis patch allows USB to work on some hosts, which need additional frobing after the host was powered up via regular USB powerup sequence.
--- drivers/usb/host/ehci-hcd.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
drivers/usb/host/ehci-hcd.c +10 -2
@@ -205,6 +205,14 @@ static inline void ehci_invalidate_dcache(struct QH *qh) }#endif /* CONFIG_EHCI_DCACHE */ +void __ehci_powerup_fixup (uint32_t *status_reg,uint32_t *reg) +{ +mdelay (50 ); +} + +void ehci_powerup_fixup (uint32_t *status_reg,uint32_t *reg) + __attribute__((weak,alias ("__ehci_powerup_fixup" ))); +static int handshake (uint32_t *ptr,uint32_t mask,uint32_t done,int usec) {uint32_t result;
@@ -713,8 +721,8 @@ ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,* usb 2.0 specification say 50 ms resets on * root */ -wait_ms (50 ); -/* terminate the reset */ +ehci_powerup_fixup (status_reg, ®); +ehci_writel (status_reg, reg & ~EHCI_PS_PR );/* * A host controller must terminate the reset
Signature · 1 line
1.7.7.1
PATCH 8/9 USB: Add generic ULPI layer and a viewport
In reply to Marek VasutFrom: Jana Rapava <[email protected]>
Add partial ULPI specification implementation that should be enough to interface the ULPI PHYs in the boot loader context.
Add a viewport implementation for Chipidea/ARC based controllers.
--- Makefile | 1 + drivers/usb/ulpi/Makefile | 44 ++++++ drivers/usb/ulpi/ulpi-viewport.c | 118 +++++++++++++++ drivers/usb/ulpi/ulpi.c | 227 +++++++++++++++++++++++++++++ include/usb/ulpi.h | 298 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 688 insertions(+), 0 deletions(-) create mode 100644 drivers/usb/ulpi/Makefile create mode 100644 drivers/usb/ulpi/ulpi-viewport.c create mode 100644 drivers/usb/ulpi/ulpi.c create mode 100644 include/usb/ulpi.h
Makefile +1 -0
@@ -283,6 +283,7 @@ LIBS += drivers/usb/gadget/libusb_gadget.o LIBS += drivers/usb/host/libusb_host.o LIBS += drivers/usb/musb/libusb_musb.o LIBS += drivers/usb/phy/libusb_phy.o +LIBS += drivers/usb/ulpi/libusb_ulpi.o LIBS += drivers/video/libvideo.o LIBS += drivers/watchdog/libwatchdog.o LIBS += common/libcommon.o
drivers/usb/ulpi/Makefile new file +44 -0
44 lines not on this page · raw message
drivers/usb/ulpi/ulpi-viewport.c new file +118 -0
118 lines not on this page · raw message
drivers/usb/ulpi/ulpi.c new file +227 -0
227 lines not on this page · raw message
include/usb/ulpi.h new file +298 -0
298 lines not on this page · raw message
Signature · 1 line
1.7.7.1
PATCH 9/9 USB: efikamx: Enable USB on EfikaMX and EfikaSB
In reply to Marek Vasut--- board/efikamx/Makefile | 4 + board/efikamx/efikamx-usb.c | 210 +++++++++++++++++++++++++++++++++++++++++++ board/efikamx/efikamx.c | 15 +++ include/configs/efikamx.h | 47 +++++++++-- 4 files changed, 270 insertions(+), 6 deletions(-) create mode 100644 board/efikamx/efikamx-usb.c
board/efikamx/Makefile +4 -0
@@ -29,6 +29,10 @@ LIB = $(obj)lib$(BOARD).o COBJS := efikamx.o +ifdef CONFIG_CMD_USB +COBJS += efikamx-usb.o +endif + SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) SOBJS := $(addprefix $(obj),$(SOBJS))
board/efikamx/efikamx-usb.c new file +210 -0
210 lines not on this page · raw message
board/efikamx/efikamx.c +15 -0
@@ -535,6 +535,15 @@ static inline void setup_iomux_ata(void) { }#endif /* +* EHCI USB +*/ +#ifdef CONFIG_CMD_USB +extern void setup_iomux_usb (void ); +#else +static inline void setup_iomux_usb (void ) { } +#endif + +/* * LED configuration */ void setup_iomux_led (void )
@@ -683,6 +692,12 @@ int board_late_init(void)setup_iomux_led ();setup_iomux_ata (); +setup_iomux_usb (); + +if (machine_is_efikasb ()) +setenv ("preboot" ,"usb reset ; setenv stdin usbkbd\0" ); + +setup_iomux_led ();efikamx_toggle_led (EFIKAMX_LED_BLUE );
include/configs/efikamx.h +41 -6
70 lines not on this page · raw message
Signature · 1 line
1.7.7.1
cover MX5x USB support
In reply to Marek VasutQuoted 54 lines
This patchset adds the USB support for MX5x. Most of the code is based on work of Wolfgang Grandegger with modifications done by various other authors. I also included version of ULPI support code cleaned up by Igor Grinberg.
NOTE: I'd really love to get this code into .12 release. Remy, Wolfgang, do you think it'd be possible? I'd really help adoption of the MX5x USB code greatly as well as cleanup of the ULPI code (which is sadly in a bad shape).
Jana Rapava (1):
USB: Add generic ULPI layer and a viewportMarek Vasut (4):
USB: MX5: Abstract out mx51 USB pixmux configuration
USB: MX5: Add MX5 usb post-init callback
USB: EHCI: Allow EHCI post-powerup configuration in board files
USB: efikamx: Enable USB on EfikaMX and EfikaSBWolfgang Grandegger (4):
USB: MX5: add helper functions to enable USB clocks
USB: MX5: add generic USB EHCI support for mx51 and mx53
USB: mx53loco: add end enable USB host support on port 1
USB: mx51evk: add end enable USB host support on port 1Makefile | 1 + arch/arm/cpu/armv7/mx5/clock.c | 72 +++++++ arch/arm/include/asm/arch-mx5/clock.h | 5 + arch/arm/include/asm/arch-mx5/crm_regs.h | 3 + board/efikamx/Makefile | 4 + board/efikamx/efikamx-usb.c | 210 +++++++++++++++++++++ board/efikamx/efikamx.c | 15 ++ board/freescale/mx51evk/mx51evk.c | 62 ++++++ board/freescale/mx53loco/mx53loco.c | 10 + drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-hcd.c | 12 +- drivers/usb/host/ehci-mx5.c | 255 +++++++++++++++++++++++++ drivers/usb/ulpi/Makefile | 44 +++++ drivers/usb/ulpi/ulpi-viewport.c | 118 ++++++++++++ drivers/usb/ulpi/ulpi.c | 227 +++++++++++++++++++++++ include/configs/efikamx.h | 47 ++++- include/configs/mx51evk.h | 13 ++ include/configs/mx53loco.h | 13 ++ include/usb/ehci-fsl.h | 16 ++ include/usb/ulpi.h | 298 ++++++++++++++++++++++++++++++ 20 files changed, 1418 insertions(+), 8 deletions(-) create mode 100644 board/efikamx/efikamx-usb.c create mode 100644 drivers/usb/host/ehci-mx5.c create mode 100644 drivers/usb/ulpi/Makefile create mode 100644 drivers/usb/ulpi/ulpi-viewport.c create mode 100644 drivers/usb/ulpi/ulpi.c create mode 100644 include/usb/ulpi.h
Quoted 6 lines
Cc Igor Grinberg <[email protected]>Cc Jana Rapava <[email protected]>Cc Remy Bohmer <[email protected]>Cc Simon Glass <[email protected]>Cc Stefano Babic <[email protected]>Cc Wolfgang Grandegger <[email protected]>
If some of the patches didn't make it through gmail because of the different From:, please check git://git.denx.de/u-boot-marex.git, "usb" branch.
M
cover MX5x USB support
Hi Marek,
Quoted 3 lines
If some of the patches didn't make it through gmail because of the different From:, please check
git://git.denx.de/u-boot-marex.git, "usb" branch.
Pulling it failed. Can you please rebase it on top of current u-boot-usb, then I will pull it from there.
Kind regards,
Remy
cover MX5x USB support
In reply to Marek VasutHi Marek,
Quoted 7 lines · Marek Vasut
This patchset adds the USB support for MX5x. Most of the code is based on work of Wolfgang Grandegger with modifications done by various other authors. I also included version of ULPI support code cleaned up by Igor Grinberg.
NOTE: I'd really love to get this code into .12 release. Remy, Wolfgang, do you think it'd be possible? I'd really help adoption of the MX5x USB code greatly as well as cleanup of the ULPI code (which is sadly in a bad shape).
I will have time for a review and testing tomorrow. Anyway, we need some feedback from the USB maintainer to get these patches accepted.
Wolfgang.
cover MX5x USB support
In reply to Marek VasutHi Marek,
2011/12/7 Marek Vasut <[email protected]>:
Quoted 7 lines
This patchset adds the USB support for MX5x. Most of the code is based on work of Wolfgang Grandegger with modifications done by various other authors. I also included version of ULPI support code cleaned up by Igor Grinberg.
NOTE: I'd really love to get this code into .12 release. Remy, Wolfgang, do you think it'd be possible? I'd really help adoption of the MX5x USB code greatly as well as cleanup of the ULPI code (which is sadly in a bad shape).
I have no objections, except that it is unclear to me what version of the ULPI code is the latest version.
I see:
* 2 'v7' versions of the same patch
* 1 version without a version information as part of a 9 pieces series.
Kind regards,
Remy
cover MX5x USB support
Quoted 13 lines
Hi Marek,
2011/12/7 Marek Vasut <[email protected]>:
Quoted 9 lines
This patchset adds the USB support for MX5x. Most of the code is based on work of Wolfgang Grandegger with modifications done by various other authors. I also included version of ULPI support code cleaned up by Igor Grinberg.
NOTE: I'd really love to get this code into .12 release. Remy, Wolfgang, do you think it'd be possible? I'd really help adoption of the MX5x USB code greatly as well as cleanup of the ULPI code (which is sadly in a bad shape).
Quoted 4 lines
I have no objections, except that it is unclear to me what version of the ULPI code is the latest version.
I see:
* 2 'v7' versions of the same patch
Oh well, it is unclear to me how Jana versioned that stuff. When Igor picked it up, I think he did the v7. When I picked Igor's version, I dropped the changelog as it carried no useful information.
Quoted 1 line
* 1 version without a version information as part of a 9 pieces series.
Yea, that's the good one. I'll rebase it tonight.
M
cover MX5x USB support
Quoted 18 lines
Quoted 13 lines
Hi Marek,
2011/12/7 Marek Vasut <[email protected]>:
Quoted 9 lines
This patchset adds the USB support for MX5x. Most of the code is based on work of Wolfgang Grandegger with modifications done by various other authors. I also included version of ULPI support code cleaned up by Igor Grinberg.
NOTE: I'd really love to get this code into .12 release. Remy, Wolfgang, do you think it'd be possible? I'd really help adoption of the MX5x USB code greatly as well as cleanup of the ULPI code (which is sadly in a bad shape).
Quoted 4 lines
I have no objections, except that it is unclear to me what version of the ULPI code is the latest version.
I see:
* 2 'v7' versions of the same patch
Quoted 7 lines
Oh well, it is unclear to me how Jana versioned that stuff. When Igor picked it up, I think he did the v7. When I picked Igor's version, I dropped the changelog as it carried no useful information.
Quoted 1 line
* 1 version without a version information as part of a 9 pieces series.
Yea, that's the good one. I'll rebase it tonight.
Rebase on u-boot-usb/master and pushed to git://git.denx.de/u-boot-marex.git , branch "usb2" !
M