ehci: fix ehci pin mux init
Subsystems (6)
PATCH 1/9 ehci: fix ehci pin mux init
EHCI pin mux init fucntion is still using old #ifdef which are not defined anymore.This causes pin mux init to always set TLL settings and thus EHCI PHY mode doesn't work.
Fixing this issue by using phy_mode parameter to initialize mux settings.
--- arch/arm/mach-omap2/usb-ehci.c | 167 ++++++++++++++++++++-------------------- 1 files changed, 83 insertions(+), 84 deletions(-)
arch/arm/mach-omap2/usb-ehci.c +83 -84
@@ -68,90 +68,89 @@ static struct platform_device ehci_device = {/* * setup_ehci_io_mux - initialize IO pad mux for USBHOST */ -static void setup_ehci_io_mux (void ) +static void setup_ehci_io_mux (enum ehci_hcd_omap_mode phy_mode) { -#ifdef CONFIG_OMAP_EHCI_PHY_MODE -/* PHY mode of operation for board: 750-2083-001 -* ISP1504 connected to Port1 and Port2 -* Do Func Mux setting for 12-pin ULPI PHY mode -*/ - -/* Port1 */ -omap_cfg_reg (Y9_3430_USB1HS_PHY_STP ); -omap_cfg_reg (Y8_3430_USB1HS_PHY_CLK ); -omap_cfg_reg (AA14_3430_USB1HS_PHY_DIR ); -omap_cfg_reg (AA11_3430_USB1HS_PHY_NXT ); -omap_cfg_reg (W13_3430_USB1HS_PHY_DATA0 ); -omap_cfg_reg (W12_3430_USB1HS_PHY_DATA1 ); -omap_cfg_reg (W11_3430_USB1HS_PHY_DATA2 ); -omap_cfg_reg (Y11_3430_USB1HS_PHY_DATA3 ); -omap_cfg_reg (W9_3430_USB1HS_PHY_DATA4 ); -omap_cfg_reg (Y12_3430_USB1HS_PHY_DATA5 ); -omap_cfg_reg (W8_3430_USB1HS_PHY_DATA6 ); -omap_cfg_reg (Y13_3430_USB1HS_PHY_DATA7 ); - -/* Port2 */ -omap_cfg_reg (AA10_3430_USB2HS_PHY_STP ); -omap_cfg_reg (AA8_3430_USB2HS_PHY_CLK ); -omap_cfg_reg (AA9_3430_USB2HS_PHY_DIR ); -omap_cfg_reg (AB11_3430_USB2HS_PHY_NXT ); -omap_cfg_reg (AB10_3430_USB2HS_PHY_DATA0 ); -omap_cfg_reg (AB9_3430_USB2HS_PHY_DATA1 ); -omap_cfg_reg (W3_3430_USB2HS_PHY_DATA2 ); -omap_cfg_reg (T4_3430_USB2HS_PHY_DATA3 ); -omap_cfg_reg (T3_3430_USB2HS_PHY_DATA4 ); -omap_cfg_reg (R3_3430_USB2HS_PHY_DATA5 ); -omap_cfg_reg (R4_3430_USB2HS_PHY_DATA6 ); -omap_cfg_reg (T2_3430_USB2HS_PHY_DATA7 ); - -#else -/* Set Func mux for : -* TLL mode of operation -* 12-pin ULPI SDR TLL mode for Port1/2/3 -*/ - -/* Port1 */ -omap_cfg_reg (Y9_3430_USB1HS_TLL_STP ); -omap_cfg_reg (Y8_3430_USB1HS_TLL_CLK ); -omap_cfg_reg (AA14_3430_USB1HS_TLL_DIR ); -omap_cfg_reg (AA11_3430_USB1HS_TLL_NXT ); -omap_cfg_reg (W13_3430_USB1HS_TLL_DATA0 ); -omap_cfg_reg (W12_3430_USB1HS_TLL_DATA1 ); -omap_cfg_reg (W11_3430_USB1HS_TLL_DATA2 ); -omap_cfg_reg (Y11_3430_USB1HS_TLL_DATA3 ); -omap_cfg_reg (W9_3430_USB1HS_TLL_DATA4 ); -omap_cfg_reg (Y12_3430_USB1HS_TLL_DATA5 ); -omap_cfg_reg (W8_3430_USB1HS_TLL_DATA6 ); -omap_cfg_reg (Y13_3430_USB1HS_TLL_DATA7 ); - -/* Port2 */ -omap_cfg_reg (AA10_3430_USB2HS_TLL_STP ); -omap_cfg_reg (AA8_3430_USB2HS_TLL_CLK ); -omap_cfg_reg (AA9_3430_USB2HS_TLL_DIR ); -omap_cfg_reg (AB11_3430_USB2HS_TLL_NXT ); -omap_cfg_reg (AB10_3430_USB2HS_TLL_DATA0 ); -omap_cfg_reg (AB9_3430_USB2HS_TLL_DATA1 ); -omap_cfg_reg (W3_3430_USB2HS_TLL_DATA2 ); -omap_cfg_reg (T4_3430_USB2HS_TLL_DATA3 ); -omap_cfg_reg (T3_3430_USB2HS_TLL_DATA4 ); -omap_cfg_reg (R3_3430_USB2HS_TLL_DATA5 ); -omap_cfg_reg (R4_3430_USB2HS_TLL_DATA6 ); -omap_cfg_reg (T2_3430_USB2HS_TLL_DATA7 ); - -/* Port3 */ -omap_cfg_reg (AB3_3430_USB3HS_TLL_STP ); -omap_cfg_reg (AA6_3430_USB3HS_TLL_CLK ); -omap_cfg_reg (AA3_3430_USB3HS_TLL_DIR ); -omap_cfg_reg (Y3_3430_USB3HS_TLL_NXT ); -omap_cfg_reg (AA5_3430_USB3HS_TLL_DATA0 ); -omap_cfg_reg (Y4_3430_USB3HS_TLL_DATA1 ); -omap_cfg_reg (Y5_3430_USB3HS_TLL_DATA2 ); -omap_cfg_reg (W5_3430_USB3HS_TLL_DATA3 ); -omap_cfg_reg (AB12_3430_USB3HS_TLL_DATA4 ); -omap_cfg_reg (AB13_3430_USB3HS_TLL_DATA5 ); -omap_cfg_reg (AA13_3430_USB3HS_TLL_DATA6 ); -omap_cfg_reg (AA12_3430_USB3HS_TLL_DATA7 ); -#endif /* CONFIG_OMAP_EHCI_PHY_MODE */ +if (phy_mode ==EHCI_HCD_OMAP_MODE_PHY ) { +/* PHY mode of operation for board: 750-2083-001 +* ISP1504 connected to Port1 and Port2 +* Do Func Mux setting for 12-pin ULPI PHY mode +*/ +/* Port1 */ +omap_cfg_reg (Y9_3430_USB1HS_PHY_STP ); +omap_cfg_reg (Y8_3430_USB1HS_PHY_CLK ); +omap_cfg_reg (AA14_3430_USB1HS_PHY_DIR ); +omap_cfg_reg (AA11_3430_USB1HS_PHY_NXT ); +omap_cfg_reg (W13_3430_USB1HS_PHY_DATA0 ); +omap_cfg_reg (W12_3430_USB1HS_PHY_DATA1 ); +omap_cfg_reg (W11_3430_USB1HS_PHY_DATA2 ); +omap_cfg_reg (Y11_3430_USB1HS_PHY_DATA3 ); +omap_cfg_reg (W9_3430_USB1HS_PHY_DATA4 ); +omap_cfg_reg (Y12_3430_USB1HS_PHY_DATA5 ); +omap_cfg_reg (W8_3430_USB1HS_PHY_DATA6 ); +omap_cfg_reg (Y13_3430_USB1HS_PHY_DATA7 ); + +/* Port2 */ +omap_cfg_reg (AA10_3430_USB2HS_PHY_STP ); +omap_cfg_reg (AA8_3430_USB2HS_PHY_CLK ); +omap_cfg_reg (AA9_3430_USB2HS_PHY_DIR ); +omap_cfg_reg (AB11_3430_USB2HS_PHY_NXT ); +omap_cfg_reg (AB10_3430_USB2HS_PHY_DATA0 ); +omap_cfg_reg (AB9_3430_USB2HS_PHY_DATA1 ); +omap_cfg_reg (W3_3430_USB2HS_PHY_DATA2 ); +omap_cfg_reg (T4_3430_USB2HS_PHY_DATA3 ); +omap_cfg_reg (T3_3430_USB2HS_PHY_DATA4 ); +omap_cfg_reg (R3_3430_USB2HS_PHY_DATA5 ); +omap_cfg_reg (R4_3430_USB2HS_PHY_DATA6 ); +omap_cfg_reg (T2_3430_USB2HS_PHY_DATA7 ); + + }else { +/* Set Func mux for : +* TLL mode of operation +* 12-pin ULPI SDR TLL mode for Port1/2/3 +*/ + +/* Port1 */ +omap_cfg_reg (Y9_3430_USB1HS_TLL_STP ); +omap_cfg_reg (Y8_3430_USB1HS_TLL_CLK ); +omap_cfg_reg (AA14_3430_USB1HS_TLL_DIR ); +omap_cfg_reg (AA11_3430_USB1HS_TLL_NXT ); +omap_cfg_reg (W13_3430_USB1HS_TLL_DATA0 ); +omap_cfg_reg (W12_3430_USB1HS_TLL_DATA1 ); +omap_cfg_reg (W11_3430_USB1HS_TLL_DATA2 ); +omap_cfg_reg (Y11_3430_USB1HS_TLL_DATA3 ); +omap_cfg_reg (W9_3430_USB1HS_TLL_DATA4 ); +omap_cfg_reg (Y12_3430_USB1HS_TLL_DATA5 ); +omap_cfg_reg (W8_3430_USB1HS_TLL_DATA6 ); +omap_cfg_reg (Y13_3430_USB1HS_TLL_DATA7 ); + +/* Port2 */ +omap_cfg_reg (AA10_3430_USB2HS_TLL_STP ); +omap_cfg_reg (AA8_3430_USB2HS_TLL_CLK ); +omap_cfg_reg (AA9_3430_USB2HS_TLL_DIR ); +omap_cfg_reg (AB11_3430_USB2HS_TLL_NXT ); +omap_cfg_reg (AB10_3430_USB2HS_TLL_DATA0 ); +omap_cfg_reg (AB9_3430_USB2HS_TLL_DATA1 ); +omap_cfg_reg (W3_3430_USB2HS_TLL_DATA2 ); +omap_cfg_reg (T4_3430_USB2HS_TLL_DATA3 ); +omap_cfg_reg (T3_3430_USB2HS_TLL_DATA4 ); +omap_cfg_reg (R3_3430_USB2HS_TLL_DATA5 ); +omap_cfg_reg (R4_3430_USB2HS_TLL_DATA6 ); +omap_cfg_reg (T2_3430_USB2HS_TLL_DATA7 ); + +/* Port3 */ +omap_cfg_reg (AB3_3430_USB3HS_TLL_STP ); +omap_cfg_reg (AA6_3430_USB3HS_TLL_CLK ); +omap_cfg_reg (AA3_3430_USB3HS_TLL_DIR ); +omap_cfg_reg (Y3_3430_USB3HS_TLL_NXT ); +omap_cfg_reg (AA5_3430_USB3HS_TLL_DATA0 ); +omap_cfg_reg (Y4_3430_USB3HS_TLL_DATA1 ); +omap_cfg_reg (Y5_3430_USB3HS_TLL_DATA2 ); +omap_cfg_reg (W5_3430_USB3HS_TLL_DATA3 ); +omap_cfg_reg (AB12_3430_USB3HS_TLL_DATA4 ); +omap_cfg_reg (AB13_3430_USB3HS_TLL_DATA5 ); +omap_cfg_reg (AA13_3430_USB3HS_TLL_DATA6 ); +omap_cfg_reg (AA12_3430_USB3HS_TLL_DATA7 ); + }return ; }
@@ -172,7 +171,7 @@ void __init usb_ehci_init(enum ehci_hcd_omap_mode phy_mode,/* Setup Pin IO MUX for EHCI */ if (cpu_is_omap34xx ()) -setup_ehci_io_mux (); +setup_ehci_io_mux (phy_mode);if (platform_device_register (&ehci_device) <0 ) {printk (KERN_ERR "Unable to register HS-USB (EHCI) device\n" );
Signature · 1 line
1.6.2.4
PATCH 2/9 ehci: adding mux pin for EHCI phy reset line
GPIO135 is used as EHCI (port2) phy reset pin on Multi Media Daughter card connected to OMAP3EVM.
--- arch/arm/mach-omap2/mux.c | 2 ++ arch/arm/plat-omap/include/mach/mux.h | 1 + 2 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/mux.c +2 -0
@@ -472,6 +472,8 @@ MUX_CFG_34XX("G25_34XX_GPIO86_OUT", 0x0fc, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) MUX_CFG_34XX("AG4_34XX_GPIO134_OUT", 0x160, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) +MUX_CFG_34XX("AF4_34XX_GPIO135_OUT", 0x162, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) MUX_CFG_34XX("AE4_34XX_GPIO136_OUT", 0x164, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c,
arch/arm/plat-omap/include/mach/mux.h +1 -0
@@ -846,6 +846,7 @@ enum omap34xx_index {L8_34XX_GPIO63 ,G25_34XX_GPIO86_OUT ,AG4_34XX_GPIO134_OUT , +AF4_34XX_GPIO135_OUT ,AE4_34XX_GPIO136_OUT ,AF6_34XX_GPIO140_UP , AE6_34XX_GPIO141,
Signature · 1 line
1.6.2.4
PATCH 3/9 ehci: correct EHCI init parameters on OMAP3EVM
Multimedia Daughter card on OMAP3EVM uses port2 as EHCI port. Other ports (port1 and port3)are not used.
GPIO135 has been used as EHCI phy reset pin so the mux config is also setup.
--- arch/arm/mach-omap2/board-omap3evm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +3 -1
@@ -308,7 +308,9 @@ static void __init omap3_evm_init(void)omap_serial_init ();usb_musb_init (); -usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , true, true,57 ,61 ); +/* Setup EHCI phy reset padconfig */ +omap_cfg_reg (AF4_34XX_GPIO135_OUT ); +usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , false, true, -EINVAL ,135 );ads7846_dev_init (); }
Signature · 1 line
1.6.2.4
PATCH 4/9 ehci: fix phy_reset init in ehci probe
phy_reset is not getting updated from platform_data.
--- drivers/usb/host/ehci-omap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/host/ehci-omap.c +1 -1
@@ -33,7 +33,6 @@* - add suspend/resume * - move workarounds to board-files * - differentiate between ES2.x and ES3.x -* - make it enumerate devices */ #include <linux/platform_device.h>
@@ -590,6 +589,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)platform_set_drvdata (pdev, omap); omap->dev = &pdev->dev; + omap->phy_reset = pdata->phy_reset; omap->reset_gpio_port1 = pdata->reset_gpio_port1; omap->reset_gpio_port2 = pdata->reset_gpio_port2; omap->phy_mode = pdata->phy_mode;
Signature · 1 line
1.6.2.4
PATCH 5/9 ehci: increase timeout to fix ehci failure
Sometime during TLL reset and waiting loop for TLL reset timeouts and thus ehci init fails. Fixing this by increasing timeout value.
--- drivers/usb/host/ehci-omap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/host/ehci-omap.c +1 -1
@@ -244,7 +244,7 @@ static void omap_usb_utmi_init(struct ehci_hcd_omap *omap, u8 tll_channel_mask)*/ static int omap_start_ehc (struct ehci_hcd_omap *omap,struct usb_hcd *hcd) { -unsigned long timeout = jiffies +msecs_to_jiffies (100 ); +unsigned long timeout = jiffies +msecs_to_jiffies (1000 );unsigned reg =0 ;int ret =0 ;
Signature · 1 line
1.6.2.4
PATCH 6/9 ehci: portwise configurations
OMAP3 EHCI has three ports and we can configure port modes (PHY/TLL) on per port basis in silicon version ES3.0 onwards.
This patch modifies the existing EHCI driver to accomodate portwise mode configuration.
Changes being done:
- Pass platform_data pointer as parameter to usb_ehci_init() to avoid multiple parameters.
- Use platform_data pointer in usb-ehci.c as platform_data directly without copying it to another *pdata*.
- Initializing platform_data in all platform files with platform specific ehci parameters.
- Added port_mode[OMAP_HS_USB_PORTS]in platform_data structures.This allows to setup mux pins on per port basis.
- Added phy_reset_gpio[OMAP_HS_USB_PORTS].
--- arch/arm/mach-omap2/board-3430sdp.c | 15 +++++- arch/arm/mach-omap2/board-omap3beagle.c | 15 +++++- arch/arm/mach-omap2/board-omap3evm.c | 15 +++++- arch/arm/mach-omap2/board-omap3pandora.c | 15 +++++- arch/arm/mach-omap2/usb-ehci.c | 95 +++++++++++++++--------------- arch/arm/plat-omap/include/mach/usb.h | 12 ++-- drivers/usb/host/ehci-omap.c | 63 +++++++++++--------- 7 files changed, 145 insertions(+), 85 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +14 -1
@@ -478,6 +478,19 @@ static inline void board_smc91x_init(void)#endif +static struct ehci_hcd_omap_platform_data ehci_pdata__initconst = { + + .port_mode[0 ] =EHCI_HCD_OMAP_MODE_PHY , + .port_mode[1 ] =EHCI_HCD_OMAP_MODE_PHY , + .port_mode[2 ] =EHCI_HCD_OMAP_MODE_UNKNOWN , + + .chargepump = true, + .phy_reset = true, + .reset_gpio_port[0 ] =57 , + .reset_gpio_port[1 ] =61 , + .reset_gpio_port[2 ] = -EINVAL +}; +static void __init omap_3430sdp_init (void ) {omap3430_i2c_init ();
@@ -495,7 +508,7 @@ static void __init omap_3430sdp_init(void)omap_serial_init ();usb_musb_init ();board_smc91x_init (); -usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , true, true,57 ,61 ); +usb_ehci_init (&ehci_pdata); }static void __init omap_3430sdp_map_io (void )
arch/arm/mach-omap2/board-omap3beagle.c +14 -1
@@ -392,6 +392,19 @@ static void __init omap3beagle_flash_init(void) } } +static struct ehci_hcd_omap_platform_data ehci_pdata__initconst = { + + .port_mode[0 ] =EHCI_HCD_OMAP_MODE_PHY , + .port_mode[1 ] =EHCI_HCD_OMAP_MODE_PHY , + .port_mode[2 ] =EHCI_HCD_OMAP_MODE_UNKNOWN , + + .chargepump = true, + .phy_reset = true, + .reset_gpio_port[0 ] =57 , + .reset_gpio_port[1 ] =61 , + .reset_gpio_port[2 ] = -EINVAL +}; +static void __init omap3_beagle_init (void ) {omap3_beagle_i2c_init ();
@@ -407,7 +420,7 @@ static void __init omap3_beagle_init(void)gpio_direction_output (170 , true);usb_musb_init (); -usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , true, true,57 ,61 ); +usb_ehci_init (&ehci_pdata);omap3beagle_flash_init (); }
arch/arm/mach-omap2/board-omap3evm.c +14 -1
@@ -295,6 +295,19 @@ static struct platform_device *omap3_evm_devices[] __initdata = { &omap3evm_smc911x_device, }; +static struct ehci_hcd_omap_platform_data ehci_pdata__initconst = { + + .port_mode[0 ] =EHCI_HCD_OMAP_MODE_UNKNOWN , + .port_mode[1 ] =EHCI_HCD_OMAP_MODE_PHY , + .port_mode[2 ] =EHCI_HCD_OMAP_MODE_UNKNOWN , + + .chargepump = false, + .phy_reset = true, + .reset_gpio_port[0 ] = -EINVAL , + .reset_gpio_port[1 ] =135 , + .reset_gpio_port[2 ] = -EINVAL +}; +static void __init omap3_evm_init (void ) {omap3_evm_i2c_init ();
@@ -310,7 +323,7 @@ static void __init omap3_evm_init(void)usb_musb_init ();/* Setup EHCI phy reset padconfig */ omap_cfg_reg (AF4_34XX_GPIO135_OUT ); -usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , false, true, -EINVAL ,135 ); +usb_ehci_init (&ehci_pdata);ads7846_dev_init (); }
arch/arm/mach-omap2/board-omap3pandora.c +14 -1
@@ -384,6 +384,19 @@ static struct platform_device *omap3pandora_devices[] __initdata = { &pandora_keys_gpio, }; +static struct ehci_hcd_omap_platform_data ehci_pdata__initconst = { + + .port_mode[0 ] =EHCI_HCD_OMAP_MODE_PHY , + .port_mode[1 ] =EHCI_HCD_OMAP_MODE_UNKNOWN , + .port_mode[2 ] =EHCI_HCD_OMAP_MODE_UNKNOWN , + + .chargepump = false, + .phy_reset = true, + .reset_gpio_port[0 ] =16 , + .reset_gpio_port[1 ] = -EINVAL , + .reset_gpio_port[2 ] = -EINVAL +}; +static void __init omap3pandora_init (void ) {omap3pandora_i2c_init ();
@@ -395,7 +408,7 @@ static void __init omap3pandora_init(void)spi_register_board_info (omap3pandora_spi_board_info,ARRAY_SIZE (omap3pandora_spi_board_info));omap3pandora_ads7846_init (); -usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , false, true,16 , -EINVAL ); +usb_ehci_init (&ehci_pdata);pandora_keys_gpio_init ();usb_musb_init (); }
arch/arm/mach-omap2/usb-ehci.c +48 -47
143 lines not on this page · raw message
arch/arm/plat-omap/include/mach/usb.h +5 -7
@@ -5,6 +5,7 @@#include <mach/board.h> +#define OMAP3_HS_USB_PORTS 3enum ehci_hcd_omap_mode {EHCI_HCD_OMAP_MODE_UNKNOWN ,EHCI_HCD_OMAP_MODE_PHY ,
@@ -12,13 +13,12 @@ enum ehci_hcd_omap_mode { };struct ehci_hcd_omap_platform_data { -enum ehci_hcd_omap_mode phy_mode; +enum ehci_hcd_omap_mode port_mode[OMAP3_HS_USB_PORTS ];unsigned chargepump:1 ;unsigned phy_reset:1 ; -/* have to be valid if phy_reset is true */ -int reset_gpio_port1; -int reset_gpio_port2; +/* have to be valid if phy_reset is true and portx is in phy mode */ +int reset_gpio_port[OMAP3_HS_USB_PORTS ]; };/*-------------------------------------------------------------------------*/
@@ -45,9 +45,7 @@ struct ehci_hcd_omap_platform_data {extern void usb_musb_init (void ); -extern void usb_ehci_init (enum ehci_hcd_omap_mode phy_mode, -int chargepump,int phy_reset,int reset_gpio_port1, -int reset_gpio_port2); +extern void usb_ehci_init (struct ehci_hcd_omap_platform_data *pdata);#endif
drivers/usb/host/ehci-omap.c +36 -27
122 lines not on this page · raw message
Signature · 1 line
1.6.2.4
PATCH 7/9 omap3: Add CHIP_GE_OMAP3430ES3 for HSUSB
OMAP3 HSUSB ports can be individually programmed in PHY or TLL mode in ES3.0 onwards whereas this is not supported in ES2.1 and earlier versions.
CHIP_GE_OMAP3430ES3 is added to program this behavior at runtime.
Also updated the existing macros to use the priviously defined *_GE_* logic instead of repeating the same logic again.
--- arch/arm/plat-omap/include/mach/cpu.h | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
arch/arm/plat-omap/include/mach/cpu.h +4 -3
@@ -428,10 +428,11 @@ IS_OMAP_TYPE(3430, 0x3430)* chips at ES2 and beyond, but not, for example, any OMAP lines after * OMAP3. */ -#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ - CHIP_IS_OMAP3430ES3_0 | \ - CHIP_IS_OMAP3430ES3_1)#define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1) +#define CHIP_GE_OMAP3430ES3 (CHIP_IS_OMAP3430ES3_0 | \ + CHIP_GE_OMAP3430ES3_1) +#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ + CHIP_GE_OMAP3430ES3)int omap_chip_is (struct omap_chip_id oci);
Signature · 1 line
1.6.2.4
PATCH 8/9 ehci: Support for ES3.x
OMAP ES3.x supports portwise PHY or TLL mode of operation whereas in ES2.x all the three ports can either be in PHY mode or in TLL mode.Port3 can not be configured in PHY mode.
Port mode must be defined either PHY, TLL or UNKNOWN in platform files.Be careful of the scenario where one port is set as PHY and other in TLL but the OMAP silicon version is 2.x or earlier where this scenario is *not* supported.
Changes are :
- Setup all the bypass configuration in omap_start_ehc() based on ES version.
- Remove UHH_HOSTCONFIG programming for bypass settings in omap_usb_utmi_init()
--- drivers/usb/host/ehci-omap.c | 90 ++++++++++++++++++++++++------------------ 1 files changed, 52 insertions(+), 38 deletions(-)
drivers/usb/host/ehci-omap.c +52 -38
@@ -32,7 +32,6 @@* - move DPLL5 programming to clock fw * - add suspend/resume * - move workarounds to board-files -* - differentiate between ES2.x and ES3.x */ #include <linux/platform_device.h>
@@ -102,6 +101,9 @@#define OMAP_UHH_SYSSTATUS (0x14)#define OMAP_UHH_HOSTCONFIG (0x40)#define OMAP_UHH_HOSTCONFIG_ULPI_BYPASS (1 << 0) +#define OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS (1 << 0) +#define OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS (1 << 11) +#define OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS (1 << 12)#define OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN (1 << 2)#define OMAP_UHH_HOSTCONFIG_INCR8_BURST_EN (1 << 3)#define OMAP_UHH_HOSTCONFIG_INCR16_BURST_EN (1 << 4)
@@ -185,16 +187,6 @@ static void omap_usb_utmi_init(struct ehci_hcd_omap *omap, u8 tll_channel_mask)unsigned reg;int i; - reg =ehci_omap_readl (omap->uhh_base,OMAP_UHH_HOSTCONFIG ); - reg |=OMAP_UHH_HOSTCONFIG_ULPI_BYPASS - |OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN - |OMAP_UHH_HOSTCONFIG_INCR8_BURST_EN - |OMAP_UHH_HOSTCONFIG_INCR16_BURST_EN ; - reg &= ~OMAP_UHH_HOSTCONFIG_INCRX_ALIGN_EN ; - -/* Use UTMI Ports of TLL */ -ehci_omap_writel (omap->uhh_base,OMAP_UHH_HOSTCONFIG , reg); -/* Program the 3 TLL channels upfront */ for (i =0 ; i <OMAP_TLL_CHANNEL_COUNT ; i++) { reg =ehci_omap_readl (omap->tll_base,OMAP_TLL_CHANNEL_CONF (i));
@@ -243,7 +235,9 @@ static void omap_usb_utmi_init(struct ehci_hcd_omap *omap, u8 tll_channel_mask)*/ static int omap_start_ehc (struct ehci_hcd_omap *omap,struct usb_hcd *hcd) { +struct omap_chip_id oci =OMAP_CHIP_INIT (CHIP_GE_OMAP3430ES3 );unsigned long timeout = jiffies +msecs_to_jiffies (1000 ); +u8 tll_ch_mask =0 ;unsigned reg =0 ;int ret =0 ;
@@ -362,37 +356,58 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)ehci_omap_writel (omap->uhh_base,OMAP_UHH_SYSCONFIG , reg); -if ((omap->port_mode[0 ] ==EHCI_HCD_OMAP_MODE_PHY ) || - (omap->port_mode[1 ] ==EHCI_HCD_OMAP_MODE_PHY ) || - (omap->port_mode[2 ] ==EHCI_HCD_OMAP_MODE_PHY )) { + reg =ehci_omap_readl (omap->uhh_base,OMAP_UHH_HOSTCONFIG ); - reg =ehci_omap_readl (omap->uhh_base,OMAP_UHH_HOSTCONFIG ); +/* setup ULPI bypass and burst configurations */ + reg |= (OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN + |OMAP_UHH_HOSTCONFIG_INCR8_BURST_EN + |OMAP_UHH_HOSTCONFIG_INCR16_BURST_EN ); + reg &= ~OMAP_UHH_HOSTCONFIG_INCRX_ALIGN_EN ; - reg |= (OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN - |OMAP_UHH_HOSTCONFIG_INCR8_BURST_EN - |OMAP_UHH_HOSTCONFIG_INCR16_BURST_EN ); - reg &= ~(OMAP_UHH_HOSTCONFIG_ULPI_BYPASS - |OMAP_UHH_HOSTCONFIG_INCRX_ALIGN_EN ); +/* Bypass the TLL module for PHY mode operation */ +if (omap_chip_is (oci)) { +dev_dbg (omap->dev,"OMAP3 ES version > ES3\n" ); +if (omap->port_mode[0 ] ==EHCI_HCD_OMAP_MODE_PHY ) + reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS ; +else if (omap->port_mode[0 ] ==EHCI_HCD_OMAP_MODE_TLL ) + reg |=OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS ; -/* Bypass the TLL module for PHY mode operation */ -ehci_omap_writel (omap->uhh_base,OMAP_UHH_HOSTCONFIG , reg); -dev_dbg (omap->dev,"Entered ULPI PHY MODE: success\n" ); +if (omap->port_mode[1 ] ==EHCI_HCD_OMAP_MODE_PHY ) + reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS ; +else if (omap->port_mode[1 ] ==EHCI_HCD_OMAP_MODE_TLL ) + reg |=OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS ; + +if (omap->port_mode[2 ] ==EHCI_HCD_OMAP_MODE_PHY ) + reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS ; +else if (omap->port_mode[2 ] ==EHCI_HCD_OMAP_MODE_TLL ) + reg |=OMAP_UHH_HOSTCONFIG_ULPI_P3_BYPASS ; - }else if ((omap->port_mode[0 ] ==EHCI_HCD_OMAP_MODE_TLL ) || - (omap->port_mode[1 ] ==EHCI_HCD_OMAP_MODE_TLL ) || - (omap->port_mode[2 ] ==EHCI_HCD_OMAP_MODE_TLL )) { - -/* Enable UTMI mode for all 3 TLL channels */ -omap_usb_utmi_init (omap, -OMAP_TLL_CHANNEL_1_EN_MASK | -OMAP_TLL_CHANNEL_2_EN_MASK | -OMAP_TLL_CHANNEL_3_EN_MASK - ); }else { -dev_err (hcd->self.controller, -"UNKOWN mode requested\n" ); - ret = -EINVAL ; - goto err_unknown_mode; +dev_dbg (omap->dev,"OMAP3 ES version < ES3\n" ); +if ((omap->port_mode[0 ] ==EHCI_HCD_OMAP_MODE_PHY ) || + (omap->port_mode[1 ] ==EHCI_HCD_OMAP_MODE_PHY ) || + (omap->port_mode[2 ] ==EHCI_HCD_OMAP_MODE_PHY )) + reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_BYPASS ; +else + reg |=OMAP_UHH_HOSTCONFIG_ULPI_BYPASS ; + } +ehci_omap_writel (omap->uhh_base,OMAP_UHH_HOSTCONFIG , reg); +dev_dbg (omap->dev,"UHH setup done, uhh_base=%x\n" , reg); + + +if ((omap->port_mode[0 ] ==EHCI_HCD_OMAP_MODE_TLL ) || + (omap->port_mode[1 ] ==EHCI_HCD_OMAP_MODE_TLL ) || + (omap->port_mode[2 ] ==EHCI_HCD_OMAP_MODE_TLL )) { + +if (omap->port_mode[0 ] ==EHCI_HCD_OMAP_MODE_TLL ) + tll_ch_mask |=OMAP_TLL_CHANNEL_1_EN_MASK ; +if (omap->port_mode[1 ] ==EHCI_HCD_OMAP_MODE_TLL ) + tll_ch_mask |=OMAP_TLL_CHANNEL_2_EN_MASK ; +if (omap->port_mode[2 ] ==EHCI_HCD_OMAP_MODE_TLL ) + tll_ch_mask |=OMAP_TLL_CHANNEL_3_EN_MASK ; + +/* Enable UTMI mode for required TLL channels */ +omap_usb_utmi_init (omap, tll_ch_mask); }if (omap->phy_reset) {
@@ -430,7 +445,6 @@ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd *hcd)return 0 ; -err_unknown_mode: err_sys_status:clk_disable (omap->usbtll_ick);clk_put (omap->usbtll_ick);
Signature · 1 line
1.6.2.4
PATCH 9/9 ehci: update driver with generic change
Update the OMAP EHCI driver in accordance with below patch introduced in generic EHCI driver.
commit: b18ffd49e86102a9ed0a1cc83fdafe3891e844e5
USB: EHCI: update toggle state for linked QHs
--- drivers/usb/host/ehci-omap.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-omap.c +1 -0
@@ -761,6 +761,7 @@ static const struct hc_driver ehci_omap_hc_driver = { .urb_enqueue = ehci_urb_enqueue, .urb_dequeue = ehci_urb_dequeue, .endpoint_disable = ehci_endpoint_disable, + .endpoint_reset = ehci_endpoint_reset,/* * scheduling support
Signature · 1 line
1.6.2.4
Re: [PATCH 7/9] omap3: Add CHIP_GE_OMAP3430ES3 for HSUSB
In reply to Ajay Kumar GuptaQuoted 20 lines · ext Ajay Kumar Gupta
OMAP3 HSUSB ports can be individually programmed in PHY or TLL mode in ES3.0 onwards whereas this is not supported in ES2.1 and earlier versions.
CHIP_GE_OMAP3430ES3is added to program this behavior at runtime.Also updated the existing macros to use the priviously defined *_GE_* logic instead of repeating the same logic again.
Signed-off-by Ajay Kumar Gupta <[email protected]>--- arch/arm/plat-omap/include/mach/cpu.h | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)arch/arm/plat-omap/include/mach/cpu.h +0
-0@@ -428,10 +428,11 @@ IS_OMAP_TYPE(3430, 0x3430)* chips at ES2 and beyond, but not, for example, any OMAP lines after
arch/arm/plat-omap/include/mach/cpu.h IS_OMAP_TYPE(3430, 0x3430) · line 435
Quoted 10 lines
arch/arm/plat-omap/include/mach/cpu.h +4
-3* OMAP3. */ -#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ - CHIP_IS_OMAP3430ES3_0 | \ - CHIP_IS_OMAP3430ES3_1)#define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1) +#define CHIP_GE_OMAP3430ES3 (CHIP_IS_OMAP3430ES3_0 | \ + CHIP_GE_OMAP3430ES3_1) +#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ + CHIP_GE_OMAP3430ES3)
Tony, what about this one ? Do you agree with it ? I need this in order to get a buildable driver merged through linux-usb. The usb-ehci.c stuff I can postpone to be sent later but without this, ehci-omap.c won't build.
any input is appreciated.
Signature · 1 line
balbi
Tony Lindgren
maintainerRe: [PATCH 7/9] omap3: Add CHIP_GE_OMAP3430ES3 for HSUSB
Quoted 37 lines · Felipe Balbi
Quoted 20 lines · ext Ajay Kumar Gupta
OMAP3 HSUSB ports can be individually programmed in PHY or TLL mode in ES3.0 onwards whereas this is not supported in ES2.1 and earlier versions.
CHIP_GE_OMAP3430ES3is added to program this behavior at runtime.Also updated the existing macros to use the priviously defined *_GE_* logic instead of repeating the same logic again.
Signed-off-by Ajay Kumar Gupta <[email protected]>--- arch/arm/plat-omap/include/mach/cpu.h | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)arch/arm/plat-omap/include/mach/cpu.h +0
-0@@ -428,10 +428,11 @@ IS_OMAP_TYPE(3430, 0x3430)* chips at ES2 and beyond, but not, for example, any OMAP lines after arch/arm/plat-omap/include/mach/cpu.h IS_OMAP_TYPE(3430, 0x3430) · line 435
Quoted 10 lines
arch/arm/plat-omap/include/mach/cpu.h +4
-3* OMAP3. */ -#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ - CHIP_IS_OMAP3430ES3_0 | \ - CHIP_IS_OMAP3430ES3_1)#define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1) +#define CHIP_GE_OMAP3430ES3 (CHIP_IS_OMAP3430ES3_0 | \ + CHIP_GE_OMAP3430ES3_1) +#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \ + CHIP_GE_OMAP3430ES3)Tony, what about this one ? Do you agree with it ? I need this in order to get a buildable driver merged through linux-usb. The
usb-ehci.cstuff I can postpone to be sent later but without this,ehci-omap.cwon't build.
Quoted 1 line
any input is appreciated.
Yeh looks OK to me.
Tony
Tony Lindgren
maintainerRe: [PATCH 5/9] ehci: increase timeout to fix ehci failure
In reply to Ajay Kumar GuptaQuoted 2 lines · Ajay Kumar Gupta
Sometime during TLL reset and waiting loop for TLL reset timeouts and thus ehci init fails. Fixing this by increasing timeout value.
Applying patches 6 - 9 to ehci branch also.
Tony
Quoted 26 lines
Signed-off-by Ajay Kumar Gupta <[email protected]>Signed-off-by Felipe Balbi <[email protected]>--- drivers/usb/host/ehci-omap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/usb/host/ehci-omap.c +1
-1@@ -244,7 +244,7 @@ static void omap_usb_utmi_init(struct ehci_hcd_omap *omap, u8 tll_channel_mask)*/ static int omap_start_ehc (struct ehci_hcd_omap *omap,struct usb_hcd *hcd) { -unsigned long timeout = jiffies +msecs_to_jiffies (100 ); +unsigned long timeout = jiffies +msecs_to_jiffies (1000 );unsigned reg =0 ;int ret =0 ;Signature · 6 lines
1.6.2.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 5/9] ehci: increase timeout to fix ehci failure
Tony,
Quoted 6 lines · Ajay Kumar Gupta
Quoted 1 line
Sometime during TLL reset and waiting loop for TLL reset timeouts and
thus
Quoted 1 line
ehci init fails. Fixing this by increasing timeout value.
Applying patches 6 - 9 to ehci branch also.
One patch is missing which causes compilation error. [0002-omap3-Add-CHIP_GE_OMAP3430ES3-for-HSUSB.patch]
Apart from this I have two more EHCI fixes and one patch to fix compilation warning on OMAP3EVM.
I am submitting all four patches , Please review them.
-Ajay
Quoted 31 lines
Tony
drivers/usb/host/ehci-omap.c static void omap_usb_utmi_init(struct ehci_hcd_omap
Quoted 11 lines
Signed-off-by Ajay Kumar Gupta <[email protected]>Signed-off-by Felipe Balbi <[email protected]>--- drivers/usb/host/ehci-omap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/usb/host/ehci-omap.c +0
-0@@ -244,7 +244,7 @@ static void omap_usb_utmi_init(struct ehci_hcd_omap*omap, u8
tll_channel_mask)drivers/usb/host/ehci-omap.c static void omap_usb_utmi_init(struct ehci_hcd_omap · line 245
Quoted 2 lines
drivers/usb/host/ehci-omap.c +0
-0*/ static int omap_start_ehc(struct ehci_hcd_omap *omap, struct usb_hcd*hcd)
Quoted 13 lines
drivers/usb/host/ehci-omap.c +1
-2{ -unsigned long timeout = jiffies +msecs_to_jiffies (100 ); +unsigned long timeout = jiffies +msecs_to_jiffies (1000 );unsigned reg =0 ;int ret =0 ; --1.6.2.4
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Tony Lindgren
maintainerRe: [PATCH 5/9] ehci: increase timeout to fix ehci failure
Quoted 10 lines · Gupta, Ajay Kumar
Tony,
Quoted 6 lines · Ajay Kumar Gupta
Quoted 1 line
Sometime during TLL reset and waiting loop for TLL reset timeouts and
thus
Quoted 1 line
ehci init fails. Fixing this by increasing timeout value.
Applying patches 6 - 9 to ehci branch also.
One patch is missing which causes compilation error. [0002-omap3-Add-CHIP_GE_OMAP3430ES3-for-HSUSB.patch]
OK, after looking at the "ehci: Support for ES3.x" patch more, how about just testing the revision with:
if (omap_rev() == OMAP3430_REV_ES3_1) {
/* Set something */
}That means the 0002-omap3-Add-CHIP_GE_OMAP3430ES3-for-HSUSB.patch is not needed.
So I'm dropping the "ehci: Support for ES3.x" patch for now.
Quoted 3 lines
Apart from this I have two more EHCI fixes and one patch to fix compilation warning on OMAP3EVM.
I am submitting all four patches , Please review them.
Pushing the others to the ehci branch.
Tony
Tony Lindgren
maintainerRe: [PATCH 4/9] ehci: fix phy_reset init in ehci probe
In reply to Ajay Kumar GuptaQuoted 1 line · Ajay Kumar Gupta
phy_resetis not getting updated fromplatform_data.
Adding to ehci branch.
Tony
Quoted 32 lines
Signed-off-by Ajay Kumar Gupta <[email protected]>--- drivers/usb/host/ehci-omap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/usb/host/ehci-omap.c +1
-1@@ -33,7 +33,6 @@* - add suspend/resume * - move workarounds to board-files * - differentiate between ES2.x and ES3.x -* - make it enumerate devices */ #include <linux/platform_device.h> @@ -590,6 +589,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)platform_set_drvdata (pdev, omap); omap->dev = &pdev->dev; + omap->phy_reset = pdata->phy_reset; omap->reset_gpio_port1 = pdata->reset_gpio_port1; omap->reset_gpio_port2 = pdata->reset_gpio_port2; omap->phy_mode = pdata->phy_mode;Signature · 6 lines
1.6.2.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Tony Lindgren
maintainerRe: [PATCH 3/9] ehci: correct EHCI init parameters on OMAP3EVM
In reply to Ajay Kumar GuptaQuoted 16 lines · Ajay Kumar Gupta
Multimedia Daughter card on OMAP3EVM uses port2 as EHCI port. Other ports (port1 and port3)are not used.
GPIO135 has been used as EHCI phy reset pin so the mux config is also setup.
Signed-off-by Ajay Kumar Gupta <[email protected]>--- arch/arm/mach-omap2/board-omap3evm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)arch/arm/mach-omap2/board-omap3evm.c +0
-0
arch/arm/mach-omap2/board-omap3evm.c static void __init omap3_evm_init(void) · line 315
Quoted 9 lines
arch/arm/mach-omap2/board-omap3evm.c +3
-1@@ -308,7 +308,9 @@ static void __init omap3_evm_init(void)omap_serial_init ();usb_musb_init (); -usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , true, true,57 ,61 ); +/* Setup EHCI phy reset padconfig */ +omap_cfg_reg (AF4_34XX_GPIO135_OUT ); +usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , false, true, -EINVAL ,135 );ads7846_dev_init (); }
Is this safe to do if you don't have the daughter card? If so, maybe add a comment for it.
I guess the nicest thing would be to wait until the daughter card is probed based on some I2C chip id and only then mux the pins.
Tony
RE: [PATCH 3/9] ehci: correct EHCI init parameters on OMAP3EVM
Quoted 7 lines
arch/arm/mach-
Quoted 1 line
arch/arm/mach- renamed from arch/arm/mach-omap2/board-omap3evm.c +0
-0
omap2/board-omap3evm.cQuoted 5 lines
index 595beac..b497979 100644
arch/arm/mach-omap2/board-omap3evm.c +0
-0@@ -308,7 +308,9 @@ static void __init omap3_evm_init(void)
Quoted 11 lines
arch/arm/mach-omap2/board-omap3evm.c static void __init omap3_evm_init(void) · line 315
Quoted 8 lines
arch/arm/mach-omap2/board-omap3evm.c +3
-1omap_serial_init ();usb_musb_init (); -usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , true, true,57 ,61 ); +/* Setup EHCI phy reset padconfig */ +omap_cfg_reg (AF4_34XX_GPIO135_OUT ); +usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , false, true, -EINVAL ,135 );ads7846_dev_init (); }Is this safe to do if you don't have the daughter card? If so, maybe add a comment for it.
Yes, it is safe for OMAP3EVM even if there is no DC but we can add comment as you suggested.
Quoted 3 lines
I guess the nicest thing would be to wait until the daughter card is probed based on some I2C chip id and only then mux the pins.
I agree that this would be the best but this requires OMAP3EVM DC related patch from Vaibhav which is still under review.
I feel we can add this logic once other dependent patches are accepted.
-Ajay
Quoted 2 lines
Tony
Tony Lindgren
maintainerRe: [PATCH 3/9] ehci: correct EHCI init parameters on OMAP3EVM
In reply to Ajay Kumar GuptaQuoted 5 lines · Ajay Kumar Gupta
Multimedia Daughter card on OMAP3EVM uses port2 as EHCI port. Other ports (port1 and port3)are not used.
GPIO135 has been used as EHCI phy reset pin so the mux config is also setup.
Adding this to ehci branch.
Tony
Quoted 27 lines
Signed-off-by Ajay Kumar Gupta <[email protected]>--- arch/arm/mach-omap2/board-omap3evm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)arch/arm/mach-omap2/board-omap3evm.c +3
-1@@ -308,7 +308,9 @@ static void __init omap3_evm_init(void)omap_serial_init ();usb_musb_init (); -usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , true, true,57 ,61 ); +/* Setup EHCI phy reset padconfig */ +omap_cfg_reg (AF4_34XX_GPIO135_OUT ); +usb_ehci_init (EHCI_HCD_OMAP_MODE_PHY , false, true, -EINVAL ,135 );ads7846_dev_init (); }Signature · 6 lines
1.6.2.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Tony Lindgren
maintainerRe: [PATCH 2/9] ehci: adding mux pin for EHCI phy reset line
In reply to Ajay Kumar GuptaQuoted 2 lines · Ajay Kumar Gupta
GPIO135 is used as EHCI (port2) phy reset pin on Multi Media Daughter card connected to OMAP3EVM.
Adding this to omap-fixes branch.
Tony
Quoted 38 lines
Signed-off-by Ajay Kumar Gupta <[email protected]>--- arch/arm/mach-omap2/mux.c | 2 ++ arch/arm/plat-omap/include/mach/mux.h | 1 + 2 files changed, 3 insertions(+), 0 deletions(-)arch/arm/mach-omap2/mux.c +2
-0@@ -472,6 +472,8 @@ MUX_CFG_34XX("G25_34XX_GPIO86_OUT", 0x0fc, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) MUX_CFG_34XX("AG4_34XX_GPIO134_OUT", 0x160, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) +MUX_CFG_34XX("AF4_34XX_GPIO135_OUT", 0x162, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) MUX_CFG_34XX("AE4_34XX_GPIO136_OUT", 0x164, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c,arch/arm/plat-omap/include/mach/mux.h +1
-0@@ -846,6 +846,7 @@ enum omap34xx_index {L8_34XX_GPIO63 ,G25_34XX_GPIO86_OUT ,AG4_34XX_GPIO134_OUT , +AF4_34XX_GPIO135_OUT ,AE4_34XX_GPIO136_OUT ,AF6_34XX_GPIO140_UP , AE6_34XX_GPIO141,Signature · 6 lines
1.6.2.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Tony Lindgren
maintainerHi,
Quoted 179 lines · Ajay Kumar Gupta
EHCI pin mux init fucntion is still using old #ifdef which are not defined anymore.This causes pin mux init to always set TLL settings and thus EHCI PHY mode doesn't work.
Fixing this issue by using
phy_modeparameter to initialize mux settings.Signed-off-by Ajay Kumar Gupta <[email protected]>Signed-off-by Felipe Balbi <[email protected]>--- arch/arm/mach-omap2/usb-ehci.c | 167 ++++++++++++++++++++-------------------- 1 files changed, 83 insertions(+), 84 deletions(-)arch/arm/mach-omap2/usb-ehci.c +75
-83@@ -68,90 +68,89 @@ static struct platform_device ehci_device = {/* * setup_ehci_io_mux - initialize IO pad mux for USBHOST */ -static void setup_ehci_io_mux (void ) +static void setup_ehci_io_mux (enum ehci_hcd_omap_mode phy_mode) { -#ifdef CONFIG_OMAP_EHCI_PHY_MODE -/* PHY mode of operation for board: 750-2083-001 -* ISP1504 connected to Port1 and Port2 -* Do Func Mux setting for 12-pin ULPI PHY mode -*/ - -/* Port1 */ -omap_cfg_reg (Y9_3430_USB1HS_PHY_STP ); -omap_cfg_reg (Y8_3430_USB1HS_PHY_CLK ); -omap_cfg_reg (AA14_3430_USB1HS_PHY_DIR ); -omap_cfg_reg (AA11_3430_USB1HS_PHY_NXT ); -omap_cfg_reg (W13_3430_USB1HS_PHY_DATA0 ); -omap_cfg_reg (W12_3430_USB1HS_PHY_DATA1 ); -omap_cfg_reg (W11_3430_USB1HS_PHY_DATA2 ); -omap_cfg_reg (Y11_3430_USB1HS_PHY_DATA3 ); -omap_cfg_reg (W9_3430_USB1HS_PHY_DATA4 ); -omap_cfg_reg (Y12_3430_USB1HS_PHY_DATA5 ); -omap_cfg_reg (W8_3430_USB1HS_PHY_DATA6 ); -omap_cfg_reg (Y13_3430_USB1HS_PHY_DATA7 ); - -/* Port2 */ -omap_cfg_reg (AA10_3430_USB2HS_PHY_STP ); -omap_cfg_reg (AA8_3430_USB2HS_PHY_CLK ); -omap_cfg_reg (AA9_3430_USB2HS_PHY_DIR ); -omap_cfg_reg (AB11_3430_USB2HS_PHY_NXT ); -omap_cfg_reg (AB10_3430_USB2HS_PHY_DATA0 ); -omap_cfg_reg (AB9_3430_USB2HS_PHY_DATA1 ); -omap_cfg_reg (W3_3430_USB2HS_PHY_DATA2 ); -omap_cfg_reg (T4_3430_USB2HS_PHY_DATA3 ); -omap_cfg_reg (T3_3430_USB2HS_PHY_DATA4 ); -omap_cfg_reg (R3_3430_USB2HS_PHY_DATA5 ); -omap_cfg_reg (R4_3430_USB2HS_PHY_DATA6 ); -omap_cfg_reg (T2_3430_USB2HS_PHY_DATA7 ); - -#else -/* Set Func mux for : -* TLL mode of operation -* 12-pin ULPI SDR TLL mode for Port1/2/3 -*/ - -/* Port1 */ -omap_cfg_reg (Y9_3430_USB1HS_TLL_STP ); -omap_cfg_reg (Y8_3430_USB1HS_TLL_CLK ); -omap_cfg_reg (AA14_3430_USB1HS_TLL_DIR ); -omap_cfg_reg (AA11_3430_USB1HS_TLL_NXT ); -omap_cfg_reg (W13_3430_USB1HS_TLL_DATA0 ); -omap_cfg_reg (W12_3430_USB1HS_TLL_DATA1 ); -omap_cfg_reg (W11_3430_USB1HS_TLL_DATA2 ); -omap_cfg_reg (Y11_3430_USB1HS_TLL_DATA3 ); -omap_cfg_reg (W9_3430_USB1HS_TLL_DATA4 ); -omap_cfg_reg (Y12_3430_USB1HS_TLL_DATA5 ); -omap_cfg_reg (W8_3430_USB1HS_TLL_DATA6 ); -omap_cfg_reg (Y13_3430_USB1HS_TLL_DATA7 ); - -/* Port2 */ -omap_cfg_reg (AA10_3430_USB2HS_TLL_STP ); -omap_cfg_reg (AA8_3430_USB2HS_TLL_CLK ); -omap_cfg_reg (AA9_3430_USB2HS_TLL_DIR ); -omap_cfg_reg (AB11_3430_USB2HS_TLL_NXT ); -omap_cfg_reg (AB10_3430_USB2HS_TLL_DATA0 ); -omap_cfg_reg (AB9_3430_USB2HS_TLL_DATA1 ); -omap_cfg_reg (W3_3430_USB2HS_TLL_DATA2 ); -omap_cfg_reg (T4_3430_USB2HS_TLL_DATA3 ); -omap_cfg_reg (T3_3430_USB2HS_TLL_DATA4 ); -omap_cfg_reg (R3_3430_USB2HS_TLL_DATA5 ); -omap_cfg_reg (R4_3430_USB2HS_TLL_DATA6 ); -omap_cfg_reg (T2_3430_USB2HS_TLL_DATA7 ); - -/* Port3 */ -omap_cfg_reg (AB3_3430_USB3HS_TLL_STP ); -omap_cfg_reg (AA6_3430_USB3HS_TLL_CLK ); -omap_cfg_reg (AA3_3430_USB3HS_TLL_DIR ); -omap_cfg_reg (Y3_3430_USB3HS_TLL_NXT ); -omap_cfg_reg (AA5_3430_USB3HS_TLL_DATA0 ); -omap_cfg_reg (Y4_3430_USB3HS_TLL_DATA1 ); -omap_cfg_reg (Y5_3430_USB3HS_TLL_DATA2 ); -omap_cfg_reg (W5_3430_USB3HS_TLL_DATA3 ); -omap_cfg_reg (AB12_3430_USB3HS_TLL_DATA4 ); -omap_cfg_reg (AB13_3430_USB3HS_TLL_DATA5 ); -omap_cfg_reg (AA13_3430_USB3HS_TLL_DATA6 ); -omap_cfg_reg (AA12_3430_USB3HS_TLL_DATA7 ); -#endif /* CONFIG_OMAP_EHCI_PHY_MODE */ +if (phy_mode ==EHCI_HCD_OMAP_MODE_PHY ) { +/* PHY mode of operation for board: 750-2083-001 +* ISP1504 connected to Port1 and Port2 +* Do Func Mux setting for 12-pin ULPI PHY mode +*/ +/* Port1 */ +omap_cfg_reg (Y9_3430_USB1HS_PHY_STP ); +omap_cfg_reg (Y8_3430_USB1HS_PHY_CLK ); +omap_cfg_reg (AA14_3430_USB1HS_PHY_DIR ); +omap_cfg_reg (AA11_3430_USB1HS_PHY_NXT ); +omap_cfg_reg (W13_3430_USB1HS_PHY_DATA0 ); +omap_cfg_reg (W12_3430_USB1HS_PHY_DATA1 ); +omap_cfg_reg (W11_3430_USB1HS_PHY_DATA2 ); +omap_cfg_reg (Y11_3430_USB1HS_PHY_DATA3 ); +omap_cfg_reg (W9_3430_USB1HS_PHY_DATA4 ); +omap_cfg_reg (Y12_3430_USB1HS_PHY_DATA5 ); +omap_cfg_reg (W8_3430_USB1HS_PHY_DATA6 ); +omap_cfg_reg (Y13_3430_USB1HS_PHY_DATA7 ); + +/* Port2 */ +omap_cfg_reg (AA10_3430_USB2HS_PHY_STP ); +omap_cfg_reg (AA8_3430_USB2HS_PHY_CLK ); +omap_cfg_reg (AA9_3430_USB2HS_PHY_DIR ); +omap_cfg_reg (AB11_3430_USB2HS_PHY_NXT ); +omap_cfg_reg (AB10_3430_USB2HS_PHY_DATA0 ); +omap_cfg_reg (AB9_3430_USB2HS_PHY_DATA1 ); +omap_cfg_reg (W3_3430_USB2HS_PHY_DATA2 ); +omap_cfg_reg (T4_3430_USB2HS_PHY_DATA3 ); +omap_cfg_reg (T3_3430_USB2HS_PHY_DATA4 ); +omap_cfg_reg (R3_3430_USB2HS_PHY_DATA5 ); +omap_cfg_reg (R4_3430_USB2HS_PHY_DATA6 ); +omap_cfg_reg (T2_3430_USB2HS_PHY_DATA7 ); + + }else { +/* Set Func mux for : +* TLL mode of operation +* 12-pin ULPI SDR TLL mode for Port1/2/3 +*/ + +/* Port1 */ +omap_cfg_reg (Y9_3430_USB1HS_TLL_STP ); +omap_cfg_reg (Y8_3430_USB1HS_TLL_CLK ); +omap_cfg_reg (AA14_3430_USB1HS_TLL_DIR ); +omap_cfg_reg (AA11_3430_USB1HS_TLL_NXT ); +omap_cfg_reg (W13_3430_USB1HS_TLL_DATA0 ); +omap_cfg_reg (W12_3430_USB1HS_TLL_DATA1 ); +omap_cfg_reg (W11_3430_USB1HS_TLL_DATA2 ); +omap_cfg_reg (Y11_3430_USB1HS_TLL_DATA3 ); +omap_cfg_reg (W9_3430_USB1HS_TLL_DATA4 ); +omap_cfg_reg (Y12_3430_USB1HS_TLL_DATA5 ); +omap_cfg_reg (W8_3430_USB1HS_TLL_DATA6 ); +omap_cfg_reg (Y13_3430_USB1HS_TLL_DATA7 ); + +/* Port2 */ +omap_cfg_reg (AA10_3430_USB2HS_TLL_STP ); +omap_cfg_reg (AA8_3430_USB2HS_TLL_CLK ); +omap_cfg_reg (AA9_3430_USB2HS_TLL_DIR ); +omap_cfg_reg (AB11_3430_USB2HS_TLL_NXT ); +omap_cfg_reg (AB10_3430_USB2HS_TLL_DATA0 ); +omap_cfg_reg (AB9_3430_USB2HS_TLL_DATA1 ); +omap_cfg_reg (W3_3430_USB2HS_TLL_DATA2 ); +omap_cfg_reg (T4_3430_USB2HS_TLL_DATA3 ); +omap_cfg_reg (T3_3430_USB2HS_TLL_DATA4 ); +omap_cfg_reg (R3_3430_USB2HS_TLL_DATA5 ); +omap_cfg_reg (R4_3430_USB2HS_TLL_DATA6 ); +omap_cfg_reg (T2_3430_USB2HS_TLL_DATA7 ); + +/* Port3 */ +omap_cfg_reg (AB3_3430_USB3HS_TLL_STP ); +omap_cfg_reg (AA6_3430_USB3HS_TLL_CLK ); +omap_cfg_reg (AA3_3430_USB3HS_TLL_DIR ); +omap_cfg_reg (Y3_3430_USB3HS_TLL_NXT ); +omap_cfg_reg (AA5_3430_USB3HS_TLL_DATA0 ); +omap_cfg_reg (Y4_3430_USB3HS_TLL_DATA1 );
arch/arm/mach-omap2/usb-ehci.c static struct platform_device ehci_device = { · line 156
Quoted 10 lines
arch/arm/mach-omap2/usb-ehci.c +7
-0+omap_cfg_reg (Y5_3430_USB3HS_TLL_DATA2 ); +omap_cfg_reg (W5_3430_USB3HS_TLL_DATA3 ); +omap_cfg_reg (AB12_3430_USB3HS_TLL_DATA4 ); +omap_cfg_reg (AB13_3430_USB3HS_TLL_DATA5 ); +omap_cfg_reg (AA13_3430_USB3HS_TLL_DATA6 ); +omap_cfg_reg (AA12_3430_USB3HS_TLL_DATA7 ); + }return ; }
Hmm, is this safe to do? Or does it remember on the number of data lines that the transceiver uses? If so, maybe something like the recent mmc muxing could be done where the number of pins is passed from platform_data.
This is assuming that the data lines do not have alternative pins.. In that case only the common pins can be muxed and the rest would have to be muxed in the board-*.c files.
Regards,
Tony
Quoted 16 lines
arch/arm/mach-omap2/usb-ehci.c +1
-1@@ -172,7 +171,7 @@ void __init usb_ehci_init(enum ehci_hcd_omap_mode phy_mode,/* Setup Pin IO MUX for EHCI */ if (cpu_is_omap34xx ()) -setup_ehci_io_mux (); +setup_ehci_io_mux (phy_mode);if (platform_device_register (&ehci_device) <0 ) {printk (KERN_ERR "Unable to register HS-USB (EHCI) device\n" );Signature · 6 lines
1.6.2.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines
Quoted 7 lines
arch/arm/mach-omap2/usb-ehci.c +6
-0+omap_cfg_reg (W5_3430_USB3HS_TLL_DATA3 ); +omap_cfg_reg (AB12_3430_USB3HS_TLL_DATA4 ); +omap_cfg_reg (AB13_3430_USB3HS_TLL_DATA5 ); +omap_cfg_reg (AA13_3430_USB3HS_TLL_DATA6 ); +omap_cfg_reg (AA12_3430_USB3HS_TLL_DATA7 ); + }
Quoted 6 lines
Quoted 2 lines
return;
}Hmm, is this safe to do? Or does it remember on the number of data lines that the transceiver uses? If so, maybe something like the recent mmc muxing could be done where the number of pins is passed from > >
platform_data.
This is actually done in "PATCH[6/9] ehci: portwise configurations" where number of ports is being passed from platform files and muxing is done only for required lines.
Quoted 3 lines
This is assuming that the data lines do not have alternative pins.. In
that case only the common pins can be muxed and the rest would have to be > muxed in the board-*.c files.
These are common pins for HS USB ports 1/2/3 but muxing board specific pins such as PHY RESET is getting done in board-*.c files only.
Quoted 23 lines
Regards,
Tony
Review void __init usb_ehci_init(enum ehci_hcd_omap_mode
Quoted 1 line
(quoted diff) +0
-0@@ -172,7 +171,7 @@ void __init usb_ehci_init(enum ehci_hcd_omap_mode
phy_mode,Quoted 15 lines
arch/arm/mach-omap2/usb-ehci.c +1
-2/* Setup Pin IO MUX for EHCI */ if (cpu_is_omap34xx ()) -setup_ehci_io_mux (); +setup_ehci_io_mux (phy_mode);if (platform_device_register (&ehci_device) <0 ) {printk (KERN_ERR "Unable to register HS-USB (EHCI) device\n" ); --1.6.2.4
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 20 lines
Quoted 7 lines
Quoted 7 lines
arch/arm/mach-omap2/usb-ehci.c +6
-0+omap_cfg_reg (W5_3430_USB3HS_TLL_DATA3 ); +omap_cfg_reg (AB12_3430_USB3HS_TLL_DATA4 ); +omap_cfg_reg (AB13_3430_USB3HS_TLL_DATA5 ); +omap_cfg_reg (AA13_3430_USB3HS_TLL_DATA6 ); +omap_cfg_reg (AA12_3430_USB3HS_TLL_DATA7 ); + }Quoted 7 lines
Quoted 2 lines
return;
}Hmm, is this safe to do? Or does it remember on the number of data lines that the transceiver uses? If so, maybe something like the recent mmc muxing could be done where the number of pins is passed from
platform_data.This is actually done in "PATCH[6/9] ehci: portwise configurations" where number of ports is being passed from platform files and muxing is done only for required lines.
Quoted 1 line
Quoted 9 lines
Quoted 2 lines
This is assuming that the data lines do not have alternative pins.. In that case only the common pins can be muxed and the rest
would have to be > muxed in the board-*.c files.
These are common pins for HS USB ports 1/2/3 but muxing board specific pins such as PHY RESET is getting done in board-*.c files only.
Quoted 1 line
At the very least, some pins of HSUSB2 are muxed with MMC and MCSPI2.
So users of those could possibly see something stop working.
- Anand
-----Original Message-----
Quoted 38 lines
From: Gadiyar, Anand
Sent: Thursday, August 06, 2009 7:32 PM
To: Gupta, Ajay Kumar; Tony Lindgren
Cc: [email protected]; [email protected]; david- [email protected]
Subject: RE: [PATCH 1/9] ehci: fix ehci pin mux initQuoted 11 lines
Quoted 11 lines
arch/arm/mach-omap2/usb-ehci.c static struct platform_device ehci_device = { · line 156
Quoted 9 lines
arch/arm/mach-omap2/usb-ehci.c +6
-0+omap_cfg_reg (W5_3430_USB3HS_TLL_DATA3 ); +omap_cfg_reg (AB12_3430_USB3HS_TLL_DATA4 ); +omap_cfg_reg (AB13_3430_USB3HS_TLL_DATA5 ); +omap_cfg_reg (AA13_3430_USB3HS_TLL_DATA6 ); +omap_cfg_reg (AA12_3430_USB3HS_TLL_DATA7 ); + }return ; }Hmm, is this safe to do? Or does it remember on the number of data
lines
Quoted 9 lines
Quoted 3 lines
that the transceiver uses? If so, maybe something like the recent mmc muxing could be done where the number of pins is passed from
platform_data.This is actually done in "PATCH[6/9] ehci: portwise configurations" where number of ports is being passed from platform files and muxing is done only for required lines.
Quoted 1 line
Quoted 9 lines
Quoted 2 lines
This is assuming that the data lines do not have alternative pins.. In that case only the common pins can be muxed and the rest
would have to be > muxed in the board-*.c files.
These are common pins for HS USB ports 1/2/3 but muxing board specific pins such as PHY RESET is getting done in board-*.c files only.
Quoted 1 line
Quoted 3 lines
At the very least, some pins of HSUSB2 are muxed with MMC and MCSPI2.
So users of those could possibly see something stop working.
In such scenarios where MMC or MCSPI2 is used then board-*.c file would not report those conflicting ports to be in use and so they wouldn't get muxed for EHCI.
-Ajay
Quoted 2 lines
- Anand