summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-04-10pxe: Move calculation of FDT file into a functionSimon Glass
This code undertakes a separate task from the main logic of label_run_boot() so move it into its own function. Signed-off-by: Simon Glass <[email protected]>
2024-04-10pxe: Refactor to avoid over-using bootm_argvSimon Glass
The bootm_argv[3] expression is used in many places. It is the FDT address, so use that name throughout. Assign it to bootm_argv[3] only at the end, when all the conditions are resolved. Signed-off-by: Simon Glass <[email protected]>
2024-04-10pxe: Refactor to reduce the size of label_boot()Simon Glass
This function is far too long and complicated. Split out the part which actually calls the boot commands into a separate function. Change a strncpy() to strlcpy() to keep checkpatch happy. No functional change is intended. Signed-off-by: Simon Glass <[email protected]>
2024-04-10pxe: Use strlcpy() instead of strcpy() in label_boot()Simon Glass
The intention here is to nul-terminate the result string, so use the correct function for that. Signed-off-by: Simon Glass <[email protected]>
2024-04-10doc: Mention fastboot dependency on CMDLINESimon Glass
The fastboot 'boot' command only supports running a U-Boot command if CONFIG_CMDLINE is enabled. Mention this in the documentation. Signed-off-by: Simon Glass <[email protected]> Suggested-by: Tom Rini <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Reviewed-by: Sam Protsenko <[email protected]>
2024-04-10fastboot: Remove dependencies on CMDLINESimon Glass
It is possible to boot a kernel without CMDLINE being enabled. Update the implementation to handle this, and drop the condition from the FASTBOOT config. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2024-04-10bootm: Make cmdline optional with bootm_boot_start()Simon Glass
Allow the default command line to be used when booting the OS. This is needed by fastboot. Signed-off-by: Simon Glass <[email protected]>
2024-04-10fastboot: Change fastboot_buf_addr to an addressSimon Glass
Given the name of this variable, it should be an address, not a pointer. Update this, to make it easier to use with sandbox. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Dmitrii Merkurev <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]> # on vim3
2024-04-10boot: Update SYS_BOOTM_LEN to depend on BOOTMSimon Glass
Use the new CONFIG_BOOTM symbol to determine whether SYS_BOOT_LEN is visible or not, since we want to support decompression when CMDLINE is disabled. Signed-off-by: Simon Glass <[email protected]>
2024-04-10treewide: Make arch-specific bootm code depend on BOOTMSimon Glass
Allow these functions to be compiled in when CONFIG_BOOTM is enabled, even if CONFIG_CMD_BOOTM is not. Signed-off-by: Simon Glass <[email protected]> Acked-by: Angelo Dureghello <[email protected]>
2024-04-10bootm: Make OS booting dependent on BOOTMSimon Glass
Booting an OS does not require the 'bootm' command, so change the condition for these options. Move them into boot/ so they don't depend on CMDLINE Note that CMD_BOOTM_PRE_LOAD has been put directly into the bootm code so will need some additional refactoring (and a test!) to allow it to change over. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2024-04-10bootm: Add a Kconfig option for bootm functionalitySimon Glass
Create a separate Kconfig option which enables the bootm logic, separate from the 'bootm' command. This will eventually allow booting without CMDLINE enabled. Update boards which disable CMD_BOOTM to disable BOOTM instead, since CMD_BOOTM now depends on BOOTM Signed-off-by: Simon Glass <[email protected]>
2024-04-10boot: Reorder FIT and BOOTSTD to be firstSimon Glass
The boot menu shows Android first and then a timestamp option. Move these later since they are less commonly used. Signed-off-by: Simon Glass <[email protected]>
2024-04-10Merge patch series "Complete decoupling of zboot logic from commands"Tom Rini
Simon Glass <[email protected]> says: This series refactors the zboot code to allow it to be used with CONFIG_COMMAND disabled. A new zboot_run() function is used to boot a zimage.
2024-04-10x86: zboot: Tidy up the comment for zboot_run()Simon Glass
The current use case (ChromeOS) is the uncommon case. Document how this function is more normally used, where base is 0 and cmdline is NULL Signed-off-by: Simon Glass <[email protected]>
2024-04-10x86: zboot: Use zboot_start() in zboot_run()Simon Glass
Now that we have a function to start the process of booting a zimage, use it in zboot_run() to avoid duplicated logic. Signed-off-by: Simon Glass <[email protected]>
2024-04-10x86: zboot: Separate logic functions from commandsSimon Glass
Move zboot_start() and zboot_info() in with the other logic functions. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2024-04-10x86: zboot: Rename zboot_start() to zboot_run()Simon Glass
The term 'start' is used withint bootm and zboot to indicate the first phase of booting an image. Since zboot_start() does the whole boot, rename it to zboot_run() to align with bootm_run() etc. Fix a log message while we are here. Signed-off-by: Simon Glass <[email protected]>
2024-04-10x86: zboot: Move argument processing outside zboot_start()Simon Glass
Process the arguments before calling zboot_start() so that we can separate the command line from the internal logic. Signed-off-by: Simon Glass <[email protected]>
2024-04-10x86: zboot: Drop intermediate zboot_go() functionSimon Glass
This function only calls zboot_go() so drop it. Signed-off-by: Simon Glass <[email protected]>
2024-04-10x86: zboot: Drop intermediate zboot_setup() functionSimon Glass
Move error checking into the caller so that do_zboot_setup() can call zboot_setup() directly. Signed-off-by: Simon Glass <[email protected]>
2024-04-10x86: zboot: Move environment setting into zboot_load()Simon Glass
The only difference between the command and the underlying logic is the setting of envrionment variables. Move this out of the command processing since it needs to be done in any case. Signed-off-by: Simon Glass <[email protected]>
2024-04-10x86: zboot: Create separate functions for the logicSimon Glass
Separate out the commands from the logic. This will eventually allow the logic to be used when CONFIG_CMDLINE is not enabled. Signed-off-by: Simon Glass <[email protected]>
2024-04-10x86: zboot: Avoid iteration in do_zboot_states()Simon Glass
Drop the iteration and write out each state in full. This will allow the arguments to be reduced and adjusted in future patches. Signed-off-by: Simon Glass <[email protected]>
2024-04-10x86: zboot: Create a separate ZBOOT option for zboot logicSimon Glass
Most of the functionality of zboot is contained in the logic which handles a zimage. Create a separate Kconfig for the logic so that it can (later) be used without the command itself being enabled. Enable ZBOOT by default on x86, with the command depending on that. The existing 'imply' can therefore be removed. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2024-04-10x86: zboot: Move command code into its own fileSimon Glass
Much of the code in zimage.c deals with the zboot command. Move it into a sepatate zboot.c file within the cmd/ directory. This will eventually allow use of the zimage logic without the command being enabled. Signed-off-by: Simon Glass <[email protected]>
2024-04-10x86: zboot: Move zimage definitions to the header fileSimon Glass
In preparation for splitting the zboot-command code into a separate file, move the definitions into the header file. While we are here, mention when load_address and base_ptr are set up and explain bzimage_addr better. Make cmdline const since it cannot be changed. Signed-off-by: Simon Glass <[email protected]>
2024-04-10Merge tag 'xilinx-for-v2024.07-rc1' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-microblaze Xilinx changes for v2024.07-rc1 xilinx: - Do not call env_get_location when !ENV_IS_NOWHERE - Add FDT_FIXUP_PARTITIONS support - Fix legacy format MAC decoding zynqmp: - Enable semihosting SPL support - DT updates - Kconfig resort/cleanup - Don't describe second image/capsule if !SPL - Add support for dfu/capsule description via MTD - Support JTAG as alternative boot mode - Add support for TEG soc variant zynqmp-kria: - Wire usb4 boot device - Update SDIO tristate pin configuration - Disable SPI_FLASH_BAR to avoid issue with SPI after update mbv: - Enable SPL and binman - Small platform changes zynqmp-nand: - Error out in case of unsupported SW ECC - Clean error path versal-net: - Support multiple locations for variables
2024-04-10trace: use dynamic string buffer in make_flamegraph()Vincent Stehlé
The str[] buffer declared in make_flamegraph() is used to hold strings representing the full call-stacks recorded in traces. The size of this buffer is currently 500 characters and this works well for the documented examples. However, it is possible to exhaust this buffer when processing traces captured when running the UEFI shell on aarch64 sandbox for example. Indeed, the maximum length needed for such traces can reach 780 characters. As it is difficult to evaluate the maximum size that would ever be needed for all the possible traces, let's use a dynamically allocated `abuf' instead, which we reallocate when needed. This fixes the following error: String too short (500 chars) While at it, fix a few typos in strings and comments. Signed-off-by: Vincent Stehlé <[email protected]> Cc: Tom Rini <[email protected]> Cc: Simon Glass <[email protected]> Cc: Michal Simek <[email protected]>
2024-04-10net: dw_eth_qos: Add missing \n in error messages.Heinrich Schuchardt
Missing line-feeds in error messages lead to output like: phy_startup() failed: -110FAILED: -110=> Output like the following is much easier to read: phy_startup() failed: -110 FAILED: -110 => Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-04-10lib: add missing line breaks in debug messagesMaxim Moskalets
Add missing line breaks to improve debug log readability. Signed-off-by: Maxim Moskalets <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2024-04-10fs: ext4: all file paths are absoluteHeinrich Schuchardt
U-Boot only knows absolute file paths. It is inconsistent to require that saving to an ext4 file system should use a leading '/' while reading does not. Remove the superfluous check. Reported-by: Patrice Chotard <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Tested-by: Patrice Chotard <[email protected]>
2024-04-10net: nfs: fix file handle length in NFSv3Sébastien Szymanski
The NFS protocol uses file handles to refer to file or directory. In NFSv2 file handles have a fixed size of 32 bytes. In NFSv3 file handles have a variable length up to 64 bytes. This is also true for the MOUNT protocol. [1] When the NFSv3 server replies with a file handle length > 32 bytes, U-Boot only copies 32 bytes of that file handle and the next LOOKUP Call fails: BIOS> nfs ${loadaddr} 192.168.1.51:/nfsroot/opos93dev-br/boot/Image Using ethernet@428a0000 device File transfer via NFS from server 192.168.1.51; our IP address is 192.168.1.133 Filename '/nfsroot/opos93dev-br/boot/Image'. Load address: 0x80400000 Loading: *** ERROR: File lookup fail done BIOS> Looking at this transfer in Wireshark, we can see that the server replies with the following file handle: length: 36 [hash (CRC-32): 0x230ac67b] FileHandle: 0100070101005e000000000091763911f87c449fa73c298552db19ba0c9f60002980cfd2 and U-Boot sends the following file handle in the next LOOKUP Call: length: 32 [hash (CRC-32): 0x6314131b] FileHandle: 000000240100070101005e000000000091763911f87c449fa73c298552db19ba Fix this by using a variable length file handle for dirfh. [1] https://www.rfc-editor.org/rfc/rfc1813.html#page-106 Fixes: b0baca982048 ("net: NFS: Add NFSv3 support") Signed-off-by: Sébastien Szymanski <[email protected]> Tested-by: Andrew Davis <[email protected]>
2024-04-10rtc: goldfish_rtc_probe should be staticHeinrich Schuchardt
There is no need to export goldfish_rtc_probe(). Fixes: 2d6dc19fd25d ("rtc: driver for Goldfish RTC") Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-04-10tools: open FIT image read-onlyAhelenia Ziemiańska
Open for reading as O_RDONLY instead of O_RDWR: the only usage of the fd is for the single read() below; this prevented mkimage -f auto -A arm64 \ -T kernel -C lz4 -d Image-6.6.15.lz4 \ -b mt8173-elm-hana-6.6.15.dtb outf when the inputs were unwritable. Link: https://bugs.debian.org/1063097 Signed-off-by: Ahelenia Ziemiańska <[email protected]> Reviewed-by: Dragan Simic <[email protected]>
2024-04-10fs: ext4: make "File System is consistent\n" a debug messageHeinrich Schuchardt
When accessing an ext2 system the message "File System is consistent\n" is shown after each write. This is superfluous noise. Only write a debug message. Signed-off-by: Heinrich Schuchardt <[email protected]>
2024-04-10build: Revive and update LDR format supportGreg Malysa
LDR format files are used primarily by Analog Devices processors but may be of interest to other vendors. Previously support existed for this format as part of the U-Boot build, but it has been unmaintained and unused for a long time. In preparation for adding support for modern ADI processors that use LDR, modernize the LDR support: - Introduce CONFIG_LDR_CPU as the CPU string recognized by the LDR tool may not be the same as CONFIG_CPU - Add an SPL target that repackages u-boot-spl inside an LDR file An almost identical target for packaging u-boot into an LDR file already exists and did not need to be created. Co-developed-by: Nathan Barrett-Morrison <[email protected]> Signed-off-by: Nathan Barrett-Morrison <[email protected]> Signed-off-by: Ian Roberts <[email protected]> Signed-off-by: Greg Malysa <[email protected]>
2024-04-10scripts/Makefile.spl: Use 'sort' in SHRUNK_ARCH_DTB ruleTom Rini
With configs such as "am64x_evm_a53" or "imx8mp_venice" which list multiple device trees to build we get a warning such as: scripts/Makefile.spl:578: target 'spl/dts/freescale/' given more than once in the same rule If we sort this list first the warning goes away. Tested-by: Michal Simek <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-04-10fs: ext4: Change the Settings of file permissionsJixiong Hu
When a file is created in the linux and corresponding file permission is set, if the file needs to be modified in uboot during the startup process, the modified file permission will be reset to 755. Therefore, when the ext4fs_write() function is called, if the file already exists, the file permission of the new file is equal to the file permission of the existing file.
2024-04-10cmd: sysboot: null check filenameCaleb Connolly
Currently if ${bootfile} is unset and sysboot is invoked with no filename specified then U-Boot will crash will a null-pointer dereference. Add the missing check and a matching error print. Fixes: 993c912d304d ("cmd: sysboot: Create a sysboot command dedicated file") Signed-off-by: Caleb Connolly <[email protected]>
2024-04-10arm64: Fix map_range() not splitting mapped blocksPierre-Clément Tosi
The implementation of map_range() creates the requested mapping by walking the page tables, iterating over multiple PTEs and/or descending into existing table mappings as needed. When doing so, it assumes any pre-existing valid PTE to be a table mapping. This assumption is wrong if the platform code attempts to successively map two overlapping ranges where the latter intersects a block mapping created for the former. As a result, map_range() treats the existing block mapping as a table mapping and descends into it i.e. starts interpreting the previously-mapped range as an array of PTEs, writing to them and potentially even descending further (extra fun with MMIO ranges!). Instead, pass any valid non-table mapping to split_block(), which ensures that it actually was a block mapping (calls panic() otherwise) before splitting it. Fixes: 41e2787f5ec4 ("arm64: Reduce add_map() complexity") Signed-off-by: Pierre-Clément Tosi <[email protected]> Tested-by: Fabio Estevam <[email protected]> Tested-by: Hiago De Franco <[email protected]> # Toradex Verdin AM62 Reviewed-by: Marc Zyngier <[email protected]>
2024-04-10xilinx: common: Fix MAC address read from EEPROMPetr Zejdl
The upper-to-lowercase character conversion now avoids altering the MAC address field. In the previous version, this alteration corrupted the MAC address. Signed-off-by: Petr Zejdl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2024-04-10configs: zynqmp_kria: Deactivate CONFIG_SPI_FLASH_BARTejas Bhumkar
The Kria board features a recovery application that activates when the FW_EN button is pressed. Upon power-up flash operates in 3B mode, However, the recovery application changes it back to 4B mode. Currently, after a reset, u-boot activates CONFIG_SPI_FLASH_BAR and assumes the flash is in 3B mode. However, there's no code or reset lines connected to the flash that could return it to 3B mode. To resolve this issue, changes were made to disable CONFIG_SPI_FLASH_BAR, which activates 4-byte opcodes. Signed-off-by: Tejas Bhumkar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2024-04-09Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscvTom Rini
CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/20256 - RISC-V: Support backtrace and improve isa extension parsing - cpu: Add cv1800b SoC support - board: Add Milk-V Mars board support - board: Add Milk-V Duo SD card support
2024-04-09doc: describe Milk-V Mars boardHeinrich Schuchardt
Add instructions to build U-Boot for the Milk-V Mars board Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-04-09riscv: starfive: avoid including common.hHeinrich Schuchardt
The usage of common.h is deprecated. Remove it from board files. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-04-09board: starfive: support Milk-V Mars boardHeinrich Schuchardt
The differences between the Milk-V Mars board and the VisionFive 2 board are small enough that we can support both using the same U-Boot build. * The model and compatible property are taken from proposed Linux patches. * The EEPROM is atmel,24c02 according to the vendor U-Boot. * The second Ethernet port is not available. usb@10100000 does not exist in U-Boot yet. So we don't have to reflect differences in usage here. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-04-09riscv: set fdtfile on Milk-V MarsHeinrich Schuchardt
Set environment variable fdtfile to the correct value for the Milk-V Mars board. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-04-09eeprom: starfive: function get_product_id_from_eeprom()Heinrich Schuchardt
Export a function get_product_id_from_eeprom() to read the product ID. This value can be used for fixing up the device-tree on JH7110 based products. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-04-09riscv: do not set default fdt for VisionFive 2Heinrich Schuchardt
Currently in set_fdtfile() we set the value of environment variable fdtfile unconditionally. The implies that a value in the environment will be ignored. With the patch environment variable fdtfile will only be set if it does not yet exist. This requires that CONFIG_DEFAULT_FDT_FILE is not set. Now the user can either set and save fdtfile interactively or in the U-Boot configuration to overrule the device-tree name chosen based on the hardware in set_fdtfile(). Reported-by: E Shattow <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>