9
0
Fork 0

ARM: MXS: Add multiimage support

The Freescale MXS SoCs have a multi staged boot process which needs
different images composed out of different binaries. The ROM executes
a so called bootstream which contains multiple executables. The first
one is executed in SRAM and the purpose of this binary is to setup
the internal PMIC and the SDRAM. The second image is usually the
bootloader itself. In case of barebox the bootstream is composed
out of the self extracting barebox image (pblx) and the prepare
stage for setting up the SDRAM.

The bootstream image itself is useful for USB boot, but for booting from
SD cards or NAND a BCB header has to be prepended to the image. In case
of SD boot the image has the .mxssd file extension in barebox.

Since the bootstream images are encrypted they are not suitable for
2nd stage execution. For this purpose the 2nd stage images are generated.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-12-05 09:29:28 +01:00
parent 30aad4a4ce
commit ba4ace8110
5 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,6 @@
SECTION 0x0 BOOTABLE
TAG LAST
LOAD 0x1000 @PREP@
CALL 0x1000 0x0
LOAD 0x40002000 @BOOTLOADER@
CALL 0x40002000 0x0

View File

@ -0,0 +1,8 @@
SECTION 0x0 BOOTABLE
TAG LAST
LOAD 0x1000 @PREP@
LOAD IVT 0x8000 0x1000
CALL HAB 0x8000 0x0
LOAD 0x40002000 @BOOTLOADER@
LOAD IVT 0x8000 0x40002000
CALL HAB 0x8000 0x0

2
images/.gitignore vendored
View File

@ -16,6 +16,8 @@
*.t124img.cfg
*.mlo
*.mlospi
*.mxsbs
*.mxssd
pbl.lds
barebox.x
barebox.z

View File

@ -103,6 +103,7 @@ include $(srctree)/images/Makefile.mvebu
include $(srctree)/images/Makefile.rockchip
include $(srctree)/images/Makefile.socfpga
include $(srctree)/images/Makefile.tegra
include $(srctree)/images/Makefile.mxs
targets += $(image-y) pbl.lds barebox.x barebox.z
targets += $(patsubst %,%.pblx,$(pblx-y))
@ -119,5 +120,5 @@ images: $(addprefix $(obj)/, $(image-y)) FORCE
clean-files := *.pbl *.pblb *.pblx *.map start_*.imximg *.img barebox.z start_*.kwbimg \
start_*.kwbuartimg *.socfpgaimg *.mlo *.t20img *.t20img.cfg *.t30img \
*.t30img.cfg *.t124img *.t124img.cfg *.mlospi *.mlo
*.t30img.cfg *.t124img *.t124img.cfg *.mlospi *.mlo *.mxsbs *.mxssd
clean-files += pbl.lds

23
images/Makefile.mxs Normal file
View File

@ -0,0 +1,23 @@
#
# barebox image generation Makefile for MXS images
#
# %.mxsbs - convert into MXS BootStream image
# ----------------------------------------------------------------
quiet_cmd_mxs_bootstream = MXS-BOOTSTREAM $@
cmd_mxs_bootstream = $(objtree)/scripts/mxsimage -c $(CFG_$(@F)) -b $< -o $@ -p $(word 2,$^)
$(obj)/%.mxsbs: $(obj)/%.pblx $(obj)/prep_%.pblb FORCE
$(call if_changed,mxs_bootstream)
# %.mxssd - convert into MXS SD card image
# ----------------------------------------------------------------
quiet_cmd_mxs_sd = MXS-SD $@
cmd_mxs_sd = $(objtree)/scripts/mxsboot sd $< $@
$(obj)/%.mxssd: $(obj)/%
$(call if_changed,mxs_sd)
board = $(srctree)/arch/$(ARCH)/boards
mxs23cfg = $(srctree)/arch/arm/mach-mxs/mxs23img.cfg
mxs28cfg = $(srctree)/arch/arm/mach-mxs/mxs28img.cfg