summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-09-12tools: mkeficapsule: support generating dynamic GUIDsCaleb Connolly
Add support for generating GUIDs that match those generated internally by U-Boot for capsule update fw_images when using dynamic UUIDs. Dynamic UUIDs in U-Boot work by taking a namespace UUID and hashing it with the board compatible and fw_image name. This feature just provides a way to determine the UUIDs for a particular board without having to actually boot U-Boot on it. Acked-by: Ilias Apalodimas <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-09-12tools: mkeficapsule: use u-boot UUID libraryCaleb Connolly
Replace the use of libuuid with U-Boot's own UUID library. This prepares us to add support for generating v5 GUIDs. Signed-off-by: Caleb Connolly <[email protected]>
2024-09-12include: export uuid.hCaleb Connolly
Move this header to include/u-boot/ so that it can be used by external tools. Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-09-12lib: uuid: supporting building as part of host toolsCaleb Connolly
Adjust the UUID library code so that it can be compiled as part of a host tool. This removes the one redundant log_debug() call, as well as the incorrectly defined LOG_CATEGORY. In general this is a fairly trivial change, just adjusting includes and disabling list_guid. This will be used by a new genguid tool to generate v5 GUIDs that match those generated by U-Boot at runtime. Acked-by: Ilias Apalodimas <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-09-12sandbox: switch to dynamic UUIDsCaleb Connolly
Migrate sandbox over to generating it's capsule update image GUIDs dynamically from the namespace and board/image info. Update the reference and tests to use the new GUIDs. Acked-by: Ilias Apalodimas <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-09-12doc: uefi: document dynamic UUID generationCaleb Connolly
Document how platforms can generate GUIDs at runtime rather than maintaining a list of UUIDs per-board. Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-09-12efi: add a helper to generate dynamic UUIDsCaleb Connolly
Introduce a new helper efi_capsule_update_info_gen_ids() which populates the capsule update fw images image_type_id field. This allows for determinstic UUIDs to be used that can scale to a large number of different boards and board variants without the need to maintain a big list. We call this from efi_fill_image_desc_array() to populate the UUIDs lazily on-demand. Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-09-12lib: uuid: add UUID v5 supportCaleb Connolly
Add support for generating version 5 UUIDs, these are determistic and work by hashing a "namespace" UUID together with some unique data. One intended usecase is to allow for dynamically generate payload UUIDs for UEFI capsule updates, so that supported boards can have their own UUIDs without needing to hardcode them. In addition, move the common bit twiddling code from gen_ran_uuid into a separate function and rewrite it not to use clrsetbits (which is not available when building as part of host tools). Tests for this are added in an upcoming patch. Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-09-12efi: define struct efi_guidCaleb Connolly
This let's us forward declare efi_guid_t in the UUID code without pulling in efi.h Reviewed-by: Ilias Apalodimas <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>
2024-09-12Kconfig: clean up the efi configuration statusIlias Apalodimas
The EFI_LOADER and EFI config options are randomly scattered under lib/ making it cumbersome to navigate and enable options, unless you really know what you are doing. On top of that the existing options are in random order instead of a logical one. So let's move things around a bit and move them under boot/. Present a generic UEFI entry where people can select Capsules, Protocols, Services, and an option to compile U-Boot as an EFI for X86 Signed-off-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-09-12efi_loader: return the correct error in efi_bootmgr_release_uridp()Ilias Apalodimas
There's currently a chance for this function to overwrite an error if one occurred and the subsequent call to efi_uninstall_multiple_protocol_interfaces() succedded. Although this is an EFI event and we can't do much let's at least set and return the correct error Signed-off-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-09-12efi_loader: rename efi_bootmgr_image_return_notifyIlias Apalodimas
We use this event when returning from an EFI HTTP booted image. The name is a bit confusing since it suggests we always run it, rename it to make it clearer Signed-off-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-09-12efi_loader: shorten efi_bootmgr_release_uridp_resource()Ilias Apalodimas
We use this function to clean up leftover resources when booting an EFI HTTP boot image, but the name is unnecessary long. Shorten it to efi_bootmgr_release_uridp() Signed-off-by: Ilias Apalodimas <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2024-09-12Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv ↵Tom Rini
into next CI result shows no issue: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/22315 ---------------------------------------------------------------- - Aspeed: Add AST2700 board (Ibex RISC-V core) support - Add timer, dram controller, network support - Sophgo: Add clock controller support for Milk-V Duo
2024-09-11Merge tag 'u-boot-imx-next-20240911' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/22320 - Improve i.MX8M boot time by enabling MMU and D-cache very early. - Don't drop the enable bit once set on the i.MX PWM driver. - Enable DM_RNG so that the kaslr-seed property is set in the dt allowing Linux KASLR.
2024-09-11pwm: imx: Don't drop the enable bit once setMiquel Raynal
Changing the duty-cycle should not blindly override (and clear) the enable (EN) bit if it has already been set. For instance, a PWM backlight can be enabled and set to a specific intensity using two operations. The order of these operations should not matter. Signed-off-by: Miquel Raynal <[email protected]> Reviewed-by: Fabio Estevam <[email protected]>
2024-09-11configs: venice: enable DM_RNGTim Harvey
Enable DM_RNG so that the kaslr-seed property is set in the dt allowing Linux KASLR. Signed-off-by: Tim Harvey <[email protected]> Reviewed-by: Fabio Estevam <[email protected]>
2024-09-11ARM: imx: Enable MMU and dcache very early on i.MX8MMarek Vasut
Enable MMU and caches very early on in the boot process on i.MX8M in U-Boot proper. This allows board_init_f to run with icache and dcache enabled, which saves some 700 milliseconds of boot time on i.MX8M Plus based device. The 'bootstage report' output is below: Before: ``` Timer summary in microseconds (8 records): Mark Elapsed Stage 0 0 reset 961,363 961,363 board_init_f 1,818,874 857,511 board_init_r 1,921,474 102,600 eth_common_init 2,013,702 92,228 eth_initialize 2,015,238 1,536 main_loop Accumulated time: 32,775 dm_r 289,165 dm_f ``` After: ``` Timer summary in microseconds (8 records): Mark Elapsed Stage 0 0 reset 989,466 989,466 board_init_f 1,179,100 189,634 board_init_r 1,281,456 102,356 eth_common_init 1,373,857 92,401 eth_initialize 1,375,396 1,539 main_loop Accumulated time: 12,630 dm_f 32,635 dm_r ``` Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Peng Fan <[email protected]> Reviewed-by: Fabio Estevam <[email protected]>
2024-09-11configs: ibex-ast2700: Enable DRAM and timer driverChia-Wei Wang
Enable the driver support for the DRAM and timer devices. Signed-off-by: Chia-Wei Wang <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11ram: ast2700: Add DRAM controller initializationChia-Wei Wang
Add driver for AST2700 to initialize DRAM in SPL. This patch also refactors the Kconfig dependency of Aspeed DRAM drivers as some of them are shared among the file structures of RV and ARM ISAs. Signed-off-by: Chia-Wei Wang <[email protected]> Acked-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11board: ibex_ast2700: Add FMC header supportChia-Wei Wang
Define and parse the header of the First Mutable Code (FMC) of AST2700 SoCs at runtime phase. The FMC header contains the information to load prebuilt binaries required for device initialization such as DRAM and VGA. Signed-off-by: Chia-Wei Wang <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11timer: Add AST2700 IBEX timer supportChia-Wei Wang
Add the driver for the AST2700 Ibex timer, which uses CPU cycles as the timer count running at 200MHz. Signed-off-by: Chia-Wei Wang <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11riscv: Add AST2700 SoC initial platform supportChia-Wei Wang
AST2700 SoCs integrates a Ibex 32-bits RISC-V core as the boot MCU for the first stage bootloader execution, namely SPL. This patch implements the preliminary base to successfully run SPL on this RV32-based MCU to the console banner message. Signed-off-by: Chia-Wei Wang <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11riscv: u-boot-spl.lds: Remove _image_binary_end alignmentChia-Wei Wang
The _image_binary_end symbol was aligned to the 8-bytes boundary. However, the SPL device tree (u-boot-spl.dtb) is concatenated right after the binary (u-boot-spl-nodtb.bin) wihtout the consideration of the 8-bytes alignment restriction. After then, for the SPL_SEPARATE_BSS case, fdtdec_setup() searching for the DTB by _image_binary_end will return the "Missing DTB" error. As the real DTB starting point does not align to a 8-bytes address like _image_binary_end does. Signed-off-by: Chia-Wei Wang <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11riscv: Make stack size shift configurableChia-Wei Wang
Add prompt for STACK_SIZE_SHIFT to make it configurable. The default value remains 14 as usual. Signed-off-by: Chia-Wei Wang <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11riscv: Make A ISA extension selectableChia-Wei Wang
Make the Atomic (A) ISA extension selectable. Thus CPUs such as Ibex without the A extension can be supported. Signed-off-by: Chia-Wei Wang <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11driver: net: Add Aspeed AST2700 MDIO supportJacky Chou
The AST2700 is the 7th generation SoC from Aspeed. And use the driver to support clause 22 access. Signed-off-by: Jacky Chou <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11net: ftgmac100: Add Aspeed AST2700 supportJacky Chou
Add support of Aspeed AST2700 SoC. AST2700 is based on ARM64 so modify the DMA address related code to fit both ARM and ARM64. Besides, the RMII/RGMII mode control register is moved from SCU500 to MAC50 so initialize the register in ftgmac100_start correspondingly. Signed-off-by: Jacky Chou <[email protected]> Acked-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11net: ftgmac100: Modify desc. size to cache lineJacky Chou
The TX/RX descriptor size is 16 byte. When the cache line size is larger than 16 bytes, descriptors flushed to RAM will flush more than one descriptor. It is possible that it may mistakenly flush to other descriptor that has been updated by MAC in RAM. To avoid this issue, align the descriptors to cache line size. Only one desc will be flushed or invalidated at a time. Signed-off-by: Jacky Chou <[email protected]> Acked-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11net: ftgmac100: Fixed NC-SI PHY device cannot getJacky Chou
The NC-SI interface does not need the MDIO bus and the NC-SI PHY device cannot get from dm_eth_phy_connect. Therefore, use phy_connect directly here. Signed-off-by: Jacky Chou <[email protected]> Acked-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11net: ftgmac100: Fixed the cache coherency issues of rx memoryJacky Chou
When executing TFTP, the ARP will be replied to after receiving the ARP. U-boot's ARP routine modifies the data in the receive packet in response to the ARP packet and then copies it into the transmit packet. At this point, the received packet cache is inconsistent. It is possible that the cache will perform a writeback action to affect the MAC receiving packets. Avoid the same problem that occurs in other networking protocols. In the free_pkt function, ensure cache and memory consistency. Signed-off-by: Jacky Chou <[email protected]> Acked-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11riscv: dts: sophgo: Replace device clocks with real clocks.Kongyang Liu
Replace device clocks with real clocks from the clock controller, and remove dummy clocks. Signed-off-by: Kongyang Liu <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11configs: milkv_duo: Enable clock controllerKongyang Liu
Add configs to enable clock controller for Sophgo Milk-V Duo board Signed-off-by: Kongyang Liu <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11clk: sophgo: cv1800b: Add clock controller driver for cv1800b SoCKongyang Liu
Add clock controller driver for sophgo cv1800b SoC Signed-off-by: Kongyang Liu <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-11dt-bindings: clk: import header for clock controller of sophgo CV1800BKongyang Liu
Import header file of sophgo cv1800b clock controller from kernel Signed-off-by: Kongyang Liu <[email protected]> Link: https://lore.kernel.org/all/IA1PR20MB4953637E7A6C121D7A700F1CBB8BA@IA1PR20MB4953.namprd20.prod.outlook.com/ Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2024-09-10Merge patch series "phycore-am62/4: Add more boot sources"Tom Rini
Daniel Schultz <[email protected]> says: This patch stack extends the phyCORE-AM62x/AM64x U-Boot by following boot sources: - Load U-Boot with USB DFU - Load a Linux and initramfs from OSPI/QSPI NOR flash - Load a Linux and rootfs from Network Moreover, it adds required changes to the environment to boot an A/B system with RAUC and includes some minor fixes.
2024-09-10configs: phycore_am62x_*_defconfig: Set PHYTEC as ManufacturerDaniel Schultz
Commit 371b379edbf3 ("configs: Make USB_GADGET_MANUFACTURER consistent over all PHYTEC boards") made the USB_GADGET_MANUFACTURER value consistent over all PHYTEC boards. Update the phyCORE-AM62x defconfigs to make this config consistent as well. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10configs: phycore_am62x_a53_defconfig: Fix CONFIG_ENV_SIZEDaniel Schultz
The environment should have a size of 0x20000 instead 0x2000. Update to have the same environment size for all PHYTEC K3 products. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10configs: Add phycore_am62x_r5_usbdfu_defconfigDaniel Schultz
This config includes the phycore_am62x_r5_defconfig file as well as the am62x_r5_usbdfu.config fragment. We need another defconfig because the AM62x has not enough internal SRAM to support all boot sources. The normal phycore_am62x_r5_defconfig should allow to boot from MMC and OSPI while this new defconfig allows to boot from USB. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10configs: phycore_am62x_a53_defconfig: Merge am62x_a53_usbdfu.configDaniel Schultz
Merge the am62x_a53_usbdfu.config into the phyCORE-AM62x A53 defconfig to properly support USB DFU boot. This config was made with the following command: make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- \ phycore_am62x_a53_defconfig am62x_a53_usbdfu.config However, CONFIG_USB_GADGET_MANUFACTURER was not merged to keep Phytec as manufacturer. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10configs: phycore_am64x_a53_defconfig: Make BOOTCMD genericDaniel Schultz
The phyCORE-AM64x board code sets an environment variable 'boot' with the device U-Boot booted from. Use this variable in CONFIG_BOOTCOMMAND to boot Linux from the same boot device by default. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10configs: phycore_am62x_a53_defconfig: Make BOOTCMD genericDaniel Schultz
The phyCORE-AM62x board code sets an environment variable 'boot' with the device U-Boot booted from. Use this variable in CONFIG_BOOTCOMMAND to boot Linux from the same boot device by default. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10board: phytec: phycore_am64x: Add Network/SPI BootDaniel Schultz
Include the boot logic to boot via Network or from a OSPI/QSPI NOR flash. Moreover, set all required variables to both boot methods to the environment. Note: The phyBOARD-Electra AM64x is not able to load the U-Boot via Network. However, it's still possible to load the kernel. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10board: phytec: phycore_am62x: Add Network/SPI BootDaniel Schultz
Include the boot logic to boot via Network or from a OSPI/QSPI NOR flash. Moreover, set all required variables to both boot methods to the environment. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10include: env: phytec: Add K3 boot logic for OSPI/QSPI flashesDaniel Schultz
This boot logic allows to boot a Kernel image, Device-Tree blob and a initramfs from an external OSPI/QSPI NOR flash. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10include: net: phytec: Add K3 network boot logicDaniel Schultz
This boot logic allows to boot a Kernel image, Device-Tree blob and overlays via tftp/dhcp (configurable with 'net_fetch_cmd'). Additionally, it loads a rootfs via NFS. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10include: env: phytec: Add raucinit to k3_mmc environmentDaniel Schultz
Initialize the environment for booting an RAUC image when 'doraucboot' is set to 1. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10include: env: phytec: k3_mmc: Rename variablesDaniel Schultz
Add a mmc prefix to 'loadimage' and 'loadfdt' because we need similar variables for other boot sources. This will prevent name clashes and allows to implement similar boot logic. Also switch from loadaddr to kernel_addr_r. Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10configs: phycore_am64x_a53_defconfig: Enable CONFIG_OF_BOARD_SETUPWadim Egorov
Enable CONFIG_OF_BOARD_SETUP to fixup kernel device tree with mtd partitions. Signed-off-by: Wadim Egorov <[email protected]> Signed-off-by: Daniel Schultz <[email protected]>
2024-09-10spl: spl_load: fix comparison between negative error code and unsigned sizeDaniel Palmer
read could be a negative error value but size in spl_image is unsigned so when they are compared read is used as if it's a unsigned value and if it's negative it'll most likely be bigger than size and the result will be true and _spl_load() will return 0 to the caller. This results in the caller to _spl_load() not seeing that an error happened as it should and continuing as if the load was completed when it might not have been. Check if read is negative and return it's value if it is before comparing against size in spl_image. Signed-off-by: Daniel Palmer <[email protected]> Reviewed-by: Simon Glass <[email protected]>