board: ti: am65x: store a list of DTBOs needed for the detected daughter boards

This list will be used later by a board driver

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
This commit is contained in:
Jean-Jacques Hiblot 2021-03-17 16:27:49 +00:00 committed by Praneeth Bajjuri
parent b37c0c8868
commit 1d1d08d23a
1 changed files with 7 additions and 1 deletions

View File

@ -25,6 +25,7 @@
#include "../common/board_detect.h" #include "../common/board_detect.h"
#define board_is_am65x_base_board() board_ti_is("AM6-COMPROCEVM") #define board_is_am65x_base_board() board_ti_is("AM6-COMPROCEVM")
#define MAX_DAUGHTER_CARDS 8
/* Daughter card presence detection signals */ /* Daughter card presence detection signals */
enum { enum {
@ -128,6 +129,8 @@ int ft_board_setup(void *blob, struct bd_info *bd)
} }
#endif #endif
const char *k3_dtbo_list[MAX_DAUGHTER_CARDS] = {NULL};
int do_board_detect(void) int do_board_detect(void)
{ {
int ret; int ret;
@ -196,7 +199,7 @@ static int probe_daughtercards(void)
char mac_addr[DAUGHTER_CARD_NO_OF_MAC_ADDR][TI_EEPROM_HDR_ETH_ALEN]; char mac_addr[DAUGHTER_CARD_NO_OF_MAC_ADDR][TI_EEPROM_HDR_ETH_ALEN];
u8 mac_addr_cnt; u8 mac_addr_cnt;
char name_overlays[1024] = { 0 }; char name_overlays[1024] = { 0 };
int i, j; int i, j, nb_dtbos = 0;
int ret; int ret;
/* /*
@ -263,6 +266,7 @@ static int probe_daughtercards(void)
return ret; return ret;
} }
memset(k3_dtbo_list, 0, sizeof(k3_dtbo_list));
for (i = 0; i < ARRAY_SIZE(cards); i++) { for (i = 0; i < ARRAY_SIZE(cards); i++) {
/* Obtain card-specific slot index and associated I2C address */ /* Obtain card-specific slot index and associated I2C address */
u8 slot_index = cards[i].slot_index; u8 slot_index = cards[i].slot_index;
@ -332,6 +336,8 @@ static int probe_daughtercards(void)
if (!strlen(cards[i].dtbo_name)) if (!strlen(cards[i].dtbo_name))
continue; continue;
k3_dtbo_list[nb_dtbos++] = cards[i].dtbo_name;
/* /*
* Make sure we are not running out of buffer space by checking * Make sure we are not running out of buffer space by checking
* if we can fit the new overlay, a trailing space to be used * if we can fit the new overlay, a trailing space to be used