[PATCH v2 1/2] spl: spl_nor: add BOOT_DEVICE_NOR2 as alternative SPL_LOAD_IMAGE_METHOD

Mario Kicherer dev at kicherer.org
Mon Jan 30 11:17:33 CET 2023


On 2023-01-27 18:58, Tom Rini wrote:
>> Okay, I think I understand your point now. I am not sure what's the 
>> best
>> way to proceed here. Should I try to build all targets that contain
>> BOOT_DEVICE_NOR and add a #define for BOOT_DEVICE_NOR2 if my patch 
>> really
>> breaks the build? Or should I just add a #define BOOT_DEVICE_NOR2 to 
>> every
>> #define BOOT_DEVICE_NOR?
>> 
>> It looks like a change would be necessary in these files then:
>> 
>> arch/arm/include/asm/arch-am33xx/spl.h
>> arch/arm/include/asm/arch-orion5x/spl.h
>> arch/arm/mach-k3/include/mach/j721e_spl.h
>> arch/arm/mach-k3/include/mach/j721s2_spl.h
>> arch/microblaze/include/asm/spl.h
>> arch/powerpc/include/asm/spl.h
>> 
>> > Ah, OK. Keep in mind that MMC1/MMC2 are for different physical MMC
>> > devices on a given platform. I think this is more like the case where
>> > you should be able to override spl_nor_get_uboot_base at the board level
>> > to say if you're loading A or B?
>> 
>> Ah yes, it's been a while since I wrote this patch originally.
>> spl_nor_get_uboot_base() chooses between A and B and BOOT_DEVICE_NOR2
>> signals that I should choose the other one now.
> 
> I think you should be able to solve this problem without making further
> changes upstream, yes.

I am not sure I understand your answer. Both ways I mentioned would 
probably
require further changes. Or do you mean I should find a way to implement
this only with board-specific code?

I sent two additional patches to the mailing list:

[PATCH] spl: spl_nor: use panic instead of hang if booting fails
[PATCH] spl: spl-nor: return error if no valid image was loaded

which would make this possible.

However, I would prefer this patch series as it enables loading U-Boot
from an alternate location without additional resets and relying on a
boot counter.

Best regards,
Mario


More information about the U-Boot mailing list