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>
diff --git a/boot/bootmeth_cros.c b/boot/bootmeth_cros.c
index f6fb521..385eca3 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 @@
 /**
  * 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 @@
 		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;
 	}