[U-Boot] [PATCH 3/6] SPL: Add XIP booting support

Vikas MANOCHA vikas.manocha at st.com
Mon May 22 16:55:06 UTC 2017


Hi Alex,

> -----Original Message-----
> From: Alexandru Gagniuc [mailto:alex.g at adaptrum.com]
> Sent: Thursday, May 18, 2017 12:51 PM
> To: Vikas MANOCHA <vikas.manocha at st.com>; u-boot at lists.denx.de
> Cc: Patrick DELAUNAY <patrick.delaunay at st.com>; Patrice CHOTARD <patrice.chotard at st.com>; Christophe KERELLO
> <christophe.kerello at st.com>; Christophe PRIOUZEAU <christophe.priouzeau at st.com>; Alexandre TORGUE
> <alexandre.torgue at st.com>; Albert Aribaud <albert.u.boot at aribaud.net>; Andrew F. Davis <afd at ti.com>; Bin Meng
> <bmeng.cn at gmail.com>; B, Ravi <ravibabu at ti.com>; Heiko Schocher <hs at denx.de>; Ladislav Michl <ladis at linux-mips.org>;
> Masahiro Yamada <yamada.masahiro at socionext.com>; Michal Simek <michal.simek at xilinx.com>; Simon Glass
> <sjg at chromium.org>; Stefan Agner <stefan.agner at toradex.com>
> Subject: Re: [PATCH 3/6] SPL: Add XIP booting support
> 
> On 05/18/2017 11:49 AM, Vikas Manocha wrote:
> > Enable support for XIP (execute in place) of U-Boot or kernel image.
> > There is no need to copy image from flash to ram if flash supports execute in place.
> 
> Awesome. I've had to hack u-boot before to achieve exactly this. It's nice to have a proper implementation.
> 
> 
> [snip]
> 
> > diff --git a/board/st/stm32f746-disco/stm32f746-disco.c b/board/st/stm32f746-disco/stm32f746-disco.c
> > index 4f2b677..e330b1f 100644
> > --- a/board/st/stm32f746-disco/stm32f746-disco.c
> > +++ b/board/st/stm32f746-disco/stm32f746-disco.c
> > @@ -91,6 +91,7 @@ int board_early_init_f(void)
> >  #endif
> >
> >  #ifdef CONFIG_SPL_BUILD
> > +
> Unrelated change.

Oops! I will remove this blank line & so the file from this patch in v2.

> 
> [snip]
> 
> > diff --git a/common/spl/spl_xip.c b/common/spl/spl_xip.c
> > new file mode 100644
> > index 0000000..50e2f34
> > --- /dev/null
> > +++ b/common/spl/spl_xip.c
> > @@ -0,0 +1,31 @@
> > +/*
> > + * Copyright (C) 2017 Vikas Manocha <vikas.manocha at st.com>
> > + *
> > + * SPDX-License-Identifier:	GPL-2.0+
> > + */
> > +
> > +#include <common.h>
> > +#include <spl.h>
> > +
> > +static int spl_xip(struct spl_image_info *spl_image,
> > +		   struct spl_boot_device *bootdev)
> > +{
> > +#ifdef CONFIG_SPL_OS_BOOT
> > +	if (!spl_start_uboot()) {
> > +		spl_image->arg = (void *)CONFIG_SYS_FDT_BASE;
> > +		spl_image->name = "Linux";
> > +		spl_image->os = IH_OS_LINUX;
> > +		spl_image->load_addr = CONFIG_SYS_LOAD_ADDR;
> > +		spl_image->entry_point = CONFIG_SYS_LOAD_ADDR;
> > +#ifdef CONFIG_CPU_V7M
> 
> This looks like it should be handled by spl_set_header_raw_uboot(). I
> don't see other SPL loaders do this.

We might not want to boot kernel if header is not present in every situation. With spl_xip config option, we enable if we need it.

Cheers,
Vikas

> 
> > +		spl_image->entry_point |= 0x1;
> > +#endif
> > +		debug("spl: payload xipImage, load addr: 0x%lx\n",
> > +		      spl_image->load_addr);
> > +		return 0;
> > +	}
> > +#endif
> > +	return(spl_parse_image_header(spl_image, (const struct image_header *)
> > +	       CONFIG_SYS_UBOOT_BASE));
> > +}
> > +SPL_LOAD_IMAGE_METHOD("XIP", 0, BOOT_DEVICE_XIP, spl_xip);
> >
> 
> Alex


More information about the U-Boot mailing list