Commit 965c509f0a06ea506432e1f90fdd43a0faff6c23
Committed by
Tom Rini
1 parent
46650d583b
Exists in
v2017.01-smarct4x
and in
25 other branches
arm: am57xx: cl-som-am57x: fetch board rev from EEPROM
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>
Showing 2 changed files with 28 additions and 0 deletions Side-by-side Diff
board/compulab/cl-som-am57x/cl-som-am57x.c
... | ... | @@ -14,6 +14,8 @@ |
14 | 14 | #include <asm/gpio.h> |
15 | 15 | #include <asm/arch/mmc_host_def.h> |
16 | 16 | #include <asm/arch/sys_proto.h> |
17 | +#include "../common/common.h" | |
18 | +#include "../common/eeprom.h" | |
17 | 19 | |
18 | 20 | DECLARE_GLOBAL_DATA_PTR; |
19 | 21 | |
... | ... | @@ -60,4 +62,16 @@ |
60 | 62 | return 0; |
61 | 63 | } |
62 | 64 | #endif /* CONFIG_USB_XHCI_OMAP */ |
65 | + | |
66 | +int misc_init_r(void) | |
67 | +{ | |
68 | + cl_print_pcb_info(); | |
69 | + | |
70 | + return 0; | |
71 | +} | |
72 | + | |
73 | +u32 get_board_rev(void) | |
74 | +{ | |
75 | + return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS); | |
76 | +} |
include/configs/cl-som-am57x.h
... | ... | @@ -24,6 +24,10 @@ |
24 | 24 | |
25 | 25 | #include <configs/ti_omap5_common.h> |
26 | 26 | |
27 | +/* misc */ | |
28 | +#define CONFIG_MISC_INIT_R | |
29 | +#define CONFIG_REVISION_TAG | |
30 | + | |
27 | 31 | /* Status LED */ |
28 | 32 | #define CONFIG_STATUS_LED /* Status LED enabled */ |
29 | 33 | #define CONFIG_GPIO_LED |
... | ... | @@ -64,6 +68,16 @@ |
64 | 68 | #define CONFIG_ENV_SECT_SIZE (64 * 1024) |
65 | 69 | #define CONFIG_ENV_OFFSET (768 * 1024) |
66 | 70 | #define CONFIG_ENV_SPI_MAX_HZ 48000000 |
71 | + | |
72 | +/* EEPROM */ | |
73 | +#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 | |
74 | +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 | |
75 | +#define CONFIG_SYS_I2C_EEPROM_BUS 3 | |
76 | + | |
77 | +#define CONFIG_CMD_EEPROM | |
78 | +#define CONFIG_CMD_EEPROM_LAYOUT | |
79 | +#define CONFIG_ENV_EEPROM_IS_ON_I2C | |
80 | +#define CONFIG_SYS_EEPROM_SIZE 256 | |
67 | 81 | |
68 | 82 | #ifndef CONFIG_SPL_BUILD |
69 | 83 | /* SATA */ |