From 87d1cac49d265ead979ff75bda36c45fa9025193 Mon Sep 17 00:00:00 2001 From: Mihai Sain Date: Mon, 24 Jul 2023 14:35:10 +0300 Subject: board: at91: sama5d29_curiosity: add initial support for sama5d29_curiosity Add initial support for sama5d29_curiosity board. Hardware: SoC: SAMA5D29 500 MHz DRAM: LPDDR2 512 MiB PMIC: MCP16502 Debug: UART0 Flash: QSPI NOR 8 MiB RGB LCD connector Mikrobus connectors x 2 SD-Card connectors x 2 USB 2.0 x 2 Signed-off-by: Mihai Sain --- board/atmel/sama5d29_curiosity/Kconfig | 15 ++++ board/atmel/sama5d29_curiosity/MAINTAINERS | 9 +++ board/atmel/sama5d29_curiosity/Makefile | 7 ++ .../atmel/sama5d29_curiosity/sama5d29_curiosity.c | 86 ++++++++++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 board/atmel/sama5d29_curiosity/Kconfig create mode 100644 board/atmel/sama5d29_curiosity/MAINTAINERS create mode 100644 board/atmel/sama5d29_curiosity/Makefile create mode 100644 board/atmel/sama5d29_curiosity/sama5d29_curiosity.c (limited to 'board') diff --git a/board/atmel/sama5d29_curiosity/Kconfig b/board/atmel/sama5d29_curiosity/Kconfig new file mode 100644 index 00000000000..64ca237697b --- /dev/null +++ b/board/atmel/sama5d29_curiosity/Kconfig @@ -0,0 +1,15 @@ +if TARGET_SAMA5D29_CURIOSITY + +config SYS_BOARD + default "sama5d29_curiosity" + +config SYS_VENDOR + default "atmel" + +config SYS_SOC + default "at91" + +config SYS_CONFIG_NAME + default "sama5d29_curiosity" + +endif diff --git a/board/atmel/sama5d29_curiosity/MAINTAINERS b/board/atmel/sama5d29_curiosity/MAINTAINERS new file mode 100644 index 00000000000..54894d6cbb6 --- /dev/null +++ b/board/atmel/sama5d29_curiosity/MAINTAINERS @@ -0,0 +1,9 @@ +SAMA5D29 CURIOSITY BOARD +M: Mihai Sain +S: Maintained +F: board/atmel/sama5d29_curiosity.c +F: include/configs/sama5d29_curiosity.h +F: configs/sama5d29_curiosity_mmc_defconfig +F: configs/sama5d29_curiosity_mmc1_defconfig +F: configs/sama5d29_curiosity_qspiflash_defconfig +F: arch/arm/dts/at91-sama5d29_curiosity* diff --git a/board/atmel/sama5d29_curiosity/Makefile b/board/atmel/sama5d29_curiosity/Makefile new file mode 100644 index 00000000000..848e1ce149c --- /dev/null +++ b/board/atmel/sama5d29_curiosity/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries +# +# Author: Mihai Sain + +obj-y += sama5d29_curiosity.o diff --git a/board/atmel/sama5d29_curiosity/sama5d29_curiosity.c b/board/atmel/sama5d29_curiosity/sama5d29_curiosity.c new file mode 100644 index 00000000000..d0679317fb2 --- /dev/null +++ b/board/atmel/sama5d29_curiosity/sama5d29_curiosity.c @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries + * + * Author: Mihai Sain + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern void at91_pda_detect(void); + +DECLARE_GLOBAL_DATA_PTR; + +static void rgb_leds_init(void) +{ + atmel_pio4_set_pio_output(AT91_PIO_PORTA, 7, 0); /* LED RED */ + atmel_pio4_set_pio_output(AT91_PIO_PORTA, 8, 0); /* LED GREEN */ + atmel_pio4_set_pio_output(AT91_PIO_PORTA, 9, 1); /* LED BLUE */ +} + +static void board_usb_hw_init(void) +{ + atmel_pio4_set_pio_output(AT91_PIO_PORTA, 6, 1); +} + +int board_late_init(void) +{ + at91_video_show_board_info(); + + at91_pda_detect(); + + return 0; +} + +static void board_uart0_hw_init(void) +{ + atmel_pio4_set_c_periph(AT91_PIO_PORTB, 26, ATMEL_PIO_PUEN_MASK); /* URXD0 */ + atmel_pio4_set_c_periph(AT91_PIO_PORTB, 27, 0); /* UTXD0 */ + + at91_periph_clk_enable(ATMEL_ID_UART0); +} + +void board_debug_uart_init(void) +{ + board_uart0_hw_init(); +} + +int board_early_init_f(void) +{ + debug_uart_init(); + + return 0; +} + +int board_init(void) +{ + /* address of boot parameters */ + gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100; + + rgb_leds_init(); + + board_usb_hw_init(); + + return 0; +} + +int dram_init_banksize(void) +{ + return fdtdec_setup_memory_banksize(); +} + +int dram_init(void) +{ + return fdtdec_setup_mem_size_base(); +} -- cgit v1.2.3 From 615828721abfe8c73b5103d4436402ecbf9b9897 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 14 Jul 2023 13:24:50 +0200 Subject: Revert "lib: string: Fix strlcpy return value", fix callers Both the Linux kernel and libbsd agree that strlcpy() should always return strlen(src) and not include the NUL termination. The incorrect U-Boot implementation makes it impossible to check the return value for truncation, and breaks code written with the usual implementation in mind (for example, fdtdec_add_reserved_memory() was subtly broken). I reviewed all callers of strlcpy() and strlcat() and fixed them according to my understanding of the intended function. This reverts commit d3358ecc54be0bc3b4dd11f7a63eab0a2842f772 and adds related fixes. Fixes: d3358ecc54be ("lib: string: Fix strlcpy return value") Signed-off-by: Matthias Schiffer Reviewed-by: Simon Glass Reviewed-by: Sean Anderson --- board/amlogic/vim3/vim3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'board') diff --git a/board/amlogic/vim3/vim3.c b/board/amlogic/vim3/vim3.c index fcd60ab1e05..8bdfb302f72 100644 --- a/board/amlogic/vim3/vim3.c +++ b/board/amlogic/vim3/vim3.c @@ -104,8 +104,8 @@ int meson_ft_board_setup(void *blob, struct bd_info *bd) } /* Update PHY names (mandatory to disable USB3.0) */ - len = strlcpy(data, "usb2-phy0", 32); - len += strlcpy(&data[len], "usb2-phy1", 32 - len); + len = strlcpy(data, "usb2-phy0", 32) + 1; + len += strlcpy(&data[len], "usb2-phy1", 32 - len) + 1; ret = fdt_setprop(blob, node, "phy-names", data, len); if (ret < 0) { printf("vim3: failed to update usb phy names property (%d)\n", ret); @@ -132,7 +132,7 @@ int meson_ft_board_setup(void *blob, struct bd_info *bd) } /* Enable PCIe */ - len = strlcpy(data, "okay", 32); + len = strlcpy(data, "okay", 32) + 1; ret = fdt_setprop(blob, node, "status", data, len); if (ret < 0) { printf("vim3: failed to enable pcie node (%d)\n", ret); -- cgit v1.2.3 From 1a549c8961a6db72db374a4db2be598b30c9c46d Mon Sep 17 00:00:00 2001 From: Ilya Lukin <4.shket@gmail.com> Date: Fri, 14 Jul 2023 17:39:32 +0300 Subject: crc32: Drop duplicates crc header includes Fixes: 3db711085752 ("crc32: Use the crc.h header for crc functions") Signed-off-by: Ilya Lukin <4.shket@gmail.com> --- board/sunxi/board.c | 1 - 1 file changed, 1 deletion(-) (limited to 'board') diff --git a/board/sunxi/board.c b/board/sunxi/board.c index f321cd58a6e..de0f3505e52 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -33,7 +33,6 @@ #include #include #include -#include #ifndef CONFIG_ARM64 #include #endif -- cgit v1.2.3 From 506df9dc5881b74ca6463b89e9edcd14732a7da5 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Thu, 3 Aug 2023 09:47:16 +0800 Subject: treewide: rework linker symbol declarations in sections header 1. Convert all linker symbols to char[] type so that we can get the corresponding address by calling array name 'var' or its address '&var'. In this way, we can avoid some potential issues[1]. 2. Remove unused symbol '_TEXT_BASE'. It has been abandoned and has not been referenced by any source code. 3. Move '__data_end' to the arch x86's own sections header as it's only used by x86 arch. 4. Remove some duplicate declared linker symbols. Now we use the standard header file to declare them. [1] This patch fixes the boot failure on MIPS target. Error log: SPL: Image overlaps SPL Fixes: 1b8a1be1a1f1 ("spl: spl_legacy: Fix spl_end address") Signed-off-by: Shiji Yang Reviewed-by: Tom Rini --- board/advantech/imx8qm_dmsse20_a1/spl.c | 1 + board/advantech/imx8qm_rom7720_a1/spl.c | 1 + board/aristainetos/aristainetos.c | 2 +- board/beacon/imx8mm/spl.c | 1 + board/beacon/imx8mn/spl.c | 1 + board/bosch/acc/acc.c | 1 + board/bsh/imx8mn_smm_s2/spl.c | 1 + board/cloos/imx8mm_phg/spl.c | 1 + board/compulab/cl-som-imx7/spl.c | 1 + board/compulab/imx8mm-cl-iot-gate/spl.c | 1 + board/congatec/cgtqmx8/spl.c | 1 + board/dhelectronics/dh_imx6/dh_imx6_spl.c | 1 + board/dhelectronics/dh_imx8mp/spl.c | 1 + board/engicam/imx8mm/spl.c | 1 + board/freescale/imx8mm_evk/spl.c | 1 + board/freescale/imx8mn_evk/spl.c | 1 + board/freescale/imx8mq_evk/spl.c | 1 + board/freescale/imx8qm_mek/spl.c | 1 + board/freescale/imx8qxp_mek/spl.c | 1 + board/freescale/imx8ulp_evk/spl.c | 1 + board/freescale/imx93_evk/spl.c | 1 + board/freescale/ls1021aiot/ls1021aiot.c | 1 + board/freescale/ls1021aqds/ls1021aqds.c | 1 + board/freescale/ls1021atsn/ls1021atsn.c | 1 + board/freescale/ls1021atwr/ls1021atwr.c | 1 + board/freescale/mx6sabreauto/mx6sabreauto.c | 1 + board/freescale/mx6sabresd/mx6sabresd.c | 1 + board/freescale/mx6slevk/mx6slevk.c | 1 + board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c | 1 + board/gateworks/venice/spl.c | 1 + board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c | 1 + board/kontron/pitx_imx8m/spl.c | 1 + board/kontron/sl-mx6ul/spl.c | 1 + board/kontron/sl-mx8mm/spl.c | 1 + board/liebherr/display5/spl.c | 1 + board/mntre/imx8mq_reform2/spl.c | 1 + board/phytec/pcm058/pcm058.c | 1 + board/phytec/phycore_imx8mm/spl.c | 1 + board/ronetix/imx7-cm/spl.c | 1 + board/ronetix/imx8mq-cm/spl.c | 1 + board/siemens/capricorn/spl.c | 1 + board/softing/vining_2000/vining_2000.c | 1 + board/solidrun/mx6cuboxi/mx6cuboxi.c | 1 + board/technexion/pico-imx6ul/spl.c | 1 + board/technexion/pico-imx7d/spl.c | 1 + board/technexion/pico-imx8mq/spl.c | 1 + board/toradex/apalis_imx6/apalis_imx6.c | 1 + board/toradex/colibri_imx6/colibri_imx6.c | 1 + board/toradex/verdin-imx8mm/spl.c | 1 + board/udoo/neo/neo.c | 1 + board/variscite/dart_6ul/spl.c | 1 + board/variscite/imx8mn_var_som/spl.c | 1 + 52 files changed, 52 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/advantech/imx8qm_dmsse20_a1/spl.c b/board/advantech/imx8qm_dmsse20_a1/spl.c index f36caece7d7..e8959ede51d 100644 --- a/board/advantech/imx8qm_dmsse20_a1/spl.c +++ b/board/advantech/imx8qm_dmsse20_a1/spl.c @@ -14,6 +14,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/advantech/imx8qm_rom7720_a1/spl.c b/board/advantech/imx8qm_rom7720_a1/spl.c index 922bb0b7d43..d32400101fc 100644 --- a/board/advantech/imx8qm_rom7720_a1/spl.c +++ b/board/advantech/imx8qm_rom7720_a1/spl.c @@ -17,6 +17,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/aristainetos/aristainetos.c b/board/aristainetos/aristainetos.c index 4dcf3f396b8..17f37badd74 100644 --- a/board/aristainetos/aristainetos.c +++ b/board/aristainetos/aristainetos.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -216,7 +217,6 @@ static void set_gpr_register(void) &iomuxc_regs->gpr[12]); } -extern char __bss_start[], __bss_end[]; int board_early_init_f(void) { select_ldb_di_clock_source(MXC_PLL5_CLK); diff --git a/board/beacon/imx8mm/spl.c b/board/beacon/imx8mm/spl.c index b2830c5223a..1632238bf5d 100644 --- a/board/beacon/imx8mm/spl.c +++ b/board/beacon/imx8mm/spl.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff --git a/board/beacon/imx8mn/spl.c b/board/beacon/imx8mn/spl.c index 9acd9161800..b4d46f11f98 100644 --- a/board/beacon/imx8mn/spl.c +++ b/board/beacon/imx8mn/spl.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/board/bosch/acc/acc.c b/board/bosch/acc/acc.c index 7c49b206c15..34088adee47 100644 --- a/board/bosch/acc/acc.c +++ b/board/bosch/acc/acc.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/board/bsh/imx8mn_smm_s2/spl.c b/board/bsh/imx8mn_smm_s2/spl.c index ce0504a011a..5a77d28cb7e 100644 --- a/board/bsh/imx8mn_smm_s2/spl.c +++ b/board/bsh/imx8mn_smm_s2/spl.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include diff --git a/board/cloos/imx8mm_phg/spl.c b/board/cloos/imx8mm_phg/spl.c index e63904eade8..0c3a0135a86 100644 --- a/board/cloos/imx8mm_phg/spl.c +++ b/board/cloos/imx8mm_phg/spl.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/board/compulab/cl-som-imx7/spl.c b/board/compulab/cl-som-imx7/spl.c index 5d4c4d39e72..98c3b831f1e 100644 --- a/board/compulab/cl-som-imx7/spl.c +++ b/board/compulab/cl-som-imx7/spl.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "common.h" #ifdef CONFIG_FSL_ESDHC_IMX diff --git a/board/compulab/imx8mm-cl-iot-gate/spl.c b/board/compulab/imx8mm-cl-iot-gate/spl.c index d2d20269ba0..19c1acd8a52 100644 --- a/board/compulab/imx8mm-cl-iot-gate/spl.c +++ b/board/compulab/imx8mm-cl-iot-gate/spl.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/board/congatec/cgtqmx8/spl.c b/board/congatec/cgtqmx8/spl.c index dea34e4dc63..b432ce27459 100644 --- a/board/congatec/cgtqmx8/spl.c +++ b/board/congatec/cgtqmx8/spl.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/board/dhelectronics/dh_imx6/dh_imx6_spl.c b/board/dhelectronics/dh_imx6/dh_imx6_spl.c index 20a330cce62..e6d5657c62d 100644 --- a/board/dhelectronics/dh_imx6/dh_imx6_spl.c +++ b/board/dhelectronics/dh_imx6/dh_imx6_spl.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/board/dhelectronics/dh_imx8mp/spl.c b/board/dhelectronics/dh_imx8mp/spl.c index e2aa874723a..a8fda139aa4 100644 --- a/board/dhelectronics/dh_imx8mp/spl.c +++ b/board/dhelectronics/dh_imx8mp/spl.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/board/engicam/imx8mm/spl.c b/board/engicam/imx8mm/spl.c index 1846134a492..af9044a3c2b 100644 --- a/board/engicam/imx8mm/spl.c +++ b/board/engicam/imx8mm/spl.c @@ -16,6 +16,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/freescale/imx8mm_evk/spl.c b/board/freescale/imx8mm_evk/spl.c index 6e9513805cd..35437811d9d 100644 --- a/board/freescale/imx8mm_evk/spl.c +++ b/board/freescale/imx8mm_evk/spl.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/board/freescale/imx8mn_evk/spl.c b/board/freescale/imx8mn_evk/spl.c index ec0378b5b76..dd54fa9b608 100644 --- a/board/freescale/imx8mn_evk/spl.c +++ b/board/freescale/imx8mn_evk/spl.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include diff --git a/board/freescale/imx8mq_evk/spl.c b/board/freescale/imx8mq_evk/spl.c index bea9ddc9960..818cdd615eb 100644 --- a/board/freescale/imx8mq_evk/spl.c +++ b/board/freescale/imx8mq_evk/spl.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/board/freescale/imx8qm_mek/spl.c b/board/freescale/imx8qm_mek/spl.c index 332a662dee8..17fd437116d 100644 --- a/board/freescale/imx8qm_mek/spl.c +++ b/board/freescale/imx8qm_mek/spl.c @@ -17,6 +17,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/freescale/imx8qxp_mek/spl.c b/board/freescale/imx8qxp_mek/spl.c index 75aab1651c0..462c43ceebc 100644 --- a/board/freescale/imx8qxp_mek/spl.c +++ b/board/freescale/imx8qxp_mek/spl.c @@ -22,6 +22,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/freescale/imx8ulp_evk/spl.c b/board/freescale/imx8ulp_evk/spl.c index 66d0f68cc62..c49b5be4762 100644 --- a/board/freescale/imx8ulp_evk/spl.c +++ b/board/freescale/imx8ulp_evk/spl.c @@ -20,6 +20,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/freescale/imx93_evk/spl.c b/board/freescale/imx93_evk/spl.c index 63883b30dd7..be9c24fc0d9 100644 --- a/board/freescale/imx93_evk/spl.c +++ b/board/freescale/imx93_evk/spl.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/board/freescale/ls1021aiot/ls1021aiot.c b/board/freescale/ls1021aiot/ls1021aiot.c index 8605d064138..d6f22bd6a2a 100644 --- a/board/freescale/ls1021aiot/ls1021aiot.c +++ b/board/freescale/ls1021aiot/ls1021aiot.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include diff --git a/board/freescale/ls1021aqds/ls1021aqds.c b/board/freescale/ls1021aqds/ls1021aqds.c index d5cb7312095..a618ce11a58 100644 --- a/board/freescale/ls1021aqds/ls1021aqds.c +++ b/board/freescale/ls1021aqds/ls1021aqds.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/board/freescale/ls1021atsn/ls1021atsn.c b/board/freescale/ls1021atsn/ls1021atsn.c index d144f25c623..d0e4e796c60 100644 --- a/board/freescale/ls1021atsn/ls1021atsn.c +++ b/board/freescale/ls1021atsn/ls1021atsn.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include "../common/sleep.h" #include diff --git a/board/freescale/ls1021atwr/ls1021atwr.c b/board/freescale/ls1021atwr/ls1021atwr.c index 4f5834347db..27b9d79e5f0 100644 --- a/board/freescale/ls1021atwr/ls1021atwr.c +++ b/board/freescale/ls1021atwr/ls1021atwr.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c b/board/freescale/mx6sabreauto/mx6sabreauto.c index 039deb5bf94..77e92006131 100644 --- a/board/freescale/mx6sabreauto/mx6sabreauto.c +++ b/board/freescale/mx6sabreauto/mx6sabreauto.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index 96a76b0581c..b558a596dff 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index 2c90a35e2c9..e9ac57118b0 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c index 570b5014dbb..534b16cec7a 100644 --- a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c +++ b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/board/gateworks/venice/spl.c b/board/gateworks/venice/spl.c index 5aa209578b2..774a99041c8 100644 --- a/board/gateworks/venice/spl.c +++ b/board/gateworks/venice/spl.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c index 103c4531a64..54902437940 100644 --- a/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c +++ b/board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/board/kontron/pitx_imx8m/spl.c b/board/kontron/pitx_imx8m/spl.c index f6fd17048d0..a247803a4b4 100644 --- a/board/kontron/pitx_imx8m/spl.c +++ b/board/kontron/pitx_imx8m/spl.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/board/kontron/sl-mx6ul/spl.c b/board/kontron/sl-mx6ul/spl.c index a9d370bc854..b1758858705 100644 --- a/board/kontron/sl-mx6ul/spl.c +++ b/board/kontron/sl-mx6ul/spl.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/board/kontron/sl-mx8mm/spl.c b/board/kontron/sl-mx8mm/spl.c index b49373442a2..54ee1e66a7a 100644 --- a/board/kontron/sl-mx8mm/spl.c +++ b/board/kontron/sl-mx8mm/spl.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c index 4219d002fec..97928e92215 100644 --- a/board/liebherr/display5/spl.c +++ b/board/liebherr/display5/spl.c @@ -25,6 +25,7 @@ #include "asm/arch/iomux.h" #include #include +#include #include #include #include diff --git a/board/mntre/imx8mq_reform2/spl.c b/board/mntre/imx8mq_reform2/spl.c index 21fad4972ab..5120c628b91 100644 --- a/board/mntre/imx8mq_reform2/spl.c +++ b/board/mntre/imx8mq_reform2/spl.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/board/phytec/pcm058/pcm058.c b/board/phytec/pcm058/pcm058.c index 5e5b129ef1f..b37c6fe218d 100644 --- a/board/phytec/pcm058/pcm058.c +++ b/board/phytec/pcm058/pcm058.c @@ -17,6 +17,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/phytec/phycore_imx8mm/spl.c b/board/phytec/phycore_imx8mm/spl.c index 1bae9b1170d..690a51f7a72 100644 --- a/board/phytec/phycore_imx8mm/spl.c +++ b/board/phytec/phycore_imx8mm/spl.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/board/ronetix/imx7-cm/spl.c b/board/ronetix/imx7-cm/spl.c index d36f734e49c..b94cfd6ffc6 100644 --- a/board/ronetix/imx7-cm/spl.c +++ b/board/ronetix/imx7-cm/spl.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/board/ronetix/imx8mq-cm/spl.c b/board/ronetix/imx8mq-cm/spl.c index b9a67451aec..1c675bcab25 100644 --- a/board/ronetix/imx8mq-cm/spl.c +++ b/board/ronetix/imx8mq-cm/spl.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/board/siemens/capricorn/spl.c b/board/siemens/capricorn/spl.c index 8e077d73aef..e160c611a96 100644 --- a/board/siemens/capricorn/spl.c +++ b/board/siemens/capricorn/spl.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/board/softing/vining_2000/vining_2000.c b/board/softing/vining_2000/vining_2000.c index aaeeee361e5..4483bd7f7a3 100644 --- a/board/softing/vining_2000/vining_2000.c +++ b/board/softing/vining_2000/vining_2000.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index 6fa5cf4d27d..e119330bc0c 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/board/technexion/pico-imx6ul/spl.c b/board/technexion/pico-imx6ul/spl.c index 251f5a1b7d0..ff56fd88d68 100644 --- a/board/technexion/pico-imx6ul/spl.c +++ b/board/technexion/pico-imx6ul/spl.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/board/technexion/pico-imx7d/spl.c b/board/technexion/pico-imx7d/spl.c index f86fee9c88e..c6b21aaa42d 100644 --- a/board/technexion/pico-imx7d/spl.c +++ b/board/technexion/pico-imx7d/spl.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/board/technexion/pico-imx8mq/spl.c b/board/technexion/pico-imx8mq/spl.c index 2afb4d37608..1a9c7996cb2 100644 --- a/board/technexion/pico-imx8mq/spl.c +++ b/board/technexion/pico-imx8mq/spl.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c index 3c7cfa309c1..fa6b7226fed 100644 --- a/board/toradex/apalis_imx6/apalis_imx6.c +++ b/board/toradex/apalis_imx6/apalis_imx6.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c index 677caa4a4eb..e6c9b10570d 100644 --- a/board/toradex/colibri_imx6/colibri_imx6.c +++ b/board/toradex/colibri_imx6/colibri_imx6.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c index 9d54d60bb17..afa3686083a 100644 --- a/board/toradex/verdin-imx8mm/spl.c +++ b/board/toradex/verdin-imx8mm/spl.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/board/udoo/neo/neo.c b/board/udoo/neo/neo.c index 1287f719197..730e266469b 100644 --- a/board/udoo/neo/neo.c +++ b/board/udoo/neo/neo.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/board/variscite/dart_6ul/spl.c b/board/variscite/dart_6ul/spl.c index 17b1ae74884..1dff69c8277 100644 --- a/board/variscite/dart_6ul/spl.c +++ b/board/variscite/dart_6ul/spl.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ diff --git a/board/variscite/imx8mn_var_som/spl.c b/board/variscite/imx8mn_var_som/spl.c index 41e70505774..01a63c69641 100644 --- a/board/variscite/imx8mn_var_som/spl.c +++ b/board/variscite/imx8mn_var_som/spl.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From ccea96f443e2d35cf5ecc341bb14569029eb93b8 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Thu, 3 Aug 2023 09:47:17 +0800 Subject: treewide: unify the linker symbol reference format Now all linker symbols are declared as type char[]. Though we can reference the address via both the array name 'var' and its address '&var'. It's better to unify them to avoid confusing developers. This patch converts all '&var' linker symbol refrences to the most commonly used format 'var'. Signed-off-by: Shiji Yang Reviewed-by: Tom Rini --- board/sifive/unleashed/unleashed.c | 2 +- board/sifive/unmatched/unmatched.c | 2 +- board/starfive/visionfive2/starfive_visionfive2.c | 2 +- board/xilinx/common/board.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'board') diff --git a/board/sifive/unleashed/unleashed.c b/board/sifive/unleashed/unleashed.c index b6ab06a08fb..3c5dd50c369 100644 --- a/board/sifive/unleashed/unleashed.c +++ b/board/sifive/unleashed/unleashed.c @@ -122,7 +122,7 @@ void *board_fdt_blob_setup(int *err) return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; } - return (ulong *)&_end; + return (ulong *)_end; } int board_init(void) diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c index 6295deeae23..6675548c2bf 100644 --- a/board/sifive/unmatched/unmatched.c +++ b/board/sifive/unmatched/unmatched.c @@ -19,7 +19,7 @@ void *board_fdt_blob_setup(int *err) return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; } - return (ulong *)&_end; + return (ulong *)_end; } int board_init(void) diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c index 07dcca26b30..d609262b676 100644 --- a/board/starfive/visionfive2/starfive_visionfive2.c +++ b/board/starfive/visionfive2/starfive_visionfive2.c @@ -49,5 +49,5 @@ void *board_fdt_blob_setup(int *err) return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; } - return (ulong *)&_end; + return (ulong *)_end; } diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 0328d68e751..bc5cdd89b55 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -374,12 +374,12 @@ void *board_fdt_blob_setup(int *err) * region */ if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)) - fdt_blob = (ulong *)&_image_binary_end; + fdt_blob = (ulong *)_image_binary_end; else - fdt_blob = (ulong *)&__bss_end; + fdt_blob = (ulong *)__bss_end; } else { /* FDT is at end of image */ - fdt_blob = (ulong *)&_end; + fdt_blob = (ulong *)_end; } if (fdt_magic(fdt_blob) == FDT_MAGIC) -- cgit v1.2.3 From d3c830228f69de8bd65782e54eeb762f68655784 Mon Sep 17 00:00:00 2001 From: Roger Quadros Date: Sat, 5 Aug 2023 11:14:37 +0300 Subject: board: ti: am64x: Recognize AM64-HSEVM AM64-HSEVM is AM64-GPEVM with High Security Device. Gets rid of "Unidentified board claims AM64-HSEVM in eeprom header". Signed-off-by: Roger Quadros Acked-by: Andrew Davis Reviewed-by: Nishanth Menon Tested-by: Nishanth Menon #SK-AM64B --- board/ti/am64x/evm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c index 96f4e3013a3..a080b2b0d25 100644 --- a/board/ti/am64x/evm.c +++ b/board/ti/am64x/evm.c @@ -18,7 +18,8 @@ #include "../common/board_detect.h" -#define board_is_am64x_gpevm() board_ti_k3_is("AM64-GPEVM") +#define board_is_am64x_gpevm() (board_ti_k3_is("AM64-GPEVM") || \ + board_ti_k3_is("AM64-HSEVM")) #define board_is_am64x_skevm() (board_ti_k3_is("AM64-SKEVM") || \ board_ti_k3_is("AM64B-SKEVM")) -- cgit v1.2.3 From 4d6641d5db85827e9efeab4cec84befbee1cd9f6 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Mon, 14 Aug 2023 20:39:41 +0300 Subject: arm: qemu: Enable Bochs video support Commit 716161663ec49 ("riscv: qemu: Enable Bochs video support") enables a video console for QEMU RISC-V virtual machines using an emulated Bochs VGA card. Similarly, enable it for ARM virtual machines as well. Signed-off-by: Alper Nebi Yasak Reviewed-by: Bin Meng --- board/emulation/qemu-arm/qemu-arm.env | 3 +++ 1 file changed, 3 insertions(+) (limited to 'board') diff --git a/board/emulation/qemu-arm/qemu-arm.env b/board/emulation/qemu-arm/qemu-arm.env index e658d5ee7d6..86a99a2e871 100644 --- a/board/emulation/qemu-arm/qemu-arm.env +++ b/board/emulation/qemu-arm/qemu-arm.env @@ -2,6 +2,9 @@ /* environment for qemu-arm and qemu-arm64 */ +stdin=serial +stdout=serial,vidconsole +stderr=serial,vidconsole fdt_high=0xffffffff initrd_high=0xffffffff fdt_addr=0x40000000 -- cgit v1.2.3 From 120f540a71e425efc702308352453ddf443a2c98 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Mon, 14 Aug 2023 20:39:42 +0300 Subject: arm: qemu: Enable PRE_CONSOLE_BUFFER Commit 608b80b5b855 ("riscv: qemu: Enable PRE_CONSOLE_BUFFER") enables buffering console messages for QEMU RISC-V virtual machines so those printed before the video console is available will still show up on the display. Similarly, enable it for ARM virtual machines as well. Signed-off-by: Alper Nebi Yasak Reviewed-by: Simon Glass Reviewed-by: Bin Meng --- board/emulation/qemu-arm/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'board') diff --git a/board/emulation/qemu-arm/Kconfig b/board/emulation/qemu-arm/Kconfig index ed9949651c4..09c95413a54 100644 --- a/board/emulation/qemu-arm/Kconfig +++ b/board/emulation/qemu-arm/Kconfig @@ -12,6 +12,10 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply VIRTIO_NET imply VIRTIO_BLK +config PRE_CON_BUF_ADDR + hex + default 0x40100000 + endif if TARGET_QEMU_ARM_64BIT && !TFABOOT -- cgit v1.2.3 From 05e2fa79310ab30dd3e3fe522333aef3cfb1c421 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Mon, 14 Aug 2023 20:39:43 +0300 Subject: arm: qemu: Enable usb keyboard as an input device Commit 02be57caf730 ("riscv: qemu: Enable usb keyboard as an input device") adds PCI xHCI support to QEMU RISC-V virtual machines and enables using a USB keyboard as one of the input devices. Similarly, enable those for ARM virtual machines as well. Signed-off-by: Alper Nebi Yasak Reviewed-by: Simon Glass Reviewed-by: Bin Meng --- board/emulation/qemu-arm/qemu-arm.c | 5 +++++ board/emulation/qemu-arm/qemu-arm.env | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c index dfea0d92a3c..942f1fff571 100644 --- a/board/emulation/qemu-arm/qemu-arm.c +++ b/board/emulation/qemu-arm/qemu-arm.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -114,6 +115,10 @@ int board_late_init(void) */ virtio_init(); + /* start usb so that usb keyboard can be used as input device */ + if (CONFIG_IS_ENABLED(USB_KEYBOARD)) + usb_init(); + return 0; } diff --git a/board/emulation/qemu-arm/qemu-arm.env b/board/emulation/qemu-arm/qemu-arm.env index 86a99a2e871..fb4adef281e 100644 --- a/board/emulation/qemu-arm/qemu-arm.env +++ b/board/emulation/qemu-arm/qemu-arm.env @@ -2,7 +2,7 @@ /* environment for qemu-arm and qemu-arm64 */ -stdin=serial +stdin=serial,usbkbd stdout=serial,vidconsole stderr=serial,vidconsole fdt_high=0xffffffff -- cgit v1.2.3 From 1818b44b7bc8c8aaaa0d80c9a47e559a1f07bf1d Mon Sep 17 00:00:00 2001 From: Alexander Dahl Date: Wed, 23 Aug 2023 15:58:55 +0200 Subject: board: sam9x60-curiosity: Let LED subsystem init leds if enabled If CONFIG_LED and CONFIG_LED_GPIO are enabled, it is not necessary to initialize the RGB LED on the board by manually setting hardcoded GPIOs anymore. Everything is well defined in dts and can be used like on boards of other vendors. Keep the old behaviour as fallback, though. With all this in place enabling CONFIG_CMD_LED gives us a working 'led' command on the U-Boot shell. Signed-off-by: Alexander Dahl --- board/atmel/sam9x60_curiosity/sam9x60_curiosity.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'board') diff --git a/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c b/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c index 0fe0de9fde9..f53d359404e 100644 --- a/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c +++ b/board/atmel/sam9x60_curiosity/sam9x60_curiosity.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -18,6 +19,7 @@ #include #include #include +#include extern void at91_pda_detect(void); @@ -27,9 +29,25 @@ void at91_prepare_cpu_var(void); static void board_leds_init(void) { +#if CONFIG_IS_ENABLED(LED) + const char *led_name; + struct udevice *dev; + int ret; + + led_name = ofnode_conf_read_str("u-boot,boot-led"); + if (!led_name) + return; + + ret = led_get_by_label(led_name, &dev); + if (ret) + return; + + led_set_state(dev, LEDST_ON); +#else at91_set_pio_output(AT91_PIO_PORTD, 17, 0); /* LED RED */ at91_set_pio_output(AT91_PIO_PORTD, 19, 0); /* LED GREEN */ at91_set_pio_output(AT91_PIO_PORTD, 21, 1); /* LED BLUE */ +#endif } int board_late_init(void) -- cgit v1.2.3 From b74f62920bca5da25be0eefe08498d4d294b9697 Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Tue, 22 Aug 2023 23:09:56 +0530 Subject: sandbox: capsule: Add keys and certificates needed for capsule update testing Add the private keys and public key certificates which are to be used for capsule authentication while testing the EFI capsule update functionality. There are two pairs of private and public keys, good and bad. The good key pair will be used for signing capsules, whilst the bad key pair is to be used as malicious keys for testing authentication failure cases. The capsule_pub_key_good.crt is also converted to an EFI Signature List(ESL) file, SIGNER.esl, which is embedded in the platform's device-tree for capsule authentication. Signed-off-by: Sughosh Ganu Reviewed-by: Simon Glass --- board/sandbox/capsule_priv_key_bad.key | 28 ++++++++++++++++++++++++++++ board/sandbox/capsule_priv_key_good.key | 28 ++++++++++++++++++++++++++++ board/sandbox/capsule_pub_esl_good.esl | Bin 0 -> 831 bytes board/sandbox/capsule_pub_key_bad.crt | 19 +++++++++++++++++++ board/sandbox/capsule_pub_key_good.crt | 19 +++++++++++++++++++ 5 files changed, 94 insertions(+) create mode 100644 board/sandbox/capsule_priv_key_bad.key create mode 100644 board/sandbox/capsule_priv_key_good.key create mode 100644 board/sandbox/capsule_pub_esl_good.esl create mode 100644 board/sandbox/capsule_pub_key_bad.crt create mode 100644 board/sandbox/capsule_pub_key_good.crt (limited to 'board') diff --git a/board/sandbox/capsule_priv_key_bad.key b/board/sandbox/capsule_priv_key_bad.key new file mode 100644 index 00000000000..2324f69ebd1 --- /dev/null +++ b/board/sandbox/capsule_priv_key_bad.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmPw1pGd2xNW0p +lesRXkkek3uwUB06Nt61tnZvpMkBKt4IokqGWz1tZls+Z2CqvwOfcsPZ27cPRYSu +xRnM3YdL4MG6SePV7i/YSNw3rq8CP8zLGtCbNIfsfsNfPQEtPBpw6+7pMJKhjqpV +2U2UQzZEiX4qlnhLpyv2JNJag27yf0feLdJi7HnJ9xdvcXpA1DSGm4y+DDhgYeI8 +DEteEu6s0TYQfnOZSQOeJi+1/Qz0S594uFJB37MyGh/mB15ILb8gva4nA3ayHOBK +0dd+HSiUCGYrLYO7aj+nfzQj9N1qTlzCnC1603bMczU5pkwcODg6xP0Sn11J6RYy +y0c0qzJLAgMBAAECggEABDY2MLoew3IkBltrParAWAUUcFLi95jw92q6BkOHEJg8 +2qia1yCitPUtPodMLmOKF5x4EdgXg5sv2O8MGbWP1VtUKXGh3QJcnRnNmsZ1hXJC +RBcrei2aVLsqf0V2Mg3+GuG8PW3vLWHyZ/Sd6afeuXEYm2Bzrw9J5rfd3dBVKm7f +HBvIyy1ATO/2cbUaEaCLOyhxLhssTI2TIK5SjlsjFLxiQXEi6RyGfBxUCriKZykS +krMdvYh7Tf0uYcv0STmQ5s5Rd+RhRIGCVAdsNBxxJjgBAgqqa/B+kWbcc6o2D41n +yWjErUaBBx3t0A7oT4K4DSTYwMNDVY3fhdd+szsocQKBgQDjnm8LG4UO6OQDm6iX +0vTQTItoAz5TU6GEjHTCfVEqiupD4LKfHhSXwp2hRyzxXO5oNTU9MQCzYd7Npes0 +oVk4Tjo3YDacNPgxqKjODu/Q+tkTH15ydzGr674+YXHfCA1uT5GKOiiF0H1FZgMa +Dk0s+3uWX34vbL4QCu97bUhBewKBgQC6+Z0J9sClgWvvjkglJN3XhRnAacp+WgX7 +bkpgSboXIIsqeqhd1WCLeV7L1pcZgifYBMPojf5LTBqBedL1q3RuqiqQWD/bSIYN +Oc9KCdTjksS8Zo+w+s5zDObDhW9y13H2mKwDqilYBrT4fiA62wPMf1SjEF+RSC6K +ZrQzHO1xcQKBgAILsXnLFIYOx8XUh05eAf9BQNt9c/jxvnjffkklMS6Nsw9LHK/b +aFn40MvbROcia64aFFFpeFUkYwk8HYIKlS+xXEqVHciHnVds6Z94eOVK69qFJKco +tRSTeNE8tPZJLz23j1pLrYOOXSHbidmZGU53MCQo1Yx9kLO6NW7Ji6WzAoGBALP4 +lEoE80Xbn3NEdvkZ1VcfzLvCmKCqMlvjuz+Xd8HPF2VaDznSq01VFAQMmAB7obJy +U8hC9OSxakn6Yy8JS9dBgBrUdxKxaibM4FQZxosOuMPHzMPDhniDkJPemnnmGtIL +/nbAkW8jdYpCjO9Z5PwwC92xYuvKmNGrLgSM8ZhhAoGAfgSZTpASXubM18E3ecfw +5z333wf9qEQgZj7i9MzByFZudyHUhv/FPW1ocUJf36Wu1dfofZg3noSL6oakrm2v +dFDo4PoyCStuF0w9SSzpIld01ZG0t7XqphY0DmshCXIXsqr7Vb4WrbBI7KX+b3Um +BzmROfaSud97NjQ/RA26OZk= +-----END PRIVATE KEY----- diff --git a/board/sandbox/capsule_priv_key_good.key b/board/sandbox/capsule_priv_key_good.key new file mode 100644 index 00000000000..9a37f597964 --- /dev/null +++ b/board/sandbox/capsule_priv_key_good.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCwBfaV0P1jRzS6 +13U1T+4VbuMVsxFXhwHJY5z5Fx6v+cWBf3K1ruK+7cEnW55ZHXvNE2JCkjMvISKm +hI/DLJWIPnAus8tFdU/R2u5oJbKI+b6GbuamO/CG9HsXZ58lOC6r2ckjixxovsA9 +SFshccdIv2YrwiVsWeyFpH+rB3/+cFbrgdWpaUc1367GkU/ZCnSRDBvVvzRRI1a4 +y2NogFqbZHXHENpzWNJ3TTXhf9dwM5HFGkmX7SA43Dtazae6CB4EaUKzLYWj3+ae +AQbdvBrupKZQz1PUKn7X6+BGaLujHthvibYppNegPvqbJ1xBbv59CQK+lRULwC05 +NYw5+sIxAgMBAAECggEAHn8h/knjpMAw/BAZP//VrYP1Nwy7u/Dpl9U43JUrXWzG +Uc3dd2nR4id6GBIRCLqJePnbQ9JlqMwyXyxHZhbC34SF1imTVbjh9+dY99VULdQr +NMphDrsCzLbt3pu24HFv8Jk+dniDFwi5cMSo+U3nq4xxrLIp3rBjwLHD5sNZYyEU +9xZnj7ziTn5X8da8iRxNpyzz2kQeVemJ0ahr/IkX718bkakSFMesGkln06vH7rAs +069SeqOPrFEbWYXI5iMktLugl3JZpzasRE48j0M42PuProgvT7jb8B35ZF7kn0jT +MqTIHglsJRWcSY0fAb2lHSAvd2vLLVunxr9PDWZvGQKBgQDVzVTuvo1CrVrQLy+B +tpy2k5mjR3qxAOcoWTnKcMErLe8imWWaxukODenP4XqQIX4Sl+X3BXxOqun0Klap +FEsI7TWSHf0eULFtFj0SCgqfRR+V/nblP05eO2nFXgr5YdNa1bWf/aMHplBo4q9e +bbAr4InUB7IGWL2cWjhOhWuJbQKBgQDSw81cBM+vGPUYH/wlxlTVgZCo2Dg2NHjt +LUBqvOZNr21j2F+w8t1vKmqwhkqpc5HIi3pHjEA5gZLTRtmf4GQyo973I6MGn4bS +eayOd6/+FkAi9DUD+WaF7yctJqeevav6KF2UCiz78OtCAU5Y9jFFJpuOANIztI7m +t7ZCUpMFVQKBgFnAsP7oj3SGQbFTnaXeeztKCx04TJExx9hwXIpXe0AdMF5d9wFa +r0tvG9Bg34rSBJLZoXhpnR2JMl2FyIuCMV219t84J6IqTdF1nH2OKZdi9TeKc28Z +fFSirGxmZkT6hDeFr5FScLYtY2QkhWomseY5hKK1+E4hwrd4SFruN46hAoGBAJgh +nzTBgEtqH1enlrCJhSiLmihV0dVGcNb559pjuXTvoG0GfKPT2gPowRPkCzZe5ia0 +jrHgSWd44MtCA8nEBW8MG9+VyJH6Si3Yh7ZaLB2iX+8bCL1yow8f/c44bZtGW0F5 +K3q1EZ1VW+rL2IqcQhog8P1CGHgb514f0x3yTo71AoGACGdb+Nb6lg8OSJPUcuuH +xsWk6RhkJl9bldTleS+QT3R9zO3FvbTwnCCYJboh5Cq/jVmiA7T+fcVAyEJNHSdm +hxbHdScuiJdNWL9+FczOkylnKH3VEdG3RS5lGdyi6r+miTMs3h8WfzGp4JINysjg +PUFskK36qGjASfkRUn0hizQ= +-----END PRIVATE KEY----- diff --git a/board/sandbox/capsule_pub_esl_good.esl b/board/sandbox/capsule_pub_esl_good.esl new file mode 100644 index 00000000000..f8cc272309b Binary files /dev/null and b/board/sandbox/capsule_pub_esl_good.esl differ diff --git a/board/sandbox/capsule_pub_key_bad.crt b/board/sandbox/capsule_pub_key_bad.crt new file mode 100644 index 00000000000..2e8e5d58281 --- /dev/null +++ b/board/sandbox/capsule_pub_key_bad.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDDzCCAfegAwIBAgIUWw3vHYnrjoHUXytxSm2eYWzbYVAwDQYJKoZIhvcNAQEL +BQAwFjEUMBIGA1UEAwwLVEVTVF9TSUdORVIwIBcNMjMwODA0MTgwODEyWhgPMzAw +MzEwMDYxODA4MTJaMBYxFDASBgNVBAMMC1RFU1RfU0lHTkVSMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEApj8NaRndsTVtKZXrEV5JHpN7sFAdOjbetbZ2 +b6TJASreCKJKhls9bWZbPmdgqr8Dn3LD2du3D0WErsUZzN2HS+DBuknj1e4v2Ejc +N66vAj/MyxrQmzSH7H7DXz0BLTwacOvu6TCSoY6qVdlNlEM2RIl+KpZ4S6cr9iTS +WoNu8n9H3i3SYux5yfcXb3F6QNQ0hpuMvgw4YGHiPAxLXhLurNE2EH5zmUkDniYv +tf0M9EufeLhSQd+zMhof5gdeSC2/IL2uJwN2shzgStHXfh0olAhmKy2Du2o/p380 +I/Tdak5cwpwtetN2zHM1OaZMHDg4OsT9Ep9dSekWMstHNKsySwIDAQABo1MwUTAd +BgNVHQ4EFgQUm9b8SnF811nweXSfGisfpzUHGwgwHwYDVR0jBBgwFoAUm9b8SnF8 +11nweXSfGisfpzUHGwgwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC +AQEAaOZFOcQzF1MRekcBmIZMaHSWYxOUrVLzBNSNhFD8muYiUAAufrkyTUq0Mmat +w5hAnJ34VGpU1wxQlr/uwH7wpZZnGuj10rAp3tqES0g24AeH1bC9wmRs+rD6dcZR +YmZq6FxtV7Cv3pQX7lhDYbcBj2za3YT6I1+yczskAHR6KYYuJzKJ7XRVCL7ZlYRX +pUMZBQq2eAVWlW/c5iDT3KoGZUD9Of71F7qyUAqMMYafeDxguDz7gKstoXVCklQ+ +I4C7JKmRbrRvMgXx6O1clGhAsRZ0nNAtzi7XT5tD27qFwIPgwv48RWgsmPtzE03S +YGQ5WhYMdHOOjWmcV6MDkCpiSA== +-----END CERTIFICATE----- diff --git a/board/sandbox/capsule_pub_key_good.crt b/board/sandbox/capsule_pub_key_good.crt new file mode 100644 index 00000000000..82d8576a648 --- /dev/null +++ b/board/sandbox/capsule_pub_key_good.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDDzCCAfegAwIBAgIUUzrWhMi7oPFshQP6eFlccqf7exswDQYJKoZIhvcNAQEL +BQAwFjEUMBIGA1UEAwwLVEVTVF9TSUdORVIwIBcNMjMwODA0MTgwNzQyWhgPMzAw +MzEwMDYxODA3NDJaMBYxFDASBgNVBAMMC1RFU1RfU0lHTkVSMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsAX2ldD9Y0c0utd1NU/uFW7jFbMRV4cByWOc ++Rcer/nFgX9yta7ivu3BJ1ueWR17zRNiQpIzLyEipoSPwyyViD5wLrPLRXVP0dru +aCWyiPm+hm7mpjvwhvR7F2efJTguq9nJI4scaL7APUhbIXHHSL9mK8IlbFnshaR/ +qwd//nBW64HVqWlHNd+uxpFP2Qp0kQwb1b80USNWuMtjaIBam2R1xxDac1jSd001 +4X/XcDORxRpJl+0gONw7Ws2nuggeBGlCsy2Fo9/mngEG3bwa7qSmUM9T1Cp+1+vg +Rmi7ox7Yb4m2KaTXoD76mydcQW7+fQkCvpUVC8AtOTWMOfrCMQIDAQABo1MwUTAd +BgNVHQ4EFgQUHvG7Xchqzwdggky+oyzlpNem8UowHwYDVR0jBBgwFoAUHvG7Xchq +zwdggky+oyzlpNem8UowDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC +AQEAUn1ncSqeXbQAHNrVOFldLwu70hNlMxf2z4EfH2M7vJgrpwkRuIFw7PXNITBh +CImd/ghm5NGFysrK7BwdHkFvUXZV3rE93BhcLC9leWfky33kW9olIzpE14i5FfBn +ABmaokPhOrzAneGzU35sZHNotlqOrzgpKVkpOWrykhYZ5Qjk8Sz0xvzuG8TJc20s +2og+W8Rm2u/xI9xPxtFbq9vUjvFS35o1pm+vkzpgNdo4YS1PG37BW/aopsooLSk7 +9Rxv5vzNXtQqeZ5qBdKbAVh3OsgqwigTmXVvOX3xpy9r9qiimhaISxCt83RZ7wQW +I19t9pXyxAi6u7MRhJZlAeH/3w== +-----END CERTIFICATE----- -- cgit v1.2.3 From f72d0d4a2f9a2d05ebeefb583992cc620f7c4c2d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 21 Aug 2023 21:16:56 -0600 Subject: event: Convert existing spy records to simple Very few of the existing event-spy records use the arguments they are passed. Update them to use a simple spy instead, to simplify the code. Where an adaptor function is currently used, remove it where possible. Signed-off-by: Simon Glass --- board/google/chromebook_coral/coral.c | 4 ++-- board/keymile/kmcent2/kmcent2.c | 4 ++-- board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c | 4 ++-- board/starfive/visionfive2/spl.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'board') diff --git a/board/google/chromebook_coral/coral.c b/board/google/chromebook_coral/coral.c index 9e23f5cd31e..9d9168d608a 100644 --- a/board/google/chromebook_coral/coral.c +++ b/board/google/chromebook_coral/coral.c @@ -33,7 +33,7 @@ struct cros_gpio_info { int flags; }; -static int coral_check_ll_boot(void *ctx, struct event *event) +static int coral_check_ll_boot(void) { if (!ll_boot_init()) { printf("Running as secondary loader"); @@ -57,7 +57,7 @@ static int coral_check_ll_boot(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_MISC_INIT_F, coral_check_ll_boot); +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, coral_check_ll_boot); int arch_misc_init(void) { diff --git a/board/keymile/kmcent2/kmcent2.c b/board/keymile/kmcent2/kmcent2.c index ed552c57b5f..7e655175c57 100644 --- a/board/keymile/kmcent2/kmcent2.c +++ b/board/keymile/kmcent2/kmcent2.c @@ -182,7 +182,7 @@ unsigned long get_serial_clock(unsigned long dummy) return (gd->bus_clk / 2); } -static int kmcent2_misc_init_f(void *ctx, struct event *event) +static int kmcent2_misc_init_f(void) { /* configure QRIO pis for i2c deblocking */ i2c_deblock_gpio_cfg(); @@ -210,7 +210,7 @@ static int kmcent2_misc_init_f(void *ctx, struct event *event) return 0; } -EVENT_SPY(EVT_MISC_INIT_F, kmcent2_misc_init_f); +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, kmcent2_misc_init_f); #define USED_SRDS_BANK 0 #define EXPECTED_SRDS_RFCK SRDS_PLLCR0_RFCK_SEL_100 diff --git a/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c b/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c index 2f1731eea6a..d7f47959ebd 100644 --- a/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c +++ b/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c @@ -110,14 +110,14 @@ int board_early_init_f(void) return 0; } -static int pg_wcom_misc_init_f(void *ctx, struct event *event) +static int pg_wcom_misc_init_f(void) { if (IS_ENABLED(CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED)) check_for_uboot_update(); return 0; } -EVENT_SPY(EVT_MISC_INIT_F, pg_wcom_misc_init_f); +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, pg_wcom_misc_init_f); int board_init(void) { diff --git a/board/starfive/visionfive2/spl.c b/board/starfive/visionfive2/spl.c index 7acd3995aad..ad5f71a2018 100644 --- a/board/starfive/visionfive2/spl.c +++ b/board/starfive/visionfive2/spl.c @@ -218,7 +218,7 @@ void board_init_f(ulong dummy) if (ret) panic("spl_early_init() failed: %d\n", ret); - riscv_cpu_setup(NULL, NULL); + riscv_cpu_setup(); preloader_console_init(); /* Set the parent clock of cpu_root clock to pll0, -- cgit v1.2.3 From 6a32bfae61652f9dae621410ca6e094f374a1f11 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 21 Aug 2023 21:17:00 -0600 Subject: freescale: Drop call to init_func_vid() in the init sequence Use the misc_init_f event instead, which is designed for this purpose. All boards with CONFIG_VID already enable CONFIG_EVENT. Signed-off-by: Simon Glass --- board/freescale/ls1088a/ls1088a.c | 3 ++- board/freescale/lx2160a/lx2160a.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/freescale/ls1088a/ls1088a.c b/board/freescale/ls1088a/ls1088a.c index 7a1047a77f7..f2b8bec0372 100644 --- a/board/freescale/ls1088a/ls1088a.c +++ b/board/freescale/ls1088a/ls1088a.c @@ -181,13 +181,14 @@ unsigned long long get_qixis_addr(void) #endif #if defined(CONFIG_VID) -int init_func_vid(void) +static int setup_core_voltage(void) { if (adjust_vdd(0) < 0) printf("core voltage not adjusted\n"); return 0; } +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, setup_core_voltage); u16 soc_get_fuse_vid(int vid_index) { diff --git a/board/freescale/lx2160a/lx2160a.c b/board/freescale/lx2160a/lx2160a.c index d631a11ff66..2883848550a 100644 --- a/board/freescale/lx2160a/lx2160a.c +++ b/board/freescale/lx2160a/lx2160a.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -242,6 +243,7 @@ int init_func_vid(void) return 0; } #endif +EVENT_SPY_SIMPLE(EVT_MISC_INIT_F, init_func_vid); int checkboard(void) { -- cgit v1.2.3 From 91caa3bb89b112a1421ee2ee3661baf67c64bab9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 21 Aug 2023 21:17:01 -0600 Subject: event: Use an event to replace last_stage_init() Add a new event which handles this function. Convert existing use of the function to use the new event instead. Make sure that EVENT is enabled by affected boards, by selecting it from the LAST_STAGE_INIT option. For x86, enable it by default since all boards need it. For controlcenterdc, inline the get_tpm() function and make sure the event is not built in SPL. Signed-off-by: Simon Glass --- board/CZ.NIC/turris_mox/turris_mox.c | 4 +++- board/Marvell/mvebu_armada-37xx/board.c | 5 +++- board/Marvell/octeon_nic23/board.c | 4 +++- board/Marvell/octeontx2/board.c | 4 +++- board/cortina/presidio-asic/presidio.c | 4 +++- board/emulation/qemu-ppce500/qemu-ppce500.c | 4 +++- board/gdsys/a38x/controlcenterdc.c | 31 +++++++++++-------------- board/gdsys/mpc8308/gazerbeam.c | 4 +++- board/ge/bx50v3/bx50v3.c | 4 +++- board/keymile/km83xx/km83xx.c | 4 +++- board/keymile/kmcent2/kmcent2.c | 3 ++- board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c | 6 +---- board/phytium/durian/durian.c | 4 +++- board/phytium/pomelo/pomelo.c | 4 +++- 14 files changed, 51 insertions(+), 34 deletions(-) (limited to 'board') diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c index a52a032e4d5..370c2668b08 100644 --- a/board/CZ.NIC/turris_mox/turris_mox.c +++ b/board/CZ.NIC/turris_mox/turris_mox.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -667,7 +668,7 @@ err: return NULL; } -int last_stage_init(void) +static int last_stage_init(void) { struct gpio_desc reset_gpio = {}; @@ -712,6 +713,7 @@ handle_reset_btn: return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); #if defined(CONFIG_OF_BOARD_SETUP) diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 3ab6e8873d8..3fe5319437e 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -301,7 +302,7 @@ static int mii_multi_chip_mode_write(struct udevice *bus, int dev_smi_addr, } /* Bring-up board-specific network stuff */ -int last_stage_init(void) +static int last_stage_init(void) { struct udevice *bus; ofnode node; @@ -356,6 +357,8 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); + #endif #ifdef CONFIG_OF_BOARD_SETUP diff --git a/board/Marvell/octeon_nic23/board.c b/board/Marvell/octeon_nic23/board.c index 08b1aa4b6ef..bc9332cb74a 100644 --- a/board/Marvell/octeon_nic23/board.c +++ b/board/Marvell/octeon_nic23/board.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -364,7 +365,7 @@ int board_late_init(void) return 0; } -int last_stage_init(void) +static int last_stage_init(void) { struct gpio_desc gpio = {}; ofnode node; @@ -386,3 +387,4 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); diff --git a/board/Marvell/octeontx2/board.c b/board/Marvell/octeontx2/board.c index e7899f49f0c..974e9eb8200 100644 --- a/board/Marvell/octeontx2/board.c +++ b/board/Marvell/octeontx2/board.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -213,11 +214,12 @@ void board_acquire_flash_arb(bool acquire) } } -int last_stage_init(void) +static int last_stage_init(void) { (void)smc_flsf_fw_booted(); return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); static int do_go_uboot(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) diff --git a/board/cortina/presidio-asic/presidio.c b/board/cortina/presidio-asic/presidio.c index aae0a5dac06..fdfa3affc3b 100644 --- a/board/cortina/presidio-asic/presidio.c +++ b/board/cortina/presidio-asic/presidio.c @@ -4,6 +4,7 @@ * */ #include +#include #include #include #include @@ -121,7 +122,7 @@ void reset_cpu(void) } #ifdef CONFIG_LAST_STAGE_INIT -int last_stage_init(void) +static int last_stage_init(void) { u32 val; @@ -134,4 +135,5 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); #endif diff --git a/board/emulation/qemu-ppce500/qemu-ppce500.c b/board/emulation/qemu-ppce500/qemu-ppce500.c index a39bcb4fa0c..7ca8773b17e 100644 --- a/board/emulation/qemu-ppce500/qemu-ppce500.c +++ b/board/emulation/qemu-ppce500/qemu-ppce500.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -184,7 +185,7 @@ int misc_init_r(void) return 0; } -int last_stage_init(void) +static int last_stage_init(void) { void *fdt = get_fdt_virt(); int len = 0; @@ -204,6 +205,7 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); static uint64_t get_linear_ram_size(void) { diff --git a/board/gdsys/a38x/controlcenterdc.c b/board/gdsys/a38x/controlcenterdc.c index ccebba72721..0f620c2d917 100644 --- a/board/gdsys/a38x/controlcenterdc.c +++ b/board/gdsys/a38x/controlcenterdc.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -35,19 +36,6 @@ DECLARE_GLOBAL_DATA_PTR; #define DB_GP_88F68XX_GPP_POL_LOW 0x0 #define DB_GP_88F68XX_GPP_POL_MID 0x0 -static int get_tpm(struct udevice **devp) -{ - int rc; - - rc = uclass_first_device_err(UCLASS_TPM, devp); - if (rc) { - printf("Could not find TPM (ret=%d)\n", rc); - return CMD_RET_FAILURE; - } - - return 0; -} - /* * Define the DDR layout / topology here in the board file. This will * be used by the DDR3 init code in the SPL U-Boot version to configure @@ -284,15 +272,22 @@ int board_fix_fdt(void *rw_fdt_blob) return 0; } -int last_stage_init(void) +#ifndef CONFIG_SPL_BUILD +static int last_stage_init(void) { struct udevice *tpm; int ret; -#ifndef CONFIG_SPL_BUILD + if (IS_ENABLED(CONFIG_SPL_BUILD)) + return 0; ccdc_eth_init(); -#endif - ret = get_tpm(&tpm); + + ret = uclass_first_device_err(UCLASS_TPM, &tpm); + if (ret) { + printf("Could not find TPM (ret=%d)\n", ret); + return ret; + } + if (ret || tpm_init(tpm) || tpm1_startup(tpm, TPM_ST_CLEAR) || tpm1_continue_self_test(tpm)) { return 1; @@ -305,3 +300,5 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); +#endif diff --git a/board/gdsys/mpc8308/gazerbeam.c b/board/gdsys/mpc8308/gazerbeam.c index ba88401f13d..cc608c4ac43 100644 --- a/board/gdsys/mpc8308/gazerbeam.c +++ b/board/gdsys/mpc8308/gazerbeam.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -124,7 +125,7 @@ static void display_osd_info(struct udevice *osd, osd_info->width, osd_info->height); } -int last_stage_init(void) +static int last_stage_init(void) { int fpga_hw_rev = 0; int i; @@ -179,6 +180,7 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); #if defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index 4e9d841fe29..2d8951964a8 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -5,6 +5,7 @@ * Copyright 2012 Freescale Semiconductor, Inc. */ +#include #include #include #include @@ -531,7 +532,7 @@ static void remove_ethaddr_env_var(int index) env_set(env_var_name, NULL); } -int last_stage_init(void) +static int last_stage_init(void) { int i; @@ -544,6 +545,7 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); int checkboard(void) { diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c index 8f2d873bc68..acd13105dd5 100644 --- a/board/keymile/km83xx/km83xx.c +++ b/board/keymile/km83xx/km83xx.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -184,7 +185,7 @@ int misc_init_r(void) return 0; } -int last_stage_init(void) +static int last_stage_init(void) { #if defined(CONFIG_TARGET_KMCOGE5NE) /* @@ -202,6 +203,7 @@ int last_stage_init(void) set_km_env(); return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); static int fixed_sdram(void) { diff --git a/board/keymile/kmcent2/kmcent2.c b/board/keymile/kmcent2/kmcent2.c index 7e655175c57..572cc7bbdc6 100644 --- a/board/keymile/kmcent2/kmcent2.c +++ b/board/keymile/kmcent2/kmcent2.c @@ -261,7 +261,7 @@ int hush_init_var(void) return 0; } -int last_stage_init(void) +static int last_stage_init(void) { const char *kmem; /* DIP switch support on BFTIC */ @@ -287,6 +287,7 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); void fdt_fixup_fman_mac_addresses(void *blob) { diff --git a/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c b/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c index d7f47959ebd..21c21aac221 100644 --- a/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c +++ b/board/keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c @@ -215,8 +215,4 @@ int hush_init_var(void) return 0; } -int last_stage_init(void) -{ - set_km_env(); - return 0; -} +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, set_km_env); diff --git a/board/phytium/durian/durian.c b/board/phytium/durian/durian.c index ee484749bcf..0a4048d4982 100644 --- a/board/phytium/durian/durian.c +++ b/board/phytium/durian/durian.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -99,7 +100,7 @@ int __asm_flush_l3_dcache(void) return 0; } -int last_stage_init(void) +static int last_stage_init(void) { int ret; @@ -113,3 +114,4 @@ int last_stage_init(void) } return ret; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); diff --git a/board/phytium/pomelo/pomelo.c b/board/phytium/pomelo/pomelo.c index 75d2636bf45..960e491c768 100644 --- a/board/phytium/pomelo/pomelo.c +++ b/board/phytium/pomelo/pomelo.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -102,7 +103,7 @@ int __asm_flush_l3_dcache(void) return 0; } -int last_stage_init(void) +static int last_stage_init(void) { int ret; @@ -116,3 +117,4 @@ int last_stage_init(void) } return ret; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); -- cgit v1.2.3 From 63cbfd38a814d72f3e74773c1f8150de788ed4f4 Mon Sep 17 00:00:00 2001 From: Emanuele Ghidoli Date: Thu, 24 Aug 2023 10:08:50 +0200 Subject: board: verdin-am62: fix check for minimum memory size verdin am62 SKUs comes in multiple memory configuration, check that the detected memory is at least 512MB since we have some reserved memory just before this threshold and therefore the module cannot work with less memory. Fixes: 7d1a10659f5b ("board: toradex: add verdin am62 support") Signed-off-by: Emanuele Ghidoli Acked-by: Francesco Dolcini --- board/toradex/verdin-am62/verdin-am62.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'board') diff --git a/board/toradex/verdin-am62/verdin-am62.c b/board/toradex/verdin-am62/verdin-am62.c index a3d1d07a0cb..d09dda5bccc 100644 --- a/board/toradex/verdin-am62/verdin-am62.c +++ b/board/toradex/verdin-am62/verdin-am62.c @@ -28,8 +28,8 @@ int dram_init(void) { gd->ram_size = get_ram_size((long *)CFG_SYS_SDRAM_BASE, CFG_SYS_SDRAM_SIZE); - if (gd->ram_size < SZ_64M) - puts("## WARNING: Less than 64MB RAM detected\n"); + if (gd->ram_size < SZ_512M) + puts("## WARNING: Less than 512MB RAM detected\n"); return 0; } -- cgit v1.2.3 From 47b519c5060ddbc84042a808c9b3601d645d53bf Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:51 -0500 Subject: board: ti: am62x: am62x.env: Add explicit boot_targets Add explicit boot_targets to indicate the specific boot sequence to follow. NOTE: The non-standard ti_mmc emulates what is done for distro_boot. With bootstd, this will eventually need to be replaced by equivalent class. Tested-by: Mattijs Korpershoek Signed-off-by: Nishanth Menon Reviewed-by: Mattijs Korpershoek --- board/ti/am62x/am62x.env | 1 + 1 file changed, 1 insertion(+) (limited to 'board') diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env index f2dc87893a9..1cf56dbd812 100644 --- a/board/ti/am62x/am62x.env +++ b/board/ti/am62x/am62x.env @@ -11,6 +11,7 @@ args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 ${mtdparts} run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr} +boot_targets=ti_mmc mmc0 mmc1 usb pxe dhcp boot=mmc mmcdev=1 bootpart=1:2 -- cgit v1.2.3 From bf9c61acb6caed97114029d2dc1e91b148cd9b8a Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:54 -0500 Subject: include: env: ti: ti_armv7_common.env: Rename to ti_common.env ti_armv7_common does not make any more sense as it is used by armv7 and armv8 TI based platforms. Reported-by: Tom Rini Reviewed-by: Mattijs Korpershoek Reviewed-by: Tom Rini Tested-by: Mattijs Korpershoek Signed-off-by: Nishanth Menon --- board/siemens/iot2050/iot2050.env | 2 +- board/ti/am62ax/am62ax.env | 2 +- board/ti/am62x/am62x.env | 2 +- board/ti/am64x/am64x.env | 2 +- board/ti/am65x/am65x.env | 2 +- board/ti/j721e/j721e.env | 2 +- board/ti/j721s2/j721s2.env | 2 +- board/ti/ks2_evm/k2e_evm.env | 2 +- board/ti/ks2_evm/k2g_evm.env | 2 +- board/ti/ks2_evm/k2hk_evm.env | 2 +- board/ti/ks2_evm/k2l_evm.env | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) (limited to 'board') diff --git a/board/siemens/iot2050/iot2050.env b/board/siemens/iot2050/iot2050.env index caa9f80e3fc..8bbd7abe98f 100644 --- a/board/siemens/iot2050/iot2050.env +++ b/board/siemens/iot2050/iot2050.env @@ -6,7 +6,7 @@ * Jan Kiszka */ -#include +#include usb_pgood_delay=900 diff --git a/board/ti/am62ax/am62ax.env b/board/ti/am62ax/am62ax.env index 3f7c333fa40..bfed7f36084 100644 --- a/board/ti/am62ax/am62ax.env +++ b/board/ti/am62ax/am62ax.env @@ -1,4 +1,4 @@ -#include +#include #include default_device_tree=ti/k3-am62a7-sk.dtb diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env index 1cf56dbd812..1ef948df83d 100644 --- a/board/ti/am62x/am62x.env +++ b/board/ti/am62x/am62x.env @@ -1,4 +1,4 @@ -#include +#include #include default_device_tree=ti/k3-am625-sk.dtb diff --git a/board/ti/am64x/am64x.env b/board/ti/am64x/am64x.env index 1567907fcbd..68e42222b7f 100644 --- a/board/ti/am64x/am64x.env +++ b/board/ti/am64x/am64x.env @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/board/ti/am65x/am65x.env b/board/ti/am65x/am65x.env index 755bff2707c..286b9c300c0 100644 --- a/board/ti/am65x/am65x.env +++ b/board/ti/am65x/am65x.env @@ -1,4 +1,4 @@ -#include +#include #include #include #if CONFIG_CMD_REMOTEPROC diff --git a/board/ti/j721e/j721e.env b/board/ti/j721e/j721e.env index 2f2fb059127..8cc8232fc13 100644 --- a/board/ti/j721e/j721e.env +++ b/board/ti/j721e/j721e.env @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/board/ti/j721s2/j721s2.env b/board/ti/j721s2/j721s2.env index 6825b146985..64e3d9da85f 100644 --- a/board/ti/j721s2/j721s2.env +++ b/board/ti/j721s2/j721s2.env @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/board/ti/ks2_evm/k2e_evm.env b/board/ti/ks2_evm/k2e_evm.env index a145db53e5f..3dbb7934c59 100644 --- a/board/ti/ks2_evm/k2e_evm.env +++ b/board/ti/ks2_evm/k2e_evm.env @@ -1,4 +1,4 @@ -#include +#include #include findfdt=setenv fdtfile ${name_fdt} diff --git a/board/ti/ks2_evm/k2g_evm.env b/board/ti/ks2_evm/k2g_evm.env index 4f4941dd090..2b500fc6edf 100644 --- a/board/ti/ks2_evm/k2g_evm.env +++ b/board/ti/ks2_evm/k2g_evm.env @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/board/ti/ks2_evm/k2hk_evm.env b/board/ti/ks2_evm/k2hk_evm.env index 0714a51090e..9991b76f8fc 100644 --- a/board/ti/ks2_evm/k2hk_evm.env +++ b/board/ti/ks2_evm/k2hk_evm.env @@ -1,4 +1,4 @@ -#include +#include #include findfdt=setenv fdtfile ${name_fdt} diff --git a/board/ti/ks2_evm/k2l_evm.env b/board/ti/ks2_evm/k2l_evm.env index e8a803a4ed7..4e2debca4bd 100644 --- a/board/ti/ks2_evm/k2l_evm.env +++ b/board/ti/ks2_evm/k2l_evm.env @@ -1,4 +1,4 @@ -#include +#include #include findfdt=setenv fdtfile ${name_fdt} -- cgit v1.2.3 From d0411b0fbfcf0b0ca3206e2f97647309e13a0e7c Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:02:56 -0500 Subject: board: ti: am62x: am62x.env: Use default findfdt Use the default findfdt using CONFIG_DEFAULT_DEVICE_TREE Reviewed-by: Tom Rini Tested-by: Mattijs Korpershoek Signed-off-by: Nishanth Menon Reviewed-by: Mattijs Korpershoek --- board/ti/am62x/am62x.env | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'board') diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env index 1ef948df83d..3b79ae1b3f0 100644 --- a/board/ti/am62x/am62x.env +++ b/board/ti/am62x/am62x.env @@ -1,10 +1,7 @@ #include +#include #include -default_device_tree=ti/k3-am625-sk.dtb -findfdt= - setenv name_fdt ${default_device_tree}; - setenv fdtfile ${name_fdt} name_kern=Image console=ttyS2,115200n8 args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 -- cgit v1.2.3 From 45b0b5e5a0e9d7803ddcab48b26a6fd8f55bcaec Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Fri, 25 Aug 2023 13:03:03 -0500 Subject: arm: dts: Add k3-am625-beagleplay BeagleBoard.org BeaglePlay is an easy to use, affordable open source hardware single board computer based on the Texas Instruments AM625 SoC that allows you to create connected devices that work even at long distances using IEEE 802.15.4g LR-WPAN and IEEE 802.3cg 10Base-T1L. Expansion is provided over open standards based mikroBUS, Grove and QWIIC headers among other interfaces. This board family can be identified by the 24c32 eeprom: [aa 55 33 ee 01 37 00 10 2e 00 42 45 41 47 4c 45 |.U3..7....BEAGLE|] [50 4c 41 59 2d 41 30 2d 00 00 30 32 30 30 37 38 |PLAY-A0-..020078|] https://beagleplay.org/ https://git.beagleboard.org/beagleplay/beagleplay baseline of base device tree is v6.5-rc1. Reviewed-by: Tom Rini Reviewed-by: Mattijs Korpershoek Tested-by: Mattijs Korpershoek Signed-off-by: Robert Nelson Co-developed-by: Nishanth Menon Signed-off-by: Nishanth Menon --- board/ti/am62x/MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'board') diff --git a/board/ti/am62x/MAINTAINERS b/board/ti/am62x/MAINTAINERS index 105e741995e..6ac4e65f5af 100644 --- a/board/ti/am62x/MAINTAINERS +++ b/board/ti/am62x/MAINTAINERS @@ -6,3 +6,10 @@ F: board/ti/am62x/ F: include/configs/am62x_evm.h F: configs/am62x_evm_r5_defconfig F: configs/am62x_evm_a53_defconfig + +BEAGLEPLAY BOARD +M: Nishanth Menon +M: Robert Nelson +M: Tom Rini +S: Maintained +N: beagleplay -- cgit v1.2.3 From a200f428b5b2183c1bf9c7519569aa61faa990d7 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Fri, 25 Aug 2023 13:03:04 -0500 Subject: board: ti: am62x: Add am62x_beagleplay_* defconfigs and env file Add defconfig fragments for am625 based beagleplay and corresponding customized environment file for beagleplay. Reviewed-by: Mattijs Korpershoek Tested-by: Mattijs Korpershoek Signed-off-by: Nishanth Menon Reviewed-by: Tom Rini --- board/ti/am62x/beagleplay.env | 19 +++++++++++++ board/ti/am62x/beagleplay_a53.config | 55 ++++++++++++++++++++++++++++++++++++ board/ti/am62x/beagleplay_r5.config | 15 ++++++++++ 3 files changed, 89 insertions(+) create mode 100644 board/ti/am62x/beagleplay.env create mode 100644 board/ti/am62x/beagleplay_a53.config create mode 100644 board/ti/am62x/beagleplay_r5.config (limited to 'board') diff --git a/board/ti/am62x/beagleplay.env b/board/ti/am62x/beagleplay.env new file mode 100644 index 00000000000..4f0a94a8113 --- /dev/null +++ b/board/ti/am62x/beagleplay.env @@ -0,0 +1,19 @@ +#include +#include +#include + +name_kern=Image +console=ttyS2,115200n8 +args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 +run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr} +set_led_state_fail_load= led led-0 off; led led-1 on; + led led-2 off; led led-3 on; led led-4 off +set_led_state_start_load=led led-0 on; led led-1 off; + led led-2 on; led led-3 off; led led-4 on +boot=mmc +mmcdev=1 +bootpart=1:1 +bootdir=/boot +boot_targets=mmc1 mmc0 usb pxe +bootmeths=script extlinux efi pxe +rd_spec=- diff --git a/board/ti/am62x/beagleplay_a53.config b/board/ti/am62x/beagleplay_a53.config new file mode 100644 index 00000000000..f0380416cc5 --- /dev/null +++ b/board/ti/am62x/beagleplay_a53.config @@ -0,0 +1,55 @@ +# Defconfig fragment to apply on top of am62x_evm_a53_defconfig + +CONFIG_DEFAULT_DEVICE_TREE="k3-am625-beagleplay" +CONFIG_OF_LIST="k3-am625-beagleplay" +CONFIG_SPL_OF_LIST="k3-am625-beagleplay" +CONFIG_BOOTCOMMAND="run set_led_state_start_load;run findfdt; run envboot; bootflow scan -lb;run set_led_state_fail_load" +CONFIG_EXT4_WRITE=y +CONFIG_LZO=y +CONFIG_AUTOBOOT_KEYED=y +CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n" +CONFIG_AUTOBOOT_DELAY_STR="d" +CONFIG_AUTOBOOT_STOP_STR=" " +# Use the Beagleplay env file +CONFIG_ENV_SOURCE_FILE="beagleplay" +# Do not use emmc boot - we will use FS only +CONFIG_SUPPORT_EMMC_BOOT=n +CONFIG_MMC_IO_VOLTAGE=y +# CONFIG_SPL_MMC_IO_VOLTAGE is not set +CONFIG_MMC_UHS_SUPPORT=y +# CONFIG_SPL_MMC_UHS_SUPPORT is not set +CONFIG_MMC_HS200_SUPPORT=y +# CONFIG_SPL_MMC_HS200_SUPPORT is not set +# Enable GPIO control +CONFIG_DM_GPIO=y +CONFIG_SPL_GPIO=y +CONFIG_DA8XX_GPIO=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPIO_READ=y +# Enable LEDs +CONFIG_LED=y +CONFIG_LED_GPIO=y +CONFIG_SPL_LED=y +CONFIG_SPL_LED_GPIO=y +# Enable I2C bus +CONFIG_SPL_I2C=y +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_OMAP24XX=y +CONFIG_CMD_I2C=y +# Regulator +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_REGULATOR_GPIO=y +CONFIG_CMD_REGULATOR=y +CONFIG_DM_REGULATOR_TPS65219=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_TPS65219=y +CONFIG_CMD_PMIC=y +# Uses Realtek phy rather than TI phy +CONFIG_PHY_TI_DP83867=n +CONFIG_PHY_REALTEK=y +# No SPI flash on Beagleplay +CONFIG_SPI=n +CONFIG_SPI_FLASH=n +CONFIG_SPL_DM_SPI_FLASH=n +CONFIG_SPL_SPI_FLASH_SUPPORT=n diff --git a/board/ti/am62x/beagleplay_r5.config b/board/ti/am62x/beagleplay_r5.config new file mode 100644 index 00000000000..4ee0375a2a1 --- /dev/null +++ b/board/ti/am62x/beagleplay_r5.config @@ -0,0 +1,15 @@ +# Defconfig fragment to apply on top of: +# am62x_evm_r5_defconfig +# +CONFIG_DEFAULT_DEVICE_TREE="k3-am625-r5-beagleplay" +CONFIG_OF_LIST="k3-am625-r5-beagleplay" +CONFIG_SPL_OF_LIST="k3-am625-r5-beagleplay" +# Do spl board init +CONFIG_SPL_BOARD_INIT=y +# Do not use emmc boot - we will use FS only +CONFIG_SUPPORT_EMMC_BOOT=n +# No SPI flash on Beagleplay +CONFIG_SPI=n +CONFIG_SPI_FLASH=n +CONFIG_SPL_DM_SPI_FLASH=n +CONFIG_SPL_SPI_FLASH_SUPPORT=n -- cgit v1.2.3 From 2caf974b5fac69a1b778e64503f2c107a8d7c3a3 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 1 Sep 2023 11:50:03 +0200 Subject: board: usb: Replace legacy usb_gadget_handle_interrupts() The usb_gadget_handle_interrupts() is no longer used anywhere, replace the remaining uses with dm_usb_gadget_handle_interrupts() which takes udevice as a parameter. Some of the UDC drivers currently ignore the index parameter altogether, those also ignore the udevice and have to be reworked. Other like the dwc3_uboot_handle_interrupt() had to be switched from index to udevice look up to avoid breakage. Reviewed-by: Mattijs Korpershoek Tested-by: Mattijs Korpershoek # on khadas vim3 Signed-off-by: Marek Vasut --- board/purism/librem5/spl.c | 4 ++-- board/samsung/common/exynos5-dt.c | 4 ++-- board/st/stih410-b2260/board.c | 4 ++-- board/ti/am43xx/board.c | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'board') diff --git a/board/purism/librem5/spl.c b/board/purism/librem5/spl.c index 90f1fcf415f..581f0929662 100644 --- a/board/purism/librem5/spl.c +++ b/board/purism/librem5/spl.c @@ -418,9 +418,9 @@ out: return rv; } -int usb_gadget_handle_interrupts(int index) +int dm_usb_gadget_handle_interrupts(struct udevice *dev) { - dwc3_uboot_handle_interrupt(0); + dwc3_uboot_handle_interrupt(dev); return 0; } diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c index cde77d79a0f..726b7f0667a 100644 --- a/board/samsung/common/exynos5-dt.c +++ b/board/samsung/common/exynos5-dt.c @@ -126,9 +126,9 @@ static struct dwc3_device dwc3_device_data = { .index = 0, }; -int usb_gadget_handle_interrupts(int index) +int dm_usb_gadget_handle_interrupts(struct udevice *dev) { - dwc3_uboot_handle_interrupt(0); + dwc3_uboot_handle_interrupt(dev); return 0; } diff --git a/board/st/stih410-b2260/board.c b/board/st/stih410-b2260/board.c index cd3a7dc51a2..e21cbc270e9 100644 --- a/board/st/stih410-b2260/board.c +++ b/board/st/stih410-b2260/board.c @@ -50,9 +50,9 @@ static struct dwc3_device dwc3_device_data = { .index = 0, }; -int usb_gadget_handle_interrupts(int index) +int dm_usb_gadget_handle_interrupts(struct udevice *dev) { - dwc3_uboot_handle_interrupt(index); + dwc3_uboot_handle_interrupt(dev); return 0; } diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 87e552a4701..58bfe7cd455 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -760,13 +760,13 @@ static struct ti_usb_phy_device usb_phy2_device = { .index = 1, }; -int usb_gadget_handle_interrupts(int index) +int dm_usb_gadget_handle_interrupts(struct udevice *dev) { u32 status; - status = dwc3_omap_uboot_interrupt_status(index); + status = dwc3_omap_uboot_interrupt_status(dev); if (status) - dwc3_uboot_handle_interrupt(index); + dwc3_uboot_handle_interrupt(dev); return 0; } -- cgit v1.2.3 From a467fb58b1b0534f1a212ce12a50aa21c02a6b97 Mon Sep 17 00:00:00 2001 From: Nikhil M Jain Date: Fri, 1 Sep 2023 16:09:13 +0530 Subject: tools: logos: Rename TI logo files Change the file name from ti.gz and ti.bmp to ti_logos_414x97_32bpp to help user understand the resolution and identify the logo files when placed in the boot partition and update the splashfile name with the same in .env file. Signed-off-by: Nikhil M Jain Reviewed-by: Devarsh Thakkar --- board/ti/am62x/am62x.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board') diff --git a/board/ti/am62x/am62x.env b/board/ti/am62x/am62x.env index 3b79ae1b3f0..22a6c2c91b1 100644 --- a/board/ti/am62x/am62x.env +++ b/board/ti/am62x/am62x.env @@ -15,7 +15,7 @@ bootpart=1:2 bootdir=/boot rd_spec=- -splashfile=ti.gz +splashfile=ti_logo_414x97_32bpp.bmp.gz splashimage=0x80200000 splashpos=m,m splashsource=sf -- cgit v1.2.3 From c5172c10f669f935d71d5bdb4d7296eeffc717d0 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 7 Sep 2023 13:21:28 +0200 Subject: riscv: set fdtfile on VisionFive 2 Multiple revisions of the StarFive VisionFive 2 board exist. They can be identified by reading their EEPROM. Linux uses two differently named device-tree files. To load the correct device-tree we need to set $fdtfile to the device-tree file name that matches the board revision. Signed-off-by: Heinrich Schuchardt Reviewed-by: Leo Yu-Chi Liang --- board/starfive/visionfive2/starfive_visionfive2.c | 43 +++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'board') diff --git a/board/starfive/visionfive2/starfive_visionfive2.c b/board/starfive/visionfive2/starfive_visionfive2.c index d609262b676..05d8d2d657c 100644 --- a/board/starfive/visionfive2/starfive_visionfive2.c +++ b/board/starfive/visionfive2/starfive_visionfive2.c @@ -5,14 +5,20 @@ */ #include -#include -#include #include #include +#include +#include +#include +#include #include #define JH7110_L2_PREFETCHER_BASE_ADDR 0x2030000 #define JH7110_L2_PREFETCHER_HART_OFFSET 0x2000 +#define FDTFILE_VISIONFIVE2_1_2A \ + "starfive/jh7110-starfive-visionfive-2-v1.2a.dtb" +#define FDTFILE_VISIONFIVE2_1_3B \ + "starfive/jh7110-starfive-visionfive-2-v1.3b.dtb" /* enable U74-mc hart1~hart4 prefetcher */ static void enable_prefetcher(void) @@ -33,6 +39,31 @@ static void enable_prefetcher(void) } } +/** + * set_fdtfile() - set the $fdtfile variable based on the board revision + */ +static void set_fdtfile(void) +{ + u8 version; + const char *fdtfile; + + version = get_pcb_revision_from_eeprom(); + switch (version) { + case 'a': + case 'A': + fdtfile = FDTFILE_VISIONFIVE2_1_2A; + break; + + case 'b': + case 'B': + default: + fdtfile = FDTFILE_VISIONFIVE2_1_3B; + break; + }; + + env_set("fdtfile", fdtfile); +} + int board_init(void) { enable_caches(); @@ -41,6 +72,14 @@ int board_init(void) return 0; } +int board_late_init(void) +{ + if (CONFIG_IS_ENABLED(ID_EEPROM)) + set_fdtfile(); + + return 0; +} + void *board_fdt_blob_setup(int *err) { *err = 0; -- cgit v1.2.3 From 7ca9c1d864b7b3adffdd1e889f174feb51a1b5b1 Mon Sep 17 00:00:00 2001 From: Christian Taedcke Date: Tue, 25 Jul 2023 09:26:58 +0200 Subject: xilinx: zynqmp: Extract aes operation into new file This moves the aes operation that is performed by the pmu into a separate file. This way it can be called not just from the shell command, but also e.g. from board initialization code. Signed-off-by: Christian Taedcke Link: https://lore.kernel.org/r/20230725072658.16341-1-christian.taedcke-oss@weidmueller.com Signed-off-by: Michal Simek --- board/xilinx/zynqmp/cmds.c | 43 +++---------------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) (limited to 'board') diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c index ea404d547f6..fadb0edb24f 100644 --- a/board/xilinx/zynqmp/cmds.c +++ b/board/xilinx/zynqmp/cmds.c @@ -14,16 +14,7 @@ #include #include #include - -struct aes { - u64 srcaddr; - u64 ivaddr; - u64 keyaddr; - u64 dstaddr; - u64 len; - u64 op; - u64 keysrc; -}; +#include static int do_zynqmp_verify_secure(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) @@ -121,9 +112,7 @@ static int do_zynqmp_mmio_write(struct cmd_tbl *cmdtp, int flag, int argc, static int do_zynqmp_aes(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) { - ALLOC_CACHE_ALIGN_BUFFER(struct aes, aes, 1); - int ret; - u32 ret_payload[PAYLOAD_ARG_CNT]; + ALLOC_CACHE_ALIGN_BUFFER(struct zynqmp_aes, aes, 1); if (zynqmp_firmware_version() <= PMUFW_V1_0) { puts("ERR: PMUFW v1.0 or less is detected\n"); @@ -142,40 +131,14 @@ static int do_zynqmp_aes(struct cmd_tbl *cmdtp, int flag, int argc, aes->keysrc = hextoul(argv[6], NULL); aes->dstaddr = hextoul(argv[7], NULL); - if (aes->srcaddr && aes->ivaddr && aes->dstaddr) { - flush_dcache_range(aes->srcaddr, - (aes->srcaddr + - roundup(aes->len, ARCH_DMA_MINALIGN))); - flush_dcache_range(aes->ivaddr, - (aes->ivaddr + - roundup(IV_SIZE, ARCH_DMA_MINALIGN))); - flush_dcache_range(aes->dstaddr, - (aes->dstaddr + - roundup(aes->len, ARCH_DMA_MINALIGN))); - } - if (aes->keysrc == 0) { if (argc < cmdtp->maxargs) return CMD_RET_USAGE; aes->keyaddr = hextoul(argv[8], NULL); - if (aes->keyaddr) - flush_dcache_range(aes->keyaddr, - (aes->keyaddr + - roundup(KEY_PTR_LEN, - ARCH_DMA_MINALIGN))); } - flush_dcache_range((ulong)aes, (ulong)(aes) + - roundup(sizeof(struct aes), ARCH_DMA_MINALIGN)); - - ret = xilinx_pm_request(PM_SECURE_AES, upper_32_bits((ulong)aes), - lower_32_bits((ulong)aes), 0, 0, ret_payload); - if (ret || ret_payload[1]) - printf("Failed: AES op status:0x%x, errcode:0x%x\n", - ret, ret_payload[1]); - - return ret; + return zynqmp_aes_operation(aes); } #ifdef CONFIG_DEFINE_TCM_OCM_MMAP -- cgit v1.2.3 From 5528f79778473b19917fbaea41e8f6ad0f943ca5 Mon Sep 17 00:00:00 2001 From: Algapally Santosh Sagar Date: Thu, 31 Aug 2023 08:59:06 +0200 Subject: xilinx: board: Add support to pick bootscr address from DT The bootscript is expected at a default address specific to each platform. When high speed memory like Programmable Logic Double Data Rate RAM (PL DDR RAM) or Higher Bandwidth Memory RAM (HBM) is used the boot.scr may be loaded at a different offset. The offset needs to be set through setenv. Due to the default values in some cases the boot.scr is falling in between the kernel partition. The bootscript address or the bootscript offset is fetched directly from the DT and updated in the environment making it easier for automated flows. Signed-off-by: Algapally Santosh Sagar Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/fac7020b31e1f150b021d666f0d588579ea671ad.1693465140.git.michal.simek@amd.com --- board/xilinx/common/board.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'board') diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 2caeb32470f..720dcd040f0 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -414,9 +414,25 @@ int board_late_init_xilinx(void) if (!IS_ENABLED(CONFIG_MICROBLAZE)) { ulong scriptaddr; - - scriptaddr = env_get_hex("scriptaddr", 0); - ret |= env_set_hex("scriptaddr", gd->ram_base + scriptaddr); + u64 bootscr_address; + u64 bootscr_offset; + + /* Fetch bootscr_address/bootscr_offset from DT and update */ + if (!ofnode_read_bootscript_address(&bootscr_address, + &bootscr_offset)) { + if (bootscr_offset) + ret |= env_set_hex("scriptaddr", + gd->ram_base + + bootscr_offset); + else + ret |= env_set_hex("scriptaddr", + bootscr_address); + } else { + /* Update scriptaddr(bootscr offset) from env */ + scriptaddr = env_get_hex("scriptaddr", 0); + ret |= env_set_hex("scriptaddr", + gd->ram_base + scriptaddr); + } } if (IS_ENABLED(CONFIG_ARCH_ZYNQ) || IS_ENABLED(CONFIG_MICROBLAZE)) -- cgit v1.2.3 From 0bbc962efda40d6b9b479c6be7fb4c7fb6129707 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 31 Aug 2023 09:04:28 +0200 Subject: xilinx: board: Add support to pick bootscr flash offset/size from DT Location of bootscript in flash can be specified via /options/u-boot DT node by using bootscr-flash-offset and bootscr-flash-size properties. Values should be saved to script_offset_f and script_size_f variables. Variables are described in doc/develop/bootstd.rst as: script_offset_f SPI flash offset from which to load the U-Boot script, e.g. 0xffe000 script_size_f Size of the script to load, e.g. 0x2000 Both of them are used by sf_get_bootflow() in drivers/mtd/spi/sf_bootdev.c to identify bootscript location inside flash. Reviewed-by: Simon Glass Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/60a84405f3fefabb8b48a4e1ce84431483a729f3.1693465465.git.michal.simek@amd.com --- board/xilinx/common/board.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'board') diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 720dcd040f0..9309b071269 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -411,6 +411,7 @@ int board_late_init_xilinx(void) int i, id, macid = 0; struct xilinx_board_description *desc; phys_size_t bootm_size = gd->ram_top - gd->ram_base; + u64 bootscr_flash_offset, bootscr_flash_size; if (!IS_ENABLED(CONFIG_MICROBLAZE)) { ulong scriptaddr; @@ -435,11 +436,19 @@ int board_late_init_xilinx(void) } } + if (!ofnode_read_bootscript_flash(&bootscr_flash_offset, + &bootscr_flash_size)) { + ret |= env_set_hex("script_offset_f", bootscr_flash_offset); + ret |= env_set_hex("script_size_f", bootscr_flash_size); + } else { + debug("!!! Please define bootscr-flash-offset via DT !!!\n"); + ret |= env_set_hex("script_offset_f", + CONFIG_BOOT_SCRIPT_OFFSET); + } + if (IS_ENABLED(CONFIG_ARCH_ZYNQ) || IS_ENABLED(CONFIG_MICROBLAZE)) bootm_size = min(bootm_size, (phys_size_t)(SZ_512M + SZ_256M)); - ret |= env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET); - ret |= env_set_addr("bootm_low", (void *)gd->ram_base); ret |= env_set_addr("bootm_size", (void *)bootm_size); -- cgit v1.2.3 From c55eb1d542363951347f73c8f03ebcfc63833e11 Mon Sep 17 00:00:00 2001 From: Venkatesh Yadav Abbarapu Date: Mon, 4 Sep 2023 08:50:33 +0530 Subject: xilinx: versal-net: Do not setup boot_targets if driver is not enabled SOC can boot in the device which is not accessible from APU and running this is detected as error which ends up in stopping boot process. Boot mode detection and logic around is present to setup priority on boot devices that SOC boot device is likely also used for booting OS. Change logic to detect this case with showing message about it but don't fail in boot process and don't prioritize boot device in this case. Signed-off-by: Venkatesh Yadav Abbarapu Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/20230904032035.11926-2-venkatesh.abbarapu@amd.com --- board/xilinx/versal-net/board.c | 76 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'board') diff --git a/board/xilinx/versal-net/board.c b/board/xilinx/versal-net/board.c index f0d2224b332..7ad299f3a23 100644 --- a/board/xilinx/versal-net/board.c +++ b/board/xilinx/versal-net/board.c @@ -201,7 +201,7 @@ int board_late_init(void) int bootseq = -1; int bootseq_len = 0; int env_targets_len = 0; - const char *mode; + const char *mode = NULL; char *new_targets; char *env_targets; @@ -229,8 +229,8 @@ int board_late_init(void) puts("QSPI_MODE_24\n"); if (uclass_get_device_by_name(UCLASS_SPI, "spi@f1030000", &dev)) { - puts("Boot from QSPI but without QSPI enabled!\n"); - return -1; + debug("QSPI driver for QSPI device is not present\n"); + break; } mode = "xspi"; bootseq = dev_seq(dev); @@ -239,8 +239,8 @@ int board_late_init(void) puts("QSPI_MODE_32\n"); if (uclass_get_device_by_name(UCLASS_SPI, "spi@f1030000", &dev)) { - puts("Boot from QSPI but without QSPI enabled!\n"); - return -1; + debug("QSPI driver for QSPI device is not present\n"); + break; } mode = "xspi"; bootseq = dev_seq(dev); @@ -249,8 +249,8 @@ int board_late_init(void) puts("OSPI_MODE\n"); if (uclass_get_device_by_name(UCLASS_SPI, "spi@f1010000", &dev)) { - puts("Boot from OSPI but without OSPI enabled!\n"); - return -1; + debug("OSPI driver for OSPI device is not present\n"); + break; } mode = "xspi"; bootseq = dev_seq(dev); @@ -264,8 +264,8 @@ int board_late_init(void) puts("SD_MODE\n"); if (uclass_get_device_by_name(UCLASS_MMC, "mmc@f1040000", &dev)) { - puts("Boot from SD0 but without SD0 enabled!\n"); - return -1; + debug("SD0 driver for SD0 device is not present\n"); + break; } debug("mmc0 device found at %p, seq %d\n", dev, dev_seq(dev)); @@ -279,8 +279,8 @@ int board_late_init(void) puts("SD_MODE1\n"); if (uclass_get_device_by_name(UCLASS_MMC, "mmc@f1050000", &dev)) { - puts("Boot from SD1 but without SD1 enabled!\n"); - return -1; + debug("SD1 driver for SD1 device is not present\n"); + break; } debug("mmc1 device found at %p, seq %d\n", dev, dev_seq(dev)); @@ -288,38 +288,38 @@ int board_late_init(void) bootseq = dev_seq(dev); break; default: - mode = ""; printf("Invalid Boot Mode:0x%x\n", bootmode); break; } - if (bootseq >= 0) { - bootseq_len = snprintf(NULL, 0, "%i", bootseq); - debug("Bootseq len: %x\n", bootseq_len); - } - - /* - * One terminating char + one byte for space between mode - * and default boot_targets - */ - env_targets = env_get("boot_targets"); - if (env_targets) - env_targets_len = strlen(env_targets); - - new_targets = calloc(1, strlen(mode) + env_targets_len + 2 + - bootseq_len); - if (!new_targets) - return -ENOMEM; - - if (bootseq >= 0) - sprintf(new_targets, "%s%x %s", mode, bootseq, - env_targets ? env_targets : ""); - else - sprintf(new_targets, "%s %s", mode, - env_targets ? env_targets : ""); - - env_set("boot_targets", new_targets); + if (mode) { + if (bootseq >= 0) { + bootseq_len = snprintf(NULL, 0, "%i", bootseq); + debug("Bootseq len: %x\n", bootseq_len); + } + /* + * One terminating char + one byte for space between mode + * and default boot_targets + */ + env_targets = env_get("boot_targets"); + if (env_targets) + env_targets_len = strlen(env_targets); + + new_targets = calloc(1, strlen(mode) + env_targets_len + 2 + + bootseq_len); + if (!new_targets) + return -ENOMEM; + + if (bootseq >= 0) + sprintf(new_targets, "%s%x %s", mode, bootseq, + env_targets ? env_targets : ""); + else + sprintf(new_targets, "%s %s", mode, + env_targets ? env_targets : ""); + + env_set("boot_targets", new_targets); + } return board_late_init_xilinx(); } -- cgit v1.2.3 From b687f5d22124ab98693bb44ae4f772934031bba2 Mon Sep 17 00:00:00 2001 From: Venkatesh Yadav Abbarapu Date: Mon, 4 Sep 2023 08:50:34 +0530 Subject: xilinx: versal: Do not setup boot_targets if driver is not enabled SOC can boot in the device which is not accessible from APU and running this is detected as error which ends up in stopping boot process. Boot mode detection and logic around is present to setup priority on boot devices that SOC boot device is likely also used for booting OS. Change logic to detect this case with showing message about it but don't fail in boot process and don't prioritize boot device in this case. Signed-off-by: Venkatesh Yadav Abbarapu Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/20230904032035.11926-3-venkatesh.abbarapu@amd.com --- board/xilinx/versal/board.c | 67 +++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 33 deletions(-) (limited to 'board') diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index 60bf37d3c90..982a8b3779f 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -133,7 +133,7 @@ int board_late_init(void) int bootseq = -1; int bootseq_len = 0; int env_targets_len = 0; - const char *mode; + const char *mode = NULL; char *new_targets; char *env_targets; @@ -175,8 +175,8 @@ int board_late_init(void) "mmc@f1050000", &dev) && uclass_get_device_by_name(UCLASS_MMC, "sdhci@f1050000", &dev)) { - puts("Boot from EMMC but without SD1 enabled!\n"); - return -1; + debug("SD1 driver for SD1 device is not present\n"); + break; } debug("mmc1 device found at %p, seq %d\n", dev, dev_seq(dev)); mode = "mmc"; @@ -188,8 +188,8 @@ int board_late_init(void) "mmc@f1040000", &dev) && uclass_get_device_by_name(UCLASS_MMC, "sdhci@f1040000", &dev)) { - puts("Boot from SD0 but without SD0 enabled!\n"); - return -1; + debug("SD0 driver for SD0 device is not present\n"); + break; } debug("mmc0 device found at %p, seq %d\n", dev, dev_seq(dev)); @@ -205,8 +205,8 @@ int board_late_init(void) "mmc@f1050000", &dev) && uclass_get_device_by_name(UCLASS_MMC, "sdhci@f1050000", &dev)) { - puts("Boot from SD1 but without SD1 enabled!\n"); - return -1; + debug("SD1 driver for SD1 device is not present\n"); + break; } debug("mmc1 device found at %p, seq %d\n", dev, dev_seq(dev)); @@ -214,37 +214,38 @@ int board_late_init(void) bootseq = dev_seq(dev); break; default: - mode = ""; printf("Invalid Boot Mode:0x%x\n", bootmode); break; } - if (bootseq >= 0) { - bootseq_len = snprintf(NULL, 0, "%i", bootseq); - debug("Bootseq len: %x\n", bootseq_len); - } + if (mode) { + if (bootseq >= 0) { + bootseq_len = snprintf(NULL, 0, "%i", bootseq); + debug("Bootseq len: %x\n", bootseq_len); + } - /* - * One terminating char + one byte for space between mode - * and default boot_targets - */ - env_targets = env_get("boot_targets"); - if (env_targets) - env_targets_len = strlen(env_targets); - - new_targets = calloc(1, strlen(mode) + env_targets_len + 2 + - bootseq_len); - if (!new_targets) - return -ENOMEM; - - if (bootseq >= 0) - sprintf(new_targets, "%s%x %s", mode, bootseq, - env_targets ? env_targets : ""); - else - sprintf(new_targets, "%s %s", mode, - env_targets ? env_targets : ""); - - env_set("boot_targets", new_targets); + /* + * One terminating char + one byte for space between mode + * and default boot_targets + */ + env_targets = env_get("boot_targets"); + if (env_targets) + env_targets_len = strlen(env_targets); + + new_targets = calloc(1, strlen(mode) + env_targets_len + 2 + + bootseq_len); + if (!new_targets) + return -ENOMEM; + + if (bootseq >= 0) + sprintf(new_targets, "%s%x %s", mode, bootseq, + env_targets ? env_targets : ""); + else + sprintf(new_targets, "%s %s", mode, + env_targets ? env_targets : ""); + + env_set("boot_targets", new_targets); + } return board_late_init_xilinx(); } -- cgit v1.2.3 From d75c65a5259e60b9534b48ddabfc1cbb9c098aac Mon Sep 17 00:00:00 2001 From: Venkatesh Yadav Abbarapu Date: Mon, 4 Sep 2023 08:50:35 +0530 Subject: xilinx: zynqmp: Do not setup boot_targets if driver is not enabled SOC can boot in the device which is not accessible from APU and running this is detected as error which ends up in stopping boot process. Boot mode detection and logic around is present to setup priority on boot devices that SOC boot device is likely also used for booting OS. Change logic to detect this case with showing message about it but don't fail in boot process and don't prioritize boot device in this case. Signed-off-by: Venkatesh Yadav Abbarapu Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/20230904032035.11926-4-venkatesh.abbarapu@amd.com --- board/xilinx/zynqmp/zynqmp.c | 71 ++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 35 deletions(-) (limited to 'board') diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 309f24a5f43..0b6d4e57078 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -391,7 +391,7 @@ int board_late_init(void) int bootseq = -1; int bootseq_len = 0; int env_targets_len = 0; - const char *mode; + const char *mode = NULL; char *new_targets; char *env_targets; int ret, multiboot; @@ -442,8 +442,8 @@ int board_late_init(void) "mmc@ff160000", &dev) && uclass_get_device_by_name(UCLASS_MMC, "sdhci@ff160000", &dev)) { - puts("Boot from EMMC but without SD0 enabled!\n"); - return -1; + debug("SD0 driver for SD0 device is not present\n"); + break; } debug("mmc0 device found at %p, seq %d\n", dev, dev_seq(dev)); @@ -457,8 +457,8 @@ int board_late_init(void) "mmc@ff160000", &dev) && uclass_get_device_by_name(UCLASS_MMC, "sdhci@ff160000", &dev)) { - puts("Boot from SD0 but without SD0 enabled!\n"); - return -1; + debug("SD0 driver for SD0 device is not present\n"); + break; } debug("mmc0 device found at %p, seq %d\n", dev, dev_seq(dev)); @@ -475,8 +475,8 @@ int board_late_init(void) "mmc@ff170000", &dev) && uclass_get_device_by_name(UCLASS_MMC, "sdhci@ff170000", &dev)) { - puts("Boot from SD1 but without SD1 enabled!\n"); - return -1; + debug("SD1 driver for SD1 device is not present\n"); + break; } debug("mmc1 device found at %p, seq %d\n", dev, dev_seq(dev)); @@ -490,39 +490,40 @@ int board_late_init(void) env_set("modeboot", "nandboot"); break; default: - mode = ""; printf("Invalid Boot Mode:0x%x\n", bootmode); break; } - if (bootseq >= 0) { - bootseq_len = snprintf(NULL, 0, "%i", bootseq); - debug("Bootseq len: %x\n", bootseq_len); - env_set_hex("bootseq", bootseq); - } + if (mode) { + if (bootseq >= 0) { + bootseq_len = snprintf(NULL, 0, "%i", bootseq); + debug("Bootseq len: %x\n", bootseq_len); + env_set_hex("bootseq", bootseq); + } - /* - * One terminating char + one byte for space between mode - * and default boot_targets - */ - env_targets = env_get("boot_targets"); - if (env_targets) - env_targets_len = strlen(env_targets); - - new_targets = calloc(1, strlen(mode) + env_targets_len + 2 + - bootseq_len); - if (!new_targets) - return -ENOMEM; - - if (bootseq >= 0) - sprintf(new_targets, "%s%x %s", mode, bootseq, - env_targets ? env_targets : ""); - else - sprintf(new_targets, "%s %s", mode, - env_targets ? env_targets : ""); - - env_set("boot_targets", new_targets); - free(new_targets); + /* + * One terminating char + one byte for space between mode + * and default boot_targets + */ + env_targets = env_get("boot_targets"); + if (env_targets) + env_targets_len = strlen(env_targets); + + new_targets = calloc(1, strlen(mode) + env_targets_len + 2 + + bootseq_len); + if (!new_targets) + return -ENOMEM; + + if (bootseq >= 0) + sprintf(new_targets, "%s%x %s", mode, bootseq, + env_targets ? env_targets : ""); + else + sprintf(new_targets, "%s %s", mode, + env_targets ? env_targets : ""); + + env_set("boot_targets", new_targets); + free(new_targets); + } reset_reason(); -- cgit v1.2.3 From 6ec17a2c0f8bca6c92ed4c57b6180f2f80bdfa45 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 5 Sep 2023 13:30:07 +0200 Subject: arm64: xilinx: Guard distro boot variable generation When distro boot is disabled there is no reason to generate variables for it. Also do not update boot_targets variable because it would be unused. It is useful for example when standard boot is enabled and distro boot is disabled. Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/570c51435da59831ec245cddceda078afa58a550.1693913398.git.michal.simek@amd.com --- board/xilinx/versal-net/board.c | 32 ++++++++++++++++------- board/xilinx/versal/board.c | 31 ++++++++++++++++------- board/xilinx/zynqmp/zynqmp.c | 56 +++++++++++++++++++++++++---------------- 3 files changed, 79 insertions(+), 40 deletions(-) (limited to 'board') diff --git a/board/xilinx/versal-net/board.c b/board/xilinx/versal-net/board.c index 7ad299f3a23..c18be0c26c9 100644 --- a/board/xilinx/versal-net/board.c +++ b/board/xilinx/versal-net/board.c @@ -194,7 +194,7 @@ static u8 versal_net_get_bootmode(void) return bootmode; } -int board_late_init(void) +static int boot_targets_setup(void) { u8 bootmode; struct udevice *dev; @@ -205,14 +205,6 @@ int board_late_init(void) char *new_targets; char *env_targets; - if (!(gd->flags & GD_FLG_ENV_DEFAULT)) { - debug("Saved variables - Skipping\n"); - return 0; - } - - if (!IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) - return 0; - bootmode = versal_net_get_bootmode(); puts("Bootmode: "); @@ -320,6 +312,28 @@ int board_late_init(void) env_set("boot_targets", new_targets); } + + return 0; +} + +int board_late_init(void) +{ + int ret; + + if (!(gd->flags & GD_FLG_ENV_DEFAULT)) { + debug("Saved variables - Skipping\n"); + return 0; + } + + if (!IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) + return 0; + + if (IS_ENABLED(CONFIG_DISTRO_DEFAULTS)) { + ret = boot_targets_setup(); + if (ret) + return ret; + } + return board_late_init_xilinx(); } diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index 982a8b3779f..e4bdd5d7a38 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -126,7 +126,7 @@ static u8 versal_get_bootmode(void) return bootmode; } -int board_late_init(void) +static int boot_targets_setup(void) { u8 bootmode; struct udevice *dev; @@ -137,14 +137,6 @@ int board_late_init(void) char *new_targets; char *env_targets; - if (!(gd->flags & GD_FLG_ENV_DEFAULT)) { - debug("Saved variables - Skipping\n"); - return 0; - } - - if (!IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) - return 0; - bootmode = versal_get_bootmode(); puts("Bootmode: "); @@ -247,6 +239,27 @@ int board_late_init(void) env_set("boot_targets", new_targets); } + return 0; +} + +int board_late_init(void) +{ + int ret; + + if (!(gd->flags & GD_FLG_ENV_DEFAULT)) { + debug("Saved variables - Skipping\n"); + return 0; + } + + if (!IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) + return 0; + + if (IS_ENABLED(CONFIG_DISTRO_DEFAULTS)) { + ret = boot_targets_setup(); + if (ret) + return ret; + } + return board_late_init_xilinx(); } diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 0b6d4e57078..f1628030848 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -384,7 +384,7 @@ static int set_fdtfile(void) return 0; } -int board_late_init(void) +static int boot_targets_setup(void) { u8 bootmode; struct udevice *dev; @@ -394,27 +394,6 @@ int board_late_init(void) const char *mode = NULL; char *new_targets; char *env_targets; - int ret, multiboot; - -#if defined(CONFIG_USB_ETHER) && !defined(CONFIG_USB_GADGET_DOWNLOAD) - usb_ether_init(); -#endif - - if (!(gd->flags & GD_FLG_ENV_DEFAULT)) { - debug("Saved variables - Skipping\n"); - return 0; - } - - if (!IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) - return 0; - - ret = set_fdtfile(); - if (ret) - return ret; - - multiboot = multi_boot(); - if (multiboot >= 0) - env_set_hex("multiboot", multiboot); bootmode = zynqmp_get_bootmode(); @@ -525,6 +504,39 @@ int board_late_init(void) free(new_targets); } + return 0; +} + +int board_late_init(void) +{ + int ret, multiboot; + +#if defined(CONFIG_USB_ETHER) && !defined(CONFIG_USB_GADGET_DOWNLOAD) + usb_ether_init(); +#endif + + if (!(gd->flags & GD_FLG_ENV_DEFAULT)) { + debug("Saved variables - Skipping\n"); + return 0; + } + + if (!IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) + return 0; + + ret = set_fdtfile(); + if (ret) + return ret; + + multiboot = multi_boot(); + if (multiboot >= 0) + env_set_hex("multiboot", multiboot); + + if (IS_ENABLED(CONFIG_DISTRO_DEFAULTS)) { + ret = boot_targets_setup(); + if (ret) + return ret; + } + reset_reason(); return board_late_init_xilinx(); -- cgit v1.2.3 From e6ff998cb02aad0326a8280498725a8e7bbbb37b Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Fri, 8 Sep 2023 09:11:31 +0200 Subject: global: Use proper project name U-Boot (next2) Use proper project name in README, rst and comment. Done in connection to commit bb922ca3eb4b ("global: Use proper project name U-Boot (next)"). Reviewed-by: Simon Glass Reviewed-by: Alexander Graf (ppce500) Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/536af05e7061982f15b668e87f941cdabfa25392.1694157084.git.michal.simek@amd.com --- board/cobra5272/README | 18 +++++++++--------- board/emulation/qemu-ppce500/qemu-ppce500.c | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'board') diff --git a/board/cobra5272/README b/board/cobra5272/README index 11abcfacdb6..0b07148b73a 100644 --- a/board/cobra5272/README +++ b/board/cobra5272/README @@ -1,6 +1,6 @@ File: README.COBRA5272 Author: Florian Schlote for Sentec elektronik (linux@sentec-elektronik.de) -Contents: This is the README of u-boot (Universal bootloader) for our +Contents: This is the README of U-Boot (Universal bootloader) for our COBRA5272 board. Version: v01.00 Date: Tue Mar 30 00:28:33 CEST 2004 @@ -31,7 +31,7 @@ Please refer to u-boot README (general info, u-boot-x-x-x/README), to u-boot-x-x-x/board/cobra5272/README and to the comments in u-boot-x-x-x/include/configs/cobra5272.h -Configuring u-boot is done by commenting/uncommenting preprocessor defines. +Configuring U-Boot is done by commenting/uncommenting preprocessor defines. Default configuration is @@ -48,10 +48,10 @@ Default configuration is #----------------------------------- -# u-boot FLASH version & RAM version +# U-Boot FLASH version & RAM version #----------------------------------- -The u-boot bootloader for Coldfire processors can be configured +The U-Boot bootloader for Coldfire processors can be configured 1. as a standalone bootloader residing in flash & relocating itself to RAM on startup automatically => "FLASH version" @@ -60,7 +60,7 @@ The u-boot bootloader for Coldfire processors can be configured prestage bootloader ("chainloading") & is running only from the RAM address it is linked to => "RAM version" - This version may be very helpful when installing u-boot for the first time + This version may be very helpful when installing U-Boot for the first time since it can be used to make available s. th. like a "bootstrap mechanism". @@ -71,7 +71,7 @@ How to build the different images: Flash version ------------------------------ -Compile u-boot +Compile U-Boot in dir ./u-boot-x-x-x/ @@ -81,14 +81,14 @@ please first check: CONFIG_MONITOR_IS_IN_RAM has to be not present in the file - => u-boot as single bootloader starting from flash + => U-Boot as single bootloader starting from flash in configs/cobra5272_defconfig CONFIG_TEXT_BASE should be CONFIG_TEXT_BASE=0xffe00000 - => linking address for u-boot as single bootloader stored in flash + => linking address for U-Boot as single bootloader stored in flash then: @@ -116,7 +116,7 @@ please modify the settings: CONFIG_MONITOR_IS_IN_RAM=y - => u-boot as RAM version, chainloaded by another bootloader or using bdm cable + => U-Boot as RAM version, chainloaded by another bootloader or using bdm cable in configs/cobra5272_defconfig CONFIG_TEXT_BASE should be diff --git a/board/emulation/qemu-ppce500/qemu-ppce500.c b/board/emulation/qemu-ppce500/qemu-ppce500.c index 7ca8773b17e..221361691c1 100644 --- a/board/emulation/qemu-ppce500/qemu-ppce500.c +++ b/board/emulation/qemu-ppce500/qemu-ppce500.c @@ -320,7 +320,7 @@ ulong get_bus_freq(ulong dummy) int cpu_numcores(void) { /* - * The QEMU u-boot target only needs to drive the first core, + * The QEMU U-Boot target only needs to drive the first core, * spinning and device tree nodes get driven by QEMU itself */ return 1; -- cgit v1.2.3 From 0879de0e8b110da1d35db45f086c60cf777f2732 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 31 Aug 2023 11:20:53 -0600 Subject: x86: coreboot: Avoid a declaration after a label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Declare the global_data pointer at the top of the file, to avoid an error: arch/x86/include/asm/global_data.h:143:35: error: a label can only be part of a statement and a declaration is not a statement board/coreboot/coreboot/coreboot.c:60:2: note: in expansion of macro ‘DECLARE_GLOBAL_DATA_PTR’ Signed-off-by: Simon Glass Reviewed-by: Mike Frysinger Reviewed-by: Bin Meng --- board/coreboot/coreboot/coreboot.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'board') diff --git a/board/coreboot/coreboot/coreboot.c b/board/coreboot/coreboot/coreboot.c index 3b90ae75386..db855c11ae6 100644 --- a/board/coreboot/coreboot/coreboot.c +++ b/board/coreboot/coreboot/coreboot.c @@ -10,6 +10,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + int board_early_init_r(void) { /* @@ -54,14 +56,12 @@ int show_board_info(void) return 0; fallback: -#ifdef CONFIG_OF_CONTROL - DECLARE_GLOBAL_DATA_PTR; - - model = fdt_getprop(gd->fdt_blob, 0, "model", NULL); + if (IS_ENABLED(CONFIG_OF_CONTROL)) { + model = fdt_getprop(gd->fdt_blob, 0, "model", NULL); - if (model) - printf("Model: %s\n", model); -#endif + if (model) + printf("Model: %s\n", model); + } return checkboard(); } -- cgit v1.2.3 From 53fab13a7b11630aeb731c8ef7553cf773311a9f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 20 Sep 2023 07:29:51 -0600 Subject: efi: Use the installed SMBIOS tables U-Boot should set up the SMBIOS tables during startup, as it does on x86. Ensure that it does this correctly on non-x86 machines too, by creating an event spy for last-stage init. Tidy up the installation-condition code while we are here. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- board/Marvell/mvebu_armada-37xx/board.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 3fe5319437e..04124d8014d 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -307,7 +307,8 @@ static int last_stage_init(void) struct udevice *bus; ofnode node; - if (!of_machine_is_compatible("globalscale,espressobin")) + if (!CONFIG_IS_ENABLED(DM_MDIO) || + !of_machine_is_compatible("globalscale,espressobin")) return 0; node = ofnode_by_compatible(ofnode_null(), "marvell,orion-mdio"); -- cgit v1.2.3 From 1e94b46f73cedcebbff73799203f3266c5b28d90 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 14 Sep 2023 18:21:46 -0600 Subject: common: Drop linux/printk.h from common header This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass --- board/dhelectronics/dh_stm32mp1/board.c | 1 + board/mediatek/mt8518/mt8518_ap1.c | 1 + board/mscc/ocelot/ocelot.c | 1 + board/nvidia/jetson-tk1/jetson-tk1.c | 1 + board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c | 1 + board/samsung/common/exynos5-dt.c | 1 + board/samsung/common/misc.c | 1 + board/samsung/goni/goni.c | 1 + board/samsung/odroid/odroid.c | 1 + board/st/common/stm32mp_dfu.c | 1 + board/st/stm32mp1/stm32mp1.c | 1 + board/sunxi/board.c | 1 + board/synopsys/hsdk/clk-lib.c | 1 + board/synopsys/hsdk/env-lib.c | 1 + board/ti/am65x/evm.c | 1 + board/ti/common/board_detect.c | 1 + board/ti/j721e/evm.c | 1 + board/toradex/apalis-tk1/apalis-tk1.c | 1 + 18 files changed, 18 insertions(+) (limited to 'board') diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c index f9cfabe2420..341d095d689 100644 --- a/board/dhelectronics/dh_stm32mp1/board.c +++ b/board/dhelectronics/dh_stm32mp1/board.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/board/mediatek/mt8518/mt8518_ap1.c b/board/mediatek/mt8518/mt8518_ap1.c index 2490b15ec78..e03da63b1d9 100644 --- a/board/mediatek/mt8518/mt8518_ap1.c +++ b/board/mediatek/mt8518/mt8518_ap1.c @@ -8,6 +8,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/mscc/ocelot/ocelot.c b/board/mscc/ocelot/ocelot.c index f261346b358..d69db04de66 100644 --- a/board/mscc/ocelot/ocelot.c +++ b/board/mscc/ocelot/ocelot.c @@ -16,6 +16,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/nvidia/jetson-tk1/jetson-tk1.c b/board/nvidia/jetson-tk1/jetson-tk1.c index d349531261e..7f3cdd70fe7 100644 --- a/board/nvidia/jetson-tk1/jetson-tk1.c +++ b/board/nvidia/jetson-tk1/jetson-tk1.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c b/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c index 516292aaa59..4ad780767ea 100644 --- a/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c +++ b/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #define GRF_IO_VSEL_BT565_SHIFT 0 diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c index 726b7f0667a..1e88a82980e 100644 --- a/board/samsung/common/exynos5-dt.c +++ b/board/samsung/common/exynos5-dt.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c index 5ffa216e2e5..cc114aaaa6d 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 535f8e1e012..c8f5a153bb4 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c index 39a60e4ad29..d237828364c 100644 --- a/board/samsung/odroid/odroid.c +++ b/board/samsung/odroid/odroid.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c index 1cf4a3d5fa1..faee953cd4b 100644 --- a/board/st/common/stm32mp_dfu.c +++ b/board/st/common/stm32mp_dfu.c @@ -14,6 +14,7 @@ #include #include #include +#include #define DFU_ALT_BUF_LEN SZ_1K diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 3205a31c6d0..8f5719c28b3 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/board/sunxi/board.c b/board/sunxi/board.c index de0f3505e52..ebaa9431984 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -33,6 +33,7 @@ #include #include #include +#include #ifndef CONFIG_ARM64 #include #endif diff --git a/board/synopsys/hsdk/clk-lib.c b/board/synopsys/hsdk/clk-lib.c index bd43179fc79..be76d6c8f47 100644 --- a/board/synopsys/hsdk/clk-lib.c +++ b/board/synopsys/hsdk/clk-lib.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "clk-lib.h" diff --git a/board/synopsys/hsdk/env-lib.c b/board/synopsys/hsdk/env-lib.c index fd54ac75f20..d85e8167332 100644 --- a/board/synopsys/hsdk/env-lib.c +++ b/board/synopsys/hsdk/env-lib.c @@ -7,6 +7,7 @@ #include "env-lib.h" #include #include +#include #define MAX_CMD_LEN 25 diff --git a/board/ti/am65x/evm.c b/board/ti/am65x/evm.c index d52ac332f81..8bb13ef5b2b 100644 --- a/board/ti/am65x/evm.c +++ b/board/ti/am65x/evm.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "../common/board_detect.h" diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c index 9a53884c98e..ac39b25cd42 100644 --- a/board/ti/common/board_detect.c +++ b/board/ti/common/board_detect.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "board_detect.h" diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index 38fe447d8fa..d4f7c1d9f93 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "../common/board_detect.h" diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c index 86b10400ffa..85134315918 100644 --- a/board/toradex/apalis-tk1/apalis-tk1.c +++ b/board/toradex/apalis-tk1/apalis-tk1.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3