summaryrefslogtreecommitdiff
path: root/boot/bootmeth_cros.c
AgeCommit message (Collapse)Author
2025-01-15bootstd: Update cros bootmeth to record imagesSimon Glass
Record images loaded by this bootmeth. Signed-off-by: Simon Glass <sjg@chromium.org>
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 <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-07-16bootstd: cros: store partition type in an efi_guid_tVincent Stehlé
The scan_part() function uses a struct uuid to store the little-endian partition type GUID, but this structure should be used only to contain a big-endian UUID. Use an efi_guid_t instead and use guidcmp() for the comparison. Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
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 <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
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 <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
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 <trini@konsulko.com>
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 <sjg@chromium.org>
2023-11-01bootstd: cros: Correct condition for read methodSimon Glass
This has a typo which makes the method inoperable. Correct it so that 'bootflow read' works correctly for ChromeOS. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-26bootstd: cros: Allow detection of any kernel partitionSimon Glass
The existing ChromiumOS bootmeth only supports reading a single kernel partition, either 2 or 4. In fact there are normally two options available. Use the GUID to detect kernel partitions, with the BOOTMETHF_ANY_PART flag, so that bootstd does not require a valid filesystem before calling the bootmeth. Tidy up and improve the logging while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> [trini: Add missing select of PARTITION_TYPE_GUID] Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-11bootstd: cros: Add ARM supportSimon Glass
Support booting ChromiumOS on ARM devices using FIT. Add an entry into the boot implementation which does not require a command line. This can be expanded over time as the bootm code is refactored. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-11bootstd: Add a command to read all files for a bootflowSimon Glass
Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until it is needed to boot. This saves time when scanning and avoids needing to allocate memory for something that may never be used. To permit reading of these files, add a new 'bootflow read' command. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Split up reading info and kernelSimon Glass
Use the two new functions to separate reading of the ChromiumOS info from the partition from actually reading the kernel and booting it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Add a function to read a kernelSimon Glass
The code to read the ChromiumOS information from the partition is currently all in one function. Create a new function which reads the kernel, assuming that the metadata has been parsed. For now this function is not used. Future work will plumb it in. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Add a function to read info from partitionSimon Glass
The code to read the ChromiumOS information from the partition is currently all in one function. It reads the entire kernel, which is unnecessary unless it is to be booted. Create a new function which reads just the minimum required data from the disk, then obtains what it needs from there. For now this function is not used. Future work will plumb it in. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Add private info for ChromiumOSSimon Glass
Create a new private structure to hold information gleaned from the disk. This will allow separation between reading of the bootflow information and (later) reading the whole kernel. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Add docs for the kernel layoutSimon Glass
Provide brief documentation about the ChromiumOS kernel layout. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: Move common zimage functions to bootm.hSimon Glass
We want to avoid using #ifdefs around header files and in the code. It makes sense to collect the various functions used for loading images into a single header which can be included by all architectures. The best place for this is the arch-neutral bootm.h header, so use that. Move some zimage functions into this bootm.h header. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Simplify setup and cmdline expressionsSimon Glass
Create a common base from which the other parts are offset and make all of the offsets related to that. This makes the code a little easier to read. Use X86_ prefixes for the two values which are x86-specific. Drop OFFSET_BASE since it is available in a header field. Drop the unnecessary 'start' variable too. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Decode some kernel preamble fieldsSimon Glass
Decode the kernel start and size using the structures provided. This accesses the same data, just in a cleaner way. Add some logging for some of the fields in the kernel preamble. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Support a kernel on either partitionSimon Glass
ChromiumOS allows a kernel to be on either partition 2 or 4. Add support for scanning both and using the first one we find with a suitable signature. Record the partition which is used. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Bring in some ChromiumOS structuresSimon Glass
Add a header file with structures for booting ChromiumOS, taken from the vboot tree. Using these makes it easier to understand the code. Note that the code style has not been updated for U-Boot, with use of uint64_t, __attribute__((packed)) and one comment-style nit. This should make it easier to keep the code in sync. It was taken from commit: 5b8596ce ("2sha256_arm: Fix data abort issue") Update the CHROMEOS string to use the defined values. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Move partition reading into a functionSimon Glass
Move the code which reads a partition into its own function. Add a constant for the number of bytes to 'probe' at the start of the partition. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Correct reporting of I/O errorsSimon Glass
Return -EIO when the read failed, rather than the number of blocks read. Signed-off-by: Simon Glass <sjg@chromium.org>
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>