u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH] sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases
@ 2021-09-11 17:39 Jernej Skrabec
  2021-12-07  6:24 ` Jagan Teki
  2022-01-17  1:35 ` Andre Przywara
  0 siblings, 2 replies; 3+ messages in thread
From: Jernej Skrabec @ 2021-09-11 17:39 UTC (permalink / raw)
  To: jagan, andre.przywara
  Cc: mripard, u-boot, linux-sunxi, Icenowy Zheng, Jernej Skrabec

From: Icenowy Zheng <icenowy@aosc.io>

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.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
[updated commit message]
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---

Hi all,

this is effectively resend of:
https://patchwork.ozlabs.org/project/uboot/patch/20171027093439.12414-1-icenowy@aosc.io/

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(-)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 1a46100e408d..97554d4642ed 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -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);
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases
  2021-09-11 17:39 [PATCH] sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases Jernej Skrabec
@ 2021-12-07  6:24 ` Jagan Teki
  2022-01-17  1:35 ` Andre Przywara
  1 sibling, 0 replies; 3+ messages in thread
From: Jagan Teki @ 2021-12-07  6:24 UTC (permalink / raw)
  To: Jernej Skrabec
  Cc: andre.przywara, mripard, u-boot, linux-sunxi, Icenowy Zheng

On Sat, Sep 11, 2021 at 11:09 PM Jernej Skrabec
<jernej.skrabec@gmail.com> wrote:
>
> From: Icenowy Zheng <icenowy@aosc.io>
>
> 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.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> [updated commit message]
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> ---
>
> Hi all,
>
> this is effectively resend of:
> https://patchwork.ozlabs.org/project/uboot/patch/20171027093439.12414-1-icenowy@aosc.io/
>
> 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(-)
>
> diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> index 1a46100e408d..97554d4642ed 100644
> --- a/board/sunxi/board.c
> +++ b/board/sunxi/board.c
> @@ -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);

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases
  2021-09-11 17:39 [PATCH] sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases Jernej Skrabec
  2021-12-07  6:24 ` Jagan Teki
@ 2022-01-17  1:35 ` Andre Przywara
  1 sibling, 0 replies; 3+ messages in thread
From: Andre Przywara @ 2022-01-17  1:35 UTC (permalink / raw)
  To: Jernej Skrabec; +Cc: jagan, mripard, u-boot, linux-sunxi, Icenowy Zheng

On Sat, 11 Sep 2021 19:39:16 +0200
Jernej Skrabec <jernej.skrabec@gmail.com> wrote:

> From: Icenowy Zheng <icenowy@aosc.io>
> 
> 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.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> [updated commit message]
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> ---
> 
> Hi all,
> 
> this is effectively resend of:
> https://patchwork.ozlabs.org/project/uboot/patch/20171027093439.12414-1-icenowy@aosc.io/
> 
> 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

Applied to sunxi/master.

Thanks,
Andre

> 
>  board/sunxi/board.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> index 1a46100e408d..97554d4642ed 100644
> --- a/board/sunxi/board.c
> +++ b/board/sunxi/board.c
> @@ -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);
>  


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-17  1:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-11 17:39 [PATCH] sunxi: call fdt_fixup_ethernet again to set macaddr for more aliases Jernej Skrabec
2021-12-07  6:24 ` Jagan Teki
2022-01-17  1:35 ` Andre Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).