All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 00/18] SPL: extend FIT loading support
@ 2017-03-28  0:45 Andre Przywara
  2017-03-28  0:45 ` [U-Boot] [PATCH v2 01/18] SPL: FIT: refactor FDT loading Andre Przywara
                   ` (18 more replies)
  0 siblings, 19 replies; 27+ messages in thread
From: Andre Przywara @ 2017-03-28  0:45 UTC (permalink / raw)
  To: u-boot

A fixed version of the SPL FIT loading series.
The error handling has been improved, also quite some comments and
documentation has been added.
The README.pine64 file has been totally reworked to reflect the new
way of building the firmware for the Pine64 (and other 64-bit Allwinner
SoCs, really).
Some minor bugs have been fixed and Reviewed-by: tags have been added.

The first five patches introduce the core of the extened SPL FIT loading
support, see below for a description.
Patches 6-9 make some room in the sunxi 64-bit SPL to allow
compiling in the FIT loading bits. Patch 10 and 11 let the SPL choose
the proper DT from the FIT image.
The next two patches add the infrastructure and an actual generator script,
so the FIT image is automatically created at build time.
Patches 14 and 15 enable the SPL FIT support in the Pine64 and the
OrangePi PC 2 defconfigs.
The following two patches store a DT file name in the SPL header, so
U-Boot can easily pick the proper DT when scanning the FIT image.
The idea is that this DT name should stay with the board, ideally on
eMMC or SPI flash. So both U-Boot and a firmware update tool could
identify a board, updating with compatible firmware while keeping the
DT name in place. Ideally a board vendor would once seed this name
onto on-board storage like SPI flash.
I kept those two patches in, as the work on replacing mksunxiboot with
an mkimage extension is not ready yet. Feel free to drop those from
the series if this is a problem.
The final patch updates the Pine64 README file to document the current
way of building U-Boot, which now includes the ARM Trusted Firmware build
in its image.

I would be delighted if that series can make it into the next release,
as this finally enables the fully open source firmware for the 64-bit
Allwinner SoCs (including the ATF binary).

This series is based on sunxi/master, rebased upon origin/master.

Cheers,
Andre.

-------
Currently the FIT format is not used to its full potential in the SPL:
It only loads the first image from the /images node and appends the
proper FDT.
Some boards and platforms would benefit from loading more images before
starting U-Boot proper, notably Allwinner A64 and ARMv8 Rockchip boards,
which use an ARM Trusted Firmware (ATF) image to be executed before U-Boot.

This series tries to solve this in a board agnostic and generic way:
We extend the SPL FIT loading scheme to allow loading multiple images.
So apart from loading the image which is referenced by the "firmware"
property in the respective configuration node and placing the DTB right
behind it, we iterate over all strings in the "loadable" property.
Each image referenced there will be loaded to its specified load address.
The entry point U-Boot eventually branches to will be taken from the
first image to explicitly provide the "entry" property, or, if none
of them does so, from the load address of the "firmware" image.
This keeps the scheme compatible with the FIT images our Makefile creates
automatically at the moment.
Apart from the already mentioned ATF scenario this opens up more usage
scenarios, of which the commit message of patch 04/11 lists some.
The remaining patches prepare ane finally enable this scheme for the 64-bit
Allwinner boards.

Andre Przywara (17):
  SPL: FIT: refactor FDT loading
  SPL: FIT: rework U-Boot image loading
  SPL: FIT: improve error handling
  SPL: FIT: factor out spl_load_fit_image()
  SPL: FIT: allow loading multiple images
  tools: mksunxiboot: allow larger SPL binaries
  armv8: SPL: only compile GIC code if needed
  armv8: fsl: move ccn504 code into FSL Makefile
  sunxi: A64: move SPL stack to end of SRAM A2
  sunxi: SPL: store RAM size in gd
  sunxi: SPL: add FIT config selector for Pine64 boards
  Makefile: add rules to generate SPL FIT images
  sunxi: A64: Pine64: introduce FIT generator script
  sunxi: Pine64: defconfig: enable SPL FIT support
  sunxi: OrangePi-PC2: defconfig: enable SPL FIT support
  sunxi: use SPL header DT name for FIT board matching
  sunxi: update Pine64 README

