Setting MAC Address from EEPROM

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

Setting MAC Address from EEPROM

Jump to solution
5,830 Views
yensid
Contributor III

Hi,

I have a P1010RDB and a similar custom PCB board.  I would like to have an EEPROM (AT24C01 on I2C2) programmed with a MAC address and then have U-Boot program that MAC address into the environment.  It appears this is already supported on the RDB, with some additional info on the EEPROM, but it is not working for me on the RDB. I'm currently using SDK v1.5.  When the system boots U-boot shows "EEPROM: Read failed.".  I did have to add "#define CONFIG_P1010RDB_PA" for this version of U-Boot to work on the RDB.

Is the EEPROM initially not programed on the RDB?  Any assistance is appreciated, and if I missed some documentation please guide me to it. Thanks.

U-Boot 2013.01QorIQ-SDK-V1.5 (Aug 27 2014 - 15:42:34)

CPU:   P1010E, Version: 1.0, (0x80f90010)

Core:  E500, Version: 5.1, (0x80212151)

Clock Configuration:

       CPU0:800  MHz,

       CCB:400  MHz,

       DDR:333.333 MHz (666.667 MT/s data rate) (Asynchronous), IFC:100  MHz

L1:    D-cache 32 kB enabled

       I-cache 32 kB enabled

Board: P1010RDB-PA, PCB: v2.0

I2C:   ready

SPI:   ready

DRAM:  Detected UDIMM

1 GiB (DDR3, 32-bit, CL=5, ECC off)

Flash: 32 MiB

L2:    256 KB already enabled

NAND:  32 MiB

MMC:  FSL_SDHC: 0

EEPROM: Read failed.

PCIe1: Root Complex of mini PCIe Slot, no link, regs @ 0xffe0a000

PCIe1: Bus 00 - 00

PCIe2: Root Complex of mini PCIe Slot, no link, regs @ 0xffe09000

PCIe2: Bus 01 - 01

In:    serial

Out:   serial

Err:   serial

Net:   eTSEC1 [PRIME], eTSEC2, eTSEC3

Hit any key to stop autoboot:  0

Labels (1)
0 Kudos
1 Solution
2,695 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello yensid,

For P1010RDB-PB board there are 3 kinds of EEPROMs

  1. SPD EEPROM(I2C2 ADDRESS:"1010,A2,A1,X" = 52H & 53H)

This EEPROM is I2C Board 128x8 bit memory, this EEPROM can be used for board identification, and different values.

  2. BOOT I2C1 EEPROM (I2C1 ADDRESS:"1010,A2,A1,A0" = 50H)

This is boot sequencer EEPROM.

3.System Config EEPROM(I2C1 ADDRESS:"1010,A2,A1,A0" = 57H)

Please note There is no "System Config EEPROM" on P1010RDB-PA.

Please refer to the following definition in include/configs/P1010RDB.h, there is no similar definition for P1010RDB-PA.

/* I2C EEPROM */

#if defined(CONFIG_P1010RDB_PB)

#define CONFIG_ID_EEPROM

#ifdef CONFIG_ID_EEPROM

#define CONFIG_SYS_I2C_EEPROM_NXID

#endif

#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  1

#define CONFIG_SYS_I2C_EEPROM_ADDR      0x57

#define CONFIG_SYS_EEPROM_BUS_NUM      0

#define MAX_NUM_PORTS                  9 /* for 128Bytes EEPROM */

#endif

Please also refer to the source file board/freescale/common/sys_eeprom.c.

In the function read_eeprom,

ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, CONFIG_SYS_I2C_EEPROM_ADDR_LEN,

                (void *)&e, sizeof(e));

The above is the reason why the error "EEPROM: Read failed" is got in u-boot.

So please modify U-BOOT source code to use the appropriate part of I2C EEPROM.

If further discussion is needed, please feel free to let me know.


Have a great day,
Yiping

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

View solution in original post

0 Kudos
3 Replies
2,695 Views
lunminliang
NXP Employee
NXP Employee

P1010RDB-PA is not in the supported boards list of SDK reference manual of SDK1.5, only P1010RDB-PB.

Also I found below sentence for 0x52 in U-boot P1010RDB.h of SDK1.5

#define SPD_EEPROM_ADDRESS   0x52
2,696 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello yensid,

For P1010RDB-PB board there are 3 kinds of EEPROMs

  1. SPD EEPROM(I2C2 ADDRESS:"1010,A2,A1,X" = 52H & 53H)

This EEPROM is I2C Board 128x8 bit memory, this EEPROM can be used for board identification, and different values.

  2. BOOT I2C1 EEPROM (I2C1 ADDRESS:"1010,A2,A1,A0" = 50H)

This is boot sequencer EEPROM.

3.System Config EEPROM(I2C1 ADDRESS:"1010,A2,A1,A0" = 57H)

Please note There is no "System Config EEPROM" on P1010RDB-PA.

Please refer to the following definition in include/configs/P1010RDB.h, there is no similar definition for P1010RDB-PA.

/* I2C EEPROM */

#if defined(CONFIG_P1010RDB_PB)

#define CONFIG_ID_EEPROM

#ifdef CONFIG_ID_EEPROM

#define CONFIG_SYS_I2C_EEPROM_NXID

#endif

#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  1

#define CONFIG_SYS_I2C_EEPROM_ADDR      0x57

#define CONFIG_SYS_EEPROM_BUS_NUM      0

#define MAX_NUM_PORTS                  9 /* for 128Bytes EEPROM */

#endif

Please also refer to the source file board/freescale/common/sys_eeprom.c.

In the function read_eeprom,

ret = i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, CONFIG_SYS_I2C_EEPROM_ADDR_LEN,

                (void *)&e, sizeof(e));

The above is the reason why the error "EEPROM: Read failed" is got in u-boot.

So please modify U-BOOT source code to use the appropriate part of I2C EEPROM.

If further discussion is needed, please feel free to let me know.


Have a great day,
Yiping

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

0 Kudos
2,695 Views
amittomar
NXP Employee
NXP Employee

Hello Yensid,

I'm not sure did get your question well,but if you simply would want to play around EEPOM (Reading or writing)

You can make use of user space utility "EEPROG".

eeprog, Linux SMBus (I2C) 24C32 EEPROM reader/writer

Thanks,

Amit

0 Kudos