[U-Boot] [PATCH v0 2/2] u-boot-2009.08 NET: Base support for etsec2.0

Sandeep Gopalpet sandeep.kumar at freescale.com
Thu Sep 24 14:07:27 CEST 2009


1. Modified the tsec_mdio structure to include the new regs
2. Modified the MDIO_BASE_ADDR so that it will handle both
older version and new version of etsec.

Signed-off-by: Sandeep Gopalpet <sandeep.kumar at freescale.com>
---
 include/asm-ppc/immap_85xx.h |    6 +++++-
 include/tsec.h               |   13 ++++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/include/asm-ppc/immap_85xx.h b/include/asm-ppc/immap_85xx.h
index dc82f49..bbeb585 100644
--- a/include/asm-ppc/immap_85xx.h
+++ b/include/asm-ppc/immap_85xx.h
@@ -1936,10 +1936,14 @@ typedef struct ccsr_gur {
 			(CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB_OFFSET)
 
 /* TSEC and MDIO OFFSETS */
+#ifdef CONFIG_P1020
+#define CONFIG_SYS_TSEC1_OFFSET		(0xB0000)
+#else
 #define CONFIG_SYS_TSEC1_OFFSET		(0x24000)
+#endif
 #define TSEC_SIZE			(0x01000)
 
-#define CONFIG_SYS_MDIO1_OFFSET		(0x24520)
+#define CONFIG_SYS_MDIO1_OFFSET		(0x24000)
 #define MDIO_OFFSET     		(0x01000)
 
 #define TSEC_BASE_ADDR		(CONFIG_SYS_IMMR + CONFIG_SYS_TSEC1_OFFSET)
diff --git a/include/tsec.h b/include/tsec.h
index 342c07e..a915266 100644
--- a/include/tsec.h
+++ b/include/tsec.h
@@ -29,7 +29,7 @@
 #endif
 
 #ifndef CONFIG_SYS_MDIO1_OFFSET
-    #define CONFIG_SYS_MDIO1_OFFSET	(0x24520)
+    #define CONFIG_SYS_MDIO1_OFFSET	(0x24000)
 #endif
 
 #ifndef MDIO_OFFSET
@@ -478,14 +478,25 @@ typedef struct tsec_hash_regs
 	uint	res2[24];
 } tsec_hash_t;
 
+/* MDIO structure for etsec2.0.
+ * Backward compatible to etsec1.x
+ */
+
 typedef struct tsec_mdio
 {
+	uint	res1[4];
+	uint	ieventm;	/* MDIO Interrupt event register */
+	uint	imaskm;		/* MDIO Interrupt mask register */
+	uint	res2;
+	uint	emapm;		/* MDIO Event mapping register */
+	uint	res3[320];
 	uint	miimcfg;	/* MII Management: Configuration */
 	uint	miimcom;	/* MII Management: Command */
 	uint	miimadd;	/* MII Management: Address */
 	uint	miimcon;	/* MII Management: Control */
 	uint	miimstat;	/* MII Management: Status */
 	uint	miimind;	/* MII Management: Indicators */
+	uint	res4[690];
 } tsec_mdio_t;
 
 typedef struct tsec
-- 
1.5.2.2



More information about the U-Boot mailing list