board/fsl/common: Fix eeprom system version endianness
SYSTEM ID EPPROM always store SYSTEM version info in big endian format. SoC with ARM or PowerPC core should read/write version info from eeprom in BIG endian format. So use cpu-specific APIs to read SYSTEM version. Signed-off-by: Jaiprakash Singh <b44839 at freescale.com> Signed-off-by: Prabhakar Kushwaha <prabhakar at freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
This commit is contained in:
parent
34cc75469f
commit
b8baf460ee
|
|
@ -90,7 +90,7 @@ static void show_eeprom(void)
|
||||||
/* EEPROM tag ID, either CCID or NXID */
|
/* EEPROM tag ID, either CCID or NXID */
|
||||||
#ifdef CONFIG_SYS_I2C_EEPROM_NXID
|
#ifdef CONFIG_SYS_I2C_EEPROM_NXID
|
||||||
printf("ID: %c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3],
|
printf("ID: %c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3],
|
||||||
e.version);
|
be32_to_cpu(e.version));
|
||||||
#else
|
#else
|
||||||
printf("ID: %c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
|
printf("ID: %c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -340,7 +340,7 @@ int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
if (cmd == 'i') {
|
if (cmd == 'i') {
|
||||||
#ifdef CONFIG_SYS_I2C_EEPROM_NXID
|
#ifdef CONFIG_SYS_I2C_EEPROM_NXID
|
||||||
memcpy(e.id, "NXID", sizeof(e.id));
|
memcpy(e.id, "NXID", sizeof(e.id));
|
||||||
e.version = NXID_VERSION;
|
e.version = cpu_to_be32(NXID_VERSION);
|
||||||
#else
|
#else
|
||||||
memcpy(e.id, "CCID", sizeof(e.id));
|
memcpy(e.id, "CCID", sizeof(e.id));
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -485,7 +485,7 @@ int mac_read_from_eeprom(void)
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_I2C_EEPROM_NXID
|
#ifdef CONFIG_SYS_I2C_EEPROM_NXID
|
||||||
printf("%c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3],
|
printf("%c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3],
|
||||||
e.version);
|
be32_to_cpu(e.version));
|
||||||
#else
|
#else
|
||||||
printf("%c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
|
printf("%c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -496,7 +496,7 @@ int mac_read_from_eeprom(void)
|
||||||
* that at boot time, U-Boot will still say "NXID v0".
|
* that at boot time, U-Boot will still say "NXID v0".
|
||||||
*/
|
*/
|
||||||
if (e.version == 0) {
|
if (e.version == 0) {
|
||||||
e.version = NXID_VERSION;
|
e.version = cpu_to_be32(NXID_VERSION);
|
||||||
update_crc();
|
update_crc();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue