Skip to contentSkip to conversation

Marvell egiga multiple SoC support

PATCH Superseded Albert Aribaud 3 participants 22 messages Jul 11, 2010 – Jul 13, 2010

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover Marvell egiga multiple SoC support

NOTES

1) This patchset will only apply above a previously posted and Acked-by patch available on the mailing list archives e.g. at:
<http://lists.denx.de/pipermail/u-boot/2010-July/073590.html>
("kirkwood_egiga: updates: fix DRAM mapping and typo").

2) This patchset will build for edminiv2 but requires a bugfix patch, also Acked-by and available on archives as well at e.g.
<http://lists.denx.de/pipermail/u-boot/2010-July/073789.html>
("kirkwood_egiga: bugfix: add DMA sequence points").

PATCHSET HISTORY

V1: First submission.
V2: Reorganization as per Prafulla Wadasakar's suggestion.
Used -C in format-patch to render renames correctly. Removal of DRAM patch posted standalone. Removal of unrelated changes.
V3: Removal of DMA bugfix patch posted standalone
Introduced MAC non-randomization config option Added short description to each patch

SHORT STORY

This patchset separates egiga from kirkwood then adds orion5x support in egiga. It has been duly, and successfully, tested on an OpenRD-Client after each of the four commits and on an EDMini V2 after the last commit.

LONG STORY

This is a set of five atomic commits.

the first commit renames kirkwood_egiga.[ch] to mv_egiga.[ch] in drivers/net/ (also modifies Makefile) to make sur the renaming remains visible in git at 100% similarity.

The second commit makes removes all dependency of mv_egiga on kirkwood. Kirkwood references in all mv_egiga symbols are replaced with mv_egiga references throughout the source tree.

The third commit allows not to randomize local MAC addresses, which orion5x needs because it has no documented or known random generator.

The fourth commit adds orion5x support to mv_egiga.

The fifth commit adds edminiv2 support for the orion5x egiga controller.

All commits were tested on a kirkwood-based OpenRD Client for regression avoidance; the last commit was also tested on an orion5x-based ED Mini V2 for functionality validation.

Albert Aribaud (5):
net: rename: kirkwood_egiga as mv_egiga
mv_egiga: support SoCs other than kirkwood
mv_egiga: CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION
mv_egiga: add support for orion5x egiga controller
edminiv2: add ethernet support

 arch/arm/cpu/arm926ejs/kirkwood/cpu.c         |    4 +-
 arch/arm/cpu/arm926ejs/orion5x/cpu.c          |    8 +
 arch/arm/include/asm/arch-kirkwood/kirkwood.h |    5 +
 arch/arm/include/asm/arch-orion5x/orion5x.h   |    5 +
 board/LaCie/edminiv2/edminiv2.c               |   36 ++
 board/LaCie/edminiv2/edminiv2.h               |   41 ++
 drivers/net/Makefile                          |    2 +-
 drivers/net/kirkwood_egiga.h                  |  505 -------------------------
 drivers/net/{kirkwood_egiga.c => mv_egiga.c}  |  336 +++++++++--------
 drivers/net/mv_egiga.h                        |  505 +++++++++++++++++++++++++
 include/configs/edminiv2.h                    |   23 +-
 include/configs/guruplug.h                    |    4 +-
 include/configs/km_arm.h                      |    4 +-
 include/configs/mv88f6281gtw_ge.h             |    4 +-
 include/configs/openrd_base.h                 |    4 +-
 include/configs/rd6281a.h                     |    4 +-
 include/configs/sheevaplug.h                  |    4 +-
 include/netdev.h                              |    2 +-
 18 files changed, 809 insertions(+), 687 deletions(-)
 create mode 100644 board/LaCie/edminiv2/edminiv2.h
 delete mode 100644 drivers/net/kirkwood_egiga.h
 rename drivers/net/{kirkwood_egiga.c => mv_egiga.c} (60%)
 create mode 100644 drivers/net/mv_egiga.h
#1 lore raw

PATCH v3 1/5 net: rename: kirkwood_egiga as mv_egiga

Rename kirkwood_egiga.* to mv_egiga.* and adjust makefile and #include accordingly.

---
 drivers/net/Makefile                         |    2 +-
 drivers/net/{kirkwood_egiga.c => mv_egiga.c} |    2 +-
 drivers/net/{kirkwood_egiga.h => mv_egiga.h} |    0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename drivers/net/{kirkwood_egiga.c => mv_egiga.c} (99%)
 rename drivers/net/{kirkwood_egiga.h => mv_egiga.h} (100%)
drivers/net/Makefile +1 -1
index b75c02f..1599c26 100644
@@ -46,13 +46,13 @@ COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o
 COBJS-$(CONFIG_FTMAC100) += ftmac100.o
 COBJS-$(CONFIG_GRETH) += greth.o
 COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o
-COBJS-$(CONFIG_KIRKWOOD_EGIGA) += kirkwood_egiga.o
 COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
 COBJS-$(CONFIG_LAN91C96) += lan91c96.o
 COBJS-$(CONFIG_MACB) += macb.o
 COBJS-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
 COBJS-$(CONFIG_MPC5xxx_FEC) += mpc5xxx_fec.o
 COBJS-$(CONFIG_MPC512x_FEC) += mpc512x_fec.o
+COBJS-$(CONFIG_KIRKWOOD_EGIGA) += mv_egiga.o
 COBJS-$(CONFIG_NATSEMI) += natsemi.o
 COBJS-$(CONFIG_DRIVER_NE2000) += ne2000.o ne2000_base.o
 COBJS-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
drivers/net/mv_egiga.c renamed from drivers/net/kirkwood_egiga.c +1 -1
similarity index 99%
rename from drivers/net/kirkwood_egiga.c
rename to drivers/net/mv_egiga.c
index dca9f11..b7ecc9d 100644
@@ -36,7 +36,7 @@
 #include <asm/types.h>
 #include <asm/byteorder.h>
 #include <asm/arch/kirkwood.h>
-#include "kirkwood_egiga.h"
+#include "mv_egiga.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/net/mv_egiga.h renamed from drivers/net/kirkwood_egiga.h +0 -0
similarity index 100%
rename from drivers/net/kirkwood_egiga.h
rename to drivers/net/mv_egiga.h
Signature · 1 line
1.6.4.4
#2 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

Rename all references to kirkwood in mv_egiga symbols throughout the whole codebase.

---
 arch/arm/cpu/arm926ejs/kirkwood/cpu.c         |    4 +-
 arch/arm/include/asm/arch-kirkwood/kirkwood.h |    5 +
 drivers/net/Makefile                          |    2 +-
 drivers/net/mv_egiga.c                        |  322 +++++++++---------
 drivers/net/mv_egiga.h                        |  466 ++++++++++++------------
 include/configs/guruplug.h                    |    4 +-
 include/configs/km_arm.h                      |    4 +-
 include/configs/mv88f6281gtw_ge.h             |    4 +-
 include/configs/openrd_base.h                 |    4 +-
 include/configs/rd6281a.h                     |    4 +-
 include/configs/sheevaplug.h                  |    4 +-
 include/netdev.h                              |    2 +-
 12 files changed, 418 insertions(+), 407 deletions(-)
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +2 -2
index 6fc3902..786ffc6 100644
@@ -378,10 +378,10 @@ int arch_misc_init(void)
 }
 #endif /* CONFIG_ARCH_MISC_INIT */
 
-#ifdef CONFIG_KIRKWOOD_EGIGA
+#ifdef CONFIG_MV_EGIGA
 int cpu_eth_init(bd_t *bis)
 {
-	kirkwood_egiga_initialize(bis);
+	mv_egiga_initialize(bis);
 	return 0;
 }
 #endif
arch/arm/include/asm/arch-kirkwood/kirkwood.h +5 -0
index 2470efb..9200605 100644
@@ -60,6 +60,11 @@
 #define KW_EGIGA0_BASE			(KW_REGISTER(0x72000))
 #define KW_EGIGA1_BASE			(KW_REGISTER(0x76000))
 
