Re: [U-Boot] [PATCH 3/5] arm: am57xx: cl-som-am57x: fetch board rev from EEPROM

2016-12-01 Thread Tom Rini
On Thu, Dec 01, 2016 at 10:28:14AM +0200, Uri Mashiach wrote:

> From: Dmitry Lifshitz 
> 
> Add PCB revision message.
> Implement board revision get_board_rev API.
> 
> Signed-off-by: Dmitry Lifshitz 
> Commit description update.
> Signed-off-by: Uri Mashiach 
> Acked-by: Igor Grinberg 

Reviewed-by: Tom Rini 

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/5] arm: am57xx: cl-som-am57x: fetch board rev from EEPROM

2016-12-01 Thread Uri Mashiach
From: Dmitry Lifshitz 

Add PCB revision message.
Implement board revision get_board_rev API.

Signed-off-by: Dmitry Lifshitz 
Commit description update.
Signed-off-by: Uri Mashiach 
Acked-by: Igor Grinberg 
---
 board/compulab/cl-som-am57x/cl-som-am57x.c | 14 ++
 include/configs/cl-som-am57x.h | 14 ++
 2 files changed, 28 insertions(+)

diff --git a/board/compulab/cl-som-am57x/cl-som-am57x.c 
b/board/compulab/cl-som-am57x/cl-som-am57x.c
index 4bad644..bdd0a2b 100644
--- a/board/compulab/cl-som-am57x/cl-som-am57x.c
+++ b/board/compulab/cl-som-am57x/cl-som-am57x.c
@@ -14,6 +14,8 @@
 #include 
 #include 
 #include 
+#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);
+}
diff --git a/include/configs/cl-som-am57x.h b/include/configs/cl-som-am57x.h
index dfceebb..65e506a 100644
--- a/include/configs/cl-som-am57x.h
+++ b/include/configs/cl-som-am57x.h
@@ -24,6 +24,10 @@
 
 #include 
 
+/* misc */
+#define CONFIG_MISC_INIT_R
+#define CONFIG_REVISION_TAG
+
 /* Status LED */
 #define CONFIG_STATUS_LED  /* Status LED enabled */
 #define CONFIG_GPIO_LED
@@ -72,6 +76,16 @@
 #define CONFIG_ENV_OFFSET  (768 * 1024)
 #define CONFIG_ENV_SPI_MAX_HZ  4800
 
+/* 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
-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot