Skip to contentSkip to conversation

sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases

PATCH New Icenowy Zheng 2 participants 2 messages Oct 27, 2017 Arm/Allwinner sunXi SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases

Sometimes some ethernet aliases do not exist in U-Boot FDT but they exist in the FDT used to boot the system. In this situation setup_environment is called again in ft_board_setup to generate macaddr environment variable for them. However now the call to fdt_fixup_ethernet is moved before the call of ft_board_setup.

Call fdt_fixup_ethernet again to add MAC addresses for the extra ethernet aliases.

---
 board/sunxi/board.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
board/sunxi/board.c +4 -2
index 6e13ee32c1..616a5f77f0 100644
@@ -745,10 +745,12 @@ int ft_board_setup(void *blob, bd_t *bd)
 	int __maybe_unused r;
 
 	/*
-	 * Call setup_environment again in case the boot fdt has
-	 * ethernet aliases the u-boot copy does not have.
+	 * Call setup_environment and fdt_fixup_ethernet again
+	 * in case the boot fdt has ethernet aliases the u-boot
+	 * copy does not have.
 	 */
 	setup_environment(blob);
+	fdt_fixup_ethernet(blob);
 
 #ifdef CONFIG_VIDEO_DT_SIMPLEFB
 	r = sunxi_simplefb_setup(blob);
Signature · 1 line
2.13.6
#1 lore raw

PATCH 1/1 sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases

Quoted 2 lines · Icenowy Zheng

Sometimes some ethernet aliases do not exist in U-Boot FDT but they exist in the FDT used to boot the system.

I'd rather not end up in this situation in the first place. If things get broken, then it might actually be a good symptom that you need to sync the DTs.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171027/7e12570d/attachment.sig>