arm: ls102xa: Add SystemID EEPROM support for LS1021ATWR board
authorAlison Wang <b18965@freescale.com>
Fri, 17 Oct 2014 07:26:35 +0000 (15:26 +0800)
committerYork Sun <yorksun@freescale.com>
Mon, 24 Nov 2014 17:27:23 +0000 (09:27 -0800)
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>
board/freescale/common/sys_eeprom.c
include/configs/ls1021atwr.h

index 6144c533ef27af60d629103aa5f117369ed373b4..3426b8ada367db71a26529244a2a25c93dfc51ce 100644 (file)
@@ -90,7 +90,7 @@ static void show_eeprom(void)
        /* EEPROM tag ID, either CCID or 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],
-               be32_to_cpu(e.version));
+              e.version);
 #else
        printf("ID: %c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
 #endif
@@ -485,7 +485,7 @@ int mac_read_from_eeprom(void)
 
 #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],
-               be32_to_cpu(e.version));
+              e.version);
 #else
        printf("%c%c%c%c\n", e.id[0], e.id[1], e.id[2], e.id[3]);
 #endif
index 34cec6515c7701a0613b1294f8818fa83e086ac7..a5d29763c9f9bd8fc00a815d4821f1d7f7ed3cd9 100644 (file)
 #define CONFIG_SYS_I2C
 #define CONFIG_SYS_I2C_MXC
 
+/* EEPROM */
+#ifndef CONFIG_SD_BOOT
+#define CONFIG_ID_EEPROM
+#define CONFIG_SYS_I2C_EEPROM_NXID
+#define CONFIG_SYS_EEPROM_BUS_NUM              1
+#define CONFIG_SYS_I2C_EEPROM_ADDR             0x53
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         1
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      3
+#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  5
+#endif
+
 /*
  * MMC
  */