Skip to contentSkip to conversation

omap3evm: ehci: Add EHCI padconfig for board Rev >= E

PATCH In review Ajay Kumar Gupta 4 participants 15 messages Oct 28, 2009 – Oct 29, 2009

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 omap3evm: ehci: Add EHCI padconfig for board Rev >= E

OMAP3EVM (Rev >= E) has EHCI port on main board itself. Apart from this there is a slot to connect Mistral Daughter Card (MDC) to it which also has one EHCI port. Only one EHCI port can be used at a time and we can choose the port using GPIO61.

These are the new GPIO lines used for different purpose on EHCI interface.
- GPIO21 - EHCI phy reset
- GPIO22 - EHCI VBUS enable
- GPIO61 - Selects EHCI port either on main board or on Mistral Daughter Card (MDC).

---
 arch/arm/mach-omap2/mux.c             |    7 +++++++
 arch/arm/plat-omap/include/plat/mux.h |    5 +++++
 2 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/mux.c +7 -0
index 32c953e..00ad592 100644
@@ -551,6 +551,13 @@ MUX_CFG_34XX("AF13_3430_MMC3_DAT3", 0x5e2,
 MUX_CFG_34XX("AF26_34XX_SYS_NIRQ", 0x1E0,
 		OMAP3_WAKEUP_EN | OMAP34XX_PIN_INPUT_PULLUP |
 		OMAP34XX_MUX_MODE0)
+/* EHCI GPIO's on OMAP3EVM (Rev >= E) */
+MUX_CFG_34XX("AH14_34XX_GPIO21", 0x5ea,
+	OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
+MUX_CFG_34XX("AF9_34XX_GPIO22", 0x5ec,
+	OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
+MUX_CFG_34XX("U3_34XX_GPIO61", 0x0c8,
+	OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
 };
 
 #define OMAP34XX_PINS_SZ	ARRAY_SIZE(omap34xx_pins)
arch/arm/plat-omap/include/plat/mux.h +5 -0
index f3c1d8a..8316d4f 100644
@@ -840,6 +840,11 @@ enum omap34xx_index {
 
 	/* SYS_NIRQ T2 INT1 */
 	AF26_34XX_SYS_NIRQ,
+
+	/* EHCI GPIO's for OMAP3EVM (Rev >= E) */
+	AH14_34XX_GPIO21,
+	AF9_34XX_GPIO22,
+	U3_34XX_GPIO61,
 };
 
 struct omap_mux_cfg {
Signature · 1 line
1.6.2.4
#1 lore raw

PATCH 2/3 omap3evm: ehci: Update EHCI support on OMAP3EVM (Rev >= E)

Added runtime programming for the differences in EHCI interface between OMAP3EVM revisions (Rev >= E) and (Rev < E).

Changes:
- EHCI PHY reset GPIO pin is 21 on Rev >= E while Rev < E uses GPIO pin 135.
- Rev >= E uses EHCI Vbus enable GPIO22 line.
- Rev >= E uses GPIO61 to select EHCI port either on main board or on Mistral Daughter Card (MDC). OMAP3EVM Rev < E doesn't have EHCI port on main board.
- Currently GPIO61 it programmed to enable EHCI port on main board only.

---
This patch is dependent on below patch,
[PATCH] omap3evm: Add board revision function

 arch/arm/mach-omap2/board-omap3evm.c |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +26 -3
index 0595ce8..a919f33 100644
@@ -45,6 +45,8 @@
 #include "mmc-twl4030.h"
 
 #define OMAP3_EVM_TS_GPIO	175
+#define OMAP3_EVM_EHCI_VBUS	22
+#define OMAP3_EVM_EHCI_SELECT	61
 
 #define OMAP3EVM_ETHR_START	0x2c000000
 #define OMAP3EVM_ETHR_SIZE	1024
@@ -381,8 +383,9 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 	.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
 
 	.phy_reset  = true,
+	/* PHY reset GPIO will be runtime programmed based on EVM version */
 	.reset_gpio_port[0]  = -EINVAL,
-	.reset_gpio_port[1]  = 135,
+	.reset_gpio_port[1]  = -EINVAL,
 	.reset_gpio_port[2]  = -EINVAL
 };
 
@@ -402,9 +405,29 @@ static void __init omap3_evm_init(void)
 	/* OMAP3EVM uses ISP1504 phy and so register nop transceiver */
 	usb_nop_xceiv_register();
 #endif
+	if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
+		/* enable EHCI VBUS using GPIO22 */
+		omap_cfg_reg(AF9_34XX_GPIO22);
+		gpio_request(OMAP3_EVM_EHCI_VBUS, "enable EHCI VBUS");
+		gpio_direction_output(OMAP3_EVM_EHCI_VBUS, 0);
+		gpio_set_value(OMAP3_EVM_EHCI_VBUS, 1);
+
+		/* Select EHCI port on main board */
+		omap_cfg_reg(U3_34XX_GPIO61);
+		gpio_request(OMAP3_EVM_EHCI_SELECT, "select EHCI port");
+		gpio_direction_output(OMAP3_EVM_EHCI_SELECT, 0);
+		gpio_set_value(OMAP3_EVM_EHCI_SELECT, 0);
+
+		/* setup EHCI phy reset config */
+		omap_cfg_reg(AH14_34XX_GPIO21);
+		ehci_pdata.reset_gpio_port[1] = 21;
+
+	} else {
+		/* setup EHCI phy reset on MDC */
+		omap_cfg_reg(AF4_34XX_GPIO135_OUT);
+		ehci_pdata.reset_gpio_port[1] = 135;
+	}
 	usb_musb_init();
-	/* Setup EHCI phy reset padconfig */
-	omap_cfg_reg(AF4_34XX_GPIO135_OUT);
 	usb_ehci_init(&ehci_pdata);
 	ads7846_dev_init();
 }
Signature · 1 line
1.6.2.4
#2 lore raw

PATCH 3/3 omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Updated the MUSB power sourcing capability for OMAP3EVM (Rev >=E).

MUSB interface can source 500mA on OMAP3EVM Rev >= E while Rev < E supports only 100mA.MUSB PHY is programmed to use external Vbus for this.

---
This patch is dependent on below patch,
[PATCH] omap3evm: Add board revision function

 arch/arm/mach-omap2/usb-musb.c |    8 ++++++--
 drivers/usb/musb/musb_regs.h   |    5 +++++
 drivers/usb/musb/omap2430.c    |    9 +++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/usb-musb.c +6 -2
index a80441d..529e2b1 100644
@@ -148,10 +148,14 @@ static struct platform_device musb_device = {
 
 void __init usb_musb_init(void)
 {
-	if (cpu_is_omap243x())
+	if (cpu_is_omap243x()) {
 		musb_resources[0].start = OMAP243X_HS_BASE;
-	else
+	} else {
 		musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+		/* OMAP3EVM Rev >= E can source 500mA */
+		if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
+			musb_plat.power = 250;
+	}
 	musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
 
 	/*
drivers/usb/musb/musb_regs.h +5 -0
index cc1d71b..a0314df 100644
@@ -72,6 +72,10 @@
 #define MUSB_DEVCTL_HR		0x02
 #define MUSB_DEVCTL_SESSION	0x01
 
+/* ULPI VBUSCONTROL */
+#define ULPI_USE_EXTVBUS	0x01
+#define ULPI_USE_EXTVBUSIND	0x02
+
 /* TESTMODE */
 #define MUSB_TEST_FORCE_HOST	0x80
 #define MUSB_TEST_FIFO_ACCESS	0x40
@@ -246,6 +250,7 @@
 
 /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at 0x68 */
 #define MUSB_HWVERS		0x6C	/* 8 bit */
+#define MUSB_ULPI_BUSCONTROL	0x70	/* 8 bit */
 
 #define MUSB_EPINFO		0x78	/* 8 bit */
 #define MUSB_RAMINFO		0x79	/* 8 bit */
drivers/usb/musb/omap2430.c +9 -0
index 6761d20..c5fcc30 100644
@@ -36,6 +36,7 @@
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <plat/mux.h>
+#include <plat/board.h>
 
 #include "musb_core.h"
 #include "omap2430.h"
@@ -203,6 +204,7 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
 int __init musb_platform_init(struct musb *musb)
 {
 	u32 l;
+	u8 val;
 
 #if defined(CONFIG_ARCH_OMAP2430)
 	omap_cfg_reg(AE5_2430_USB0HS_STP);
@@ -239,6 +241,13 @@ int __init musb_platform_init(struct musb *musb)
 	l |= ULPI_12PIN;
 	omap_writel(l, OTG_INTERFSEL);
 
+	/* Program PHY to use external Vbus supply for OMAP3EVM Rev >= E */
+	if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
+		val = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL);
+		val |= ULPI_USE_EXTVBUS;
+		musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, val);
+	}
+
 	pr_debug("HS USB OTG: revision 0x%x, sysconfig 0x%02x, "
 			"sysstatus 0x%x, intrfsel 0x%x, simenable  0x%x\n",
 			omap_readl(OTG_REVISION), omap_readl(OTG_SYSCONFIG),
Signature · 1 line
1.6.2.4
#3 lore raw

RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Quoted 4 lines

From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Gupta, Ajay Kumar
Sent: Wednesday, October 28, 2009 5:13 PM

[...]

Quoted 6 lines
arch/arm/mach-omap2/usb- renamed from arch/arm/mach-omap2/usb-musb.c +0 -0

musb.c
index a80441d..529e2b1 100644

arch/arm/mach-omap2/usb-musb.c static struct platform_device musb_device = { · line 153

Quoted 8 lines
arch/arm/mach-omap2/usb-musb.c +2 -2
@@ -148,10 +148,14 @@ static struct platform_device musb_device = {
 
 void __init usb_musb_init(void)
 {
-	if (cpu_is_omap243x())
+	if (cpu_is_omap243x()) {
 		musb_resources[0].start = OMAP243X_HS_BASE;
-	else
+	} else {

Do you need {} for a one liner? Checkpatch should have warned you I think..

Quoted 53 lines
arch/arm/mach-omap2/usb-musb.c +4 -0
 		musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+		/* OMAP3EVM Rev >= E can source 500mA */
+		if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
+			musb_plat.power = 250;
+	}
 	musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
 
 	/*
drivers/usb/musb/musb_regs.h +5 -0
index cc1d71b..a0314df 100644
@@ -72,6 +72,10 @@
 #define MUSB_DEVCTL_HR		0x02
 #define MUSB_DEVCTL_SESSION	0x01
 
+/* ULPI VBUSCONTROL */
+#define ULPI_USE_EXTVBUS	0x01
+#define ULPI_USE_EXTVBUSIND	0x02
+
 /* TESTMODE */
 #define MUSB_TEST_FORCE_HOST	0x80
 #define MUSB_TEST_FIFO_ACCESS	0x40
@@ -246,6 +250,7 @@
 
 /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at 0x68 */
 #define MUSB_HWVERS		0x6C	/* 8 bit */
+#define MUSB_ULPI_BUSCONTROL	0x70	/* 8 bit */
 
 #define MUSB_EPINFO		0x78	/* 8 bit */
 #define MUSB_RAMINFO		0x79	/* 8 bit */
drivers/usb/musb/omap2430.c +2 -0
index 6761d20..c5fcc30 100644
@@ -36,6 +36,7 @@
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <plat/mux.h>
+#include <plat/board.h>
 
 #include "musb_core.h"
 #include "omap2430.h"
@@ -203,6 +204,7 @@ int musb_platform_set_mode(struct musb *musb, u8
 musb_mode)
 int __init musb_platform_init(struct musb *musb)
 {
 	u32 l;
+	u8 val;
 
 #if defined(CONFIG_ARCH_OMAP2430)
drivers/usb/musb/omap2430.c +0 -0
 	omap_cfg_reg(AE5_2430_USB0HS_STP);

drivers/usb/musb/omap2430.c int __init musb_platform_init(struct musb *musb) · line 249

Quoted 9 lines
drivers/usb/musb/omap2430.c +6 -0
@@ -239,6 +241,13 @@ int __init musb_platform_init(struct musb *musb)
 	l |= ULPI_12PIN;
 	omap_writel(l, OTG_INTERFSEL);
 
+	/* Program PHY to use external Vbus supply for OMAP3EVM Rev >= E */
+	if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
+		val = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL);
+		val |= ULPI_USE_EXTVBUS;
+		musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, val);
+	}

Do we want to do board specific logic inside a IP logic? Wont it be better to do it some way else?

Regards,
Nishanth Menon

#4 lore raw

RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Quoted 12 lines

From: [email protected] [mailto:linux-omap-

Quoted 3 lines

[email protected]] On Behalf Of Gupta, Ajay Kumar
Sent: Wednesday, October 28, 2009 5:13 PM

[...]

Quoted 7 lines
arch/arm/mach-omap2/usb- renamed from arch/arm/mach-omap2/usb-musb.c +0 -0

musb.c
index a80441d..529e2b1 100644

arch/arm/mach-omap2/usb-musb.c +0 -0
@@ -148,10 +148,14 @@ static struct platform_device musb_device = {
 
Quoted 9 lines

arch/arm/mach-omap2/usb-musb.c static struct platform_device musb_device = { · line 153

Quoted 7 lines
arch/arm/mach-omap2/usb-musb.c +2 -2
 void __init usb_musb_init(void)
 {
-     if (cpu_is_omap243x())
+     if (cpu_is_omap243x()) {
              musb_resources[0].start = OMAP243X_HS_BASE;
-     else
+     } else {

Do you need {} for a one liner? Checkpatch should have warned you I think..

Er, CodingStyle says you need to do this, if the else clause has brackets.

Quoted 56 lines
Quoted 56 lines
arch/arm/mach-omap2/usb-musb.c +4 -0
              musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+             /* OMAP3EVM Rev >= E can source 500mA */
+             if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
+                     musb_plat.power = 250;
+     }
      musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
 
      /*
drivers/usb/musb/musb_regs.h +5 -0
index cc1d71b..a0314df 100644
@@ -72,6 +72,10 @@
 #define MUSB_DEVCTL_HR               0x02
 #define MUSB_DEVCTL_SESSION  0x01
 
+/* ULPI VBUSCONTROL */
+#define ULPI_USE_EXTVBUS     0x01
+#define ULPI_USE_EXTVBUSIND  0x02
+
 /* TESTMODE */
 #define MUSB_TEST_FORCE_HOST 0x80
 #define MUSB_TEST_FIFO_ACCESS        0x40
@@ -246,6 +250,7 @@
 
 /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at 0x68 */
 #define MUSB_HWVERS          0x6C    /* 8 bit */
+#define MUSB_ULPI_BUSCONTROL 0x70    /* 8 bit */
 
 #define MUSB_EPINFO          0x78    /* 8 bit */
 #define MUSB_RAMINFO         0x79    /* 8 bit */
drivers/usb/musb/omap2430.c +2 -0
index 6761d20..c5fcc30 100644
@@ -36,6 +36,7 @@
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <plat/mux.h>
+#include <plat/board.h>
 
 #include "musb_core.h"
 #include "omap2430.h"
@@ -203,6 +204,7 @@ int musb_platform_set_mode(struct musb *musb, u8
 musb_mode)
 int __init musb_platform_init(struct musb *musb)
 {
      u32 l;
+     u8 val;
 
 #if defined(CONFIG_ARCH_OMAP2430)
      omap_cfg_reg(AE5_2430_USB0HS_STP);
drivers/usb/musb/omap2430.c +0 -0
@@ -239,6 +241,13 @@ int __init musb_platform_init(struct musb *musb)
      l |= ULPI_12PIN;
      omap_writel(l, OTG_INTERFSEL);
 
Quoted 7 lines

drivers/usb/musb/omap2430.c int __init musb_platform_init(struct musb *musb) · line 249

Quoted 6 lines
drivers/usb/musb/omap2430.c +6 -0
+     /* Program PHY to use external Vbus supply for OMAP3EVM Rev >= E */
+     if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
+             val = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL);
+             val |= ULPI_USE_EXTVBUS;
+             musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, val);
+     }

Do we want to do board specific logic inside a IP logic? Wont it be better to do it some way else?

Maybe add a flag to pass down from the board files? I think other boards might also end up using this.

Quoted 4 lines

Regards,
Nishanth Menon

#5 lore raw

RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Anand, Nishanth,

Quoted 28 lines

-----Original Message-----
From: Gadiyar, Anand
Sent: Thursday, October 29, 2009 8:23 AM
To: Menon, Nishanth; Gupta, Ajay Kumar; [email protected]
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Quoted 12 lines

From: [email protected] [mailto:linux-omap-

Quoted 3 lines

[email protected]] On Behalf Of Gupta, Ajay Kumar
Sent: Wednesday, October 28, 2009 5:13 PM

[...]

Quoted 7 lines
arch/arm/mach-omap2/usb- renamed from arch/arm/mach-omap2/usb-musb.c +0 -0

musb.c
index a80441d..529e2b1 100644

arch/arm/mach-omap2/usb-musb.c +0 -0
@@ -148,10 +148,14 @@ static struct platform_device musb_device = {
 
Quoted 8 lines

arch/arm/mach-omap2/usb-musb.c static struct platform_device musb_device = { · line 153

Quoted 7 lines
arch/arm/mach-omap2/usb-musb.c +2 -2
 void __init usb_musb_init(void)
 {
-     if (cpu_is_omap243x())
+     if (cpu_is_omap243x()) {
              musb_resources[0].start = OMAP243X_HS_BASE;
-     else
+     } else {

Do you need {} for a one liner? Checkpatch should have warned you I

Quoted 5 lines

think..

Quoted 1 line

Er, CodingStyle says you need to do this, if the else clause has brackets.

Correct and also checkpatch didn't give any warning for this.

Quoted 61 lines
Quoted 10 lines

Review

Quoted 10 lines
arch/arm/mach-omap2/usb-musb.c +4 -0
              musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+             /* OMAP3EVM Rev >= E can source 500mA */
+             if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
+                     musb_plat.power = 250;
+     }
      musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
 
      /*
(quoted diff) +0 -0

b/drivers/usb/musb/musb_regs.h

Quoted 16 lines
Quoted 16 lines

index cc1d71b..a0314df 100644

drivers/usb/musb/musb_regs.h +4 -0
@@ -72,6 +72,10 @@
 #define MUSB_DEVCTL_HR               0x02
 #define MUSB_DEVCTL_SESSION  0x01
 
+/* ULPI VBUSCONTROL */
+#define ULPI_USE_EXTVBUS     0x01
+#define ULPI_USE_EXTVBUSIND  0x02
+
 /* TESTMODE */
 #define MUSB_TEST_FORCE_HOST 0x80
 #define MUSB_TEST_FIFO_ACCESS        0x40
@@ -246,6 +250,7 @@
 
Quoted 1 line

drivers/usb/musb/musb_regs.h line 251

Quoted 1 line
drivers/usb/musb/musb_regs.h +0 -0
 /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at 0x68

*/

Quoted 24 lines
Quoted 24 lines
drivers/usb/musb/musb_regs.h +1 -0
 #define MUSB_HWVERS          0x6C    /* 8 bit */
+#define MUSB_ULPI_BUSCONTROL 0x70    /* 8 bit */
 
 #define MUSB_EPINFO          0x78    /* 8 bit */
 #define MUSB_RAMINFO         0x79    /* 8 bit */
drivers/usb/musb/omap2430.c +2 -0
index 6761d20..c5fcc30 100644
@@ -36,6 +36,7 @@
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <plat/mux.h>
+#include <plat/board.h>
 
 #include "musb_core.h"
 #include "omap2430.h"
@@ -203,6 +204,7 @@ int musb_platform_set_mode(struct musb *musb, u8
 musb_mode)
 int __init musb_platform_init(struct musb *musb)
 {
      u32 l;
+     u8 val;
 
Quoted 7 lines

drivers/usb/musb/omap2430.c int __init musb_platform_init(struct musb *musb) · line 244

Quoted 7 lines
drivers/usb/musb/omap2430.c +0 -0
 #if defined(CONFIG_ARCH_OMAP2430)
      omap_cfg_reg(AE5_2430_USB0HS_STP);
drivers/usb/musb/omap2430.c +1 -0
@@ -239,6 +241,13 @@ int __init musb_platform_init(struct musb *musb)
      l |= ULPI_12PIN;
      omap_writel(l, OTG_INTERFSEL);
 
+     /* Program PHY to use external Vbus supply for OMAP3EVM Rev >= E

*/

Quoted 7 lines
Quoted 6 lines

drivers/usb/musb/omap2430.c int __init musb_platform_init(struct musb *musb) · line 249

Quoted 5 lines
drivers/usb/musb/omap2430.c +5 -0
+     if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
+             val = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL);
+             val |= ULPI_USE_EXTVBUS;
+             musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, val);
+     }

Do we want to do board specific logic inside a IP logic? Wont it be

better to do it some way else?

We need to access musb controller register to program this so It has to be In musb_platform_init() only but As Anand suggested we can use some flag

Quoted 5 lines

From board file to avoid omap3_evm specific check here.

Maybe add a flag to pass down from the board files? I think other boards might also end up using this.

Looks good. I will take this in next revision.

-Ajay

Quoted 5 lines
Quoted 5 lines

Regards,
Nishanth Menon

#6 lore raw

RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Quoted 24 lines

From: Gupta, Ajay Kumar
Sent: Thursday, October 29, 2009 7:10 AM

Quoted 7 lines
Quoted 7 lines

From: [email protected] [mailto:linux-omap-

Quoted 3 lines

[email protected]] On Behalf Of Gupta, Ajay Kumar
Sent: Wednesday, October 28, 2009 5:13 PM

[...]

arch/arm/mach-

Quoted 1 line
arch/arm/mach- renamed from arch/arm/mach-omap2/usb-musb.c +0 -0

omap2/usb-

Quoted 14 lines
Quoted 14 lines

arch/arm/mach-omap2/usb-musb.c static struct platform_device musb_device = { · line 153

Quoted 13 lines

musb.c
index a80441d..529e2b1 100644

arch/arm/mach-omap2/usb-musb.c +2 -2
@@ -148,10 +148,14 @@ static struct platform_device musb_device = {
 
 void __init usb_musb_init(void)
 {
-     if (cpu_is_omap243x())
+     if (cpu_is_omap243x()) {
              musb_resources[0].start = OMAP243X_HS_BASE;
-     else
+     } else {

Do you need {} for a one liner? Checkpatch should have warned you I

Quoted 7 lines
Quoted 5 lines

think..

Quoted 1 line

Er, CodingStyle says you need to do this, if the else clause has brackets.

Correct and also checkpatch didn't give any warning for this.

Thanks..

Quoted 79 lines
Quoted 28 lines
Quoted 11 lines

Review

Quoted 11 lines
arch/arm/mach-omap2/usb-musb.c +4 -0
              musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+             /* OMAP3EVM Rev >= E can source 500mA */
+             if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
+                     musb_plat.power = 250;
+     }
      musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
 
      /*
(quoted diff) +0 -0

b/drivers/usb/musb/musb_regs.h

Quoted 16 lines
Quoted 16 lines

index cc1d71b..a0314df 100644

drivers/usb/musb/musb_regs.h +4 -0
@@ -72,6 +72,10 @@
 #define MUSB_DEVCTL_HR               0x02
 #define MUSB_DEVCTL_SESSION  0x01
 
+/* ULPI VBUSCONTROL */
+#define ULPI_USE_EXTVBUS     0x01
+#define ULPI_USE_EXTVBUSIND  0x02
+
 /* TESTMODE */
 #define MUSB_TEST_FORCE_HOST 0x80
 #define MUSB_TEST_FIFO_ACCESS        0x40
@@ -246,6 +250,7 @@
 
Quoted 1 line
Quoted 1 line

drivers/usb/musb/musb_regs.h line 251

Quoted 1 line
drivers/usb/musb/musb_regs.h +0 -0
 /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at

0x68

Quoted 7 lines

*/

Quoted 6 lines

Review

Quoted 6 lines
drivers/usb/musb/musb_regs.h +1 -0
 #define MUSB_HWVERS          0x6C    /* 8 bit */
+#define MUSB_ULPI_BUSCONTROL 0x70    /* 8 bit */
 
 #define MUSB_EPINFO          0x78    /* 8 bit */
 #define MUSB_RAMINFO         0x79    /* 8 bit */
(quoted diff) +0 -0

b/drivers/usb/musb/omap2430.c

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

index 6761d20..c5fcc30 100644

drivers/usb/musb/omap2430.c +2 -0
@@ -36,6 +36,7 @@
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <plat/mux.h>
+#include <plat/board.h>
 
 #include "musb_core.h"
 #include "omap2430.h"
@@ -203,6 +204,7 @@ int musb_platform_set_mode(struct musb *musb, u8
 musb_mode)
 int __init musb_platform_init(struct musb *musb)
 {
      u32 l;
+     u8 val;
 
Quoted 3 lines
Quoted 3 lines

drivers/usb/musb/omap2430.c int __init musb_platform_init(struct musb

Quoted 3 lines
drivers/usb/musb/omap2430.c +0 -0
 #if defined(CONFIG_ARCH_OMAP2430)
      omap_cfg_reg(AE5_2430_USB0HS_STP);
drivers/usb/musb/omap2430.c +0 -0
@@ -239,6 +241,13 @@ int __init musb_platform_init(struct musb

*musb)

Quoted 4 lines
Quoted 4 lines

drivers/usb/musb/omap2430.c int __init musb_platform_init(struct musb *musb)

Quoted 4 lines
drivers/usb/musb/omap2430.c +1 -0
      l |= ULPI_12PIN;
      omap_writel(l, OTG_INTERFSEL);
 
+     /* Program PHY to use external Vbus supply for OMAP3EVM Rev >=

E

Quoted 8 lines

*/

Quoted 6 lines

drivers/usb/musb/omap2430.c int __init musb_platform_init(struct musb *musb) · line 249

Quoted 5 lines
drivers/usb/musb/omap2430.c +5 -0
+     if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
+             val = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL);
+             val |= ULPI_USE_EXTVBUS;
+             musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, val);
+     }

Do we want to do board specific logic inside a IP logic? Wont it be

better to do it some way else?

We need to access musb controller register to program this so It has to be In musb_platform_init() only but As Anand suggested we can use some flag From board file to avoid omap3_evm specific check here.

Quoted 1 line
Quoted 4 lines
Quoted 2 lines

Maybe add a flag to pass down from the board files? I think other boards might also end up using this.

Looks good. I will take this in next revision.

Thanks again.. that might be a good thing to have.

Regards,
Nishanth Menon

#7 lore raw

RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Felipe,

Quoted 33 lines

-----Original Message-----
From: Menon, Nishanth
Sent: Thursday, October 29, 2009 11:06 AM
To: Gupta, Ajay Kumar; Gadiyar, Anand; [email protected]
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Quoted 7 lines

From: Gupta, Ajay Kumar
Sent: Thursday, October 29, 2009 7:10 AM

Quoted 5 lines
Quoted 5 lines

From: [email protected] [mailto:linux-omap-

Quoted 3 lines

[email protected]] On Behalf Of Gupta, Ajay Kumar
Sent: Wednesday, October 28, 2009 5:13 PM

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

[...]

arch/arm/mach-

Quoted 1 line
arch/arm/mach- renamed from arch/arm/mach-omap2/usb-musb.c +0 -0

omap2/usb-

Quoted 5 lines
Quoted 5 lines

arch/arm/mach-omap2/usb-musb.c static struct platform_device musb_device =

Quoted 5 lines

musb.c
index a80441d..529e2b1 100644

arch/arm/mach-omap2/usb-musb.c +0 -0
@@ -148,10 +148,14 @@ static struct platform_device musb_device =

{

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

arch/arm/mach-omap2/usb-musb.c static struct platform_device musb_device = { · line 153

Quoted 8 lines
arch/arm/mach-omap2/usb-musb.c +2 -2
 void __init usb_musb_init(void)
 {
-     if (cpu_is_omap243x())
+     if (cpu_is_omap243x()) {
              musb_resources[0].start = OMAP243X_HS_BASE;
-     else
+     } else {

Do you need {} for a one liner? Checkpatch should have warned you I

Quoted 16 lines
Quoted 7 lines
Quoted 5 lines

think..

Quoted 1 line

Er, CodingStyle says you need to do this, if the else clause has brackets.

Correct and also checkpatch didn't give any warning for this.

Thanks..

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
arch/arm/mach-omap2/usb-musb.c +4 -0
              musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+             /* OMAP3EVM Rev >= E can source 500mA */
+             if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
+                     musb_plat.power = 250;
+     }

Felipe,

How about moving the platform specific data (musb_hdrc_platform_data) moved to board-x.c file from usb-musb.c (same as ehci). This would avoid using omap3evm specific check in usb-musb.c files.

-Ajay

Quoted 83 lines
Quoted 40 lines
Quoted 21 lines
Quoted 4 lines

Review

Quoted 4 lines
arch/arm/mach-omap2/usb-musb.c +0 -0
      musb_resources[0].end = musb_resources[0].start + SZ_8K - 1;
 
      /*
(quoted diff) +0 -0

b/drivers/usb/musb/musb_regs.h

Quoted 16 lines
Quoted 16 lines

index cc1d71b..a0314df 100644

drivers/usb/musb/musb_regs.h +4 -0
@@ -72,6 +72,10 @@
 #define MUSB_DEVCTL_HR               0x02
 #define MUSB_DEVCTL_SESSION  0x01
 
+/* ULPI VBUSCONTROL */
+#define ULPI_USE_EXTVBUS     0x01
+#define ULPI_USE_EXTVBUSIND  0x02
+
 /* TESTMODE */
 #define MUSB_TEST_FORCE_HOST 0x80
 #define MUSB_TEST_FIFO_ACCESS        0x40
@@ -246,6 +250,7 @@
 
Quoted 1 line
Quoted 1 line

drivers/usb/musb/musb_regs.h line 251

Quoted 1 line
drivers/usb/musb/musb_regs.h +0 -0
 /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at

0x68

Quoted 7 lines

*/

Quoted 6 lines

Review

Quoted 6 lines
drivers/usb/musb/musb_regs.h +1 -0
 #define MUSB_HWVERS          0x6C    /* 8 bit */
+#define MUSB_ULPI_BUSCONTROL 0x70    /* 8 bit */
 
 #define MUSB_EPINFO          0x78    /* 8 bit */
 #define MUSB_RAMINFO         0x79    /* 8 bit */
(quoted diff) +0 -0

b/drivers/usb/musb/omap2430.c

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

index 6761d20..c5fcc30 100644

drivers/usb/musb/omap2430.c +1 -0
@@ -36,6 +36,7 @@
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <plat/mux.h>
+#include <plat/board.h>
 
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

drivers/usb/musb/omap2430.c int musb_platform_set_mode(struct musb *musb,

Quoted 3 lines
drivers/usb/musb/omap2430.c +0 -0
 #include "musb_core.h"
 #include "omap2430.h"
@@ -203,6 +204,7 @@ int musb_platform_set_mode(struct musb *musb,

u8

Quoted 22 lines
Quoted 9 lines
Quoted 9 lines

drivers/usb/musb/omap2430.c int __init musb_platform_init(struct musb

Quoted 9 lines
drivers/usb/musb/omap2430.c +1 -0
 musb_mode)
 int __init musb_platform_init(struct musb *musb)
 {
      u32 l;
+     u8 val;
 
 #if defined(CONFIG_ARCH_OMAP2430)
      omap_cfg_reg(AE5_2430_USB0HS_STP);
drivers/usb/musb/omap2430.c +0 -0
@@ -239,6 +241,13 @@ int __init musb_platform_init(struct musb

*musb)

Quoted 4 lines
Quoted 4 lines

drivers/usb/musb/omap2430.c int __init musb_platform_init(struct musb *musb)

Quoted 4 lines
drivers/usb/musb/omap2430.c +1 -0
      l |= ULPI_12PIN;
      omap_writel(l, OTG_INTERFSEL);
 
+     /* Program PHY to use external Vbus supply for OMAP3EVM Rev

=
E

Quoted 6 lines

*/

Quoted 5 lines
Quoted 5 lines
drivers/usb/musb/omap2430.c +5 -0
+     if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
+             val = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL);
+             val |= ULPI_USE_EXTVBUS;
+             musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, val);
+     }
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

Do we want to do board specific logic inside a IP logic? Wont it be

better to do it some way else?

We need to access musb controller register to program this so It has to

be

Quoted 8 lines

In musb_platform_init() only but As Anand suggested we can use some flag From board file to avoid omap3_evm specific check here.

Quoted 3 lines

Maybe add a flag to pass down from the board files? I think other boards might also end up using this.

Looks good. I will take this in next revision.

Thanks again.. that might be a good thing to have.

Regards,
Nishanth Menon

#8 lore raw

Re: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Hi,

Quoted 51 lines · Ajay Kumar

Felipe,

Quoted 33 lines

-----Original Message-----
From: Menon, Nishanth
Sent: Thursday, October 29, 2009 11:06 AM
To: Gupta, Ajay Kumar; Gadiyar, Anand; [email protected]
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Quoted 7 lines

From: Gupta, Ajay Kumar
Sent: Thursday, October 29, 2009 7:10 AM

Quoted 5 lines
Quoted 5 lines

From: [email protected] [mailto:linux-omap-

Quoted 3 lines

[email protected]] On Behalf Of Gupta, Ajay Kumar
Sent: Wednesday, October 28, 2009 5:13 PM

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

[...]

arch/arm/mach-

Quoted 1 line
arch/arm/mach- renamed from arch/arm/mach-omap2/usb-musb.c +0 -0

omap2/usb-

Quoted 5 lines
Quoted 5 lines

arch/arm/mach-omap2/usb-musb.c static struct platform_device musb_device =

Quoted 5 lines

musb.c
index a80441d..529e2b1 100644

arch/arm/mach-omap2/usb-musb.c +0 -0
@@ -148,10 +148,14 @@ static struct platform_device musb_device =

{

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

arch/arm/mach-omap2/usb-musb.c static struct platform_device musb_device = { · line 153

Quoted 8 lines
arch/arm/mach-omap2/usb-musb.c +2 -2
 void __init usb_musb_init(void)
 {
-     if (cpu_is_omap243x())
+     if (cpu_is_omap243x()) {
              musb_resources[0].start = OMAP243X_HS_BASE;
-     else
+     } else {

Do you need {} for a one liner? Checkpatch should have warned you I

Quoted 16 lines
Quoted 7 lines
Quoted 5 lines

think..

Quoted 1 line

Er, CodingStyle says you need to do this, if the else clause has brackets.

Correct and also checkpatch didn't give any warning for this.

Thanks..

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
arch/arm/mach-omap2/usb-musb.c +4 -0
              musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
+             /* OMAP3EVM Rev >= E can source 500mA */
+             if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
+                     musb_plat.power = 250;
+     }
Quoted 3 lines

Felipe,

How about moving the platform specific data (musb_hdrc_platform_data) moved to board-x.c file from usb-musb.c (same as ehci). This would avoid using omap3evm specific check in usb-musb.c files.

I was thinking on adding a musb_hdrc_board_data which would group board-specific data such as this one.

Musb's init phase is quite messy as of today so we would need to clean that up. Anyways, the main idea is:

board will call usb_musb_init() with a musb_hdrc_board_data * as parameter. usb-musb would still hold a static struct musb_hdrc_platform_data for the (in our case) OMAP-specific init, those would be passed down to driver and init phase would be done as following:

musb_init()

	-> musb_platform_init()
		-> musb_board_init()

we could also have board_ops and platform_ops structures for the function pointers to be passed to musb_core.c Then all init could be done there.

What do you say ???

Signature · 1 line
balbi
#9 lore raw

RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Quoted 85 lines

-----Original Message-----
From: Felipe Balbi [mailto:[email protected]]
Sent: Thursday, October 29, 2009 12:29 PM
To: Gupta, Ajay Kumar
Cc: [email protected]; Balbi Felipe (Nokia-D/Helsinki); Menon, Nishanth; Gadiyar, Anand
Subject: Re: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Hi,

Quoted 16 lines · Ajay Kumar

Felipe,

Quoted 15 lines

-----Original Message-----
From: Menon, Nishanth
Sent: Thursday, October 29, 2009 11:06 AM
To: Gupta, Ajay Kumar; Gadiyar, Anand; [email protected]
Cc: [email protected]; [email protected]
Subject: RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Quoted 7 lines

From: Gupta, Ajay Kumar
Sent: Thursday, October 29, 2009 7:10 AM

Quoted 5 lines
Quoted 5 lines

From: [email protected] [mailto:linux-omap-

Quoted 3 lines

[email protected]] On Behalf Of Gupta, Ajay Kumar
Sent: Wednesday, October 28, 2009 5:13 PM

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

[...]

arch/arm/mach-

Quoted 1 line
arch/arm/mach- renamed from arch/arm/mach-omap2/usb-musb.c +0 -0

omap2/usb-

Quoted 5 lines
Quoted 5 lines

arch/arm/mach-omap2/usb-musb.c static struct platform_device

Quoted 5 lines

musb.c
index a80441d..529e2b1 100644

arch/arm/mach-omap2/usb-musb.c +0 -0
@@ -148,10 +148,14 @@ static struct platform_device

musb_device =

Quoted 10 lines
Quoted 10 lines

{

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

arch/arm/mach-omap2/usb-musb.c static struct platform_device · line 152

Quoted 8 lines
arch/arm/mach-omap2/usb-musb.c +2 -2
 void __init usb_musb_init(void)
 {
-     if (cpu_is_omap243x())
+     if (cpu_is_omap243x()) {
              musb_resources[0].start = OMAP243X_HS_BASE;
-     else
+     } else {

Do you need {} for a one liner? Checkpatch should have warned

you I

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

think..

Quoted 1 line

Er, CodingStyle says you need to do this, if the else clause has brackets.

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

Correct and also checkpatch didn't give any warning for this.

Thanks..

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
arch/arm/mach-omap2/usb-musb.c +0 -0
              musb_resources[0].start =

OMAP34XX_HSUSB_OTG_BASE;

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

arch/arm/mach-omap2/usb-musb.c static struct platform_device · line 157

Quoted 4 lines
arch/arm/mach-omap2/usb-musb.c +4 -0
+             /* OMAP3EVM Rev >= E can source 500mA */
+             if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
+                     musb_plat.power = 250;
+     }

Felipe,

How about moving the platform specific data (musb_hdrc_platform_data)

moved to board-x.c file from usb-musb.c (same as ehci). This would avoid using omap3evm specific check in usb-musb.c files.

I was thinking on adding a musb_hdrc_board_data which would group board-specific data such as this one.

Musb's init phase is quite messy as of today so we would need to clean that up. Anyways, the main idea is:

board will call usb_musb_init() with a musb_hdrc_board_data * as parameter. usb-musb would still hold a static struct musb_hdrc_platform_data for the (in our case) OMAP-specific init, those would be passed down to driver and init phase would be done as following:

musb_init()

Quoted 8 lines
	-> musb_platform_init()
		-> musb_board_init()

we could also have board_ops and platform_ops structures for the function pointers to be passed to musb_core.c Then all init could be done there.

What do you say ???

This looks really good to isolate board specific settings. Do you have any ready patch on this ?

-Ajay

Quoted 3 lines

--
balbi

#10 lore raw

Re: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Hi,

Quoted 16 lines · Ajay Kumar
Quoted 16 lines

I was thinking on adding a musb_hdrc_board_data which would group board-specific data such as this one.

Musb's init phase is quite messy as of today so we would need to clean that up. Anyways, the main idea is:

board will call usb_musb_init() with a musb_hdrc_board_data * as parameter. usb-musb would still hold a static struct musb_hdrc_platform_data for the (in our case) OMAP-specific init, those would be passed down to driver and init phase would be done as following:

musb_init()

	-> musb_platform_init()
		-> musb_board_init()
Quoted 8 lines
Quoted 5 lines

we could also have board_ops and platform_ops structures for the function pointers to be passed to musb_core.c Then all init could be done there.

What do you say ???

This looks really good to isolate board specific settings. Do you have any ready patch on this ?

no, currently I'm working on refactoring the otg support. I could work on this after I finish otg refactoring unless you want to take this task :-)

Signature · 1 line
balbi
#11 lore raw

RE: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Hi,

Quoted 24 lines · Ajay Kumar
Quoted 9 lines
Quoted 9 lines

I was thinking on adding a musb_hdrc_board_data which would group board-specific data such as this one.

Musb's init phase is quite messy as of today so we would need to clean that up. Anyways, the main idea is:

board will call usb_musb_init() with a musb_hdrc_board_data * as parameter. usb-musb would still hold a static struct musb_hdrc_platform_data for the (in our case) OMAP-specific init,

those

Quoted 13 lines
Quoted 12 lines

would be passed down to driver and init phase would be done as following:

musb_init()

	-> musb_platform_init()
		-> musb_board_init()

we could also have board_ops and platform_ops structures for the function pointers to be passed to musb_core.c Then all init could be done there.

What do you say ???

Quoted 7 lines
Quoted 1 line

This looks really good to isolate board specific settings. Do you have

any

Quoted 1 line

ready patch on this ?

no, currently I'm working on refactoring the otg support. I could work on this after I finish otg refactoring unless you want to take this task :-)

Sure, I will submit the first cut very soon.

-Ajay

Quoted 3 lines

--
balbi

#12 lore raw

Re: [PATCH 3/3] omap3evm: musb: Update power capability for OMAP3EVM (Rev >= E)

Quoted 26 lines · Ajay Kumar

Hi,

Quoted 25 lines · Ajay Kumar
Quoted 9 lines
Quoted 9 lines

I was thinking on adding a musb_hdrc_board_data which would group board-specific data such as this one.

Musb's init phase is quite messy as of today so we would need to clean that up. Anyways, the main idea is:

board will call usb_musb_init() with a musb_hdrc_board_data * as parameter. usb-musb would still hold a static struct musb_hdrc_platform_data for the (in our case) OMAP-specific init,

those

Quoted 14 lines
Quoted 4 lines

would be passed down to driver and init phase would be done as following:

musb_init()

Quoted 8 lines
	-> musb_platform_init()
		-> musb_board_init()

we could also have board_ops and platform_ops structures for the function pointers to be passed to musb_core.c Then all init could be done there.

What do you say ???

This looks really good to isolate board specific settings. Do you have

Quoted 8 lines
Quoted 6 lines

any

Quoted 1 line

ready patch on this ?

no, currently I'm working on refactoring the otg support. I could work on this after I finish otg refactoring unless you want to take this task :-)

Sure, I will submit the first cut very soon.

We could discuss further off list about the design and implementation details. Just drop a mail :-)

Signature · 1 line
balbi
#13 lore raw
In reply to Ajay Kumar Gupta
Quoted 3 lines

From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Gupta, Ajay Kumar
Sent: Wednesday, October 28, 2009 5:13 PM

[...]

Quoted 12 lines
---
 arch/arm/mach-omap2/mux.c             |    7 +++++++
 arch/arm/plat-omap/include/plat/mux.h |    5 +++++
 2 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/mux.c +0 -0
index 32c953e..00ad592 100644

arch/arm/mach-omap2/mux.c MUX_CFG_34XX("AF13_3430_MMC3_DAT3", 0x5e2, · line 560

Quoted 10 lines
arch/arm/mach-omap2/mux.c +7 -0
@@ -551,6 +551,13 @@ MUX_CFG_34XX("AF13_3430_MMC3_DAT3", 0x5e2,
 MUX_CFG_34XX("AF26_34XX_SYS_NIRQ", 0x1E0,
 		OMAP3_WAKEUP_EN | OMAP34XX_PIN_INPUT_PULLUP |
 		OMAP34XX_MUX_MODE0)
+/* EHCI GPIO's on OMAP3EVM (Rev >= E) */
+MUX_CFG_34XX("AH14_34XX_GPIO21", 0x5ea,
+	OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
+MUX_CFG_34XX("AF9_34XX_GPIO22", 0x5ec,
+	OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
+MUX_CFG_34XX("U3_34XX_GPIO61", 0x0c8,
+	OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)

Apologies, but cant the bootloader handle this? do we want to wait for cleanup of mux system before doing this?

Regards,
Nishanth Menon

#14 lore raw

Nishanth,

Quoted 15 lines
Quoted 15 lines
---
 arch/arm/mach-omap2/mux.c             |    7 +++++++
 arch/arm/plat-omap/include/plat/mux.h |    5 +++++
 2 files changed, 12 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/mux.c +1 -0
index 32c953e..00ad592 100644
@@ -551,6 +551,13 @@ MUX_CFG_34XX("AF13_3430_MMC3_DAT3", 0x5e2,
 MUX_CFG_34XX("AF26_34XX_SYS_NIRQ", 0x1E0,
 		OMAP3_WAKEUP_EN | OMAP34XX_PIN_INPUT_PULLUP |
 		OMAP34XX_MUX_MODE0)
+/* EHCI GPIO's on OMAP3EVM (Rev >= E) */
Quoted 8 lines

arch/arm/mach-omap2/mux.c MUX_CFG_34XX("AF13_3430_MMC3_DAT3", 0x5e2, · line 560

Quoted 6 lines
arch/arm/mach-omap2/mux.c +6 -0
+MUX_CFG_34XX("AH14_34XX_GPIO21", 0x5ea,
+	OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
+MUX_CFG_34XX("AF9_34XX_GPIO22", 0x5ec,
+	OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)
+MUX_CFG_34XX("U3_34XX_GPIO61", 0x0c8,
+	OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP)

Apologies, but cant the bootloader handle this? do we want to wait for cleanup of mux system before doing this?

Bootloader can take care of this but I wanted to remove dependency on uboot. I will wait for others' comment and then revise the patch.

Thanks,
ajay

Quoted 3 lines

Regards,
Nishanth Menon