spl: spi: Raw Kernel Image Support for Falcon Mode Boot Via SPI Devices

Nathan Barrett-Morrison nathan.morrison at timesys.com
Tue Apr 19 23:49:21 CEST 2022


Hi Sean,

Thanks for the response.  I don't have my embedded board I'm doing this on quite up to this version of U-Boot, but it does appear your patchset should resolve my issue in the future.  So please disregard my patch, I think we're good!

Sincerely,
Nathan

On 4/19/22 17:43, Sean Anderson wrote:
> Hi Nathan,
> 
> On 4/19/22 5:38 PM, Nathan Barrett-Morrison wrote:
>> [You don't often get email from nathan.morrison at timesys.com. Learn why this is important at http://aka.ms/LearnAboutSenderIdentification.]
>>
>> Hi Tom,
>>
>> I believe this patch is still relevant, so I'm resubmitting it.  It was previously marked as superseded.
>>
>> Thanks,
>> Nathan
>>
>> From 0bb98a42bcb01c078f63513d9151d307dbfd6ccd Mon Sep 17 00:00:00 2001
>> From: Nathan Barrett-Morrison <nathan.morrison at timesys.com>
>> Date: Tue, 19 Apr 2022 17:35:21 -0400
>> 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.morrison at timesys.com>
>> Cc: Tom Rini <trini at 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 cf3f7ef4c0..22e9c87eae 100644
>> --- a/common/spl/spl_spi.c
>> +++ b/common/spl/spl_spi.c
>> @@ -34,9 +34,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, bootdev, header);
>>         if (err)
>>                 return err;
>> --
>> 2.30.2
>>
> 
> Can you see if [1] fixes your problem? You will also need the first patch in the series.
> 
> --Sean
> 
> [1] https://lore.kernel.org/u-boot/20220401190405.1932697-8-sean.anderson@seco.com/


More information about the U-Boot mailing list