powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM
PATCH 1/1 powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM
Some boards use System EEPROM with 128-bytes instead of 256-bytes. Since we regard 256-bytes EEPROM as standard EEPROM with default value for MAX_NUM_PORTS. For those non-256-bytes EEPROM, we can redefine MAX_NUM_PORTS in board-specific file to override the default MAX_NUM_PORTS.
This patch doesn't impact on previous existing boards.
--- board/freescale/common/sys_eeprom.c | 4 ++++ 1 file changed, 4 insertions(+)
board/freescale/common/sys_eeprom.c +4 -0
@@ -34,7 +34,11 @@#endif #ifdef CONFIG_SYS_I2C_EEPROM_NXID +/* some boards with non-256-bytes EEPROM have special define */ +/* for MAX_NUM_PORTS in board-specific file */ +#ifndef MAX_NUM_PORTS #define MAX_NUM_PORTS 23 +#endif #define NXID_VERSION 1#endif
Signature · 1 line
1.8.0
PATCH 1/1 powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM
board/freescale/common/sys_eeprom.c line 43
Quoted 8 lines · Shengzhou Liu
#ifdef
CONFIG_SYS_I2C_EEPROM_NXIDboard/freescale/common/sys_eeprom.c +4
-0+/* some boards with non-256-bytes EEPROM have special define */ +/* for MAX_NUM_PORTS in board-specific file */ +#ifndef MAX_NUM_PORTS #define MAX_NUM_PORTS 23 +#endif #define NXID_VERSION 1#endif
I'll have to think about this. On one hand, this works. As long as the board-specific value of MAX_NUM_PORTS is valid, then it will work.
On the other hand, it's fragile and violates the specification. An NXID v1 EEPROM has the CRC at offset 0xFC. I'm just not sure it really matters.
York, I'm okay with this patch if you are. You're the one maintaining this code now. Is there anyone left at Freescale who cares about the integrity of the EEPROM specification?
PATCH 1/1 powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM
Quoted 15 lines · Timur Tabi
board/freescale/common/sys_eeprom.c line 43
Quoted 8 lines · Shengzhou Liu
#ifdef
CONFIG_SYS_I2C_EEPROM_NXIDboard/freescale/common/sys_eeprom.c +4
-0+/* some boards with non-256-bytes EEPROM have special define */ +/* for MAX_NUM_PORTS in board-specific file */ +#ifndef MAX_NUM_PORTS #define MAX_NUM_PORTS 23 +#endif #define NXID_VERSION 1#endif I'll have to think about this. On one hand, this works. As long as the board-specific value of
MAX_NUM_PORTSis valid, then it will work.
Quoted 3 lines
On the other hand, it's fragile and violates the specification. An NXID v1 EEPROM has the CRC at offset
0xFC. I'm just not sure it really matters.
We need to verify the CRC is still valid.
Quoted 4 lines
York, I'm okay with this patch if you are. You're the one maintaining this code now. Is there anyone left at Freescale who cares about the integrity of the EEPROM specification?
Some many boards pop up from different design groups. Unfortunately not all came to us to review. It is often too late when we find the design is different.
York
PATCH 1/1 powerpc/eeprom: update MAX_NUM_PORTS to adapt non-256-bytes EEPROM
Quoted 25 lines
-----Original Message-----
From: sun york-R58495
Sent: Wednesday, September 04, 2013 1:29 AM
To: Timur Tabi
Cc: Liu Shengzhou-B36685; U-Boot Mailing List
Subject: Re: [U-Boot] [PATCH] powerpc/eeprom: updateMAX_NUM_PORTSto adapt non- 256-bytes EEPROMQuoted 14 lines · Timur Tabi
board/freescale/common/sys_eeprom.c line 43
Quoted 7 lines · Shengzhou Liu
#ifdef
CONFIG_SYS_I2C_EEPROM_NXIDboard/freescale/common/sys_eeprom.c +3
-0+/* some boards with non-256-bytes EEPROM have special define */ +/* for MAX_NUM_PORTS in board-specific file */ #ifndef MAX_NUM_PORTS #define MAX_NUM_PORTS 23 +#endif #define NXID_VERSION 1#endif I'll have to think about this. On one hand, this works. As long as the board-specific value of
MAX_NUM_PORTSis valid, then it will work.
Quoted 5 lines
Quoted 3 lines
On the other hand, it's fragile and violates the specification. An NXID v1 EEPROM has the CRC at offset
0xFC. I'm just not sure it really matters.We need to verify the CRC is still valid.
It had been verified on P1010RDB-PB with 128 Bytes, The CRC is still at the end of EEPROM and is still valid.
-Shengzhou
Quoted 9 lines
Quoted 4 lines
York, I'm okay with this patch if you are. You're the one maintaining this code now. Is there anyone left at Freescale who cares about the integrity of the EEPROM specification?
Some many boards pop up from different design groups. Unfortunately not all came to us to review. It is often too late when we find the design is different.
York