MrBool
Posts: 145
Joined: Sat Jul 05, 2014 9:51 am

MAC address and OTP memory

Wed Jun 10, 2015 9:34 am

I noticed that MAC address is partialy taken from serial number.
  • root@raspberrypi:~# cat /proc/cpuinfo
    processor : 0
    model name : ARMv6-compatible processor rev 7 (v6l)
    BogoMIPS : 2.00
    Features : half thumb fastmult vfp edsp java tls
    CPU implementer : 0x41
    CPU architecture: 7
    CPU variant : 0x0
    CPU part : 0xb76
    CPU revision : 7

    Hardware : BCM2708
    Revision : 0011
    Serial : 00000000b86266ab

    root@raspberrypi:~# ifconfig eth0
    eth0 Link encap:Ethernet HWaddr b8:27:eb:62:66:ab
I want to set my MAC number.

Two issues:
1. I see that there is a lot of free space in OTP memory. How can I program OTP memory? Is it possible?
2. How to set MAC based on information stored in OTP? Which part of code do that now?

User avatar
RaTTuS
Posts: 10829
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: MAC address and OTP memory

Wed Jun 10, 2015 9:43 am

where do you see there is a lot of space ?
easy answer no - long answer probably not
don't change the MAC via OTP
you can change it via
ip link set dev interface xx.xx.xx.xx.xx
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
rpdom
Posts: 23367
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: MAC address and OTP memory

Wed Jun 10, 2015 9:45 am

No need to use OTP (I'm not even sure there is space for it). You can change the MAC to whatever you like in cmdline.txt with the smsc95xx.macaddr=aa:bb:cc:dd:ee:ff option, or you could force it with ifconfig

MrBool
Posts: 145
Joined: Sat Jul 05, 2014 9:51 am

Re: MAC address and OTP memory

Wed Jun 10, 2015 9:50 am

RaTTuS wrote:where do you see there is a lot of space ?

Code: Select all

root@raspberrypi:~# vcgencmd otp_dump
08:00000000
09:00000000
10:00000000
11:00000000
12:00000000
13:00000000
14:00000000
15:00000000
16:00280000
17:1020000a
18:1020000a
19:ffffffff
20:ffffffff
21:ffffffff
22:ffffffff
23:ffffffff
24:ffffffff
25:ffffffff
26:ffffffff
27:0000c2c2
28:b86266ab
29:479d9954
30:00000011
31:00000000
32:00000000
33:00000000
34:00000000
35:00000000
36:00000000
37:00000000
38:00000000
39:00000000
40:00000000
41:00000000
42:00000000
43:00000000
44:00000000
45:00000000
46:00000000
47:00000000
48:00000000
49:00000000
50:00000000
51:00000000
52:00000000
53:00000000
54:00000000
55:00000000
56:00000000
57:00000000
58:00000000
59:00000000
60:00000000
61:00000000
62:00000000
63:00000000
64:00000000

MrBool
Posts: 145
Joined: Sat Jul 05, 2014 9:51 am

Re: MAC address and OTP memory

Wed Jun 10, 2015 9:57 am

I know that I can change MAC via cmdline.txt or ip link set but this is not good solution for me. When my customers update system thay always have to change this settings. I want to store MAC in OTP memory because it is independent of system image and customer can't change it (it is also identification number of my products). I use now EEPROM connected to LAN9514. It works fine but easy to change MAC stored in such memory.

User avatar
DougieLawson
Posts: 42852
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: MAC address and OTP memory

Wed Jun 10, 2015 12:17 pm

MrBool wrote:I know that I can change MAC via cmdline.txt or ip link set but this is not good solution for me. When my customers update system thay always have to change this settings. I want to store MAC in OTP memory because it is independent of system image and customer can't change it (it is also identification number of my products). I use now EEPROM connected to LAN9514. It works fine but easy to change MAC stored in such memory.
That's impossible to do because of the closed source GPU code. There's no user API to access any OTP memory.

Looking at /proc/cmdline there's all this stuff passed to the kernel

Code: Select all

dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1366 bcm2708_fb.fbheight=768 bcm2709.boardrev=0xa01041 bcm2709.serial=0x5a67d427 smsc95xx.macaddr=B8:27:EB:67:D4:27 bcm2708_fb.fbswap=1 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000
As long as I don't have root access to the system you can mostly trust those parms as being valid.

If I have root access I can spoof /proc/cpuinfo and /proc/cmdline and can override the MAC address with a ifconfig eth0 hw ether aa:bb:cc:mm:aa:cc command.
Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

Return to “Compute Module”