diff options
author | Andreas Dannenberg | 2020-01-07 13:15:54 +0530 |
---|---|---|
committer | Lokesh Vutla | 2020-01-20 10:10:28 +0530 |
commit | 643eb6ea07f3ce1e86069a4d281d1c4f89899cdf (patch) | |
tree | 5133a0d1c11ec0cb5746cdee9e167e50f2343557 /board/ti/common | |
parent | 499681e15e7e7afcae78bdc100d6a753f9271094 (diff) |
board: ti: j721e: Use EEPROM-based board detection
The TI J721E EVM system on module (SOM), the common processor board, and
the associated daughtercards have on-board I2C-based EEPROMs containing
board config data. Use the board detection infrastructure to do the
following:
1) Parse the J721E SOM EEPROM and populate items like board name, board
HW and SW revision as well as board serial number into the TI common
EEPROM data structure residing in SRAM scratch space
2) Check for presence of daughter card(s) by probing associated I2C
addresses used for on-board EEPROMs containing daughter card-specific
data. If such a card is found, parse the EEPROM data such as for
additional Ethernet MAC addresses and populate those into U-Boot
accordingly
3) Dynamically apply daughter card DTB overlays to the U-Boot (proper)
DTB during SPL execution
4) Dynamically create an U-Boot ENV variable called name_overlays
during U-Boot execution containing a list of daugherboard-specific
DTB overlays based on daughercards found to be used during Kernel
boot.
This patch adds support for the J721E system on module boards containing
the actual SoC ("J721EX-PM2-SOM", accessed via CONFIG_EEPROM_CHIP_ADDRESS),
the common processor board ("J7X-BASE-CPB"), the Quad-Port Ethernet
Expansion Board ("J7X-VSC8514-ETH"), the infotainment board
("J7X-INFOTAN-EXP") as well as for the gateway/Ethernet switch/industrial
expansion board ("J7X-GESI-EXP").
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'board/ti/common')
-rw-r--r-- | board/ti/common/board_detect.c | 9 | ||||
-rw-r--r-- | board/ti/common/board_detect.h | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c index b230bb6f8d4..cbd35f24342 100644 --- a/board/ti/common/board_detect.c +++ b/board/ti/common/board_detect.c @@ -548,6 +548,15 @@ int __maybe_unused ti_i2c_eeprom_am6_get_base(int bus_addr, int dev_addr) return ret; } +bool __maybe_unused board_ti_k3_is(char *name_tag) +{ + struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA; + + if (ep->header == TI_DEAD_EEPROM_MAGIC) + return false; + return !strncmp(ep->name, name_tag, AM6_EEPROM_HDR_NAME_LEN); +} + bool __maybe_unused board_ti_is(char *name_tag) { struct ti_common_eeprom *ep = TI_EEPROM_DATA; diff --git a/board/ti/common/board_detect.h b/board/ti/common/board_detect.h index 1a85b7fda96..5835af5344b 100644 --- a/board/ti/common/board_detect.h +++ b/board/ti/common/board_detect.h @@ -320,6 +320,15 @@ int __maybe_unused ti_i2c_eeprom_am6_get_base(int bus_addr, int dev_addr); bool board_ti_is(char *name_tag); /** + * board_ti_k3_is() - Board detection logic for TI K3 EVMs + * @name_tag: Tag used in eeprom for the board + * + * Return: false if board information does not match OR eeprom wasn't read. + * true otherwise + */ +bool board_ti_k3_is(char *name_tag); + +/** * board_ti_rev_is() - Compare board revision for TI EVMs * @rev_tag: Revision tag to check in eeprom * @cmp_len: How many chars to compare? |