diff options
Diffstat (limited to 'board')
40 files changed, 488 insertions, 149 deletions
diff --git a/board/altera/stratix10-socdk/MAINTAINERS b/board/altera/stratix10-socdk/MAINTAINERS index 6192bc9174..6efd0cfc05 100644 --- a/board/altera/stratix10-socdk/MAINTAINERS +++ b/board/altera/stratix10-socdk/MAINTAINERS @@ -4,4 +4,5 @@ M: Dinh Nguyen <dinh.nguyen@intel.com> S: Maintained F: board/altera/stratix10-socdk/ F: include/configs/socfpga_stratix10_socdk.h +F: configs/socfpga_stratix10_atf_defconfig F: configs/socfpga_stratix10_defconfig diff --git a/board/amlogic/beelink-s922x/MAINTAINERS b/board/amlogic/beelink-s922x/MAINTAINERS new file mode 100644 index 0000000000..7f223df4ae --- /dev/null +++ b/board/amlogic/beelink-s922x/MAINTAINERS @@ -0,0 +1,9 @@ +BEELINK-S922X +M: Christian Hewitt <christianshewitt@gmail.com> +S: Maintained +L: u-boot-amlogic@groups.io +F: board/amlogic/beelink-s922x/ +F: configs/beelink-gtking_defconfig +F: configs/beelink-gtkingpro_defconfig +F: doc/board/amlogic/beelink-gtking.rst +F: doc/board/amlogic/beelink-gtkingpro.rst diff --git a/board/amlogic/beelink-s922x/Makefile b/board/amlogic/beelink-s922x/Makefile new file mode 100644 index 0000000000..27b1a74105 --- /dev/null +++ b/board/amlogic/beelink-s922x/Makefile @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2020 BayLibre, SAS +# Author: Neil Armstrong <narmstrong@baylibre.com> + +obj-y := beelink-s922x.o diff --git a/board/amlogic/beelink-s922x/beelink-s922x.c b/board/amlogic/beelink-s922x/beelink-s922x.c new file mode 100644 index 0000000000..dc0d933a39 --- /dev/null +++ b/board/amlogic/beelink-s922x/beelink-s922x.c @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2020 BayLibre, SAS + * Author: Neil Armstrong <narmstrong@baylibre.com> + */ + +#include <common.h> +#include <dm.h> +#include <env.h> +#include <init.h> +#include <net.h> +#include <asm/io.h> +#include <asm/arch/sm.h> +#include <asm/arch/eth.h> +#include <asm/arch/boot.h> + +#define EFUSE_MAC_OFFSET 20 +#define EFUSE_MAC_SIZE 12 +#define MAC_ADDR_LEN 6 + +int misc_init_r(void) +{ + u8 mac_addr[MAC_ADDR_LEN]; + char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3]; + ssize_t len; + + if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) && + meson_get_soc_rev(tmp, sizeof(tmp)) > 0) + env_set("soc_rev", tmp); + + meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0); + + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { + len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, + efuse_mac_addr, EFUSE_MAC_SIZE); + if (len != EFUSE_MAC_SIZE) + return 0; + + /* MAC is stored in ASCII format, 1bytes = 2characters */ + for (int i = 0; i < 6; i++) { + tmp[0] = efuse_mac_addr[i * 2]; + tmp[1] = efuse_mac_addr[i * 2 + 1]; + tmp[2] = '\0'; + mac_addr[i] = simple_strtoul(tmp, NULL, 16); + } + + if (is_valid_ethaddr(mac_addr)) + eth_env_set_enetaddr("ethaddr", mac_addr); + else + meson_generate_serial_ethaddr(); + } + + return 0; +} diff --git a/board/amlogic/odroid-n2/odroid-n2.c b/board/amlogic/odroid-n2/odroid-n2.c index caf7fd6810..d9955433bf 100644 --- a/board/amlogic/odroid-n2/odroid-n2.c +++ b/board/amlogic/odroid-n2/odroid-n2.c @@ -10,19 +10,32 @@ #include <init.h> #include <net.h> #include <asm/io.h> +#include <asm/arch/boot.h> #include <asm/arch/sm.h> #include <asm/arch/eth.h> +#include <asm/arch/boot.h> #define EFUSE_MAC_OFFSET 20 #define EFUSE_MAC_SIZE 12 #define MAC_ADDR_LEN 6 +int mmc_get_env_dev(void) +{ + if (meson_get_boot_device() == BOOT_DEVICE_EMMC) + return 1; + return 0; +} + int misc_init_r(void) { u8 mac_addr[MAC_ADDR_LEN]; char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3]; ssize_t len; + if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) && + meson_get_soc_rev(tmp, sizeof(tmp)) > 0) + env_set("soc_rev", tmp); + meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0); if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { diff --git a/board/amlogic/p212/MAINTAINERS b/board/amlogic/p212/MAINTAINERS index cae6994393..3d622af29b 100644 --- a/board/amlogic/p212/MAINTAINERS +++ b/board/amlogic/p212/MAINTAINERS @@ -7,6 +7,7 @@ F: include/configs/p212.h F: configs/khadas-vim_defconfig F: configs/libretech-ac_defconfig F: configs/libretech-cc_defconfig +F: configs/libretech-cc_v2_defconfig F: configs/p212_defconfig F: doc/board/amlogic/p212.rst F: doc/board/amlogic/libretech-ac.rst diff --git a/board/amlogic/q200/MAINTAINERS b/board/amlogic/q200/MAINTAINERS index ec05aa6f4c..ba7c12b2c1 100644 --- a/board/amlogic/q200/MAINTAINERS +++ b/board/amlogic/q200/MAINTAINERS @@ -7,4 +7,6 @@ F: include/configs/q200.h F: configs/khadas-vim2_defconfig F: configs/libretech-s905d-pc_defconfig F: configs/libretech-s912-pc_defconfig +F: configs/wetek-core2_defconfig F: doc/board/amlogic/khadas-vim2.rst +F: doc/board/amlogic/wetek-core2.rst diff --git a/board/amlogic/vim3/vim3.c b/board/amlogic/vim3/vim3.c index 09ef39ff30..7145dbe18e 100644 --- a/board/amlogic/vim3/vim3.c +++ b/board/amlogic/vim3/vim3.c @@ -10,10 +10,19 @@ #include <init.h> #include <net.h> #include <asm/io.h> +#include <asm/arch/boot.h> #include <asm/arch/eth.h> +#include <asm/arch/sm.h> #include <i2c.h> #include "khadas-mcu.h" +int mmc_get_env_dev(void) +{ + if (meson_get_boot_device() == BOOT_DEVICE_EMMC) + return 2; + return 1; +} + /* * The VIM3 on-board MCU can mux the PCIe/USB3.0 shared differential * lines using a FUSB340TMX USB 3.1 SuperSpeed Data Switch between @@ -129,9 +138,39 @@ int meson_ft_board_setup(void *blob, struct bd_info *bd) return 0; } +#define EFUSE_MAC_OFFSET 0 +#define EFUSE_MAC_SIZE 12 +#define MAC_ADDR_LEN 6 + int misc_init_r(void) { + u8 mac_addr[MAC_ADDR_LEN]; + char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3]; + ssize_t len; + meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0); + if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { + len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, + efuse_mac_addr, EFUSE_MAC_SIZE); + if (len != EFUSE_MAC_SIZE) + return 0; + + /* MAC is stored in ASCII format, 1bytes = 2characters */ + for (int i = 0; i < 6; i++) { + tmp[0] = efuse_mac_addr[i * 2]; + tmp[1] = efuse_mac_addr[i * 2 + 1]; + tmp[2] = '\0'; + mac_addr[i] = simple_strtoul(tmp, NULL, 16); + } + + if (is_valid_ethaddr(mac_addr)) + eth_env_set_enetaddr("ethaddr", mac_addr); + else + meson_generate_serial_ethaddr(); + + eth_env_get_enetaddr("ethaddr", mac_addr); + } + return 0; } diff --git a/board/aspeed/evb_ast2600/Kconfig b/board/aspeed/evb_ast2600/Kconfig new file mode 100644 index 0000000000..42008cd033 --- /dev/null +++ b/board/aspeed/evb_ast2600/Kconfig @@ -0,0 +1,12 @@ +if TARGET_EVB_AST2600 + +config SYS_BOARD + default "evb_ast2600" + +config SYS_VENDOR + default "aspeed" + +config SYS_CONFIG_NAME + default "evb_ast2600" + +endif diff --git a/board/aspeed/evb_ast2600/MAINTAINERS b/board/aspeed/evb_ast2600/MAINTAINERS new file mode 100644 index 0000000000..e83aae5d6a --- /dev/null +++ b/board/aspeed/evb_ast2600/MAINTAINERS @@ -0,0 +1,6 @@ +EVB AST2600 BOARD +M: Chia-Wei, Wang <chiawei_wang@aspeedtech.com> +S: Maintained +F: board/aspeed/evb_ast2600/ +F: include/configs/evb_ast2600.h +F: configs/evb-ast2600_defconfig diff --git a/board/aspeed/evb_ast2600/Makefile b/board/aspeed/evb_ast2600/Makefile new file mode 100644 index 0000000000..9291db6ee1 --- /dev/null +++ b/board/aspeed/evb_ast2600/Makefile @@ -0,0 +1 @@ +obj-y += evb_ast2600.o diff --git a/board/aspeed/evb_ast2600/evb_ast2600.c b/board/aspeed/evb_ast2600/evb_ast2600.c new file mode 100644 index 0000000000..e6dc8c7952 --- /dev/null +++ b/board/aspeed/evb_ast2600/evb_ast2600.c @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (c) Aspeed Technology Inc. + */ +#include <common.h> diff --git a/board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its b/board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its index ba48786e08..8eed9d0fb2 100644 --- a/board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its +++ b/board/dhelectronics/dh_stm32mp1/u-boot-dhcom.its @@ -47,28 +47,28 @@ config-1 { /* DT+SoM+board model */ description = "dh,stm32mp15xx-dhcom-pdk2_somrev0_boardrev0"; - loadables = "uboot"; + firmware = "uboot"; fdt = "fdt-1"; }; config-2 { /* DT+SoM+board model */ description = "dh,stm32mp15xx-dhcom-pdk2_somrev1_boardrev0"; - loadables = "uboot"; + firmware = "uboot"; fdt = "fdt-1"; }; config-3 { /* DT+SoM+board model */ description = "dh,stm32mp15xx-dhcom-drc02_somrev0_boardrev0"; - loadables = "uboot"; + firmware = "uboot"; fdt = "fdt-2"; }; config-4 { /* DT+SoM+board model */ description = "dh,stm32mp15xx-dhcom-drc02_somrev1_boardrev0"; - loadables = "uboot"; + firmware = "uboot"; fdt = "fdt-2"; }; diff --git a/board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its b/board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its index 7419684f55..0ea10a1497 100644 --- a/board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its +++ b/board/dhelectronics/dh_stm32mp1/u-boot-dhcor.its @@ -31,7 +31,7 @@ config-1 { /* DT+SoM+board model */ description = "arrow,stm32mp15xx-avenger96_somrev0_boardrev1"; - loadables = "uboot"; + firmware = "uboot"; fdt = "fdt-1"; }; diff --git a/board/intel/agilex-socdk/MAINTAINERS b/board/intel/agilex-socdk/MAINTAINERS index b8e28f0b24..18edbdcd2f 100644 --- a/board/intel/agilex-socdk/MAINTAINERS +++ b/board/intel/agilex-socdk/MAINTAINERS @@ -4,4 +4,5 @@ M: Chee Hong Ang <chee.hong.ang@intel.com> S: Maintained F: board/intel/agilex-socdk/ F: include/configs/socfpga_agilex_socdk.h +F: configs/socfpga_agilex_atf_defconfig F: configs/socfpga_agilex_defconfig diff --git a/board/keymile/km_arm/Kconfig b/board/keymile/km_arm/Kconfig index 4b21db8573..6f55cfab86 100644 --- a/board/keymile/km_arm/Kconfig +++ b/board/keymile/km_arm/Kconfig @@ -58,8 +58,12 @@ config BOARD_SPECIFIC_OPTIONS # dummy select DM_SERIAL select DM_SPI select DM_SPI_FLASH + select USB + select USB_EHCI_HCD + select USB_EHCI_MARVELL imply CMD_CRAMFS imply CMD_DIAG imply FS_CRAMFS + imply CMD_USB endif diff --git a/board/mediatek/pumpkin/pumpkin.c b/board/mediatek/pumpkin/pumpkin.c index 666e4d6a26..37daf1c51b 100644 --- a/board/mediatek/pumpkin/pumpkin.c +++ b/board/mediatek/pumpkin/pumpkin.c @@ -4,8 +4,25 @@ */ #include <common.h> +#include <dm.h> int board_init(void) { return 0; } + +int board_late_init(void) +{ + struct udevice *dev; + int ret; + + if (CONFIG_IS_ENABLED(USB_GADGET)) { + ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev); + if (ret) { + pr_err("%s: Cannot find USB device\n", __func__); + return ret; + } + } + + return 0; +} diff --git a/board/microchip/mpfs_icicle/Kconfig b/board/microchip/mpfs_icicle/Kconfig index bf8e1a13ec..4678462378 100644 --- a/board/microchip/mpfs_icicle/Kconfig +++ b/board/microchip/mpfs_icicle/Kconfig @@ -20,7 +20,30 @@ config BOARD_SPECIFIC_OPTIONS # dummy def_bool y select GENERIC_RISCV select BOARD_EARLY_INIT_F + select BOARD_LATE_INIT imply SMP + imply CLK_CCF + imply CLK_MPFS imply SYS_NS16550 + imply CMD_DHCP + imply CMD_EXT2 + imply CMD_EXT4 + imply CMD_FAT + imply CMD_FS_GENERIC + imply CMD_NET + imply CMD_PING + imply CMD_MMC + imply DOS_PARTITION + imply EFI_PARTITION + imply IP_DYN + imply ISO_PARTITION + imply MACB + imply MII + imply PHY_LIB + imply PHY_VITESSE + imply MMC + imply MMC_WRITE + imply MMC_SDHCI + imply MMC_SDHCI_CADENCE endif diff --git a/board/microchip/mpfs_icicle/mpfs_icicle.c b/board/microchip/mpfs_icicle/mpfs_icicle.c index 8381361ec3..0e34409067 100644 --- a/board/microchip/mpfs_icicle/mpfs_icicle.c +++ b/board/microchip/mpfs_icicle/mpfs_icicle.c @@ -6,10 +6,49 @@ #include <common.h> #include <dm.h> +#include <env.h> #include <init.h> #include <asm/io.h> -#define MPFS_SYSREG_SOFT_RESET ((unsigned int *)0x20002088) +DECLARE_GLOBAL_DATA_PTR; + +#define MPFS_SYSREG_SOFT_RESET ((unsigned int *)0x20002088) +#define MPFS_SYS_SERVICE_CR ((unsigned int *)0x37020050) +#define MPFS_SYS_SERVICE_SR ((unsigned int *)0x37020054) +#define MPFS_SYS_SERVICE_MAILBOX ((unsigned char *)0x37020800) + +#define PERIPH_RESET_VALUE 0x1e8u +#define SERVICE_CR_REQ 0x1u +#define SERVICE_SR_BUSY 0x2u + +static void read_device_serial_number(u8 *response, u8 response_size) +{ + u8 idx; + u8 *response_buf; + unsigned int val; + + response_buf = (u8 *)response; + + writel(SERVICE_CR_REQ, MPFS_SYS_SERVICE_CR); + /* + * REQ bit will remain set till the system controller starts + * processing. + */ + do { + val = readl(MPFS_SYS_SERVICE_CR); + } while (SERVICE_CR_REQ == (val & SERVICE_CR_REQ)); + + /* + * Once system controller starts processing the busy bit will + * go high and service is completed when busy bit is gone low + */ + do { + val = readl(MPFS_SYS_SERVICE_SR); + } while (SERVICE_SR_BUSY == (val & SERVICE_SR_BUSY)); + + for (idx = 0; idx < response_size; idx++) + response_buf[idx] = readb(MPFS_SYS_SERVICE_MAILBOX + idx); +} int board_init(void) { @@ -22,10 +61,64 @@ int board_early_init_f(void) { unsigned int val; - /* Reset uart peripheral */ + /* Reset uart, mmc peripheral */ val = readl(MPFS_SYSREG_SOFT_RESET); - val = (val & ~(1u << 5u)); + val = (val & ~(PERIPH_RESET_VALUE)); writel(val, MPFS_SYSREG_SOFT_RESET); return 0; } + +int board_late_init(void) +{ + u32 ret; + u32 node; + u8 idx; + u8 device_serial_number[16] = { 0 }; + unsigned char mac_addr[6]; + char icicle_mac_addr[20]; + void *blob = (void *)gd->fdt_blob; + + node = fdt_path_offset(blob, "ethernet0"); + if (node < 0) { + printf("No ethernet0 path offset\n"); + return -ENODEV; + } + + ret = fdtdec_get_byte_array(blob, node, "local-mac-address", mac_addr, 6); + if (ret) { + printf("No local-mac-address property\n"); + return -EINVAL; + } + + read_device_serial_number(device_serial_number, 16); + + /* Update MAC address with device serial number */ + mac_addr[0] = 0x00; + mac_addr[1] = 0x04; + mac_addr[2] = 0xA3; + mac_addr[3] = device_serial_number[2]; + mac_addr[4] = device_serial_number[1]; + mac_addr[5] = device_serial_number[0]; + + ret = fdt_setprop(blob, node, "local-mac-address", mac_addr, 6); + if (ret) { + printf("Error setting local-mac-address property\n"); + return -ENODEV; + } + + icicle_mac_addr[0] = '['; + + sprintf(&icicle_mac_addr[1], "%pM", mac_addr); + + icicle_mac_addr[18] = ']'; + icicle_mac_addr[19] = '\0'; + + for (idx = 0; idx < 20; idx++) { + if (icicle_mac_addr[idx] == ':') + icicle_mac_addr[idx] = ' '; + } + env_set("icicle_mac_addr", icicle_mac_addr); + + return 0; +} diff --git a/board/rockchip/evb_rk3328/MAINTAINERS b/board/rockchip/evb_rk3328/MAINTAINERS index e7dd59ff4e..14fda46e8f 100644 --- a/board/rockchip/evb_rk3328/MAINTAINERS +++ b/board/rockchip/evb_rk3328/MAINTAINERS @@ -5,6 +5,13 @@ F: board/rockchip/evb_rk3328 F: include/configs/evb_rk3328.h F: configs/evb-rk3328_defconfig +NANOPI-R2S-RK3328 +M: David Bauer <mail@david-bauer.net> +S: Maintained +F: configs/nanopi-r2s-rk3328_defconfig +F: arch/arm/dts/rk3328-nanopi-r2s-u-boot.dtsi +F: arch/arm/dts/rk3328-nanopi-r2s.dts + ROC-RK3328-CC M: Loic Devulder <ldevulder@suse.com> M: Chen-Yu Tsai <wens@csie.org> diff --git a/board/sipeed/maix/Kconfig b/board/sipeed/maix/Kconfig index 4c42dd2087..2cdea8ea81 100644 --- a/board/sipeed/maix/Kconfig +++ b/board/sipeed/maix/Kconfig @@ -53,4 +53,20 @@ config BOARD_SPECIFIC_OPTIONS imply CMD_GPIO imply LED imply LED_GPIO + imply SPI + imply DESIGNWARE_SPI + imply SPI_FLASH_GIGADEVICE + imply SPI_FLASH_WINBOND + imply DM_MTD + imply SPI_FLASH_MTD + imply CMD_MTD + imply ENV_IS_IN_SPI_FLASH + imply MMC + imply MMC_BROKEN_CD + imply MMC_SPI + imply CMD_MMC + imply DOS_PARTITION + imply EFI_PARTITION + imply CMD_PART + imply CMD_FS_GENERIC endif diff --git a/board/st/common/MAINTAINERS b/board/st/common/MAINTAINERS index 3b02f4ab98..c4e0c5fd94 100644 --- a/board/st/common/MAINTAINERS +++ b/board/st/common/MAINTAINERS @@ -1,5 +1,5 @@ ST BOARDS -M: Patrick Delaunay <patrick.delaunay@st.com> +M: Patrick Delaunay <patrick.delaunay@foss.st.com> L: uboot-stm32@st-md-mailman.stormreply.com (moderated for non-subscribers) T: git https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git S: Maintained diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c index 9c3d115dce..5633a6cb95 100644 --- a/board/st/common/stm32mp_dfu.c +++ b/board/st/common/stm32mp_dfu.c @@ -8,6 +8,7 @@ #include <dm.h> #include <dfu.h> #include <env.h> +#include <log.h> #include <memalign.h> #include <misc.h> #include <mtd.h> @@ -199,7 +200,7 @@ static int dfu_pmic_read(u64 offset, u8 *buffer, long *size) ret = 0; } #else - pr_err("PMIC update not supported"); + log_err("PMIC update not supported"); ret = -EOPNOTSUPP; #endif diff --git a/board/st/common/stm32mp_mtdparts.c b/board/st/common/stm32mp_mtdparts.c index 9f5897f8c8..71a0b449ad 100644 --- a/board/st/common/stm32mp_mtdparts.c +++ b/board/st/common/stm32mp_mtdparts.c @@ -8,6 +8,7 @@ #include <dm.h> #include <env.h> #include <env_internal.h> +#include <log.h> #include <mtd.h> #include <mtd_node.h> #include <tee.h> @@ -117,7 +118,7 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts) for (uclass_first_device(UCLASS_MTD, &dev); dev; uclass_next_device(&dev)) { - pr_debug("mtd device = %s\n", dev->name); + log_debug("mtd device = %s\n", dev->name); } if (nor || nand) { @@ -163,5 +164,5 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts) mtd_initialized = true; *mtdids = ids; *mtdparts = parts; - debug("%s:mtdids=%s & mtdparts=%s\n", __func__, ids, parts); + log_debug("mtdids=%s & mtdparts=%s\n", ids, parts); } diff --git a/board/st/common/stpmic1.c b/board/st/common/stpmic1.c index a313b817c5..5fb1be2fd3 100644 --- a/board/st/common/stpmic1.c +++ b/board/st/common/stpmic1.c @@ -3,8 +3,11 @@ * Copyright (C) 2020, STMicroelectronics - All Rights Reserved */ +#define LOG_CATEGORY LOGC_BOARD + #include <common.h> #include <dm.h> +#include <log.h> #include <asm/io.h> #include <asm/arch/ddr.h> #include <linux/bitops.h> @@ -202,7 +205,7 @@ void stpmic1_init(u32 voltage_mv) /* Check if debug is enabled to program PMIC according to the bit */ if (readl(TAMP_BOOT_CONTEXT) & TAMP_BOOT_DEBUG_ON) { - printf("Keep debug unit ON\n"); + log_info("Keep debug unit ON\n"); pmic_clrsetbits(dev, STPMIC1_BUCKS_MRST_CR, STPMIC1_MRST_BUCK_DEBUG, diff --git a/board/st/common/stusb160x.c b/board/st/common/stusb160x.c index e0a2b76353..f0385e5e38 100644 --- a/board/st/common/stusb160x.c +++ b/board/st/common/stusb160x.c @@ -6,6 +6,8 @@ * Copyright (C) 2020, STMicroelectronics - All Rights Reserved */ +#define LOG_CATEGORY UCLASS_I2C_GENERIC + #include <common.h> #include <dm.h> #include <i2c.h> diff --git a/board/st/stih410-b2260/MAINTAINERS b/board/st/stih410-b2260/MAINTAINERS index 4f557ac7d9..6fa625507b 100644 --- a/board/st/stih410-b2260/MAINTAINERS +++ b/board/st/stih410-b2260/MAINTAINERS @@ -1,5 +1,5 @@ STIH410-B2260 BOARD -M: Patrice Chotard <patrice.chotard@st.com> +M: Patrice Chotard <patrice.chotard@foss.st.com> S: Maintained F: board/st/stih410-b2260/ F: include/configs/stih410-b2260.h diff --git a/board/st/stih410-b2260/Makefile b/board/st/stih410-b2260/Makefile index dc3e1d3959..ea573ca145 100644 --- a/board/st/stih410-b2260/Makefile +++ b/board/st/stih410-b2260/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ # # Copyright (C) 2017, STMicroelectronics - All Rights Reserved -# Author(s): Patrice CHOTARD, <patrice.chotard@st.com> for STMicroelectronics. +# Author(s): Patrice CHOTARD, <patrice.chotard@foss.st.com> for STMicroelectronics. obj-y = board.o diff --git a/board/st/stm32f429-evaluation/MAINTAINERS b/board/st/stm32f429-evaluation/MAINTAINERS index 8b7b312eee..29d00ef27e 100644 --- a/board/st/stm32f429-evaluation/MAINTAINERS +++ b/board/st/stm32f429-evaluation/MAINTAINERS @@ -1,5 +1,5 @@ STM32F429-EVALUATION BOARD -M: Patrice Chotard <patrice.chotard@st.com> +M: Patrice Chotard <patrice.chotard@foss.st.com> S: Maintained F: board/st/stm32f429-evaluation/ F: include/configs/stm32f429-evaluation.h diff --git a/board/st/stm32f429-evaluation/Makefile b/board/st/stm32f429-evaluation/Makefile index 8bf9e1f6d8..109fba876b 100644 --- a/board/st/stm32f429-evaluation/Makefile +++ b/board/st/stm32f429-evaluation/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ # # Copyright (C) 2018, STMicroelectronics - All Rights Reserved -# Author(s): Patrice CHOTARD, <patrice.chotard@st.com> for STMicroelectronics. +# Author(s): Patrice CHOTARD, <patrice.chotard@foss.st.com> for STMicroelectronics. obj-y := stm32f429-evaluation.o diff --git a/board/st/stm32f469-discovery/MAINTAINERS b/board/st/stm32f469-discovery/MAINTAINERS index d3c791a5f5..5a6a78b39e 100644 --- a/board/st/stm32f469-discovery/MAINTAINERS +++ b/board/st/stm32f469-discovery/MAINTAINERS @@ -1,5 +1,5 @@ STM32F469-DISCOVERY BOARD -M: Patrice Chotard <patrice.chotard@st.com> +M: Patrice Chotard <patrice.chotard@foss.st.com> S: Maintained F: board/st/stm32f469-discovery/ F: include/configs/stm32f469-discovery.h diff --git a/board/st/stm32f469-discovery/Makefile b/board/st/stm32f469-discovery/Makefile index 249835b122..45480b72c5 100644 --- a/board/st/stm32f469-discovery/Makefile +++ b/board/st/stm32f469-discovery/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ # # Copyright (C) STMicroelectronics SA 2017 -# Author(s): Patrice CHOTARD, <patrice.chotard@st.com> for STMicroelectronics. +# Author(s): Patrice CHOTARD, <patrice.chotard@foss.st.com> for STMicroelectronics. obj-y := stm32f469-discovery.o diff --git a/board/st/stm32h743-disco/MAINTAINERS b/board/st/stm32h743-disco/MAINTAINERS index e5e0b5a6f2..60fbe344f8 100644 --- a/board/st/stm32h743-disco/MAINTAINERS +++ b/board/st/stm32h743-disco/MAINTAINERS @@ -1,5 +1,5 @@ STM32H743 DISCOVERY BOARD -M: Patrice Chotard <patrice.chotard@st.com> +M: Patrice Chotard <patrice.chotard@foss.st.com> S: Maintained F: board/st/stm32h743-disco F: include/configs/stm32h743-disco.h diff --git a/board/st/stm32h743-disco/Makefile b/board/st/stm32h743-disco/Makefile index 8fe7a2d6ff..b6c22be1ea 100644 --- a/board/st/stm32h743-disco/Makefile +++ b/board/st/stm32h743-disco/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ # # Copyright (C) 2017, STMicroelectronics - All Rights Reserved -# Author(s): Patrice CHOTARD, <patrice.chotard@st.com> for STMicroelectronics. +# Author(s): Patrice CHOTARD, <patrice.chotard@foss.st.com> for STMicroelectronics. obj-y := stm32h743-disco.o diff --git a/board/st/stm32h743-eval/MAINTAINERS b/board/st/stm32h743-eval/MAINTAINERS index 3029c56023..fda93db777 100644 --- a/board/st/stm32h743-eval/MAINTAINERS +++ b/board/st/stm32h743-eval/MAINTAINERS @@ -1,5 +1,5 @@ STM32H743 EVALUATION BOARD -M: Patrice Chotard <patrice.chotard@st.com> +M: Patrice Chotard <patrice.chotard@foss.st.com> S: Maintained F: board/st/stm32h743-eval F: include/configs/stm32h743-eval.h diff --git a/board/st/stm32h743-eval/Makefile b/board/st/stm32h743-eval/Makefile index 88b59fda0d..86ef19fc36 100644 --- a/board/st/stm32h743-eval/Makefile +++ b/board/st/stm32h743-eval/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ # # Copyright (C) 2017, STMicroelectronics - All Rights Reserved -# Author(s): Patrice CHOTARD, <patrice.chotard@st.com> for STMicroelectronics. +# Author(s): Patrice CHOTARD, <patrice.chotard@foss.st.com> for STMicroelectronics. obj-y := stm32h743-eval.o diff --git a/board/st/stm32mp1/MAINTAINERS b/board/st/stm32mp1/MAINTAINERS index 96c4559033..bd5c07da34 100644 --- a/board/st/stm32mp1/MAINTAINERS +++ b/board/st/stm32mp1/MAINTAINERS @@ -1,5 +1,5 @@ STM32MP1 BOARD -M: Patrick Delaunay <patrick.delaunay@st.com> +M: Patrick Delaunay <patrick.delaunay@foss.st.com> L: uboot-stm32@st-md-mailman.stormreply.com (moderated for non-subscribers) T: git https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git S: Maintained diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index df353cb5ec..78362d24a2 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -2,6 +2,9 @@ /* * Copyright (C) 2018, STMicroelectronics - All Rights Reserved */ + +#define LOG_CATEGORY LOGC_BOARD + #include <common.h> #include <adc.h> #include <bootm.h> @@ -106,12 +109,11 @@ int checkboard(void) else mode = "basic"; - printf("Board: stm32mp1 in %s mode", mode); fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible", &fdt_compat_len); - if (fdt_compat && fdt_compat_len) - printf(" (%s)", fdt_compat); - puts("\n"); + + log_info("Board: stm32mp1 in %s mode (%s)\n", mode, + fdt_compat && fdt_compat_len ? fdt_compat : ""); /* display the STMicroelectronics board identification */ if (CONFIG_IS_ENABLED(CMD_STBOARD)) { @@ -122,12 +124,12 @@ int checkboard(void) ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD), &otp, sizeof(otp)); if (ret > 0 && otp) - printf("Board: MB%04x Var%d.%d Rev.%c-%02d\n", - otp >> 16, - (otp >> 12) & 0xF, - (otp >> 4) & 0xF, - ((otp >> 8) & 0xF) - 1 + 'A', - otp & 0xF); + log_info("Board: MB%04x Var%d.%d Rev.%c-%02d\n", + otp >> 16, + (otp >> 12) & 0xF, + (otp >> 4) & 0xF, + ((otp >> 8) & 0xF) - 1 + 'A', + otp & 0xF); } return 0; @@ -144,17 +146,16 @@ static void board_key_check(void) node = ofnode_path("/config"); if (!ofnode_valid(node)) { - debug("%s: no /config node?\n", __func__); + log_debug("no /config node?\n"); return; } if (IS_ENABLED(CONFIG_FASTBOOT)) { if (gpio_request_by_name_nodev(node, "st,fastboot-gpios", 0, &gpio, GPIOD_IS_IN)) { - debug("%s: could not find a /config/st,fastboot-gpios\n", - __func__); + log_debug("could not find a /config/st,fastboot-gpios\n"); } else { if (dm_gpio_get_value(&gpio)) { - puts("Fastboot key pressed, "); + log_notice("Fastboot key pressed, "); boot_mode = BOOT_FASTBOOT; } @@ -164,18 +165,17 @@ static void board_key_check(void) if (IS_ENABLED(CONFIG_CMD_STM32PROG)) { if (gpio_request_by_name_nodev(node, "st,stm32prog-gpios", 0, &gpio, GPIOD_IS_IN)) { - debug("%s: could not find a /config/st,stm32prog-gpios\n", - __func__); + log_debug("could not find a /config/st,stm32prog-gpios\n"); } else { if (dm_gpio_get_value(&gpio)) { - puts("STM32Programmer key pressed, "); + log_notice("STM32Programmer key pressed, "); boot_mode = BOOT_STM32PROG; } dm_gpio_free(NULL, &gpio); } } if (boot_mode != BOOT_NORMAL) { - puts("entering download mode...\n"); + log_notice("entering download mode...\n"); clrsetbits_le32(TAMP_BOOT_CONTEXT, TAMP_BOOT_FORCED_MASK, boot_mode); @@ -198,8 +198,10 @@ int g_dnl_board_usb_cable_connected(void) ret = uclass_get_device_by_driver(UCLASS_USB_GADGET_GENERIC, DM_DRIVER_GET(dwc2_udc_otg), &dwc2_udc_otg); - if (!ret) - debug("dwc2_udc_otg init failed\n"); + if (ret) { + log_debug("dwc2_udc_otg init failed\n"); + return ret; + } return dwc2_udc_B_session_valid(dwc2_udc_otg); } @@ -231,13 +233,12 @@ static int get_led(struct udevice **dev, char *led_string) led_name = fdtdec_get_config_string(gd->fdt_blob, led_string); if (!led_name) { - pr_debug("%s: could not find %s config string\n", - __func__, led_string); + log_debug("could not find %s config string\n", led_string); return -ENOENT; } ret = led_get_by_label(led_name, dev); if (ret) { - debug("%s: get=%d\n", __func__, ret); + log_debug("get=%d\n", ret); return ret; } @@ -288,49 +289,19 @@ static void __maybe_unused led_error_blink(u32 nb_blink) hang(); } -static int board_check_usb_power(void) +static int adc_measurement(ofnode node, int adc_count, int *min_uV, int *max_uV) { struct ofnode_phandle_args adc_args; struct udevice *adc; - ofnode node; unsigned int raw; - int max_uV = 0; - int min_uV = USB_START_HIGH_THRESHOLD_UV; - int ret, uV, adc_count; - u32 nb_blink; - u8 i; - - if (!IS_ENABLED(CONFIG_ADC)) - return -ENODEV; - - node = ofnode_path("/config"); - if (!ofnode_valid(node)) { - debug("%s: no /config node?\n", __func__); - return -ENOENT; - } - - /* - * Retrieve the ADC channels devices and get measurement - * for each of them - */ - adc_count = ofnode_count_phandle_with_args(node, "st,adc_usb_pd", - "#io-channel-cells", 0); - if (adc_count < 0) { - if (adc_count == -ENOENT) - return 0; - - pr_err("%s: can't find adc channel (%d)\n", __func__, - adc_count); - - return adc_count; - } + int ret, uV; + int i; for (i = 0; i < adc_count; i++) { if (ofnode_parse_phandle_with_args(node, "st,adc_usb_pd", "#io-channel-cells", 0, i, &adc_args)) { - pr_debug("%s: can't find /config/st,adc_usb_pd\n", - __func__); + log_debug("can't find /config/st,adc_usb_pd\n"); return 0; } @@ -338,44 +309,91 @@ static int board_check_usb_power(void) &adc); if (ret) { - pr_err("%s: Can't get adc device(%d)\n", __func__, - ret); + log_err("Can't get adc device(%d)\n", ret); return ret; } ret = adc_channel_single_shot(adc->name, adc_args.args[0], &raw); if (ret) { - pr_err("%s: single shot failed for %s[%d]!\n", - __func__, adc->name, adc_args.args[0]); + log_err("single shot failed for %s[%d]!\n", + adc->name, adc_args.args[0]); return ret; } /* Convert to uV */ if (!adc_raw_to_uV(adc, raw, &uV)) { - if (uV > max_uV) - max_uV = uV; - if (uV < min_uV) - min_uV = uV; - pr_debug("%s: %s[%02d] = %u, %d uV\n", __func__, - adc->name, adc_args.args[0], raw, uV); + if (uV > *max_uV) + *max_uV = uV; + if (uV < *min_uV) + *min_uV = uV; + log_debug("%s[%02d] = %u, %d uV\n", + adc->name, adc_args.args[0], raw, uV); } else { - pr_err("%s: Can't get uV value for %s[%d]\n", - __func__, adc->name, adc_args.args[0]); + log_err("Can't get uV value for %s[%d]\n", + adc->name, adc_args.args[0]); } } + return 0; +} + +static int board_check_usb_power(void) +{ + ofnode node; + int max_uV = 0; + int min_uV = USB_START_HIGH_THRESHOLD_UV; + int adc_count, ret; + u32 nb_blink; + u8 i; + + node = ofnode_path("/config"); + if (!ofnode_valid(node)) { + log_debug("no /config node?\n"); + return -ENOENT; + } + /* - * If highest value is inside 1.23 Volts and 2.10 Volts, that means - * board is plugged on an USB-C 3A power supply and boot process can - * continue. + * Retrieve the ADC channels devices and get measurement + * for each of them */ - if (max_uV > USB_START_LOW_THRESHOLD_UV && - max_uV <= USB_START_HIGH_THRESHOLD_UV && - min_uV <= USB_LOW_THRESHOLD_UV) - return 0; + adc_count = ofnode_count_phandle_with_args(node, "st,adc_usb_pd", + "#io-channel-cells", 0); + if (adc_count < 0) { + if (adc_count == -ENOENT) + return 0; + + log_err("Can't find adc channel (%d)\n", adc_count); + + return adc_count; + } - pr_err("****************************************************\n"); + /* perform maximum of 2 ADC measurements to detect power supply current */ + for (i = 0; i < 2; i++) { + if (IS_ENABLED(CONFIG_ADC)) + ret = adc_measurement(node, adc_count, &min_uV, &max_uV); + else + ret = -ENODEV; + + if (ret) + return ret; + + /* + * If highest value is inside 1.23 Volts and 2.10 Volts, that means + * board is plugged on an USB-C 3A power supply and boot process can + * continue. + */ + if (max_uV > USB_START_LOW_THRESHOLD_UV && + max_uV <= USB_START_HIGH_THRESHOLD_UV && + min_uV <= USB_LOW_THRESHOLD_UV) + return 0; + + if (i == 0) { + log_err("Previous ADC measurements was not the one expected, retry in 20ms\n"); + mdelay(20); /* equal to max tPDDebounce duration (min 10ms - max 20ms) */ + } + } + log_notice("****************************************************\n"); /* * If highest and lowest value are either both below * USB_LOW_THRESHOLD_UV or both above USB_LOW_THRESHOLD_UV, that @@ -386,8 +404,8 @@ static int board_check_usb_power(void) min_uV > USB_LOW_THRESHOLD_UV) || (max_uV <= USB_LOW_THRESHOLD_UV && min_uV <= USB_LOW_THRESHOLD_UV)) { - pr_err("* ERROR USB TYPE-C connection in unattached mode *\n"); - pr_err("* Check that USB TYPE-C cable is correctly plugged *\n"); + log_notice("* ERROR USB TYPE-C connection in unattached mode *\n"); + log_notice("* Check that USB TYPE-C cable is correctly plugged *\n"); /* with 125ms interval, led will blink for 17.02 years ....*/ nb_blink = U32_MAX; } @@ -395,14 +413,14 @@ static int board_check_usb_power(void) if (max_uV > USB_LOW_THRESHOLD_UV && max_uV <= USB_WARNING_LOW_THRESHOLD_UV && min_uV <= USB_LOW_THRESHOLD_UV) { - pr_err("* WARNING 500mA power supply detected *\n"); + log_notice("* WARNING 500mA power supply detected *\n"); nb_blink = 2; } if (max_uV > USB_WARNING_LOW_THRESHOLD_UV && max_uV <= USB_START_LOW_THRESHOLD_UV && min_uV <= USB_LOW_THRESHOLD_UV) { - pr_err("* WARNING 1.5A power supply detected *\n"); + log_notice("* WARNING 1.5A power supply detected *\n"); nb_blink = 3; } @@ -411,14 +429,14 @@ static int board_check_usb_power(void) * supplies more than 3 Amp, this is not compliant with TypeC specification */ if (max_uV > USB_START_HIGH_THRESHOLD_UV) { - pr_err("* USB TYPE-C charger not compliant with *\n"); - pr_err("* specification *\n"); - pr_err("****************************************************\n\n"); + log_notice("* USB TYPE-C charger not compliant with *\n"); + log_notice("* specification *\n"); + log_notice("****************************************************\n\n"); /* with 125ms interval, led will blink for 17.02 years ....*/ nb_blink = U32_MAX; } else { - pr_err("* Current too low, use a 3A power supply! *\n"); - pr_err("****************************************************\n\n"); + log_notice("* Current too low, use a 3A power supply! *\n"); + log_notice("****************************************************\n\n"); } led_error_blink(nb_blink); @@ -471,7 +489,7 @@ static void sysconf_init(void) DM_DRIVER_GET(stm32mp_bsec), &dev); if (ret) { - pr_err("Can't find stm32mp_bsec driver\n"); + log_err("Can't find stm32mp_bsec driver\n"); return; } @@ -494,13 +512,13 @@ static void sysconf_init(void) syscfg + SYSCFG_IOCTRLSETR); if (!otp) - pr_err("product_below_2v5=0: HSLVEN protected by HW\n"); + log_err("product_below_2v5=0: HSLVEN protected by HW\n"); } else { if (otp) - pr_err("product_below_2v5=1: HSLVEN update is destructive, no update as VDD>2.7V\n"); + log_err("product_below_2v5=1: HSLVEN update is destructive, no update as VDD>2.7V\n"); } } else { - debug("VDD unknown"); + log_debug("VDD unknown"); } } @@ -514,7 +532,7 @@ static void sysconf_init(void) val & SYSCFG_CMPCR_READY, 1000000); if (ret) { - pr_err("SYSCFG: I/O compensation failed, timeout.\n"); + log_err("SYSCFG: I/O compensation failed, timeout.\n"); led_error_blink(10); } @@ -533,39 +551,37 @@ static int dk2_i2c1_fix(void) node = ofnode_path("/soc/i2c@40012000/hdmi-transmitter@39"); if (!ofnode_valid(node)) { - pr_debug("%s: no hdmi-transmitter@39 ?\n", __func__); + log_debug("no hdmi-transmitter@39 ?\n"); return -ENOENT; } if (gpio_request_by_name_nodev(node, "reset-gpios", 0, &hdmi, GPIOD_IS_OUT)) { - pr_debug("%s: could not find reset-gpios\n", - __func__); + log_debug("could not find reset-gpios\n"); return -ENOENT; } node = ofnode_path("/soc/i2c@40012000/cs42l51@4a"); if (!ofnode_valid(node)) { - pr_debug("%s: no cs42l51@4a ?\n", __func__); + log_debug("no cs42l51@4a ?\n"); return -ENOENT; } if (gpio_request_by_name_nodev(node, "reset-gpios", 0, &audio, GPIOD_IS_OUT)) { - pr_debug("%s: could not find reset-gpios\n", - __func__); + log_debug("could not find reset-gpios\n"); return -ENOENT; } /* before power up, insure that HDMI and AUDIO IC is under reset */ ret = dm_gpio_set_value(&hdmi, 1); if (ret) { - pr_err("%s: can't set_value for hdmi_nrst gpio", __func__); + log_err("can't set_value for hdmi_nrst gpio"); goto error; } ret = dm_gpio_set_value(&audio, 1); if (ret) { - pr_err("%s: can't set_value for audio_nrst gpio", __func__); + log_err("can't set_value for audio_nrst gpio"); goto error; } @@ -732,7 +748,7 @@ int board_interface_eth_init(struct udevice *dev, case PHY_INTERFACE_MODE_MII: value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII | SYSCFG_PMCSETR_ETH_REF_CLK_SEL; - debug("%s: PHY_INTERFACE_MODE_MII\n", __func__); + log_debug("PHY_INTERFACE_MODE_MII\n"); break; case PHY_INTERFACE_MODE_GMII: if (eth_clk_sel_reg) @@ -740,7 +756,7 @@ int board_interface_eth_init(struct udevice *dev, SYSCFG_PMCSETR_ETH_CLK_SEL; else value = SYSCFG_PMCSETR_ETH_SEL_GMII_MII; - debug("%s: PHY_INTERFACE_MODE_GMII\n", __func__); + log_debug("PHY_INTERFACE_MODE_GMII\n"); break; case PHY_INTERFACE_MODE_RMII: if (eth_ref_clk_sel_reg) @@ -748,7 +764,7 @@ int board_interface_eth_init(struct udevice *dev, SYSCFG_PMCSETR_ETH_REF_CLK_SEL; else value = SYSCFG_PMCSETR_ETH_SEL_RMII; - debug("%s: PHY_INTERFACE_MODE_RMII\n", __func__); + log_debug("PHY_INTERFACE_MODE_RMII\n"); break; case PHY_INTERFACE_MODE_RGMII: case PHY_INTERFACE_MODE_RGMII_ID: @@ -759,11 +775,11 @@ int board_interface_eth_init(struct udevice *dev, SYSCFG_PMCSETR_ETH_CLK_SEL; else value = SYSCFG_PMCSETR_ETH_SEL_RGMII; - debug("%s: PHY_INTERFACE_MODE_RGMII\n", __func__); + log_debug("PHY_INTERFACE_MODE_RGMII\n"); break; default: - debug("%s: Do not manage %d interface\n", - __func__, interface_type); + log_debug("Do not manage %d interface\n", + interface_type); /* Do not manage others interfaces */ return -EINVAL; } @@ -878,14 +894,14 @@ static void board_copro_image_process(ulong fw_image, size_t fw_size) if (!rproc_is_initialized()) if (rproc_init()) { - printf("Remote Processor %d initialization failed\n", - id); + log_err("Remote Processor %d initialization failed\n", + id); return; } ret = rproc_load(id, fw_image, fw_size); - printf("Load Remote Processor %d with data@addr=0x%08lx %u bytes:%s\n", - id, fw_image, fw_size, ret ? " Failed!" : " Success!"); + log_err("Load Remote Processor %d with data@addr=0x%08lx %u bytes:%s\n", + id, fw_image, fw_size, ret ? " Failed!" : " Success!"); if (!ret) rproc_start(id); diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index cdc06a39ce..df19aeadd0 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -324,25 +324,30 @@ void *board_fdt_blob_setup(void) { void *fdt_blob; -#if !defined(CONFIG_VERSAL_NO_DDR) && !defined(CONFIG_ZYNQMP_NO_DDR) - fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR; + if (!IS_ENABLED(CONFIG_SPL_BUILD) && + !IS_ENABLED(CONFIG_VERSAL_NO_DDR) && + !IS_ENABLED(CONFIG_VERSAL_NO_DDR)) { + fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR; - if (fdt_magic(fdt_blob) == FDT_MAGIC) - return fdt_blob; + if (fdt_magic(fdt_blob) == FDT_MAGIC) + return fdt_blob; - debug("DTB is not passed via %p\n", fdt_blob); -#endif + debug("DTB is not passed via %p\n", fdt_blob); + } -#ifdef CONFIG_SPL_BUILD - /* FDT is at end of BSS unless it is in a different memory region */ - if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)) - fdt_blob = (ulong *)&_image_binary_end; - else - fdt_blob = (ulong *)&__bss_end; -#else - /* FDT is at end of image */ - fdt_blob = (ulong *)&_end; -#endif + if (IS_ENABLED(CONFIG_SPL_BUILD)) { + /* + * FDT is at end of BSS unless it is in a different memory + * region + */ + if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)) + fdt_blob = (ulong *)&_image_binary_end; + else + fdt_blob = (ulong *)&__bss_end; + } else { + /* FDT is at end of image */ + fdt_blob = (ulong *)&_end; + } if (fdt_magic(fdt_blob) == FDT_MAGIC) return fdt_blob; diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 047b070485..459d9b1e47 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -648,6 +648,7 @@ int board_late_init(void) if (bootseq >= 0) { bootseq_len = snprintf(NULL, 0, "%i", bootseq); debug("Bootseq len: %x\n", bootseq_len); + env_set_hex("bootseq", bootseq); } /* |