ARM: OMAP3: Add I2C and network support
Subsystems (3)
PATCH 8/11 ARM: OMAP3: Add I2C and network support
Subject: [PATCH 08/11 v1] ARM: OMAP3: Add I2C and network support
From: Dirk Behme <[email protected]>
Add I2C and network support
--- drivers/i2c/Makefile | 1 drivers/i2c/omap24xx_i2c.c | 132 ++++++++++++++++++++++++++------------------- drivers/net/Makefile | 1 net/eth.c | 5 + 4 files changed, 84 insertions(+), 55 deletions(-)
drivers/i2c/Makefile +1 -0
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o +COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
drivers/i2c/omap24xx_i2c.c +78 -54
283 lines not on this page · raw message
drivers/net/Makefile +1 -0
@@ -69,6 +69,7 @@ COBJS-$(CONFIG_VSC7385_ENET) += vsc7385. COBJS-$(CONFIG_XILINX_EMAC) += xilinx_emac.o COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o COBJS-$(CONFIG_SH_ETHER) += sh_eth.o +COBJS-$(CONFIG_DRIVER_SMC911X) += smc911x.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c)
net/eth.c +4 -1
@@ -508,7 +508,7 @@ extern int emac4xx_miiphy_initialize(bd_extern int mcf52x2_miiphy_initialize (bd_t *bis);extern int ns7520_miiphy_initialize (bd_t *bis);extern int davinci_eth_miiphy_initialize (bd_t *bis); - +extern int eth_init (bd_t *bd);int eth_initialize (bd_t *bis) {
@@ -532,6 +532,9 @@ int eth_initialize(bd_t *bis)#if defined(CONFIG_DRIVER_TI_EMAC )davinci_eth_miiphy_initialize (bis);#endif +#if defined(CONFIG_DRIVER_SMC911X ) +eth_init (bis); +#endif return 0; }#endif
PATCH 8/11 ARM: OMAP3: Add I2C and network support
Quoted 7 lines · dirk.behme at googlemail.com
Subject: [PATCH 08/11 v1] ARM: OMAP3: Add I2C and network support
From: Dirk Behme <[email protected]>
Add I2C and network support
I2C and network bits are kinda unrelated, don't you think? <snip>
Quoted 14 lines
Index:
u-boot_master/net/eth.c
===================================================================net/eth.c +1
-1@@ -508,7 +508,7 @@ extern int emac4xx_miiphy_initialize(bd_extern int mcf52x2_miiphy_initialize (bd_t *bis);extern int ns7520_miiphy_initialize (bd_t *bis);extern int davinci_eth_miiphy_initialize (bd_t *bis); - +extern int eth_init (bd_t *bd);int eth_initialize (bd_t *bis) {
net/eth.c int eth_initialize(bd_t *bis) · line 537
Quoted 6 lines
net/eth.c +2
-0@@ -532,6 +532,9 @@ int eth_initialize(bd_t *bis)#if defined(CONFIG_DRIVER_TI_EMAC )davinci_eth_miiphy_initialize (bis);#endif +#if defined(CONFIG_DRIVER_SMC911X ) +eth_init (bis);
This isn't the right place to call eth_init(). I know the namespaces are pretty convoluted, but the eth_initialize() family of functions are intended to do things like register devices, initialize data structures etc. without actually enabling the device. eth_init() enables a device. The SMC911X driver doesn' t have such a thing, which is why none of the other boards that use this chip have anything in this file.
Quoted 9 lines
net/eth.c +1
-0+#endif return 0 ; }#endif
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH 8/11 ARM: OMAP3: Add I2C and network support
Quoted 4 lines · Ben Warren
Quoted 2 lines · dirk.behme at googlemail.com
Subject: [PATCH 08/11 v1] ARM: OMAP3: Add I2C and network support
Quoted 8 lines
Quoted 5 lines
From: Dirk Behme <[email protected]>
Add I2C and network support
I2C and network bits are kinda unrelated, don't you think? <snip>
Ben: Yes, you are right ;) The OMAP3 patch is ~300k and I tried to put this in as less patches as possible while having no patch > 40k. This resulted in some more or less unrelated code in one patch. Alternative would be to have more than the ~11 patches at the list we already have.
Quoted 11 lines
Quoted 11 lines
Index:
u-boot_master/net/eth.c
===================================================================net/eth.c +1
-1@@ -508,7 +508,7 @@ extern int emac4xx_miiphy_initialize(bd_extern int mcf52x2_miiphy_initialize (bd_t *bis);extern int ns7520_miiphy_initialize (bd_t *bis);extern int davinci_eth_miiphy_initialize (bd_t *bis); - +extern int eth_init (bd_t *bd);
Quoted 16 lines
net/eth.c int eth_initialize(bd_t *bis) · line 537
Quoted 9 lines
net/eth.c +2
-0int eth_initialize (bd_t *bis) {@@ -532,6 +532,9 @@ int eth_initialize(bd_t *bis)#if defined(CONFIG_DRIVER_TI_EMAC )davinci_eth_miiphy_initialize (bis);#endif +#if defined(CONFIG_DRIVER_SMC911X ) +eth_init (bis);This isn't the right place to call
eth_init(). I know the namespaces are pretty convoluted, but theeth_initialize()family of functions are intended to do things like register devices, initialize data structures etc. without actually enabling the device.eth_init()enables a device. The SMC911X driver doesn' t have such a thing, which is why none of the other boards that use this chip have anything in this file.
Mani, Steve: Any comments on this?
Ben: Any hint where in existing code it is done right to take this as example?
Thanks
Dirk
PATCH 8/11 ARM: OMAP3: Add I2C and network support
Quoted 48 lines · Dirk Behme
Quoted 4 lines · Ben Warren
Quoted 2 lines · dirk.behme at googlemail.com
Subject: [PATCH 08/11 v1] ARM: OMAP3: Add I2C and network support
Quoted 8 lines
Quoted 5 lines
From: Dirk Behme <[email protected]>
Add I2C and network support
I2C and network bits are kinda unrelated, don't you think? <snip>
Ben: Yes, you are right ;) The OMAP3 patch is ~300k and I tried to put this in as less patches as possible while having no patch > 40k. This resulted in some more or less unrelated code in one patch. Alternative would be to have more than the ~11 patches at the list we already have.
Quoted 21 lines
Quoted 14 lines
Index:
u-boot_master/net/eth.c
===================================================================net/eth.c +1
-1@@ -508,7 +508,7 @@ extern int emac4xx_miiphy_initialize(bd_extern int mcf52x2_miiphy_initialize (bd_t *bis);extern int ns7520_miiphy_initialize (bd_t *bis);extern int davinci_eth_miiphy_initialize (bd_t *bis); - +extern int eth_init (bd_t *bd);int eth_initialize (bd_t *bis) {net/eth.c int eth_initialize(bd_t *bis) · line 537
Quoted 6 lines
net/eth.c +2
-0@@ -532,6 +532,9 @@ int eth_initialize(bd_t *bis)#if defined(CONFIG_DRIVER_TI_EMAC )davinci_eth_miiphy_initialize (bis);#endif +#if defined(CONFIG_DRIVER_SMC911X ) +eth_init (bis);Quoted 7 lines
This isn't the right place to call
eth_init(). I know the namespaces are pretty convoluted, but theeth_initialize()family of functions are intended to do things like register devices, initialize data structures etc. without actually enabling the device.eth_init()enables a device. The SMC911X driver doesn' t have such a thing, which is why none of the other boards that use this chip have anything in this file.
Quoted 5 lines
Mani, Steve: Any comments on this?
Ben: Any hint where in existing code it is done right to take this as example?
eth_init() will get called in NetLoop() (net/net.c) whenever you send a packet. You should never have to call it explicitly. There doesn't appear to be a separate driver initialization for this controller.
Quoted 3 lines
Thanks
Dirk
regards,
Ben