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 Set OMAPL138 Ethernet Mac Address?

Other Parts Discussed in Thread: OMAPL138, OMAP-L138, DA8XX, PMP

Hi,

Hoe can set OMAPL138 ethernet mac address to be fixed for all next boot ? [...because now the mac address change every boot? ]

During boot process i recieve this messages:

Booting TI User Boot Loader
UBL Version: 1.65
UBL Flashtype: SPI
Starting SPI Memory Copy...
Valid magicnum, 0x55424CBB, found at offset 0x00010000.
DONE
Jumping to entry point at 0xC1080000.


U-Boot 2009.11 (Jan 13 2011 - 01:05:37)

I2C: ready
DRAM: 64 MB
MMC: davinci: 0
In: serial
Out: serial
Err: serial
ARM Clock : 300000000 Hz
DDR Clock : 150000000 Hz
Invalid MAC address read.
Net: Ethernet PHY: GENERIC @ 0x00

Hit any key to stop autoboot: 0
reading uImage

2187060 bytes read
## Booting kernel from Legacy Image at c0700000 ...
Image Name: Arago/2.6.32+2.6.33-rc4-psp03.20
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2186996 Bytes = 2.1 MB
Load Address: c0008000
Entry Point: c0008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Linux version 2.6.33-rc4 (sdk@nemo) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #1 PREEMPT Thu Mar 24 23:27:57 CDT 2011
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: DaVinci DA850/OMAP-L138/AM18xx EVM
Memory policy: ECC disabled, Data cache writeback
DaVinci da850/omap-l138/am18xx variant 0x1
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 24320
Kernel command line: console=ttyS2,115200n8 noinitrd rw mem=32M@0xc0000000 mem=64M@0xc4000000 root=/dev/nfs nfsroot=10.0.0.26:/home/oded/DVSDK_4_02_00_06/OMAPL138/targetfs,nolock ip=dhcp
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 32MB 64MB = 96MB total
Memory: 92704KB available (4164K code, 320K data, 148K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:245
Console: colour dummy device 80x30
Calibrating delay loop... 149.50 BogoMIPS (lpj=747520)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
DaVinci: 144 gpio irqs
regulator: core version 0.5
NET: Registered protocol family 16
da850_evm_init: mmcsd2 registration failed: -1bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
regulator: VDCDC1: 3200 <--> 3300 mV at 3300 mV
regulator: VDCDC2: 1750 <--> 3300 mV at 3300 mV
regulator: VDCDC3: 950 <--> 1375 mV at 1200 mV
regulator: LDO1: 1800 mV
regulator: LDO2: 1150 <--> 1300 mV at 1200 mV
pca953x 1-0020: failed reading register
i2c-gpio i2c-gpio.1: using pins 20 (SDA) and 21 (SCL)
Bluetooth: Core ver 2.15
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Switching to clocksource timer0_1
musb_hdrc: version 6.0, cppi4.1-dma, host, debug=0
Waiting for USB PHY clock good...

musb_hdrc: USB Host mode controller at fee00000 using DMA, IRQ 58
musb_hdrc musb_hdrc: MUSB HDRC host driver
musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
EMAC: MII PHY configured, RMII PHY will not be functional
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 181
io scheduler noop registered (default)
da8xx_lcdc da8xx_lcdc.0: GLCD: Found Sharp_LK043T1DG01 panel
Console: switching to colour frame buffer device 60x34
Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x1c42000 (irq = 25) is a AR7
serial8250.0: ttyS1 at MMIO 0x1d0c000 (irq = 53) is a AR7
serial8250.0: ttyS2 at MMIO 0x1d0d000 (irq = 61) is a AR7
console [ttyS2] enabled
brd: module loaded
ahci ahci: forcing PORTS_IMPL to 0x1
ahci ahci: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
ahci ahci: flags: ncq sntf pm led clo only pmp pio slum part ccc
scsi0 : ahci
ata1: SATA max UDMA/133 irq 67
spi_davinci spi_davinci.1: DaVinci SPI driver in EDMA mode
Using RX channel = 18 , TX channel = 19 and event queue = 1
m25p80 spi1.0: m25p64 (8192 Kbytes)
Creating 4 MTD partitions on "m25p80":
0x000000000000-0x000000040000 : "U-Boot"
0x000000040000-0x000000050000 : "U-Boot Environment"
0x000000050000-0x0000007f0000 : "Linux"

0x0000007f0000-0x000000800000 : "MAC Address"
Read MAC addr from EEPROM: ff:ff:ff:ff:ff:ff
spi_davinci spi_davinci.1: Controller at 0xfef0e000
console [netcon0] enabled
netconsole: network logging started
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci ohci.0: DA8xx OHCI
ohci ohci.0: new USB bus registered, assigned bus number 2
ohci ohci.0: irq 59, io mem 0x01e25000
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
input: TPS6507x Touchscreen as /devices/platform/i2c-gpio.1/i2c-1/1-0048/input/input0
omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0
omap_rtc: RTC power up reset detected
omap_rtc: already running
i2c /dev entries driver
Linux video capture interface: v2.00
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v0.1.0)
watchdog watchdog: heartbeat 60 sec
Bluetooth: HCI UART driver ver 2.2
Bluetooth: HCI H4 protocol initialized
Bluetooth: HCI BCSP protocol initialized
Bluetooth: HCILL protocol initialized
cpuidle: using governor ladder
cpuidle: using governor menu
davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
davinci_mmc davinci_mmc.1: Using DMA, 4-bit mode
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.21.
usbcore: registered new interface driver snd-usb-audio
No device for DAI tlv320aic3x
asoc: tlv320aic3x <-> davinci-i2s mapping ok
ALSA device list:
#0: DA850/OMAP-L138 EVM (tlv320aic3x)
ata1: SATA link down (SStatus 0 SControl 300)
TCP cubic registered
NET: Registered protocol family 17

