This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to configure the Ethernet MAC address from file system?

Other Parts Discussed in Thread: OMAP-L138

Hi All,

We are using OMAP-L138 and Linux.

As per "http://e2e.ti.com/support/dsp/omap_applications_processors/f/42/t/189985.aspx".

We were unable to set the MAC address. But we solved this problem by modifying source code.

But our requirement is mac address should read from the file system, instead of boot argument command.

we want to put the MAC address in file, instead of using u-boot. this will be useful for production.

so let us know how to probe emac after installing flash system? for example to run the Ethernet driver from rcS script by supplying MAC address using environment variable.

Thanks,

Darshan.

  • Hi Darshan,

    Please try the below command to set MAC address.

    ifconfig eth0 hw ether 00:01:02:03:04:05 up

  • Hi Titusrathinaraj,

    I know this command, but with this command on boot up Board takes the random MAC address or uboot address.

    I want to start the whole Ethernet driver after file system installation.

    Thanks,

    Darshan.

  • Hi Darshan,

    1) Enable the ethernet driver as module and insert (insmod) after filesystem.

    2) Please comment out the "Random ethernet MAC ID generation" in the following mentioned file.

    linux-davinci/drivers/net/ethernet/ti/davinci_emac.c

    #if 0
    	if (!is_valid_ether_addr(priv->mac_addr)) {
    		/* Use random MAC if none passed */
    		random_ether_addr(priv->mac_addr);
    		dev_warn(&pdev->dev, "using random MAC addr: %pM\n",
    							priv->mac_addr);
    	}
    #endif
    

  • Thanks Titusrathinaraj,

    1>

    as I don't know the Ethernet Module name so please let me know the command (specify the command insmod, ). 

    2>

    commenting these lines, we are avoiding the prints and random genration of mac addresse, but installation driver will happen.

    So Please clarify, how to avoid installation Ethernet Driver in the Kernal boot up(emac probe).

    Thanks,

    Darshan.

  • Hi Darshan,

    Build your kernel with ethernet as module and install the modules into filesystem.

    make menuconfig ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

    Device Drivers  --->
    [*] Network device support  --->
    [*]   Ethernet driver support  --->

     

    Select ethernet drivers as a module as given screenshot

    make uImage ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

    make modules ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

    make modules_install INSTALL_MOD_PATH=<filesystem location> ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

    After booting,

    modprobe davinci_emac

    modprobe davinci_mdio

    modprobe davinci_cpdma

    ifconfig eth0 10.100.1.86 up