Skip to contentSkip to conversation

TI: OMAP3: Overo Tobi ethernet support

PATCH New Olof Johansson 11 participants 74 messages Sep 11, 2009 – Oct 10, 2009 1 message not in the archive Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

board/overo/overo.c +60 -0
index dd6d286..4a67360 100644
@@ -32,6 +32,7 @@
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
 #include "overo.h"
@@ -62,6 +63,10 @@ int misc_init_r(void)
 	twl4030_power_init();
 	twl4030_led_init();
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	setup_net_chip();
+#endif
+
 	dieid_num_r();
 
 	return 0;
@@ -76,4 +81,59 @@ int misc_init_r(void)
 void set_muxconf_regs(void)
 {
 	MUX_OVERO();
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	MUX_OVERO_TOBI();
+#endif
+}
+
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *	      Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+	struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
+	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+	/* Configure GPMC registers */
+	writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+	writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+	writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+	writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+	writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+	writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+	writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+	/* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+	writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+	/* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+		&ctrl_base->gpmc_nadv_ale);
+
+	/* Make GPIO 64 as output pin */
+	writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);
+
+	/* Now send a pulse on the GPIO pin */
+	writel(GPIO0, &gpio3_base->setdataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->cleardataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->setdataout);
+}
+#endif
+
+
+
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC911X
+	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+	return rc;
 }
+
board/overo/overo.h +40 -0
index 0b59120..f0ec18a 100644
@@ -33,6 +33,8 @@ const omap3_sysinfo sysinfo = {
 #endif
 };
 
+static void setup_net_chip(void);
+
 /*
  * IEN  - Input Enable
  * IDIS - Input Disable
@@ -378,4 +380,42 @@ const omap3_sysinfo sysinfo = {
  MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  | M0)) /*sdrc_cke0*/\
  MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTU | EN  | M0)) /*sdrc_cke1*/
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+#define MUX_OVERO_TOBI() \
+ MUX_VAL(CP(GPMC_A1),		(IDIS | PTU | EN  | M0)) /*GPMC_A1*/\
+ MUX_VAL(CP(GPMC_A2),		(IDIS | PTU | EN  | M0)) /*GPMC_A2*/\
+ MUX_VAL(CP(GPMC_A3),		(IDIS | PTU | EN  | M0)) /*GPMC_A3*/\
+ MUX_VAL(CP(GPMC_A4),		(IDIS | PTU | EN  | M0)) /*GPMC_A4*/\
+ MUX_VAL(CP(GPMC_A5),		(IDIS | PTU | EN  | M0)) /*GPMC_A5*/\
+ MUX_VAL(CP(GPMC_A6),		(IDIS | PTU | EN  | M0)) /*GPMC_A6*/\
+ MUX_VAL(CP(GPMC_A7),		(IDIS | PTU | EN  | M0)) /*GPMC_A7*/\
+ MUX_VAL(CP(GPMC_A8),		(IDIS | PTU | EN  | M0)) /*GPMC_A8*/\
+ MUX_VAL(CP(GPMC_A9),		(IDIS | PTU | EN  | M0)) /*GPMC_A9*/\
+ MUX_VAL(CP(GPMC_A10),		(IDIS | PTU | EN  | M0)) /*GPMC_A10*/\
+ MUX_VAL(CP(GPMC_D0),		(IEN  | PTU | EN  | M0)) /*GPMC_D0*/\
+ MUX_VAL(CP(GPMC_D1),		(IEN  | PTU | EN  | M0)) /*GPMC_D1*/\
+ MUX_VAL(CP(GPMC_D2),		(IEN  | PTU | EN  | M0)) /*GPMC_D2*/\
+ MUX_VAL(CP(GPMC_D3),		(IEN  | PTU | EN  | M0)) /*GPMC_D3*/\
+ MUX_VAL(CP(GPMC_D4),		(IEN  | PTU | EN  | M0)) /*GPMC_D4*/\
+ MUX_VAL(CP(GPMC_D5),		(IEN  | PTU | EN  | M0)) /*GPMC_D5*/\
+ MUX_VAL(CP(GPMC_D6),		(IEN  | PTU | EN  | M0)) /*GPMC_D6*/\
+ MUX_VAL(CP(GPMC_D7),		(IEN  | PTU | EN  | M0)) /*GPMC_D7*/\
+ MUX_VAL(CP(GPMC_D8),		(IEN  | PTU | EN  | M0)) /*GPMC_D8*/\
+ MUX_VAL(CP(GPMC_D9),		(IEN  | PTU | EN  | M0)) /*GPMC_D9*/\
+ MUX_VAL(CP(GPMC_D10),		(IEN  | PTU | EN  | M0)) /*GPMC_D10*/\
+ MUX_VAL(CP(GPMC_D11),		(IEN  | PTU | EN  | M0)) /*GPMC_D11*/\
+ MUX_VAL(CP(GPMC_D12),		(IEN  | PTU | EN  | M0)) /*GPMC_D12*/\
+ MUX_VAL(CP(GPMC_D13),		(IEN  | PTU | EN  | M0)) /*GPMC_D13*/\
+ MUX_VAL(CP(GPMC_D14),		(IEN  | PTU | EN  | M0)) /*GPMC_D14*/\
+ MUX_VAL(CP(GPMC_D15),		(IEN  | PTU | EN  | M0)) /*GPMC_D15*/\
+ MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS5*/\
+ MUX_VAL(CP(GPMC_CLK),		(IDIS | PTU | EN  | M0)) /*GPMC_CLK*/\
+ MUX_VAL(CP(GPMC_WAIT2),	(IEN  | PTU | EN  | M4)) /*GPIO_64*/\
+							 /* - SMSC911X_NRES*/\
+ MUX_VAL(CP(MCSPI1_CS2),	(IEN  | PTU | DIS | M4)) /*GPIO_176 */\
+							 /* - LAN_INTR */\
+
+
+#endif
+
 #endif
include/configs/omap3_overo.h +21 -2
index 07a031b..6616b55 100644
@@ -28,7 +28,8 @@
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3430		1	/* which is in a 3430 */
-#define CONFIG_OMAP3_OVERO		1	/* working with overo */
+#define CONFIG_OMAP3_OVERO	1	/* working with overo */
+//#define CONFIG_OMAP3_OVERO_TOBI	1	/* overo mounted on tobi */
 
 #include <asm/arch/cpu.h>	/* get chip and board defs */
 #include <asm/arch/omap3.h>
@@ -105,9 +106,13 @@
 #undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
 #undef CONFIG_CMD_IMI		/* iminfo			*/
 #undef CONFIG_CMD_IMLS		/* List all found images	*/
-#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 #undef CONFIG_CMD_NFS		/* NFS support			*/
 
+#if !defined(CONFIG_OMAP3_OVERO_TOBI)
+#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#endif
+
+
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_I2C_SPEED		100000
 #define CONFIG_SYS_I2C_SLAVE		1
@@ -293,4 +298,18 @@ extern unsigned int boot_flash_sec;
 extern unsigned int boot_flash_type;
 #endif
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*----------------------------------------------------------------------------
+ * SMSC9115 Ethernet from SMSC9118 family
+ *----------------------------------------------------------------------------
+ */
+
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X		1
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE     0x2C000000
+
+#endif /* (CONFIG_CMD_NET) */
+
+
 #endif				/* __CONFIG_H */
#1 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 8 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Quoted 192 lines
board/overo/overo.c +60 -0
index dd6d286..4a67360 100644
@@ -32,6 +32,7 @@
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
 #include "overo.h"
@@ -62,6 +63,10 @@ int misc_init_r(void)
 	twl4030_power_init();
 	twl4030_led_init();
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	setup_net_chip();
+#endif
+
 	dieid_num_r();
 
 	return 0;
@@ -76,4 +81,59 @@ int misc_init_r(void)
 void set_muxconf_regs(void)
 {
 	MUX_OVERO();
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	MUX_OVERO_TOBI();
+#endif
+}
+
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *	      Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+	struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
+	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+	/* Configure GPMC registers */
+	writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+	writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+	writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+	writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+	writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+	writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+	writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+	/* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+	writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+	/* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+		&ctrl_base->gpmc_nadv_ale);
+
+	/* Make GPIO 64 as output pin */
+	writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);
+
+	/* Now send a pulse on the GPIO pin */
+	writel(GPIO0, &gpio3_base->setdataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->cleardataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->setdataout);
+}
+#endif
+
+
+
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC911X
+	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+	return rc;
 }
+
board/overo/overo.h +40 -0
index 0b59120..f0ec18a 100644
@@ -33,6 +33,8 @@ const omap3_sysinfo sysinfo = {
 #endif
 };
 
+static void setup_net_chip(void);
+
 /*
  * IEN  - Input Enable
  * IDIS - Input Disable
@@ -378,4 +380,42 @@ const omap3_sysinfo sysinfo = {
  MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  | M0)) /*sdrc_cke0*/\
  MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTU | EN  | M0)) /*sdrc_cke1*/
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+#define MUX_OVERO_TOBI() \
+ MUX_VAL(CP(GPMC_A1),		(IDIS | PTU | EN  | M0)) /*GPMC_A1*/\
+ MUX_VAL(CP(GPMC_A2),		(IDIS | PTU | EN  | M0)) /*GPMC_A2*/\
+ MUX_VAL(CP(GPMC_A3),		(IDIS | PTU | EN  | M0)) /*GPMC_A3*/\
+ MUX_VAL(CP(GPMC_A4),		(IDIS | PTU | EN  | M0)) /*GPMC_A4*/\
+ MUX_VAL(CP(GPMC_A5),		(IDIS | PTU | EN  | M0)) /*GPMC_A5*/\
+ MUX_VAL(CP(GPMC_A6),		(IDIS | PTU | EN  | M0)) /*GPMC_A6*/\
+ MUX_VAL(CP(GPMC_A7),		(IDIS | PTU | EN  | M0)) /*GPMC_A7*/\
+ MUX_VAL(CP(GPMC_A8),		(IDIS | PTU | EN  | M0)) /*GPMC_A8*/\
+ MUX_VAL(CP(GPMC_A9),		(IDIS | PTU | EN  | M0)) /*GPMC_A9*/\
+ MUX_VAL(CP(GPMC_A10),		(IDIS | PTU | EN  | M0)) /*GPMC_A10*/\
+ MUX_VAL(CP(GPMC_D0),		(IEN  | PTU | EN  | M0)) /*GPMC_D0*/\
+ MUX_VAL(CP(GPMC_D1),		(IEN  | PTU | EN  | M0)) /*GPMC_D1*/\
+ MUX_VAL(CP(GPMC_D2),		(IEN  | PTU | EN  | M0)) /*GPMC_D2*/\
+ MUX_VAL(CP(GPMC_D3),		(IEN  | PTU | EN  | M0)) /*GPMC_D3*/\
+ MUX_VAL(CP(GPMC_D4),		(IEN  | PTU | EN  | M0)) /*GPMC_D4*/\
+ MUX_VAL(CP(GPMC_D5),		(IEN  | PTU | EN  | M0)) /*GPMC_D5*/\
+ MUX_VAL(CP(GPMC_D6),		(IEN  | PTU | EN  | M0)) /*GPMC_D6*/\
+ MUX_VAL(CP(GPMC_D7),		(IEN  | PTU | EN  | M0)) /*GPMC_D7*/\
+ MUX_VAL(CP(GPMC_D8),		(IEN  | PTU | EN  | M0)) /*GPMC_D8*/\
+ MUX_VAL(CP(GPMC_D9),		(IEN  | PTU | EN  | M0)) /*GPMC_D9*/\
+ MUX_VAL(CP(GPMC_D10),		(IEN  | PTU | EN  | M0)) /*GPMC_D10*/\
+ MUX_VAL(CP(GPMC_D11),		(IEN  | PTU | EN  | M0)) /*GPMC_D11*/\
+ MUX_VAL(CP(GPMC_D12),		(IEN  | PTU | EN  | M0)) /*GPMC_D12*/\
+ MUX_VAL(CP(GPMC_D13),		(IEN  | PTU | EN  | M0)) /*GPMC_D13*/\
+ MUX_VAL(CP(GPMC_D14),		(IEN  | PTU | EN  | M0)) /*GPMC_D14*/\
+ MUX_VAL(CP(GPMC_D15),		(IEN  | PTU | EN  | M0)) /*GPMC_D15*/\
+ MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS5*/\
+ MUX_VAL(CP(GPMC_CLK),		(IDIS | PTU | EN  | M0)) /*GPMC_CLK*/\
+ MUX_VAL(CP(GPMC_WAIT2),	(IEN  | PTU | EN  | M4)) /*GPIO_64*/\
+							 /* - SMSC911X_NRES*/\
+ MUX_VAL(CP(MCSPI1_CS2),	(IEN  | PTU | DIS | M4)) /*GPIO_176 */\
+							 /* - LAN_INTR */\
+
+
+#endif
+
 #endif
include/configs/omap3_overo.h +21 -2
index 07a031b..6616b55 100644
@@ -28,7 +28,8 @@
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3430		1	/* which is in a 3430 */
-#define CONFIG_OMAP3_OVERO		1	/* working with overo */
+#define CONFIG_OMAP3_OVERO	1	/* working with overo */
+//#define CONFIG_OMAP3_OVERO_TOBI	1	/* overo mounted on tobi */
 
 #include <asm/arch/cpu.h>	/* get chip and board defs */
 #include <asm/arch/omap3.h>
@@ -105,9 +106,13 @@
 #undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
 #undef CONFIG_CMD_IMI		/* iminfo			*/
 #undef CONFIG_CMD_IMLS		/* List all found images	*/
-#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 #undef CONFIG_CMD_NFS		/* NFS support			*/
 
+#if !defined(CONFIG_OMAP3_OVERO_TOBI)
+#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#endif
+
+
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_I2C_SPEED		100000
 #define CONFIG_SYS_I2C_SLAVE		1
@@ -293,4 +298,18 @@ extern unsigned int boot_flash_sec;
 extern unsigned int boot_flash_type;
 #endif
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*----------------------------------------------------------------------------
+ * SMSC9115 Ethernet from SMSC9118 family
+ *----------------------------------------------------------------------------
+ */
+
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X		1
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE     0x2C000000
+
+#endif /* (CONFIG_CMD_NET) */
+
+
 #endif				/* __CONFIG_H */

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#2 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 6 lines
Quoted 3 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Quoted 7 lines
Quoted 5 lines

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Pushed to u-boot-ti

-Sandeep

#3 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 9 lines · Sandeep
Quoted 9 lines
Quoted 8 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in
this case).

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Pushed to u-boot-ti

Thanks!

Random question on u-boot development process: I see you didn't add your signed-off on the commit. People don't do that when they check in patches to the u-boot trees?

-Olof

#4 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 17 lines
Quoted 11 lines
Quoted 11 lines
Quoted 8 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in
this case).

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Pushed to u-boot-ti

Quoted 8 lines

Thanks!

Random question on u-boot development process: I see you didn't add your signed-off on the commit. People don't do that when they check in patches to the u-boot trees?

-Olof

Well look at these 2 examples. Both are my patches, one of them applied by Ben Warren and one by Jean-Christophe

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commitdiff;h=b3af1d698b031e721bacaee8715d79daaf823de6

The above has a signed-off by Ben

But the below committed by Jean-Christophe does not have his signed-off-by

http://git.denx.de/?p=u-boot.git;a=commitdiff;h=fcaac589a68115819ddadcf5c18ded9a5f9e2c75

Thanks,
Sandeep

#5 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 31 lines · Sandeep
Quoted 17 lines
Quoted 11 lines
Quoted 11 lines
Quoted 8 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in
this case).

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Pushed to u-boot-ti

Quoted 8 lines

Thanks!

Random question on u-boot development process: I see you didn't add your signed-off on the commit. People don't do that when they check in patches to the u-boot trees?

-Olof

Well look at these 2 examples. Both are my patches, one of them applied by Ben Warren and one by Jean-Christophe

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commitdiff;h=b3af1d698b031e721bacaee8715d79daaf823de6

Quoted 8 lines

The above has a signed-off by Ben

But the below committed by Jean-Christophe does not have his signed-off-by

http://git.denx.de/?p=u-boot.git;a=commitdiff;h=fcaac589a68115819ddadcf5c18ded9a5f9e2c75

I always use 'git am -s', which adds the SOB. My understanding is that

maintainers should do this as an indication of approval and help in traceability.

regards,
Ben

#6 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 7 lines

I always use 'git am -s', which adds the SOB. My understanding is that maintainers should do this as an indication of approval and help in traceability.

regards,
Ben

OK Thanks. Shall do so henceforth.

Regards,
Sandeep

#7 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Dear "Paulraj, Sandeep",

Quoted 4 lines · In message <[email protected]> you…
Quoted 2 lines

I always use 'git am -s', which adds the SOB. My understanding is that maintainers should do this as an indication of approval and help in traceability.

OK Thanks. Shall do so henceforth.

Hm. I have to amit that I don't consider this a change to the better.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
No man knows what true happiness is until he gets married.  By  then,
of course, its too late.
#8 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Ben Warren

Dear Ben Warren,

Quoted 4 lines · In message <[email protected]> you…
Quoted 2 lines

I always use 'git am -s', which adds the SOB. My understanding is that

maintainers should do this as an indication of approval and help in traceability.

Please feel free to do that, but I consider this just adding line-noise, unless you _really_ express special approval.

Which sense would it make if I added a s-o-b to each and every commit I'm pulling in from anywhere?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Man is the best computer we can put aboard a spacecraft ...  and  the
only one that can be mass produced with unskilled labor.
                                                  - Wernher von Braun
#9 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 7 lines · Wolfgang Denk

Dear Ben Warren,

In message <[email protected]

Quoted 4 lines
Quoted 2 lines · you

I always use 'git am -s', which adds the SOB. My understanding
is that

Quoted 8 lines
Quoted 2 lines

maintainers should do this as an indication of approval and help in traceability.

Please feel free to do that, but I consider this just adding line-noise, unless you _really_ express special approval.

Which sense would it make if I added a s-o-b to each and every commit I'm pulling in from anywhere?

You're not pulling it, you are applying it. And the s-o-b is used to show the paper trail of who has touched it. So all you should need to backtrack the source of the code change is the list of the s-o-bs.

S-o-b is not an approval of the technical merits of the change. It's a pure bookkeeping measure to tell where a piece of code came from and who handled it on the way.

BUT in addition to this it's really useful for a newbie like me to see who to send a patch to, since it shows the list of maintainership (up to the first person that submits his work through git pulls, but that seems nonexistent for non-maintainers in u-boot anyway :)

-Olof

#10 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Dear Olof Johansson,

Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 6 lines

Please feel free to do that, but I consider this just adding line-noise, unless you _really_ express special approval.

Which sense would it make if I added a s-o-b to each and every commit I'm pulling in from anywhere?

You're not pulling it, you are applying it. And the s-o-b is used to show the paper trail of who has touched it. So all you should need to backtrack the source of the code change is the list of the s-o-bs.

What is the difference between a "git pull" from some remote repo and the "git am" of a patch posted on the mailing list? In both cases I do _not_ touch the patch, and the result looks the same, too.

Quoted 3 lines

S-o-b is not an approval of the technical merits of the change. It's a pure bookkeeping measure to tell where a piece of code came from and who handled it on the way.

If the "handling" is just a technical operation which does not modify a single bit of the content I see no reason to add lines of s-o-b. Hey, I use several stages of repositories, and a number or branches here and there. Should I every time I pull from here or cherry-pick from there or format-patch + am somewhere else add a s-o-b? This makes zero sense to me.

Quoted 4 lines

BUT in addition to this it's really useful for a newbie like me to see who to send a patch to, since it shows the list of maintainership (up to the first person that submits his work through git pulls, but that seems nonexistent for non-maintainers in u-boot anyway :)

Did you try looking at the list of custodians?
http://www.denx.de/wiki/U-Boot/Custodians

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It usually takes more than three weeks to prepare  a  good  impromptu
speech.                                                  - Mark Twain
#11 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 24 lines · Wolfgang Denk

Dear Olof Johansson,

Quoted 11 lines · In message <[email protected]> you wrote:
Quoted 7 lines

Please feel free to do that, but I consider this just adding line-noise, unless you _really_ express special approval.

Which sense would it make if I added a s-o-b to each and every commit
I'm pulling in from anywhere?

You're not pulling it, you are applying it. And the s-o-b is used to show the paper trail of who has touched it. So all you should need to backtrack the source of the code change is the list of the s-o-bs.

What is the difference between a "git pull" from some remote repo and the "git am" of a patch posted on the mailing list? In both cases I do _not_ touch the patch, and the result looks the same, too.

Quoted 4 lines

S-o-b is not an approval of the technical merits of the change. It's a
pure bookkeeping measure to tell where a piece of code came from and who handled it on the way.

Quoted 6 lines

If the "handling" is just a technical operation which does not modify a single bit of the content I see no reason to add lines of s-o-b. Hey, I use several stages of repositories, and a number or branches here and there. Should I every time I pull from here or cherry-pick from there or format-patch + am somewhere else add a s-o-b? This makes zero sense to me.

I guess you don't see what the difference between applying a patch and pulling a tree is.

Anyway, it really doesn't matter much to me, it just confused me. It's your project and you can do with it as you please, there's no use in arguing over it. It just happens to be opposite to the principle of another large project using similar signed-off methods.

Quoted 8 lines
Quoted 5 lines

BUT in addition to this it's really useful for a newbie like me to see
who to send a patch to, since it shows the list of maintainership (up to the first person that submits his work through git pulls, but that seems nonexistent for non-maintainers in u-boot anyway :)

Did you try looking at the list of custodians?
http://www.denx.de/wiki/U-Boot/Custodians

I'm not saying there aren't other ways to do it, just that it's the one that made sense for me: Look at other files near where you are changing, and see the merge path.

-Olof

#12 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Dear Olof Johansson,

Quoted 3 lines · In message <[email protected]> you wrote:

I guess you don't see what the difference between applying a patch and pulling a tree is.

Indeed I don't. Isn't pulling a tree the same as applying a number of patches using soem highly efficient command?

Quoted 4 lines

Anyway, it really doesn't matter much to me, it just confused me. It's your project and you can do with it as you please, there's no use in arguing over it. It just happens to be opposite to the principle of another large project using similar signed-off methods.

Well, I'm willing to learn, but I'm an old man and a pighead at that. I need good reason to change my mind, and so far I really see none. If you could help this will be appreciated.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Leave bigotry in your quarters; there's no room for it on the bridge.
	-- Kirk, "Balance of Terror", stardate 1709.2
#13 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Olof Johansson

Dear Olof Johansson,

Quoted 4 lines · In message <[email protected]> you wrote:

Random question on u-boot development process: I see you didn't add your signed-off on the commit. People don't do that when they check in patches to the u-boot trees?

No, we don't do this if we check in an unchanged patch.

Linus does not S-o-b all patches that go into the Linux kernel, or does he?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"What the scientists have in their briefcases is terrifying."
- Nikita Khrushchev
#14 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 9 lines · Wolfgang Denk

Dear Olof Johansson,

Quoted 5 lines · In message <[email protected]> you wrote:

Random question on u-boot development process: I see you didn't add your signed-off on the commit. People don't do that when they check in
patches to the u-boot trees?

Quoted 4 lines

No, we don't do this if we check in an unchanged patch.

Linus does not S-o-b all patches that go into the Linux kernel, or does he?

He does.

For example, see http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e258b80e691f1f3ae83a60aa80eaf7322bd55ec4

-Olof

#15 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Dear Olof Johansson,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 3 lines

Linus does not S-o-b all patches that go into the Linux kernel, or does he?

He does.

No, he does not.

Quoted 1 line

For example, see http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e258b80e691f1f3ae83a60aa80eaf7322bd55ec4

See for example
5ac7687860dbfd3dd90e09d2c10dd31de91f20c2
a0f320f48799f67329fcb1b26ff0451c304e1dde
83ba7c34d2b82dc608647f629616df393ab883f9
97572751d78133cf9a5f7165b252bf975f9dd17d
067006a5f5b956fbdd183f9b799e7b8059b53f6c
b21495a03e20514eacd788a6b5d160667177cd94
56327c2a58b76291616f15c9c84a180cf7049645
6d6c971778c5257fc815e1ebe01779fefda6293c
98840f2ce5339d46e1830b0455360ad03a840d9d
39558c8f8e4c48805e702340e1610961d922268a
fcf989216138858003f0c354698260f29e6e10b0
144374dcc3ad0436f0a1bb3095836cf0ec32eebe
edf382bc6d4429d796fc3b26f7a33eaeca9db8ec
4765d681a4dccdc6ded7dd20329f5498aa53b0d0
5d3f33318a6c1f79f89e3dd2c7ddc11e0da14895
b0999cc55bd49e315ec82d2fb770a0d9ef7cbed8
7bd032dc2793afcbaf4a350056768da84cdbd89b
320348c8d5c9b591282633ddb8959b42f7fc7a1c
ff8324df1187b7280e507c976777df76c73a1ef1
74556123e034c8337b69a3ebac2f3a5fc0a97032
...

Let me know if you need more :-)

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The price of curiosity is a terminal experience.
                         - Terry Pratchett, _The Dark Side of the Sun_
#16 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 1 line · Wolfgang Denk

56327c2a58b76291616f15c9c84a180cf7049645

committer Jaswinder Singh Rajput <[email protected]>
Sun, 20 Sep 2009 10:32:20 +0000 (15:32 +0530)

He didn't commit it.

-Olof

#17 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Dear Olof Johansson,

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 1 line · Wolfgang Denk

56327c2a58b76291616f15c9c84a180cf7049645

committer Jaswinder Singh Rajput <[email protected]>
Sun, 20 Sep 2009 10:32:20 +0000 (15:32 +0530)

He didn't commit it.

So?

What is the difference between a "cd here ; git pull there" and a "git format-patch" there followed by a "git am" here?

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The computer programmer is a creator of universes for which he alone
is responsible. Universes of virtually unlimited  complexity  can  be
created  in  the  form  of  computer  programs." - Joseph Weizenbaum,
_Computer Power and Human Reason_
#18 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Wolfgang Denk

Wolfgang Denk a ?crit :

Quoted 8 lines

Dear Olof Johansson,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Linus does not S-o-b all patches that go into the Linux kernel, or does he?

He does.

No, he does not.

Maybe not so off-tropic, Linus have talked precisely about that today:

http://www.tuxradar.com/content/linuxcon-rountable-torvalds-quotes

On documentation:
?In the kernel we have this sign-off process, where patches as they flow through people are supposed to be signed off. And we had legal reasons for doing it initially, and the legal reasons have kind of gone away because nobody worries about SCO very much anymore. But it turns out it?s a really nice flow process, where people actually see how code came in, so it?s nice, and I?m seeing that in a number of non-kernel projects too. So I think there may not be a lot of documentation about how the kernel does it, but I think a lot of open source people do see the kernel model and it actually ends up being, the same way there?s this Unix mindset of how things are supposed to work, I think the kernel model has actually become this mindset of how open source projects are supposed to work, at least for a subset of projects out there.?

Best regards,

Jean-Christian de Rivaz

#19 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Wolfgang Denk
Quoted 12 lines · Wolfgang Denk

Dear Olof Johansson,

Quoted 3 lines · In message <[email protected]> you wrote:

Random question on u-boot development process: I see you didn't add your signed-off on the commit. People don't do that when they check in patches to the u-boot trees?

No, we don't do this if we check in an unchanged patch.

Linus does not S-o-b all patches that go into the Linux kernel, or does he?

This cracks me up.
When is being a SOB ever good? :P

Tom

Quoted 6 lines

Best regards,

Wolfgang Denk

#20 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Paulraj

Dear "Paulraj, Sandeep",

Quoted 9 lines · In message <[email protected]> you…
Quoted 9 lines
Quoted 7 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Pushed to u-boot-ti

Sorry, please see my previous review comments. I apologize for the late review.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Diplomacy is the art of saying "nice doggy" until you can find a rock.
#21 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Olof Johansson
Quoted 10 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Quoted 188 lines
board/overo/overo.c +0 -0
index dd6d286..4a67360 100644
@@ -32,6 +32,7 @@

?#include <twl4030.h>
?#include <asm/io.h>
?#include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
?#include <asm/arch/sys_proto.h>
?#include <asm/mach-types.h>
?#include "overo.h"

board/overo/overo.c +59 -0
@@ -62,6 +63,10 @@ int misc_init_r(void)
 ? ? ? ?twl4030_power_init();
 ? ? ? ?twl4030_led_init();
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+ ? ? ? setup_net_chip();
+#endif
+
 ? ? ? ?dieid_num_r();
 
 ? ? ? ?return 0;
@@ -76,4 +81,59 @@ int misc_init_r(void)
 ?void set_muxconf_regs(void)
 ?{
 ? ? ? ?MUX_OVERO();
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+ ? ? ? MUX_OVERO_TOBI();
+#endif
+}
+
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ * ? ? ? ? ? Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+ ? ? ? struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
+ ? ? ? struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+ ? ? ? /* Configure GPMC registers */
+ ? ? ? writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+ ? ? ? writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+ ? ? ? writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+ ? ? ? writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+ ? ? ? writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+ ? ? ? writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+ ? ? ? writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+ ? ? ? /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+ ? ? ? writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+ ? ? ? /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+ ? ? ? writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+ ? ? ? /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+ ? ? ? writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+ ? ? ? ? ? ? ? &ctrl_base->gpmc_nadv_ale);
+
+ ? ? ? /* Make GPIO 64 as output pin */
+ ? ? ? writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);
+
+ ? ? ? /* Now send a pulse on the GPIO pin */
+ ? ? ? writel(GPIO0, &gpio3_base->setdataout);
+ ? ? ? udelay(1);
+ ? ? ? writel(GPIO0, &gpio3_base->cleardataout);
+ ? ? ? udelay(1);
+ ? ? ? writel(GPIO0, &gpio3_base->setdataout);
+}
+#endif
+
+
+
+int board_eth_init(bd_t *bis)
+{
+ ? ? ? int rc = 0;
+#ifdef CONFIG_SMC911X
+ ? ? ? rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+ ? ? ? return rc;
 ?}
+
board/overo/overo.h +0 -0
index 0b59120..f0ec18a 100644
@@ -33,6 +33,8 @@ const omap3_sysinfo sysinfo = {

?#endif
?};

board/overo/overo.h +2 -0
+static void setup_net_chip(void);
+

?/*
?* IEN ?- Input Enable
?* IDIS - Input Disable

board/overo/overo.h +0 -0
@@ -378,4 +380,42 @@ const omap3_sysinfo sysinfo = {
 ?MUX_VAL(CP(SDRC_CKE0), ? ? ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*sdrc_cke0*/\

?MUX_VAL(CP(SDRC_CKE1), ? ? ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*sdrc_cke1*/

board/overo/overo.h +38 -0
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+#define MUX_OVERO_TOBI() \
+ MUX_VAL(CP(GPMC_A1), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A1*/\
+ MUX_VAL(CP(GPMC_A2), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A2*/\
+ MUX_VAL(CP(GPMC_A3), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A3*/\
+ MUX_VAL(CP(GPMC_A4), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A4*/\
+ MUX_VAL(CP(GPMC_A5), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A5*/\
+ MUX_VAL(CP(GPMC_A6), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A6*/\
+ MUX_VAL(CP(GPMC_A7), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A7*/\
+ MUX_VAL(CP(GPMC_A8), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A8*/\
+ MUX_VAL(CP(GPMC_A9), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A9*/\
+ MUX_VAL(CP(GPMC_A10), ? ? ? ? (IDIS | PTU | EN ?| M0)) /*GPMC_A10*/\
+ MUX_VAL(CP(GPMC_D0), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D0*/\
+ MUX_VAL(CP(GPMC_D1), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D1*/\
+ MUX_VAL(CP(GPMC_D2), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D2*/\
+ MUX_VAL(CP(GPMC_D3), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D3*/\
+ MUX_VAL(CP(GPMC_D4), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D4*/\
+ MUX_VAL(CP(GPMC_D5), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D5*/\
+ MUX_VAL(CP(GPMC_D6), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D6*/\
+ MUX_VAL(CP(GPMC_D7), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D7*/\
+ MUX_VAL(CP(GPMC_D8), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D8*/\
+ MUX_VAL(CP(GPMC_D9), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D9*/\
+ MUX_VAL(CP(GPMC_D10), ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D10*/\
+ MUX_VAL(CP(GPMC_D11), ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D11*/\
+ MUX_VAL(CP(GPMC_D12), ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D12*/\
+ MUX_VAL(CP(GPMC_D13), ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D13*/\
+ MUX_VAL(CP(GPMC_D14), ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D14*/\
+ MUX_VAL(CP(GPMC_D15), ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D15*/\
+ MUX_VAL(CP(GPMC_NCS5), ? ? ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_nCS5*/\
+ MUX_VAL(CP(GPMC_CLK), ? ? ? ? (IDIS | PTU | EN ?| M0)) /*GPMC_CLK*/\
+ MUX_VAL(CP(GPMC_WAIT2), ? ? ? (IEN ?| PTU | EN ?| M4)) /*GPIO_64*/\
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* - SMSC911X_NRES*/\
+ MUX_VAL(CP(MCSPI1_CS2), ? ? ? (IEN ?| PTU | DIS | M4)) /*GPIO_176 */\
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* - LAN_INTR */\
+
+
+#endif
+

?#endif

include/configs/omap3_overo.h +0 -0
index 07a031b..6616b55 100644
@@ -28,7 +28,8 @@

?#define CONFIG_OMAP ? ? ? ? ? ?1 ? ? ? /* in a TI OMAP core */ ?#define CONFIG_OMAP34XX ? ? ? ? ? ? ? ?1 ? ? ? /* which is a 34XX */ ?#define CONFIG_OMAP3430 ? ? ? ? ? ? ? ?1 ? ? ? /* which is in a 3430 */

include/configs/omap3_overo.h +2 -1
-#define CONFIG_OMAP3_OVERO ? ? ? ? ? ? 1 ? ? ? /* working with overo */
+#define CONFIG_OMAP3_OVERO ? ? 1 ? ? ? /* working with overo */
+//#define CONFIG_OMAP3_OVERO_TOBI ? ? ?1 ? ? ? /* overo mounted on tobi */

?#include <asm/arch/cpu.h> ? ? ?/* get chip and board defs */ ?#include <asm/arch/omap3.h>

include/configs/omap3_overo.h +0 -0
@@ -105,9 +106,13 @@

?#undef CONFIG_CMD_FPGA ? ? ? ? /* FPGA configuration Support ? */ ?#undef CONFIG_CMD_IMI ? ? ? ? ?/* iminfo ? ? ? ? ? ? ? ? ? ? ? */ ?#undef CONFIG_CMD_IMLS ? ? ? ? /* List all found images ? ? ? ?*/ -#undef CONFIG_CMD_NET ? ? ? ? ?/* bootp, tftpboot, rarpboot ? ?*/ ?#undef CONFIG_CMD_NFS ? ? ? ? ?/* NFS support ? ? ? ? ? ? ? ? ?*/

include/configs/omap3_overo.h +5 -0
+#if !defined(CONFIG_OMAP3_OVERO_TOBI)
+#undef CONFIG_CMD_NET ? ? ? ? ?/* bootp, tftpboot, rarpboot ? ?*/
+#endif
+
+

?#define CONFIG_SYS_NO_FLASH
?#define CONFIG_SYS_I2C_SPEED ? ? ? ? ? 100000
?#define CONFIG_SYS_I2C_SLAVE ? ? ? ? ? 1

include/configs/omap3_overo.h +0 -0
@@ -293,4 +298,18 @@ extern unsigned int boot_flash_sec;
 ?extern unsigned int boot_flash_type;

?#endif

include/configs/omap3_overo.h +14 -0
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*----------------------------------------------------------------------------
+ * SMSC9115 Ethernet from SMSC9118 family
+ *----------------------------------------------------------------------------
+ */
+
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X ? ? ? ? 1
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE ? ? 0x2C000000
+
+#endif /* (CONFIG_CMD_NET) */
+
+

?#endif ? ? ? ? ? ? ? ? ? ? ? ? /* __CONFIG_H */

#22 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Olof Johansson

Dear Olof Johansson,

board/overo/overo.c

Quoted 12 lines · In message <[email protected]> you wrote:

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

board/overo/overo.c +0 -0
index dd6d286..4a67360 100644

Please use "git format-patch" / "git send-email" to create and submit patches. For example, it is always nice to see a file statistics in the patch.

Quoted 39 lines
board/overo/overo.h +26 -0
@@ -33,6 +33,8 @@ const omap3_sysinfo sysinfo = {
 #endif
 };
 
+static void setup_net_chip(void);
+
 /*
  * IEN  - Input Enable
  * IDIS - Input Disable
@@ -378,4 +380,42 @@ const omap3_sysinfo sysinfo = {
  MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  | M0)) /*sdrc_cke0*/\
  MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTU | EN  | M0)) /*sdrc_cke1*/
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+#define MUX_OVERO_TOBI() \
+ MUX_VAL(CP(GPMC_A1),		(IDIS | PTU | EN  | M0)) /*GPMC_A1*/\
+ MUX_VAL(CP(GPMC_A2),		(IDIS | PTU | EN  | M0)) /*GPMC_A2*/\
+ MUX_VAL(CP(GPMC_A3),		(IDIS | PTU | EN  | M0)) /*GPMC_A3*/\
+ MUX_VAL(CP(GPMC_A4),		(IDIS | PTU | EN  | M0)) /*GPMC_A4*/\
+ MUX_VAL(CP(GPMC_A5),		(IDIS | PTU | EN  | M0)) /*GPMC_A5*/\
+ MUX_VAL(CP(GPMC_A6),		(IDIS | PTU | EN  | M0)) /*GPMC_A6*/\
+ MUX_VAL(CP(GPMC_A7),		(IDIS | PTU | EN  | M0)) /*GPMC_A7*/\
+ MUX_VAL(CP(GPMC_A8),		(IDIS | PTU | EN  | M0)) /*GPMC_A8*/\
+ MUX_VAL(CP(GPMC_A9),		(IDIS | PTU | EN  | M0)) /*GPMC_A9*/\
+ MUX_VAL(CP(GPMC_A10),		(IDIS | PTU | EN  | M0)) /*GPMC_A10*/\
+ MUX_VAL(CP(GPMC_D0),		(IEN  | PTU | EN  | M0)) /*GPMC_D0*/\
+ MUX_VAL(CP(GPMC_D1),		(IEN  | PTU | EN  | M0)) /*GPMC_D1*/\
+ MUX_VAL(CP(GPMC_D2),		(IEN  | PTU | EN  | M0)) /*GPMC_D2*/\
+ MUX_VAL(CP(GPMC_D3),		(IEN  | PTU | EN  | M0)) /*GPMC_D3*/\
+ MUX_VAL(CP(GPMC_D4),		(IEN  | PTU | EN  | M0)) /*GPMC_D4*/\
+ MUX_VAL(CP(GPMC_D5),		(IEN  | PTU | EN  | M0)) /*GPMC_D5*/\
+ MUX_VAL(CP(GPMC_D6),		(IEN  | PTU | EN  | M0)) /*GPMC_D6*/\
+ MUX_VAL(CP(GPMC_D7),		(IEN  | PTU | EN  | M0)) /*GPMC_D7*/\
+ MUX_VAL(CP(GPMC_D8),		(IEN  | PTU | EN  | M0)) /*GPMC_D8*/\
+ MUX_VAL(CP(GPMC_D9),		(IEN  | PTU | EN  | M0)) /*GPMC_D9*/\
+ MUX_VAL(CP(GPMC_D10),		(IEN  | PTU | EN  | M0)) /*GPMC_D10*/\
+ MUX_VAL(CP(GPMC_D11),		(IEN  | PTU | EN  | M0)) /*GPMC_D11*/\

board/overo/overo.h const omap3_sysinfo sysinfo = { · line 416

Quoted 10 lines
board/overo/overo.h +10 -0
+ MUX_VAL(CP(GPMC_D12),		(IEN  | PTU | EN  | M0)) /*GPMC_D12*/\
+ MUX_VAL(CP(GPMC_D13),		(IEN  | PTU | EN  | M0)) /*GPMC_D13*/\
+ MUX_VAL(CP(GPMC_D14),		(IEN  | PTU | EN  | M0)) /*GPMC_D14*/\
+ MUX_VAL(CP(GPMC_D15),		(IEN  | PTU | EN  | M0)) /*GPMC_D15*/\
+ MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS5*/\
+ MUX_VAL(CP(GPMC_CLK),		(IDIS | PTU | EN  | M0)) /*GPMC_CLK*/\
+ MUX_VAL(CP(GPMC_WAIT2),	(IEN  | PTU | EN  | M4)) /*GPIO_64*/\
+							 /* - SMSC911X_NRES*/\
+ MUX_VAL(CP(MCSPI1_CS2),	(IEN  | PTU | DIS | M4)) /*GPIO_176 */\
+							 /* - LAN_INTR */\

Please use either no indentatioin at all, or indent by a multiple of TAB characters.

include/configs/omap3_overo.h line 32

Quoted 11 lines
include/configs/omap3_overo.h +2 -1
index 07a031b..6616b55 100644
@@ -28,7 +28,8 @@
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3430		1	/* which is in a 3430 */
-#define CONFIG_OMAP3_OVERO		1	/* working with overo */
+#define CONFIG_OMAP3_OVERO	1	/* working with overo */
+//#define CONFIG_OMAP3_OVERO_TOBI	1	/* overo mounted on tobi */

Please do not use an C++ comments, and do not add dead code.

include/configs/omap3_overo.h line 115

Quoted 5 lines
include/configs/omap3_overo.h +5 -0
+#if !defined(CONFIG_OMAP3_OVERO_TOBI)
+#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#endif
+
+

Only one blank line, please.

include/configs/omap3_overo.h extern unsigned int boot_flash_sec; · line 314

Quoted 3 lines
include/configs/omap3_overo.h +3 -0
+#endif /* (CONFIG_CMD_NET) */
+
+

Ditto.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de When some people discover the truth, they just can't understand why everybody isn't eager to hear it.

#23 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 3 lines · Wolfgang Denk

Please use "git format-patch" / "git send-email" to create and submit patches. For example, it is always nice to see a file statistics in the patch.

k.

Quoted 8 lines

board/overo/overo.h const omap3_sysinfo sysinfo = { · line 416

Quoted 5 lines

+ MUX_VAL(CP(GPMC_CLK), (IDIS | PTU | EN | M0)) /*GPMC_CLK*/\
+ MUX_VAL(CP(GPMC_WAIT2), (IEN | PTU | EN | M4)) /*GPIO_64*/\

board/overo/overo.h +3 -0
+							 /* - SMSC911X_NRES*/\
+ MUX_VAL(CP(MCSPI1_CS2),	(IEN  | PTU | DIS | M4)) /*GPIO_176 */\
+							 /* - LAN_INTR */\

Please use either no indentatioin at all, or indent by a multiple of TAB characters.

So no aligning with spaces at the end of a run of tabs to make them line up? Ok, if you prefer so.

Quoted 5 lines
Quoted 5 lines
include/configs/omap3_overo.h +0 -0
index 07a031b..6616b55 100644
@@ -28,7 +28,8 @@
Quoted 8 lines

include/configs/omap3_overo.h line 32

Quoted 6 lines
include/configs/omap3_overo.h +2 -1
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3430		1	/* which is in a 3430 */
-#define CONFIG_OMAP3_OVERO		1	/* working with overo */
+#define CONFIG_OMAP3_OVERO	1	/* working with overo */
+//#define CONFIG_OMAP3_OVERO_TOBI	1	/* overo mounted on tobi */

Please do not use an C++ comments, and do not add dead code.

What is the preferred way to show that the option is available but not enabled by default?

Quoted 8 lines

include/configs/omap3_overo.h line 115

Quoted 5 lines
include/configs/omap3_overo.h +5 -0
+#if !defined(CONFIG_OMAP3_OVERO_TOBI)
+#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#endif
+
+

Only one blank line, please.

Quoted 5 lines

include/configs/omap3_overo.h extern unsigned int boot_flash_sec; · line 314

Quoted 3 lines
include/configs/omap3_overo.h +3 -0
+#endif /* (CONFIG_CMD_NET) */
+
+

Ditto.

Sure (on both).

This patch has been applied and pulled though. I'll submit an incremental patch to address the above.

-Olof

#24 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Dear Olof Johansson,

Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 9 lines

board/overo/overo.h const omap3_sysinfo sysinfo = { · line 416

Quoted 6 lines

+ MUX_VAL(CP(GPMC_CLK), (IDIS | PTU | EN | M0)) /*GPMC_CLK*/\
+ MUX_VAL(CP(GPMC_WAIT2), (IEN | PTU | EN | M4)) /*GPIO_64*/\

board/overo/overo.h +3 -0
+							 /* - SMSC911X_NRES*/\
+ MUX_VAL(CP(MCSPI1_CS2),	(IEN  | PTU | DIS | M4)) /*GPIO_176 */\
+							 /* - LAN_INTR */\

Please use either no indentatioin at all, or indent by a multiple of TAB characters.

Quoted 2 lines

So no aligning with spaces at the end of a run of tabs to make them line up? Ok, if you prefer so.

I was referring to the initial blank at the very beginning of the line.

Quoted 4 lines
Quoted 1 line

Please do not use an C++ comments, and do not add dead code.

What is the preferred way to show that the option is available but not enabled by default?

Use a C comment, if you must.

Quoted 1 line

This patch has been applied and pulled though. I'll submit an incremental patch to address the above.

No, please submit a new version which also incorporates the cleanup patches by Dirk.

I will not pull the current version.

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
That's their goal, remember, a goal that's really contrary to that of
the programmer or administrator. We just want to get our  jobs  done.
$Bill  just  wants  to  become  $$Bill. These aren't even marginallly
congruent.
         -- Tom Christiansen in <[email protected]>
#25 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 13 lines · Wolfgang Denk

Dear Olof Johansson,

Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 9 lines

board/overo/overo.h const omap3_sysinfo sysinfo = { · line 416

Quoted 6 lines

+ MUX_VAL(CP(GPMC_CLK), (IDIS | PTU | EN | M0)) /*GPMC_CLK*/\
+ MUX_VAL(CP(GPMC_WAIT2), (IEN | PTU | EN | M4)) /*GPIO_64*/\

board/overo/overo.h +3 -0
+							 /* - SMSC911X_NRES*/\
+ MUX_VAL(CP(MCSPI1_CS2),	(IEN  | PTU | DIS | M4)) /*GPIO_176 */\
+							 /* - LAN_INTR */\

Please use either no indentatioin at all, or indent by a multiple of TAB characters.

Quoted 6 lines
Quoted 3 lines

So no aligning with spaces at the end of a run of tabs to make them line
up? Ok, if you prefer so.

I was referring to the initial blank at the very beginning of the line.

Ah, crap. Thanks.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

Please do not use an C++ comments, and do not add dead code.

What is the preferred way to show that the option is available but not enabled
by default?

Quoted 7 lines

Use a C comment, if you must.

Quoted 2 lines

This patch has been applied and pulled though. I'll submit an incremental patch to address the above.

No, please submit a new version which also incorporates the cleanup patches by Dirk.

I didn't see those, since I wasn't cc:d.

Quoted 1 line

I will not pull the current version.

So much for delegating maintainership. :)

-Olof

#26 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Dear Olof Johansson,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 3 lines

No, please submit a new version which also incorporates the cleanup patches by Dirk.

I didn't see those, since I wasn't cc:d.

See the ML archive, then.

Quoted 3 lines
Quoted 1 line

I will not pull the current version.

So much for delegating maintainership. :)

Heh. We just introduced these new custodians, _and_ I didn't find time for reviewing soon enough. That's just an unlucky coincidence.

[Hm... not to mention that sometimes I do enjoy being able to have the last word.]

[[Please don't tell my wife, though. :-) ]]

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
When all is said and done, more is said than done.
#27 lore raw

PATCH 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 10 lines · Wolfgang Denk

Dear Olof Johansson,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 3 lines

No, please submit a new version which also incorporates the cleanup patches by Dirk.

I didn't see those, since I wasn't cc:d.

See the ML archive, then.

Yep, no problem.

Quoted 11 lines
Quoted 3 lines
Quoted 1 line

I will not pull the current version.

So much for delegating maintainership. :)

Heh. We just introduced these new custodians, _and_ I didn't find time for reviewing soon enough. That's just an unlucky coincidence.

[Hm... not to mention that sometimes I do enjoy being able to have the last word.]

[[Please don't tell my wife, though. :-) ]]

:-) No worries.

-Olof

#28 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

---

This version of the patch fixes whitespace comments from WD, and includes fixes for the build warnings that Dirk's patch also silenced.

 board/overo/overo.c           |   62 +++++++++++++++++++++++++++++++++++++++++
 board/overo/overo.h           |   37 ++++++++++++++++++++++++
 include/configs/omap3_overo.h |   23 ++++++++++++++-
 3 files changed, 120 insertions(+), 2 deletions(-)
board/overo/overo.c +62 -0
index dd6d286..7d87e52 100644
@@ -29,13 +29,19 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <netdev.h>
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
 #include "overo.h"
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+static void setup_net_chip(void);
+#endif
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -62,6 +68,10 @@ int misc_init_r(void)
 	twl4030_power_init();
 	twl4030_led_init();
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	setup_net_chip();
+#endif
+
 	dieid_num_r();
 
 	return 0;
@@ -76,4 +86,56 @@ int misc_init_r(void)
 void set_muxconf_regs(void)
 {
 	MUX_OVERO();
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	MUX_OVERO_TOBI();
+#endif
+}
+
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *	      Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+	struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
+	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+	/* Configure GPMC registers */
+	writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+	writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+	writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+	writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+	writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+	writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+	writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+	/* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+	writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+	/* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+		&ctrl_base->gpmc_nadv_ale);
+
+	/* Make GPIO 64 as output pin */
+	writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);
+
+	/* Now send a pulse on the GPIO pin */
+	writel(GPIO0, &gpio3_base->setdataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->cleardataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->setdataout);
+}
+#endif
+
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC911X
+	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+	return rc;
 }
board/overo/overo.h +37 -0
index d9fe74e..48d58f2 100644
@@ -378,4 +378,41 @@ const omap3_sysinfo sysinfo = {
 	MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  | M0)) /*sdrc_cke0*/\
 	MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTU | EN  | M0)) /*sdrc_cke1*/
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+#define MUX_OVERO_TOBI() \
+	MUX_VAL(CP(GPMC_A1),		(IDIS | PTU | EN  | M0)) /*GPMC_A1*/\
+	MUX_VAL(CP(GPMC_A2),		(IDIS | PTU | EN  | M0)) /*GPMC_A2*/\
+	MUX_VAL(CP(GPMC_A3),		(IDIS | PTU | EN  | M0)) /*GPMC_A3*/\
+	MUX_VAL(CP(GPMC_A4),		(IDIS | PTU | EN  | M0)) /*GPMC_A4*/\
+	MUX_VAL(CP(GPMC_A5),		(IDIS | PTU | EN  | M0)) /*GPMC_A5*/\
+	MUX_VAL(CP(GPMC_A6),		(IDIS | PTU | EN  | M0)) /*GPMC_A6*/\
+	MUX_VAL(CP(GPMC_A7),		(IDIS | PTU | EN  | M0)) /*GPMC_A7*/\
+	MUX_VAL(CP(GPMC_A8),		(IDIS | PTU | EN  | M0)) /*GPMC_A8*/\
+	MUX_VAL(CP(GPMC_A9),		(IDIS | PTU | EN  | M0)) /*GPMC_A9*/\
+	MUX_VAL(CP(GPMC_A10),		(IDIS | PTU | EN  | M0)) /*GPMC_A10*/\
+	MUX_VAL(CP(GPMC_D0),		(IEN  | PTU | EN  | M0)) /*GPMC_D0*/\
+	MUX_VAL(CP(GPMC_D1),		(IEN  | PTU | EN  | M0)) /*GPMC_D1*/\
+	MUX_VAL(CP(GPMC_D2),		(IEN  | PTU | EN  | M0)) /*GPMC_D2*/\
+	MUX_VAL(CP(GPMC_D3),		(IEN  | PTU | EN  | M0)) /*GPMC_D3*/\
+	MUX_VAL(CP(GPMC_D4),		(IEN  | PTU | EN  | M0)) /*GPMC_D4*/\
+	MUX_VAL(CP(GPMC_D5),		(IEN  | PTU | EN  | M0)) /*GPMC_D5*/\
+	MUX_VAL(CP(GPMC_D6),		(IEN  | PTU | EN  | M0)) /*GPMC_D6*/\
+	MUX_VAL(CP(GPMC_D7),		(IEN  | PTU | EN  | M0)) /*GPMC_D7*/\
+	MUX_VAL(CP(GPMC_D8),		(IEN  | PTU | EN  | M0)) /*GPMC_D8*/\
+	MUX_VAL(CP(GPMC_D9),		(IEN  | PTU | EN  | M0)) /*GPMC_D9*/\
+	MUX_VAL(CP(GPMC_D10),		(IEN  | PTU | EN  | M0)) /*GPMC_D10*/\
+	MUX_VAL(CP(GPMC_D11),		(IEN  | PTU | EN  | M0)) /*GPMC_D11*/\
+	MUX_VAL(CP(GPMC_D12),		(IEN  | PTU | EN  | M0)) /*GPMC_D12*/\
+	MUX_VAL(CP(GPMC_D13),		(IEN  | PTU | EN  | M0)) /*GPMC_D13*/\
+	MUX_VAL(CP(GPMC_D14),		(IEN  | PTU | EN  | M0)) /*GPMC_D14*/\
+	MUX_VAL(CP(GPMC_D15),		(IEN  | PTU | EN  | M0)) /*GPMC_D15*/\
+	MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS5*/\
+	MUX_VAL(CP(GPMC_CLK),		(IDIS | PTU | EN  | M0)) /*GPMC_CLK*/\
+	MUX_VAL(CP(GPMC_WAIT2),		(IEN  | PTU | EN  | M4)) /*GPIO_64*/\
+								 /* - SMSC911X_NRES*/\
+	MUX_VAL(CP(MCSPI1_CS2),		(IEN  | PTU | DIS | M4)) /*GPIO_176 */\
+								 /* - LAN_INTR */
+
+#endif
+
 #endif
include/configs/omap3_overo.h +21 -2
index 07a031b..3faf756 100644
@@ -28,7 +28,10 @@
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3430		1	/* which is in a 3430 */
-#define CONFIG_OMAP3_OVERO		1	/* working with overo */
+#define CONFIG_OMAP3_OVERO	1	/* working with overo */
+
+/* Change the below line to define 1 if you want ethernet on Tobi */
+#undef CONFIG_OMAP3_OVERO_TOBI		/* overo mounted on tobi */
 
 #include <asm/arch/cpu.h>	/* get chip and board defs */
 #include <asm/arch/omap3.h>
@@ -105,9 +108,12 @@
 #undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
 #undef CONFIG_CMD_IMI		/* iminfo			*/
 #undef CONFIG_CMD_IMLS		/* List all found images	*/
-#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 #undef CONFIG_CMD_NFS		/* NFS support			*/
 
+#if !defined(CONFIG_OMAP3_OVERO_TOBI)
+#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#endif
+
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_I2C_SPEED		100000
 #define CONFIG_SYS_I2C_SLAVE		1
@@ -293,4 +299,17 @@ extern unsigned int boot_flash_sec;
 extern unsigned int boot_flash_type;
 #endif
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*----------------------------------------------------------------------------
+ * SMSC9115 Ethernet from SMSC9118 family
+ *----------------------------------------------------------------------------
+ */
+
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X		1
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE     0x2C000000
+
+#endif /* (CONFIG_CMD_NET) */
+
 #endif				/* __CONFIG_H */
Signature · 1 line
1.6.0.4
#29 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 90 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

---

This version of the patch fixes whitespace comments from WD, and includes fixes for the build warnings that Dirk's patch also silenced.

 board/overo/overo.c           |   62 +++++++++++++++++++++++++++++++++++++++++
 board/overo/overo.h           |   37 ++++++++++++++++++++++++
 include/configs/omap3_overo.h |   23 ++++++++++++++-
 3 files changed, 120 insertions(+), 2 deletions(-)
board/overo/overo.c +42 -0
index dd6d286..7d87e52 100644
@@ -29,13 +29,19 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <netdev.h>
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
 #include "overo.h"
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+static void setup_net_chip(void);
+#endif
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -62,6 +68,10 @@ int misc_init_r(void)
 	twl4030_power_init();
 	twl4030_led_init();
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	setup_net_chip();
+#endif
+
 	dieid_num_r();
 
 	return 0;
@@ -76,4 +86,56 @@ int misc_init_r(void)
 void set_muxconf_regs(void)
 {
 	MUX_OVERO();
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	MUX_OVERO_TOBI();
+#endif
+}
+
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *	      Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+	struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
+	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+	/* Configure GPMC registers */
+	writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+	writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+	writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+	writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+	writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+	writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+	writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+	/* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+	writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+	/* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+		&ctrl_base->gpmc_nadv_ale);

board/overo/overo.c int misc_init_r(void) · line 130

Quoted 10 lines
board/overo/overo.c +10 -0
+
+	/* Make GPIO 64 as output pin */
+	writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);
+
+	/* Now send a pulse on the GPIO pin */
+	writel(GPIO0, &gpio3_base->setdataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->cleardataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->setdataout);

Use the omap gpio interface described in README.omap3

Tom

#30 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 90 lines · Tom
Quoted 89 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.
Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

---
This version of the patch fixes whitespace comments from WD, and includes
fixes for the build warnings that Dirk's patch also silenced.
board/overo/overo.c | 62 +++++++++++++++++++++++++++++++
++++++++++

board/overo/overo.h           |   37 ++++++++++++++++++++++++
include/configs/omap3_overo.h |   23 ++++++++++++++-
3 files changed, 120 insertions(+), 2 deletions(-)
board/overo/overo.c +19 -0
index dd6d286..7d87e52 100644
@@ -29,13 +29,19 @@
 * MA 02111-1307 USA
 */
 #include <common.h>
+#include <netdev.h>
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
 #include "overo.h"
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+static void setup_net_chip(void);
+#endif
+
 /*
 * Routine: board_init
 * Description: Early hardware init.
@@ -62,6 +68,10 @@ int misc_init_r(void)
 	twl4030_power_init();
 	twl4030_led_init();
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	setup_net_chip();
+#endif
+
 	dieid_num_r();
 	return 0;
@@ -76,4 +86,56 @@ int misc_init_r(void)
 void set_muxconf_regs(void)
 {
 	MUX_OVERO();
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	MUX_OVERO_TOBI();
+#endif
+}
+
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers  

specific to the
+ * Ethernet hardware.
+ */

board/overo/overo.c +16 -0
+static void setup_net_chip(void)
+{
+	struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
+	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+	/* Configure GPMC registers */
+	writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+	writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+	writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+	writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+	writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+	writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+	writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+	/* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+	writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base- 
Quoted 1 line

gpmc_nwe);

board/overo/overo.c +9 -0
+	/* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+		&ctrl_base->gpmc_nadv_ale);
+
+	/* Make GPIO 64 as output pin */
+	writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);
+
Quoted 9 lines

board/overo/overo.c int misc_init_r(void) · line 130

Quoted 6 lines
board/overo/overo.c +6 -0
+	/* Now send a pulse on the GPIO pin */
+	writel(GPIO0, &gpio3_base->setdataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->cleardataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->setdataout);

Use the omap gpio interface described in README.omap3

Seriously, this code is a 1:1 replica from the evm code. Obviously that code was good enough to merge.

-Olof

#31 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

Dear Olof Johansson,

In message <[email protected]> you wrote:
...

Quoted 4 lines
Quoted 1 line

Use the omap gpio interface described in README.omap3

Seriously, this code is a 1:1 replica from the evm code. Obviously that code was good enough to merge.

Isn't this godd? It means that we learn from previous mistakes, and strive not to repeat them.

Patches to cleanup the evm code are welcome, too.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q:  What's a light-year?
A:  One-third less calories than a regular year.
#32 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

Hi,

Quoted 11 lines · Wolfgang Denk

Dear Olof Johansson,

In message <[email protected]> you wrote:
...

Quoted 4 lines
Quoted 1 line

Use the omap gpio interface described in README.omap3

Seriously, this code is a 1:1 replica from the evm code. Obviously that code was good enough to merge.

Isn't this godd? It means that we learn from previous mistakes, and strive not to repeat them.

It's also a bit of "we're holding new contributors to higher standards than we hold ourselves", alternatively "we can merge crap, and when others use it as examples we'll make them clean it all up".

So, some of this is OK, I agree. That's why I did the whitespace cleanup yesterday. But I've reached my limit in this case.

Bottom line: I don't have more time to sink into this fairly trivial patch, I don't need to get it merged. I'll just carry it myself out of tree until I get bored enough to revisit it.

-Olof

#33 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 20 lines · Olof Johansson

Hi,

Quoted 11 lines · Wolfgang Denk

Dear Olof Johansson,

In message <[email protected]> you wrote:
...

Quoted 4 lines
Quoted 1 line

Use the omap gpio interface described in README.omap3

Seriously, this code is a 1:1 replica from the evm code. Obviously that code was good enough to merge.

Isn't this godd? It means that we learn from previous mistakes, and strive not to repeat them.

It's also a bit of "we're holding new contributors to higher standards than we hold ourselves", alternatively "we can merge crap, and when others use it as examples we'll make them clean it all up".

Quoted 7 lines

So, some of this is OK, I agree. That's why I did the whitespace cleanup yesterday. But I've reached my limit in this case.

Bottom line: I don't have more time to sink into this fairly trivial patch, I don't need to get it merged. I'll just carry it myself out of tree until I get bored enough to revisit it.

Ugh. Sorry.

I was just pointing out that there is a new gpio interface. I did not clean up all the omap3's when the interface was created and I do not expect you to do the same. The problem is making big changes you can not test.

I will make the gpio change as a followup after this is merged if you can test it for me.

I do not have any other issues.

This ok ?

Tom

Quoted 2 lines

-Olof

#34 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 25 lines · Tom
Quoted 14 lines · Olof Johansson

Hi,

Quoted 5 lines · Wolfgang Denk

Dear Olof Johansson,

In message <[email protected]> you wrote:
...

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Use the omap gpio interface described in README.omap3

Seriously, this code is a 1:1 replica from the evm code. Obviously that code was good enough to merge.

Isn't this godd? It means that we learn from previous mistakes, and strive not to repeat them.

Quoted 9 lines

It's also a bit of "we're holding new contributors to higher standards than we hold ourselves", alternatively "we can merge crap, and when others use it as examples we'll make them clean it all up".
So, some of this is OK, I agree. That's why I did the whitespace cleanup yesterday. But I've reached my limit in this case. Bottom line: I don't have more time to sink into this fairly trivial patch, I don't need to get it merged. I'll just carry it myself out of tree until I get bored enough to revisit it.

Quoted 1 line

Ugh. Sorry.

No worries. Either yours or Wolfgangs cleanup requests alone would have been fine with me, they just piled up :)

Quoted 5 lines

I was just pointing out that there is a new gpio interface. I did not clean up all the omap3's when the interface was created and I do not expect you to do the same. The problem is making big changes you can not test.

Quoted 7 lines

I will make the gpio change as a followup after this is merged if you can test it for me.

I do not have any other issues.

This ok ?

Quite reasonable. I'm happy to help clean it up too, as I have time later if you haven't already done it by then.

-Olof

#35 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Olof Johansson

Olof Johansson said the following on 09/23/2009 09:43 PM:

Quoted 18 lines · Tom
Quoted 9 lines
Quoted 5 lines · Olof Johansson
board/overo/overo.c +0 -0
index dd6d286..7d87e52 100644
Quoted 7 lines

board/overo/overo.c int misc_init_r(void) · line 130

Quoted 4 lines
board/overo/overo.c +3 -0
+	writel(GPIO0, &gpio3_base->cleardataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->setdataout);

Use the omap gpio interface described in README.omap3

Quoted 3 lines

Seriously, this code is a 1:1 replica from the evm code. Obviously that code was good enough to merge.

should'nt we be fixing evm code instead of moving similar code in for another platform?
Regards,
Nishanth Menon

#36 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 19 lines · Nishanth Menon

Olof Johansson said the following on 09/23/2009 09:43 PM:

Quoted 18 lines · Tom
Quoted 16 lines

board/overo/overo.c int misc_init_r(void) · line 130

Quoted 9 lines · Olof Johansson
board/overo/overo.c +3 -0
index dd6d286..7d87e52 100644
 
+	writel(GPIO0, &gpio3_base->cleardataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->setdataout);

Use the omap gpio interface described in README.omap3

Quoted 6 lines
Quoted 3 lines

Seriously, this code is a 1:1 replica from the evm code. Obviously that code was good enough to merge.

should'nt we be fixing evm code instead of moving similar code in for another platform?

Sure, but you forgot to attach the patch.

-Olof

#37 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 21 lines · Olof Johansson
Quoted 19 lines · Nishanth Menon

Olof Johansson said the following on 09/23/2009 09:43 PM:

Quoted 18 lines · Tom
Quoted 16 lines

board/overo/overo.c int misc_init_r(void) · line 130

Quoted 9 lines · Olof Johansson
board/overo/overo.c +3 -0
index dd6d286..7d87e52 100644
 
+    writel(GPIO0, &gpio3_base->cleardataout);
+    udelay(1);
+    writel(GPIO0, &gpio3_base->setdataout);

Use the omap gpio interface described in README.omap3

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Seriously, this code is a 1:1 replica from the evm code. Obviously that code was good enough to merge.

should'nt we be fixing evm code instead of moving similar code in for another platform?

Sure, but you forgot to attach the patch.

;)

Yes the evm should be fixed but...
I think Olof has had enough 'just one mores' ..

The point is to get patch in.

I will add the evm changes to my follow-on if there is someone to test the changes.

Tom

Quoted 2 lines

-Olof

#38 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Olof Johansson

Olof Johansson said the following on 09/24/2009 03:38 AM:

Quoted 21 lines · Nishanth Menon
Quoted 20 lines

Olof Johansson said the following on 09/23/2009 09:43 PM:

Quoted 18 lines · Tom
Quoted 16 lines

board/overo/overo.c int misc_init_r(void) · line 130

Quoted 9 lines · Olof Johansson
board/overo/overo.c +3 -0
index dd6d286..7d87e52 100644
 
+    writel(GPIO0, &gpio3_base->cleardataout);
+    udelay(1);
+    writel(GPIO0, &gpio3_base->setdataout);

Use the omap gpio interface described in README.omap3

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Seriously, this code is a 1:1 replica from the evm code. Obviously that code was good enough to merge.

should'nt we be fixing evm code instead of moving similar code in for another platform?

Sure, but you forgot to attach the patch.

Silly me.. sorry about that.. as you pointed out, I did indeed forget.. need to catch my flight now, and as i dont own an evm, here is the patch
in attachment if someone would care to try it out..
Regards,
Nishanth Menon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001--RFC-OMAP3-EVM-remove-direct-gpio-hits.patch
Type: text/x-diff
Size: 0 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090924/555ff8b1/attachment.patch

#39 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Olof Johansson
Quoted 8 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Ack-ed

Sandeep,
Can you push this to the ti branch?

Tom

Quoted 197 lines

---

This version of the patch fixes whitespace comments from WD, and includes fixes for the build warnings that Dirk's patch also silenced.

 board/overo/overo.c           |   62 +++++++++++++++++++++++++++++++++++++++++
 board/overo/overo.h           |   37 ++++++++++++++++++++++++
 include/configs/omap3_overo.h |   23 ++++++++++++++-
 3 files changed, 120 insertions(+), 2 deletions(-)
board/overo/overo.c +62 -0
index dd6d286..7d87e52 100644
@@ -29,13 +29,19 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <netdev.h>
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
 #include "overo.h"
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+static void setup_net_chip(void);
+#endif
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -62,6 +68,10 @@ int misc_init_r(void)
 	twl4030_power_init();
 	twl4030_led_init();
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	setup_net_chip();
+#endif
+
 	dieid_num_r();
 
 	return 0;
@@ -76,4 +86,56 @@ int misc_init_r(void)
 void set_muxconf_regs(void)
 {
 	MUX_OVERO();
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+	MUX_OVERO_TOBI();
+#endif
+}
+
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *	      Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+	struct gpio *gpio3_base = (struct gpio *)OMAP34XX_GPIO3_BASE;
+	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+	/* Configure GPMC registers */
+	writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+	writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+	writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+	writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+	writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+	writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+	writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+	/* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+	writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+	/* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+		&ctrl_base->gpmc_nadv_ale);
+
+	/* Make GPIO 64 as output pin */
+	writel(readl(&gpio3_base->oe) & ~(GPIO0), &gpio3_base->oe);
+
+	/* Now send a pulse on the GPIO pin */
+	writel(GPIO0, &gpio3_base->setdataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->cleardataout);
+	udelay(1);
+	writel(GPIO0, &gpio3_base->setdataout);
+}
+#endif
+
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC911X
+	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+	return rc;
 }
board/overo/overo.h +37 -0
index d9fe74e..48d58f2 100644
@@ -378,4 +378,41 @@ const omap3_sysinfo sysinfo = {
 	MUX_VAL(CP(SDRC_CKE0),		(IDIS | PTU | EN  | M0)) /*sdrc_cke0*/\
 	MUX_VAL(CP(SDRC_CKE1),		(IDIS | PTU | EN  | M0)) /*sdrc_cke1*/
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+#define MUX_OVERO_TOBI() \
+	MUX_VAL(CP(GPMC_A1),		(IDIS | PTU | EN  | M0)) /*GPMC_A1*/\
+	MUX_VAL(CP(GPMC_A2),		(IDIS | PTU | EN  | M0)) /*GPMC_A2*/\
+	MUX_VAL(CP(GPMC_A3),		(IDIS | PTU | EN  | M0)) /*GPMC_A3*/\
+	MUX_VAL(CP(GPMC_A4),		(IDIS | PTU | EN  | M0)) /*GPMC_A4*/\
+	MUX_VAL(CP(GPMC_A5),		(IDIS | PTU | EN  | M0)) /*GPMC_A5*/\
+	MUX_VAL(CP(GPMC_A6),		(IDIS | PTU | EN  | M0)) /*GPMC_A6*/\
+	MUX_VAL(CP(GPMC_A7),		(IDIS | PTU | EN  | M0)) /*GPMC_A7*/\
+	MUX_VAL(CP(GPMC_A8),		(IDIS | PTU | EN  | M0)) /*GPMC_A8*/\
+	MUX_VAL(CP(GPMC_A9),		(IDIS | PTU | EN  | M0)) /*GPMC_A9*/\
+	MUX_VAL(CP(GPMC_A10),		(IDIS | PTU | EN  | M0)) /*GPMC_A10*/\
+	MUX_VAL(CP(GPMC_D0),		(IEN  | PTU | EN  | M0)) /*GPMC_D0*/\
+	MUX_VAL(CP(GPMC_D1),		(IEN  | PTU | EN  | M0)) /*GPMC_D1*/\
+	MUX_VAL(CP(GPMC_D2),		(IEN  | PTU | EN  | M0)) /*GPMC_D2*/\
+	MUX_VAL(CP(GPMC_D3),		(IEN  | PTU | EN  | M0)) /*GPMC_D3*/\
+	MUX_VAL(CP(GPMC_D4),		(IEN  | PTU | EN  | M0)) /*GPMC_D4*/\
+	MUX_VAL(CP(GPMC_D5),		(IEN  | PTU | EN  | M0)) /*GPMC_D5*/\
+	MUX_VAL(CP(GPMC_D6),		(IEN  | PTU | EN  | M0)) /*GPMC_D6*/\
+	MUX_VAL(CP(GPMC_D7),		(IEN  | PTU | EN  | M0)) /*GPMC_D7*/\
+	MUX_VAL(CP(GPMC_D8),		(IEN  | PTU | EN  | M0)) /*GPMC_D8*/\
+	MUX_VAL(CP(GPMC_D9),		(IEN  | PTU | EN  | M0)) /*GPMC_D9*/\
+	MUX_VAL(CP(GPMC_D10),		(IEN  | PTU | EN  | M0)) /*GPMC_D10*/\
+	MUX_VAL(CP(GPMC_D11),		(IEN  | PTU | EN  | M0)) /*GPMC_D11*/\
+	MUX_VAL(CP(GPMC_D12),		(IEN  | PTU | EN  | M0)) /*GPMC_D12*/\
+	MUX_VAL(CP(GPMC_D13),		(IEN  | PTU | EN  | M0)) /*GPMC_D13*/\
+	MUX_VAL(CP(GPMC_D14),		(IEN  | PTU | EN  | M0)) /*GPMC_D14*/\
+	MUX_VAL(CP(GPMC_D15),		(IEN  | PTU | EN  | M0)) /*GPMC_D15*/\
+	MUX_VAL(CP(GPMC_NCS5),		(IDIS | PTU | EN  | M0)) /*GPMC_nCS5*/\
+	MUX_VAL(CP(GPMC_CLK),		(IDIS | PTU | EN  | M0)) /*GPMC_CLK*/\
+	MUX_VAL(CP(GPMC_WAIT2),		(IEN  | PTU | EN  | M4)) /*GPIO_64*/\
+								 /* - SMSC911X_NRES*/\
+	MUX_VAL(CP(MCSPI1_CS2),		(IEN  | PTU | DIS | M4)) /*GPIO_176 */\
+								 /* - LAN_INTR */
+
+#endif
+
 #endif
include/configs/omap3_overo.h +21 -2
index 07a031b..3faf756 100644
@@ -28,7 +28,10 @@
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3430		1	/* which is in a 3430 */
-#define CONFIG_OMAP3_OVERO		1	/* working with overo */
+#define CONFIG_OMAP3_OVERO	1	/* working with overo */
+
+/* Change the below line to define 1 if you want ethernet on Tobi */
+#undef CONFIG_OMAP3_OVERO_TOBI		/* overo mounted on tobi */
 
 #include <asm/arch/cpu.h>	/* get chip and board defs */
 #include <asm/arch/omap3.h>
@@ -105,9 +108,12 @@
 #undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
 #undef CONFIG_CMD_IMI		/* iminfo			*/
 #undef CONFIG_CMD_IMLS		/* List all found images	*/
-#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 #undef CONFIG_CMD_NFS		/* NFS support			*/
 
+#if !defined(CONFIG_OMAP3_OVERO_TOBI)
+#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
+#endif
+
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_I2C_SPEED		100000
 #define CONFIG_SYS_I2C_SLAVE		1
@@ -293,4 +299,17 @@ extern unsigned int boot_flash_sec;
 extern unsigned int boot_flash_type;
 #endif
 
+#if defined(CONFIG_OMAP3_OVERO_TOBI)
+/*----------------------------------------------------------------------------
+ * SMSC9115 Ethernet from SMSC9118 family
+ *----------------------------------------------------------------------------
+ */
+
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X		1
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE     0x2C000000
+
+#endif /* (CONFIG_CMD_NET) */
+
 #endif				/* __CONFIG_H */
#40 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 11 lines
Quoted 7 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Quoted 9 lines
Quoted 1 line

Ack-ed

Sandeep,
Can you push this to the ti branch?

Tom

Yes after I rebase the branch.
I have to get rid of some commits NAK'ed by Wolfgang. I believe even you will have to do that.

Thanks,
Sandeep

#41 lore raw

[U-Boot] Applying u-boot-ti patches (was: [PATCH v2] TI: OMAP3: Overo Tobi ethernet support)

Quoted 12 lines · Sandeep
Quoted 12 lines
Quoted 8 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Ack-ed

Quoted 7 lines
Quoted 5 lines

Sandeep,
Can you push this to the ti branch?

Tom

Yes after I rebase the branch.
I have to get rid of some commits NAK'ed by Wolfgang.

Seems this is done :)

Just in case it might help: After looking through the OMAP3 patches, my list of patches to be applied:

1. [PATCH v3] OMAP3 MMC: Fix warning dereferencing type-punned pointer
http://lists.denx.de/pipermail/u-boot/2009-September/061621.html

2. [PATCH] OMAP3: Update Overo and Beagle environment
http://lists.denx.de/pipermail/u-boot/2009-September/061564.html

3. [PATCH 1/1] TI OMAP3 Use arm init sequence to initialize i2c
http://lists.denx.de/pipermail/u-boot/2009-September/061515.html

(if it's fine to move it into u-boot-ti instead of u-boot-i2c)

4. [PATCH] OMAP3: Clean up whitespace in mux configs
http://lists.denx.de/pipermail/u-boot/2009-September/061300.html

5. [PATCH v3] TI: OMAP3: Overo Tobi ethernet support
http://lists.denx.de/pipermail/u-boot/2009-September/061604.html

(needs an ack from Ben?)

Note: 5 depends on 4.

Best regards

Dirk

#42 lore raw

[U-Boot] Applying u-boot-ti patches (was: [PATCH v2] TI: OMAP3: Overo Tobi ethernet support)

Quoted 31 lines
Quoted 12 lines · Sandeep
Quoted 12 lines
Quoted 8 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Ack-ed

Quoted 7 lines
Quoted 5 lines

Sandeep,
Can you push this to the ti branch?

Tom

Yes after I rebase the branch.
I have to get rid of some commits NAK'ed by Wolfgang.

Seems this is done :)

Just in case it might help: After looking through the OMAP3 patches, my list of patches to be applied:

1. [PATCH v3] OMAP3 MMC: Fix warning dereferencing type-punned pointer
http://lists.denx.de/pipermail/u-boot/2009-September/061621.html

Quoted 7 lines

2. [PATCH] OMAP3: Update Overo and Beagle environment
http://lists.denx.de/pipermail/u-boot/2009-September/061564.html

3. [PATCH 1/1] TI OMAP3 Use arm init sequence to initialize i2c
http://lists.denx.de/pipermail/u-boot/2009-September/061515.html

(if it's fine to move it into u-boot-ti instead of u-boot-i2c)

Looks like you have an ACK for this to happen :-)

Quoted 7 lines

4. [PATCH] OMAP3: Clean up whitespace in mux configs
http://lists.denx.de/pipermail/u-boot/2009-September/061300.html

5. [PATCH v3] TI: OMAP3: Overo Tobi ethernet support
http://lists.denx.de/pipermail/u-boot/2009-September/061604.html

Quoted 7 lines

(needs an ack from Ben?)

Note: 5 depends on 4.

Best regards

Dirk

I'll apply them in the evening.
Ben, can I apply the following patch to u-boot-ti?

[PATCH v3] TI: OMAP3: Overo Tobi ethernet support

Thanks,
Sandeep

#43 lore raw

[U-Boot] Applying u-boot-ti patches

Quoted 41 lines · Sandeep
Quoted 27 lines
Quoted 11 lines · Sandeep
Quoted 11 lines
Quoted 8 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Ack-ed

Quoted 7 lines
Quoted 5 lines

Sandeep,
Can you push this to the ti branch?

Tom

Yes after I rebase the branch.
I have to get rid of some commits NAK'ed by Wolfgang.

Seems this is done :)

Just in case it might help: After looking through the OMAP3 patches, my list of patches to be applied:

1. [PATCH v3] OMAP3 MMC: Fix warning dereferencing type-punned pointer
http://lists.denx.de/pipermail/u-boot/2009-September/061621.html

Quoted 7 lines

2. [PATCH] OMAP3: Update Overo and Beagle environment
http://lists.denx.de/pipermail/u-boot/2009-September/061564.html

3. [PATCH 1/1] TI OMAP3 Use arm init sequence to initialize i2c
http://lists.denx.de/pipermail/u-boot/2009-September/061515.html

(if it's fine to move it into u-boot-ti instead of u-boot-i2c)

Looks like you have an ACK for this to happen :-)

Quoted 6 lines

4. [PATCH] OMAP3: Clean up whitespace in mux configs
http://lists.denx.de/pipermail/u-boot/2009-September/061300.html

5. [PATCH v3] TI: OMAP3: Overo Tobi ethernet support
http://lists.denx.de/pipermail/u-boot/2009-September/061604.html

Quoted 8 lines
Quoted 7 lines

(needs an ack from Ben?)

Note: 5 depends on 4.

Best regards

Dirk

I'll apply them in the evening.

Thanks for applying patches 1, 2 & 4 :)

Just fyi, I got

u-boot-ti > git pull
remote: error: refs/remotes/origin/HEAD points nowhere!
remote: error: refs/remotes/origin/mkimage does not point to a valid object!
...

Not sure what this is about, though.

Best regards

Dirk

#44 lore raw

[U-Boot] Applying u-boot-ti patches

Quoted 39 lines

in

Quoted 36 lines
Quoted 20 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

this case).

Ack-ed

Quoted 7 lines
Quoted 5 lines

Sandeep,
Can you push this to the ti branch?

Tom

Yes after I rebase the branch.
I have to get rid of some commits NAK'ed by Wolfgang.

Seems this is done :)

Just in case it might help: After looking through the OMAP3 patches, my list of patches to be applied:

1. [PATCH v3] OMAP3 MMC: Fix warning dereferencing type-punned pointer
http://lists.denx.de/pipermail/u-boot/2009-September/061621.html

Quoted 7 lines

2. [PATCH] OMAP3: Update Overo and Beagle environment
http://lists.denx.de/pipermail/u-boot/2009-September/061564.html

3. [PATCH 1/1] TI OMAP3 Use arm init sequence to initialize i2c
http://lists.denx.de/pipermail/u-boot/2009-September/061515.html

(if it's fine to move it into u-boot-ti instead of u-boot-i2c)

Looks like you have an ACK for this to happen :-)

Quoted 8 lines

4. [PATCH] OMAP3: Clean up whitespace in mux configs
http://lists.denx.de/pipermail/u-boot/2009-September/061300.html

5. [PATCH v3] TI: OMAP3: Overo Tobi ethernet support
http://lists.denx.de/pipermail/u-boot/2009-September/061604.html

(needs an ack from Ben?)

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

Note: 5 depends on 4.

Best regards

Dirk

I'll apply them in the evening.

Thanks for applying patches 1, 2 & 4 :)

#3 does not apply clean :-)
#5 I'm waiting for a reply from Ben

Quoted 8 lines

Just fyi, I got

u-boot-ti > git pull
remote: error: refs/remotes/origin/HEAD points nowhere!
remote: error: refs/remotes/origin/mkimage does not point to a valid object!
...

I am able to pull without any issues. Things seem fine. You should be able to see all you updates in the repo you just updated

Quoted 2 lines

Not sure what this is about, though.

Is there anything I can do to get rid of this?

Quoted 4 lines

Best regards

Dirk

#45 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Tom
Quoted 11 lines
Quoted 7 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Quoted 8 lines
Quoted 1 line

Ack-ed

Sandeep,
Can you push this to the ti branch?

Tom

BTW does this patch need an ACK from Dirk?
I ask because when we commit this patch we will have to remove one of his patches.

Quoted 6 lines
Quoted 3 lines

---

This version of the patch fixes whitespace comments from WD, and

includes

Quoted 2 lines

fixes for the build warnings that Dirk's patch also silenced.

This patch I believe incorporates Dirk's patch.

Sandeep

#46 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 20 lines · Sandeep
Quoted 9 lines
Quoted 7 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Quoted 7 lines
Quoted 1 line

Ack-ed

Sandeep,
Can you push this to the ti branch?

Tom

BTW does this patch need an ACK from Dirk?
I ask because when we commit this patch we will have to remove one of his patches.

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

---

This version of the patch fixes whitespace comments from WD, and

includes

Quoted 2 lines

fixes for the build warnings that Dirk's patch also silenced.

This patch I believe incorporates Dirk's patch.

You have my ack to do what you think is the best way to go. I wasn't able to track this discussion, but will look at the result then ;)

Best regards

Dirk

#47 lore raw

PATCH v2 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Paulraj

Hi,

Quoted 16 lines · Sandeep
Quoted 16 lines
Quoted 9 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in
this case).

Ack-ed

Quoted 8 lines
Quoted 4 lines

Sandeep,
Can you push this to the ti branch?

Tom

BTW does this patch need an ACK from Dirk?
I ask because when we commit this patch we will have to remove one of his patches.

Yeah, I suppose so. :-)

Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

---

This version of the patch fixes whitespace comments from WD, and

includes

Quoted 2 lines

fixes for the build warnings that Dirk's patch also silenced.

This patch I believe incorporates Dirk's patch.

Yes, but not identical (I moved the prototype to the C file, a static function prototype shouldn't have been in the header file to start with).

-Olof

#48 lore raw

[U-Boot] smc911x runtime detection (was: TI: OMAP3: Overo Tobi ethernet support)

In reply to Olof Johansson
Quoted 6 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

First: This is only a request for comment for possible future improvement. It doesn't ask for any changes in this patch or is any nack. Now to the content ;)

It seems that Steve found a way for runtime detection of smc911x making CONFIG_OMAP3_OVERO_TOBI more or less obsolete (from [1]) :

-- cut --
--- git/include/configs/omap3_overo.h-orig 2009-09-17
13:06:08.000000000 -0700
+++ git/include/configs/omap3_overo.h 2009-09-17 13:06:49.000000000 -0700
@@ -29,7 +29,7 @@
#define CONFIG_OMAP34XX 1 /* which is a 34XX */
#define CONFIG_OMAP3430 1 /* which is in a 3430 */
#define CONFIG_OMAP3_OVERO 1 /* working with overo */
-//#define CONFIG_OMAP3_OVERO_TOBI 1 /* overo mounted on tobi */
+#define CONFIG_OMAP3_OVERO_TOBI 1 /* overo mounted on tobi */

#include <asm/arch/cpu.h> /* get chip and board defs */
#include <asm/arch/omap3.h>

drivers/net/smc911x.c renamed from drivers/net/smc911x.c-orig +6 -0
@@ -253,6 +253,12 @@ int smc911x_initialize(u8 dev_num, int b
 
  	dev->iobase = base_addr;
 
+	/* test to see if chip is present (-1 if not) */
+	if (smc911x_reg_read(dev, MAC_CSR_CMD) == -1) {
+		free(dev);
+		return 0;
+	}
+
  	addrh = smc911x_get_mac_csr(dev, ADDRH);
  	addrl = smc911x_get_mac_csr(dev, ADDRL);
  	dev->enetaddr[0] = addrl;

-- cut --

But this needs some change in smc911x.c driver. Maybe someone likes to comment (Ben?).

Best regards

Dirk

[1]
http://www.sakoman.net/cgi-bin/gitweb.cgi?p=openembedded.git;a=blob;f=recipes/u-boot/u-boot-omap3-git/smsc911x.patch;h=0d71b75727904cb59c88d523794c1d2699127cb2;hb=5965063dcfc396b3ef2f0891b54f05cf8f1ea08e

#49 lore raw

[U-Boot] smc911x runtime detection (was: TI: OMAP3: Overo Tobi ethernet support)

Quoted 31 lines · On Saturday 26 September 2009 02:13:52 Dirk Behme wrote:
Quoted 6 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

First: This is only a request for comment for possible future improvement. It doesn't ask for any changes in this patch or is any nack. Now to the content ;)

It seems that Steve found a way for runtime detection of smc911x making CONFIG_OMAP3_OVERO_TOBI more or less obsolete (from [1]) :

-- cut --
--- git/include/configs/omap3_overo.h-orig 2009-09-17
13:06:08.000000000 -0700
+++ git/include/configs/omap3_overo.h 2009-09-17 13:06:49.000000000 -0700

(quoted diff) +1 -1
@@ -29,7 +29,7 @@
  #define CONFIG_OMAP34XX		1	/* which is a 34XX */
  #define CONFIG_OMAP3430		1	/* which is in a 3430 */
  #define CONFIG_OMAP3_OVERO	1	/* working with overo */
-//#define CONFIG_OMAP3_OVERO_TOBI	1	/* overo mounted on tobi */
+#define CONFIG_OMAP3_OVERO_TOBI	1	/* overo mounted on tobi */
 
  #include <asm/arch/cpu.h>	/* get chip and board defs */
  #include <asm/arch/omap3.h>

drivers/net/smc911x.c int smc911x_initialize(u8 dev_num, int b · line 260

Quoted 8 lines
drivers/net/smc911x.c renamed from drivers/net/smc911x.c-orig +5 -0
@@ -253,6 +253,12 @@ int smc911x_initialize(u8 dev_num, int b
 
  	dev->iobase = base_addr;
 
+	/* test to see if chip is present (-1 if not) */
+	if (smc911x_reg_read(dev, MAC_CSR_CMD) == -1) {
+		free(dev);
+		return 0;
+	}

i dont think returning 0 is correct. let the higher layers (i.e. your board) handle the error dynamically.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090926/f619c500/attachment.pgp

#50 lore raw

[U-Boot] smc911x runtime detection

In reply to Dirk Behme
Quoted 31 lines · Dirk Behme
Quoted 6 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

First: This is only a request for comment for possible future improvement. It doesn't ask for any changes in this patch or is any nack. Now to the content ;)

It seems that Steve found a way for runtime detection of smc911x making CONFIG_OMAP3_OVERO_TOBI more or less obsolete (from [1]) :

-- cut --
--- git/include/configs/omap3_overo.h-orig 2009-09-17
13:06:08.000000000 -0700
+++ git/include/configs/omap3_overo.h 2009-09-17 13:06:49.000000000 -0700

(quoted diff) +1 -1
@@ -29,7 +29,7 @@
  #define CONFIG_OMAP34XX		1	/* which is a 34XX */
  #define CONFIG_OMAP3430		1	/* which is in a 3430 */
  #define CONFIG_OMAP3_OVERO	1	/* working with overo */
-//#define CONFIG_OMAP3_OVERO_TOBI	1	/* overo mounted on tobi */
+#define CONFIG_OMAP3_OVERO_TOBI	1	/* overo mounted on tobi */
 
  #include <asm/arch/cpu.h>	/* get chip and board defs */
  #include <asm/arch/omap3.h>

drivers/net/smc911x.c int smc911x_initialize(u8 dev_num, int b · line 261

Quoted 9 lines
drivers/net/smc911x.c renamed from drivers/net/smc911x.c-orig +6 -0
@@ -253,6 +253,12 @@ int smc911x_initialize(u8 dev_num, int b
 
  	dev->iobase = base_addr;
 
+	/* test to see if chip is present (-1 if not) */
+	if (smc911x_reg_read(dev, MAC_CSR_CMD) == -1) {
+		free(dev);
+		return 0;
+	}
+

How are the mux and f/i clock setup handled?
Or will this change only help if the mux setup happens as a default? Tom

#51 lore raw

[U-Boot] smc911x runtime detection (was: TI: OMAP3: Overo Tobi ethernet support)

In reply to Dirk Behme
Quoted 7 lines · Dirk Behme
Quoted 5 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.
Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Quoted 6 lines

First: This is only a request for comment for possible future improvement. It doesn't ask for any changes in this patch or is any nack. Now to the content ;)

It seems that Steve found a way for runtime detection of smc911x making CONFIG_OMAP3_OVERO_TOBI more or less obsolete (from [1]) :

Looks like a good idea. I guess the risk is if there's ever another carrier board with something on the same chip select that happens to return something at that address, thus causing false detection. Is that a valid concern?

-Olof

#52 lore raw

[U-Boot] smc911x runtime detection (was: TI: OMAP3: Overo Tobi ethernet support)

Hi Olof,

Quoted 20 lines · Olof Johansson

On Sep 26, 2009, at 1:13 AM, Dirk Behme wrote:

Quoted 8 lines · Olof Johansson
Quoted 7 lines

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.
Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

Quoted 7 lines

First: This is only a request for comment for possible future improvement. It doesn't ask for any changes in this patch or is any nack. Now to the content ;)

It seems that Steve found a way for runtime detection of smc911x making CONFIG_OMAP3_OVERO_TOBI more or less obsolete (from [1]) :

Quoted 6 lines

Looks like a good idea. I guess the risk is if there's ever another carrier board with something on the same chip select that happens to return something at that address, thus causing false detection. Is that a valid concern?

It is a good idea in principle, but just reading and expecting *something*

is a fatal flaw. I don't know about these ones in particular, but memory-mapped chips often have ID registers that are RO and have well-documented contents. If somebody can find something like that here, let's do it.

Quoted 4 lines

-Olof

regards,

Ben

A message that is not in the archive (sent off-list or not yet received): [email protected]

#54 lore raw

[U-Boot] smc911x runtime detection (was: TI: OMAP3: Overo Tobi ethernet support)

Steve,
Please keep list C-C'd,

Quoted 43 lines · Steve Sakoman
Quoted 15 lines · Ben Warren

Hi Olof,

Quoted 13 lines · Olof Johansson
Quoted 10 lines · Dirk Behme
Quoted 6 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.
Based on the omap3 evm code. I added a new highlevel define for Tobi to avoid having it dependent on CMD_NET (which would seem backward in this case).

First: This is only a request for comment for possible future improvement. It doesn't ask for any changes in this patch or is any

nack.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

Now to the content ;)

It seems that Steve found a way for runtime detection of smc911x making CONFIG_OMAP3_OVERO_TOBI more or less obsolete (from [1]) :

Looks like a good idea. I guess the risk is if there's ever another carrier board with something on the same chip select that happens to

return

Quoted 4 lines
Quoted 3 lines

something at that address, thus causing false detection. Is that a valid concern?

It is a good idea in principle, but just reading and expecting

*something*

Quoted 4 lines

is a fatal flaw. I don't know about these ones in particular, but memory-mapped chips often have ID registers that are RO and have well-documented contents. If somebody can find something like that here, let's do it.

Agreed, I didn't have a spec at hand to investigate this, so that's why I didn't think that this was a good patch for all systems with smc911x. I know it to work on Overo because reads to non-existent GPMC locations give all ones (hence the test for -1).

I would definitely prefer a register with known contents.

Quoted 7 lines

There was a question as to whether the code returned the proper value.
Returning a 0 from this routine when no chip is found results in a
reasonable error message:

Net: No ethernet found.

Yes, returning 0 is the correct value. The undocumented API is that

Ethernet initialize() functions return the number of interfaces added, or -1 on error. I wouldn't consider this an error condition.

regards,
Ben

#55 lore raw

[U-Boot] smc911x runtime detection (was: TI: OMAP3: Overo Tobi ethernet support)

Quoted 2 lines · On Saturday 26 September 2009 15:19:01 Ben Warren wrote:

Ethernet initialize() functions return the number of interfaces added, or
-1 on error. I wouldn't consider this an error condition.

should be added to the README.drivers.eth. have you merged that yet ? if not, i'll send an updated version.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090926/78728778/attachment.pgp

#56 lore raw

[U-Boot] smc911x runtime detection (was: TI: OMAP3: Overo Tobi ethernet support)

In reply to Ben Warren
Quoted 5 lines · Ben Warren

It is a good idea in principle, but just reading and expecting *something* is a fatal flaw. I don't know about these ones in particular, but memory-mapped chips often have ID registers that are RO and have well-documented contents. If somebody can find something like that here, let's do it.

Register at offset 0x50 should contain the Chip ID and revision (0x9211 << 16 | <rev>). It should be a better base for auto-probe.

Actually, the driver already does check it (and verifies it against a table of known chip revs). By moving that call sooner we can essentially accomplish the same thing. It also makes sense to move some of the printouts around to not mess up he probing printouts. I will post a v3 patch for this separately (it also contains the GPIO changes).

I do find the whole "one firmware config for all overo carriers" to be a little hard to accomplish, since the OMAP gumstix + carrier really is what is normally considered the "board". On the other hand, having one firmware that boots on all possible versions is probably preferrably on some level.

For future carrier boards, having an I2C ID EEPROM or similar on there might not be a bad idea. However, I can't figure out how to contact anyone at Gumstix without posting on their web forum.

See patch separately.

-Olof

#57 lore raw

[U-Boot] smc911x runtime detection

Quoted 2 lines · Olof Johansson

For future carrier boards, having an I2C ID EEPROM or similar on there might not be a bad idea.

Totally off-topic here, but just fyi: TinCanTools started with I2C ID EEPROM already

http://elinux.org/BeagleBoardPinMux#Expansion_boards

and I think this is agreed with Steve (Gumstix?), too. At least Steve was heavily involved in discussion about this ;)

Best regards

Dirk

#58 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

This also refactors the smc911x driver to allow for detecting when the chip is missing. I.e. the detect_chip() function is called earlier and will abort gracefully when the Chip ID read returns all 1's.

---

Changes since last version:
* Incorporated auto-detect based on email discussion
* Refactored some smc911x probe to deal with the above
* Incorporated the GPIO library changes
* Removed the TOBI-specific config option due to the new auto-probe

Testing on non-Tobi carrier boards would be appreciated, since I don't have any.

 board/overo/overo.c           |   59 ++++++++++++++++++++++++++++++++++++++
 board/overo/overo.h           |   63 +++++++++++++++++++++--------------------
 drivers/net/smc911x.c         |   14 +++++----
 drivers/net/smc911x.h         |    7 +++-
 include/configs/omap3_overo.h |   17 ++++++++++-
 5 files changed, 119 insertions(+), 41 deletions(-)
board/overo/overo.c +59 -0
index dd6d286..d42dc13 100644
@@ -29,13 +29,20 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <netdev.h>
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
+#include <asm/arch/gpio.h>
 #include <asm/mach-types.h>
 #include "overo.h"
 
+#if defined(CONFIG_CMD_NET)
+static void setup_net_chip(void);
+#endif
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -62,6 +69,10 @@ int misc_init_r(void)
 	twl4030_power_init();
 	twl4030_led_init();
 
+#if defined(CONFIG_CMD_NET)
+	setup_net_chip();
+#endif
+
 	dieid_num_r();
 
 	return 0;
@@ -77,3 +88,51 @@ void set_muxconf_regs(void)
 {
 	MUX_OVERO();
 }
+
+#if defined(CONFIG_CMD_NET)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ *	      Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+	struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+	/* Configure GPMC registers */
+	writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+	writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+	writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+	writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+	writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+	writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+	writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+	/* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+	writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+	/* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+	/* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+	writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+		&ctrl_base->gpmc_nadv_ale);
+
+	/* Make GPIO 64 as output pin and send a magic pulse through it */
+	if (!omap_request_gpio(64)) {
+		omap_set_gpio_direction(64, 0);
+		omap_set_gpio_dataout(64, 1);
+		udelay(1);
+		omap_set_gpio_dataout(64, 0);
+		udelay(1);
+		omap_set_gpio_dataout(64, 1);
+	}
+}
+#endif
+
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+#ifdef CONFIG_SMC911X
+	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+	return rc;
+}
board/overo/overo.h +32 -31

94 lines not on this page · raw message

drivers/net/smc911x.c +8 -6
index 18a729c..b106ec9 100644
@@ -146,10 +146,9 @@ static void smc911x_enable(struct eth_device *dev)
 
 static int smc911x_init(struct eth_device *dev, bd_t * bd)
 {
-	printf(DRIVERNAME ": initializing\n");
+	struct chip_id *id = dev->priv;
 
-	if (smc911x_detect_chip(dev))
-		goto err_out;
+        printf(DRIVERNAME ": detected %s controller\n", id->name);
 
 	smc911x_reset(dev);
 
@@ -162,9 +161,6 @@ static int smc911x_init(struct eth_device *dev, bd_t * bd)
 	smc911x_enable(dev);
 
 	return 0;
-
-err_out:
-	return -1;
 }
 
 static int smc911x_send(struct eth_device *dev,
@@ -268,6 +264,12 @@ int smc911x_initialize(u8 dev_num, int base_addr)
 	dev->recv = smc911x_rx;
 	sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
 
+	/* Try to detect chip. Will fail if not present. */
+	if (smc911x_detect_chip(dev)) {
+		free(dev);
+		return 0;
+	}
+
 	eth_register(dev);
 	return 0;
 }
drivers/net/smc911x.h +5 -2
index 053e330..d5bca63 100644
@@ -441,7 +441,10 @@ static int smc911x_detect_chip(struct eth_device *dev)
 	unsigned long val, i;
 
 	val = smc911x_reg_read(dev, BYTE_TEST);
-	if (val != 0x87654321) {
+	if (val == 0xffffffff) {
+		/* Special case -- no chip present */
+		return -1;
+	} else if (val != 0x87654321) {
 		printf(DRIVERNAME ": Invalid chip endian 0x%08lx\n", val);
 		return -1;
 	}
@@ -455,7 +458,7 @@ static int smc911x_detect_chip(struct eth_device *dev)
 		return -1;
 	}
 
-	printf(DRIVERNAME ": detected %s controller\n", chip_ids[i].name);
+	dev->priv = (void *)&chip_ids[i];
 
 	return 0;
 }
include/configs/omap3_overo.h +15 -2
index 07a031b..1836233 100644
@@ -28,7 +28,7 @@
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3430		1	/* which is in a 3430 */
-#define CONFIG_OMAP3_OVERO		1	/* working with overo */
+#define CONFIG_OMAP3_OVERO	1	/* working with overo */
 
 #include <asm/arch/cpu.h>	/* get chip and board defs */
 #include <asm/arch/omap3.h>
@@ -105,8 +105,8 @@
 #undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
 #undef CONFIG_CMD_IMI		/* iminfo			*/
 #undef CONFIG_CMD_IMLS		/* List all found images	*/
-#undef CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 #undef CONFIG_CMD_NFS		/* NFS support			*/
+#define CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_I2C_SPEED		100000
@@ -293,4 +293,17 @@ extern unsigned int boot_flash_sec;
 extern unsigned int boot_flash_type;
 #endif
 
+#if defined(CONFIG_CMD_NET)
+/*----------------------------------------------------------------------------
+ * SMSC9211 Ethernet from SMSC9118 family
+ *----------------------------------------------------------------------------
+ */
+
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X		1
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE     0x2C000000
+
+#endif /* (CONFIG_CMD_NET) */
+
 #endif				/* __CONFIG_H */
Signature · 1 line
1.6.0.4
#59 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 10 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

This also refactors the smc911x driver to allow for detecting when the chip is missing. I.e. the detect_chip() function is called earlier and will abort gracefully when the Chip ID read returns all 1's.

(although it should have been broken into functionally-orthogonal patches).

Go ahead and apply to the TI branch.

regards,
Ben

#60 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 11 lines
Quoted 8 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

This also refactors the smc911x driver to allow for detecting when the chip is missing. I.e. the detect_chip() function is called earlier and will abort gracefully when the Chip ID read returns all 1's.

Quoted 8 lines
Quoted 2 lines

(although it should have been broken into functionally-orthogonal patches).

Go ahead and apply to the TI branch.

Yes you are right

board/overo/overo.c           |   59 ++++++++++++++++++++++++++++++++++++++
board/overo/overo.h           |   63 +++++++++++++++++++++-----------------
drivers/net/smc911x.c         |   14 +++++----
drivers/net/smc911x.h         |    7 +++-

the above 2 should have been in a diff patch
include/configs/omap3_overo.h | 17 ++++++++++-

 5 files changed, 119 insertions(+), 41 deletions(-)
Quoted 3 lines

regards,
Ben

#61 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Olof Johansson
Quoted 7 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

This also refactors the smc911x driver to allow for detecting when the chip is missing. I.e. the detect_chip() function is called earlier and will abort gracefully when the Chip ID read returns all 1's.

Hmm . . . I just tried this on a board without smc911x chip and it seems to hang after printing "Net".

Did it work for you in this case? Haven't had time to debug yet, but will try to look later today.

Steve

Quoted 322 lines

---

Changes since last version:
* Incorporated auto-detect based on email discussion
* Refactored some smc911x probe to deal with the above
* Incorporated the GPIO library changes
* Removed the TOBI-specific config option due to the new auto-probe

Testing on non-Tobi carrier boards would be appreciated, since I don't have any.

?board/overo/overo.c ? ? ? ? ? | ? 59 ++++++++++++++++++++++++++++++++++++++
?board/overo/overo.h ? ? ? ? ? | ? 63 +++++++++++++++++++++--------------------
?drivers/net/smc911x.c ? ? ? ? | ? 14 +++++----
?drivers/net/smc911x.h ? ? ? ? | ? ?7 +++-
?include/configs/omap3_overo.h | ? 17 ++++++++++-

?5 files changed, 119 insertions(+), 41 deletions(-)

board/overo/overo.c +0 -0
index dd6d286..d42dc13 100644
@@ -29,13 +29,20 @@

?* MA 02111-1307 USA
?*/
?#include <common.h>
+#include <netdev.h>
?#include <twl4030.h>
?#include <asm/io.h>
?#include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
?#include <asm/arch/sys_proto.h>
+#include <asm/arch/gpio.h>
?#include <asm/mach-types.h>
?#include "overo.h"

board/overo/overo.c +4 -0
+#if defined(CONFIG_CMD_NET)
+static void setup_net_chip(void);
+#endif
+

?/*
?* Routine: board_init
?* Description: Early hardware init.

board/overo/overo.c +52 -0
@@ -62,6 +69,10 @@ int misc_init_r(void)
 ? ? ? ?twl4030_power_init();
 ? ? ? ?twl4030_led_init();
 
+#if defined(CONFIG_CMD_NET)
+ ? ? ? setup_net_chip();
+#endif
+
 ? ? ? ?dieid_num_r();
 
 ? ? ? ?return 0;
@@ -77,3 +88,51 @@ void set_muxconf_regs(void)
 ?{
 ? ? ? ?MUX_OVERO();
 ?}
+
+#if defined(CONFIG_CMD_NET)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers specific to the
+ * ? ? ? ? ? Ethernet hardware.
+ */
+static void setup_net_chip(void)
+{
+ ? ? ? struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+ ? ? ? /* Configure GPMC registers */
+ ? ? ? writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+ ? ? ? writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+ ? ? ? writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+ ? ? ? writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+ ? ? ? writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+ ? ? ? writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+ ? ? ? writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+ ? ? ? /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+ ? ? ? writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
+ ? ? ? /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
+ ? ? ? writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
+ ? ? ? /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
+ ? ? ? writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+ ? ? ? ? ? ? ? &ctrl_base->gpmc_nadv_ale);
+
+ ? ? ? /* Make GPIO 64 as output pin and send a magic pulse through it */
+ ? ? ? if (!omap_request_gpio(64)) {
+ ? ? ? ? ? ? ? omap_set_gpio_direction(64, 0);
+ ? ? ? ? ? ? ? omap_set_gpio_dataout(64, 1);
+ ? ? ? ? ? ? ? udelay(1);
+ ? ? ? ? ? ? ? omap_set_gpio_dataout(64, 0);
+ ? ? ? ? ? ? ? udelay(1);
+ ? ? ? ? ? ? ? omap_set_gpio_dataout(64, 1);
+ ? ? ? }
+}
+#endif
+
+int board_eth_init(bd_t *bis)
+{
+ ? ? ? int rc = 0;
+#ifdef CONFIG_SMC911X
+ ? ? ? rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+ ? ? ? return rc;
+}
board/overo/overo.h +31 -31
index d9fe74e..4c7ac27 100644
@@ -83,43 +83,43 @@ const omap3_sysinfo sysinfo = {
 ? ? ? ?MUX_VAL(CP(SDRC_DQS2), ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*SDRC_DQS2*/\
 ? ? ? ?MUX_VAL(CP(SDRC_DQS3), ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*SDRC_DQS3*/\
 ?/*GPMC*/\
- ? ? ? MUX_VAL(CP(GPMC_A1), ? ? ? ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_A1*/\
- ? ? ? MUX_VAL(CP(GPMC_A2), ? ? ? ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_A2*/\
- ? ? ? MUX_VAL(CP(GPMC_A3), ? ? ? ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_A3*/\
- ? ? ? MUX_VAL(CP(GPMC_A4), ? ? ? ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_A4*/\
- ? ? ? MUX_VAL(CP(GPMC_A5), ? ? ? ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_A5*/\
- ? ? ? MUX_VAL(CP(GPMC_A6), ? ? ? ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_A6*/\
- ? ? ? MUX_VAL(CP(GPMC_A7), ? ? ? ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_A7*/\
- ? ? ? MUX_VAL(CP(GPMC_A8), ? ? ? ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_A8*/\
- ? ? ? MUX_VAL(CP(GPMC_A9), ? ? ? ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_A9*/\
- ? ? ? MUX_VAL(CP(GPMC_A10), ? ? ? ? ? (IDIS | PTD | DIS | M0)) /*GPMC_A10*/\
- ? ? ? MUX_VAL(CP(GPMC_D0), ? ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_D0*/\
- ? ? ? MUX_VAL(CP(GPMC_D1), ? ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_D1*/\
- ? ? ? MUX_VAL(CP(GPMC_D2), ? ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_D2*/\
- ? ? ? MUX_VAL(CP(GPMC_D3), ? ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_D3*/\
- ? ? ? MUX_VAL(CP(GPMC_D4), ? ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_D4*/\
- ? ? ? MUX_VAL(CP(GPMC_D5), ? ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_D5*/\
- ? ? ? MUX_VAL(CP(GPMC_D6), ? ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_D6*/\
- ? ? ? MUX_VAL(CP(GPMC_D7), ? ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_D7*/\
- ? ? ? MUX_VAL(CP(GPMC_D8), ? ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_D8*/\
- ? ? ? MUX_VAL(CP(GPMC_D9), ? ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_D9*/\
- ? ? ? MUX_VAL(CP(GPMC_D10), ? ? ? ? ? (IEN ?| PTD | DIS | M0)) /*GPMC_D10*/\
- ? ? ? MUX_VAL(CP(GPMC_D11), ? ? ? ? ? (IEN ?| PTD | DIS | M0)) /*GPMC_D11*/\
- ? ? ? MUX_VAL(CP(GPMC_D12), ? ? ? ? ? (IEN ?| PTD | DIS | M0)) /*GPMC_D12*/\
- ? ? ? MUX_VAL(CP(GPMC_D13), ? ? ? ? ? (IEN ?| PTD | DIS | M0)) /*GPMC_D13*/\
- ? ? ? MUX_VAL(CP(GPMC_D14), ? ? ? ? ? (IEN ?| PTD | DIS | M0)) /*GPMC_D14*/\
- ? ? ? MUX_VAL(CP(GPMC_D15), ? ? ? ? ? (IEN ?| PTD | DIS | M0)) /*GPMC_D15*/\
+ ? ? ? MUX_VAL(CP(GPMC_A1), ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A1*/\
+ ? ? ? MUX_VAL(CP(GPMC_A2), ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A2*/\
+ ? ? ? MUX_VAL(CP(GPMC_A3), ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A3*/\
+ ? ? ? MUX_VAL(CP(GPMC_A4), ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A4*/\
+ ? ? ? MUX_VAL(CP(GPMC_A5), ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A5*/\
+ ? ? ? MUX_VAL(CP(GPMC_A6), ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A6*/\
+ ? ? ? MUX_VAL(CP(GPMC_A7), ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A7*/\
+ ? ? ? MUX_VAL(CP(GPMC_A8), ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A8*/\
+ ? ? ? MUX_VAL(CP(GPMC_A9), ? ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_A9*/\
+ ? ? ? MUX_VAL(CP(GPMC_A10), ? ? ? ? ? (IDIS | PTU | EN ?| M0)) /*GPMC_A10*/\
+ ? ? ? MUX_VAL(CP(GPMC_D0), ? ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D0*/\
+ ? ? ? MUX_VAL(CP(GPMC_D1), ? ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D1*/\
+ ? ? ? MUX_VAL(CP(GPMC_D2), ? ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D2*/\
+ ? ? ? MUX_VAL(CP(GPMC_D3), ? ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D3*/\
+ ? ? ? MUX_VAL(CP(GPMC_D4), ? ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D4*/\
+ ? ? ? MUX_VAL(CP(GPMC_D5), ? ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D5*/\
+ ? ? ? MUX_VAL(CP(GPMC_D6), ? ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D6*/\
+ ? ? ? MUX_VAL(CP(GPMC_D7), ? ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D7*/\
+ ? ? ? MUX_VAL(CP(GPMC_D8), ? ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D8*/\
+ ? ? ? MUX_VAL(CP(GPMC_D9), ? ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_D9*/\
+ ? ? ? MUX_VAL(CP(GPMC_D10), ? ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D10*/\
+ ? ? ? MUX_VAL(CP(GPMC_D11), ? ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D11*/\
+ ? ? ? MUX_VAL(CP(GPMC_D12), ? ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D12*/\
+ ? ? ? MUX_VAL(CP(GPMC_D13), ? ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D13*/\
+ ? ? ? MUX_VAL(CP(GPMC_D14), ? ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D14*/\
+ ? ? ? MUX_VAL(CP(GPMC_D15), ? ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_D15*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NCS0), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_nCS0*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NCS1), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_nCS1*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NCS2), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_nCS2*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NCS3), ? ? ? ? ?(IEN ?| PTU | EN ?| M4)) /*GPIO_54*/\
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* - MMC1_WP*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NCS4), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_nCS4*/\
- ? ? ? MUX_VAL(CP(GPMC_NCS5), ? ? ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_nCS5*/\
+ ? ? ? MUX_VAL(CP(GPMC_NCS5), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*GPMC_nCS5*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NCS6), ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_nCS6*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NCS7), ? ? ? ? ?(IEN ?| PTU | EN ?| M0)) /*GPMC_nCS7*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NBE1), ? ? ? ? ?(IEN ?| PTD | DIS | M0)) /*GPMC_nCS3*/\
- ? ? ? MUX_VAL(CP(GPMC_CLK), ? ? ? ? ? (IDIS | PTD | DIS | M0)) /*GPMC_CLK*/\
+ ? ? ? MUX_VAL(CP(GPMC_CLK), ? ? ? ? ? (IDIS | PTU | EN ?| M0)) /*GPMC_CLK*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NADV_ALE), ? ? ?(IDIS | PTD | DIS | M0)) /*GPMC_nADV_ALE*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NOE), ? ? ? ? ? (IDIS | PTD | DIS | M0)) /*GPMC_nOE*/\
 ? ? ? ?MUX_VAL(CP(GPMC_NWE), ? ? ? ? ? (IDIS | PTD | DIS | M0)) /*GPMC_nWE*/\
@@ -127,7 +127,7 @@ const omap3_sysinfo sysinfo = {
 ? ? ? ?MUX_VAL(CP(GPMC_NWP), ? ? ? ? ? (IEN ?| PTD | DIS | M0)) /*GPMC_nWP*/\
 ? ? ? ?MUX_VAL(CP(GPMC_WAIT0), ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_WAIT0*/\
 ? ? ? ?MUX_VAL(CP(GPMC_WAIT1), ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_WAIT1*/\
- ? ? ? MUX_VAL(CP(GPMC_WAIT2), ? ? ? ? (IEN ?| PTU | DIS | M4)) /*GPIO_64*/\
+ ? ? ? MUX_VAL(CP(GPMC_WAIT2), ? ? ? ? (IEN ?| PTU | EN ?| M4)) /*GPIO_64*/\
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* - SMSC911X_NRES*/\
 ? ? ? ?MUX_VAL(CP(GPMC_WAIT3), ? ? ? ? (IEN ?| PTU | EN ?| M0)) /*GPMC_nCS3*/\
 ?/*DSS*/\
@@ -270,8 +270,8 @@ const omap3_sysinfo sysinfo = {
 ? ? ? ?MUX_VAL(CP(MCSPI1_SOMI), ? ? ? ?(IEN ?| PTD | DIS | M0)) /*McSPI1_SOMI */\
 ? ? ? ?MUX_VAL(CP(MCSPI1_CS0), ? ? ? ? (IEN ?| PTD | EN ?| M0)) /*McSPI1_CS0*/\
 ? ? ? ?MUX_VAL(CP(MCSPI1_CS1), ? ? ? ? (IDIS | PTD | EN ?| M0)) /*McSPI1_CS1*/\
- ? ? ? MUX_VAL(CP(MCSPI1_CS2), ? ? ? ? (IEN ?| PTD | DIS | M4)) /*GPIO_176*/\
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* - SMSC911X_IRQ*/\
+ ? ? ? MUX_VAL(CP(MCSPI1_CS2), ? ? ? ? (IEN ?| PTU | DIS | M4)) /*GPIO_176 */\
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* - LAN_INTR */\
 ? ? ? ?MUX_VAL(CP(MCSPI1_CS3), ? ? ? ? (IEN ?| PTD | DIS | M3)) /*HSUSB2_DATA2*/\
 ? ? ? ?MUX_VAL(CP(MCSPI2_CLK), ? ? ? ? (IEN ?| PTD | DIS | M3)) /*HSUSB2_DATA7*/\
 ? ? ? ?MUX_VAL(CP(MCSPI2_SIMO), ? ? ? ?(IEN ?| PTD | DIS | M3)) /*HSUSB2_DATA4*/\
@@ -378,4 +378,5 @@ const omap3_sysinfo sysinfo = {
 ? ? ? ?MUX_VAL(CP(SDRC_CKE0), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*sdrc_cke0*/\

? ? ? ?MUX_VAL(CP(SDRC_CKE1), ? ? ? ? ?(IDIS | PTU | EN ?| M0)) /*sdrc_cke1*/

+
?#endif

drivers/net/smc911x.c +8 -6
index 18a729c..b106ec9 100644
@@ -146,10 +146,9 @@ static void smc911x_enable(struct eth_device *dev)
 
 ?static int smc911x_init(struct eth_device *dev, bd_t * bd)
 ?{
- ? ? ? printf(DRIVERNAME ": initializing\n");
+ ? ? ? struct chip_id *id = dev->priv;
 
- ? ? ? if (smc911x_detect_chip(dev))
- ? ? ? ? ? ? ? goto err_out;
+ ? ? ? ?printf(DRIVERNAME ": detected %s controller\n", id->name);
 
 ? ? ? ?smc911x_reset(dev);
 
@@ -162,9 +161,6 @@ static int smc911x_init(struct eth_device *dev, bd_t * bd)
 ? ? ? ?smc911x_enable(dev);
 
 ? ? ? ?return 0;
-
-err_out:
- ? ? ? return -1;
 ?}
 
 ?static int smc911x_send(struct eth_device *dev,
@@ -268,6 +264,12 @@ int smc911x_initialize(u8 dev_num, int base_addr)
 ? ? ? ?dev->recv = smc911x_rx;
 ? ? ? ?sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
 
+ ? ? ? /* Try to detect chip. Will fail if not present. */
+ ? ? ? if (smc911x_detect_chip(dev)) {
+ ? ? ? ? ? ? ? free(dev);
+ ? ? ? ? ? ? ? return 0;
+ ? ? ? }
+
 ? ? ? ?eth_register(dev);
 ? ? ? ?return 0;
 ?}
drivers/net/smc911x.h +5 -2
index 053e330..d5bca63 100644
@@ -441,7 +441,10 @@ static int smc911x_detect_chip(struct eth_device *dev)
 ? ? ? ?unsigned long val, i;
 
 ? ? ? ?val = smc911x_reg_read(dev, BYTE_TEST);
- ? ? ? if (val != 0x87654321) {
+ ? ? ? if (val == 0xffffffff) {
+ ? ? ? ? ? ? ? /* Special case -- no chip present */
+ ? ? ? ? ? ? ? return -1;
+ ? ? ? } else if (val != 0x87654321) {
 ? ? ? ? ? ? ? ?printf(DRIVERNAME ": Invalid chip endian 0x%08lx\n", val);
 ? ? ? ? ? ? ? ?return -1;
 ? ? ? ?}
@@ -455,7 +458,7 @@ static int smc911x_detect_chip(struct eth_device *dev)
 ? ? ? ? ? ? ? ?return -1;
 ? ? ? ?}
 
- ? ? ? printf(DRIVERNAME ": detected %s controller\n", chip_ids[i].name);
+ ? ? ? dev->priv = (void *)&chip_ids[i];
 
 ? ? ? ?return 0;
 ?}
include/configs/omap3_overo.h +0 -0
index 07a031b..1836233 100644
@@ -28,7 +28,7 @@

?#define CONFIG_OMAP ? ? ? ? ? ?1 ? ? ? /* in a TI OMAP core */ ?#define CONFIG_OMAP34XX ? ? ? ? ? ? ? ?1 ? ? ? /* which is a 34XX */ ?#define CONFIG_OMAP3430 ? ? ? ? ? ? ? ?1 ? ? ? /* which is in a 3430 */

include/configs/omap3_overo.h +1 -1
-#define CONFIG_OMAP3_OVERO ? ? ? ? ? ? 1 ? ? ? /* working with overo */
+#define CONFIG_OMAP3_OVERO ? ? 1 ? ? ? /* working with overo */

?#include <asm/arch/cpu.h> ? ? ?/* get chip and board defs */ ?#include <asm/arch/omap3.h>

include/configs/omap3_overo.h +0 -0
@@ -105,8 +105,8 @@

?#undef CONFIG_CMD_FPGA ? ? ? ? /* FPGA configuration Support ? */ ?#undef CONFIG_CMD_IMI ? ? ? ? ?/* iminfo ? ? ? ? ? ? ? ? ? ? ? */ ?#undef CONFIG_CMD_IMLS ? ? ? ? /* List all found images ? ? ? ?*/ -#undef CONFIG_CMD_NET ? ? ? ? ?/* bootp, tftpboot, rarpboot ? ?*/ ?#undef CONFIG_CMD_NFS ? ? ? ? ?/* NFS support ? ? ? ? ? ? ? ? ?*/ +#define CONFIG_CMD_NET ? ? ? ? /* bootp, tftpboot, rarpboot ? ?*/

?#define CONFIG_SYS_NO_FLASH
?#define CONFIG_SYS_I2C_SPEED ? ? ? ? ? 100000

include/configs/omap3_overo.h +0 -0
@@ -293,4 +293,17 @@ extern unsigned int boot_flash_sec;
 ?extern unsigned int boot_flash_type;

?#endif

include/configs/omap3_overo.h +13 -0
+#if defined(CONFIG_CMD_NET)
+/*----------------------------------------------------------------------------
+ * SMSC9211 Ethernet from SMSC9118 family
+ *----------------------------------------------------------------------------
+ */
+
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X ? ? ? ? 1
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE ? ? 0x2C000000
+
+#endif /* (CONFIG_CMD_NET) */
+

?#endif ? ? ? ? ? ? ? ? ? ? ? ? /* __CONFIG_H */
--
1.6.0.4

#62 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 12 lines · Steve Sakoman
Quoted 9 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

This also refactors the smc911x driver to allow for detecting when the
chip is missing. I.e. the detect_chip() function is called earlier and
will abort gracefully when the Chip ID read returns all 1's.

Quoted 5 lines

Hmm . . . I just tried this on a board without smc911x chip and it seems to hang after printing "Net".

Did it work for you in this case? Haven't had time to debug yet, but will try to look later today.

The only hardware I have is tobi, which is why I thought I cc:d you as well as asked others to test with other carriers if they had them.

I guess first thing to find out is if it's the first read that hangs or what.

-Olof

Quoted 441 lines

Steve

Quoted 438 lines

---

Changes since last version:
* Incorporated auto-detect based on email discussion
* Refactored some smc911x probe to deal with the above
* Incorporated the GPIO library changes
* Removed the TOBI-specific config option due to the new auto-probe

Testing on non-Tobi carrier boards would be appreciated, since I don't
have any.

 board/overo/overo.c           |   59 ++++++++++++++++++++++++++++++ 
++++++++
 board/overo/overo.h           |   63 ++++++++++++++++++++ 
+--------------------
 drivers/net/smc911x.c         |   14 +++++----
 drivers/net/smc911x.h         |    7 +++-
 include/configs/omap3_overo.h |   17 ++++++++++-
 5 files changed, 119 insertions(+), 41 deletions(-)
board/overo/overo.c +16 -0
index dd6d286..d42dc13 100644
@@ -29,13 +29,20 @@
 * MA 02111-1307 USA
 */
 #include <common.h>
+#include <netdev.h>
 #include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mux.h>
+#include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
+#include <asm/arch/gpio.h>
 #include <asm/mach-types.h>
 #include "overo.h"
 
+#if defined(CONFIG_CMD_NET)
+static void setup_net_chip(void);
+#endif
+
 /*
 * Routine: board_init
 * Description: Early hardware init.
@@ -62,6 +69,10 @@ int misc_init_r(void)
       twl4030_power_init();
       twl4030_led_init();
 
+#if defined(CONFIG_CMD_NET)
+       setup_net_chip();
+#endif
+
       dieid_num_r();
 
       return 0;
@@ -77,3 +88,51 @@ void set_muxconf_regs(void)
 {
       MUX_OVERO();
 }
+
+#if defined(CONFIG_CMD_NET)
+/*
+ * Routine: setup_net_chip
+ * Description: Setting up the configuration GPMC registers  

specific to the
+ * Ethernet hardware.
+ */

board/overo/overo.c +15 -0
+static void setup_net_chip(void)
+{
+       struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
+
+       /* Configure GPMC registers */
+       writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1);
+       writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2);
+       writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3);
+       writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4);
+       writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5);
+       writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6);
+       writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7);
+
+       /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
+       writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base- 
Quoted 1 line

gpmc_nwe);

+ /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE
register */
+ writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base-

Quoted 1 line

gpmc_noe);

+ /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE
register */

board/overo/overo.c +4 -0
+       writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
+               &ctrl_base->gpmc_nadv_ale);
+
+       /* Make GPIO 64 as output pin and send a magic pulse  

through it */

board/overo/overo.c +19 -0
+       if (!omap_request_gpio(64)) {
+               omap_set_gpio_direction(64, 0);
+               omap_set_gpio_dataout(64, 1);
+               udelay(1);
+               omap_set_gpio_dataout(64, 0);
+               udelay(1);
+               omap_set_gpio_dataout(64, 1);
+       }
+}
+#endif
+
+int board_eth_init(bd_t *bis)
+{
+       int rc = 0;
+#ifdef CONFIG_SMC911X
+       rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+#endif
+       return rc;
+}
board/overo/overo.h +0 -20
index d9fe74e..4c7ac27 100644
@@ -83,43 +83,43 @@ const omap3_sysinfo sysinfo = {
       MUX_VAL(CP(SDRC_DQS2),          (IEN  | PTD | DIS | M0)) / 
 *SDRC_DQS2*/\
       MUX_VAL(CP(SDRC_DQS3),          (IEN  | PTD | DIS | M0)) / 
 *SDRC_DQS3*/\
 /*GPMC*/\
-       MUX_VAL(CP(GPMC_A1),            (IDIS | PTD | DIS | M0)) / 
 *GPMC_A1*/\
-       MUX_VAL(CP(GPMC_A2),            (IDIS | PTD | DIS | M0)) / 
 *GPMC_A2*/\
-       MUX_VAL(CP(GPMC_A3),            (IDIS | PTD | DIS | M0)) / 
 *GPMC_A3*/\
-       MUX_VAL(CP(GPMC_A4),            (IDIS | PTD | DIS | M0)) / 
 *GPMC_A4*/\
-       MUX_VAL(CP(GPMC_A5),            (IDIS | PTD | DIS | M0)) / 
 *GPMC_A5*/\
-       MUX_VAL(CP(GPMC_A6),            (IDIS | PTD | DIS | M0)) / 
 *GPMC_A6*/\
-       MUX_VAL(CP(GPMC_A7),            (IDIS | PTD | DIS | M0)) / 
 *GPMC_A7*/\
-       MUX_VAL(CP(GPMC_A8),            (IDIS | PTD | DIS | M0)) / 
 *GPMC_A8*/\
-       MUX_VAL(CP(GPMC_A9),            (IDIS | PTD | DIS | M0)) / 
 *GPMC_A9*/\
-       MUX_VAL(CP(GPMC_A10),           (IDIS | PTD | DIS | M0)) / 
 *GPMC_A10*/\
-       MUX_VAL(CP(GPMC_D0),            (IEN  | PTD | DIS | M0)) / 
 *GPMC_D0*/\
-       MUX_VAL(CP(GPMC_D1),            (IEN  | PTD | DIS | M0)) / 
 *GPMC_D1*/\
-       MUX_VAL(CP(GPMC_D2),            (IEN  | PTD | DIS | M0)) / 
 *GPMC_D2*/\
-       MUX_VAL(CP(GPMC_D3),            (IEN  | PTD | DIS | M0)) / 
 *GPMC_D3*/\
-       MUX_VAL(CP(GPMC_D4),            (IEN  | PTD | DIS | M0)) / 
 *GPMC_D4*/\
-       MUX_VAL(CP(GPMC_D5),            (IEN  | PTD | DIS | M0)) / 
 *GPMC_D5*/\
-       MUX_VAL(CP(GPMC_D6),            (IEN  | PTD | DIS | M0)) / 
 *GPMC_D6*/\
-       MUX_VAL(CP(GPMC_D7),            (IEN  | PTD | DIS | M0)) / 
 *GPMC_D7*/\
-       MUX_VAL(CP(GPMC_D8),            (IEN  | PTD | DIS | M0)) / 
 *GPMC_D8*/\
-       MUX_VAL(CP(GPMC_D9),            (IEN  | PTD | DIS | M0)) / 

*GPMC_D9*/\
- MUX_VAL(CP(GPMC_D10), (IEN | PTD | DIS | M0)) /
*GPMC_D10*/\
- MUX_VAL(CP(GPMC_D11), (IEN | PTD | DIS | M0)) /
*GPMC_D11*/\
- MUX_VAL(CP(GPMC_D12), (IEN | PTD | DIS | M0)) /
*GPMC_D12*/\
- MUX_VAL(CP(GPMC_D13), (IEN | PTD | DIS | M0)) /
*GPMC_D13*/\
- MUX_VAL(CP(GPMC_D14), (IEN | PTD | DIS | M0)) /
*GPMC_D14*/\
- MUX_VAL(CP(GPMC_D15), (IEN | PTD | DIS | M0)) /
*GPMC_D15*/\
+ MUX_VAL(CP(GPMC_A1), (IDIS | PTU | EN | M0)) /
*GPMC_A1*/\
+ MUX_VAL(CP(GPMC_A2), (IDIS | PTU | EN | M0)) /
*GPMC_A2*/\
+ MUX_VAL(CP(GPMC_A3), (IDIS | PTU | EN | M0)) /
*GPMC_A3*/\
+ MUX_VAL(CP(GPMC_A4), (IDIS | PTU | EN | M0)) /
*GPMC_A4*/\
+ MUX_VAL(CP(GPMC_A5), (IDIS | PTU | EN | M0)) /
*GPMC_A5*/\
+ MUX_VAL(CP(GPMC_A6), (IDIS | PTU | EN | M0)) /
*GPMC_A6*/\
+ MUX_VAL(CP(GPMC_A7), (IDIS | PTU | EN | M0)) /
*GPMC_A7*/\
+ MUX_VAL(CP(GPMC_A8), (IDIS | PTU | EN | M0)) /
*GPMC_A8*/\
+ MUX_VAL(CP(GPMC_A9), (IDIS | PTU | EN | M0)) /
*GPMC_A9*/\
+ MUX_VAL(CP(GPMC_A10), (IDIS | PTU | EN | M0)) /
*GPMC_A10*/\
+ MUX_VAL(CP(GPMC_D0), (IEN | PTU | EN | M0)) /
*GPMC_D0*/\
+ MUX_VAL(CP(GPMC_D1), (IEN | PTU | EN | M0)) /
*GPMC_D1*/\
+ MUX_VAL(CP(GPMC_D2), (IEN | PTU | EN | M0)) /
*GPMC_D2*/\
+ MUX_VAL(CP(GPMC_D3), (IEN | PTU | EN | M0)) /
*GPMC_D3*/\
+ MUX_VAL(CP(GPMC_D4), (IEN | PTU | EN | M0)) /
*GPMC_D4*/\
+ MUX_VAL(CP(GPMC_D5), (IEN | PTU | EN | M0)) /
*GPMC_D5*/\
+ MUX_VAL(CP(GPMC_D6), (IEN | PTU | EN | M0)) /
*GPMC_D6*/\
+ MUX_VAL(CP(GPMC_D7), (IEN | PTU | EN | M0)) /
*GPMC_D7*/\
+ MUX_VAL(CP(GPMC_D8), (IEN | PTU | EN | M0)) /
*GPMC_D8*/\
+ MUX_VAL(CP(GPMC_D9), (IEN | PTU | EN | M0)) /
*GPMC_D9*/\
+ MUX_VAL(CP(GPMC_D10), (IEN | PTU | EN | M0)) /
*GPMC_D10*/\
+ MUX_VAL(CP(GPMC_D11), (IEN | PTU | EN | M0)) /
*GPMC_D11*/\
+ MUX_VAL(CP(GPMC_D12), (IEN | PTU | EN | M0)) /
*GPMC_D12*/\
+ MUX_VAL(CP(GPMC_D13), (IEN | PTU | EN | M0)) /
*GPMC_D13*/\
+ MUX_VAL(CP(GPMC_D14), (IEN | PTU | EN | M0)) /
*GPMC_D14*/\
+ MUX_VAL(CP(GPMC_D15), (IEN | PTU | EN | M0)) /

*GPMC_D15*/\
       MUX_VAL(CP(GPMC_NCS0),          (IDIS | PTU | EN  | M0)) / 
*GPMC_nCS0*/\
       MUX_VAL(CP(GPMC_NCS1),          (IDIS | PTU | EN  | M0)) / 
*GPMC_nCS1*/\
       MUX_VAL(CP(GPMC_NCS2),          (IDIS | PTU | EN  | M0)) / 
*GPMC_nCS2*/\
       MUX_VAL(CP(GPMC_NCS3),          (IEN  | PTU | EN  | M4)) / 
*GPIO_54*/\
                                                                /*  
- MMC1_WP*/\
       MUX_VAL(CP(GPMC_NCS4),          (IDIS | PTU | EN  | M0)) / 

*GPMC_nCS4*/\
- MUX_VAL(CP(GPMC_NCS5), (IDIS | PTD | DIS | M0)) /
*GPMC_nCS5*/\
+ MUX_VAL(CP(GPMC_NCS5), (IDIS | PTU | EN | M0)) /

*GPMC_nCS5*/\
       MUX_VAL(CP(GPMC_NCS6),          (IEN  | PTD | DIS | M0)) / 
*GPMC_nCS6*/\
       MUX_VAL(CP(GPMC_NCS7),          (IEN  | PTU | EN  | M0)) / 
*GPMC_nCS7*/\
       MUX_VAL(CP(GPMC_NBE1),          (IEN  | PTD | DIS | M0)) / 

*GPMC_nCS3*/\
- MUX_VAL(CP(GPMC_CLK), (IDIS | PTD | DIS | M0)) /
*GPMC_CLK*/\
+ MUX_VAL(CP(GPMC_CLK), (IDIS | PTU | EN | M0)) /

*GPMC_CLK*/\
       MUX_VAL(CP(GPMC_NADV_ALE),      (IDIS | PTD | DIS | M0)) / 

*GPMC_nADV_ALE*/\
MUX_VAL(CP(GPMC_NOE), (IDIS | PTD | DIS | M0)) /
*GPMC_nOE*/\
MUX_VAL(CP(GPMC_NWE), (IDIS | PTD | DIS | M0)) /
*GPMC_nWE*/\

board/overo/overo.h +0 -1
@@ -127,7 +127,7 @@ const omap3_sysinfo sysinfo = {
       MUX_VAL(CP(GPMC_NWP),           (IEN  | PTD | DIS | M0)) / 
 *GPMC_nWP*/\
       MUX_VAL(CP(GPMC_WAIT0),         (IEN  | PTU | EN  | M0)) / 
 *GPMC_WAIT0*/\
       MUX_VAL(CP(GPMC_WAIT1),         (IEN  | PTU | EN  | M0)) / 
 *GPMC_WAIT1*/\
-       MUX_VAL(CP(GPMC_WAIT2),         (IEN  | PTU | DIS | M4)) / 

*GPIO_64*/\
+ MUX_VAL(CP(GPMC_WAIT2), (IEN | PTU | EN | M4)) /

*GPIO_64*/\
                                                                /*  
- SMSC911X_NRES*/\
       MUX_VAL(CP(GPMC_WAIT3),         (IEN  | PTU | EN  | M0)) / 

*GPMC_nCS3*/\
/*DSS*/\

board/overo/overo.h +1 -3
@@ -270,8 +270,8 @@ const omap3_sysinfo sysinfo = {
       MUX_VAL(CP(MCSPI1_SOMI),        (IEN  | PTD | DIS | M0)) / 
 *McSPI1_SOMI */\
       MUX_VAL(CP(MCSPI1_CS0),         (IEN  | PTD | EN  | M0)) / 
 *McSPI1_CS0*/\
       MUX_VAL(CP(MCSPI1_CS1),         (IDIS | PTD | EN  | M0)) / 
 *McSPI1_CS1*/\
-       MUX_VAL(CP(MCSPI1_CS2),         (IEN  | PTD | DIS | M4)) / 
 *GPIO_176*/\
-                                                                /*  
- SMSC911X_IRQ*/\
+       MUX_VAL(CP(MCSPI1_CS2),         (IEN  | PTU | DIS | M4)) / 

*GPIO_176 */\
+ /*

- LAN_INTR */\
       MUX_VAL(CP(MCSPI1_CS3),         (IEN  | PTD | DIS | M3)) / 
*HSUSB2_DATA2*/\
       MUX_VAL(CP(MCSPI2_CLK),         (IEN  | PTD | DIS | M3)) / 
*HSUSB2_DATA7*/\
       MUX_VAL(CP(MCSPI2_SIMO),        (IEN  | PTD | DIS | M3)) / 

*HSUSB2_DATA4*/\

board/overo/overo.h +1 -0
@@ -378,4 +378,5 @@ const omap3_sysinfo sysinfo = {
       MUX_VAL(CP(SDRC_CKE0),          (IDIS | PTU | EN  | M0)) / 
 *sdrc_cke0*/\
       MUX_VAL(CP(SDRC_CKE1),          (IDIS | PTU | EN  | M0)) / 
 *sdrc_cke1*/
 
+
 #endif
drivers/net/smc911x.c +2 -6
index 18a729c..b106ec9 100644
@@ -146,10 +146,9 @@ static void smc911x_enable(struct eth_device  
 *dev)
 
 static int smc911x_init(struct eth_device *dev, bd_t * bd)
 {
-       printf(DRIVERNAME ": initializing\n");
+       struct chip_id *id = dev->priv;
 
-       if (smc911x_detect_chip(dev))
-               goto err_out;
+        printf(DRIVERNAME ": detected %s controller\n", id->name);
 
       smc911x_reset(dev);
@@ -162,9 +161,6 @@ static int smc911x_init(struct eth_device *dev,  
 bd_t * bd)
       smc911x_enable(dev);
 
       return 0;
-
-err_out:
-       return -1;
 }
 

static int smc911x_send(struct eth_device *dev,

drivers/net/smc911x.c +6 -0
@@ -268,6 +264,12 @@ int smc911x_initialize(u8 dev_num, int  
 base_addr)
       dev->recv = smc911x_rx;
       sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
 
+       /* Try to detect chip. Will fail if not present. */
+       if (smc911x_detect_chip(dev)) {
+               free(dev);
+               return 0;
+       }
+
       eth_register(dev);
       return 0;

}

drivers/net/smc911x.h +4 -1
index 053e330..d5bca63 100644
@@ -441,7 +441,10 @@ static int smc911x_detect_chip(struct  
 eth_device *dev)
       unsigned long val, i;
 
       val = smc911x_reg_read(dev, BYTE_TEST);
-       if (val != 0x87654321) {
+       if (val == 0xffffffff) {
+               /* Special case -- no chip present */
+               return -1;
+       } else if (val != 0x87654321) {
               printf(DRIVERNAME ": Invalid chip endian 0x%08lx\n",  
 val);
               return -1;
       }
drivers/net/smc911x.h +1 -1
@@ -455,7 +458,7 @@ static int smc911x_detect_chip(struct  
 eth_device *dev)
               return -1;
       }
 
-       printf(DRIVERNAME ": detected %s controller\n", chip_ids 
 [i].name);
+       dev->priv = (void *)&chip_ids[i];
 
       return 0;

}

include/configs/ renamed from include/configs/omap3_overo.h +0 -0

omap3_overo.h
index 07a031b..1836233 100644

include/configs/omap3_overo.h +0 -0
@@ -28,7 +28,7 @@
 #define CONFIG_OMAP            1       /* in a TI OMAP core */
 #define CONFIG_OMAP34XX                1       /* which is a 34XX */
 #define CONFIG_OMAP3430                1       /* which is in a  

3430 */
-#define CONFIG_OMAP3_OVERO 1 /* working with
overo */

include/configs/omap3_overo.h +6 -4
+#define CONFIG_OMAP3_OVERO     1       /* working with overo */
 
 #include <asm/arch/cpu.h>      /* get chip and board defs */
 #include <asm/arch/omap3.h>
@@ -105,8 +105,8 @@
 #undef CONFIG_CMD_FPGA         /* FPGA configuration Support   */
 #undef CONFIG_CMD_IMI          /* iminfo                       */
 #undef CONFIG_CMD_IMLS         /* List all found images        */
-#undef CONFIG_CMD_NET          /* bootp, tftpboot, rarpboot    */
 #undef CONFIG_CMD_NFS          /* NFS support                  */
+#define CONFIG_CMD_NET         /* bootp, tftpboot, rarpboot    */
 
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_SYS_I2C_SPEED           100000
@@ -293,4 +293,17 @@ extern unsigned int boot_flash_sec;
 extern unsigned int boot_flash_type;
 #endif
 
+#if defined(CONFIG_CMD_NET)
+/ 
 *-- 
--- 
--- 
--------------------------------------------------------------------
+ * SMSC9211 Ethernet from SMSC9118 family
+  

*--
---
---
--------------------------------------------------------------------
+ */

include/configs/omap3_overo.h +8 -1
+
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X         1
+#define CONFIG_SMC911X_32_BIT
+#define CONFIG_SMC911X_BASE     0x2C000000
+
+#endif /* (CONFIG_CMD_NET) */
+
 #endif                         /* __CONFIG_H */
--

1.6.0.4

#63 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 24 lines

Subject: Re: [PATCH v3] TI: OMAP3: Overo Tobi ethernet support

Quoted 12 lines · Steve Sakoman
Quoted 9 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

This also refactors the smc911x driver to allow for detecting when the
chip is missing. I.e. the detect_chip() function is called earlier and
will abort gracefully when the Chip ID read returns all 1's.

Quoted 5 lines

Hmm . . . I just tried this on a board without smc911x chip and it seems to hang after printing "Net".

Did it work for you in this case? Haven't had time to debug yet, but will try to look later today.

Quoted 11 lines

The only hardware I have is tobi, which is why I thought I cc:d you as well as asked others to test with other carriers if they had them.

I guess first thing to find out is if it's the first read that hangs or what.

-Olof

Quoted 2 lines

Steve

I thought that I'd let everybody know that I have rebased and the ti tree is in sync with Tom's u-boot-arm.

Thanks,
Sandeep

#64 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Olof Johansson
Quoted 14 lines · Olof Johansson
Quoted 12 lines · Steve Sakoman
Quoted 7 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

This also refactors the smc911x driver to allow for detecting when the chip is missing. I.e. the detect_chip() function is called earlier and will abort gracefully when the Chip ID read returns all 1's.

Hmm . . . I just tried this on a board without smc911x chip and it seems to hang after printing "Net".

Quoted 8 lines
Quoted 2 lines

Did it work for you in this case? Haven't had time to debug yet, but will try to look later today.

The only hardware I have is tobi, which is why I thought I cc:d you as well as asked others to test with other carriers if they had them.

I guess first thing to find out is if it's the first read that hangs or what.

Any idea how to go on with this? I have no Tobi, so unfortunately I can't help here.

Best regards

Dirk

#65 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 20 lines · Dirk Behme
Quoted 19 lines · Olof Johansson
Quoted 15 lines · Steve Sakoman
Quoted 8 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

This also refactors the smc911x driver to allow for detecting when the chip is missing. I.e. the detect_chip() function is called earlier and will abort gracefully when the Chip ID read returns all 1's.

Hmm . . . I just tried this on a board without smc911x chip and it seems to hang after printing "Net".

Did it work for you in this case? ?Haven't had time to debug yet, but will try to look later today.

Quoted 8 lines
Quoted 5 lines

The only hardware I have is tobi, which is why I thought I cc:d you as well as asked others to test with other carriers if they had them.

I guess first thing to find out is if it's the first read that hangs or what.

Any idea how to go on with this? I have no Tobi, so unfortunately I can't help here.

I've been testing the patch below, which seems to work with all boards I've tried. It simply moves the test a bit earlier.

Steve

drivers/net/smc911x.c renamed from drivers/net/smc911x.c-orig +6 -6
@@ -249,6 +249,12 @@ int smc911x_initialize(u8 dev_num, int b
 
 	dev->iobase = base_addr;
 
+	/* Try to detect chip. Will fail if not present. */
+	if (smc911x_detect_chip(dev)) {
+		free(dev);
+		return 0;
+	}
+
 	addrh = smc911x_get_mac_csr(dev, ADDRH);
 	addrl = smc911x_get_mac_csr(dev, ADDRL);
 	dev->enetaddr[0] = addrl;
@@ -264,12 +270,6 @@ int smc911x_initialize(u8 dev_num, int b
 	dev->recv = smc911x_rx;
 	sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
 
-	/* Try to detect chip. Will fail if not present. */
-	if (smc911x_detect_chip(dev)) {
-		free(dev);
-		return 0;
-	}
-
 	eth_register(dev);
 	return 0;
 }
#66 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 20 lines · Steve Sakoman
Quoted 19 lines · Dirk Behme
Quoted 18 lines · Olof Johansson
Quoted 8 lines · Steve Sakoman
Quoted 7 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

This also refactors the smc911x driver to allow for detecting when the chip is missing. I.e. the detect_chip() function is called earlier and will abort gracefully when the Chip ID read returns all 1's.

Quoted 5 lines

Hmm . . . I just tried this on a board without smc911x chip and it seems to hang after printing "Net".

Did it work for you in this case? Haven't had time to debug yet, but will try to look later today.

The only hardware I have is tobi, which is why I thought I cc:d you as well as asked others to test with other carriers if they had them.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

I guess first thing to find out is if it's the first read that hangs or what.

Any idea how to go on with this? I have no Tobi, so unfortunately I can't help here.

I've been testing the patch below, which seems to work with all boards I've tried. It simply moves the test a bit earlier.

Great, thanks!

Olof: Could you test this? If it works for you, too, we should apply it on top of u-boot-ti (and u-boot-arm/next) then (or modify initial
[1] ?).

Most probably we need a Signed-off-by then ;)

Thanks

Dirk

[1]
http://git.denx.de/?p=u-boot/u-boot-arm.git;a=commit;h=4eb3af078267e103fb957cb831497cf7670fb3f4

Quoted 31 lines

Steve

drivers/net/smc911x.c renamed from drivers/net/smc911x.c-orig +6 -6
@@ -249,6 +249,12 @@ int smc911x_initialize(u8 dev_num, int b
 
 	dev->iobase = base_addr;
 
+	/* Try to detect chip. Will fail if not present. */
+	if (smc911x_detect_chip(dev)) {
+		free(dev);
+		return 0;
+	}
+
 	addrh = smc911x_get_mac_csr(dev, ADDRH);
 	addrl = smc911x_get_mac_csr(dev, ADDRL);
 	dev->enetaddr[0] = addrl;
@@ -264,12 +270,6 @@ int smc911x_initialize(u8 dev_num, int b
 	dev->recv = smc911x_rx;
 	sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
 
-	/* Try to detect chip. Will fail if not present. */
-	if (smc911x_detect_chip(dev)) {
-		free(dev);
-		return 0;
-	}
-
 	eth_register(dev);
 	return 0;
 }
#67 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 29 lines · Dirk Behme
Quoted 20 lines · Steve Sakoman
Quoted 19 lines · Dirk Behme
Quoted 18 lines · Olof Johansson
Quoted 8 lines · Steve Sakoman
Quoted 7 lines · Olof Johansson

Add setup for ethernet on Tobi, allowing kernel/ramdisk to be loaded over tftp.

This also refactors the smc911x driver to allow for detecting when the chip is missing. I.e. the detect_chip() function is called earlier and will abort gracefully when the Chip ID read returns all 1's.

Quoted 5 lines

Hmm . . . I just tried this on a board without smc911x chip and it seems to hang after printing "Net".

Did it work for you in this case? Haven't had time to debug yet, but will try to look later today.

The only hardware I have is tobi, which is why I thought I cc:d you as well as asked others to test with other carriers if they had them.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

I guess first thing to find out is if it's the first read that hangs or what.

Any idea how to go on with this? I have no Tobi, so unfortunately I can't help here.

I've been testing the patch below, which seems to work with all boards I've tried. It simply moves the test a bit earlier.

Quoted 6 lines

Great, thanks!

Olof: Could you test this? If it works for you, too, we should apply it on top of u-boot-ti (and u-boot-arm/next) then (or modify initial [1] ?).

Most probably we need a Signed-off-by then ;)

Take your pick. Either a:

Or apply the below revised patch instead.

SMC911X: Add chip auto detection

Refactor the smc911x driver to allow for detecting when the chip is missing. I.e. the detect_chip() function is called earlier and will abort gracefully when the Chip ID read returns all 1's.

Based on testing from Steve Sakoman, the test has been moved up in the function to not hang on systems without ethernet.

---
 drivers/net/smc911x.c |   14 ++++++++------
 drivers/net/smc911x.h |    7 +++++--
 2 files changed, 13 insertions(+), 8 deletions(-)
drivers/net/smc911x.c +8 -6
index 18a729c..df73478 100644
@@ -146,10 +146,9 @@ static void smc911x_enable(struct eth_device *dev)
 
 static int smc911x_init(struct eth_device *dev, bd_t * bd)
 {
-	printf(DRIVERNAME ": initializing\n");
+	struct chip_id *id = dev->priv;
 
-	if (smc911x_detect_chip(dev))
-		goto err_out;
+	printf(DRIVERNAME ": detected %s controller\n", id->name);
 
 	smc911x_reset(dev);
 
@@ -162,9 +161,6 @@ static int smc911x_init(struct eth_device *dev, bd_t * bd)
 	smc911x_enable(dev);
 
 	return 0;
-
-err_out:
-	return -1;
 }
 
 static int smc911x_send(struct eth_device *dev,
@@ -253,6 +249,12 @@ int smc911x_initialize(u8 dev_num, int base_addr)
 
 	dev->iobase = base_addr;
 
+	/* Try to detect chip. Will fail if not present. */
+	if (smc911x_detect_chip(dev)) {
+		free(dev);
+		return 0;
+	}
+
 	addrh = smc911x_get_mac_csr(dev, ADDRH);
 	addrl = smc911x_get_mac_csr(dev, ADDRL);
 	dev->enetaddr[0] = addrl;
drivers/net/smc911x.h +5 -2
index 053e330..d5bca63 100644
@@ -441,7 +441,10 @@ static int smc911x_detect_chip(struct eth_device *dev)
 	unsigned long val, i;
 
 	val = smc911x_reg_read(dev, BYTE_TEST);
-	if (val != 0x87654321) {
+	if (val == 0xffffffff) {
+		/* Special case -- no chip present */
+		return -1;
+	} else if (val != 0x87654321) {
 		printf(DRIVERNAME ": Invalid chip endian 0x%08lx\n", val);
 		return -1;
 	}
@@ -455,7 +458,7 @@ static int smc911x_detect_chip(struct eth_device *dev)
 		return -1;
 	}
 
-	printf(DRIVERNAME ": detected %s controller\n", chip_ids[i].name);
+	dev->priv = (void *)&chip_ids[i];
 
 	return 0;
 }
Signature · 1 line
1.6.3.3
#68 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 17 lines
Quoted 1 line

Most probably we need a Signed-off-by then ;)

Take your pick. Either a:

Or apply the below revised patch instead.

SMC911X: Add chip auto detection

Refactor the smc911x driver to allow for detecting when the chip is missing.
I.e. the detect_chip() function is called earlier and will abort gracefully
when the Chip ID read returns all 1's.

Quoted 6 lines

Based on testing from Steve Sakoman, the test has been moved up in the function to not hang on systems without ethernet.

Are we sure we have Ben's ACK.

I can't see an e-mail from him today.
Or am I missing something?

Quoted 75 lines
---
 drivers/net/smc911x.c |   14 ++++++++------
 drivers/net/smc911x.h |    7 +++++--
 2 files changed, 13 insertions(+), 8 deletions(-)
drivers/net/smc911x.c +2 -6
index 18a729c..df73478 100644
@@ -146,10 +146,9 @@ static void smc911x_enable(struct eth_device *dev)
 
 static int smc911x_init(struct eth_device *dev, bd_t * bd)
 {
-	printf(DRIVERNAME ": initializing\n");
+	struct chip_id *id = dev->priv;
 
-	if (smc911x_detect_chip(dev))
-		goto err_out;
+	printf(DRIVERNAME ": detected %s controller\n", id->name);
 
 	smc911x_reset(dev);
 
@@ -162,9 +161,6 @@ static int smc911x_init(struct eth_device *dev, bd_t *
 bd)
 	smc911x_enable(dev);
 
 	return 0;
-
-err_out:
-	return -1;
 }
 

static int smc911x_send(struct eth_device *dev,

drivers/net/smc911x.c +6 -0
@@ -253,6 +249,12 @@ int smc911x_initialize(u8 dev_num, int base_addr)
 
 	dev->iobase = base_addr;
 
+	/* Try to detect chip. Will fail if not present. */
+	if (smc911x_detect_chip(dev)) {
+		free(dev);
+		return 0;
+	}
+
 	addrh = smc911x_get_mac_csr(dev, ADDRH);
 	addrl = smc911x_get_mac_csr(dev, ADDRL);
 	dev->enetaddr[0] = addrl;
drivers/net/smc911x.h +4 -1
index 053e330..d5bca63 100644
@@ -441,7 +441,10 @@ static int smc911x_detect_chip(struct eth_device
 *dev)
 	unsigned long val, i;
 
 	val = smc911x_reg_read(dev, BYTE_TEST);
-	if (val != 0x87654321) {
+	if (val == 0xffffffff) {
+		/* Special case -- no chip present */
+		return -1;
+	} else if (val != 0x87654321) {
 		printf(DRIVERNAME ": Invalid chip endian 0x%08lx\n", val);
 		return -1;
drivers/net/smc911x.h +1 -2
 	}
@@ -455,7 +458,7 @@ static int smc911x_detect_chip(struct eth_device *dev)
 		return -1;
 	}
 
-	printf(DRIVERNAME ": detected %s controller\n", chip_ids[i].name);
+	dev->priv = (void *)&chip_ids[i];
 
 	return 0;
 }
--

1.6.3.3

#69 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 20 lines · Sandeep
Quoted 20 lines
Quoted 2 lines

Most probably we need a Signed-off-by then ;)

Take your pick. Either a:

Or apply the below revised patch instead.

SMC911X: Add chip auto detection

Refactor the smc911x driver to allow for detecting when the chip is missing.
I.e. the detect_chip() function is called earlier and will abort gracefully
when the Chip ID read returns all 1's.

Based on testing from Steve Sakoman, the test has been moved up in the function to not hang on systems without ethernet.

Quoted 8 lines
Quoted 4 lines

Are we sure we have Ben's ACK.

Yeah. I can't find it in my 'Sent' folder, but seem to remember ACK'ing this already. If not, consider this an ACK.

regards,
Ben

#70 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 28 lines
Quoted 25 lines · Sandeep
Quoted 24 lines
Quoted 2 lines

Most probably we need a Signed-off-by then ;)

Take your pick. Either a:

Or apply the below revised patch instead.

SMC911X: Add chip auto detection

Refactor the smc911x driver to allow for detecting when the chip is missing.
I.e. the detect_chip() function is called earlier and will abort gracefully
when the Chip ID read returns all 1's.

Based on testing from Steve Sakoman, the test has been moved up in the function to not hang on systems without ethernet.

Quoted 5 lines
Quoted 3 lines

Are we sure we have Ben's ACK.

Yeah. I can't find it in my 'Sent' folder, but seem to remember ACK'ing this already. If not, consider this an ACK.

Ok Thanks.

This is a bug fix. You had ACKed the original version.

I'll apply this to u-boot-ti

Quoted 3 lines

regards,
Ben

#71 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

In reply to Ben Warren
Quoted 26 lines · Ben Warren
Quoted 25 lines · Sandeep
Quoted 24 lines
Quoted 2 lines

Most probably we need a Signed-off-by then ;)

Take your pick. Either a:

Or apply the below revised patch instead.

SMC911X: Add chip auto detection

Refactor the smc911x driver to allow for detecting when the chip is missing.
I.e. the detect_chip() function is called earlier and will abort gracefully
when the Chip ID read returns all 1's.

Based on testing from Steve Sakoman, the test has been moved up in the function to not hang on systems without ethernet.

Quoted 5 lines
Quoted 3 lines

Are we sure we have Ben's ACK.

Yeah. I can't find it in my 'Sent' folder, but seem to remember ACK'ing this already. If not, consider this an ACK.

I just brought it forward from the previous patch, and I wasn't the one who added it back then. My bad, I should have dropped all acks based on the new contents.

-Olof

#72 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 35 lines · Ben Warren
Quoted 26 lines
Quoted 25 lines · Sandeep
Quoted 24 lines
Quoted 2 lines

Most probably we need a Signed-off-by then ;)

Take your pick. Either a:

Or apply the below revised patch instead.

SMC911X: Add chip auto detection

Refactor the smc911x driver to allow for detecting when the chip is missing.
I.e. the detect_chip() function is called earlier and will abort gracefully
when the Chip ID read returns all 1's.

Based on testing from Steve Sakoman, the test has been moved up in the function to not hang on systems without ethernet.

Quoted 5 lines
Quoted 3 lines

Are we sure we have Ben's ACK.

Yeah. I can't find it in my 'Sent' folder, but seem to remember ACK'ing this already. If not, consider this an ACK.

Quoted 6 lines

I just brought it forward from the previous patch, and I wasn't the one who added it back then. My bad, I should have dropped all acks based on the new contents.

-Olof

I'm a little confused :-)
I realized when I was trying to apply this patch that this is already part of the u-boot-ti and u-boot-arm trees.

I am referring to
http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commitdiff;h=4eb3af078267e103fb957cb831497cf7670fb3f4

The patch in this e-mail chain was supposed to fix a bug discovered after Tom updated his tree.

Since this patch was already part of u-boot-ti and u-boot-arm trees, I don't see how this fixes a bug.

Can the u-boot-ti tree be checked to see if it works with / without TOBI?

I don't have a single OMAP3 EVM(I work only on DaVinci's) and hence can't test myself.

Sandeep

#73 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 40 lines · Sandeep
Quoted 29 lines · Ben Warren
Quoted 28 lines
Quoted 27 lines · Sandeep
Quoted 17 lines
Quoted 2 lines

Most probably we need a Signed-off-by then ;)

Take your pick. Either a:

Or apply the below revised patch instead.

SMC911X: Add chip auto detection

Refactor the smc911x driver to allow for detecting when the chip is missing.
I.e. the detect_chip() function is called earlier and will abort gracefully
when the Chip ID read returns all 1's.

Quoted 7 lines

Based on testing from Steve Sakoman, the test has been moved up in the function to not hang on systems without ethernet.

Are we sure we have Ben's ACK.

Quoted 8 lines
Quoted 2 lines

Yeah. I can't find it in my 'Sent' folder, but seem to remember ACK'ing this already. If not, consider this an ACK.

I just brought it forward from the previous patch, and I wasn't the one who added it back then. My bad, I should have dropped all acks based on the new contents.

-Olof

I'm a little confused :-)
I realized when I was trying to apply this patch that this is already part of the u-boot-ti and u-boot-arm trees.

Quoted 6 lines

I am referring to
http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commitdiff;h=4eb3af078267e103fb957cb831497cf7670fb3f4

The patch in this e-mail chain was supposed to fix a bug discovered after Tom updated his tree.

Since this patch was already part of u-boot-ti and u-boot-arm trees, I don't see how this fixes a bug.

It's easy ;)

The applied patch has a bug that the chip detection is done too late. It has to be done some lines earlier:

http://lists.denx.de/pipermail/u-boot/2009-October/062150.html

(which is against the patch already applied).

So there are two options to deal with this:

a) Apply

http://lists.denx.de/pipermail/u-boot/2009-October/062150.html

on top of the patch already in u-boot-ti (and u-boot-arm)

or

b) Revert

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=commitdiff;h=4eb3af078267e103fb957cb831497cf7670fb3f4

and apply

http://lists.denx.de/pipermail/u-boot/2009-October/062153.html

instead which has the "make the chip detection earlier" fix from (a) above incorporated.

Best regards

Dirk

#74 lore raw

PATCH v3 1/1 TI: OMAP3: Overo Tobi ethernet support

Quoted 42 lines
Quoted 4 lines

I'm a little confused :-)
I realized when I was trying to apply this patch that this is already

part of the u-boot-ti and u-boot-arm trees.

Quoted 3 lines

I am referring to
http://git.denx.de/?p=u-boot/u-boot-

ti.git;a=commitdiff;h=4eb3af078267e103fb957cb831497cf7670fb3f4

Quoted 2 lines

The patch in this e-mail chain was supposed to fix a bug discovered

after Tom updated his tree.

Quoted 2 lines

Since this patch was already part of u-boot-ti and u-boot-arm trees, I

don't see how this fixes a bug.

It's easy ;)

The applied patch has a bug that the chip detection is done too late. It has to be done some lines earlier:

http://lists.denx.de/pipermail/u-boot/2009-October/062150.html

(which is against the patch already applied).

So there are two options to deal with this:

a) Apply

http://lists.denx.de/pipermail/u-boot/2009-October/062150.html

on top of the patch already in u-boot-ti (and u-boot-arm)

or

b) Revert

http://git.denx.de/?p=u-boot/u-boot-
ti.git;a=commitdiff;h=4eb3af078267e103fb957cb831497cf7670fb3f4

and apply

Quoted 8 lines

http://lists.denx.de/pipermail/u-boot/2009-October/062153.html

instead which has the "make the chip detection earlier" fix from (a) above incorporated.

Best regards

Dirk

I have been enlightened :-)

I have pushed this to u-boot-ti next

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=shortlog;h=refs/heads/next

Thanks,
Sandeep