]> git.sur5r.net Git - u-boot/commitdiff
arm: am57xx: cl-som-am57x: fetch board rev from EEPROM
authorDmitry Lifshitz <lifshitz@compulab.co.il>
Wed, 28 Dec 2016 16:28:34 +0000 (18:28 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 2 Jan 2017 16:14:06 +0000 (11:14 -0500)
Add PCB revision message.
Implement board revision get_board_rev API.

Signed-off-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
Commit description update.
Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Reviewed-by: Tom Rini <trini@konsulko.com>
board/compulab/cl-som-am57x/cl-som-am57x.c
include/configs/cl-som-am57x.h

index 4bad6440f3fb637995f23bc1fc191bcbc5fb1b78..bdd0a2ba19847d165eb511854fdf513c5fd52e7b 100644 (file)
@@ -14,6 +14,8 @@
 #include <asm/gpio.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/sys_proto.h>
+#include "../common/common.h"
+#include "../common/eeprom.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -60,3 +62,15 @@ int board_usb_init(int index, enum usb_init_type init)
        return 0;
 }
 #endif /* CONFIG_USB_XHCI_OMAP */
+
+int misc_init_r(void)
+{
+       cl_print_pcb_info();
+
+       return 0;
+}
+
+u32 get_board_rev(void)
+{
+       return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS);
+}
index c8d4a00bc9dde69d1951b9d392b0ef96e595eba2..48c0f7f04428abb30b688425eb33e6d91bf0826d 100644 (file)
 
 #include <configs/ti_omap5_common.h>
 
+/* misc */
+#define CONFIG_MISC_INIT_R
+#define CONFIG_REVISION_TAG
+
 /* Status LED */
 #define CONFIG_STATUS_LED              /* Status LED enabled */
 #define CONFIG_GPIO_LED
 #define CONFIG_ENV_OFFSET              (768 * 1024)
 #define CONFIG_ENV_SPI_MAX_HZ          48000000
 
+/* EEPROM */
+#define CONFIG_SYS_I2C_EEPROM_ADDR      0x50
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  1
+#define CONFIG_SYS_I2C_EEPROM_BUS       3
+
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_EEPROM_LAYOUT
+#define CONFIG_ENV_EEPROM_IS_ON_I2C
+#define CONFIG_SYS_EEPROM_SIZE         256
+
 #ifndef CONFIG_SPL_BUILD
 /* SATA */
 #define CONFIG_CMD_SCSI