+#if defined (CONFIG_MV_EGIGA)
+#define MV_EGIGA0_BASE			KW_EGIGA0_BASE
+#define MV_EGIGA1_BASE			KW_EGIGA1_BASE
+#endif
+
 #if defined (CONFIG_KW88F6281)
 #include <asm/arch/kw88f6281.h>
 #elif defined (CONFIG_KW88F6192)
drivers/net/Makefile +1 -1
index 1599c26..04f8de0 100644
@@ -52,7 +52,7 @@ COBJS-$(CONFIG_MACB) += macb.o
 COBJS-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
 COBJS-$(CONFIG_MPC5xxx_FEC) += mpc5xxx_fec.o
 COBJS-$(CONFIG_MPC512x_FEC) += mpc512x_fec.o
-COBJS-$(CONFIG_KIRKWOOD_EGIGA) += mv_egiga.o
+COBJS-$(CONFIG_MV_EGIGA) += mv_egiga.o
 COBJS-$(CONFIG_NATSEMI) += natsemi.o
 COBJS-$(CONFIG_DRIVER_NE2000) += ne2000.o ne2000_base.o
 COBJS-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
drivers/net/mv_egiga.c +164 -158

685 lines not on this page · raw message

drivers/net/mv_egiga.h +233 -233

587 lines not on this page · raw message

include/configs/guruplug.h +2 -2
index 2fbc6ad..f933017 100644
@@ -172,9 +172,9 @@
 #define CONFIG_NET_MULTI	/* specify more that one ports available */
 #define CONFIG_MII		/* expose smi ove miiphy interface */
 #define CONFIG_CMD_MII
-#define CONFIG_KIRKWOOD_EGIGA	/* Enable kirkwood Gbe Controller Driver */
+#define CONFIG_MV_EGIGA		/* Enable Marvell Gbe Controller Driver */
 #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN	/* detect link using phy */
-#define CONFIG_KIRKWOOD_EGIGA_PORTS	{1,1}	/* enable both ports */
+#define CONFIG_MV_EGIGA_PORTS	{1,1}	/* enable both ports */
 #define CONFIG_PHY_BASE_ADR	0
 #define CONFIG_ENV_OVERWRITE	/* ethaddr can be reprogrammed */
 #define CONFIG_RESET_PHY_R	/* use reset_phy() to init mv88e1121 PHY */
include/configs/km_arm.h +2 -2
index a928c2c..ec7d9c5 100644
@@ -127,9 +127,9 @@
 #define CONFIG_NETCONSOLE	/* include NetConsole support   */
 #define CONFIG_NET_MULTI	/* specify more that one ports available */
 #define CONFIG_MII		/* expose smi ove miiphy interface */
-#define CONFIG_KIRKWOOD_EGIGA	/* Enable kirkwood Gbe Controller Driver */
+#define CONFIG_MV_EGIGA		/* Enable Marvell Gbe Controller Driver */
 #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN	/* detect link using phy */
-#define CONFIG_KIRKWOOD_EGIGA_PORTS	{1,0}	/* enable port 0 only */
+#define CONFIG_MV_EGIGA_PORTS	{1,0}	/* enable port 0 only */
 #define CONFIG_PHY_BASE_ADR	0
 #define CONFIG_ENV_OVERWRITE	/* ethaddr can be reprogrammed */
 #define CONFIG_RESET_PHY_R	/* use reset_phy() to init 88E1118 PHY */
include/configs/mv88f6281gtw_ge.h +2 -2
index 96b4d1c..8281d49 100644
@@ -172,9 +172,9 @@
 #define CONFIG_NETCONSOLE	/* include NetConsole support   */
 #define CONFIG_NET_MULTI	/* specify more that one ports available */
 #define	CONFIG_MII		/* expose smi ove miiphy interface */
-#define CONFIG_KIRKWOOD_EGIGA	/* Enable kirkwood Gbe Controller Driver */
+#define CONFIG_MV_EGIGA		/* Enable Marvell Gbe Controller Driver */
 #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN	/* detect link using phy */
-#define CONFIG_KIRKWOOD_EGIGA_PORTS	{1,0}	/* enable port 0 only */
+#define CONFIG_MV_EGIGA_PORTS	{1,0}	/* enable port 0 only */
 #define CONFIG_ENV_OVERWRITE	/* ethaddr can be reprogrammed */
 #endif /* CONFIG_CMD_NET */
 
include/configs/openrd_base.h +2 -2
index d2f4502..03ee2ad 100644
@@ -183,9 +183,9 @@
 #define CONFIG_NETCONSOLE	/* include NetConsole support   */
 #define CONFIG_NET_MULTI	/* specify more that one ports available */
 #define	CONFIG_MII		/* expose smi ove miiphy interface */
-#define CONFIG_KIRKWOOD_EGIGA	/* Enable kirkwood Gbe Controller Driver */
+#define CONFIG_MV_EGIGA		/* Enable Marvell Gbe Controller Driver */
 #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN	/* detect link using phy */
-#define CONFIG_KIRKWOOD_EGIGA_PORTS	{1,0}	/* enable port 0 only */
+#define CONFIG_MV_EGIGA_PORTS	{1,0}	/* enable port 0 only */
 #define CONFIG_PHY_BASE_ADR	0x8
 #define CONFIG_ENV_OVERWRITE	/* ethaddr can be reprogrammed */
 #define CONFIG_RESET_PHY_R	/* use reset_phy() to init mv8831116 PHY */
include/configs/rd6281a.h +2 -2
index 3d8e25c..799f50b 100644
@@ -171,8 +171,8 @@
 #define CONFIG_NETCONSOLE	/* include NetConsole support */
 #define CONFIG_NET_MULTI	/* specify more that one ports available */
 #define CONFIG_MII		/* expose smi ove miiphy interface */
-#define CONFIG_KIRKWOOD_EGIGA	/* Enable kirkwood Gbe Controller Driver */
-#define CONFIG_KIRKWOOD_EGIGA_PORTS	{1,1}	/* enable both ports */
+#define CONFIG_MV_EGIGA		/* Enable Marvell Gbe Controller Driver */
+#define CONFIG_MV_EGIGA_PORTS	{1,1}	/* enable both ports */
 #define CONFIG_MV88E61XX_MULTICHIP_ADRMODE
 #define CONFIG_DIS_AUTO_NEG_SPEED_GMII /*Disable Auto speed negociation */
 #define CONFIG_PHY_SPEED	_1000BASET	/*Force PHYspeed to 1GBPs */
include/configs/sheevaplug.h +2 -2
index e9edc44..40c3f96 100644
@@ -174,9 +174,9 @@
 #define CONFIG_NETCONSOLE	/* include NetConsole support   */
 #define CONFIG_NET_MULTI	/* specify more that one ports available */
 #define	CONFIG_MII		/* expose smi ove miiphy interface */
-#define CONFIG_KIRKWOOD_EGIGA	/* Enable kirkwood Gbe Controller Driver */
+#define CONFIG_MV_EGIGA		/* Enable Marvell Gbe Controller Driver */
 #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN	/* detect link using phy */
-#define CONFIG_KIRKWOOD_EGIGA_PORTS	{1,0}	/* enable port 0 only */
+#define CONFIG_MV_EGIGA_PORTS	{1,0}	/* enable port 0 only */
 #define CONFIG_PHY_BASE_ADR	0
 #define CONFIG_ENV_OVERWRITE	/* ethaddr can be reprogrammed */
 #define CONFIG_RESET_PHY_R	/* use reset_phy() to init mv8831116 PHY */
include/netdev.h +1 -1
index 882642a..434848d 100644
@@ -61,7 +61,6 @@ int ftmac100_initialize(bd_t *bits);
 int greth_initialize(bd_t *bis);
 void gt6426x_eth_initialize(bd_t *bis);
 int inca_switch_initialize(bd_t *bis);