Siarhei Siamashka (1):
  sunxi: Store the device tree name in the SPL header

 Kconfig                               |  17 ++
 Makefile                              |  20 +++
 arch/arm/include/asm/arch-sunxi/spl.h |  19 ++-
 arch/arm/lib/Makefile                 |   4 +-
 board/sunxi/README.pine64             | 177 +++++++++++++-------
 board/sunxi/board.c                   |  36 +++-
 board/sunxi/mksunxi_fit_atf.sh        |  73 +++++++++
 common/spl/spl_fit.c                  | 298 ++++++++++++++++++++++------------
 configs/orangepi_pc2_defconfig        |   6 +
 configs/pine64_plus_defconfig         |   6 +
 doc/uImage.FIT/howto.txt              |  21 +++
 include/configs/sunxi-common.h        |  17 +-
 scripts/Makefile.spl                  |   3 +-
 tools/mksunxiboot.c                   |  51 +++++-
 14 files changed, 563 insertions(+), 185 deletions(-)
 create mode 100755 board/sunxi/mksunxi_fit_atf.sh

-- 
2.8.2

^ permalink raw reply	[flat|nested] 27+ messages in thread
* [U-Boot] [PATCH v2 14/18] sunxi: Pine64: defconfig: enable SPL FIT support
@ 2017-03-29  7:01 Icenowy Zheng
  0 siblings, 0 replies; 27+ messages in thread
From: Icenowy Zheng @ 2017-03-29  7:01 UTC (permalink / raw)
  To: u-boot


2017年3月29日 14:57于 Maxime Ripard <maxime.ripard@free-electrons.com>写道:
>
> On Tue, Mar 28, 2017 at 01:45:22AM +0100, Andre Przywara wrote: 
> > The Pine64 (and all other 64-bit Allwinner boards) need to load an 
> > ARM Trusted Firmware image beside the actual U-Boot proper. 
> > This can now be easily achieved by using the just extended SPL FIT 
> > loading support, so enable it in the Pine64 defconfig. 
> > Also add the FIT image as a build target to 64-bit sunxi board to 
> > trigger the respective Makefile rules. 
> > 
> > Signed-off-by: Andre Przywara <andre.przywara@arm.com> 
> > --- 
> >  configs/pine64_plus_defconfig  | 6 ++++++ 
> >  include/configs/sunxi-common.h | 4 ++++ 
> >  2 files changed, 10 insertions(+) 
> > 
> > diff --git a/configs/pine64_plus_defconfig b/configs/pine64_plus_defconfig 
> > index 92bda60..8a90579 100644 
> > --- a/configs/pine64_plus_defconfig 
> > +++ b/configs/pine64_plus_defconfig 
> > @@ -3,9 +3,14 @@ CONFIG_ARCH_SUNXI=y 
> >  CONFIG_MACH_SUN50I=y 
> >  CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y 
> >  CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus" 
> > +CONFIG_OF_LIST="sun50i-a64-pine64 sun50i-a64-pine64-plus" 
> >  # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set 
> >  CONFIG_CONSOLE_MUX=y 
> >  CONFIG_SPL=y 
> > +CONFIG_FIT=y 
> > +CONFIG_SPL_FIT=y 
> > +CONFIG_SPL_LOAD_FIT=y 
> > +CONFIG_SPL_OF_LIBFDT=y 
>
> Again, this doesn't make any sense to enable it in *all* our 
> defconfigs. If this is something that should be enabled by default for 
> the A64 support, then do so in Kconfig directly. 

Here it's "strongly recommended" to use SPL FIT support, but not "must", as
someone may use U-Boot to execute their own code that wants EL3. In that
situation SPL FIT support shouldn't be present. U-Boot is not Linux Loader, so
we should give people the permission to disable it; however, U-Boot is mostly
used to load and execute Linux, so this should be defaultly enabled -- is this
correctly the meaning of defconfig?

>
> Maxime 
>
> -- 
> Maxime Ripard, Free Electrons 
> Embedded Linux and Kernel engineering 
> http://free-electrons.com 

^ permalink raw reply	[flat|nested] 27+ messages in thread
* [U-Boot] [PATCH v2 14/18] sunxi: Pine64: defconfig: enable SPL FIT support
@ 2017-03-29 11:19 Icenowy Zheng
  0 siblings, 0 replies; 27+ messages in thread
From: Icenowy Zheng @ 2017-03-29 11:19 UTC (permalink / raw)
  To: u-boot


