diff options
author | Tom Rini <trini@konsulko.com> | 2024-03-21 08:35:23 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-03-21 08:35:23 -0400 |
commit | 5397daaed8994000f2b3480896df9c163dea4375 (patch) | |
tree | 21671fe2a0f3ff4fbeda01be16060406004d93d5 | |
parent | 6ec096a7116a5f1f7dfac5f69ef192429331905c (diff) | |
parent | fcd0c8b8474f7db0b94608424715a73fbeba92dc (diff) |
Merge tag 'efi-2024-04-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2024-04-rc5-2
Documentation:
* patman: Properly document the patchwork_url setting
* doc: man-page for if
* colibri-imx8x, apalis-imx8: update board documentation
UEFI:
* correct handling of EFI binary return code
* don't show usage help if EFI binary fails.
* correct error handling for bootefi selftest command
-rw-r--r-- | cmd/bootefi.c | 12 | ||||
-rw-r--r-- | doc/board/toradex/apalis-imx8.rst | 32 | ||||
-rw-r--r-- | doc/board/toradex/colibri-imx8x.rst | 23 | ||||
-rw-r--r-- | doc/usage/cmd/acpi.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/bootdev.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/bootflow.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/bootmeth.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/cbsysinfo.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/cedit.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/cli.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/dm.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/fdt.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/font.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/for.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/history.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/host.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/if.rst | 72 | ||||
-rw-r--r-- | doc/usage/cmd/md.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/mtrr.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/panic.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/part.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/sf.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/sm.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/trace.rst | 4 | ||||
-rw-r--r-- | doc/usage/cmd/ut.rst | 4 | ||||
-rw-r--r-- | doc/usage/index.rst | 1 | ||||
-rw-r--r-- | lib/efi_loader/efi_bootbin.c | 16 | ||||
-rw-r--r-- | tools/patman/patman.rst | 8 |
28 files changed, 165 insertions, 83 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 9cf9027bf4..578dbb19a7 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; @@ -173,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(); @@ -218,9 +214,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; diff --git a/doc/board/toradex/apalis-imx8.rst b/doc/board/toradex/apalis-imx8.rst index ffc4c7d222..069d86ccd8 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 --------------------------------------- -.. 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 - -Copy the following binaries to the U-Boot folder: +Download imx-seco firmware and extract it: .. code-block:: bash - $ cp imx-atf/build/imx8qm/release/bl31.bin . - $ cp u-boot/u-boot.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 firmware to the U-Boot folder: +Copy the following binaries 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``: diff --git a/doc/board/toradex/colibri-imx8x.rst b/doc/board/toradex/colibri-imx8x.rst index 9e61d98c6b..378b259abd 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``: diff --git a/doc/usage/cmd/acpi.rst b/doc/usage/cmd/acpi.rst index a630f1ec5e..9f30972fe5 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 658020e7c7..f759abab35 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 16ba986dc8..6519e4880a 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 95651fdc7c..2903977ee5 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 8c03a85169..80d8ba1b66 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 b39d708281..5670805a00 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 81487722f6..23e5ee7a90 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 9bef2eeaed..7651507937 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 3e8c32cdea..71a9fc627e 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 adcd5126d0..a878254633 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 4c98419b28..729bd4db43 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 564a159665..b52b5b220a 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 072497db90..a70a432b6f 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/if.rst b/doc/usage/cmd/if.rst new file mode 100644 index 0000000000..6b3dbe7b0a --- /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 <test statement> + then + <statements> + fi + + if <test statement> + then + <statements> + else + <statements> + 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/cmd/md.rst b/doc/usage/cmd/md.rst index 9ea148a8dc..9a9919f9ad 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 c65618950b..3c5c3ba3d4 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 <reg> <type> <start> <size> diff --git a/doc/usage/cmd/panic.rst b/doc/usage/cmd/panic.rst index ba5ea62610..39d32adbc9 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 58be38781e..e7faeccbb0 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 24d5dc692d..dfdca46e66 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 b767647d77..e828fddc51 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 ad6db12394..e798b2bbc6 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 ddc48ec42d..45bc9ffbdc 100644 --- a/doc/usage/cmd/ut.rst +++ b/doc/usage/cmd/ut.rst @@ -6,8 +6,8 @@ ut command ========== -Synopis -------- +Synopsis +-------- :: diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 0d174eefaa..66d73e70cc 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 diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c index 733cc1a61b..b7910f78fb 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; } /** diff --git a/tools/patman/patman.rst b/tools/patman/patman.rst index e01355824c..f4588c00fc 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 |