Skip to contentSkip to conversation

NET: Base support for etsec2.0

PATCH New Sandeep Gopalpet 2 participants 3 messages Oct 18, 2009 – Oct 19, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 NET: Base support for etsec2.0

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.

---
 include/asm-ppc/immap_85xx.h |    6 +++++-
 include/configs/P1_P2_RDB.h  |    5 +++++
 include/tsec.h               |   13 ++++++++++++-
 3 files changed, 22 insertions(+), 2 deletions(-)
include/asm-ppc/immap_85xx.h +5 -1
index 6c9baac..fccfca5 100644
@@ -1933,10 +1933,14 @@ typedef struct ccsr_gur {
 	(CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB_OFFSET)
 
 /* TSEC and MDIO OFFSETS */
+#ifdef CONFIG_TSECV2
+#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)
include/configs/P1_P2_RDB.h +5 -0
index 8e97ad0..77c43e7 100644
@@ -68,6 +68,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.
  */
include/tsec.h +12 -1
index 342c07e..a915266 100644
@@ -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
Signature · 1 line
1.5.2.2
#1 lore raw

PATCH 2/2 NET: Base support for etsec2.0

Quoted 22 lines · 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.

---

include/asm-ppc/immap_85xx.h |    6 +++++-
include/configs/P1_P2_RDB.h  |    5 +++++
include/tsec.h               |   13 ++++++++++++-
3 files changed, 22 insertions(+), 2 deletions(-)
include/asm-ppc/ renamed from include/asm-ppc/immap_85xx.h +0 -0

immap_85xx.h
index 6c9baac..fccfca5 100644

include/asm-ppc/immap_85xx.h +2 -0
@@ -1933,10 +1933,14 @@ typedef struct ccsr_gur {
 	(CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB_OFFSET)
 
 /* TSEC and MDIO OFFSETS */
+#ifdef CONFIG_TSECV2
+#define CONFIG_SYS_TSEC1_OFFSET		(0xB0000)

include/asm-ppc/immap_85xx.h typedef struct ccsr_gur { · line 1946

Quoted 10 lines
include/asm-ppc/immap_85xx.h +3 -1
+#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)

let's just do this in tsec.h

Quoted 64 lines
include/configs/P1_P2_RDB.h +5 -0
index 8e97ad0..77c43e7 100644
@@ -68,6 +68,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.
*/

include/tsec.h +5 -1
index 342c07e..a915266 100644
@@ -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
{

include/tsec.h +6 -0
+	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 */

include/tsec.h +1 -0
+	uint	res4[690];

} tsec_mdio_t;

typedef struct tsec

Signature · 6 lines
1.5.2.2

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

PATCH 2/2 NET: Base support for etsec2.0

Quoted 39 lines

-----Original Message-----
From: Kumar Gala [mailto:galak at kernel.crashing.org]
Sent: Monday, October 19, 2009 12:10 AM
To: Kumar Gopalpet-B05799
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] [PATCH v1 2/2] NET: Base support for etsec2.0

Quoted 2 lines · 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

Quoted 24 lines

and new version of etsec.

---

include/asm-ppc/immap_85xx.h |    6 +++++-
include/configs/P1_P2_RDB.h  |    5 +++++
include/tsec.h               |   13 ++++++++++++-
3 files changed, 22 insertions(+), 2 deletions(-)
include/asm-ppc/ renamed from include/asm-ppc/immap_85xx.h +0 -0

immap_85xx.h index 6c9baac..fccfca5 100644

include/asm-ppc/immap_85xx.h +4 -0
@@ -1933,10 +1933,14 @@ typedef struct ccsr_gur {
 	(CONFIG_SYS_IMMR + CONFIG_SYS_MPC85xx_USB_OFFSET)
 
 /* TSEC and MDIO OFFSETS */
+#ifdef CONFIG_TSECV2
+#define CONFIG_SYS_TSEC1_OFFSET		(0xB0000)
+#else
 #define CONFIG_SYS_TSEC1_OFFSET		(0x24000)
+#endif
 #define TSEC_SIZE			(0x01000)
 
Quoted 8 lines

include/asm-ppc/immap_85xx.h typedef struct ccsr_gur {

Quoted 5 lines
include/asm-ppc/immap_85xx.h +1 -1
-#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)

let's just do this in tsec.h

I feel the correct place for these definitions is the platform file. Whats ur say ??

Quoted 67 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

b/include/configs/P1_P2_RDB.h

Quoted 61 lines

index 8e97ad0..77c43e7 100644

include/configs/P1_P2_RDB.h +0 -0
@@ -68,6 +68,11 @@ extern unsigned long get_board_sys_clk(unsigned 

long dummy); #define CONFIG_MP #endif

include/configs/P1_P2_RDB.h +5 -0
+/* TSECV2 */
+#if defined(CONFIG_P1020)
+#define CONFIG_TSECV2
+#endif
+

/*
* These can be toggled for performance analysis, otherwise use
default.
*/

include/tsec.h index 342c07e..a915266 renamed from include/tsec.h +0 -0

100644

include/tsec.h +5 -1
@@ -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
{

include/tsec.h +6 -0
+	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 */

include/tsec.h +1 -0
+	uint	res4[690];

} tsec_mdio_t;

typedef struct tsec
--
1.5.2.2

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