Bluetooth: L2CAP ver 2.14
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO (Voice Link) ver 0.6
Bluetooth: SCO socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
Clocks: disable unused i2c1
Clocks: disable unused emac
Clocks: disable unused aemif
Clocks: disable unused spi0
Clocks: disable unused mcbsp0
Clocks: disable unused mcbsp1
Clocks: disable unused vpif
Clocks: disable unused ecap0
regulator_init_complete: incomplete constraints, leaving LDO2 on
regulator_init_complete: incomplete constraints, leaving LDO1 on
regulator_init_complete: incomplete constraints, leaving VDCDC3 on
regulator_init_complete: incomplete constraints, leaving VDCDC2 on
regulator_init_complete: incomplete constraints, leaving VDCDC1 on
davinci_emac_probe: using random MAC addr: 3a:1d:50:58:20:28
mmc0: new high speed SDHC card at address b368
mmcblk0: mmc0:b368 USD 3.75 GiB
mmcblk0: p1 p2
emac-mii: probed
omap_rtc omap_rtc: setting system clock to 2011-03-25 01:18:07 UTC (1301015887)
eth0: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=1:00, id=7c0f1)
Sending DHCP requests .
PHY: 1:00 - Link is Up - 100/Full
., OK
IP-Config: Got DHCP answer from 0.0.0.0, my address is 10.0.0.62
IP-Config: Complete:
device=eth0, addr=10.0.0.62, mask=255.255.255.0, gw=10.0.0.138,
host=10.0.0.62, domain=, nis-domain=(none),
bootserver=0.0.0.0, rootserver=10.0.0.26, rootpath=
Looking up port of RPC 100003/2 on 10.0.0.26
Looking up port of RPC 100005/1 on 10.0.0.26
VFS: Mounted root (nfs filesystem) on device 0:13.
Freeing init memory: 148K

INIT: version 2.86 booting
Please wait: booting...
Starting udev
udev: starting version 141
udevd[564]: unable to move watches dir '/dev/.udev/watch', old watches will not be restored: Directory not empty
Remounting root file system...
FAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev mmcblk0.
Caching udev devnodes
Populating dev cacheFAT: bogus number of reserved sectors
VFS: Can't find a valid FAT filesystem on dev mmcblk0p2.
mv: cannot rename '/tmp/devices': No such file or directory
NET: Registered protocol family 10
logger: mount: mount point /proc/bus/usb does not exist
ALSA: Restoring mixer settings...
NOT configuring network interfaces: / is an NFS mount
INIT: Entering runlevel: 5
Starting system message bus: dbus.
Starting Dropbear SSH server: dropbear.
Starting telnet daemon.
Starting syslogd/klogd: done
Starting thttpd.

_____ _____ _ _
| _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
| | _| .'| . | . | | __| _| . | | | -_| _| _|
|__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
|___| |___|

Arago Project http://arago-project.org arago ttyS2

Arago 2011.02 arago ttyS2

arago login: root
root@arago:~#