-int kirkwood_egiga_initialize(bd_t *bis);
 int lan91c96_initialize(u8 dev_num, int base_addr);
 int macb_eth_initialize(int id, void *regs, unsigned int phy_addr);
 int mcdmafec_initialize(bd_t *bis);
@@ -70,6 +69,7 @@ int mpc512x_fec_initialize(bd_t *bis);
 int mpc5xxx_fec_initialize(bd_t *bis);
 int mpc8220_fec_initialize(bd_t *bis);
 int mpc82xx_scc_enet_initialize(bd_t *bis);
+int mv_egiga_initialize(bd_t *bis);
 int natsemi_initialize(bd_t *bis);
 int npe_initialize(bd_t *bis);
 int ns8382x_initialize(bd_t *bis);
Signature · 1 line
1.6.4.4
#3 lore raw

PATCH v3 3/5 mv_egiga: CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION

Add a configuration option to allow SoCs without random generation capability to fill in local MACs with a fixed rather than random value

---
 drivers/net/mv_egiga.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/net/mv_egiga.c +9 -1
index 4fecf1e..e8315fa 100644
@@ -705,13 +705,21 @@ int mv_egiga_initialize(bd_t * bis)
 		}
 
 		while (!eth_getenv_enetaddr(s, dev->enetaddr)) {
-			/* Generate Random Private MAC addr if not set */
+			/* Generate Private MAC addr if not set */
 			dev->enetaddr[0] = 0x02;
 			dev->enetaddr[1] = 0x50;
 			dev->enetaddr[2] = 0x43;
+#if defined (CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION)
+			/* Generate fixed lower MAC half using devnum */
+			dev->enetaddr[3] = 0;
+			dev->enetaddr[4] = 0;
+			dev->enetaddr[5] = devnum;
+#else
+			/* Generate random lower MAC half */
 			dev->enetaddr[3] = get_random_hex();
 			dev->enetaddr[4] = get_random_hex();
 			dev->enetaddr[5] = get_random_hex();
+#endif
 			eth_setenv_enetaddr(s, dev->enetaddr);
 		}
 
Signature · 1 line
1.6.4.4
#4 lore raw

PATCH v3 4/5 mv_egiga: add support for orion5x egiga controller

Add definitions and initialization in orion5x for mv_egiga. Add orion5x in mv_egiga SoC includes.

---
 arch/arm/cpu/arm926ejs/orion5x/cpu.c        |    8 ++++++++
 arch/arm/include/asm/arch-orion5x/orion5x.h |    5 +++++
 drivers/net/mv_egiga.c                      |    2 ++
 3 files changed, 15 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/orion5x/cpu.c +8 -0
index 03c6d06..fc9455e 100644
@@ -268,3 +268,11 @@ int arch_misc_init(void)
 	return 0;
 }
 #endif /* CONFIG_ARCH_MISC_INIT */
+
+#ifdef CONFIG_MV_EGIGA
+int cpu_eth_init(bd_t *bis)
+{
+	mv_egiga_initialize(bis);
+	return 0;
+}
+#endif
arch/arm/include/asm/arch-orion5x/orion5x.h +5 -0
index 4008c84..6783b74 100644
@@ -56,6 +56,11 @@
 #define ORION5X_USB20_PORT1_BASE		(ORION5X_REGISTER(0xA0000))
 #define ORION5X_EGIGA_BASE			(ORION5X_REGISTER(0x72000))
 
+/* Oron5x has one Marvell egiga controller */
+#if defined (CONFIG_MV_EGIGA)
+#define MV_EGIGA0_BASE				ORION5X_EGIGA_BASE
+#endif
+
 #define CONFIG_MAX_RAM_BANK_SIZE		(64*1024*1024)
 
 /* include here SoC variants. 5181, 5281, 6183 should go here when
drivers/net/mv_egiga.c +2 -0
index e8315fa..3401f64 100644
@@ -38,6 +38,8 @@
 
 #if defined (CONFIG_KIRKWOOD)
 #include <asm/arch/kirkwood.h>
+#elif defined (CONFIG_ORION5X)
+#include <asm/arch/orion5x.h>
 #endif
 
 #include "mv_egiga.h"
Signature · 1 line
1.6.4.4
#5 lore raw

PATCH v3 5/5 edminiv2: add ethernet support

Add edminiv2 board support for mv_egiga.
Add edminiv2 config to enable mv_egiga.

---
 board/LaCie/edminiv2/edminiv2.c |   36 ++++++++++++++++++++++++++++++++++
 board/LaCie/edminiv2/edminiv2.h |   41 +++++++++++++++++++++++++++++++++++++++
 include/configs/edminiv2.h      |   23 ++++++++++++++++-----
 3 files changed, 94 insertions(+), 6 deletions(-)
 create mode 100644 board/LaCie/edminiv2/edminiv2.h
board/LaCie/edminiv2/edminiv2.c +36 -0
index 54c0ffe..d46ee4a 100644
@@ -27,6 +27,7 @@
 #include <common.h>
 #include <miiphy.h>
 #include <asm/arch/orion5x.h>
+#include "edminiv2.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -90,3 +91,38 @@ int board_init(void)
 
 	return 0;
 }
+
+#if defined (CONFIG_CMD_NET) && defined (CONFIG_RESET_PHY_R)
+/* Configure and enable MV88E1116 PHY */
+void reset_phy(void)
+{
+	u16 reg;
+	u16 devadr;
+	char *name = "egiga0";
+
+	if (miiphy_set_current_dev(name))
+		return;
+
+	/* command to read PHY dev address */
+	if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+		printf("Err..%s could not read PHY dev address\n",
+			__FUNCTION__);
+		return;
+	}
+
+	/*
+	 * Enable RGMII delay on Tx and Rx for CPU port
+	 * Ref: sec 4.7.2 of chip datasheet
+	 */
+	miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2);
+	miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, &reg);
+	reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL);
+	miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg);
+	miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0);
+
+	/* reset the phy */
+	miiphy_reset(name, devadr);
+
+	printf("88E1116 Initialized on %s\n", name);
+}
+#endif /* CONFIG_RESET_PHY_R */
board/LaCie/edminiv2/edminiv2.h new file +41 -0

41 lines not on this page · raw message

include/configs/edminiv2.h +17 -6
index c3d95a0..458e313 100644
@@ -110,6 +110,15 @@
 #define CONFIG_SYS_FLASH_SECTSZ \
 	{16384, 8192, 8192, 32768, \
 	 65536, 65536, 65536, 65536, 65536, 65536, 65536}
+/*
+ * Ethernet
+  */
+
+#define CONFIG_MV_EGIGA		/* Enable Marvell egiga Controller Driver */
+#define CONFIG_MV_EGIGA_PORTS	{1,0}	/* enable port 0 only */
+#define CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION	/* don't randomize MAC */
+#define CONFIG_PHY_BASE_ADR	0x8
+#define CONFIG_RESET_PHY_R	/* use reset_phy() to init mv8831116 PHY */
 
 /* auto boot */
 #define CONFIG_BOOTDELAY	3	/* default enable autoboot */
@@ -131,12 +140,14 @@
  * Commands configuration - using default command set for now
  */
 #include <config_cmd_default.h>
