MAC address is not set during the boot process

  • The MAC address is not set during the boot process -> MAC address is 00:00:00:00:00:00 with the following exception:
    If in UBOOT is a dummy file loaded with the tftpboot command then the correct MAC address during booting is set.
    A work around that works is the following:
    1) In the boot arguments in UBOOT a parameter must be added, for example 'mac_address' with the value 'ethaddr' ( MAC address set by F&S):
    "setenv bootargs console=ttyASC2,38400 ... mac_adress=$(ethaddr)"
    2) After the boot process the parameter mac_address with its value can be found in '/proc/cmdline'
    3) The value of the MAC address can be extracted with 'sed' and regular expressions.
    4) The extracted MAC address then can be set under Linux as follows:
    "ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx" ( the xx are the placeholders for the MAC address )


    I have the following find under FAQ in the UBOOT project, "14.3.11. Ethernet does not work in Linux"


    " Question:
    Ethernet does not work on my board. But everything is fine when I use the ethernet interface in U-Boot (for example by performing a TFTP download). This is a bug in U-Boot, right?


    Answer:
    No. It's a bug in the Linux ethernet driver.


    In some cases the Linux driver fails to set the MAC address. That's a buggy driver then - Linux ethernet drivers are supposed to read the MAC address at startup. On ->open, they are supposed to reprogram the MAC address back into the chip (but not the EEPROM, if any) whether or not the address has been changed.


    In general, a Linux driver shall not make any assumptions about any initialization being done (or not done) by a boot loader; instead, that driver is responsible for performing all of the necessary initialization itself.


    And U-Boot shall not touch any hardware it does not access itself. If you don't use the ethernet interface in U-Boot, it won't be initialized by U-Boot.


    A pretty extensive discussion of this issue can be found in the thread ATAG for MAC address on the ARM Linux mailing list. archive 1 archive 2


    Some current methods for handling the MAC address programming:


    * use custom ATAGs (ARM systems)
    * use a Flattened Device Tree (if your arch/port supports it)
    * parse the U-Boot environment directly
    * pass it via the command line


    If your device driver does not support one of these sources directly, then do it yourself:


    * add an init board hook
    * program it from user space (`ifconfig hw ...`)
    * for people who need to do NFS root or similar, then use initramfs -- this is what it was designed for ! "


    Is there already a patch to solve this problem ?

  • This was already corrected in V0.2. You can download the U-Boot file from our website. However installing can currently only be done from the stepstone bootloader NBoot, not from U-Boot itself. This is how it is done:


    You need a terminal program that is capable of transferring binary files. Connect the PC with COM3 of the PicoMOD6 (this is the upper one of the twin RS232 connector on the Starterkit). Press 's' (lower case S, this is important!) in the terminal window and keep it pressed. The character should repeat. At the same time, power-on the PicoMOD6. Now the boot process will stop in NBoot:


    Code
    1. F&S Nand Loader PC07 built Nov 30 2009 18:32:45
    2. PicoMOD6 Rev. 1.20
    3. 128 MB RAM 2 chips 64 MB FLASH
    4. Please select action
    5. 'd' -> serial download
    6. 'c' -> download eboot.nb0 from SDCard
    7. 'E' -> erase flash
    8. use NetDCUUsbLoader for USB download


    Now press 'd' (lower case D). Then send the U-Boot binary in binary mode to the PicoMOD6. The board should echo dots. Then press 'f' to save the boot loader. You can continue by pressing 'x' to start U-Boot or you can restart the board. The new U-Boot should appear. Here you should enter the network address of the board as the first thing you do.


    Code
    1. setenv ethaddr 00:05:51:xx:xx:xx
    2. saveenv


    The final 6 digits can be found on the 2D-barcode sticker on the PicoMOD6 module.


    That's it.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.