How do I change the MAC address on a system that is base on the SabreSD reference design?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I change the MAC address on a system that is base on the SabreSD reference design?

Jump to solution
3,784 Views
jamespieterick
Contributor IV

Hi All,

I am working on an Android project that is base on the SabreSD reference design. I am having problems finding the procedure for permanently  setting the MAC address on eth0. I need to be able to give each unit a unique MAC address. Thanks.

Labels (2)
0 Kudos
1 Solution
2,037 Views
jamespieterick
Contributor IV

OK, so putting it all together after calculating the requisite indices and deciphering table 5-10 in the reference manual:

If I want to program MAC address 10:98:76:54:32:10 into my i.mx6 Android device I enter the following uboot commands:

imxotp blow --force 23 1098

imxotp blow --force 22 76543210

boot the unit and enter the following command in the debug console:

busybox ifconfig

verify that the HWaddr for eth0 matches the desired MAC address. In this example:

# busybox ifconfig

eth0      Link encap:Ethernet  HWaddr 10:98:76:54:32:10

          inet addr:192.168.2.93  Bcast:192.168.2.255  Mask:255.255.255.0

          inet6 addr: fe80::210:25ff:fe0a:fb9a/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:161 errors:0 dropped:36 overruns:0 frame:0

          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:15836 (15.4 KiB)  TX bytes:1377 (1.3 KiB)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I have tried the above on our board and it worked.

Thanks,

Jim Pieterick

View solution in original post

0 Kudos
5 Replies
2,037 Views
kalyankodamagul
Contributor I

Can some one please help with below q's

Q1 . How to get imxopt tool  and is this tool helps me to make "fixed" the MAC address for below registers

     

 In i.MX 6Solo/6DualLite application processors 

 21B_C620 (Absolute address) -Value of OTP Bank4 Word2 (MAC Address) (OCOTP_MAC0)

 21B_C630(Absolute address)  - Value of OTP Bank4 Word3 (MAC Address) (OCOTP_MAC1)

Q2.  I found two types of MAC's :  HW_OCOTP_MAC0/MAC1  which is in /sys/fsl_otp/HW_OCOTP_MAC0/MAC1 

        above registers are same as  Value of OTP Bank4 Word2/3 (MAC Address) (OCOTP_MAC0/1) ?? 

  if both are same then,then below flashing procedure is correct or not for permanently fixing the MAC address

Say for eg the MAC address to be set is 00:23:a1:47:1b:80

echo 0x00000023 >/sys/fsl_otp/HW_OCOTP_MAC1

echo 0xa1471b80 >/sys/fsl_otp/HW_OCOTP_MAC0

-Thanks,

kalyan.

0 Kudos
2,037 Views
igorpadykov
NXP Employee
NXP Employee

Hi James

mac address is stored in fuses, description can be found in

Table 5-10. Fusemap Descriptions i.MX6DQ Reference Manual (rev.2  7/2014)

http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf

Q&A: How to program i.MX6 eFUSE?

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
2,037 Views
jamespieterick
Contributor IV

Hi Igor,

From "Q&A How to program i.MX6 eFUSE"

--------------------------------

U-Boot contains a tool, imxotp, which is used for fusing.

U-Boot > imxotp

imxotp - One-Time Programable sub-system

Usage:

imxotp imxotp read <index>

- read fuse at 'index'

imxotp blow [--force] <index> <value>

- blow fuse at 'index' with hex value 'value'

Tips: 'addr' to 'index':

convert 'index' from 'address'

index = (addr - otp_base) / 0x10

eg, addr is 0x021bc410, otp_base is 0x021bc400, the index = 1

--------------------------------

I don't understand how to calculate the index. Table 5.10 indicates that the fuse address for the MAC_ADDR[31-0] fuse is "0x620[31:0]" and the address for MAC_ADDR[32:47] is 0x630[15:0]. If I subtract otp_base (0x021bc400) from one of these addresses as the index equation above indicates, I will get a negative number. It looks like the fuse address needs to be added to some offset to get the value needed for the addr parameter in the index equation. What is that offset? otp_base?

Thanks,

Jim Pieterick

0 Kudos
2,037 Views
igorpadykov
NXP Employee
NXP Employee

Hi James

when Table 5.10 indicates that the fuse address for the MAC_ADDR[31-0] fuse is "0x620[31:0]"

this means addr is 0x021bc620

Best regards

igor

0 Kudos
2,038 Views
jamespieterick
Contributor IV

OK, so putting it all together after calculating the requisite indices and deciphering table 5-10 in the reference manual:

If I want to program MAC address 10:98:76:54:32:10 into my i.mx6 Android device I enter the following uboot commands:

imxotp blow --force 23 1098

imxotp blow --force 22 76543210

boot the unit and enter the following command in the debug console:

busybox ifconfig

verify that the HWaddr for eth0 matches the desired MAC address. In this example:

# busybox ifconfig

eth0      Link encap:Ethernet  HWaddr 10:98:76:54:32:10

          inet addr:192.168.2.93  Bcast:192.168.2.255  Mask:255.255.255.0

          inet6 addr: fe80::210:25ff:fe0a:fb9a/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:161 errors:0 dropped:36 overruns:0 frame:0

          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:15836 (15.4 KiB)  TX bytes:1377 (1.3 KiB)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

I have tried the above on our board and it worked.

Thanks,

Jim Pieterick

0 Kudos