-/*
- * Disabling some default commands for staggered bring-up
- */
-#undef CONFIG_CMD_BOOTD	/* no bootd since no net */
-#undef CONFIG_CMD_NET	/* no net since no eth */
-#undef CONFIG_CMD_NFS	/* no NFS since no net */
+
+#ifdef CONFIG_CMD_NET
+#define CONFIG_NETCONSOLE	/* include NetConsole support   */
+#define CONFIG_NET_MULTI	/* specify more that one ports available */
+#define	CONFIG_MII		/* expose smi ove miiphy interface */
+#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN	/* detect link using phy */
+#define CONFIG_ENV_OVERWRITE	/* ethaddr can be reprogrammed */
+#endif
 
 /*
  *  Environment variables configurations
Signature · 1 line
1.6.4.4
#6 lore raw

PATCH v3 5/5 edminiv2: add ethernet support

Quoted 127 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Sunday, July 11, 2010 1:32 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V3 5/5] edminiv2: add ethernet support

Add edminiv2 board support for mv_egiga.
Add edminiv2 config to enable mv_egiga.

---
 board/LaCie/edminiv2/edminiv2.c |   36 
++++++++++++++++++++++++++++++++++
 board/LaCie/edminiv2/edminiv2.h |   41 
+++++++++++++++++++++++++++++++++++++++
 include/configs/edminiv2.h      |   23 ++++++++++++++++-----
 3 files changed, 94 insertions(+), 6 deletions(-)
 create mode 100644 board/LaCie/edminiv2/edminiv2.h
board/LaCie/edminiv2/edminiv2.c +36 -0
index 54c0ffe..d46ee4a 100644
@@ -27,6 +27,7 @@
 #include <common.h>
 #include <miiphy.h>
 #include <asm/arch/orion5x.h>
+#include "edminiv2.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -90,3 +91,38 @@ int board_init(void)
 
 	return 0;
 }
+
+#if defined (CONFIG_CMD_NET) && defined (CONFIG_RESET_PHY_R)
+/* Configure and enable MV88E1116 PHY */
+void reset_phy(void)
+{
+	u16 reg;
+	u16 devadr;
+	char *name = "egiga0";
+
+	if (miiphy_set_current_dev(name))
+		return;
+
+	/* command to read PHY dev address */
+	if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) {
+		printf("Err..%s could not read PHY dev address\n",
+			__FUNCTION__);
+		return;
+	}
+
+	/*
+	 * Enable RGMII delay on Tx and Rx for CPU port
+	 * Ref: sec 4.7.2 of chip datasheet
+	 */
+	miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2);
+	miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, &reg);
+	reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL);
+	miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg);
+	miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0);
+
+	/* reset the phy */
+	miiphy_reset(name, devadr);
+
+	printf("88E1116 Initialized on %s\n", name);
+}
+#endif /* CONFIG_RESET_PHY_R */
board/LaCie/edminiv2/edminiv2.h new file +41 -0
new file mode 100644
index 0000000..88e62b2
@@ -0,0 +1,41 @@
+/*
+ * (C) Copyright 2009
+ * Net Insight <www.netinsight.net>
+ * Written-by: Simon Kagstrom <[email protected]>
+ *
+ * Based on sheevaplug.h:
+ * (C) Copyright 2009
+ * Marvell Semiconductor <www.marvell.com>
+ * Written-by: Prafulla Wadaskar <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef __EDMINIV2_BASE_H
+#define __EDMINIV2_BASE_H
+
+/* PHY related */
+#define MV88E1116_LED_FCTRL_REG		10
+#define MV88E1116_CPRSP_CR3_REG		21
+#define MV88E1116_MAC_CTRL_REG		21
+#define MV88E1116_PGADR_REG		22
+#define MV88E1116_RGMII_TXTM_CTRL	(1 << 4)
+#define MV88E1116_RGMII_RXTM_CTRL	(1 << 5)
+
+#endif /* __EDMINIV2_BASE_H */
include/configs/edminiv2.h +0 -0
index c3d95a0..458e313 100644

include/configs/edminiv2.h line 115

Quoted 6 lines
include/configs/edminiv2.h +3 -0
@@ -110,6 +110,15 @@
 #define CONFIG_SYS_FLASH_SECTSZ \
 	{16384, 8192, 8192, 32768, \
 	 65536, 65536, 65536, 65536, 65536, 65536, 65536}
+/*
+ * Ethernet
+  */

Pls remove additional space char here

Quoted 9 lines
include/configs/edminiv2.h +2 -0
+
+#define CONFIG_MV_EGIGA		/* Enable Marvell egiga 

Controller Driver */

include/configs/edminiv2.h +2 -0
+#define CONFIG_MV_EGIGA_PORTS	{1,0}	/* enable port 0 only */
+#define CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION	/* don't 

randomize MAC */

include/configs/edminiv2.h +2 -0
+#define CONFIG_PHY_BASE_ADR	0x8
+#define CONFIG_RESET_PHY_R	/* use reset_phy() to init 

mv8831116 PHY */

Shift above definition below (inside #ifdef CONFIG_CMD_NET), that makes more sense

Quoted 35 lines

/* auto boot */
#define CONFIG_BOOTDELAY 3 /* default enable autoboot */

include/configs/edminiv2.h +4 -6
@@ -131,12 +140,14 @@
  * Commands configuration - using default command set for now
  */
 #include <config_cmd_default.h>
-/*
- * Disabling some default commands for staggered bring-up
- */
-#undef CONFIG_CMD_BOOTD	/* no bootd since no net */
-#undef CONFIG_CMD_NET	/* no net since no eth */
-#undef CONFIG_CMD_NFS	/* no NFS since no net */
+
+#ifdef CONFIG_CMD_NET
+#define CONFIG_NETCONSOLE	/* include NetConsole support   */
+#define CONFIG_NET_MULTI	/* specify more that one ports 

available */
+#define CONFIG_MII /* expose smi ove
miiphy interface */
+#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN /* detect link
using phy */

include/configs/edminiv2.h +2 -0
+#define CONFIG_ENV_OVERWRITE	/* ethaddr can be reprogrammed */
+#endif
 
 /*
  *  Environment variables configurations
Signature · 6 lines
1.6.4.4

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

PATCH v3 5/5 edminiv2: add ethernet support

Hi Prafulla,

Le 12/07/2010 08:00, Prafulla Wadaskar a ?crit :

Quoted 5 lines

include/configs/edminiv2.h line 115

Quoted 3 lines
include/configs/edminiv2.h +3 -0
+/*
+ * Ethernet
+  */

Pls remove additional space char here

Done.

Quoted 6 lines
Quoted 4 lines
(quoted diff) +2 -0
+#define CONFIG_MV_EGIGA		/* Enable Marvell egiga
[...]
+#define CONFIG_RESET_PHY_R	/* use reset_phy() to init

mv8831116 PHY */

Shift above definition below (inside #ifdef CONFIG_CMD_NET), that makes more sense

Done--actually replaced "Ethernet" with "Network" in block comment as the whole block is not only about Eth.

Thanks for the feedback.

Any remaining comments on patches 1-4?

Amicalement,

Signature · 1 line
Albert.
#8 lore raw

PATCH v3 5/5 edminiv2: add ethernet support

Hi Albert,

Quoted 15 lines · Albert ARIBAUD

Hi Prafulla,

Le 12/07/2010 08:00, Prafulla Wadaskar a ?crit :

Quoted 4 lines

include/configs/edminiv2.h line 115

Quoted 3 lines
include/configs/edminiv2.h +3 -0
+/*
+ * Ethernet
+  */

Pls remove additional space char here

Done.

Quoted 5 lines
Quoted 4 lines
(quoted diff) +2 -0
+#define CONFIG_MV_EGIGA		/* Enable Marvell egiga
[...]
+#define CONFIG_RESET_PHY_R	/* use reset_phy() to init

mv8831116 PHY */

Shift above definition below (inside #ifdef CONFIG_CMD_NET), that makes more sense

Quoted 8 lines

Done--actually replaced "Ethernet" with "Network" in block comment as the whole block is not only about Eth.

Thanks for the feedback.

Any remaining comments on patches 1-4?

Amicalement,

That should be it. Please post updates as needed.

regards,
Ben

#9 lore raw

PATCH v3 4/5 mv_egiga: add support for orion5x egiga controller

In reply to Albert Aribaud
Quoted 43 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Sunday, July 11, 2010 1:32 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V3 4/5] mv_egiga: add support for orion5x egiga controller

Add definitions and initialization in orion5x for mv_egiga. Add orion5x in mv_egiga SoC includes.

---
 arch/arm/cpu/arm926ejs/orion5x/cpu.c        |    8 ++++++++
 arch/arm/include/asm/arch-orion5x/orion5x.h |    5 +++++
 drivers/net/mv_egiga.c                      |    2 ++
 3 files changed, 15 insertions(+), 0 deletions(-)
arch/arm/cpu/arm926ejs/orion5x/cpu.c +8 -0
index 03c6d06..fc9455e 100644
@@ -268,3 +268,11 @@ int arch_misc_init(void)
 	return 0;
 }
 #endif /* CONFIG_ARCH_MISC_INIT */
+
+#ifdef CONFIG_MV_EGIGA
+int cpu_eth_init(bd_t *bis)
+{
+	mv_egiga_initialize(bis);
+	return 0;
+}
+#endif
arch/arm/include/asm/arch-orion5x/orion5x.h +0 -0
index 4008c84..6783b74 100644

arch/arm/include/asm/arch-orion5x/orion5x.h line 61

Quoted 6 lines
arch/arm/include/asm/arch-orion5x/orion5x.h +1 -0
@@ -56,6 +56,11 @@
 #define ORION5X_USB20_PORT1_BASE		
 (ORION5X_REGISTER(0xA0000))
 #define ORION5X_EGIGA_BASE			
 (ORION5X_REGISTER(0x72000))
 
+/* Oron5x has one Marvell egiga controller */

You need to move a macro MAX_KWGBE_DEVS from kirkwood_egiga.h to here, and also in kirkwood.h

arch/arm/include/asm/arch-orion5x/orion5x.h line 60

Quoted 1 line
arch/arm/include/asm/arch-orion5x/orion5x.h +1 -0
+#if defined (CONFIG_MV_EGIGA)

Ifdef not needed, pls remove

arch/arm/include/asm/arch-orion5x/orion5x.h line 63

Quoted 4 lines
arch/arm/include/asm/arch-orion5x/orion5x.h +1 -0
+#define MV_EGIGA0_BASE				

ORION5X_EGIGA_BASE

arch/arm/include/asm/arch-orion5x/orion5x.h +2 -0
+#endif
+

Regards..
Prafulla . .

#10 lore raw

PATCH v3 3/5 mv_egiga: CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION

In reply to Albert Aribaud
Quoted 37 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Sunday, July 11, 2010 1:32 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V3 3/5] mv_egiga:
CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION

Add a configuration option to allow SoCs without random generation capability to fill in local MACs with a fixed rather than random value

---
 drivers/net/mv_egiga.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/net/mv_egiga.c +0 -1
index 4fecf1e..e8315fa 100644
@@ -705,13 +705,21 @@ int mv_egiga_initialize(bd_t * bis)
 		}
 
 		while (!eth_getenv_enetaddr(s, dev->enetaddr)) {
-			/* Generate Random Private MAC addr if 

not set */

drivers/net/mv_egiga.c +4 -0
+			/* Generate Private MAC addr if not set */
 			dev->enetaddr[0] = 0x02;
 			dev->enetaddr[1] = 0x50;
 			dev->enetaddr[2] = 0x43;
+#if defined (CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION)
+			/* Generate fixed lower MAC half using devnum */
+			dev->enetaddr[3] = 0;

drivers/net/mv_egiga.c int mv_egiga_initialize(bd_t * bis) · line 724

Quoted 10 lines
drivers/net/mv_egiga.c +5 -0
+			dev->enetaddr[4] = 0;
+			dev->enetaddr[5] = devnum;
+#else
+			/* Generate random lower MAC half */
 			dev->enetaddr[3] = get_random_hex();
 			dev->enetaddr[4] = get_random_hex();
 			dev->enetaddr[5] = get_random_hex();
+#endif
 			eth_setenv_enetaddr(s, dev->enetaddr);
 		}

This is standalone patch,
Pls make this patch independent on the top of current driver version. Acked otherwise

Regards..
Prafulla . .

#11 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

In reply to Albert Aribaud
Quoted 55 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Sunday, July 11, 2010 1:32 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V3 2/5] mv_egiga: support SoCs other than kirkwood

Rename all references to kirkwood in mv_egiga symbols throughout the whole codebase.

---
 arch/arm/cpu/arm926ejs/kirkwood/cpu.c         |    4 +-
 arch/arm/include/asm/arch-kirkwood/kirkwood.h |    5 +
 drivers/net/Makefile                          |    2 +-
 drivers/net/mv_egiga.c                        |  322 
+++++++++---------
 drivers/net/mv_egiga.h                        |  466 
++++++++++++------------
 include/configs/guruplug.h                    |    4 +-
 include/configs/km_arm.h                      |    4 +-
 include/configs/mv88f6281gtw_ge.h             |    4 +-
 include/configs/openrd_base.h                 |    4 +-
 include/configs/rd6281a.h                     |    4 +-
 include/configs/sheevaplug.h                  |    4 +-
 include/netdev.h                              |    2 +-
 12 files changed, 418 insertions(+), 407 deletions(-)
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +2 -2
index 6fc3902..786ffc6 100644
@@ -378,10 +378,10 @@ int arch_misc_init(void)
 }
 #endif /* CONFIG_ARCH_MISC_INIT */
 
-#ifdef CONFIG_KIRKWOOD_EGIGA
+#ifdef CONFIG_MV_EGIGA
 int cpu_eth_init(bd_t *bis)
 {
-	kirkwood_egiga_initialize(bis);
+	mv_egiga_initialize(bis);
 	return 0;
 }
 #endif
arch/arm/include/asm/arch-kirkwood/kirkwood.h +0 -0
index 2470efb..9200605 100644

arch/arm/include/asm/arch-kirkwood/kirkwood.h line 63

Quoted 4 lines
arch/arm/include/asm/arch-kirkwood/kirkwood.h +1 -0
@@ -60,6 +60,11 @@
 #define KW_EGIGA0_BASE			(KW_REGISTER(0x72000))
 #define KW_EGIGA1_BASE			(KW_REGISTER(0x76000))
 
+#if defined (CONFIG_MV_EGIGA)

I think you don't need ifdef here

Quoted 47 lines
arch/arm/include/asm/arch-kirkwood/kirkwood.h +4 -0
+#define MV_EGIGA0_BASE			KW_EGIGA0_BASE
+#define MV_EGIGA1_BASE			KW_EGIGA1_BASE
+#endif
+
 #if defined (CONFIG_KW88F6281)
 #include <asm/arch/kw88f6281.h>
 #elif defined (CONFIG_KW88F6192)
drivers/net/Makefile +1 -1
index 1599c26..04f8de0 100644
@@ -52,7 +52,7 @@ COBJS-$(CONFIG_MACB) += macb.o
 COBJS-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
 COBJS-$(CONFIG_MPC5xxx_FEC) += mpc5xxx_fec.o
 COBJS-$(CONFIG_MPC512x_FEC) += mpc512x_fec.o
-COBJS-$(CONFIG_KIRKWOOD_EGIGA) += mv_egiga.o
+COBJS-$(CONFIG_MV_EGIGA) += mv_egiga.o
 COBJS-$(CONFIG_NATSEMI) += natsemi.o
 COBJS-$(CONFIG_DRIVER_NE2000) += ne2000.o ne2000_base.o
 COBJS-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
drivers/net/mv_egiga.c +6 -2
index b7ecc9d..4fecf1e 100644
@@ -35,13 +35,17 @@
 #include <asm/errno.h>
 #include <asm/types.h>
 #include <asm/byteorder.h>
+
+#if defined (CONFIG_KIRKWOOD)
 #include <asm/arch/kirkwood.h>
+#endif
+
 #include "mv_egiga.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define KIRKWOOD_PHY_ADR_REQUEST 0xee
-#define KWGBE_SMI_REG (((struct kwgbe_registers 
 *)KW_EGIGA0_BASE)->smi)
