Skip to contentSkip to conversation

Coldfire Ethernet initialization changes

PATCH New Ben Warren 2 participants 9 messages Jul 3, 2008 – Jul 8, 2008

Subsystems (2)
lore
Share & tools
lore

Ben Warren

author
#0 lore raw

cover Coldfire Ethernet initialization changes

These two patches move the default initialization of Coldfire FEC controllers to cpu_eth_init() in the CPU directories.

I don't have a Coldfire cross compiler set up nor do I have any hardware, so I'm looking for volunteers to do the following:

1. Run 'MAKEALL coldfire' to check for compile-time errors
2. Try the code out on real hardware

I'm pushing these patches to a 'testing' branch on the net repo. Please clone it as follows:

$ git clone git://git.denx.de/u-boot-net.git
$ cd u-boot-net
$ git checkout testing

thanks!
Ben

author
#1 lore raw

PATCH 1/2 Moved initialization of FSL_MCDMAFEC Ethernet driver to CPU directory

Added a cpu_eth_init() function to cpu/mcf547x_8x directory and removed code from net/eth.c

---
 cpu/mcf547x_8x/cpu.c       |    9 +++++++++
 drivers/net/fsl_mcdmafec.c |    2 +-
 net/eth.c                  |    4 ----
 3 files changed, 10 insertions(+), 5 deletions(-)
cpu/mcf547x_8x/cpu.c +9 -0
index 528bca6..e29b45c 100644
@@ -141,3 +141,12 @@ int watchdog_init(void)
 	return (0);
 }
 #endif				/* CONFIG_HW_WATCHDOG */
+
+#if defined(CONFIG_FSLDMAFEC)
+extern int mcdmafec_initialize(bd_t *bis);
+
+int cpu_eth_init(bd_t *bis)
+{
+	return mcdmafec_initialize(bis);
+}
+#endif
drivers/net/fsl_mcdmafec.c +1 -1
index f2bdba6..e34975a 100644
@@ -582,5 +582,5 @@ int mcdmafec_initialize(bd_t * bis)
 	/* default speed */
 	bis->bi_ethspeed = 10;
 
-	return 1;
+	return 0;
 }
net/eth.c +0 -4
index 7fc9aee..40bbed4 100644
@@ -73,7 +73,6 @@ extern int atstk1000_eth_initialize(bd_t *);
 extern int greth_initialize(bd_t *);
 extern int atngw100_eth_initialize(bd_t *);
 extern int mcffec_initialize(bd_t*);
-extern int mcdmafec_initialize(bd_t*);
 extern int at91sam9_eth_initialize(bd_t *);
 
 #ifdef CONFIG_API
@@ -283,9 +282,6 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_MCFFEC)
 	mcffec_initialize(bis);
 #endif
-#if defined(CONFIG_FSLDMAFEC)
-	mcdmafec_initialize(bis);
-#endif
 #if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
     defined(CONFIG_AT91SAM9263)
 	at91sam9_eth_initialize(bis);
Signature · 1 line
1.5.4.3
author
#2 lore raw

PATCH 2/2 Moved initialization of MCFFEC Ethernet driver to CPU directory

Added a cpu_eth_init() function to coldfire CPU directories and removed code from net/eth.c

---
 cpu/mcf523x/cpu.c    |   14 ++++++++++++++
 cpu/mcf52x2/cpu.c    |   15 +++++++++++++++
 cpu/mcf532x/cpu.c    |   14 ++++++++++++++
 cpu/mcf5445x/cpu.c   |   14 ++++++++++++++
 cpu/mcf547x_8x/cpu.c |   16 ++++++++++++++--
 drivers/net/mcffec.c |    2 +-
 net/eth.c            |    4 ----
 7 files changed, 72 insertions(+), 7 deletions(-)
cpu/mcf523x/cpu.c +14 -0
index f0d954b..8d2152d 100644
@@ -107,3 +107,17 @@ int watchdog_init(void)
 	return (0);
 }
 #endif				/* CONFIG_WATCHDOG */
