From e1897784aa9e8dec30ad1067c1107dbd287e5024 Mon Sep 17 00:00:00 2001 From: Benjamin Hahn Date: Tue, 12 Mar 2024 10:39:11 +0100 Subject: [PATCH 01/21] board: phytec: define get_som_type also when SoM detection is disabled define the phytec_get_som_type function also when the SoM detection is disabled. Fixes: commit 110d321a56c3 ("board: phytec: common: phytec_som_detection: Add phytec_get_som_type") Signed-off-by: Benjamin Hahn --- board/phytec/common/phytec_som_detection.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/board/phytec/common/phytec_som_detection.c b/board/phytec/common/phytec_som_detection.c index f9607b018de..a56e0f60d62 100644 --- a/board/phytec/common/phytec_som_detection.c +++ b/board/phytec/common/phytec_som_detection.c @@ -248,4 +248,9 @@ u8 __maybe_unused phytec_get_rev(struct phytec_eeprom_data *data) return PHYTEC_EEPROM_INVAL; } +u8 __maybe_unused phytec_get_som_type(struct phytec_eeprom_data *data) +{ + return PHYTEC_EEPROM_INVAL; +} + #endif /* IS_ENABLED(CONFIG_PHYTEC_SOM_DETECTION) */ From fdd529fa624e8b235a949b63b932d3eb1e9641b9 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Tue, 12 Mar 2024 21:36:41 -0300 Subject: [PATCH 02/21] colibri-imx8x: Fix sc_misc_otp_fuse_read() error check Commit aa6e698a7acd ("imx: toradex/colibri-imx8x: correct SCU API usage") made an incorrect logic change in the error code check of sc_misc_otp_fuse_read(): - if (sc_err == SC_ERR_NONE) { + if (sc_err) { /* DX has two A35 cores disabled */ return (val & 0xf) != 0x0; } The other changes in this commit are correct. sc_misc_otp_fuse_read() returns 0 on a successful fuse read. This inversion causes board_mem_get_layout() to report incorrect RAM size. Go back the original error check logic to fix the problem. Fixes: aa6e698a7acd ("imx: toradex/colibri-imx8x: correct SCU API usage") Reported-by: Hiago De Franco Signed-off-by: Fabio Estevam Reviewed-by: Peng Fan Acked-by: Marcel Ziswiler Tested-by: Hiago De Franco # Toradex Colibri iMX8X 1GB --- board/toradex/colibri-imx8x/colibri-imx8x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c index 2c673a4a6b0..6fc8076163c 100644 --- a/board/toradex/colibri-imx8x/colibri-imx8x.c +++ b/board/toradex/colibri-imx8x/colibri-imx8x.c @@ -46,7 +46,7 @@ static int is_imx8dx(void) u32 val = 0; int sc_err = sc_misc_otp_fuse_read(-1, 6, &val); - if (sc_err) { + if (!sc_err) { /* DX has two A35 cores disabled */ return (val & 0xf) != 0x0; } From cd7af7ee5a06b367fb0f866346ea82c69b96e2f8 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Tue, 12 Mar 2024 21:59:41 -0300 Subject: [PATCH 03/21] apalis-imx8: Fix sc_misc_otp_fuse_read() error check Commit bfb3409d676f ("imx: toradex/apalis-imx8: correct SCU API usage") made an incorrect logic change in the error code check of sc_misc_otp_fuse_read(): - if (scierr == SC_ERR_NONE) { + if (scierr) { /* QP has one A72 core disabled */ is_quadplus = ((val >> 4) & 0x3) != 0x0; } The other changes in this commit are correct. sc_misc_otp_fuse_read() returns 0 on a successful fuse read. This inversion causes board_mem_get_layout() to report incorrect RAM size. Go back the original error check logic to fix the problem. Fixes: bfb3409d676f ("imx: toradex/apalis-imx8: correct SCU API usage") Signed-off-by: Fabio Estevam Reviewed-by: Peng Fan Acked-by: Marcel Ziswiler --- board/toradex/apalis-imx8/apalis-imx8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index 2483a63c673..49719f2f553 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -133,7 +133,7 @@ void board_mem_get_layout(u64 *phys_sdram_1_start, struct tdx_user_fuses tdxramfuses; int scierr = sc_misc_otp_fuse_read(-1, 6, &val); - if (scierr) { + if (!scierr) { /* QP has one A72 core disabled */ is_quadplus = ((val >> 4) & 0x3) != 0x0; } From e648c4a3455a4d1880efe121602ed90a0bc9b53f Mon Sep 17 00:00:00 2001 From: Vitor Soares Date: Fri, 15 Mar 2024 14:44:25 +0000 Subject: [PATCH 04/21] arm: imx: imx8m: soc: Fix NPU/VPU fdt disable fixup On imx8m[m|p|q].dtsi, upstream Linux uses different names for NPU/VPU IP block nodes. It leads variants without such HW block having it enabled by default. This patch adds the upstream Linux node's paths to the disable list while keep the compatibility with downstream Linux. Signed-off-by: Vitor Soares Reviewed-by: Francesco Dolcini --- arch/arm/mach-imx/imx8m/soc.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 39802d6a796..0c49fb9cd48 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -933,19 +933,28 @@ int disable_vpu_nodes(void *blob) { static const char * const nodes_path_8mq[] = { "/vpu@38300000", - "/soc@0/vpu@38300000" + "/soc@0/vpu@38300000", + "/soc@0/video-codec@38300000", + "/soc@0/video-codec@38310000", + "/soc@0/blk-ctrl@38320000", }; static const char * const nodes_path_8mm[] = { "/vpu_g1@38300000", "/vpu_g2@38310000", - "/vpu_h1@38320000" + "/vpu_h1@38320000", + "/soc@0/video-codec@38300000", + "/soc@0/video-codec@38310000", + "/soc@0/blk-ctrl@38330000", }; static const char * const nodes_path_8mp[] = { "/vpu_g1@38300000", "/vpu_g2@38310000", - "/vpu_vc8000e@38320000" + "/vpu_vc8000e@38320000", + "/soc@0/video-codec@38300000", + "/soc@0/video-codec@38310000", + "/soc@0/blk-ctrl@38330000", }; if (is_imx8mq()) @@ -1100,7 +1109,8 @@ int disable_gpu_nodes(void *blob) int disable_npu_nodes(void *blob) { static const char * const nodes_path_8mp[] = { - "/vipsi@38500000" + "/vipsi@38500000", + "/soc@0/npu@38500000", }; return disable_fdt_nodes(blob, nodes_path_8mp, ARRAY_SIZE(nodes_path_8mp)); From fa0ed4c401b3325d20d5afcbd99fca177a71e41c Mon Sep 17 00:00:00 2001 From: Hiago De Franco Date: Fri, 15 Mar 2024 18:56:56 -0300 Subject: [PATCH 05/21] doc: board: colibri-imx8x: Update and improve documentation Update and improve the building documentation of Colibri iMX8X. The following changes were made: - imx-atf repository changed to nxp-imx GitHub. - imx-atf branch updated to 'lf_v2.6'. - imx-seco updated to version 5.8.7. - nxp-imx mfgtools link updated to GitHub releases. - General writing improvements. Signed-off-by: Hiago De Franco Reviewed-by: Francesco Dolcini --- doc/board/toradex/colibri-imx8x.rst | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/doc/board/toradex/colibri-imx8x.rst b/doc/board/toradex/colibri-imx8x.rst index 9e61d98c6b1..378b259abd0 100644 --- a/doc/board/toradex/colibri-imx8x.rst +++ b/doc/board/toradex/colibri-imx8x.rst @@ -20,26 +20,35 @@ Quick Start Get and Build the ARM Trusted Firmware -------------------------------------- +Download the imx-atf repository: + +.. code-block:: bash + + $ git clone -b lf_v2.6 https://github.com/nxp-imx/imx-atf.git + +Compile it with an aarch64 toolchain: + .. code-block:: bash - $ git clone -b toradex_imx_5.4.70_2.3.0 http://git.toradex.com/cgit/imx-atf.git/ $ make PLAT=imx8qx bl31 -C imx-atf Get scfw_tcm.bin and ahab-container.img --------------------------------------- +Download imx-seco firmware and extract it: + .. code-block:: bash - $ wget https://github.com/toradex/i.MX-System-Controller-Firmware/raw/master/src/scfw_export_mx8qx_b0/build_mx8qx_b0/mx8qx-colibri-scfw-tcm.bin - $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-seco-3.8.1.bin - $ sh imx-seco-3.8.1.bin --auto-accept + $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-seco-5.8.7.bin + $ sh imx-seco-5.8.7.bin --auto-accept Copy the following firmware to the U-Boot folder: .. code-block:: bash - $ cp imx-atf/build/imx8qx/release/bl31.bin . - $ cp imx-seco-3.8.1/firmware/seco/mx8qxc0-ahab-container.img mx8qx-ahab-container.img + $ wget https://github.com/toradex/i.MX-System-Controller-Firmware/raw/master/src/scfw_export_mx8qx_b0/build_mx8qx_b0/mx8qx-colibri-scfw-tcm.bin + $ cp ../imx-atf/build/imx8qx/release/bl31.bin . + $ cp ../imx-seco-5.8.7/firmware/seco/mx8qxc0-ahab-container.img mx8qx-ahab-container.img Build U-Boot ------------ @@ -54,7 +63,7 @@ Load the U-Boot Binary Using UUU Get the latest version of the universal update utility (uuu) aka ``mfgtools 3.0``: -https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FNXPmicro%2Fmfgtools%2Freleases +https://github.com/nxp-imx/mfgtools/releases Put the module into USB recovery aka serial downloader mode, connect the USB device to your host and execute ``uuu``: From b9d4db4e0f76f759b6a60035cbc191a8f3ed227b Mon Sep 17 00:00:00 2001 From: Hiago De Franco Date: Fri, 15 Mar 2024 18:56:57 -0300 Subject: [PATCH 06/21] doc: board: apalis-imx8: Update and improve documentation Update and improve the building documentation of Apalis iMX8. The following changes were made: - imx-atf repository changed to nxp-imx GitHub. - imx-atf branch updated to 'lf_v2.6'. - imx-seco updated to version 5.8.7. - nxp-imx mfgtools link updated to GitHub releases. - General writing improvements. Signed-off-by: Hiago De Franco --- doc/board/toradex/apalis-imx8.rst | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/board/toradex/apalis-imx8.rst b/doc/board/toradex/apalis-imx8.rst index ffc4c7d222a..069d86ccd8c 100644 --- a/doc/board/toradex/apalis-imx8.rst +++ b/doc/board/toradex/apalis-imx8.rst @@ -20,36 +20,36 @@ Quick Start Get and Build the ARM Trusted Firmware -------------------------------------- +Download the imx-atf repository: + +.. code-block:: bash + + $ git clone -b lf_v2.6 https://github.com/nxp-imx/imx-atf.git + +Compile it with an aarch64 toolchain: + .. code-block:: bash - $ git clone -b imx_4.14.78_1.0.0_ga https://github.com/nxp-imx/imx-atf $ cd imx-atf/ $ make PLAT=imx8qm bl31 Get scfw_tcm.bin and ahab-container.img --------------------------------------- +Download imx-seco firmware and extract it: + .. code-block:: bash - $ wget https://github.com/toradex/meta-fsl-bsp-release/blob/toradex-sumo-4.14.78-1.0.0_ga-bringup/imx/meta-bsp/recipes- - bsp/imx-sc-firmware/files/mx8qm-apalis-scfw-tcm.bin?raw=true - $ mv mx8qm-apalis-scfw-tcm.bin\?raw\=true mx8qm-apalis-scfw-tcm.bin - $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.0.bin - $ chmod +x firmware-imx-8.0.bin - $ ./firmware-imx-8.0.bin + $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-seco-5.8.7.bin + $ sh imx-seco-5.8.7.bin --auto-accept Copy the following binaries to the U-Boot folder: .. code-block:: bash - $ cp imx-atf/build/imx8qm/release/bl31.bin . - $ cp u-boot/u-boot.bin . - -Copy the following firmware to the U-Boot folder: - -.. code-block:: bash - - $ cp firmware-imx-8.0/firmware/seco/ahab-container.img . + $ wget https://github.com/toradex/i.MX-System-Controller-Firmware/raw/master/src/scfw_export_mx8qm_b0/build_mx8qm_b0/mx8qm-apalis-scfw-tcm.bin + $ cp ../imx-atf/build/imx8qm/release/bl31.bin . + $ cp ../imx-seco-5.8.7/firmware/seco/mx8qmb0-ahab-container.img mx8qm-ahab-container.img Build U-Boot ------------ @@ -64,7 +64,7 @@ Load the U-Boot Binary Using UUU Get the latest version of the universal update utility (uuu) aka ``mfgtools 3.0``: -https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FNXPmicro%2Fmfgtools%2Freleases +https://github.com/nxp-imx/mfgtools/releases Put the module into USB recovery aka serial downloader mode, connect the USB device to your host and execute ``uuu``: From 6f90a05a04d8377ae85f9aba8fc03955da72eba0 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 16 Mar 2024 10:36:42 +0100 Subject: [PATCH 07/21] efi_loader: correct handling of EFI binary return code We should not try to remove protocol interfaces from a NULL handle. efi_run_image() should always return the return code of the executed EFI binary. Fixes: 6422820ac3e5 ("efi_loader: split unrelated code from efi_bootmgr.c") Signed-off-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- lib/efi_loader/efi_bootbin.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c index 733cc1a61b5..b7910f78fb6 100644 --- a/lib/efi_loader/efi_bootbin.c +++ b/lib/efi_loader/efi_bootbin.c @@ -125,7 +125,7 @@ efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size) efi_handle_t mem_handle = NULL, handle; struct efi_device_path *file_path = NULL; struct efi_device_path *msg_path; - efi_status_t ret, ret2; + efi_status_t ret; u16 *load_options; if (!bootefi_device_path || !bootefi_image_path) { @@ -172,11 +172,17 @@ efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size) ret = do_bootefi_exec(handle, load_options); out: - ret2 = efi_uninstall_multiple_protocol_interfaces(mem_handle, - &efi_guid_device_path, - file_path, NULL); + if (mem_handle) { + efi_status_t r; + + r = efi_uninstall_multiple_protocol_interfaces( + mem_handle, &efi_guid_device_path, file_path, NULL); + if (r != EFI_SUCCESS) + log_err("Uninstalling protocol interfaces failed\n"); + } efi_free_pool(file_path); - return (ret != EFI_SUCCESS) ? ret : ret2; + + return ret; } /** From 46e5dd661c82a99b9ac8d302cbbc575f74b6b08b Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 16 Mar 2024 10:36:43 +0100 Subject: [PATCH 08/21] cmd: bootefi: Don't show usage help if EFI binary fails. If an EFI binary returns an error code EFI_INVALID_PARAMETER, we show the usage help for the bootefi command: Shell> exit 0x8000000000000002 ## Application failed, r = 2 bootefi - Boots an EFI payload from memory Usage: bootefi [:] [] - boot EFI payload bootefi bootmgr [fdt address] - load and boot EFI payload based on BootOrder/BootXXXX variables. If specified, the device tree located at gets exposed as EFI configuration table. This makes no sense. Fixes: 296faf4f7ef1 ("cmd: bootefi: re-organize do_bootefi()") Signed-off-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- cmd/bootefi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 9cf9027bf40..b509440cde0 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -154,9 +154,7 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc, !strcmp(argv[1], "bootmgr")) { ret = efi_bootmgr_run(fdt); - if (ret == EFI_INVALID_PARAMETER) - return CMD_RET_USAGE; - else if (ret) + if (ret != EFI_SUCCESS) return CMD_RET_FAILURE; return CMD_RET_SUCCESS; @@ -218,9 +216,7 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc, ret = efi_binary_run(image_buf, size, fdt); - if (ret == EFI_INVALID_PARAMETER) - return CMD_RET_USAGE; - else if (ret) + if (ret != EFI_SUCCESS) return CMD_RET_FAILURE; return CMD_RET_SUCCESS; From 68fc0b877b5ddc93eb542ffa26dcf83e7e2860a8 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 16 Mar 2024 10:36:44 +0100 Subject: [PATCH 09/21] cmd: bootefi: error handling bootefi selftest If bootefi selftest is executed and a problem with the device-tree installation occurs, efi_install_fdt() writes sensible error messages. It never returns EFI_INVALID_PARAMETER. It neither makes sense to check for EFI_INVALID_PARAMETER nor to show the usage help for the bootefi command in this case. Fixes: 296faf4f7ef1 ("cmd: bootefi: re-organize do_bootefi()") Signed-off-by: Heinrich Schuchardt Reviewed-by: Ilias Apalodimas --- cmd/bootefi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index b509440cde0..578dbb19a7e 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -171,9 +171,7 @@ static int do_bootefi(struct cmd_tbl *cmdtp, int flag, int argc, } ret = efi_install_fdt(fdt); - if (ret == EFI_INVALID_PARAMETER) - return CMD_RET_USAGE; - else if (ret != EFI_SUCCESS) + if (ret != EFI_SUCCESS) return CMD_RET_FAILURE; return do_efi_selftest(); From a9122d2c45d267adf80e84ae778eb5ac60bca94f Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 16 Mar 2024 10:57:41 +0100 Subject: [PATCH 10/21] doc: man-page for if Provide a man-page for the if command. Signed-off-by: Heinrich Schuchardt --- doc/usage/cmd/if.rst | 72 ++++++++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + 2 files changed, 73 insertions(+) create mode 100644 doc/usage/cmd/if.rst diff --git a/doc/usage/cmd/if.rst b/doc/usage/cmd/if.rst new file mode 100644 index 00000000000..6b3dbe7b0a0 --- /dev/null +++ b/doc/usage/cmd/if.rst @@ -0,0 +1,72 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +.. index:: + single: if (command) + +if command +========== + +Synopsis +-------- + +:: + + if + then + + fi + + if + then + + else + + fi + +Description +----------- + +The if command is used to conditionally execute statements. + +test statement + Any command. The test statement set the $? variable. If the value of + $? becomes 0 (true) the statements after the **then** statement will + be executed. Otherwise the statements after the **else** statement. + +Example +------- + +The examples shows how the value of a numeric variable can be tested with +**itest**. + +:: + + => a=1; if itest $a == 0; then echo true; else echo false; fi + false + => a=0; if itest $a == 0; then echo true; else echo false; fi + true + +In the following example we try to load an EFI binary via TFTP. If loading +succeeds, the binary is executed. + +:: + + if tftp $kernel_addr_r shellriscv64.efi; then bootefi $kernel_addr_r; fi + +Return value +------------ + +The value of $? is the return value of the last executed statement. + +:: + + => if true; then true; else true; fi; echo $? + 0 + => if false; then true; else true; fi; echo $? + 0 + => if false; then false; else false; fi; echo $? + 1 + => if true; then false; else false; fi; echo $? + 1 + => if false; then true; fi; echo $? + 1 diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 0d174eefaa5..66d73e70cc4 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -71,6 +71,7 @@ Shell commands cmd/gpt cmd/history cmd/host + cmd/if cmd/imxtract cmd/load cmd/loadb From 98b5ea1881ea60cb13c510322352a9349b715d9a Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 16 Mar 2024 11:09:36 +0100 Subject: [PATCH 11/21] doc: typo Synopis %s/Synopis/Synopsis/g Signed-off-by: Heinrich Schuchardt --- doc/usage/cmd/acpi.rst | 4 ++-- doc/usage/cmd/bootdev.rst | 4 ++-- doc/usage/cmd/bootflow.rst | 4 ++-- doc/usage/cmd/bootmeth.rst | 4 ++-- doc/usage/cmd/cbsysinfo.rst | 4 ++-- doc/usage/cmd/cedit.rst | 4 ++-- doc/usage/cmd/cli.rst | 4 ++-- doc/usage/cmd/dm.rst | 4 ++-- doc/usage/cmd/fdt.rst | 4 ++-- doc/usage/cmd/font.rst | 4 ++-- doc/usage/cmd/for.rst | 4 ++-- doc/usage/cmd/history.rst | 4 ++-- doc/usage/cmd/host.rst | 4 ++-- doc/usage/cmd/md.rst | 4 ++-- doc/usage/cmd/mtrr.rst | 4 ++-- doc/usage/cmd/panic.rst | 4 ++-- doc/usage/cmd/part.rst | 4 ++-- doc/usage/cmd/sf.rst | 4 ++-- doc/usage/cmd/sm.rst | 4 ++-- doc/usage/cmd/trace.rst | 4 ++-- doc/usage/cmd/ut.rst | 4 ++-- 21 files changed, 42 insertions(+), 42 deletions(-) diff --git a/doc/usage/cmd/acpi.rst b/doc/usage/cmd/acpi.rst index a630f1ec5e3..9f30972fe53 100644 --- a/doc/usage/cmd/acpi.rst +++ b/doc/usage/cmd/acpi.rst @@ -6,8 +6,8 @@ acpi command ============ -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/bootdev.rst b/doc/usage/cmd/bootdev.rst index 658020e7c7f..f759abab354 100644 --- a/doc/usage/cmd/bootdev.rst +++ b/doc/usage/cmd/bootdev.rst @@ -6,8 +6,8 @@ bootdev command =============== -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/bootflow.rst b/doc/usage/cmd/bootflow.rst index 16ba986dc8a..6519e4880a9 100644 --- a/doc/usage/cmd/bootflow.rst +++ b/doc/usage/cmd/bootflow.rst @@ -6,8 +6,8 @@ bootflow command ================ -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/bootmeth.rst b/doc/usage/cmd/bootmeth.rst index 95651fdc7c5..2903977ee54 100644 --- a/doc/usage/cmd/bootmeth.rst +++ b/doc/usage/cmd/bootmeth.rst @@ -6,8 +6,8 @@ bootmeth command ================ -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/cbsysinfo.rst b/doc/usage/cmd/cbsysinfo.rst index 8c03a85169d..80d8ba1b662 100644 --- a/doc/usage/cmd/cbsysinfo.rst +++ b/doc/usage/cmd/cbsysinfo.rst @@ -3,8 +3,8 @@ cbsysinfo ========= -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/cedit.rst b/doc/usage/cmd/cedit.rst index b39d708281d..5670805a00e 100644 --- a/doc/usage/cmd/cedit.rst +++ b/doc/usage/cmd/cedit.rst @@ -6,8 +6,8 @@ cedit command ============= -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/cli.rst b/doc/usage/cmd/cli.rst index 81487722f69..23e5ee7a902 100644 --- a/doc/usage/cmd/cli.rst +++ b/doc/usage/cmd/cli.rst @@ -6,8 +6,8 @@ cli command =========== -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/dm.rst b/doc/usage/cmd/dm.rst index 9bef2eeaed8..7651507937a 100644 --- a/doc/usage/cmd/dm.rst +++ b/doc/usage/cmd/dm.rst @@ -6,8 +6,8 @@ dm command ========== -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/fdt.rst b/doc/usage/cmd/fdt.rst index 3e8c32cdea3..71a9fc627e5 100644 --- a/doc/usage/cmd/fdt.rst +++ b/doc/usage/cmd/fdt.rst @@ -6,8 +6,8 @@ fdt command =========== -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/font.rst b/doc/usage/cmd/font.rst index adcd5126d0a..a8782546333 100644 --- a/doc/usage/cmd/font.rst +++ b/doc/usage/cmd/font.rst @@ -6,8 +6,8 @@ font command ============ -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/for.rst b/doc/usage/cmd/for.rst index 4c98419b28f..729bd4db43c 100644 --- a/doc/usage/cmd/for.rst +++ b/doc/usage/cmd/for.rst @@ -4,8 +4,8 @@ for command =========== -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/history.rst b/doc/usage/cmd/history.rst index 564a1596655..b52b5b220ae 100644 --- a/doc/usage/cmd/history.rst +++ b/doc/usage/cmd/history.rst @@ -6,8 +6,8 @@ history command =============== -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/host.rst b/doc/usage/cmd/host.rst index 072497db903..a70a432b6f2 100644 --- a/doc/usage/cmd/host.rst +++ b/doc/usage/cmd/host.rst @@ -6,8 +6,8 @@ host command ============ -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/md.rst b/doc/usage/cmd/md.rst index 9ea148a8dca..9a9919f9ad0 100644 --- a/doc/usage/cmd/md.rst +++ b/doc/usage/cmd/md.rst @@ -6,8 +6,8 @@ md command ========== -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/mtrr.rst b/doc/usage/cmd/mtrr.rst index c65618950bc..3c5c3ba3d43 100644 --- a/doc/usage/cmd/mtrr.rst +++ b/doc/usage/cmd/mtrr.rst @@ -6,8 +6,8 @@ mtrr command ============ -Synopis -------- +Synopsis +-------- mtrr [list] mtrr set diff --git a/doc/usage/cmd/panic.rst b/doc/usage/cmd/panic.rst index ba5ea626108..39d32adbc99 100644 --- a/doc/usage/cmd/panic.rst +++ b/doc/usage/cmd/panic.rst @@ -6,8 +6,8 @@ panic command ============= -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/part.rst b/doc/usage/cmd/part.rst index 58be38781e3..e7faeccbb09 100644 --- a/doc/usage/cmd/part.rst +++ b/doc/usage/cmd/part.rst @@ -6,8 +6,8 @@ part command ============ -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/sf.rst b/doc/usage/cmd/sf.rst index 24d5dc692db..dfdca46e66c 100644 --- a/doc/usage/cmd/sf.rst +++ b/doc/usage/cmd/sf.rst @@ -6,8 +6,8 @@ sf command ========== -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/sm.rst b/doc/usage/cmd/sm.rst index b767647d772..e828fddc519 100644 --- a/doc/usage/cmd/sm.rst +++ b/doc/usage/cmd/sm.rst @@ -6,8 +6,8 @@ sm command ========== -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/trace.rst b/doc/usage/cmd/trace.rst index ad6db123942..e798b2bbc6b 100644 --- a/doc/usage/cmd/trace.rst +++ b/doc/usage/cmd/trace.rst @@ -6,8 +6,8 @@ trace command ============= -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/cmd/ut.rst b/doc/usage/cmd/ut.rst index ddc48ec42dd..45bc9ffbdc5 100644 --- a/doc/usage/cmd/ut.rst +++ b/doc/usage/cmd/ut.rst @@ -6,8 +6,8 @@ ut command ========== -Synopis -------- +Synopsis +-------- :: From fcd0c8b8474f7db0b94608424715a73fbeba92dc Mon Sep 17 00:00:00 2001 From: Douglas Anderson Date: Mon, 11 Mar 2024 14:02:45 -0700 Subject: [PATCH 12/21] patman: Properly document the patchwork_url setting The "Series-patchwork-url:" tag description says that it overrides the settings file but doesn't specify the name of the setting. Elsewhere in the documentation about the "useful" settings we see a setting that sounds promising called "patchwork_server" that's actually not a valid setting. It should be "patchwork_url". Fix these problems so the doc is right and more useful. Signed-off-by: Douglas Anderson --- tools/patman/patman.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/patman/patman.rst b/tools/patman/patman.rst index e01355824c5..f4588c00fc1 100644 --- a/tools/patman/patman.rst +++ b/tools/patman/patman.rst @@ -144,7 +144,7 @@ patman.py. For reference, the useful ones (at the moment) shown below process_tags: False verbose: True smtp_server: /path/to/sendmail - patchwork_server: https://patchwork.ozlabs.org + patchwork_url: https://patchwork.ozlabs.org If you want to adjust settings (or aliases) that affect just a single project you can add a section that looks like [project_settings] or @@ -248,9 +248,9 @@ Series-links: [id | version:id]... Series-patchwork-url: url This allows specifying the Patchwork URL for a branch. This overrides - both the setting files and the command-line argument. The URL should - include the protocol and web site, with no trailing slash, for example - 'https://patchwork.ozlabs.org/project' + both the setting files ("patchwork_url") and the command-line argument. + The URL should include the protocol and web site, with no trailing slash, + for example 'https://patchwork.ozlabs.org/project' Cover-letter: Sets the cover letter contents for the series. The first line From bcbd1364cb0f32c3879a9c58ab8d61532e0bc4cd Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Fri, 8 Mar 2024 17:13:15 -0300 Subject: [PATCH 13/21] clk: clk-imx8qxp: Add LPUART IPG entries Since commit cc7df0b9e8bc ("serial: lpuart: Enable IPG clock") the colibri-imx8qxp board no longer boots. The reason is that the imx8qxp clock driver does not handle the LPUART IPG clocks inside get_rate(), set_rate() and enable() functions. Fix the boot regression by adding the LPUART IPG entries. Fixes: cc7df0b9e8bc ("serial: lpuart: Enable IPG clock") Reported-by: Marcel Ziswiler Signed-off-by: Fabio Estevam Reviewed-by: Peng Fan Tested-by: Hiago De Franco # Toradex Colibri iMX8X Acked-by: Sean Anderson --- drivers/clk/imx/clk-imx8qxp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c index 8bf7e325481..d900d4cd528 100644 --- a/drivers/clk/imx/clk-imx8qxp.c +++ b/drivers/clk/imx/clk-imx8qxp.c @@ -88,20 +88,23 @@ ulong imx8_clk_get_rate(struct clk *clk) resource = SC_R_SDHC_1; pm_clk = SC_PM_CLK_PER; break; - case IMX8QXP_UART0_IPG_CLK: case IMX8QXP_UART0_CLK: + case IMX8QXP_UART0_IPG_CLK: resource = SC_R_UART_0; pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART1_CLK: + case IMX8QXP_UART1_IPG_CLK: resource = SC_R_UART_1; pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART2_CLK: + case IMX8QXP_UART2_IPG_CLK: resource = SC_R_UART_2; pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART3_CLK: + case IMX8QXP_UART3_IPG_CLK: resource = SC_R_UART_3; pm_clk = SC_PM_CLK_PER; break; @@ -170,18 +173,22 @@ ulong imx8_clk_set_rate(struct clk *clk, unsigned long rate) pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART0_CLK: + case IMX8QXP_UART0_IPG_CLK: resource = SC_R_UART_0; pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART1_CLK: + case IMX8QXP_UART1_IPG_CLK: resource = SC_R_UART_1; pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART2_CLK: + case IMX8QXP_UART2_IPG_CLK: resource = SC_R_UART_2; pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART3_CLK: + case IMX8QXP_UART3_IPG_CLK: resource = SC_R_UART_3; pm_clk = SC_PM_CLK_PER; break; @@ -263,18 +270,22 @@ int __imx8_clk_enable(struct clk *clk, bool enable) pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART0_CLK: + case IMX8QXP_UART0_IPG_CLK: resource = SC_R_UART_0; pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART1_CLK: + case IMX8QXP_UART1_IPG_CLK: resource = SC_R_UART_1; pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART2_CLK: + case IMX8QXP_UART2_IPG_CLK: resource = SC_R_UART_2; pm_clk = SC_PM_CLK_PER; break; case IMX8QXP_UART3_CLK: + case IMX8QXP_UART3_IPG_CLK: resource = SC_R_UART_3; pm_clk = SC_PM_CLK_PER; break; From f0e997dc61a230dbb8f2eacd465d4eb209524d02 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Fri, 8 Mar 2024 17:13:16 -0300 Subject: [PATCH 14/21] clk: clk-imx8qm: Add LPUART IPG entries Since commit cc7df0b9e8bc ("serial: lpuart: Enable IPG clock") the apalis-imx8qm board no longer boots. The reason is that the imx8qm clock driver does not handle the LPUART IPG clocks inside get_rate(), set_rate() and enable() functions. Fix the boot regression by adding the LPUART IPG entries. Fixes: cc7df0b9e8bc ("serial: lpuart: Enable IPG clock") Reported-by: Marcel Ziswiler Signed-off-by: Fabio Estevam Reviewed-by: Peng Fan --- drivers/clk/imx/clk-imx8qm.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx8qm.c b/drivers/clk/imx/clk-imx8qm.c index 6c05d07c340..01e33de9d63 100644 --- a/drivers/clk/imx/clk-imx8qm.c +++ b/drivers/clk/imx/clk-imx8qm.c @@ -95,20 +95,23 @@ ulong imx8_clk_get_rate(struct clk *clk) resource = SC_R_SDHC_2; pm_clk = SC_PM_CLK_PER; break; - case IMX8QM_UART0_IPG_CLK: case IMX8QM_UART0_CLK: + case IMX8QM_UART0_IPG_CLK: resource = SC_R_UART_0; pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART1_CLK: + case IMX8QM_UART1_IPG_CLK: resource = SC_R_UART_1; pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART2_CLK: + case IMX8QM_UART2_IPG_CLK: resource = SC_R_UART_2; pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART3_CLK: + case IMX8QM_UART3_IPG_CLK: resource = SC_R_UART_3; pm_clk = SC_PM_CLK_PER; break; @@ -181,18 +184,22 @@ ulong imx8_clk_set_rate(struct clk *clk, unsigned long rate) pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART0_CLK: + case IMX8QM_UART0_IPG_CLK: resource = SC_R_UART_0; pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART1_CLK: + case IMX8QM_UART1_IPG_CLK: resource = SC_R_UART_1; pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART2_CLK: + case IMX8QM_UART2_IPG_CLK: resource = SC_R_UART_2; pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART3_CLK: + case IMX8QM_UART3_IPG_CLK: resource = SC_R_UART_3; pm_clk = SC_PM_CLK_PER; break; @@ -283,18 +290,22 @@ int __imx8_clk_enable(struct clk *clk, bool enable) pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART0_CLK: + case IMX8QM_UART0_IPG_CLK: resource = SC_R_UART_0; pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART1_CLK: + case IMX8QM_UART1_IPG_CLK: resource = SC_R_UART_1; pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART2_CLK: + case IMX8QM_UART2_IPG_CLK: resource = SC_R_UART_2; pm_clk = SC_PM_CLK_PER; break; case IMX8QM_UART3_CLK: + case IMX8QM_UART3_IPG_CLK: resource = SC_R_UART_3; pm_clk = SC_PM_CLK_PER; break; From 2bb18248c64e6a51b53c2571c0ca323a687c49c5 Mon Sep 17 00:00:00 2001 From: Joao Paulo Goncalves Date: Tue, 19 Mar 2024 11:04:27 -0300 Subject: [PATCH 15/21] arm: dts: k3-am625-verdin-r5: Change CPU frequency to 800MHz The lowest speed grade of Toradex AM62 SoMs is K speed, resulting in a max value of 800MHz for the CPU operating frequency. A solution with runtime selection of the CPU frequency is already planned to avoid these kinds of problems in the future. Fixes: 8fb8a6d49977 ("arm: dts: k3-am625-verdin-r5:Change CPU frequency to 1000MHz") Signed-off-by: Joao Paulo Goncalves --- arch/arm/dts/k3-am625-verdin-r5.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/k3-am625-verdin-r5.dts b/arch/arm/dts/k3-am625-verdin-r5.dts index 6b03e7405af..2b333e70f5c 100644 --- a/arch/arm/dts/k3-am625-verdin-r5.dts +++ b/arch/arm/dts/k3-am625-verdin-r5.dts @@ -23,7 +23,7 @@ */ assigned-clocks = <&k3_clks 61 0>, <&k3_clks 135 0>, <&k3_clks 157 20>; assigned-clock-parents = <&k3_clks 61 2>, <0>, <&k3_clks 157 22>; - assigned-clock-rates = <200000000>, <1000000000>, <25000000>; + assigned-clock-rates = <200000000>, <800000000>, <25000000>; clocks = <&k3_clks 61 0>; power-domains = <&k3_pds 61 TI_SCI_PD_EXCLUSIVE>, <&k3_pds 135 TI_SCI_PD_EXCLUSIVE>, From 1e3a2c0a4a981372f5d74ba07c6eb98820964155 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 18 Mar 2024 11:47:16 +0100 Subject: [PATCH 16/21] .mailmap entry for Masahisa Kojima The Linaro mail address is not valid anymore. Cc: kojima.masahisa@socionext.com Signed-off-by: Heinrich Schuchardt Reviewed-by: Masahisa Kojima --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index d1f08f3eca8..59f84711000 100644 --- a/.mailmap +++ b/.mailmap @@ -57,6 +57,7 @@ John Linn Jyotheeswar Reddy Mutthareddyvari Jyotheeswar Reddy Mutthareddyvari Kalyani Akula +Masahisa Kojima Love Kumar Lukasz Majewski Marek BehĂșn From bd0aedde3ea3691616c17c720e2d25351308c0a1 Mon Sep 17 00:00:00 2001 From: Hiago De Franco Date: Wed, 20 Mar 2024 13:48:45 -0300 Subject: [PATCH 17/21] board: toradex: verdin-am62_r5: Increase SPL_STACK_R_MALLOC_SIMPLE_LEN Increase the SPL_STACK_R_MALLOC_SIMPLE_LEN to 0x200000 to accommodate the size of tispl.bin fit image. With the recent upgrade of ti-linux-firmware from version v9.1.0 to v9.2.5, the size of tispl.bin fit image has increased to 1.4MB, causing allocation errors in the R5 SPL: ``` alloc space exhausted Could not get FIT buffer of 1325056 bytes check CONFIG_SPL_SYS_MALLOC_SIZE ``` Signed-off-by: Hiago De Franco Reviewed-by: Francesco Dolcini --- configs/verdin-am62_r5_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/verdin-am62_r5_defconfig b/configs/verdin-am62_r5_defconfig index a3febdcb694..5b4b81c925a 100644 --- a/configs/verdin-am62_r5_defconfig +++ b/configs/verdin-am62_r5_defconfig @@ -35,7 +35,7 @@ CONFIG_SPL_BSS_MAX_SIZE=0x3000 CONFIG_SPL_SYS_REPORT_STACK_F_USAGE=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_SPL_STACK_R=y -CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x140000 +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x200000 CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_SYS_MALLOC=y CONFIG_SPL_HAS_CUSTOM_MALLOC_START=y From cac77418d6be11445c3e1139f6763b5f5f5fe9fb Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Sun, 24 Mar 2024 15:19:04 +0000 Subject: [PATCH 18/21] ARM: dts: fix Ethernet on WeTek Hub/Play2 Placing the snps,reset content needed for Ethernet to probe in a common uboot.dtsi results in the content not being used and broken Ethernet. Fix this by creating two board specific dtsi files with the right content. Fixes: 67d5128df950 ("ARM: dts: add support for WeTek Hub and WeTek Play2") Signed-off-by: Christian Hewitt Link: https://lore.kernel.org/r/20240324151905.3817732-2-christianshewitt@gmail.com Signed-off-by: Neil Armstrong --- ...u-boot.dtsi => meson-gxbb-wetek-hub-u-boot.dtsi} | 0 arch/arm/dts/meson-gxbb-wetek-play2-u-boot.dtsi | 13 +++++++++++++ 2 files changed, 13 insertions(+) rename arch/arm/dts/{meson-gxbb-wetek-u-boot.dtsi => meson-gxbb-wetek-hub-u-boot.dtsi} (100%) create mode 100644 arch/arm/dts/meson-gxbb-wetek-play2-u-boot.dtsi diff --git a/arch/arm/dts/meson-gxbb-wetek-u-boot.dtsi b/arch/arm/dts/meson-gxbb-wetek-hub-u-boot.dtsi similarity index 100% rename from arch/arm/dts/meson-gxbb-wetek-u-boot.dtsi rename to arch/arm/dts/meson-gxbb-wetek-hub-u-boot.dtsi diff --git a/arch/arm/dts/meson-gxbb-wetek-play2-u-boot.dtsi b/arch/arm/dts/meson-gxbb-wetek-play2-u-boot.dtsi new file mode 100644 index 00000000000..3743053eb9c --- /dev/null +++ b/arch/arm/dts/meson-gxbb-wetek-play2-u-boot.dtsi @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 BayLibre, SAS. + * Author: Neil Armstrong + */ + +#include "meson-gx-u-boot.dtsi" + +ðmac { + snps,reset-gpio = <&gpio GPIOZ_14 0>; + snps,reset-delays-us = <0 10000 1000000>; + snps,reset-active-low; +}; From 65d5c367b00cb392bda560c3da1834979adcf137 Mon Sep 17 00:00:00 2001 From: Christian Hewitt Date: Sun, 24 Mar 2024 15:19:05 +0000 Subject: [PATCH 19/21] board: amlogic: add meson_generate_serial_ethaddr fallback to p200 Add a fall-back method to generate ethaddr from CPU serial on p200 boards if the MAC cannot be read from efuse. This prevents random MAC addresses on the WeTek Hub/Play2 boards. Signed-off-by: Christian Hewitt Link: https://lore.kernel.org/r/20240324151905.3817732-3-christianshewitt@gmail.com Signed-off-by: Neil Armstrong --- board/amlogic/p200/p200.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/board/amlogic/p200/p200.c b/board/amlogic/p200/p200.c index 7c432f9d281..3061f7a6b3c 100644 --- a/board/amlogic/p200/p200.c +++ b/board/amlogic/p200/p200.c @@ -30,6 +30,8 @@ int misc_init_r(void) mac_addr, EFUSE_MAC_SIZE); if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("ethaddr", mac_addr); + else + meson_generate_serial_ethaddr(); } if (!env_get("serial#")) { From d54f87f09a36ac20154955297b7c999b368b0443 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Wed, 20 Mar 2024 09:46:11 +0100 Subject: [PATCH 20/21] board: amlogic: fix buffler overflow in seria, mac & usid read While meson_sm_read_efuse() doesn't overflow, the string is not zero terminated and env_set*() will buffer overflow and add random characters to environment. Acked-by: Viacheslav Bocharov Link: https://lore.kernel.org/r/20240320-u-boot-fix-p200-serial-v2-1-972be646a301@linaro.org Signed-off-by: Neil Armstrong --- board/amlogic/beelink-s922x/beelink-s922x.c | 3 ++- board/amlogic/jethub-j100/jethub-j100.c | 3 ++- board/amlogic/jethub-j80/jethub-j80.c | 9 ++++++--- board/amlogic/odroid-n2/odroid-n2.c | 3 ++- board/amlogic/p200/p200.c | 6 ++++-- board/amlogic/p201/p201.c | 6 ++++-- board/amlogic/p212/p212.c | 6 ++++-- board/amlogic/q200/q200.c | 6 ++++-- board/amlogic/vim3/vim3.c | 3 ++- 9 files changed, 30 insertions(+), 15 deletions(-) diff --git a/board/amlogic/beelink-s922x/beelink-s922x.c b/board/amlogic/beelink-s922x/beelink-s922x.c index adae27fc7e7..c2776310a3d 100644 --- a/board/amlogic/beelink-s922x/beelink-s922x.c +++ b/board/amlogic/beelink-s922x/beelink-s922x.c @@ -20,7 +20,7 @@ int misc_init_r(void) { - u8 mac_addr[MAC_ADDR_LEN]; + u8 mac_addr[MAC_ADDR_LEN + 1]; char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3]; ssize_t len; @@ -41,6 +41,7 @@ int misc_init_r(void) tmp[2] = '\0'; mac_addr[i] = hextoul(tmp, NULL); } + mac_addr[MAC_ADDR_LEN] = '\0'; if (is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("ethaddr", mac_addr); diff --git a/board/amlogic/jethub-j100/jethub-j100.c b/board/amlogic/jethub-j100/jethub-j100.c index 6a2c4ad4c3c..010fc0df7d1 100644 --- a/board/amlogic/jethub-j100/jethub-j100.c +++ b/board/amlogic/jethub-j100/jethub-j100.c @@ -17,7 +17,7 @@ int misc_init_r(void) { - u8 mac_addr[ARP_HLEN]; + u8 mac_addr[ARP_HLEN + 1]; char serial[SM_SERIAL_SIZE]; u32 sid; @@ -34,6 +34,7 @@ int misc_init_r(void) mac_addr[3] = (sid >> 16) & 0xff; mac_addr[4] = (sid >> 8) & 0xff; mac_addr[5] = (sid >> 0) & 0xff; + mac_addr[ARP_HLEN] = '\0'; eth_env_set_enetaddr("ethaddr", mac_addr); } diff --git a/board/amlogic/jethub-j80/jethub-j80.c b/board/amlogic/jethub-j80/jethub-j80.c index 185880de139..0b781666e98 100644 --- a/board/amlogic/jethub-j80/jethub-j80.c +++ b/board/amlogic/jethub-j80/jethub-j80.c @@ -27,9 +27,9 @@ int misc_init_r(void) { - u8 mac_addr[EFUSE_MAC_SIZE]; - char serial[EFUSE_SN_SIZE]; - char usid[EFUSE_USID_SIZE]; + u8 mac_addr[EFUSE_MAC_SIZE + 1]; + char serial[EFUSE_SN_SIZE + 1]; + char usid[EFUSE_USID_SIZE + 1]; ssize_t len; unsigned int adcval; int ret; @@ -37,6 +37,7 @@ int misc_init_r(void) if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, mac_addr, EFUSE_MAC_SIZE); + mac_addr[len] = '\0'; if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("ethaddr", mac_addr); else @@ -46,6 +47,7 @@ int misc_init_r(void) if (!env_get("serial")) { len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, EFUSE_SN_SIZE); + serial[len] = '\0'; if (len == EFUSE_SN_SIZE) env_set("serial", serial); } @@ -53,6 +55,7 @@ int misc_init_r(void) if (!env_get("usid")) { len = meson_sm_read_efuse(EFUSE_USID_OFFSET, usid, EFUSE_USID_SIZE); + usid[len] = '\0'; if (len == EFUSE_USID_SIZE) env_set("usid", usid); } diff --git a/board/amlogic/odroid-n2/odroid-n2.c b/board/amlogic/odroid-n2/odroid-n2.c index 2135457edd9..a4bcc62174a 100644 --- a/board/amlogic/odroid-n2/odroid-n2.c +++ b/board/amlogic/odroid-n2/odroid-n2.c @@ -107,7 +107,7 @@ static int odroid_detect_variant(void) int misc_init_r(void) { - u8 mac_addr[MAC_ADDR_LEN]; + u8 mac_addr[MAC_ADDR_LEN + 1]; char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3]; ssize_t len; @@ -128,6 +128,7 @@ int misc_init_r(void) tmp[2] = '\0'; mac_addr[i] = hextoul(tmp, NULL); } + mac_addr[MAC_ADDR_LEN] = '\0'; if (is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("ethaddr", mac_addr); diff --git a/board/amlogic/p200/p200.c b/board/amlogic/p200/p200.c index 3061f7a6b3c..754242e4a9f 100644 --- a/board/amlogic/p200/p200.c +++ b/board/amlogic/p200/p200.c @@ -21,13 +21,14 @@ int misc_init_r(void) { - u8 mac_addr[EFUSE_MAC_SIZE]; - char serial[EFUSE_SN_SIZE]; + u8 mac_addr[EFUSE_MAC_SIZE + 1]; + char serial[EFUSE_SN_SIZE + 1]; ssize_t len; if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, mac_addr, EFUSE_MAC_SIZE); + mac_addr[len] = '\0'; if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("ethaddr", mac_addr); else @@ -37,6 +38,7 @@ int misc_init_r(void) if (!env_get("serial#")) { len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, EFUSE_SN_SIZE); + serial[len] = '\0'; if (len == EFUSE_SN_SIZE) env_set("serial#", serial); } diff --git a/board/amlogic/p201/p201.c b/board/amlogic/p201/p201.c index 7c432f9d281..769e2735d27 100644 --- a/board/amlogic/p201/p201.c +++ b/board/amlogic/p201/p201.c @@ -21,13 +21,14 @@ int misc_init_r(void) { - u8 mac_addr[EFUSE_MAC_SIZE]; - char serial[EFUSE_SN_SIZE]; + u8 mac_addr[EFUSE_MAC_SIZE + 1]; + char serial[EFUSE_SN_SIZE + 1]; ssize_t len; if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, mac_addr, EFUSE_MAC_SIZE); + mac_addr[len] = '\0'; if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("ethaddr", mac_addr); } @@ -35,6 +36,7 @@ int misc_init_r(void) if (!env_get("serial#")) { len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, EFUSE_SN_SIZE); + serial[len] = '\0'; if (len == EFUSE_SN_SIZE) env_set("serial#", serial); } diff --git a/board/amlogic/p212/p212.c b/board/amlogic/p212/p212.c index fcef90bce56..f6e60ae3af1 100644 --- a/board/amlogic/p212/p212.c +++ b/board/amlogic/p212/p212.c @@ -22,13 +22,14 @@ int misc_init_r(void) { - u8 mac_addr[EFUSE_MAC_SIZE]; - char serial[EFUSE_SN_SIZE]; + u8 mac_addr[EFUSE_MAC_SIZE + 1]; + char serial[EFUSE_SN_SIZE + 1]; ssize_t len; if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, mac_addr, EFUSE_MAC_SIZE); + mac_addr[len] = '\0'; if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("ethaddr", mac_addr); else @@ -38,6 +39,7 @@ int misc_init_r(void) if (!env_get("serial#")) { len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, EFUSE_SN_SIZE); + serial[len] = '\0'; if (len == EFUSE_SN_SIZE) env_set("serial#", serial); } diff --git a/board/amlogic/q200/q200.c b/board/amlogic/q200/q200.c index 3aa6d8f200e..47f1566a9d3 100644 --- a/board/amlogic/q200/q200.c +++ b/board/amlogic/q200/q200.c @@ -22,13 +22,14 @@ int misc_init_r(void) { - u8 mac_addr[EFUSE_MAC_SIZE]; - char serial[EFUSE_SN_SIZE]; + u8 mac_addr[EFUSE_MAC_SIZE + 1]; + char serial[EFUSE_SN_SIZE + 1]; ssize_t len; if (!eth_env_get_enetaddr("ethaddr", mac_addr)) { len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, mac_addr, EFUSE_MAC_SIZE); + mac_addr[len] = '\0'; if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("ethaddr", mac_addr); else @@ -38,6 +39,7 @@ int misc_init_r(void) if (!env_get("serial#")) { len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial, EFUSE_SN_SIZE); + serial[len] = '\0'; if (len == EFUSE_SN_SIZE) env_set("serial#", serial); } diff --git a/board/amlogic/vim3/vim3.c b/board/amlogic/vim3/vim3.c index 8bdfb302f72..43d7a8e84f6 100644 --- a/board/amlogic/vim3/vim3.c +++ b/board/amlogic/vim3/vim3.c @@ -151,7 +151,7 @@ int meson_ft_board_setup(void *blob, struct bd_info *bd) int misc_init_r(void) { - u8 mac_addr[MAC_ADDR_LEN]; + u8 mac_addr[MAC_ADDR_LEN + 1]; char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3]; char serial_string[EFUSE_MAC_SIZE + 1]; ssize_t len; @@ -169,6 +169,7 @@ int misc_init_r(void) tmp[2] = '\0'; mac_addr[i] = hextoul(tmp, NULL); } + mac_addr[MAC_ADDR_LEN] = '\0'; if (is_valid_ethaddr(mac_addr)) eth_env_set_enetaddr("ethaddr", mac_addr); From dde373bde392c38649c8c4420e0c98ef8d38d9dc Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 25 Mar 2024 21:55:55 -0400 Subject: [PATCH 21/21] Prepare v2024.04-rc5 Signed-off-by: Tom Rini --- Makefile | 2 +- doc/develop/release_cycle.rst | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f634222223a..ff003a5ad8b 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERSION = 2024 PATCHLEVEL = 04 SUBLEVEL = -EXTRAVERSION = -rc4 +EXTRAVERSION = -rc5 NAME = # *DOCUMENTATION* diff --git a/doc/develop/release_cycle.rst b/doc/develop/release_cycle.rst index db936a8b48e..7cfc2012c42 100644 --- a/doc/develop/release_cycle.rst +++ b/doc/develop/release_cycle.rst @@ -64,15 +64,15 @@ Future Releases For the next scheduled release, release candidates were made on:: -* U-Boot v2024.01-rc1 was released on Mon 29 January 2024. +* U-Boot v2024.04-rc1 was released on Mon 29 January 2024. -* U-Boot v2024.01-rc2 was released on Tue 13 February 2024. +* U-Boot v2024.04-rc2 was released on Tue 13 February 2024. -* U-Boot v2024.01-rc3 was released on Mon 26 February 2024. +* U-Boot v2024.04-rc3 was released on Mon 26 February 2024. -* U-Boot v2024.01-rc4 was released on Mon 11 March 2024. +* U-Boot v2024.04-rc4 was released on Mon 11 March 2024. -.. * U-Boot v2024.01-rc5 was released on Mon 25 March 2024. +* U-Boot v2024.04-rc5 was released on Mon 25 March 2024. Please note that the following dates are planned only and may be deviated from as needed.