+#define MV_PHY_ADR_REQUEST 0xee
+#define MV_EGIGA_SMI_REG (((struct mv_egiga_registers 
 *)MV_EGIGA0_BASE)->smi)
 

/*
* smi_reg_read - miiphy_read callback function.

drivers/net/mv_egiga.c DECLARE_GLOBAL_DATA_PTR; · line 60

Quoted 8 lines
drivers/net/mv_egiga.c +2 -2
@@ -51,16 +55,16 @@ DECLARE_GLOBAL_DATA_PTR;
 static int smi_reg_read(char *devname, u8 phy_adr, u8 
 reg_ofs, u16 * data)
 {
 	struct eth_device *dev = eth_get_dev_by_name(devname);
-	struct kwgbe_device *dkwgbe = to_dkwgbe(dev);
-	struct kwgbe_registers *regs = dkwgbe->regs;
+	struct mv_egiga_device *dmvegiga = to_mv_egiga(dev);
+	struct mv_egiga_registers *regs = dmvegiga->regs;

I suggest to keep name as mvgbe here instead of mv_egiga, 3 additional chars, increases overall code size

drivers/net/mv_egiga.c DECLARE_GLOBAL_DATA_PTR;

Quoted 11 lines
drivers/net/mv_egiga.c +3 -3
 	u32 smi_reg;
 	u32 timeout;
 
 	/* Phyadr read request */
-	if (phy_adr == KIRKWOOD_PHY_ADR_REQUEST &&
-			reg_ofs == KIRKWOOD_PHY_ADR_REQUEST) {
+	if (phy_adr == MV_PHY_ADR_REQUEST &&
+			reg_ofs == MV_PHY_ADR_REQUEST) {
 		/* */
-		*data = (u16) (KWGBEREG_RD(regs->phyadr) & PHYADR_MASK);
+		*data = (u16) (MV_EGIGA_REG_RD(regs->phyadr) & 

Same here, pls use MVGBEREG instead of MV_EGIGA_REG, 4 extra chars

Pls just replace kw/KW by mv/MV to avoide indentation issues

I think these are the only changes in this patch (i.e. find and replace), are there any other?

Regards..
Prafulla . .

#12 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

Quoted 105 lines · Prafulla Wadaskar
Quoted 55 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Sunday, July 11, 2010 1:32 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V3 2/5] mv_egiga: support SoCs other than kirkwood

Rename all references to kirkwood in mv_egiga symbols throughout the whole codebase.

---
  arch/arm/cpu/arm926ejs/kirkwood/cpu.c         |    4 +-
  arch/arm/include/asm/arch-kirkwood/kirkwood.h |    5 +
  drivers/net/Makefile                          |    2 +-
  drivers/net/mv_egiga.c                        |  322
+++++++++---------
  drivers/net/mv_egiga.h                        |  466
++++++++++++------------
  include/configs/guruplug.h                    |    4 +-
  include/configs/km_arm.h                      |    4 +-
  include/configs/mv88f6281gtw_ge.h             |    4 +-
  include/configs/openrd_base.h                 |    4 +-
  include/configs/rd6281a.h                     |    4 +-
  include/configs/sheevaplug.h                  |    4 +-
  include/netdev.h                              |    2 +-
  12 files changed, 418 insertions(+), 407 deletions(-)
arch/arm/cpu/arm926ejs/kirkwood/cpu.c +2 -2
index 6fc3902..786ffc6 100644
@@ -378,10 +378,10 @@ int arch_misc_init(void)
  }
  #endif /* CONFIG_ARCH_MISC_INIT */
 
-#ifdef CONFIG_KIRKWOOD_EGIGA
+#ifdef CONFIG_MV_EGIGA
  int cpu_eth_init(bd_t *bis)
  {
-	kirkwood_egiga_initialize(bis);
+	mv_egiga_initialize(bis);
  	return 0;
  }
  #endif
arch/arm/include/asm/arch-kirkwood/kirkwood.h +0 -0
index 2470efb..9200605 100644

arch/arm/include/asm/arch-kirkwood/kirkwood.h line 63

Quoted 4 lines
arch/arm/include/asm/arch-kirkwood/kirkwood.h +1 -0
@@ -60,6 +60,11 @@
  #define KW_EGIGA0_BASE			(KW_REGISTER(0x72000))
  #define KW_EGIGA1_BASE			(KW_REGISTER(0x76000))
 
+#if defined (CONFIG_MV_EGIGA)

I think you don't need ifdef here

Quoted 44 lines
arch/arm/include/asm/arch-kirkwood/kirkwood.h +4 -0
+#define MV_EGIGA0_BASE			KW_EGIGA0_BASE
+#define MV_EGIGA1_BASE			KW_EGIGA1_BASE
+#endif
+
  #if defined (CONFIG_KW88F6281)
  #include<asm/arch/kw88f6281.h>
  #elif defined (CONFIG_KW88F6192)
drivers/net/Makefile +1 -1
index 1599c26..04f8de0 100644
@@ -52,7 +52,7 @@ COBJS-$(CONFIG_MACB) += macb.o
  COBJS-$(CONFIG_MCFFEC) += mcffec.o mcfmii.o
  COBJS-$(CONFIG_MPC5xxx_FEC) += mpc5xxx_fec.o
  COBJS-$(CONFIG_MPC512x_FEC) += mpc512x_fec.o
-COBJS-$(CONFIG_KIRKWOOD_EGIGA) += mv_egiga.o
+COBJS-$(CONFIG_MV_EGIGA) += mv_egiga.o
  COBJS-$(CONFIG_NATSEMI) += natsemi.o
  COBJS-$(CONFIG_DRIVER_NE2000) += ne2000.o ne2000_base.o
  COBJS-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
drivers/net/mv_egiga.c +6 -2
index b7ecc9d..4fecf1e 100644
@@ -35,13 +35,17 @@
  #include<asm/errno.h>
  #include<asm/types.h>
  #include<asm/byteorder.h>
+
+#if defined (CONFIG_KIRKWOOD)
  #include<asm/arch/kirkwood.h>
+#endif
+
  #include "mv_egiga.h"
 
  DECLARE_GLOBAL_DATA_PTR;
 
-#define KIRKWOOD_PHY_ADR_REQUEST 0xee
-#define KWGBE_SMI_REG (((struct kwgbe_registers
 *)KW_EGIGA0_BASE)->smi)
+#define MV_PHY_ADR_REQUEST 0xee
+#define MV_EGIGA_SMI_REG (((struct mv_egiga_registers
 *)MV_EGIGA0_BASE)->smi)
 
Quoted 12 lines

drivers/net/mv_egiga.c DECLARE_GLOBAL_DATA_PTR; · line 60

Quoted 11 lines

/*
* smi_reg_read - miiphy_read callback function.

drivers/net/mv_egiga.c +2 -2
@@ -51,16 +55,16 @@ DECLARE_GLOBAL_DATA_PTR;
  static int smi_reg_read(char *devname, u8 phy_adr, u8
 reg_ofs, u16 * data)
  {
  	struct eth_device *dev = eth_get_dev_by_name(devname);
-	struct kwgbe_device *dkwgbe = to_dkwgbe(dev);
-	struct kwgbe_registers *regs = dkwgbe->regs;
+	struct mv_egiga_device *dmvegiga = to_mv_egiga(dev);
+	struct mv_egiga_registers *regs = dmvegiga->regs;

I suggest to keep name as mvgbe here instead of mv_egiga, 3 additional chars, increases overall code size

huh? The name is consistent with the rest of his work, and *if* the code really increases in size, I can't imagine that 3 chars really matters...

Quoted 12 lines

drivers/net/mv_egiga.c DECLARE_GLOBAL_DATA_PTR;

Quoted 11 lines
drivers/net/mv_egiga.c +3 -3
  	u32 smi_reg;
  	u32 timeout;
 
  	/* Phyadr read request */
