Skip to contentSkip to conversation

powerpc/boot: cuboot: Fix up ethernet3 MAC address on MPC85xx

PATCH In review Nate Case 2 participants 5 messages Jun 8, 2009 – Jun 11, 2009 PowerPC

lore
Share & tools
lore

Nate Case

author
#0 lore raw

PATCH 1/1 powerpc/boot: cuboot: Fix up ethernet3 MAC address on MPC85xx

MPC85xx platforms do support 4 ethernet ports, so make sure the boot wrapper fixes up all of them in the fdt.

---
 arch/powerpc/boot/cuboot-85xx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/powerpc/boot/cuboot-85xx.c +2 -0
index 6776a1a..277ba4a 100644
@@ -15,6 +15,7 @@
 #include "cuboot.h"
 
 #define TARGET_85xx
+#define TARGET_HAS_ETH3
 #include "ppcboot.h"
 
 static bd_t bd;
@@ -27,6 +28,7 @@ static void platform_fixups(void)
 	dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
 	dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
 	dt_fixup_mac_address_by_alias("ethernet2", bd.bi_enet2addr);
+	dt_fixup_mac_address_by_alias("ethernet3", bd.bi_enet3addr);
 	dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 8, bd.bi_busfreq);
 
 	/* Unfortunately, the specific model number is encoded in the
Signature · 1 line
1.6.0.2
#1 lore raw
Quoted 13 lines · Nate Case

MPC85xx platforms do support 4 ethernet ports, so make sure the boot wrapper fixes up all of them in the fdt.

---
arch/powerpc/boot/cuboot-85xx.c | 2 ++

1 files changed, 2 insertions(+), 0 deletions(-)
arch/powerpc/boot/cuboot-85xx.c +0 -0
index 6776a1a..277ba4a 100644

arch/powerpc/boot/cuboot-85xx.c line 18

Quoted 4 lines
arch/powerpc/boot/cuboot-85xx.c +1 -0
@@ -15,6 +15,7 @@
 #include "cuboot.h"
 
 #define TARGET_85xx
+#define TARGET_HAS_ETH3

This is problematic in that we'd be changing the memory layout of the bd_t and not ALL 85xx's have HAS_ETH3 set.

- k

#2 lore raw
Quoted 5 lines · Kumar Gala
Quoted 2 lines

#define TARGET_85xx
+#define TARGET_HAS_ETH3

This is problematic in that we'd be changing the memory layout of the bd_t and not ALL 85xx's have HAS_ETH3 set.

It shouldn't be problematic. The bi_enet3addr field is at the end of the structure on MPC85xx. The only fields after it in ppcboot.h are 4xx-specific
fields. I believe the MAC addresses were placed at the end of the struct for
this very reason.

Signature · 1 line
Nate Case <[email protected]>
#3 lore raw
Quoted 9 lines · Nathaniel Case

On Wed, 10 Jun 2009 21:54:01 -0500, Kumar Gala <[email protected]

Quoted 1 line
Quoted 5 lines · wrote:
Quoted 2 lines

#define TARGET_85xx
+#define TARGET_HAS_ETH3

This is problematic in that we'd be changing the memory layout of the bd_t and not ALL 85xx's have HAS_ETH3 set.

Quoted 6 lines

It shouldn't be problematic. The bi_enet3addr field is at the end of the structure on MPC85xx. The only fields after it in ppcboot.h are 4xx-specific
fields. I believe the MAC addresses were placed at the end of the struct for
this very reason.

ahh, good point... I'll add this detail to the commit message when I commit this.

- k

#4 lore raw
In reply to Nate Case
Quoted 7 lines · Nate Case

MPC85xx platforms do support 4 ethernet ports, so make sure the boot wrapper fixes up all of them in the fdt.

---
arch/powerpc/boot/cuboot-85xx.c | 2 ++

1 files changed, 2 insertions(+), 0 deletions(-)

applied (updated commit message) to next

- k