2017年3月29日 19:17于 Andre Przywara <andre.przywara@arm.com>写道:
>
> Hi, 
>
> On 29/03/17 07:57, Maxime Ripard wrote: 
> > On Tue, Mar 28, 2017 at 01:45:22AM +0100, Andre Przywara wrote: 
> >> The Pine64 (and all other 64-bit Allwinner boards) need to load an 
> >> ARM Trusted Firmware image beside the actual U-Boot proper. 
> >> This can now be easily achieved by using the just extended SPL FIT 
> >> loading support, so enable it in the Pine64 defconfig. 
> >> Also add the FIT image as a build target to 64-bit sunxi board to 
> >> trigger the respective Makefile rules. 
> >> 
> >> Signed-off-by: Andre Przywara <andre.przywara@arm.com> 
> >> --- 
> >>  configs/pine64_plus_defconfig  | 6 ++++++ 
> >>  include/configs/sunxi-common.h | 4 ++++ 
> >>  2 files changed, 10 insertions(+) 
> >> 
> >> diff --git a/configs/pine64_plus_defconfig b/configs/pine64_plus_defconfig 
> >> index 92bda60..8a90579 100644 
> >> --- a/configs/pine64_plus_defconfig 
> >> +++ b/configs/pine64_plus_defconfig 
> >> @@ -3,9 +3,14 @@ CONFIG_ARCH_SUNXI=y 
> >>  CONFIG_MACH_SUN50I=y 
> >>  CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y 
> >>  CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus" 
> >> +CONFIG_OF_LIST="sun50i-a64-pine64 sun50i-a64-pine64-plus" 
> >>  # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set 
> >>  CONFIG_CONSOLE_MUX=y 
> >>  CONFIG_SPL=y 
> >> +CONFIG_FIT=y 
> >> +CONFIG_SPL_FIT=y 
> >> +CONFIG_SPL_LOAD_FIT=y 
> >> +CONFIG_SPL_OF_LIBFDT=y 
> > 
> > Again, this doesn't make any sense to enable it in *all* our 
> > defconfigs. If this is something that should be enabled by default for 
> > the A64 support, then do so in Kconfig directly. 
>
> Oh sorry, I think I completely misunderstood you last time. 
> Indeed this makes sense, especially with more defconfigs for A64/H5 
> boards coming up. 
>
> I will think about a solution that makes Icenowy happy as well, 
> something like BOARD_NEEDS_SPL_FIT or so - though a simple "select" 
> sounds tempting ;-) 

In fact I don't need an environment without ATF. I just mentioned the possibility ;-)

>
> Cheers, 
> Andre. 

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-04-05 14:10 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28  0:45 [U-Boot] [PATCH v2 00/18] SPL: extend FIT loading support Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 01/18] SPL: FIT: refactor FDT loading Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 02/18] SPL: FIT: rework U-Boot image loading Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 03/18] SPL: FIT: improve error handling Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 04/18] SPL: FIT: factor out spl_load_fit_image() Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 05/18] SPL: FIT: allow loading multiple images Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 06/18] tools: mksunxiboot: allow larger SPL binaries Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 07/18] armv8: SPL: only compile GIC code if needed Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 08/18] armv8: fsl: move ccn504 code into FSL Makefile Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 09/18] sunxi: A64: move SPL stack to end of SRAM A2 Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 10/18] sunxi: SPL: store RAM size in gd Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 11/18] sunxi: SPL: add FIT config selector for Pine64 boards Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 12/18] Makefile: add rules to generate SPL FIT images Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 13/18] sunxi: A64: Pine64: introduce FIT generator script Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 14/18] sunxi: Pine64: defconfig: enable SPL FIT support Andre Przywara
2017-03-29  6:57   ` Maxime Ripard
2017-03-29 11:17     ` Andre Przywara
2017-03-29 12:33       ` Maxime Ripard
2017-04-05 13:41       ` Tom Rini
2017-04-05 14:10       ` Dr. Philipp Tomsich
2017-03-28  0:45 ` [U-Boot] [PATCH v2 15/18] sunxi: OrangePi-PC2: " Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 16/18] sunxi: Store the device tree name in the SPL header Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 17/18] sunxi: use SPL header DT name for FIT board matching Andre Przywara
2017-03-28  0:45 ` [U-Boot] [PATCH v2 18/18] sunxi: update Pine64 README Andre Przywara
2017-04-01  4:23 ` [U-Boot] [PATCH v2 00/18] SPL: extend FIT loading support Simon Glass
2017-03-29  7:01 [U-Boot] [PATCH v2 14/18] sunxi: Pine64: defconfig: enable SPL FIT support Icenowy Zheng
2017-03-29 11:19 Icenowy Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.