summaryrefslogtreecommitdiff
path: root/boot/vbe_simple.c
AgeCommit message (Collapse)Author
2025-01-22Merge patch series "vbe: Series part F"Tom Rini
Simon Glass <[email protected]> says: This includes various patches towards implementing the VBE abrec bootmeth in U-Boot. It mostly focuses on introducing a relocating SPL-loader so that VBE can run in the limited amount of SRAM available on many devices. Another minor new feature is support in VBE for specifying the image phase when loading from a FIT. This allows a single FIT to include images for several boot phases, thus simplifying image-creation. One lingering niggle in this series is that it has a different code path for sandbox, since it does not support the relocating jump. It should be possible to resolve this with additional work, but I have not attempted this so far. For v2, I have split the first patch into 5 pieces, to make it easier to see the code-size impact, plus added a few tweaks to reduce code size. Again, only MMC is supported so far. Looking ahead, series G will have some more plumbing and H some rk3399 pieces. That should be enough to complete these feature. Here is a run in my lab, with the VBE ABrec bootmeth. You can see that VPL runs before memory is set up. SPL sets up memory and can be upgraded in the field reliably. $ ub-int vbe Building U-Boot in sourcedir for rk3399-generic Bootstrapping U-Boot from dir /tmp/b/rk3399-generic Writing U-Boot using method rockchip U-Boot TPL 2025.01-rc3-00345-gdfbdbf1eb56c-dirty (Jan 08 2025 - 10:47:58) Trying to boot from vbe_abrec load: Firefly-RK3399 Board Using 'config-3' configuration Trying 'image-vpl' firmware subimage Using 'config-3' configuration Trying 'fdt-3' fdt subimage U-Boot VPL 2025.01-rc3-00345-gdfbdbf1eb56c-dirty (Jan 08 2025 - 10:47:58) Trying to boot from vbe_abrec load: Firefly-RK3399 Board Starting with empty state VBE: Firmware pick A at 800000 Using 'config-3' configuration Trying 'spl' firmware subimage Using 'config-3' configuration Trying 'fdt-3' fdt subimage Channel 0: DDR3, 800MHz BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB Channel 1: DDR3, 800MHz BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB 256B stride U-Boot SPL 2025.01-rc3-00345-gdfbdbf1eb56c-dirty (Jan 08 2025 - 10:47:58 -0700) Trying to boot from vbe_abrec load: Firefly-RK3399 Board VBE: Firmware pick A at 900000 load_simple_fit: Skip load 'atf-5': image size is 0! Relocating bloblist ff8eff00 to 100000: done ns16550_serial serial@ff1a0000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19 U-Boot 2025.01-rc3-00345-gdfbdbf1eb56c-dirty (Jan 08 2025 - 10:47:58 -0700) SoC: Rockchip rk3399 Reset cause: POR Model: Firefly-RK3399 Board DRAM: 4 GiB (effective 3.9 GiB) Core: 314 devices, 33 uclasses, devicetree: separate MMC: mmc@fe310000: 3, mmc@fe320000: 1, mmc@fe330000: 0 Loading Environment from SPIFlash... Invalid bus 0 (err=-19) *** Warning - spi_flash_probe_bus_cs() failed, using default environment In: serial,usbkbd Out: serial,vidconsole Err: serial,vidconsole Model: Firefly-RK3399 Board Net: PMIC: RK808 eth0: ethernet@fe300000 starting USB... Bus usb@fe380000: USB EHCI 1.00 Bus usb@fe3a0000: USB OHCI 1.0 Bus usb@fe3c0000: USB EHCI 1.00 Bus usb@fe3e0000: USB OHCI 1.0 Bus usb@fe900000: Register 2000140 NbrPorts 2 Starting the controller USB XHCI 1.10 scanning bus usb@fe380000 for devices... 1 USB Device(s) found scanning bus usb@fe3a0000 for devices... 1 USB Device(s) found scanning bus usb@fe3c0000 for devices... 2 USB Device(s) found scanning bus usb@fe3e0000 for devices... 1 USB Device(s) found scanning bus usb@fe900000 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Hit any key to stop autoboot: 0 Link: https://lore.kernel.org/r/[email protected]
2025-01-22vbe: Move reading the nvdata into the common fileSimon Glass
All VBE methods read non-volatile data, so move this function into a common file. Signed-off-by: Simon Glass <[email protected]>
2025-01-22vbe: Move reading the version into the common fileSimon Glass
All VBE methods read a version string, so move this function into a common file. Signed-off-by: Simon Glass <[email protected]>
2025-01-22vbe: Create a common function to get the block deviceSimon Glass
Add a vbe_get_blk() function and use it to obtain the block device used by VBE. Signed-off-by: Simon Glass <[email protected]>
2025-01-22vbe: Convert some checks to assertionsSimon Glass
VBE is currently quite careful with function arguments because it is used in VPL which cannot be updated after manufacture. Bugs can cause security holes. Unfortunately this adds to code size. In several cases we are reading values from a devicetree which is part of U-Boot (or at least VPL) and so known to be good. Also, in several places, getting bad values does not matter. So change a few checks to assert() to reduce code size. Signed-off-by: Simon Glass <[email protected]>
2025-01-22vbe: Pass simple_priv to internal functionsSimon Glass
Pass the private data instead of the device, to help the compiler optimise better. This saves 16 bytes of code on pinecube (rk3288) Signed-off-by: Simon Glass <[email protected]>
2025-01-22vbe: Use a block device instead of descriptorSimon Glass
Pass a struct udevice instead of the descriptor structure, since this is the native argument for blk_read() Signed-off-by: Simon Glass <[email protected]>
2025-01-22vbe: Start a common header fileSimon Glass
Move a few things into a new, common header file so that vbe-simple can share code with the upcoming abrec. Put struct simple_nvdata in it and rename it. Signed-off-by: Simon Glass <[email protected]>
2025-01-22vbe: Use blk_read() to read blocksSimon Glass
We should not be using the old blk_d...() interface, is only there to aid migration to driver model. Move to blk_read() instead. Changes in v2: - Split patch into several pieces Signed-off-by: Simon Glass <[email protected]>
2025-01-15bootmeth: Update the read_file() method to include a typeSimon Glass
We want to record the type of each file which is loaded. Add an new parameter for this, to the read_file() method. Update all users. Make bootmeth_common_read_file() store information about the image that is read. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-06boot: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from all "boot/" files and when needed add missing include files directly. Signed-off-by: Tom Rini <[email protected]>
2023-04-28boot: vbe_simple: Fix vbe_simple_read_bootflow() dependencyBin Meng
vbe_simple_read_bootflow() calls vbe_simple_read_bootflow_fw() which is only available when BOOTMETH_VBE_SIMPLE_FW is on. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-10-31vbe: Move OS implementation into a separate fileSimon Glass
Move this into its own file so it can be built only by U-Boot proper. Signed-off-by: Simon Glass <[email protected]>
2022-10-31vbe: Support reading the next SPL phase via VBESimon Glass
Add an SPL loader to obtain the next-phase binary from a FIT provided by the VBE driver. Signed-off-by: Simon Glass <[email protected]>
2022-10-17boot: Tidy up logging and naming in vbe_simpleSimon Glass
Make sure the log_msg_ret() values are unique so that the log trace is unambiguous with LOG_ERROR_RETURN. Also avoid reusing the 'node' variable for two different nodes in bootmeth_vbe_simple_ft_fixup(), since this is confusing. Signed-off-by: Simon Glass <[email protected]>
2022-09-29dm: core: Split ofnode_path_root() into two functionsSimon Glass
This function turns out to be a little confusing since it looks up a path and also registers the tree. Split it into two, one that gets the root node and one that looks up a path, so the purpose is clear. Registering the tree will happen in a function to be added in a later patch, called oftree_from_fdt(). Signed-off-by: Simon Glass <[email protected]>
2022-08-26boot: simplify bootmeth_vbe_simple_ft_fixup()Heinrich Schuchardt
Don't assign a value to a variable if it is not used afterwards. Move variables to the code fragment where they are used. Addresses-Coverity: CID 356243 ("Code maintainability issues (UNUSED_VALUE)") Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-08-12vbe: Support VBE simpleSimon Glass
Add support for VBE simple, which permits firmware update of a single image stored in MMC or another block device. Signed-off-by: Simon Glass <[email protected]>