Skip to contentSkip to conversation

sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases

PATCH Applied Jernej Skrabec 3 participants 3 messages Sep 11, 2021 – Jan 17, 2022 Arm/Allwinner sunXi SoC support

lore
Share & tools
lore

Jernej Skrabec

author maintainer
#0 lore raw

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

From: Icenowy Zheng <[email protected]>

Sometimes some ethernet aliases do not exist in U-Boot DT but they exist in the DT used to boot the system (for example, modified via DT overlays). 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.

[updated commit message]

---

Hi all,

this is effectively resend of:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

On at least one board, namely BananaPi M2 Zero, adding ethernet connector is pretty popular after market modification. Since this is not something that is already present on the board, ethernet node will never be part of upstream DT. Thus, the only sensible solution is to use DT overlay, which adds node to DT (maintaining patches is tedious). However, when overlays are used, U-Boot misses injecting MAC address, as described in commit message.

Please reconsider this patch for inclusion in upstream.

Best regards,
Jernej

 board/sunxi/board.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
board/sunxi/board.c +4 -2
index 1a46100e408d..97554d4642ed 100644
@@ -997,10 +997,12 @@ int ft_board_setup(void *blob, struct bd_info *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);
 
 	bluetooth_dt_fixup(blob);
 
Signature · 1 line
2.33.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 44 lines · Jernej Skrabec

From: Icenowy Zheng <[email protected]>

Sometimes some ethernet aliases do not exist in U-Boot DT but they exist in the DT used to boot the system (for example, modified via DT overlays). 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.

[updated commit message]

---

Hi all,

this is effectively resend of:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

On at least one board, namely BananaPi M2 Zero, adding ethernet connector is pretty popular after market modification. Since this is not something that is already present on the board, ethernet node will never be part of upstream DT. Thus, the only sensible solution is to use DT overlay, which adds node to DT (maintaining patches is tedious). However, when overlays are used, U-Boot misses injecting MAC address, as described in commit message.

Please reconsider this patch for inclusion in upstream.

Best regards,
Jernej

 board/sunxi/board.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
board/sunxi/board.c +0 -0
index 1a46100e408d..97554d4642ed 100644
@@ -997,10 +997,12 @@ int ft_board_setup(void *blob, struct bd_info *bd)
        int __maybe_unused r;

board/sunxi/board.c int ft_board_setup(void *blob, struct bd_info *bd) · line 1005

Quoted 10 lines
board/sunxi/board.c +4 -2
 
        /*
-        * 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);
#2 lore raw
In reply to Jernej Skrabec
Quoted 29 lines · On Sat, 11 Sep 2021 19:39:16 +0200 Jernej Skrabec <[email protected]>…

From: Icenowy Zheng <[email protected]>

Sometimes some ethernet aliases do not exist in U-Boot DT but they exist in the DT used to boot the system (for example, modified via DT overlays). 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.

[updated commit message]

---

Hi all,

this is effectively resend of:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

On at least one board, namely BananaPi M2 Zero, adding ethernet connector is pretty popular after market modification. Since this is not something that is already present on the board, ethernet node will never be part of upstream DT. Thus, the only sensible solution is to use DT overlay, which adds node to DT (maintaining patches is tedious). However, when overlays are used, U-Boot misses injecting MAC address, as described in commit message.

Quoted 4 lines

Please reconsider this patch for inclusion in upstream.

Best regards,
Jernej

Applied to sunxi/master.

Thanks,
Andre

Quoted 23 lines
 board/sunxi/board.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
board/sunxi/board.c +4 -2
index 1a46100e408d..97554d4642ed 100644
@@ -997,10 +997,12 @@ int ft_board_setup(void *blob, struct bd_info *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);
 
 	bluetooth_dt_fixup(blob);