diff options
Diffstat (limited to 'board/xilinx')
-rw-r--r-- | board/xilinx/common/board.c | 26 | ||||
-rw-r--r-- | board/xilinx/versal/board.c | 5 | ||||
-rw-r--r-- | board/xilinx/zynqmp/zynqmp.c | 8 |
3 files changed, 33 insertions, 6 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 5f2afb9def4..9b4aded466a 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -23,6 +23,7 @@ #include <soc.h> #include <linux/ctype.h> #include <linux/kernel.h> +#include <uuid.h> #include "fru.h" @@ -86,6 +87,7 @@ int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) #define EEPROM_HDR_SERIAL_LEN 20 #define EEPROM_HDR_NO_OF_MAC_ADDR 4 #define EEPROM_HDR_ETH_ALEN ETH_ALEN +#define EEPROM_HDR_UUID_LEN 16 struct xilinx_board_description { u32 header; @@ -94,6 +96,7 @@ struct xilinx_board_description { char revision[EEPROM_HDR_REV_LEN + 1]; char serial[EEPROM_HDR_SERIAL_LEN + 1]; u8 mac_addr[EEPROM_HDR_NO_OF_MAC_ADDR][EEPROM_HDR_ETH_ALEN + 1]; + char uuid[EEPROM_HDR_UUID_LEN + 1]; }; static int highest_id = -1; @@ -235,21 +238,23 @@ static int xilinx_read_eeprom_fru(struct udevice *dev, char *name, } /* It is clear that FRU was captured and structures were filled */ - strncpy(desc->manufacturer, (char *)fru_data.brd.manufacturer_name, + strlcpy(desc->manufacturer, (char *)fru_data.brd.manufacturer_name, sizeof(desc->manufacturer)); - strncpy(desc->name, (char *)fru_data.brd.product_name, + strlcpy(desc->uuid, (char *)fru_data.brd.uuid, + sizeof(desc->uuid)); + strlcpy(desc->name, (char *)fru_data.brd.product_name, sizeof(desc->name)); for (i = 0; i < sizeof(desc->name); i++) { if (desc->name[i] == ' ') desc->name[i] = '\0'; } - strncpy(desc->revision, (char *)fru_data.brd.rev, + strlcpy(desc->revision, (char *)fru_data.brd.rev, sizeof(desc->revision)); for (i = 0; i < sizeof(desc->revision); i++) { if (desc->revision[i] == ' ') desc->revision[i] = '\0'; } - strncpy(desc->serial, (char *)fru_data.brd.serial_number, + strlcpy(desc->serial, (char *)fru_data.brd.serial_number, sizeof(desc->serial)); while (id < EEPROM_HDR_NO_OF_MAC_ADDR) { @@ -452,6 +457,19 @@ int board_late_init_xilinx(void) ret |= env_set_by_index("serial", id, desc->serial); + if (desc->uuid[0]) { + char uuid[UUID_STR_LEN + 1]; + char *t = desc->uuid; + + memset(uuid, 0, UUID_STR_LEN + 1); + + sprintf(uuid, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + t[0], t[1], t[2], t[3], t[4], t[5], + t[6], t[7], t[8], t[9], t[10], t[11], + t[12], t[13], t[14], t[15]); + ret |= env_set_by_index("uuid", id, uuid); + } + if (!CONFIG_IS_ENABLED(NET)) continue; diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index 81663e0cd0e..d8f39be56c8 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -27,7 +27,10 @@ DECLARE_GLOBAL_DATA_PTR; #if defined(CONFIG_FPGA_VERSALPL) -static xilinx_desc versalpl = XILINX_VERSAL_DESC; +static xilinx_desc versalpl = { + xilinx_versal, csu_dma, 1, &versal_op, 0, &versal_op, NULL, + FPGA_LEGACY +}; #endif int board_init(void) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 106c3953e1f..57259b60a02 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -48,7 +48,10 @@ DECLARE_GLOBAL_DATA_PTR; #if CONFIG_IS_ENABLED(FPGA) && defined(CONFIG_FPGA_ZYNQMPPL) -static xilinx_desc zynqmppl = XILINX_ZYNQMP_DESC; +static xilinx_desc zynqmppl = { + xilinx_zynqmp, csu_dma, 1, &zynqmp_op, 0, &zynqmp_op, NULL, + ZYNQMP_FPGA_FLAGS +}; #endif int __maybe_unused psu_uboot_init(void) @@ -253,6 +256,7 @@ int dram_init(void) return 0; } +#if defined(CONFIG_LMB) ulong board_get_usable_ram_top(ulong total_size) { phys_size_t size; @@ -277,6 +281,8 @@ ulong board_get_usable_ram_top(ulong total_size) return reg + size; } +#endif + #else int dram_init_banksize(void) { |