[U-Boot] [PATCH v3 2/2] NET: Base support for etsec2.0

2009-10-29 Thread Sandeep Gopalpet
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.ku...@freescale.com
---
 include/asm-ppc/immap_83xx.h |2 +-
 include/asm-ppc/immap_85xx.h |6 +-
 include/asm-ppc/immap_86xx.h |2 +-
 include/configs/P1_P2_RDB.h  |5 +
 include/tsec.h   |7 +++
 5 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/include/asm-ppc/immap_83xx.h b/include/asm-ppc/immap_83xx.h
index 6dd477c..2e6ba2d 100644
--- a/include/asm-ppc/immap_83xx.h
+++ b/include/asm-ppc/immap_83xx.h
@@ -872,7 +872,7 @@ typedef struct immap {
 #define CONFIG_SYS_TSEC1_OFFSET0x24000
 #define TSEC_SIZE  0x01000
 
-#define CONFIG_SYS_MDIO1_OFFSET0x24520
+#define CONFIG_SYS_MDIO1_OFFSET0x24000
 #define TSEC_MDIO_OFFSET   0x01000
 
 #define TSEC_BASE_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_TSEC1_OFFSET)
diff --git a/include/asm-ppc/immap_85xx.h b/include/asm-ppc/immap_85xx.h
index 54b43b1..2f2ebfe 100644
--- a/include/asm-ppc/immap_85xx.h
+++ b/include/asm-ppc/immap_85xx.h
@@ -1933,9 +1933,13 @@ typedef struct ccsr_gur {
(CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB_OFFSET)
 
 /* TSEC and MDIO OFFSETS */
+#ifdef CONFIG_TSECV2
+#define CONFIG_SYS_TSEC1_OFFSET0xB
+#else
 #define CONFIG_SYS_TSEC1_OFFSET0x24000
+#endif
 
-#define CONFIG_SYS_MDIO1_OFFSET0x24520
+#define CONFIG_SYS_MDIO1_OFFSET0x24000
 #define TSEC_MDIO_OFFSET   0x01000
 
 #define TSEC_BASE_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_TSEC1_OFFSET)
diff --git a/include/asm-ppc/immap_86xx.h b/include/asm-ppc/immap_86xx.h
index be2eadd..783ea2e 100644
--- a/include/asm-ppc/immap_86xx.h
+++ b/include/asm-ppc/immap_86xx.h
@@ -1300,7 +1300,7 @@ extern immap_t  *immr;
 
 #define CONFIG_SYS_TSEC1_OFFSET0x24000
 
-#define CONFIG_SYS_MDIO1_OFFSET0x24520
+#define CONFIG_SYS_MDIO1_OFFSET0x24000
 #define TSEC_MDIO_OFFSET   0x01000
 
 #define TSEC_BASE_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_TSEC1_OFFSET)
diff --git a/include/configs/P1_P2_RDB.h b/include/configs/P1_P2_RDB.h
index 310242e..4d93ed8 100644
--- a/include/configs/P1_P2_RDB.h
+++ b/include/configs/P1_P2_RDB.h
@@ -84,6 +84,11 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_MP
 #endif
 
+/* TSECV2 */
+#if defined(CONFIG_P1020)
+#define CONFIG_TSECV2
+#endif
+
 /*
  * These can be toggled for performance analysis, otherwise use default.
  */
diff --git a/include/tsec.h b/include/tsec.h
index d895d02..fc2f075 100644
--- a/include/tsec.h
+++ b/include/tsec.h
@@ -456,12 +456,19 @@ typedef struct tsec_hash_regs
 } tsec_hash_t;
 
 typedef struct tsec_mdio {
+   uintres1[4];
+   uintieventm;
+   uintimaskm;
+   uintres2;
+   uintemapm;
+   uintres3[320];
uintmiimcfg;/* MII Management: Configuration */
uintmiimcom;/* MII Management: Command */
uintmiimadd;/* MII Management: Address */
uintmiimcon;/* MII Management: Control */
uintmiimstat;   /* MII Management: Status */
uintmiimind;/* MII Management: Indicators */
+   uintres4[690];
 } tsec_mdio_t;
 
 typedef struct tsec
-- 
1.5.2.2

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


[U-Boot] [PATCH v3 2/2] NET: Base support for etsec2.0

2009-10-28 Thread Sandeep Gopalpet
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.ku...@freescale.com
---
 include/asm-ppc/immap_85xx.h |7 ++-
 include/configs/P1_P2_RDB.h  |5 +
 include/tsec.h   |   11 +++
 3 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/include/asm-ppc/immap_85xx.h b/include/asm-ppc/immap_85xx.h
index ad3910c..9a5326a 100644
--- a/include/asm-ppc/immap_85xx.h
+++ b/include/asm-ppc/immap_85xx.h
@@ -1933,10 +1933,15 @@ typedef struct ccsr_gur {
(CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB_OFFSET)
 
 /* TSEC and MDIO OFFSETS */
+#ifdef CONFIG_TSECV2
+#define CONFIG_SYS_TSEC1_OFFSET0xB
+#else
 #define CONFIG_SYS_TSEC1_OFFSET0x24000
+#endif
+
 #define TSEC_SIZE  0x01000
 
-#define CONFIG_SYS_MDIO1_OFFSET0x24520
+#define CONFIG_SYS_MDIO1_OFFSET0x24000
 #define MDIO_OFFSET0x01000
 
 #define TSEC_BASE_ADDR (CONFIG_SYS_IMMR + CONFIG_SYS_TSEC1_OFFSET)
diff --git a/include/configs/P1_P2_RDB.h b/include/configs/P1_P2_RDB.h
index 310242e..4d93ed8 100644
--- a/include/configs/P1_P2_RDB.h
+++ b/include/configs/P1_P2_RDB.h
@@ -84,6 +84,11 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_MP
 #endif
 
+/* TSECV2 */
+#if defined(CONFIG_P1020)
+#define CONFIG_TSECV2
+#endif
+
 /*
  * These can be toggled for performance analysis, otherwise use default.
  */
diff --git a/include/tsec.h b/include/tsec.h
index 92ac49a..0727cbe 100644
--- a/include/tsec.h
+++ b/include/tsec.h
@@ -453,14 +453,25 @@ typedef struct tsec_hash_regs
uintres2[24];
 } tsec_hash_t;
 
+/* MDIO structure for etsec2.0.
+ * Backward compatible to etsec1.x
+ */
+
 typedef struct tsec_mdio
 {
+   uintres1[4];
+   uintieventm;/* MDIO Interrupt event register */
+   uintimaskm; /* MDIO Interrupt mask register */
+   uintres2;
+   uintemapm;  /* MDIO Event mapping register */
+   uintres3[320];
uintmiimcfg;/* MII Management: Configuration */
uintmiimcom;/* MII Management: Command */
uintmiimadd;/* MII Management: Address */
uintmiimcon;/* MII Management: Control */
uintmiimstat;   /* MII Management: Status */
uintmiimind;/* MII Management: Indicators */
+   uintres4[690];
 } tsec_mdio_t;
 
 typedef struct tsec
-- 
1.5.2.2

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