Rock64 mac address ignores boot.txt changes

This is for ARMv8 based devices

Rock64 mac address ignores boot.txt changes

Postby kb4fxc » Fri Aug 21, 2020 3:25 pm

The most recent uboot code for the Rock64 seems to ignore having the ethernet mac address changed. I've tried the
standard method (modify the "setenv macaddr" parameter in /boot/boot.txt and ./mkscr), which has previously always worked.

Is a fix for this issue in the queue?

Thanks!!
kb4fxc
 
Posts: 9
Joined: Mon Apr 28, 2014 5:56 pm

Re: Rock64 mac address ignores boot.txt changes

Postby Kabbone » Fri Aug 21, 2020 4:35 pm

you can try "setenv ethaddr", but normally it shouldn't be possible for eth0, because it's not intended in mainline u-boot.

http://www.denx.de/wiki/view/DULG/UBootEnvVariables
Kabbone
 
Posts: 155
Joined: Thu Jul 25, 2013 9:20 am

Re: Rock64 mac address ignores boot.txt changes

Postby kb4fxc » Fri Aug 21, 2020 5:44 pm

Hi,

I tried "setenv ethaddr" earlier (before my first post) without success.

For now, I added a udev rule to adjust the MAC address....But, that solution could lead to future problems,
if the MAC address changes from the current default, which is: a2:ce:c4:4a:ae:e4....

Thanks!
kb4fxc
 
Posts: 9
Joined: Mon Apr 28, 2014 5:56 pm

Re: Rock64 mac address ignores boot.txt changes

Postby Kabbone » Fri Aug 21, 2020 8:00 pm

$this->bbcode_second_pass_quote('kb4fxc', '
')...
if the MAC address changes from the current default, which is: a2:ce:c4:4a:ae:e4....
...


I don't think this is an default, is it? This should be your regular MAC Address of the device, at least I can tell you, mine is different.
Kabbone
 
Posts: 155
Joined: Thu Jul 25, 2013 9:20 am

Re: Rock64 mac address ignores boot.txt changes

Postby kb4fxc » Fri Aug 21, 2020 9:25 pm

Always in the past, the default MAC address has been da:19:c8:7a:6d:f4 ---the address found in the /boot/boot.txt file.

However, with the most recent installs, the default address on the adapter is different from the boot.txt value. I've tried a v2 and v3 board. Just to make sure I didn't clobber something during testing, I re-downloaded the image files and performed an installation per these instructions, up through step 12...I do have a serial console attached.

https://archlinuxarm.org/platforms/armv ... stallation

Here is what the "virgin" install says---still the same MAC address as before:

[root@alarm ~]# ip link show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether a2:ce:c4:4a:ae:e4 brd ff:ff:ff:ff:ff:ff


Very odd. I'll inspect uboot via the console and see if that MAC string appears to be embedded anywhere.

Thanks!
kb4fxc
 
Posts: 9
Joined: Mon Apr 28, 2014 5:56 pm

Re: Rock64 mac address ignores boot.txt changes

Postby Kabbone » Fri Aug 21, 2020 9:33 pm

the one in boot.txt was hardcoded, wasn't it? It was in there, because the rockchip loader was able to set via the environment variable, but mainline u-boot doesn't support this.

Your v2 and v3 board do have different MAC addresses now, don't they (even with the same sd-card)?
Kabbone
 
Posts: 155
Joined: Thu Jul 25, 2013 9:20 am

Re: Rock64 mac address ignores boot.txt changes

Postby kb4fxc » Fri Aug 21, 2020 9:58 pm

Okay, I tried several v2 (datecode 2017-0713) and v3 (datecode 2019-0626) boards, booting with the same "virgin" flash image.
They all get setup with the exact same a2:ce:c4:4a:ae:e4 MAC address.

I'm guessing perhaps this MAC address is hard-coded in u-boot (or possibly the device tree???) somewhere?

Thanks!
kb4fxc
 
Posts: 9
Joined: Mon Apr 28, 2014 5:56 pm

Re: Rock64 mac address ignores boot.txt changes

Postby kb4fxc » Fri Aug 21, 2020 10:29 pm

Okay, just poked around via the serial console and found that MAC address is hard coded in u-boot:

-----------------------------------------------------------------------------------------------------------------------------------------
U-Boot TPL 2020.07-1 (Aug 18 2020 - 01:45:07)
LPDDR3, 800MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS=1 Die BW=16 Size=1024MB
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2020.07-1 (Aug 18 2020 - 01:45:07 +0000)
Trying to boot from MMC1
NOTICE: BL31: v2.3():
NOTICE: BL31: Built : 01:45:07, Aug 18 2020
NOTICE: BL31:Rockchip release version: v1.2


U-Boot 2020.07-1 (Aug 18 2020 - 01:45:07 +0000) Arch Linux ARM

Model: Pine64 Rock64
DRAM: 1022 MiB
PMIC: RK8050 (on=0x40, off=0x00)
MMC: mmc@ff500000: 1, mmc@ff520000: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In: serial@ff130000
Out: serial@ff130000
Err: serial@ff130000
Model: Pine64 Rock64
Net: eth0: ethernet@ff540000
Hit any key to stop autoboot: 0

=> env print
...lots of parameters...

ethaddr=a2:ce:c4:4a:ae:e4

...lots of parameters...

Environment size: 4030/32764 bytes
=>
kb4fxc
 
Posts: 9
Joined: Mon Apr 28, 2014 5:56 pm

Re: Rock64 mac address ignores boot.txt changes

Postby Kabbone » Sat Aug 22, 2020 8:28 am

Ok, I checked the source code, because I knew it couldn't be really hardcoded.
Like I said before ethaddr can only be set once. If no environment variable ethaddr is set at first boot this gets autogenerated and is not changeable anymore.
I assume you can change it if you zero out the uboot environment space, reflash and set it at/before first boot, but I need to verify that. At first I need to check where the environment variables get stored.
Kabbone
 
Posts: 155
Joined: Thu Jul 25, 2013 9:20 am

Re: Rock64 mac address ignores boot.txt changes

Postby kb4fxc » Sat Aug 22, 2020 9:48 am

This MAC address (a2:ce:c4:4a:ae:e4) seems already pre-set in the download install image---I've tried re-flashing several times and always get the same address. I also tried setting the ethaddr parameter (without success) at various points, including first boot after
flashing the install image.

Also, I noticed this in the u-boot messages. This warning seems to never get resolved, through multiple boot cycles:

Loading Environment from MMC... *** Warning - bad CRC, using default environment

Does this message imply that the default environment is always loading, including the odd ethaddr parameter setting?
I can eliminate this message by saving the environment (saveenv) from the u-boot CLI.

As mentioned above, I also tried setting the ethaddr parameter without success--I tried before and after the saveenv command, at
firstboot, etc.

=> env print ethaddr
ethaddr=a2:ce:c4:4a:ae:e4
=> env set ethaddr 11:22:33:44:55:66
## Error: Can't overwrite "ethaddr"
## Error inserting "ethaddr" variable, errno=1

Thanks!
kb4fxc
 
Posts: 9
Joined: Mon Apr 28, 2014 5:56 pm

Next

Return to ARMv8 Devices

Who is online

Users browsing this forum: No registered users and 5 guests