9
0
Fork 0

arm: integrate kwbimage in the image generation

When a ARCH_MVEBU platform is selected, generate barebox.kwb and
barebox.kwbuart images from barebox.bin, using kwbimage.

barebox.kwb is generated by executing kwbimage on the board
kwbimage.cfg file, and is therefore designed to be booted from the
default boot media of the board, as defined by kwbimage.cfg (typically
a NAND flash or SPI flash).

barebox.kwbuart is generated by executing kwbimage on the board
kwbimage.cfg file, but by overriding the boot media to be UART. This
image is suitable for usage with the kwbtool and is generally useful
for recovery purposes.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Squashed this fixup:

arm: ensure the build doesn't fail when kwbimage lacks the binary blob

mach-mvebu images for Armada 370 and Armada XP SoC require a DDR3
training code which should be extracted from existing bootable images
for the relevant board. When such binary blob has not been extracted,
the build of the .kwb and .kwbuart images will fail. This is annoying
as it makes the build of all Armada 370/XP defconfig fail, which can
be a problem for automated builds.

This proposal makes the failure of kwbimage not a fatal failure for
the build process, and shows a warning. The user therefore sees:

====================================================================
  KWB     barebox.kwb
Didn't find the file 'plathome-openblocks-ax3-binary.0' in '/home/thomas/projets/barebox' which is mandatory to generate the image
This file generally contains the DDR3 training code, and should be extracted from an existing bootable
image for your board. See 'kwbimage -x' to extract it from an existing image.
Could not create image
WARNING: Couldn't create KWB image due to previous errors.
  KWBUART barebox.kwbuart
Didn't find the file 'plathome-openblocks-ax3-binary.0' in '/home/thomas/projets/barebox' which is mandatory to generate the image
This file generally contains the DDR3 training code, and should be extracted from an existing bootable
image for your board. See 'kwbimage -x' to extract it from an existing image.
Could not create image
WARNING Couldn't create KWB image due to previous errors.
====================================================================

The only drawback is that barebox-flash-image, which normally points
to barebox.kwb, becomes a stale symbolic link.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Thomas Petazzoni 2013-05-09 11:52:48 +02:00 committed by Sascha Hauer
parent b3522a5b80
commit 6bb3a08cd3
2 changed files with 23 additions and 1 deletions

View File

@ -970,7 +970,7 @@ CLEAN_FILES += barebox System.map include/generated/barebox_default_env.h \
.tmp_kallsyms* common/barebox_default_env* barebox.ldr \
scripts/bareboxenv-target barebox-flash-image \
Doxyfile.version barebox.srec barebox.s5p barebox.ubl \
barebox.uimage barebox.spi
barebox.uimage barebox.spi barebox.kwb barebox.kwbuart
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config include2 usr/include

View File

@ -263,6 +263,28 @@ KBUILD_TARGET := barebox.zynq
KBUILD_IMAGE := barebox.zynq
endif
KWBIMAGE_OPTS = \
-c -i $(srctree)/$(BOARD)/kwbimage.cfg -d $(TEXT_BASE) -e $(TEXT_BASE)
quiet_cmd_kwbimage = KWB $@
cmd_kwbimage = scripts/kwbimage -p $< $(KWBIMAGE_OPTS) -o $@ || \
echo "WARNING: Couldn't create KWB image due to previous errors."
quiet_cmd_kwbimage_uart = KWBUART $@
cmd_kwbimage_uart = scripts/kwbimage -m uart -p $< $(KWBIMAGE_OPTS) -o $@ || \
echo "WARNING Couldn't create KWB image due to previous errors."
barebox.kwb: $(KBUILD_BINARY) FORCE
$(call if_changed,kwbimage)
barebox.kwbuart: $(KBUILD_BINARY) FORCE
$(call if_changed,kwbimage_uart)
ifeq ($(CONFIG_ARCH_MVEBU),y)
KBUILD_TARGET := barebox.kwb barebox.kwbuart
KBUILD_IMAGE := barebox.kwb barebox.kwbuart
endif
pbl := arch/arm/pbl
zbarebox.S zbarebox.bin zbarebox: barebox.bin
$(Q)$(MAKE) $(build)=$(pbl) $(pbl)/$@