[PATCH 3/3] ARM: OMAP: early call am33xx_register_ethaddr

y at numalfix.phytec.de y at numalfix.phytec.de
Tue Dec 10 09:30:09 EST 2013


From: Jan Weitzel <j.weitzel at phytec.de>

am33xx_register_ethaddr must be called before cpsw driver start.
Move it from devices_initcall to coredevice_initcall.

Signed-off-by: Jan Weitzel <j.weitzel at phytec.de>
---
 arch/arm/boards/beaglebone/board.c |   12 ++++++++++--
 arch/arm/boards/pcm051/board.c     |   13 +++++++++++--
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boards/beaglebone/board.c b/arch/arm/boards/beaglebone/board.c
index 439c4c2..6445d81 100644
--- a/arch/arm/boards/beaglebone/board.c
+++ b/arch/arm/boards/beaglebone/board.c
@@ -40,6 +40,16 @@
 
 #include "beaglebone.h"
 
+static int beaglebone_coredevice_init(void)
+{
+	if (!of_machine_is_compatible("ti,am335x-bone"))
+		return 0;
+
+	am33xx_register_ethaddr(0, 0);
+	return 0;
+}
+coredevice_initcall(beaglebone_coredevice_init);
+
 static int beaglebone_devices_init(void)
 {
 	int black;
@@ -54,8 +64,6 @@ static int beaglebone_devices_init(void)
 			omap_set_bootmmc_devname("mmc1");
 	}
 
-	am33xx_register_ethaddr(0, 0);
-
 	black = is_beaglebone_black();
 
 	globalvar_add_simple("board.variant", black ? "boneblack" : "bone");
diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c
index 91e8208..60f00bb 100644
--- a/arch/arm/boards/pcm051/board.c
+++ b/arch/arm/boards/pcm051/board.c
@@ -30,6 +30,17 @@
 #include <mach/am33xx-silicon.h>
 #include <mach/bbu.h>
 
+
+static int pcm051_coredevice_init(void)
+{
+	if (!of_machine_is_compatible("phytec,pcm051"))
+		return 0;
+
+	am33xx_register_ethaddr(0, 0);
+	return 0;
+}
+coredevice_initcall(pcm051_coredevice_init);
+
 static struct omap_barebox_part pcm051_barebox_part = {
 	.nand_offset = SZ_512K,
 	.nand_size = SZ_512K,
@@ -42,8 +53,6 @@ static int pcm051_devices_init(void)
 	if (!of_machine_is_compatible("phytec,pcm051"))
 		return 0;
 
-	am33xx_register_ethaddr(0, 0);
-
 	switch (bootsource_get()) {
 	case BOOTSOURCE_SPI:
 		of_device_enable_path("/chosen/environment-spi");
-- 
1.7.0.4




More information about the barebox mailing list