+
+#if defined(CONFIG_MCFFEC)
+/* Default initializations for MCFFEC controllers.  To override,
+ * create a board-specific function called:
+ * 	int board_eth_init(bd_t *bis)
+ */
+
+extern int mcffec_initialize(bd_t*);
+
+int cpu_eth_init(bd_t *bis)
+{
+	return mcffec_initialize(bis);
+}
+#endif
cpu/mcf52x2/cpu.c +15 -0
index d5d3d33..2af31cb 100644
@@ -321,3 +321,18 @@ int do_reset(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
 	return 0;
 };
 #endif
+
+#if defined(CONFIG_MCFFEC)
+/* Default initializations for MCFFEC controllers.  To override,
+ * create a board-specific function called:
+ * 	int board_eth_init(bd_t *bis)
+ */
+
+extern int mcffec_initialize(bd_t*);
+
+int cpu_eth_init(bd_t *bis)
+{
+	return mcffec_initialize(bis);
+}
+#endif
+
cpu/mcf532x/cpu.c +14 -0
index 61541ab..20d0d5c 100644
@@ -129,3 +129,17 @@ int watchdog_init(void)
 	return (0);
 }
 #endif				/* CONFIG_WATCHDOG */
+
+#if defined(CONFIG_MCFFEC)
+/* Default initializations for MCFFEC controllers.  To override,
+ * create a board-specific function called:
+ * 	int board_eth_init(bd_t *bis)
+ */
+
+extern int mcffec_initialize(bd_t*);
+
+int cpu_eth_init(bd_t *bis)
+{
+	return mcffec_initialize(bis);
+}
+#endif
cpu/mcf5445x/cpu.c +14 -0
index e601b89..ab342dd 100644
@@ -95,3 +95,17 @@ int checkcpu(void)
 
 	return 0;
 }
+
+#if defined(CONFIG_MCFFEC)
+/* Default initializations for MCFFEC controllers.  To override,
+ * create a board-specific function called:
+ * 	int board_eth_init(bd_t *bis)
+ */
+
+extern int mcffec_initialize(bd_t*);
+
+int cpu_eth_init(bd_t *bis)
+{
+	return mcffec_initialize(bis);
+}
+#endif
cpu/mcf547x_8x/cpu.c +14 -2
index e29b45c..4a04b7f 100644
@@ -142,11 +142,23 @@ int watchdog_init(void)
 }
 #endif				/* CONFIG_HW_WATCHDOG */
 
-#if defined(CONFIG_FSLDMAFEC)
+#if defined(CONFIG_FSLDMAFEC) || #if defined(CONFIG_MCFFEC)
+/* Default initializations for MCFFEC controllers.  To override,
+ * create a board-specific function called:
+ * 	int board_eth_init(bd_t *bis)
+ */
+
 extern int mcdmafec_initialize(bd_t *bis);
+extern int mcffec_initialize(bd_t*);
 
 int cpu_eth_init(bd_t *bis)
 {
-	return mcdmafec_initialize(bis);
+#if defined(CONFIG_FSLDMAFEC)
+	mcdmafec_initialize(bis);
+#endif
+#if defined(CONFIG_MCFFEC)
+	mcffec_initialize(bis);
+#endif
+	return 0;
 }
 #endif
drivers/net/mcffec.c +1 -1
index 58ed5e3..6e69b46 100644
@@ -599,5 +599,5 @@ int mcffec_initialize(bd_t * bis)
 	/* default speed */
 	bis->bi_ethspeed = 10;
 
-	return 1;
+	return 0;
 }
net/eth.c +0 -4
index 40bbed4..bc74f47 100644
@@ -72,7 +72,6 @@ extern int bfin_EMAC_initialize(bd_t *);
 extern int atstk1000_eth_initialize(bd_t *);
 extern int greth_initialize(bd_t *);
 extern int atngw100_eth_initialize(bd_t *);
