aboutsummaryrefslogtreecommitdiff
path: root/boot/bootmeth_cros.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-07-30 11:16:49 -0600
committerSimon Glass <sjg@chromium.org>2023-08-10 18:34:54 -0600
commitde30aa9a2f5659ecee599d61e1940b30c76d627c (patch)
tree1885fdb275fe036da23530010c1d0c85a27a5d66 /boot/bootmeth_cros.c
parent5a8589ebd6b20a4ba992bdf8806e574c339b12ea (diff)
bootstd: cros: Bring in some ChromiumOS structures
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>
Diffstat (limited to 'boot/bootmeth_cros.c')
-rw-r--r--boot/bootmeth_cros.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/boot/bootmeth_cros.c b/boot/bootmeth_cros.c
index f6fb521f20..385eca3738 100644
--- a/boot/bootmeth_cros.c
+++ b/boot/bootmeth_cros.c
@@ -21,6 +21,7 @@
#include <asm/zimage.h>
#endif
#include <linux/sizes.h>
+#include "bootmeth_cros.h"
enum {
PROBE_SIZE = SZ_4K, /* initial bytes read from partition */
@@ -82,7 +83,8 @@ static int copy_cmdline(const char *from, const char *uuid, char **bufp)
/**
* scan_part() - Scan a kernel partition to see if has a ChromeOS header
*
- * This reads the first PROBE_SIZE of a partition, loookng for CHROMEOS
+ * This reads the first PROBE_SIZE of a partition, loookng for
+ * VB2_KEYBLOCK_MAGIC
*
* @blk: Block device to scan
* @partnum: Partition number to scan
@@ -114,7 +116,7 @@ static int scan_part(struct udevice *blk, int partnum,
return log_msg_ret("inf", -EIO);
}
- if (memcmp("CHROMEOS", hdr, 8)) {
+ if (memcmp(VB2_KEYBLOCK_MAGIC, hdr->magic, VB2_KEYBLOCK_MAGIC_SIZE)) {
free(hdr);
return -ENOENT;
}