Thanks, Oded.

 

  • The MAC address must be written to the SPI slash at 07f0000 (the last 64k), in binary.


    You can do this from u-boot, or from the shell prompt if you have the MTD devices enabled in the kernel, e.g.

    flash_eraseall /dev/mtd3

    echo -n '\xXX\xXX\xXX\xXX\xXX\xXX' > /dev/mtd3


    (the 'XX' being your MAC address from the sticker)

  • Hi,

    Refer this link http://processors.wiki.ti.com/index.php/GSG:_OMAP-L138_DVEVM_Additional_Procedures#Restoring_MAC_address_on_SPI_Flash

    for setting the MAC address at U-boot prompt.

    Thx,

    --Prabhakar Lad

    http://in.linkedin.com/pub/prabhakar-lad/19/92b/955

  • Hi,

    I was try to do what  you wrote and i was not success.

    First, this is results of  "ls /dev" command:

    root@arago:~# ls /dev
    block rtc tty46
    bus rtc0 tty47
    char shm tty48
    console snd tty49
    cpu_dma_latency tty tty5
    disk tty0 tty50
    fb tty1 tty51
    fb0 tty10 tty52
    full tty11 tty53
    i2c-1 tty12 tty54
    initctl tty13 tty55
    input tty14 tty56
    kmem tty15 tty57
    kmsg tty16 tty58
    log tty17 tty59
    mem tty18 tty6
    mmcblk0 tty19 tty60
    mmcblk0p1 tty2 tty61
    mmcblk0p2 tty20 tty62
    mtd0 tty21 tty63
    mtd0ro tty22 tty7
    mtd1 tty23 tty8
    mtd1ro tty24 tty9
    mtd2 tty25 ttyS0
    mtd2ro tty26 ttyS1
    mtd3 tty27 ttyS2
    mtd3ro tty28 ttyp0
    mtdblock0 tty29 ttyp1
    mtdblock1 tty3 ttyp2
    mtdblock2 tty30 ttyp3
    mtdblock3 tty31 ttyp4
    network_latency tty32 ttyp5
    network_throughput tty33 ttyp6
    null tty34 ttyp7
    ptmx tty35 udev_network_queue
    pts tty36 urandom
    ptyp0 tty37 vcs
    ptyp1 tty38 vcs1
    ptyp2 tty39 vcs2
    ptyp3 tty4 vcsa
    ptyp4 tty40 vcsa1
    ptyp5 tty41 vcsa2
    ptyp6 tty42 watchdog

    ptyp7 tty43 zero
    ram0 tty44
    random tty45

    Second, this is result of  "cat /proc/mtd" command:

    root@arago:~# cat /proc/mtd

    dev: size erasesize name
    mtd0: 00040000 00010000 "U-Boot"
    mtd1: 00010000 00010000 "U-Boot Environment"
    mtd2: 007a0000 00010000 "Linux"
    mtd3: 00010000 00010000 "MAC Address"

    Now, when i try to operate  "flash_eraseall /dev/mtd3" command, i recieve that message:

    root@arago:~# flash_eraseall /dev/mtd3
    flash_eraseall: /dev/mtd3: Permission denied

    When i try to operate  "echo -n '\xXX\xXX\xXX\xXX\xXX\xXX' > /dev/mtd3" command, i recieve that message:

    root@arago:~# echo -n '\xXX\xXX\xXX\xXX\xXX\xXX' > /dev/mtd3
    -sh: can't create /dev/mtd3: Permission denied

    When i operate  "flash_eraseall /dev/mtd3" command from u-boot , i recieve that message:

    Booting TI User Boot Loader
    UBL Version: 1.65
    UBL Flashtype: SPI
    Starting SPI Memory Copy...
    Valid magicnum, 0x55424CBB, found at offset 0x00010000.
    DONE
    Jumping to entry point at 0xC1080000.


    U-Boot 2009.11 (Jan 13 2011 - 01:05:37)

    I2C: ready
    DRAM: 64 MB
    MMC: davinci: 0
    In: serial
    Out: serial
    Err: serial
    ARM Clock : 300000000 Hz
    DDR Clock : 150000000 Hz
    Invalid MAC address read.
    Net: Ethernet PHY: GENERIC @ 0x00

    Hit any key to stop autoboot: 0
    U-Boot > flash_eraseall /dev/mtd3
    Unknown command 'flash_eraseall' - try 'help'

    When i try to operate  "echo -n '\xXX\xXX\xXX\xXX\xXX\xXX' > /dev/mtd3" command  from u-boot  , i recieve that message:

    U-Boot > echo -n '\x01\x01\x01\x01\x01\x01' > /dev/mtd3
    -ececho -n x01x01x01x01x01x01 > /dev/mtd3

    But this Mac Address is not save in  memory and when i boot OMAP i still recieve invalid Mac Address.

    So what is the problem?

    What i can do to solve this problem and make my Mac Address to be fix?

    Thanks, Oded. 

  • Hi,

    Please perform following steps,

    1:Modify the DDR content at address c0000000. MAC address is printed on a sticker pasted on SoC module of EVM.

    U-Boot> mm.b c0000000
    c0000000: fb ? 00
    c0000001: ef ? 08
    c0000002: fd ? ee
    c0000003: df ? 03
    c0000004: ff ? 6a
    c0000005: ff ? c4
    c0000006: bf ? q
    

    2:Make sure that modification is correct:

    U-Boot> md.b c0000000
    c0000000: 00 08 ee 03 6a c4 bf ff f3 fd fb ff fe fd bf ef    ....j...........
    c0000010: ff ff fb fd 3f fd ff ff bb df 7f fd f7 ff 77 ff    ....?.........w.
    c0000020: 7f ee f7 fd 3f fd fb fd ed ef bf ce 77 bf fb ff    ....?.......w...
    c0000030: 6f bc b7 fe ff de fd ff 7b fd ff ff b7 fd ff ff    o.......{.......
    

    3: Initialize SPI flash from u-boot.

    U-Boot> sf probe 0
    

    4: Write the MAC address from DDR to SPI flash:

    U-Boot> sf write c0000000 7f0000 6
    

    5: Reset the EVM. U-Boot/Kernel should read the MAC address which was written to the flash.

    Thx,

    --Prabhakar Lad

  • In order from the "user mode" change to work, your kernel needs to allow "write" access to the MTD device. This requires patching the partition table in the kernel. The "flash_eraseall" command is part of busybox (i'm using 1.18.5) and you'll need to menuconfig that applet into it.

    I guess it's easier to use the u-boot method in your case, since you'll only need to do this once.

  • Hello, 

    I have LCDK Omap L138 and I got this:

    U-Boot > md.b c0000000
    c0000000: 2e c9 81 78 73 16 ff ff ff ff ff ff ff ff ff ff ...xs...........
    c0000010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    c0000020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    c0000030: 7f ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    U-Boot > sf probe 0
    Unknown command 'sf' - try 'help'
    U-Boot > sf write c0000000 7f0000 6
    Unknown command 'sf' - try 'help'

  • I have LCDK Omap L138 and I got this:

    U-Boot > md.b c0000000
    c0000000: 2e c9 81 78 73 16 ff ff ff ff ff ff ff ff ff ff ...xs...........
    c0000010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    c0000020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    c0000030: 7f ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    U-Boot > sf probe 0
    Unknown command 'sf' - try 'help'
    U-Boot > sf write c0000000 7f0000 6
    Unknown command 'sf' - try 'help'

    Looks like, you are trying this in other boot mode ie. not SPI boot mode rite ?

    You need to use uboot which is build enabling CONFIG_USE_SPI and flash it in

    SPI. The above commands which you tried are SPI commands, flashing a SPI enabled image 

    should solve your issue.

    Regards,

    --Prabhakar Lad

  • Hi,

    I am struggling with the same problem on the TI OMAPL138 LCDK.

    This board uses NAND instead of SPI FLASH in uboot. I am wondering how I can change the 'ethaddr' environment variable. EVERY LCDK board we have boots with:

    ethact=DaVinci-EMAC
    ethaddr=00:00:a0:00:fb:c7

    I tried setting it:

    U-Boot > setenv ethaddr 08:00:28:32:51:27
    Can't overwrite "ethaddr"
    U-Boot > env set ethaddr 08:00:28:32:51:27
    Can't overwrite "ethaddr"
    U-Boot > env set -f ethaddr 08:00:28:32:51:27
    U-Boot > env print ethaddr
    ethaddr=00:00:a0:00:fb:c7
    

    Of course I do not have the sf probe commands as I am using NAND, I have nand read and nand write however I do not know at what address the drivers are reading the mac

    '08:00:28:32:51:27'

    From. 

    Thanks

    I also found this which concerned me:

    static int get_mac_addr(u8 *addr)
    {
    /* Need to find a way to get MAC ADDRESS */
    return 0;
    }




  • Hi Evan,

    You can change the MAC address.
    Have you changed the u-boot board config file (*.h) ?

    common/cmd_nvedit.c
    Try to use/append the following config in u-boot board file.

    include/configs/omapl138_lcdk.h

    #define CONFIG_ENV_OVERWRITE