-	if (phy_adr == KIRKWOOD_PHY_ADR_REQUEST&&
-			reg_ofs == KIRKWOOD_PHY_ADR_REQUEST) {
+	if (phy_adr == MV_PHY_ADR_REQUEST&&
+			reg_ofs == MV_PHY_ADR_REQUEST) {
  		/* */
-		*data = (u16) (KWGBEREG_RD(regs->phyadr)&  PHYADR_MASK);
+		*data = (u16) (MV_EGIGA_REG_RD(regs->phyadr)&

Same here, pls use MVGBEREG instead of MV_EGIGA_REG, 4 extra chars

Same comment as above. Clarity is king.

Quoted 10 lines

Pls just replace kw/KW by mv/MV to avoide indentation issues

I think these are the only changes in this patch (i.e. find and replace), are there any other?

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

#13 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

Quoted 20 lines

-----Original Message-----
From: Ben Warren [mailto:biggerbadderben at gmail.com]
Sent: Monday, July 12, 2010 11:54 AM
To: Prafulla Wadaskar
Cc: Albert Aribaud; u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH V3 2/5] mv_egiga: support SoCs other than kirkwood

Quoted 9 lines · Prafulla Wadaskar
Quoted 9 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Sunday, July 11, 2010 1:32 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V3 2/5] mv_egiga: support SoCs other than kirkwood

...snip...

Quoted 10 lines
Quoted 6 lines

drivers/net/mv_egiga.c DECLARE_GLOBAL_DATA_PTR; · line 59

Quoted 5 lines
  	struct eth_device *dev = eth_get_dev_by_name(devname);
drivers/net/mv_egiga.c +2 -2
-	struct kwgbe_device *dkwgbe = to_dkwgbe(dev);
-	struct kwgbe_registers *regs = dkwgbe->regs;
+	struct mv_egiga_device *dmvegiga = to_mv_egiga(dev);
+	struct mv_egiga_registers *regs = dmvegiga->regs;

I suggest to keep name as mvgbe here instead of mv_egiga, 3

additional chars, increases overall code size
huh? The name is consistent with the rest of his work, and *if* the code really increases in size, I can't imagine that 3 chars really matters...

That's true.
But if we can do it why to avoid it? again it helps to keep same indentation (keeping them below 80char size)

Regards..
Prafulla . .

#14 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

Le 12/07/2010 08:53, Prafulla Wadaskar a ?crit :

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/net/mv_egiga.c DECLARE_GLOBAL_DATA_PTR; · line 59

Quoted 4 lines
drivers/net/mv_egiga.c +2 -2
-	struct kwgbe_device *dkwgbe = to_dkwgbe(dev);
-	struct kwgbe_registers *regs = dkwgbe->regs;
+	struct mv_egiga_device *dmvegiga = to_mv_egiga(dev);
+	struct mv_egiga_registers *regs = dmvegiga->regs;

I suggest to keep name as mvgbe here instead of mv_egiga, 3

Quoted 7 lines
Quoted 4 lines

additional chars, increases overall code size
huh? The name is consistent with the rest of his work, and *if* the code really increases in size, I can't imagine that 3 chars really matters...

That's true.
But if we can do it why to avoid it? again it helps to keep same indentation (keeping them below 80char size)

I don't think I changed indentation here, and the issue is about line lengths, right?

Initially I chose mv egiga because the file names used egiga while the code used gbe, and I wanted clarity, so I decided to keep only one of egiga and gbe. Now which one I should keep is not really important to me, and a Google search for marvell egiga vs marvell gbe indicates gbe appears much more frequently, so someone looking into this will probably know "GbE" more than "egiga".

I suggest that:

- I switch the file names from mv_egiga to "mvgbe" (to be consistent with Prafulla's comment on mv_sata becoming mvsata), and

- I replace mv_egiga/MV_EGIGA symbols with mvgbe/MVGBE.

That will retain (as much) clarity and uniformity (as egiga does), which is what I think Ben is looking for, and it'll keep name length at a minimum, which should satisfy Prafulla.

Ben, Prafulla (and others as well, of course), do you agree?

Amicalement,

Signature · 1 line
Albert.
#15 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

Hi Albert,

Quoted 36 lines · Albert ARIBAUD

Le 12/07/2010 08:53, Prafulla Wadaskar a ?crit :

Quoted 14 lines

- struct kwgbe_device *dkwgbe = to_dkwgbe(dev);

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/net/mv_egiga.c +2 -1
-       struct kwgbe_registers *regs = dkwgbe->regs;
+       struct mv_egiga_device *dmvegiga = to_mv_egiga(dev);
+       struct mv_egiga_registers *regs = dmvegiga->regs;
Quoted 7 lines
Quoted 2 lines

I suggest to keep name as mvgbe here instead of mv_egiga, 3

additional chars, increases overall code size
huh? The name is consistent with the rest of his work, and *if* the code really increases in size, I can't imagine that 3 chars really matters...

Quoted 4 lines

That's true.
But if we can do it why to avoid it? again it helps to keep same indentation (keeping them below 80char size)

I don't think I changed indentation here, and the issue is about line lengths, right?

Initially I chose mv egiga because the file names used egiga while the code used gbe, and I wanted clarity, so I decided to keep only one of egiga and gbe. Now which one I should keep is not really important to me, and a Google search for marvell egiga vs marvell gbe indicates gbe appears much more frequently, so someone looking into this will probably know "GbE" more than "egiga".

I suggest that:

- I switch the file names from mv_egiga to "mvgbe" (to be consistent with Prafulla's comment on mv_sata becoming mvsata), and

Quoted 8 lines

- I replace mv_egiga/MV_EGIGA symbols with mvgbe/MVGBE.

That will retain (as much) clarity and uniformity (as egiga does), which is what I think Ben is looking for, and it'll keep name length at a minimum, which should satisfy Prafulla.

Ben, Prafulla (and others as well, of course), do you agree?

OK with me.

Quoted 1 line

Amicalement,

Quoted 3 lines

--
Albert.

regards,
Ben

#16 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

Le 12/07/2010 16:19, Ben Warren a ?crit :

Quoted 7 lines

I suggest that:

- I switch the file names from mv_egiga to "mvgbe" (to be consistent with Prafulla's comment on mv_sata becoming mvsata), and

- I replace mv_egiga/MV_EGIGA symbols with mvgbe/MVGBE.

Quoted 7 lines

That will retain (as much) clarity and uniformity (as egiga does), which is what I think Ben is looking for, and it'll keep name length at a minimum, which should satisfy Prafulla.

Ben, Prafulla (and others as well, of course), do you agree?

OK with me.

Thanks Ben. I assume Prafulla will agree too. I'll regenerate a patch set with all changes requested by Prafulla, keeping the symbol-change in a single patch as discussed elsewhere in this thread.

Note that the last patch of the series (edminiv2 support) will only build above the CONFIG_SKIP_LOCAL_MAC_RANDOMIZATION patch that I posted separately.

Amicalement,

Signature · 1 line
Albert.
#17 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

In reply to Prafulla Wadaskar

Le 12/07/2010 07:45, Prafulla Wadaskar a ?crit :

Quoted 10 lines

arch/arm/include/asm/arch-kirkwood/kirkwood.h line 63

Quoted 4 lines
arch/arm/include/asm/arch-kirkwood/kirkwood.h +1 -0
 
+#if defined (CONFIG_MV_EGIGA)

I think you don't need ifdef here

arch/arm/include/asm/arch-kirkwood/kirkwood.h line 66

Quoted 3 lines
arch/arm/include/asm/arch-kirkwood/kirkwood.h +3 -0
+#define MV_EGIGA0_BASE			KW_EGIGA0_BASE
+#define MV_EGIGA1_BASE			KW_EGIGA1_BASE
+#endif

Actually the ifdef is intended to make sure these symbols do not get defined uselessly for kirkwood boards that don't have Ethernet support. Granted, their being defined without being used is no big deal.

However the whole thing about the egiga driver supporting one or two ports could be streamlined (e.g., one might define KIRKWOOD_EGIGAn_BASE while not enabling port n in CONFIG_KIRKWOOD_EGIGA_PORTS) and integrate the suggestion about the PHYs that occurred some time ago:

<http://lists.denx.de/pipermail/u-boot/2010-June/073138.html>

So I'll leave that one to a later patch set.

Amicalement,

Signature · 1 line
Albert.
#18 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

In reply to Albert Aribaud
Quoted 10 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Sunday, July 11, 2010 1:32 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V3 2/5] mv_egiga: support SoCs other than kirkwood

Quoted 5 lines

Rename all references to kirkwood in mv_egiga symbols throughout the whole codebase.

---

Pls break this patch as-

Quoted 2 lines
 arch/arm/cpu/arm926ejs/kirkwood/cpu.c         |    4 +-
 arch/arm/include/asm/arch-kirkwood/kirkwood.h |    5 +

Kirkwood SOC specific

Quoted 5 lines
 drivers/net/Makefile                          |    2 +-
 drivers/net/mv_egiga.c                        |  322 
+++++++++---------
 drivers/net/mv_egiga.h                        |  466
 include/netdev.h                              |    2 +-

Net: driver specific for net repo

Quoted 7 lines

++++++++++++------------

 include/configs/guruplug.h                    |    4 +-
 include/configs/km_arm.h                      |    4 +-
 include/configs/mv88f6281gtw_ge.h             |    4 +-
 include/configs/openrd_base.h                 |    4 +-
 include/configs/rd6281a.h                     |    4 +-
 include/configs/sheevaplug.h                  |    4 +-

Board updates
In the same order, so that it is easier to pick them separately by net and Marvell repos.

Regards..
Prafulla . .

#19 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

Le 12/07/2010 07:49, Prafulla Wadaskar a ?crit :

Quoted 36 lines
Quoted 10 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Sunday, July 11, 2010 1:32 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V3 2/5] mv_egiga: support SoCs other than kirkwood

Quoted 5 lines

Rename all references to kirkwood in mv_egiga symbols throughout the whole codebase.

---

Pls break this patch as-

Quoted 2 lines
  arch/arm/cpu/arm926ejs/kirkwood/cpu.c         |    4 +-
  arch/arm/include/asm/arch-kirkwood/kirkwood.h |    5 +

Kirkwood SOC specific

Quoted 5 lines
  drivers/net/Makefile                          |    2 +-
  drivers/net/mv_egiga.c                        |  322
+++++++++---------
  drivers/net/mv_egiga.h                        |  466
  include/netdev.h                              |    2 +-

Net: driver specific for net repo

Quoted 7 lines

++++++++++++------------

  include/configs/guruplug.h                    |    4 +-
  include/configs/km_arm.h                      |    4 +-
  include/configs/mv88f6281gtw_ge.h             |    4 +-
  include/configs/openrd_base.h                 |    4 +-
  include/configs/rd6281a.h                     |    4 +-
  include/configs/sheevaplug.h                  |    4 +-
Quoted 5 lines

Board updates
In the same order, so that it is easier to pick them separately by net and Marvell repos.

Regards..
Prafulla . .

If I split this patch, it will not build correctly any more.

Amicalement,

Signature · 1 line
Albert.
#20 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

Hi Albert,

Quoted 39 lines · Albert ARIBAUD

Le 12/07/2010 07:49, Prafulla Wadaskar a ?crit :

Quoted 36 lines
Quoted 10 lines

-----Original Message-----
From: u-boot-bounces at lists.denx.de [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Albert Aribaud
Sent: Sunday, July 11, 2010 1:32 PM
To: u-boot at lists.denx.de
Subject: [U-Boot] [PATCH V3 2/5] mv_egiga: support SoCs other than kirkwood

Quoted 5 lines

Rename all references to kirkwood in mv_egiga symbols throughout the whole codebase.

---

Pls break this patch as-

Quoted 2 lines
  arch/arm/cpu/arm926ejs/kirkwood/cpu.c         |    4 +-
  arch/arm/include/asm/arch-kirkwood/kirkwood.h |    5 +

Kirkwood SOC specific

Quoted 5 lines
  drivers/net/Makefile                          |    2 +-
  drivers/net/mv_egiga.c                        |  322
+++++++++---------
  drivers/net/mv_egiga.h                        |  466
  include/netdev.h                              |    2 +-

Net: driver specific for net repo

Quoted 7 lines

++++++++++++------------

  include/configs/guruplug.h                    |    4 +-
  include/configs/km_arm.h                      |    4 +-
  include/configs/mv88f6281gtw_ge.h             |    4 +-
  include/configs/openrd_base.h                 |    4 +-
  include/configs/rd6281a.h                     |    4 +-
  include/configs/sheevaplug.h                  |    4 +-
Quoted 2 lines

Board updates
In the same order, so that it is easier to pick them separately by net

Quoted 8 lines

and Marvell repos.

Quoted 3 lines

Regards..
Prafulla . .

If I split this patch, it will not build correctly any more.

Usually, these should be split up. In this case, the dependencies are

significant, so just leave it as-is. If Prafulla ACKs, I'll pull the whole group into the net repo.

Quoted 4 lines

Amicalement,
--
Albert.

regards,
Ben

Quoted 5 lines

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

#21 lore raw

PATCH v3 2/5 mv_egiga: support SoCs other than kirkwood

Quoted 75 lines

-----Original Message-----
From: Ben Warren [mailto:biggerbadderben at gmail.com]
Sent: Monday, July 12, 2010 7:54 PM
To: Albert ARIBAUD
Cc: Prafulla Wadaskar; u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH V3 2/5] mv_egiga: support SoCs other than kirkwood

Hi Albert,

On Mon, Jul 12, 2010 at 1:56 AM, Albert ARIBAUD <[email protected]> wrote:

	Le 12/07/2010 07:49, Prafulla Wadaskar a ?crit :
	
	>
	>
	>> -----Original Message-----
	>> From: u-boot-bounces at lists.denx.de
	>> [mailto:u-boot-bounces at lists.denx.de] On Behalf Of 

Albert Aribaud
>> Sent: Sunday, July 11, 2010 1:32 PM
>> To: u-boot at lists.denx.de
>> Subject: [U-Boot] [PATCH V3 2/5] mv_egiga: support SoCs other >> than kirkwood
>>

>> Rename all references to kirkwood in mv_egiga symbols >> throughout the whole codebase.
>>
>> Signed-off-by: Albert Aribaud<[email protected]> >> ---
>

> Pls break this patch as-

>> arch/arm/cpu/arm926ejs/kirkwood/cpu.c | 4 +-
>> arch/arm/include/asm/arch-kirkwood/kirkwood.h | 5 +

> Kirkwood SOC specific

>
>> drivers/net/Makefile | 2 +-
>> drivers/net/mv_egiga.c | 322
>> +++++++++---------
>> drivers/net/mv_egiga.h | 466

>> include/netdev.h | 2 +-
> Net: driver specific for net repo

>
>> ++++++++++++------------
>> include/configs/guruplug.h | 4 +-
>> include/configs/km_arm.h | 4 +-
>> include/configs/mv88f6281gtw_ge.h | 4 +-
>> include/configs/openrd_base.h | 4 +-
>> include/configs/rd6281a.h | 4 +-
>> include/configs/sheevaplug.h | 4 +-
>

> Board updates
> In the same order, so that it is easier to pick them
separately by net and Marvell repos.

	>
	> Regards..
	> Prafulla . .
	
	If I split this patch, it will not build correctly any more.
Quoted 3 lines

Usually, these should be split up. In this case, the dependencies are significant, so just leave it as-is. If Prafulla ACKs, I'll pull the whole group into the net repo.

Ack
Hi Ben, its good if you pull entire patch series.

Regards..
Prafulla . .