[PATCH 1/1] Zynq: add support to chainload another barebox

Michael Graichen michael.graichen at hotmail.com
Mon May 3 11:07:30 BST 2021


Since OCRAM is only 192K this introduces CONFIG_ZYNQ_BUILD_FSBL so we can can chainload a more feature rich barebox via bootm.

>From 1f1a95eca42198d73c38cc12b9b44f061980cef8 Mon Sep 17 00:00:00 2001
From: Michael Graichen <michael.graichen at hotmail.com>
Date: Mon, 3 May 2021 12:03:05 +0200
Subject: [PATCH] zynq: add support to chainload another barebox

Signed-off-by: Michael Graichen <michael.graichen at hotmail.com>
---
 arch/arm/mach-zynq/Kconfig |  6 +++++-
 images/Makefile.zynq       | 21 +++++++++++++++------
 2 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index 3e07633e5..0800b55e6 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -21,7 +21,11 @@ config ARCH_ZYNQ7000
 	select OFDEVICE
 	select RELOCATABLE

-
+config ZYNQ_BUILD_FSBL
+	prompt "build FSBL binary (BOOT.BIN)"
+	bool
+	help
+	  Say Y here if you want to build an FSBL binary for the Zynq.

 menu "select Zynq boards to be built"

diff --git a/images/Makefile.zynq b/images/Makefile.zynq
index b00e74869..39c72bd88 100644
--- a/images/Makefile.zynq
+++ b/images/Makefile.zynq
@@ -7,17 +7,26 @@ zynqcfg_cpp_flags  = -Wp,-MD,$(depfile) -nostdinc -x assembler-with-cpp \

 zynqcfg-tmp = $(subst $(comma),_,$(dot-target).zynqcfg.tmp)

-quiet_cmd_zynq_image = ZYNQIMG  $@
+quiet_cmd_zynq_image = ZYNQIMG $@
       cmd_zynq_image = \
          $(CPP) $(zynqcfg_cpp_flags) -o $(zynqcfg-tmp) $(CFG_$(@F)) ; \
          $(objtree)/scripts/zynq_mkimage -c $(zynqcfg-tmp) \
-           -f $(subst .zynqimg,,$@) -o $@
+           -f $(subst .zynqimg_fsbl,,$@) -o $@

-$(obj)/%.zynqimg: $(obj)/% FORCE
+$(obj)/%.zynqimg_fsbl: $(obj)/% FORCE
 	$(call if_changed,zynq_image)

 #------------------------------------------------------------------------------

-CFG_start_avnet_zedboard.pblb.zynqimg = $(board)/avnet-zedboard/zedboard.zynqcfg
-FILE_barebox-avnet-zedboard.img = start_avnet_zedboard.pblb.zynqimg
-image-$(CONFIG_MACH_ZEDBOARD) += barebox-avnet-zedboard.img
+FILE_barebox-avnet-zedboard.img = start_avnet_zedboard.pblb
+zynq-barebox-$(CONFIG_MACH_ZEDBOARD) += barebox-avnet-zedboard.img
+
+CFG_start_avnet_zedboard.pblb.zynqimg_fsbl = $(board)/avnet-zedboard/zedboard.zynqcfg
+FILE_barebox-avnet-zedboard-fsbl.img = start_avnet_zedboard.pblb.zynqimg_fsbl
+zynq-fsbl-$(CONFIG_MACH_ZEDBOARD) += barebox-avnet-zedboard-fsbl.img
+
+ifdef CONFIG_ZYNQ_BUILD_FSBL
+image-y += $(zynq-fsbl-y)
+else
+image-y += $(zynq-barebox-y)
+endif
--
2.25.1



More information about the barebox mailing list