Hi Tom,

I've attached v2 of this patch.  I've also confirmed again that the
offending lines are entirely unnecessary and amended the patch to delete
them instead.

Sincerely,
Nathan

On Mon, Jan 31, 2022 at 10:23 AM Tom Rini <tr...@konsulko.com> wrote:

> On Mon, Jan 31, 2022 at 10:16:08AM -0500, Nathan Barrett-Morrison wrote:
>
> > Hi Tom,
> >
> > Yes -- I believe this section of code should not be checking for IH_MAGIC
> > at all, as parse_image_header does it as well.
> >
> > Would you like me to resubmit this patch with the offending lines
> deleted?
>
> Well, please take a good look over the whole area of code and see if it
> really makes sense to do what it's doing there or not.
>
> --
> Tom
>
From 65e75debf7813760bf192b477818093e35909081 Mon Sep 17 00:00:00 2001
From: Nathan Barrett Morrison <nathan.morri...@timesys.com>
Date: Wed, 2 Feb 2022 16:56:50 -0500
Subject: [PATCH v2] Allow Falcon Mode boot to use raw kernel image when booting
 via SPI.

When using Falcon Mode boot with a raw, unwrapped kernel image, the bootz_setup() call inside of spl_parse_image_header() is
unreachable because the mkimage header magic check in spi_load_image_os() will never pass.  This check is entirely redundant and unnecessary,
as the spl_parse_image_header() call will also check for IH_MAGIC.

Signed-off-by: Nathan Barrett-Morrison <nathan.morri...@timesys.com>
Cc: Tom Rini <tr...@konsulko.com>
---
Changes for v2:
   - Remove proposed CONFIG_SYS_SPI_KERNEL_SKIP_HEADER option, as we've determined the entire check is redundant and unnecessary.  Just delete it instead.

 common/spl/spl_spi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/common/spl/spl_spi.c b/common/spl/spl_spi.c
index 4e20a23dea..16e268be50 100644
--- a/common/spl/spl_spi.c
+++ b/common/spl/spl_spi.c
@@ -33,9 +33,6 @@ static int spi_load_image_os(struct spl_image_info *spl_image,
 	spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(*header),
 		       (void *)header);
 
-	if (image_get_magic(header) != IH_MAGIC)
-		return -1;
-
 	err = spl_parse_image_header(spl_image, header);
 	if (err)
 		return err;
-- 
2.30.2

Reply via email to