Commit 5175a2885fbb47e4836dcb8ad0ad2214e9b0b3b5

Authored by Alison Wang
Committed by York Sun
1 parent 272c5265ed

arm: ls102xa: Add SystemID EEPROM support for LS1021ATWR board

SystemID information could be read through I2C1 from EEPROM
on LS1021ATWR board.

As LS1 is a little-endian processor, getting the version ID by
be32_to_cpu() is wrong. Fix it by using e.version directly.
This change will be compatible for both ARM and PowerPC.

As there is an errata that I2C1 could not work in SD boot,
reading EEPROM through I2C1 is disabled too in SD boot.

Signed-off-by: Alison Wang <alison.wang@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>

Showing 2 changed files with 13 additions and 2 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   - be32_to_cpu(e.version));
  93 + 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
... ... @@ -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   - be32_to_cpu(e.version));
  488 + 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
include/configs/ls1021atwr.h
... ... @@ -161,6 +161,17 @@
161 161 #define CONFIG_SYS_I2C
162 162 #define CONFIG_SYS_I2C_MXC
163 163  
  164 +/* EEPROM */
  165 +#ifndef CONFIG_SD_BOOT
  166 +#define CONFIG_ID_EEPROM
  167 +#define CONFIG_SYS_I2C_EEPROM_NXID
  168 +#define CONFIG_SYS_EEPROM_BUS_NUM 1
  169 +#define CONFIG_SYS_I2C_EEPROM_ADDR 0x53
  170 +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  171 +#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
  172 +#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
  173 +#endif
  174 +
164 175 /*
165 176 * MMC
166 177 */