aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-07-17x86: Show the CPU physical address size with bdinfoSimon Glass
This is useful information so show it with the bdinfo command. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Add a comment for board_init_f_r_trampoline()Simon Glass
Add a comment for this function in the header. Change the function (and the one after) to use __noreturn to keep checkpatch happy. Add docs to board_init_f_r() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: Tidy up EFI code in interrupt_init()Simon Glass
The ll_boot_init() check handles the EFI case so we don't need the rest of the code. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bios_emulator: Drop VIDEO_IO_OFFSETSimon Glass
This is always zero in the source tree, so drop it. While we are here, add a comment to _X86EMU_env since the symbol is actually defined twice, which can cause confusion when building. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bios_emulator: Add Kconfig and adjust Makefile for SPLSimon Glass
The Kconfig for this is currently inside a particular board. Move it into the correct place and allow use in SPL, so that video can be used there if needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: mtrr: Add documentationSimon Glass
Add documention for the x86 'mtrr' command. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2023-07-17x86: Allow listing MTRRs in SPLSimon Glass
Move MTRR-listing code into a common file so it can be used from SPL. Update the 'mtrr' command to call it. Use this in SPL just before adjusting the MTRRs, so we can see the state set up by the board. Only show it when debug is enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: coral: Adjust various config optionsSimon Glass
Add ms so it is easier to search for tables in memory. Expand the command-line and print buffers so that we can deal with the very long ChromeOS command lines. (typically 700 characters). Enable BOOTSTD_FULL to get the full set of standard-boot options. Replace the existing manual script with 'bootflow scan', since it can find and boot the OS. Finally, expand the malloc() space so we can read large kernels into a bootflow. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: coreboot: Adjust various config optionsSimon Glass
Drop IDE and add NVME since this is more common now. Add ms so it is easier to search for tables in memory. Expand the command-line and print buffers so that we can deal with the very long ChromeOS command lines. (typically 700 characters). Enable BOOTSTD_FULL to get the full set up standard-boot options. Finally, expand the malloc() space so we can read large kernels into a bootflow. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bootstd: Add a simple bootmeth for ChromiumOSSimon Glass
It is possible to boot x86-based ChromeOS machines by parsing a table and locating the kernel and command line. Add a bootmeth for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: zimage: Export the function to obtain the cmdlineSimon Glass
Allow reading the command line from a zimage, so that it can be recorded in the bootflow. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-17x86: Add a function to boot a zimageSimon Glass
Add a direct interface to booting a zimage, so that bootstd can call it without going through the command-line interface. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bootstd: Support automatically setting Linux parametersSimon Glass
Some Linux parameters can be set automatically by U-Boot, if it knows the device being used. For example, since U-Boot knows the serial console being used, it can add parameters for earlycon and console. Add support for this. Note that this is an experimental feature and we will see how useful it turns out to be. It is very handy for ChromeOS, since otherwise it is very difficult to manually determine the UART address or port number, particularly in a script. Provide an example of how this is used with ChromeOS. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: qemu: Switch to standard bootSimon Glass
Drop use of the distro boot script and use standard boot instead. Moving to a text-based environment would be desirable also, but requires additional work. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17x86: qemu: Create a little more room for U-BootSimon Glass
We want to enable some of the more interesting bootstd features. Move SPL up to create some room for the larger U-Boot binary. Also disable microcode since this is not needed Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bootstd: Add support for updating elements of the cmdlineSimon Glass
Add a bootflow command to update the command line more easily. This allows changing a particular parameter rather than editing a very long strings. It is also easier to handle with scripting. The new 'bootflow cmdline' command allows getting and setting single parameters. Fix up the example output while we are here, since there are a few new items. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bootstd: Add a function to update a command lineSimon Glass
The Linux command line consists of a number of words with optional values. At present U-Boot allows this to be changed using the bootargs environment variable. But this is quite painful, since the command line can be very long. Add a function which can adjust a single field in the command line, so that it is easier to make changes before booting. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bdinfo: Show information about the serial portSimon Glass
It is useful to see the detailed setting of the serial port, e.g. to allow setting up earlycon or console for Linux. Add this output to the 'bdinfo' command. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: squashed in 20230716033929.253357-2-sjg@chromium.org] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16Merge tag 'video-20230714' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-video - fix video console default font selection - add panel driver for HannStar HSD060BHW4 - fix backlight pwm integer overflow in duty cycle calculation - fix dw_mipi_dsi hsync/vsync settings - various other fixes for rockchip dw_mipi_dsi
2023-07-16bootstd: Allow storing x86 setup informationSimon Glass
On x86 boards Linux uses a block of binary data to provide information about the command line, memory map, etc. Provide a way to store this in the bootflow so it can be passed on to the OS. No attempt is made to generalise the code, since other archs don't need this information. The field is present always, though, to avoid needing accessors or #ifdefs when building code on other archs. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16bootstd: Use the bootargs env var for changing the cmdlineSimon Glass
The "bootargs" environment variable is used to set the command-line arguments to pass to the OS. Use this same mechanism with bootstd as well. When the variable is updated, it is written to the current bootflow. When the current bootflow is updated, the environment variable is updated too. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16bootstd: Allow storing the OS command line in the bootflowSimon Glass
Some operating systems have a command line which can be adjusted before booting. Store this in the bootflow so it can be controlled within U-Boot. Fix up the example output while we are here, since there are a few new items. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16bootstd: Correct baudrate typoSimon Glass
This is a copy error. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16bootstd: Use bootdev instead of bootdeviceSimon Glass
It seems better to call this a 'bootdev' since this is name used in the documentation. The older 'Bootdevice' name is no-longer used and may cause confusion with the 'bootdevice' environment variable. Update throughout to use bootdev. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16bootstd: Correct the name of the QEMU bootmethSimon Glass
This does not relate to sandbox. Correct the name. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16test: Skip flat-tree tests if devicetree is not usedSimon Glass
Many tests don't actually use the devicetree at all so there is no point in running the tests both with livetree and flat tree. Check for this and skip the flat tree test in that case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-15Merge tag 'efi-2023-10-rc1' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request efi-2023-10-rc1 Documentation: * enhance UEFI anti-rollback documentation EFI: * Reconnect drivers if UninstallProtocol fails * Prefer short device paths for boot options * Fix error handling when updating boot options for block devices
2023-07-15doc: uefi: enhance anti-rollback documentationMasahisa Kojima
To enforce anti-rollback to any older version, dtb must be always update manually. This should be described in the documentation. This commit also adds the recommendation that secure system should not enable the fdt command because lowest-supported-version property in device tree can be changed by fdt command. Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
2023-07-15README: remove Minicom commentHeinrich Schuchardt
The main README file is the wrong place to document how different terminal emulations can be used to access the U-Boot serial console. C-Kermit which requires a configuration file or several commands to access the U-Boot console may not be the preferred choice for newcomers. The provided wiki link is invalid. The man-pages for loadb and loads already show how to use the commands with picocom. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-07-15efi_selftests: add extra testcases on controller handlingIlias Apalodimas
We recently fixed a few issues wrt to controller handling. Add a few test cases to cover the new code. - return EFI_DEVICE_ERROR the first time the protocol interface of the controller is uninstalled, after all the children have been disconnected. This should make the drivers reconnect - add tests to verify controllers are reconnected when uninstalling a protocol fails - add tests to make sure EFI_NOT_FOUND is returned if a non existent interface is being removed Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-15efi_loader: fix the return codes of UninstallProtocolIlias Apalodimas
Up to now we did not check the return value of DisconnectController. A previous patch is fixing that taking into account what happened during the controller disconnect. But that check takes place before our code is trying to figure out if the interface exists to begin with. In case a driver is not allowed to unbind -- e.g returning EFI_DEVICE_ERROR, we will end up returning that error instead of EFI_NOT_FOUND. Add an extra check on the top of the function to make sure the protocol interface exists before trying to disconnect any drivers Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-15efi_loader: check the status of disconnected driversIlias Apalodimas
efi_uninstall_protocol() calls efi_disconnect_all_drivers() but never checks the return value. Instead it tries to identify protocols that are still open after closing the ones that were opened with EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL, EFI_OPEN_PROTOCOL_GET_PROTOCOL and EFI_OPEN_PROTOCOL_TEST_PROTOCOL. Instead of doing that, check the return value early and exit if disconnecting the drivers failed. Also reconnect all the drivers of a handle if protocols are still found on the handle after disconnecting controllers and closing the remaining protocols. While at it fix a memory leak and properly free the opened protocol information when closing a protocol. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2023-07-15efi_loader: reconnect drivers on failureIlias Apalodimas
efi_disconnect_controller() doesn't reconnect drivers in case of failure. Reconnect the disconnected drivers properly Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2023-07-15Load option with short device path for boot varsRaymond Mao
The boot variables automatically generated for removable medias should be with short form of device path without device nodes. This is a requirement for the case that a removable media is plugged into a different port but is still able to work with the existing boot variables. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-15Fix incorrect return code of boot option updateRaymond Mao
Correct the return code for out-of-memory and no boot option found Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-15Move bootorder and bootoption apis to libRaymond Mao
Rename and move bootorder and bootoption apis from cmd to lib for re-use between eficonfig and bootmgr Fix 'unexpected indentation' when 'make htmldocs' after functions are moved Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-14Merge branch '2023-07-14-assorted-general-updates'Tom Rini
- A number of assorted general fixes and code updates
2023-07-14powerpc: Fix flush_cache() speed regressionChristophe Leroy
Flushing kernel image after decompression was taking 113 milliseconds with U-boot 2022.10. With U-boot 2023.01 and 2023.04, flushing the same amount of memory takes approx 1.5 seconds. With U-boot 2023.07-rc6, it takes 6.5 seconds. powerpc flush_cache() function used to call WATCHDOG_RESET() after flushing every cacheline. At that time WATCHDOG_RESET() was light so the operation was almost seamless. But commit 29caf9305b6 ("cyclic: Use schedule() instead of WATCHDOG_RESET()") replaced WATCHDOG_RESET() by schedule() and that started to hurt with U-boot 2022.10. And in U-boot 2023.07-rc6 that's even worse after commit 26e8ebcd7cb ("watchdog: mpc8xxx: Make it generic"). In the meantime commit 729c1fe656 ("powerpc: introduce CONFIG_CACHE_FLUSH_WATCHDOG_THRESHOLD") gives us the opportinity to only call schedule() every given chunk of data instead of every cacheline. As explained in that commit there is no point in pinging the watchdog after every cacheline flush, so lets define a sensible default chunk size of 4k which matches to size of a page on most powerpc platforms. With that new default threshold, the culprit flushing performed after kernel image decompression now takes 85 milliseconds on a powerpc 8xx. Fixes: 29caf9305b6 ("cyclic: Use schedule() instead of WATCHDOG_RESET()") Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-07-14lzma: Fix decompression speed regressionChristophe Leroy
Uncompressing a 1.7Mbytes FIT image on U-boot 2023.04 takes approx 7s on a powerpc 8xx. The same on U-boot 2023.07-rc6 takes approx 28s unless watchdog is disabled. During that decompression, LzmaDec_DecodeReal() calls schedule 1.6 million times, that is every 4µs in average. In the past it used to be a call to WATCHDOG_RESET() which was just calling hw_watchdog_reset(). But the combination of commit 29caf9305b6 ("cyclic: Use schedule() instead of WATCHDOG_RESET()") and commit 26e8ebcd7cb ("watchdog: mpc8xxx: Make it generic") results in an heavier processing. However, there is absolutely no point in calling schedule() that often. By moving and keeping only one call to schedule() in the main loop the number of calls is reduced to 1.2 million which is still too much. So add logic to only call schedule every 1024 times. That leads to a call to schedule approx every 6ms which is still far enough to entertain the watchdog which has a 1s timeout on powerpc 8xx. powerpc 8xx being one of the slowest targets we have today in U-boot, and most other watchdogs having a timeout of one minutes instead of one second like the 8xx, this fix should not have negative impact on other targets. Fixes: 29caf9305b6 ("cyclic: Use schedule() instead of WATCHDOG_RESET()") Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-14ufs: Use 'TASK_TAG' to construct the ucd_req_ptr->header.dword_0Bhupesh Sharma
Instead of using the hard-coded value of 0x1f, use 'TASK_TAG' macro instead to construct the ucd_req_ptr->header.dword_0 This is in sync with what the Linux UFS driver does, i.e. set the byte0 equal to TASK_TAG (see [1]). Setting it to a fixed value of 0x1f is wrong as we define TASK_TAG as 0 inside u-boot ufs framework. So, instead we should use the macro value directly. [1]. https://github.com/torvalds/linux/blob/master/drivers/ufs/core/ufshcd.c#L2705 Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
2023-07-14drivers: led: bcm6753: do not use null label to find the topPhilippe Reynes
This driver considers that a node with an empty label is the top. But the led class has changed, if a label is not provided for a led, the label is filed with the node name. So we update this driver to use a wrapper to manage the top led node. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2023-07-14board_f: Relocate fdt even if GD_FLG_SKIP_RELOC is setKunihiko Hayashi
In case of OF_SEPARATE (!OF_EMBED), the devicetree blob is placed after _end, and fdt_find_separate() always returns _end. There is a .bss section after _end and the section is cleared before relocation. When GD_FLG_SKIP_RELOC is set, relocation is skipped, so the blob is still in .bss section, but will be cleared. As a result, the devicetree become invalid. To avoid this issue, should relocate it regardless of GD_FLG_SKIP_RELOC in reloc_fdt(). Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-14lib/zlib: Fix a bug when getting a gzip header extra fieldOleksandr Suvorov
This fixes CVE-2022-37434 [1] and bases on 2 commits from Mark Adler's zlib master repo - the original fix of CVE bug [2] and the fix for the fix [3]. [1] https://github.com/advisories/GHSA-cfmr-vrgj-vqwv [2] https://github.com/madler/zlib/commit/eff308af425b67093bab25f80f1ae950166bece1 [3] https://github.com/madler/zlib/commit/1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d Fixes: e89516f031d ("zlib: split up to match original source tree") Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2023-07-14net: ti: am65-cpsw-nuss: Use dedicated port mode control registersAndreas Dannenberg
The different CPSW sub-system Ethernet ports have different PHY mode control registers. In order to allow the modes to get configured independently only the register for the port in question must be accessed, otherwise we would just be re-configuring the mode for port 1, while leaving all others at their power-on defaults. Fix this issue by adding a port-number based offset to the mode control base register address based on the fact that the control registers for the different ports are spaced exactly 0x4 bytes apart. Fixes: 9d0dca1199d1 ("net: ethernet: ti: Introduce am654 gigabit eth switch subsystem driver") Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
2023-07-14disable NFS support by defaultPeter Robinson
While NFS is widely used in data centres, and private networks it's quite a nuanced usecase for device firmware. A lot of devices already disable it. Various network protocols should really be opt in, not opt out, because they add extra size and are potential attack vectors from a security PoV. In the NFS case it doesn't really make sense for a lot of devices like tables, SBCs etc. It's also something we don't really want for SystemReady-IR due to security concerns. Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-14env: mmc: statically set the environment partition nameEmmanuel Di Fede
The new opt-out setting, CONFIG_ENV_MMC_PARTITION, statically sets the MMC environment partition name. Prior to this patch, the only way to declare this partition name was by creating a 'u-boot,mmc-env-partition' parameter in the device-tree's /config node. This setting provides additional flexibility, particularly in cases where accessing the device-tree is not straightforward (e.g. QEMU). If undeclared, the device-tree's setting will be used. Signed-off-by: Emmanuel Di Fede <emmanuel.difede@cysec.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
2023-07-14firmware: scmi: return a right errno for SCMI status codeAKASHI Takahiro
scmi_to_linux_errno() is set to return an appropriate errno which corresponds to a given SCMI status code. But the current implementation always returns the same value. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2023-07-14hash: fix a memory leakSergei Antonov
memalign() returns a pointer which is to be freed by free(). To call unmap_sysmem() is incorrect, furthermore it was called in a wrong scope. Also add a check for allocation error. Fixes: d7af2baa49c6 ("crypto/fsl: Fix HW accelerated hash commands") Cc: Breno Lima <breno.lima@nxp.com> Signed-off-by: Sergei Antonov <saproj@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-14clk: scmi: claim the dependency on CONFIG_CLKAKASHI Takahiro
Without CONFIG_CLK, the build fails with the following message: LD u-boot aarch64-none-linux-gnu-ld.bfd: drivers/firmware/scmi/scmi_agent-uclass.o: \ in function `scmi_bind_protocols': .../drivers/firmware/scmi/scmi_agent-uclass.c:79: undefined reference to \ `_u_boot_list_2_driver_2_scmi_clock' Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Sean Anderson <seanga2@gmail.com>
2023-07-14arch: arm: npcm8xx: add cpu version and 4G ram supportJim Liu
Add npcm8xx A2 cpu version check and add 4G RAM support Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>