Restoring automatically ethernet MAC addresses

AmigaOne X5000 platform specific issues.
Gregor
Posts: 103
Joined: Thu Sep 08, 2011 10:44 am

Restoring automatically ethernet MAC addresses

Post by Gregor »

Does the following procedure (from http://wiki.amiga.org/index.php?title=AmigaONE_X5000) for restoring automatically ethernet MAC addresses in UBoot work for anyone...?
Restoring the MAC addresses after flashing firmware

To reset your ethernet MAC addresses correctly after a firmware update, perform the following steps:

1. Whilst the animated ball title screen is being played, press the ESC key to display the Early StartUp Control menu

2. Select the Command Line option or press the m shortcut key

3. At the X5000> prompt enter the following (pressing enter after each line):

setenv ethaddr
setenv eth1addr
setenv eth2addr
saveenv
4. Once this is saved, reset the system. This will now force the motherboard to retrieve the correct MAC addresses and record them.
I have tested it with two different UBoot version (dated 2016 and 2018), but the addresses are not automatically restored. The 'ethaddr' variables stay empty, unless they are input manually!

If it works for you, what UBoot version do you have?
User avatar
msalcedo
Beta Tester
Beta Tester
Posts: 107
Joined: Thu Oct 20, 2011 11:55 pm
Location: Sacramento, CA USA

Re: Restoring automatically ethernet MAC addresses

Post by msalcedo »

you missed the addresses in the command

setenv eth1addr xx:xx:xx:xx:xx:x1

some x5000 had the mac address written down on the left rear on the motherboard

maybe you wrote them down before making changes?
Gregor
Posts: 103
Joined: Thu Sep 08, 2011 10:44 am

Re: Restoring automatically ethernet MAC addresses

Post by Gregor »

msalcedo wrote: Thu Jan 30, 2020 10:52 pm you missed the addresses in the command

setenv eth1addr xx:xx:xx:xx:xx:x1

some x5000 had the mac address written down on the left rear on the motherboard

maybe you wrote them down before making changes?
No, I have not 'lost' the addresses of my machine... (Besides, they can be easily checked using the latest MorphOS which now supports the onboard ethernet). I was just wanting to check whether that 'automatic address restoring' really works for anyone. If not, it should be removed from Ami-Wiki. Maybe that was just a planned feature, or working only in some beta-Cyrus+/U-Boot?
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Restoring automatically ethernet MAC addresses

Post by tonyw »

I'm not going to run two threads on the one subject, so I'll assume that you want to discuss it here, not on aw.net.

If you capture the serial debug output of U-Boot, you will see how it prints out its MAC addresses. My version of U-Boot then regenerates the two SD-RAM variables on reboot, as I described before.

My U-Boot says this:
U-Boot 2014.04 (Oct 17 2016 - 08:22:22)
---
Then a few lines down it says:
Build date: 2014/05/30 14:51:05
Eth0: xx:xx:xx:xx:xx:xx
Eth1: xx:xx:xx:xx:xx:xx
---
You can see the dichotomy of dates/versions.

No, I have not seen that System Info screen before. I can see that it also prints out confusing date/version information for U-Boot.

What is "SDVersion" ? The only SDVersion that I know is one that I wrote not long ago (for the X5000 and A1222), but I doubt that it has gotten out into the real world.
Can you type "version full file SDVersion" and post what it says?
cheers
tony
Gregor
Posts: 103
Joined: Thu Sep 08, 2011 10:44 am

Re: Restoring automatically ethernet MAC addresses

Post by Gregor »

tonyw wrote: Fri Jan 31, 2020 11:06 am I'm not going to run two threads on the one subject, so I'll assume that you want to discuss it here, not on aw.net.
Thanks for your answer! Yes, I think this a better forum for this kind of technical considerations...
If you capture the serial debug output of U-Boot, you will see how it prints out its MAC addresses. My version of U-Boot then regenerates the two SD-RAM variables on reboot, as I described before.
Unfortunately I do not have now a null-modem cable, so I cannot check what comes out there. But for some reason that info does not end in my system to be written to the variables...
My U-Boot says this:
U-Boot 2014.04 (Oct 17 2016 - 08:22:22)
---
I also had this 'Oct 17 2016' version originally in my machine but the automatic restoring did not work with it, either. I have a long series of saved variable listings (taken with NVGetVar) and 'ethaddr' and 'eth1haddr' are not present in any them. And there has been hundreds of reboots during that time...

Could there be some other env variable which might have effect on this issue? Or, if you are using a beta-motherboard, could it have somewhat different behaviour from later resale versions...?
Then a few lines down it says:
Build date: 2014/05/30 14:51:05
Eth0: xx:xx:xx:xx:xx:xx
Eth1: xx:xx:xx:xx:xx:xx
---
You can see the dichotomy of dates/versions.

No, I have not seen that System Info screen before. I can see that it also prints out confusing date/version information for U-Boot.
Ok, then this dicotomy seems to be more or less 'normal' for current U-Boot versions...
What is "SDVersion" ? The only SDVersion that I know is one that I wrote not long ago (for the X5000 and A1222), but I doubt that it has gotten out into the real world. Can you type "version full file SDVersion" and post what it says?
I found it from wiki.amiga:
http://wiki.amiga.org/index.php?title=A ... date_Uboot

At the very end of that page there are some downloadable disktools, like:
http://wiki.amiga.org/index.php?title=F ... ersion.zip

This is what 'version' shows:

Code: Select all

7.Sys:> version full file SDVersion
SDVersion 54.1 (21.11.17)
Debug version
Regards,

Gregor
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Restoring automatically ethernet MAC addresses

Post by tonyw »

OK, so that is my SDVersion. No problem, I don't mind it being distributed or used.

The main thing is that SDVersion reads the SD-Card and searches the U-Boot code for a string defining its version (or, at least, what its version looked like when I wrote SDVersion). New versions of U-Boot have been created by MorphOS programmers and I have not seen or tested them all.

That said, the version of U-Boot in my other X5k (the 5040) has one of the later versions of U-Boot (SDVersion says 23-Mar-2018). I just tried it (by clearing the ethaddr and eth1addr settings) and it also regenerates the MAC addresses properly on reboot.

So what is the problem on your machine? I can't think of a hardware setting or env-variable that could prevent it from working. I don't have access to the U-Boot code, so I can't help you debug it.

So, once again, the facts:
If you change the stored values of "ethaddr" and "eth1addr" in the SD-RAM variables (listed by "printenv"), they will appear "changed" in the list when you type "printenv" again.
If you then type "saveenv" while the SD-RAM variables are "wrong", they will be saved wrong (I think, impossible to prove).
It doesn't seem to matter what is already in the "ethaddr/eth1addr" variables, they are *always* rewritten on reboot.

I tried setting "ethaddr" to "00:01:02:03:04:05", listing it to verify the change, then saving it with "saveenv", then listing it again to be sure, then rebooting. The original, correct value reappeared after a reboot.

Silly question: You ARE doing a case reset, aren't you? (Sorry).
cheers
tony
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Restoring automatically ethernet MAC addresses

Post by tonyw »

OK, having proved that the SD-RAM variables are correctly regenerated and visible when you type "printenv" in U-Boot, I booted back into AmigaOS but I didn't check (at the time) the value of "ethaddr" as read by AmigaOS.

Turns out that what AmigaOS reads is not what U-Boot reads. Looking into it now...

(edit: some time later)

OK, here's the story. U-Boot keeps the saved env-vars in the SD-RAM (where AmigaOS can read them). However, any temporary changes you make to the env-vars (without "saveenv") are not saved to the SD card, but are only present in memory, and U-Boot memory is not (yet) visible to AmigaOS (we are working on that one).

So, although U-Boot rewrites the "ethaddr" and "eth1addr" env-vars on boot, it does NOT save them to the SD-Card. Hence, AmigaOS only sees the old, saved versions.

Remedy: go into U-Boot command and simply type "saveenv". You don't have to change anything else. U-Boot will then save the "fixed" MAC addresses to the SD-card where AmigaOS can see them.
cheers
tony
Gregor
Posts: 103
Joined: Thu Sep 08, 2011 10:44 am

Re: Restoring automatically ethernet MAC addresses

Post by Gregor »

tonyw wrote: Sat Feb 01, 2020 12:49 am OK, so that is my SDVersion. No problem, I don't mind it being distributed or used.
Fine!
That said, the version of U-Boot in my other X5k (the 5040) has one of the later versions of U-Boot (SDVersion says 23-Mar-2018). I just tried it (by clearing the ethaddr and eth1addr settings) and it also regenerates the MAC addresses properly on reboot.
The version I have now is "8-Mar-2018", probably close to the one you have.
So what is the problem on your machine? I can't think of a hardware setting or env-variable that could prevent it from working. I don't have access to the U-Boot code, so I can't help you debug it.
As the addresses can also be input manually and saved, it is not a big issue... But it is still worrying, as it suggest there may be some hardware problem on my board.

There used to be on this forum a representat from Varisys... If you read this, could you please comment this issue?
So, once again, the facts:
If you change the stored values of "ethaddr" and "eth1addr" in the SD-RAM variables (listed by "printenv"), they will appear "changed" in the list when you type "printenv" again.
If you then type "saveenv" while the SD-RAM variables are "wrong", they will be saved wrong (I think, impossible to prove).
It doesn't seem to matter what is already in the "ethaddr/eth1addr" variables, they are *always* rewritten on reboot.

I tried setting "ethaddr" to "00:01:02:03:04:05", listing it to verify the change, then saving it with "saveenv", then listing it again to be sure, then rebooting. The original, correct value reappeared after a reboot.
I now tested it the same way, setting a 'fake' address and saved it with 'Saveenv'. The wrong address stays there after reboots, it is not replaced automatically! So, this definitely shows that the autowriting is not working in my machine...
Silly question: You ARE doing a case reset, aren't you?
Yes, I have tried both case reset and power off/on. No difference...

But so far other users has not commented this matter... Could you please test whether this 'autorestoring' works in your X5000? Thank you!
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: Restoring automatically ethernet MAC addresses

Post by tonyw »

So, once again, the facts:
If you change the stored values of "ethaddr" and "eth1addr" in the SD-RAM variables (listed by "printenv"), they will appear "changed" in the list when you type "printenv" again.
If you then type "saveenv" while the SD-RAM variables are "wrong", they will be saved wrong (I think, impossible to prove).
It doesn't seem to matter what is already in the "ethaddr/eth1addr" variables, they are *always* rewritten on reboot.

I tried setting "ethaddr" to "00:01:02:03:04:05", listing it to verify the change, then saving it with "saveenv", then listing it again to be sure, then rebooting. The original, correct value reappeared after a reboot.
I now tested it the same way, setting a 'fake' address and saved it with 'Saveenv'. The wrong address stays there after reboots, it is not replaced automatically! So, this definitely shows that the autowriting is not working in my machine...
You said "The wrong address stays there after reboots". How were you reading it to check? From U-Boot or AmigaOS?

I know this seems childish, but please repeat all the steps you took from the moment you changed the address. Are you sure that after a reboot, U-Boot showed the changed version of the "ethaddr" in the output of the "printenv" command?
cheers
tony
Gregor
Posts: 103
Joined: Thu Sep 08, 2011 10:44 am

Re: Restoring automatically ethernet MAC addresses

Post by Gregor »

tonyw wrote: Sat Feb 01, 2020 11:27 am
You said "The wrong address stays there after reboots". How were you reading it to check? From U-Boot or AmigaOS?
Both. No difference.
I know this seems childish, but please repeat all the steps you took from the moment you changed the address. Are you sure that after a reboot, U-Boot showed the changed version of the "ethaddr" in the output of the "printenv" command?
Absolutely sure! I still did some repeats, by first emptying the register totally (setenv ethaddr - saveenv - env print - reboot - env print) and then input again a fake address (setenv ethaddr 01:02:03:04:05:06 - saveenv - env print - reboot - env print). The same result every time, no restoring... Empty register stays empty, fake register value stays also.
Post Reply