Commit b8baf460ee978f9f704a658b31f9b074f546d6e1

Authored by Jaiprakash Singh
Committed by York Sun
1 parent 34cc75469f

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>

Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff

board/freescale/common/sys_eeprom.c
... ... @@ -90,7 +90,7 @@
90 90 /* EEPROM tag ID, either CCID or NXID */
91 91 #ifdef CONFIG_SYS_I2C_EEPROM_NXID
92 92 printf("ID: %c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3],
93   - e.version);
  93 + be32_to_cpu(e.version));
94 94 #else
95 95 printf("ID: %c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
96 96 #endif
... ... @@ -340,7 +340,7 @@
340 340 if (cmd == 'i') {
341 341 #ifdef CONFIG_SYS_I2C_EEPROM_NXID
342 342 memcpy(e.id, "NXID", sizeof(e.id));
343   - e.version = NXID_VERSION;
  343 + e.version = cpu_to_be32(NXID_VERSION);
344 344 #else
345 345 memcpy(e.id, "CCID", sizeof(e.id));
346 346 #endif
... ... @@ -485,7 +485,7 @@
485 485  
486 486 #ifdef CONFIG_SYS_I2C_EEPROM_NXID
487 487 printf("%c%c%c%c v%u\n", e.id[0], e.id[1], e.id[2], e.id[3],
488   - e.version);
  488 + be32_to_cpu(e.version));
489 489 #else
490 490 printf("%c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
491 491 #endif
... ... @@ -496,7 +496,7 @@
496 496 * that at boot time, U-Boot will still say "NXID v0".
497 497 */
498 498 if (e.version == 0) {
499   - e.version = NXID_VERSION;
  499 + e.version = cpu_to_be32(NXID_VERSION);
500 500 update_crc();
501 501 }
502 502 #endif