On Mon, 7 Jan 2019 14:16:23 +0100 Maxime Ripard <maxime.rip...@bootlin.com> wrote:
> On Sat, Jan 05, 2019 at 08:03:46PM +0200, Oskari Lemmela wrote: > > Enable SPI bootcmd if CONFIG_DM_SPI_FLASH is defined. > > > > Signed-off-by: Oskari Lemmela <osk...@lemmela.net> > > --- > > include/configs/sunxi-common.h | 16 ++++++++++++++++ > > 1 file changed, 16 insertions(+) > > > > diff --git a/include/configs/sunxi-common.h > > b/include/configs/sunxi-common.h index 9819d9980c..b2443ef678 100644 > > --- a/include/configs/sunxi-common.h > > +++ b/include/configs/sunxi-common.h > > @@ -401,6 +401,21 @@ extern int soft_i2c_gpio_scl; > > #define BOOT_TARGET_DEVICES_USB(func) > > #endif > > > > +#ifdef CONFIG_DM_SPI_FLASH > > +#define BOOT_TARGET_DEVICES_SPI(func) func(SPI, spi, 0) > > +#define BOOTENV_DEV_SPI(devtypeu, devtypel, instance) \ > > This belongs more in include/config_distro_bootcmd.h, there's nothing > really sunxi specific here. > > > + "image_addr=0x100000\0" \ > > + "image_size=0x700000\0" \ > > image_addr and image_size usually come from Kconfig, instead of being > hardcoded Actually this whole approach looks very specific to me, if I understand this correctly, it loads 7 MB from 1MB of the SPI flash and treats this as a kernel? This looks very arbitrary to me, requires at least 8MB of SPI flash (many boards come with just 2MB) and will never hold any normal arm64 kernel (which are in the range of 16MB, typically). So this might fit some specific embedded project, but doesn't look like something we want in the default environment. If there is a use case for it, people can always either set up their specific environment (and store it in FAT), or change the default environment just for their build. Cheers, Andre. > > > + "bootcmd_" #devtypel #instance "=" \ > > + "if sf probe " #instance "; then " \ > > + "sf read ${ramdisk_addr_r} ${image_addr} > > ${image_size}; " \ > > s/ramdisk_addr_r/kernel_addr_r/ > > Thanks! > Maxime > _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot