public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andre Heider <a.heider@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/4] sunxi: board: Use eth_env_set_enetaddr_by_index()
Date: Tue, 26 Nov 2019 13:12:58 +0100	[thread overview]
Message-ID: <420df73b-c49f-bbfd-d1c4-7be2bf834a2c@gmail.com> (raw)
In-Reply-To: <20191126102241.gfbosmfsvmgxwu5p@core.my.home>

On 26/11/2019 11:22, Ondřej Jirman wrote:
> Hello,
> 
> On Tue, Nov 26, 2019 at 09:15:59AM +0100, Andre Heider wrote:
>> That helper takes care of assembling the correct name and doesn't allow
>> overwriting existing env vars, so drop the checks here.
>>
>> Signed-off-by: Andre Heider <a.heider@gmail.com>
>> ---
>>   board/sunxi/board.c | 10 +---------
>>   1 file changed, 1 insertion(+), 9 deletions(-)
>>
>> diff --git a/board/sunxi/board.c b/board/sunxi/board.c
>> index e3b2d13892..bb35d6b66e 100644
>> --- a/board/sunxi/board.c
>> +++ b/board/sunxi/board.c
>> @@ -807,14 +807,6 @@ static void setup_environment(const void *fdt)
>>   			if (!fdt_get_alias(fdt, ethaddr))
>>   				continue;
>>   
>> -			if (i == 0)
>> -				strcpy(ethaddr, "ethaddr");
>> -			else
>> -				sprintf(ethaddr, "eth%daddr", i);
>> -
>> -			if (env_get(ethaddr))
>> -				continue;
>> -
>>   			/* Non OUI / registered MAC address */
>>   			mac_addr[0] = (i << 4) | 0x02;
>>   			mac_addr[1] = (sid[0] >>  0) & 0xff;
>> @@ -823,7 +815,7 @@ static void setup_environment(const void *fdt)
>>   			mac_addr[4] = (sid[3] >>  8) & 0xff;
>>   			mac_addr[5] = (sid[3] >>  0) & 0xff;
>>   
>> -			eth_env_set_enetaddr(ethaddr, mac_addr);
>> +			eth_env_set_enetaddr_by_index("eth", i, mac_addr);
> 
> This breaks the build with CONFIG_NET disabled in u-boot, since
> eth_env_set_enetaddr_by_index is only available in net/.
> 
> arm-linux-musleabihf-ld.bfd: board/sunxi/built-in.o: in function `setup_environment':
> board/sunxi/board.c:835: undefined reference to `eth_env_set_enetaddr_by_index'
> 
> See this thread for more info:
>    https://www.mail-archive.com/u-boot at lists.denx.de/msg340785.html
>   
> Use of eth_env_set_enetaddr is temporarily broken on master too, because this
> is still waiting to be merged:
> 
>    https://www.mail-archive.com/u-boot at lists.denx.de/msg340882.html

Ok, I'll drop the patch then, it was just a possible cleanup I stumbled 
upon anyway.

I applied the patch you linked to and it indeed fixes the build with 
CONFIG_NET=n.

Thanks,
Andre

  reply	other threads:[~2019-11-26 12:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26  8:15 [U-Boot] [PATCH v2 0/4] arm64: dts: sun50i: Add support for Orange Pi 3 Andre Heider
2019-11-26  8:15 ` [U-Boot] [PATCH v2 1/4] sunxi: board: Use eth_env_set_enetaddr_by_index() Andre Heider
2019-11-26 10:22   ` Ondřej Jirman
2019-11-26 12:12     ` Andre Heider [this message]
2019-11-26  8:16 ` [U-Boot] [PATCH v2 2/4] arm: sunxi: add a config option to fixup a Bluetooth address Andre Heider
2019-11-26 10:46   ` Ondřej Jirman
2019-11-26 10:50     ` Ondřej Jirman
2019-11-26 12:15     ` Andre Heider
2019-11-26 12:40       ` Ondřej Jirman
2019-11-26 14:08         ` Andre Heider
2019-11-26  8:16 ` [U-Boot] [PATCH v2 3/4] arm64: dts: sync Allwinner H6 files Andre Heider
2019-11-26  8:16 ` [U-Boot] [PATCH v2 4/4] arm64: dts: sun50i: Add support for Orange Pi 3 Andre Heider

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=420df73b-c49f-bbfd-d1c4-7be2bf834a2c@gmail.com \
    --to=a.heider@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox