From a16989ecbf4b1c4b3e471e706222c922b62e49bf Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 29 Jun 2025 18:11:56 +0200 Subject: fix: BSwap reivision on AArch64. Signed-off-by: Amlal El Mahrouss --- src/coreboot-start.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/coreboot-start.c b/src/coreboot-start.c index 7a93744..eeeaabc 100644 --- a/src/coreboot-start.c +++ b/src/coreboot-start.c @@ -81,7 +81,13 @@ void cb_start_exec(void) { */ if (boot_hdr->h_mag[0] == CB_BOOT_MAG_0 && boot_hdr->h_mag[1] == CB_BOOT_MAG_1) { - if (boot_hdr->h_revision != CB_BOOT_VER) { + uint32_t rev = boot_hdr->h_revision; + +#ifdef __aarch64__ + rev = __builtin_bswap32(rev); +#endif + + if (rev != CB_BOOT_VER) { if (hart == 0) { cb_put_string("CB> Can't Boot the StageTwo, LX invalid signature. (CB0003)\r\n"); } -- cgit v1.2.3