summaryrefslogtreecommitdiff
path: root/include/configs/tam3517-common.h
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-01-08 13:15:45 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-01-08 13:15:45 +0100
commit79f38777947ac7685e2cef8bd977f954ab198c0e (patch)
tree6fe053ef751b1c424ec50be338844197b6421d74 /include/configs/tam3517-common.h
parent96764df1b47ddebfb50fadf5af72530b07b5fc89 (diff)
parent9bd5c1ad0db802c9f8d49d72b443f03431cf6a89 (diff)
downloadu-boot-imx-79f38777947ac7685e2cef8bd977f954ab198c0e.zip
u-boot-imx-79f38777947ac7685e2cef8bd977f954ab198c0e.tar.gz
u-boot-imx-79f38777947ac7685e2cef8bd977f954ab198c0e.tar.bz2
Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
This required manual merging drivers/mtd/nand/Makefile and adding am335x_evm support for CONFIG_SPL_NAND_DRIVERS
Diffstat (limited to 'include/configs/tam3517-common.h')
-rw-r--r--include/configs/tam3517-common.h59
1 files changed, 43 insertions, 16 deletions
diff --git a/include/configs/tam3517-common.h b/include/configs/tam3517-common.h
index ee73c27..9f1fb9f 100644
--- a/include/configs/tam3517-common.h
+++ b/include/configs/tam3517-common.h
@@ -189,7 +189,6 @@
*/
#define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
-#define PHYS_SDRAM_1_SIZE (32 << 20) /* at least 32 MiB */
#define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
/*
@@ -358,7 +357,6 @@
* I2C EEPROM
*/
#if !(defined(__KERNEL_STRICT_NAMES) || defined(__ASSEMBLY__))
-
/*
* The I2C EEPROM on the TAM3517 contains
* mac address and production data
@@ -384,24 +382,29 @@ struct tam3517_module_info {
unsigned char _rev[100];
};
-#define TAM3517_READ_MAC_FROM_EEPROM \
-do { \
- struct tam3517_module_info info;\
- char buf[80], ethname[20]; \
- int i; \
+#define TAM3517_READ_EEPROM(info, ret) \
+do { \
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); \
if (eeprom_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0, \
- (void *)&info, sizeof(info))) \
- break; \
+ (void *)info, sizeof(*info))) \
+ ret = 1; \
+ else \
+ ret = 0; \
+} while (0)
+
+#define TAM3517_READ_MAC_FROM_EEPROM(info) \
+do { \
+ char buf[80], ethname[20]; \
+ int i; \
memset(buf, 0, sizeof(buf)); \
- for (i = 0 ; i < ARRAY_SIZE(info.eth_addr); i++) { \
+ for (i = 0 ; i < ARRAY_SIZE((info)->eth_addr); i++) { \
sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X", \
- info.eth_addr[i][5], \
- info.eth_addr[i][4], \
- info.eth_addr[i][3], \
- info.eth_addr[i][2], \
- info.eth_addr[i][1], \
- info.eth_addr[i][0]); \
+ (info)->eth_addr[i][5], \
+ (info)->eth_addr[i][4], \
+ (info)->eth_addr[i][3], \
+ (info)->eth_addr[i][2], \
+ (info)->eth_addr[i][1], \
+ (info)->eth_addr[i][0]); \
\
if (i) \
sprintf(ethname, "eth%daddr", i); \
@@ -411,6 +414,30 @@ do { \
setenv(ethname, buf); \
} \
} while (0)
+
+/* The following macros are taken from Technexion's documentation */
+#define TAM3517_sequence_number(info) \
+ ((info)->sequence_number % 0x1000000000000LL)
+#define TAM3517_week_of_year(info) (((info)->sequence_number >> 48) % 0x100)
+#define TAM3517_year(info) ((info)->sequence_number >> 56)
+#define TAM3517_revision_fixed(info) ((info)->revision % 0x100)
+#define TAM3517_revision_major(info) (((info)->revision >> 8) % 0x100)
+#define TAM3517_revision_tn(info) ((info)->revision >> 16)
+
+#define TAM3517_PRINT_SOM_INFO(info) \
+do { \
+ printf("Vendor:%s\n", (info)->customer); \
+ printf("SOM: %s\n", (info)->product); \
+ printf("SeqNr: %02llu%02llu%012llu\n", \
+ TAM3517_year(info), \
+ TAM3517_week_of_year(info), \
+ TAM3517_sequence_number(info)); \
+ printf("Rev: TN%u %u.%u\n", \
+ TAM3517_revision_tn(info), \
+ TAM3517_revision_major(info), \
+ TAM3517_revision_fixed(info)); \
+} while (0)
+
#endif
#endif /* __TAM3517_H */