-extern int mcffec_initialize(bd_t*);
 extern int at91sam9_eth_initialize(bd_t *);
 
 #ifdef CONFIG_API
@@ -279,9 +278,6 @@ int eth_initialize(bd_t *bis)
 #if defined(CONFIG_ATNGW100)
 	atngw100_eth_initialize(bis);
 #endif
-#if defined(CONFIG_MCFFEC)
-	mcffec_initialize(bis);
-#endif
 #if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
     defined(CONFIG_AT91SAM9263)
 	at91sam9_eth_initialize(bis);
Signature · 1 line
1.5.4.3
#3 lore raw

cover Coldfire Ethernet initialization changes

In reply to Ben Warren

Ben,

I am going to test them and let you know next Tuesday. I was
unable to download the net repo using git protocol at work and the http protocol has index error when I tried to use git-clone.

Thanks for the changes.

Regards,
TsiChung

-----Original Message-----
From: Ben Warren [mailto:biggerbadderben at gmail.com]
Sent: Thursday, July 03, 2008 2:07 AM
To: Liew Tsi Chung; u-boot-users at lists.sourceforge.net
Cc: Ben Warren
Subject: [PATCH 0/2] Coldfire Ethernet initialization changes

These two patches move the default initialization of Coldfire FEC controllers to cpu_eth_init() in the CPU directories.

I don't have a Coldfire cross compiler set up nor do I have any hardware, so I'm looking for volunteers to do the following:

1. Run 'MAKEALL coldfire' to check for compile-time errors 2. Try the code out on real hardware

I'm pushing these patches to a 'testing' branch on the net repo. Please clone it as follows:

$ git clone git://git.denx.de/u-boot-net.git $ cd u-boot-net $ git
checkout testing

thanks!
Ben

author
#4 lore raw

cover Coldfire Ethernet initialization changes

Quoted 7 lines · Liew Tsi Chung

Ben,

I am going to test them and let you know next Tuesday. I was
unable to download the net repo using git protocol at work and the http protocol has index error when I tried to use git-clone.

Wonderful. Thanks!
Ben

#5 lore raw

cover Coldfire Ethernet initialization changes

In reply to Ben Warren

Ben,

Quoted 1 line

I'm pushing these patches to a 'testing' branch on the net repo.

Please clone it as follows:

Quoted 1 line
$ git clone git://git.denx.de/u-boot-net.git $ cd u-boot-net $ git

checkout testing
There is no testing branch in u-boot-net, so I applied the two patches you sent on top of current u-boot-net tree (commit 63676841ca2d603b13765f3f7b72ff1a61c23f90 - Jun 18. Remove duplicate code in cpu/arm926ejs/davinci/lxt972.c).

Only one conflict and error:
The first patch - CONFIG_FSLDMAFEC for 547x_8x and is correct. Then, the second patch - CONFIG_MCFFEC, appended #if after ||, either remove CONFIG_MCFFEC for 547x_8x or remove "#if ".

-#if defined(CONFIG_FSLDMAFEC)
+#if defined(CONFIG_FSLDMAFEC) || #if defined(CONFIG_MCFFEC) +/* Default initializations for MCFFEC controllers. To override,
+ * create a board-specific function called:
+ * int board_eth_init(bd_t *bis)
+ */
+
extern int mcdmafec_initialize(bd_t *bis);
+extern int mcffec_initialize(bd_t*);

Thanks!

Regards,
TsiChung

-----Original Message-----
From: Ben Warren [mailto:biggerbadderben at gmail.com]
Sent: Thursday, July 03, 2008 2:07 AM
To: Liew Tsi Chung; u-boot-users at lists.sourceforge.net
Cc: Ben Warren
Subject: [PATCH 0/2] Coldfire Ethernet initialization changes

These two patches move the default initialization of Coldfire FEC controllers to cpu_eth_init() in the CPU directories.

