Right MAC address to PXE boot Arndale board
Hi Xen-devel community!!
I'm new to xen development (not new to Xen ;) ). I'm learning the Xen internals and playing with Xen ARM so bear with me if I say/ask something silly.
I have a Arndale board and following the wiki instructions for PXE boot here:
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Arndale#Booting_via_PXE
I realised that generating a random MAC address won't work because the MAC address is hard-coded in U-Boot binary. The only MAC address that will work is "00:40:5c:26:0a:5b". Obviously if you modify this piece of code:
board/samsung/smdk5250/smdk5250.c +1 -1
@@ -226,7 +226,7 @@ int board_late_init(void) {#ifdef CONFIG_PREBOOT setenv ("preboot" ,CONFIG_PREBOOT ); -setenv ("usbethaddr" ,"00:40:5c:26:0a:5b" ); +//setenv("usbethaddr", "00:40:5c:26:0a:5b"); #endif }#endif
You will be able to use the random MAC generator on that page without any trouble.
I hope this is not something too obvious or too silly :P
Cheers,
Birin
Quoted 6 lines · Birin Sanchez
Hi Xen-devel community!!
I'm new to xen development (not new to Xen ;) ). I'm learning the Xen internals and playing with Xen ARM so bear with me if I say/ask something silly.
Quoted 8 lines
I have a Arndale board and following the wiki instructions for PXE boot here:
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Arndale#Booting_via_PXE
I realised that generating a random MAC address won't work because the MAC address is hard-coded in U-Boot binary. The only MAC address that will work is "00:40:5c:26:0a:5b".
Hardcoding a MAC address in the bootloader seems to me to be obviously wrong in the general case, however CONFIG_PREBOOT says:
- Pre-Boot Commands:
CONFIG_PREBOOT
When this option is #defined, the existence of the environment variable "preboot" will be checked immediately before starting the CONFIG_BOOTDELAY countdown and/or running the auto-boot command resp. entering interactive mode.
This feature is especially useful when "preboot" is automatically generated or modified. For an example see the LWMON board specific code: here "preboot" is modified when the user holds down a certain combination of keys on the (special) keyboard when booting the systems
It sounds to me like this is intended as some sort of "factory provisioning" mode or perhaps as unbrick functionality, but it should only be activated if certain keys are held down. e.g. picking another random board from the u-boot source (board/manroland/mucmc52/mucmc52.c):
#ifdef CONFIG_PREBOOT
struct kbd_data_t kbd_data;
/* Decode keys */
char *str = strdup (key_match (get_keys (&kbd_data)));
/* Set or delete definition */
setenv ("preboot", str);
free (str);
#endif /* CONFIG_PREBOOT */Other boards set it to things like "run gs_slow_boot" iff some button is pressed.
So I think the arndale support in u-boot is simply wrong to unconditionally set preboot=CONFIG_PREBOOT, it supposed to be *conditionally* set to some sort of recovery command.
Likewise it is wrong to hardcode a macaddress if CONFIG_PREBOOT is set.
I notice that mainline u-boot.git[0] doesn't have this code, so I expect it is a Linaro u-boot special. Perhaps Anthony or Julien can recommend where the bug report should go.
[0] git://git.denx.de/u-boot.git
Quoted 1 line
Obviously if you modify this piece of code:
IMHO this change is necessary, but not the whole story...
Quoted 15 lines
board/samsung/smdk5250/smdk5250.c +1
-1@@ -226,7 +226,7 @@ int board_late_init(void) {#ifdef CONFIG_PREBOOT setenv ("preboot" ,CONFIG_PREBOOT ); -setenv ("usbethaddr" ,"00:40:5c:26:0a:5b" ); +//setenv("usbethaddr", "00:40:5c:26:0a:5b"); #endif }#endif
Quoted 4 lines
You will be able to use the random MAC generator on that page without any trouble.
I hope this is not something too obvious or too silly :P
Well, (IMHO at least) it's not *you* which is being silly ;-)
Ian.
Quoted 2 lines · Ian Campbell
Quoted 1 line · Birin Sanchez
Hi Xen-devel community!!
Hi birin,
Quoted 15 lines
Quoted 7 lines
I'm new to xen development (not new to Xen ;) ). I'm learning the Xen internals and playing with Xen ARM so bear with me if I say/ask
something silly.I have a Arndale board and following the wiki instructions for PXE boot here:
Quoted 7 lines
http://wiki.xen.org/wiki/Xen_ARMv7_with_Virtualization_Extensions/Arndale#Booting_via_PXE
MAC address is hard-coded in U-Boot binary. The only MAC address that will work is "00:40:5c:26:0a:5b".
Quoted 8 lines
Likewise it is wrong to hardcode a macaddress if
CONFIG_PREBOOTis set.I notice that mainline u-boot.git[0] doesn't have this code, so I expect it is a Linaro u-boot special. Perhaps Anthony or Julien can recommend where the bug report should go.
[0]
git://git.denx.de/u-boot.git
Thanks for the report. In fact, Linaro has already an updated git with a similar patch.
I think you can use this repository instead of the one on the wiki page. I asked Linaro if it's possible to update the wiki page.
Cheers,
Signature · 1 line
Julien
Quoted 7 lines · Julien Grall
Thanks for the report. In fact, Linaro has already an updated git with a similar patch.
I think you can use this repository instead of the one on the wiki page. I asked Linaro if it's possible to update the wiki page.
Even with that change it seems to me that the implementation of CONFIG_PREBOOT for Arndale in that tree is broken per u-boot's description of CONFIG_PREBOOT.
At the very least it doesn't seem like enabling CONFIG_PREBOOT in your own builds for this board is a good idea...
Ian.