I don't have a Coldfire cross compiler set up nor do I have any hardware, so I'm looking for volunteers to do the following:

1. Run 'MAKEALL coldfire' to check for compile-time errors 2. Try the code out on real hardware

I'm pushing these patches to a 'testing' branch on the net repo. Please clone it as follows:

$ git clone git://git.denx.de/u-boot-net.git $ cd u-boot-net $ git
checkout testing

thanks!
Ben

author
#6 lore raw

cover Coldfire Ethernet initialization changes

Quoted 7 lines · Liew Tsi Chung

Ben,

Quoted 2 lines

I'm pushing these patches to a 'testing' branch on the net repo.

Please clone it as follows:

Quoted 9 lines
Quoted 2 lines
$ git clone git://git.denx.de/u-boot-net.git $ cd u-boot-net $ git

checkout testing
There is no testing branch in u-boot-net, so I applied the two patches you sent on top of current u-boot-net tree (commit 63676841ca2d603b13765f3f7b72ff1a61c23f90 - Jun 18. Remove duplicate code in cpu/arm926ejs/davinci/lxt972.c).

There is a testing branch in the repo:
http://git.denx.de/?p=u-boot/u-boot-net.git;a=shortlog;h=refs/heads/testing

I just don't know how to use git properly...

Quoted 6 lines

Only one conflict and error:
The first patch - CONFIG_FSLDMAFEC for 547x_8x and is correct. Then, the second patch - CONFIG_MCFFEC, appended #if after ||, either remove CONFIG_MCFFEC for 547x_8x or remove "#if ".

Oh yeah, duh! I need to free up some space on my hard drive so I can have more tools...

Review

Quoted 10 lines
(quoted diff) +7 -1
-#if defined(CONFIG_FSLDMAFEC)
+#if defined(CONFIG_FSLDMAFEC) || #if defined(CONFIG_MCFFEC)
+/* Default initializations for MCFFEC controllers.  To override,
+ * create a board-specific function called:
+ * 	int board_eth_init(bd_t *bis)
+ */
+
 extern int mcdmafec_initialize(bd_t *bis);
+extern int mcffec_initialize(bd_t*);

Does it work after you fix this up?

thanks a lot!
Ben

#7 lore raw

cover Coldfire Ethernet initialization changes

Ben,

Quoted 4 lines
Quoted 4 lines
(quoted diff) +3 -1
-#if defined(CONFIG_FSLDMAFEC)
+#if defined(CONFIG_FSLDMAFEC) || #if defined(CONFIG_MCFFEC)
+/* Default initializations for MCFFEC controllers.  To override,
+ * create a board-specific function called:
Quoted 8 lines

Review

Quoted 6 lines

+ * int board_eth_init(bd_t *bis)
+ */

(quoted diff) +2 -0
+
 extern int mcdmafec_initialize(bd_t *bis);
+extern int mcffec_initialize(bd_t*);

Does it work after you fix this up?

Yes.

Thanks.

Regards,
TsiChung

author
#8 lore raw

cover Coldfire Ethernet initialization changes

Quoted 18 lines · Liew Tsi Chung

Ben,

Quoted 6 lines
Quoted 6 lines
(quoted diff) +5 -1
-#if defined(CONFIG_FSLDMAFEC)
+#if defined(CONFIG_FSLDMAFEC) || #if defined(CONFIG_MCFFEC)
+/* Default initializations for MCFFEC controllers.  To override,
+ * create a board-specific function called:
+ * 	int board_eth_init(bd_t *bis)
+ */
Quoted 9 lines

Review

Quoted 5 lines
(quoted diff) +2 -0
+
 extern int mcdmafec_initialize(bd_t *bis);
+extern int mcffec_initialize(bd_t*);

Does it work after you fix this up?

Quoted 2 lines

Yes.

Great! Thanks for checking it out. I'll update the repo tonight.

regards,
Ben