Add Xilinx ZynqMP and ZCU106 board support
v3 cover Add Xilinx ZynqMP and ZCU106 board support
Hi,
this patchset adds basic support for the ZynqMP family of ARM64 SoC+FPGA by Xilinx and for the ZCU106 board based on it.
This v3 addresses the comments received to v2 (thanks Thomas). The main change is that the zynqmp-pmufw-binaries package does not exist
anymore: instead U-Boot downloads a single file using EXTRA_DOWNLOADS. The rest are several sparse improvements that make the whole work a lot cleaner.
The ZynqMP sets a few challenges that needed some work besides the usual defconfig + readme that is enough for more classic and simple SoCs.
First, it requires ARM Trusted Firmware in the U-Boot mkimage format, not currently implemented. Nothing really hard here, this is addressed in patch 2 (with a trivial preliminary cleanup in patch 1).
Patch 3 allows to pass an externally-supplied init file to U-Boot, which is needed to boot boards not supported in the U-Boot source code, or on the same boards but with a different configuration.
The next issue is the PMU (Platform Management Unit). It is a Microblaze core that handles power and clock gating and the like, and reprogramming it at runtime is necessary to boot any modern U-Boot and Linux. Since we can't build Microblaze code out of the ARM64 toolchain, U-Boot obtains a pre-built binary using EXTRA_DOWNLOADS. This is added in patch 4.
With all these in place, patch 5 just adds the defconfig and board files.
Luca
Luca Ceresoli (5):
arm-trusted-firmware: simplify release dir path
arm-trusted-firmware: generate atf-uboot.ub image of bl31.bin
uboot: zynqmp: allow to use custom psu_init files
uboot: zynqmp: generate SPL image with PMUFW binary
configs: add Xilinx ZCU106 board (ZynqMP SoC)
DEVELOPERS | 2 + board/zynqmp/genimage.cfg | 28 +++++ ...1-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch | 53 ++++++++++ .../0002-arm64-zynqmp-Enable-booting-to-ATF.patch | 115 +++++++++++++++++++++ board/zynqmp/post-image.sh | 13 +++ board/zynqmp/readme.txt | 52 ++++++++++ boot/arm-trusted-firmware/Config.in | 8 ++ boot/arm-trusted-firmware/arm-trusted-firmware.mk | 24 ++++- boot/uboot/Config.in | 43 ++++++++ boot/uboot/uboot.mk | 35 +++++++ configs/zynqmp_zcu106_defconfig | 31 ++++++ 11 files changed, 403 insertions(+), 1 deletion(-) create mode 100644 board/zynqmp/genimage.cfg create mode 100644 board/zynqmp/patches/uboot/0001-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch create mode 100644 board/zynqmp/patches/uboot/0002-arm64-zynqmp-Enable-booting-to-ATF.patch create mode 100755 board/zynqmp/post-image.sh create mode 100644 board/zynqmp/readme.txt create mode 100644 configs/zynqmp_zcu106_defconfig
Signature · 1 line
2.7.4
PATCH v3 1/5 arm-trusted-firmware: simplify release dir path
The path to the binary images is very long. Since we are about to make a larger use of it, let's use a variable to make it somewhat shorter.
---
Changes v2 -> v3: none.
Changes v1 -> v2: none.
--- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
boot/arm-trusted-firmware/arm-trusted-firmware.mk +2 -1
@@ -25,6 +25,7 @@ endif ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)) +ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \ CROSS_COMPILE="$(TARGET_CROSS)" \
@@ -82,7 +83,7 @@ define ARM_TRUSTED_FIRMWARE_BUILD_CMDS endef define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS - cp -dpf $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release/*.bin $(BINARIES_DIR)/ + cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/ endef # Configuration check
Signature · 1 line
2.7.4
PATCH v3 1/5 arm-trusted-firmware: simplify release dir path
Hi Luca,
Quoted 25 lines · Luca Ceresoli
The path to the binary images is very long. Since we are about to make a larger use of it, let's use a variable to make it somewhat shorter.
Signed-off-by Luca Ceresoli <[email protected]>---
Changes v2 -> v3: none.
Changes v1 -> v2: none.--- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)boot/arm-trusted-firmware/arm-trusted-firmware.mk +1
-0@@ -25,6 +25,7 @@ endif ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)) +ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \ CROSS_COMPILE="$(TARGET_CROSS)" \
boot/arm-trusted-firmware/arm-trusted-firmware.mk define ARM_TRUSTED_FIRMWARE_BUILD_CMDS · line 86
Quoted 5 lines
boot/arm-trusted-firmware/arm-trusted-firmware.mk +1
-1@@ -82,7 +83,7 @@ define ARM_TRUSTED_FIRMWARE_BUILD_CMDS endef define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS - cp -dpf $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release/*.bin $(BINARIES_DIR)/ + cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/
Actually the release folder isn't always in that directory. For instance, the tegra platform requires another TARGET_SOC variable and the bin files are under build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/$(TARGET_SOC)/release/*.bin.
https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/plat/nvidia-tegra.rst
Don't get me wrong, your patch doesn't break anything, I just wanted to
inform you of that tegra case. My quick (and dirty) fix was to do a the
following:
find $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM) -name "*.bin" -exec cp -dpf {} $(BINARIES_DIR)/ \;
But if you want to have a generic ARM_TRUSTED_FIRMWARE_IMG_DIR I guess the solution is to have an optional ARM_TRUSTED_FIRMWARE_TARGET_SOC variable added to arm-trusted-firmware.mk.
Regards,
Gary
PATCH v3 1/5 arm-trusted-firmware: simplify release dir path
Hi Gary,
Quoted 40 lines · Gary Bisson
Hi Luca,
Quoted 25 lines · Luca Ceresoli
The path to the binary images is very long. Since we are about to make a larger use of it, let's use a variable to make it somewhat shorter.
Signed-off-by Luca Ceresoli <[email protected]>---
Changes v2 -> v3: none.
Changes v1 -> v2: none.--- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)boot/arm-trusted-firmware/arm-trusted-firmware.mk +1
-0@@ -25,6 +25,7 @@ endif ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)) +ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \ CROSS_COMPILE="$(TARGET_CROSS)" \boot/arm-trusted-firmware/arm-trusted-firmware.mk define ARM_TRUSTED_FIRMWARE_BUILD_CMDS · line 86
Quoted 5 lines
boot/arm-trusted-firmware/arm-trusted-firmware.mk +1
-1@@ -82,7 +83,7 @@ define ARM_TRUSTED_FIRMWARE_BUILD_CMDS endef define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS - cp -dpf $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release/*.bin $(BINARIES_DIR)/ + cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/Actually the release folder isn't always in that directory. For instance, the tegra platform requires another
TARGET_SOCvariable and the bin files are under build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/$(TARGET_SOC)/release/*.bin.
https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/plat/nvidia-tegra.rst
Quoted 4 lines
Don't get me wrong, your patch doesn't break anything, I just wanted to
inform you of that tegra case. My quick (and dirty) fix was to do a the
following:
find $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM) -name "*.bin" -exec cp -dpf {} $(BINARIES_DIR)/ \;
So if I understood correctly the current .mk file would not work for tegra, both with and without my patch.
Also your 'find' solution cannot work from ARM_TRUSTED_FIRMWARE_IMG_DIR as I defined it, because of the added '/release' dir.
Quoted 3 lines
But if you want to have a generic
ARM_TRUSTED_FIRMWARE_IMG_DIRI guess the solution is to have an optionalARM_TRUSTED_FIRMWARE_TARGET_SOCvariable added to arm-trusted-firmware.mk.
Well, using 'find' would be a simpler trick without clobbering the Config.in space. But then in patch 2 I use ARM_TRUSTED_FIRMWARE_IMG_DIR in several places, and using plain 'find' there would introduce additional problems.
Do you think there is a way to extract the TARGET_SOC value automatically, in order to avoid yet another Config.in variable in ATF? I'm afraid I'm not optimistic on this...
An alternative, under the assumption that only one *.bin file is generated, is: find that file wherever it is, and use the path to it everywhere to reference to it. Pseudocode (perhaps better done in pure make):
ARM_TRUSTED_FIRMWARE_IMG = $(dir $(shell \
find $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM) -name "*.bin" | \
head -n1))This would avoid any additional variables and give us the path of the binary. Do you think it could work?
Signature · 1 line
Luca
PATCH v3 1/5 arm-trusted-firmware: simplify release dir path
Hi Luca,
Quoted 43 lines · Luca Ceresoli
Hi Gary,
Quoted 40 lines · Gary Bisson
Hi Luca,
Quoted 25 lines · Luca Ceresoli
The path to the binary images is very long. Since we are about to make a larger use of it, let's use a variable to make it somewhat shorter.
Signed-off-by Luca Ceresoli <[email protected]>---
Changes v2 -> v3: none.
Changes v1 -> v2: none.--- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)boot/arm-trusted-firmware/arm-trusted-firmware.mk +1
-0@@ -25,6 +25,7 @@ endif ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)) +ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \ CROSS_COMPILE="$(TARGET_CROSS)" \boot/arm-trusted-firmware/arm-trusted-firmware.mk define ARM_TRUSTED_FIRMWARE_BUILD_CMDS · line 86
Quoted 5 lines
boot/arm-trusted-firmware/arm-trusted-firmware.mk +1
-1@@ -82,7 +83,7 @@ define ARM_TRUSTED_FIRMWARE_BUILD_CMDS endef define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS - cp -dpf $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release/*.bin $(BINARIES_DIR)/ + cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/Actually the release folder isn't always in that directory. For instance, the tegra platform requires another
TARGET_SOCvariable and the bin files are under build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/$(TARGET_SOC)/release/*.bin.
https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/plat/nvidia-tegra.rst
Quoted 7 lines
Quoted 4 lines
Don't get me wrong, your patch doesn't break anything, I just wanted to
inform you of that tegra case. My quick (and dirty) fix was to do a the
following:
find $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM) -name "*.bin" -exec cp -dpf {} $(BINARIES_DIR)/ \;So if I understood correctly the current .mk file would not work for tegra, both with and without my patch.
Exactly.
Quoted 2 lines
Also your 'find' solution cannot work from
ARM_TRUSTED_FIRMWARE_IMG_DIRas I defined it, because of the added '/release' dir.
Yes, that is why I bring it up here. I planned on sending that 'find' trick as a RFC although I don't expect that solution to be accepted.
Quoted 8 lines
Quoted 3 lines
But if you want to have a generic
ARM_TRUSTED_FIRMWARE_IMG_DIRI guess the solution is to have an optionalARM_TRUSTED_FIRMWARE_TARGET_SOCvariable added to arm-trusted-firmware.mk.Well, using 'find' would be a simpler trick without clobbering the Config.in space. But then in patch 2 I use
ARM_TRUSTED_FIRMWARE_IMG_DIRin several places, and using plain 'find' there would introduce additional problems.
Yes. And to be honest, there's no real Tegra support in Buildroot right now so I'm not against your series. Just wanted people to know about that case.
Quoted 3 lines
Do you think there is a way to extract the
TARGET_SOCvalue automatically, in order to avoid yet another Config.in variable in ATF? I'm afraid I'm not optimistic on this...
Me neither, I don't see a way to extract the TARGET_SOC.
Quoted 11 lines
An alternative, under the assumption that only one *.bin file is generated, is: find that file wherever it is, and use the path to it everywhere to reference to it. Pseudocode (perhaps better done in pure make):
ARM_TRUSTED_FIRMWARE_IMG = $(dir $(shell \ find $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM) -name "*.bin" | \ head -n1))This would avoid any additional variables and give us the path of the binary. Do you think it could work?
Yes I think that would work but I'm not fond of that 'find' command in the first place. In my opinion having a TARGET_SOC variable, even if empty for most platforms, is a more elegant solution.
But, I've CC'd Sergey to help in that decision process since he's the one maintaining the package.
Regards,
Gary
Thomas Petazzoni
AppliedPATCH v3 1/5 arm-trusted-firmware: simplify release dir path
In reply to Luca CeresoliHello,
Quoted 11 lines · Luca Ceresoli
The path to the binary images is very long. Since we are about to make a larger use of it, let's use a variable to make it somewhat shorter.
Signed-off-by Luca Ceresoli <[email protected]>---
Changes v2 -> v3: none.
Changes v1 -> v2: none.--- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to next, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH v3 2/5 arm-trusted-firmware: generate atf-uboot.ub image of bl31.bin
In reply to Luca CeresoliU-Boot SPL for the Xilinx ZynqMP SoCs needs ATF in this format to load it.
---
Changes v2 -> v3 (Thomas):
- Make the option not ZynqMP-specific
- Simplify the grep+sed expression to extract the entry point address
- Rather than hooks, just use directly BUILD_CMDS and INSTALL_IMAGES_CMDS
- Use $(INSTALL), not install
Changes v1 -> v2: none.
--- boot/arm-trusted-firmware/Config.in | 8 ++++++++ boot/arm-trusted-firmware/arm-trusted-firmware.mk | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+)
boot/arm-trusted-firmware/Config.in +8 -0
@@ -71,6 +71,14 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31 typically used on platforms where another bootloader (e.g U-Boot) encapsulates ATF BL31. +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT + bool "Build BL31 U-Boot image" + select BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31 + help + Generates a U-Boot image named atf-uboot.ub containing + bl31.bin. This is used for example by the Xilinx version of + U-Boot SPL to load ATF on the ZynqMP SoC. + config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 bool "Use U-Boot as BL33" depends on BR2_TARGET_UBOOT
boot/arm-trusted-firmware/arm-trusted-firmware.mk +21 -0
@@ -75,15 +75,36 @@ ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31),y) ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += bl31 endif +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT),y) +define ARM_TRUSTED_FIRMWARE_BL31_UBOOT_BUILD +# Get the entry point address from the elf. + BASE_ADDR=$$($(TARGET_READELF) -h $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf | \ + sed -r '/^ Entry point address:\s*(.*)/!d; s//\1/') && \ + $(HOST_DIR)/bin/mkimage \ + -A arm64 -O arm-trusted-firmware -C none \ + -a $${BASE_ADDR} -e $${BASE_ADDR} \ + -d $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31.bin \ + $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub +endef +define ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL + $(INSTALL) -m 0644 $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub \ + $(BINARIES_DIR)/atf-uboot.ub +endef +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += RESET_TO_BL31=1 +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-uboot-tools +endif + define ARM_TRUSTED_FIRMWARE_BUILD_CMDS $(ARM_TRUSTED_FIRMWARE_BUILD_FIPTOOL) $(TARGET_CONFIGURE_OPTS) \ $(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \ $(ARM_TRUSTED_FIRMWARE_MAKE_TARGETS) + $(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_BUILD) endef define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/ + $(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL) endef # Configuration check
Signature · 1 line
2.7.4
Thomas Petazzoni
AppliedPATCH v3 2/5 arm-trusted-firmware: generate atf-uboot.ub image of bl31.bin
Hello,
Quoted 11 lines · Luca Ceresoli
U-Boot SPL for the Xilinx ZynqMP SoCs needs ATF in this format to load it.
Signed-off-by Luca Ceresoli <[email protected]>---
Changes v2 -> v3 (Thomas):
- Make the option not ZynqMP-specific
- Simplify the grep+sed expression to extract the entry point address
- Rather than hooks, just use directlyBUILD_CMDSandINSTALL_IMAGES_CMDS
- Use $(INSTALL), not install
Applied to next, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH v3 3/5 uboot: zynqmp: allow to use custom psu_init files
In reply to Luca CeresoliU-Boot SPL configures pinmuxes, clocks and other low-level devices. On the Xilinx ZynqMP SoCs the code to do this resides in a file called psu_init_gpl.c which is initially generated by the Xilinx development tools. Add an option to pass these files from the outside (e.g. in the board files).
---
Changes v2 -> v3:
- Add a bool option to show/hidw all ZynqMP-specific config knobs
- Move this patch before "uboot: zynqmp: generate SPL image with PMUFW binary"
- Reword Config.in text
Changes v1 -> v2:
- split from a larger patch doing 2 things
- document the option of having psu_init_gpl.c without .h
--- boot/uboot/Config.in | 30 ++++++++++++++++++++++++++++++ boot/uboot/uboot.mk | 16 ++++++++++++++++ 2 files changed, 46 insertions(+)
boot/uboot/Config.in +30 -0
@@ -365,6 +365,36 @@ config BR2_TARGET_UBOOT_ZYNQ_IMAGE for u-boot-dtb.img file so this U-Boot format is required to be set. +config BR2_TARGET_UBOOT_ZYNQMP + bool "Boot on the Xilinx ZynqMP SoCs" + depends on BR2_aarch64 + help + Enable options specific to the Xilinx ZynqMP family of SoCs. + +if BR2_TARGET_UBOOT_ZYNQMP + +config BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR + string "Custom psu_init_gpl files" + help + On ZynqMP the booloader is responsible for some basic + initializations, such as enabling peripherals and + configuring pinmuxes. The psu_init_gpl.c file (and, + optionally, psu_init_gpl.h) contains the code for such + initializations. + + Although U-Boot contains psu_init_gpl.c files for some + boards, each of them describes only one specific + configuration. Users of a different board, or needing a + different configuration, can generate custom files using the + Xilinx development tools. + + Set this variable to the path where the psu_init_gpl.c file + (and psu_init_gpl.h if needed) is located. U-Boot will build + and link the user-provided file instead of the built-in + one. Leave empty to use the files provided by U-Boot. + +endif + config BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC bool "CRC image for Altera SoC FPGA (mkpimage)" depends on BR2_arm
boot/uboot/uboot.mk +16 -0
@@ -274,6 +274,22 @@ define UBOOT_INSTALL_IMAGES_CMDS $(BINARIES_DIR)/boot.scr) endef +ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y) + +ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR)),) +define UBOOT_ZYNQMP_COPY_PSU_INIT +# In U-Boot's board/xilinx/zynqmp/Makefile the bundled psu_init_gpl.c +# has precedence over ours if placed in a subdir whose name matches +# CONFIG_DEFAULT_DEVICE_TREE. Delete them all to be sure we use ours. + rm -f $(@D)/board/xilinx/zynqmp/*/psu_init*.[ch] + cp $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR))/psu_init_gpl.[ch] \ + $(@D)/board/xilinx/zynqmp/ +endef +UBOOT_PRE_CONFIGURE_HOOKS += UBOOT_ZYNQMP_COPY_PSU_INIT +endif # BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR + +endif # BR2_TARGET_UBOOT_ZYNQMP + define UBOOT_INSTALL_OMAP_IFT_IMAGE cp -dpf $(@D)/$(UBOOT_BIN_IFT) $(BINARIES_DIR)/ endef
Signature · 1 line
2.7.4
PATCH v3 3/5 uboot: zynqmp: allow to use custom psu_init files
Hello,
boot/uboot/uboot.mk define UBOOT_INSTALL_IMAGES_CMDS · line 279
Quoted 3 lines · Luca Ceresoli
boot/uboot/uboot.mk +3
-0+ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y) + +ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR)),)
It'd be nice to have an intermediate UBOOT_ZYNQMP_PSU_INIT_DIR variable instead of calculating its qstripped value twice.
boot/uboot/uboot.mk define UBOOT_INSTALL_IMAGES_CMDS · line 286
Quoted 7 lines
boot/uboot/uboot.mk +7
-0+define UBOOT_ZYNQMP_COPY_PSU_INIT +# In U-Boot's board/xilinx/zynqmp/Makefile the bundled psu_init_gpl.c +# has precedence over ours if placed in a subdir whose name matches +# CONFIG_DEFAULT_DEVICE_TREE. Delete them all to be sure we use ours. + rm -f $(@D)/board/xilinx/zynqmp/*/psu_init*.[ch] + cp $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR))/psu_init_gpl.[ch] \ + $(@D)/board/xilinx/zynqmp/
However, the bigger question is why do we need this in the first place ? This is in fact just patching the U-Boot source code. Why not use a patch instead ? Aren't people in general anyway going to have their own custom U-Boot Git tree, in which they will version control their psu_init files ?
Since this really looks like a specialized patching step, I'm not sure it really makes sense to add this. Unless you can convince me otherwise :-)
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH v3 3/5 uboot: zynqmp: allow to use custom psu_init files
Hi Thomas,
Quoted 11 lines · Thomas Petazzoni
Hello,
boot/uboot/uboot.mk define UBOOT_INSTALL_IMAGES_CMDS · line 279
Quoted 3 lines · Luca Ceresoli
boot/uboot/uboot.mk +3
-0+ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y) + +ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR)),)It'd be nice to have an intermediate
UBOOT_ZYNQMP_PSU_INIT_DIRvariable instead of calculating its qstripped value twice.
Quoted 13 lines
boot/uboot/uboot.mk define UBOOT_INSTALL_IMAGES_CMDS · line 286
Quoted 7 lines
boot/uboot/uboot.mk +7
-0+define UBOOT_ZYNQMP_COPY_PSU_INIT +# In U-Boot's board/xilinx/zynqmp/Makefile the bundled psu_init_gpl.c +# has precedence over ours if placed in a subdir whose name matches +# CONFIG_DEFAULT_DEVICE_TREE. Delete them all to be sure we use ours. + rm -f $(@D)/board/xilinx/zynqmp/*/psu_init*.[ch] + cp $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR))/psu_init_gpl.[ch] \ + $(@D)/board/xilinx/zynqmp/However, the bigger question is why do we need this in the first place ? This is in fact just patching the U-Boot source code. Why not use a patch instead ? Aren't people in general anyway going to have their own custom U-Boot Git tree, in which they will version control their
psu_initfiles ?
Of course course having a custom U-Boot tree with these files versioned is a valid workflow, which does not need the present patch. But there are other valid use cases.
Quoted 3 lines
Since this really looks like a specialized patching step, I'm not sure it really makes sense to add this. Unless you can convince me otherwise :-)
The psu_init files are special because they contain automatically-generated code to configure the SoC peripherals: enable devices, set pinmuxes etc, which is not otherwise done at runtime. Have a look at a few examples: [0] [1].
This file will change whenever the hardware *or* the configuration changes (e.g. to enable peripherals).
It is perfectly fine if one wants to use a mainline U-Boot release or a Xilinx release, unmodified, that works fine... *except* for the psu_init file. With your proposed workflow all users will be forced to use a custom git tree, just because they have a slightly different psu_init file. With my patch these users can just use a "standard" U-Boot (downloaded straight from the Internet), throw a psu_init file in their Buildroot boards/ dir and change their Buildroot config to point to it.
Even though it's technically code, you can consider the psu_init somewhat like a configuration file.
Did I convince you? :-)
[0]
http://git.denx.de/?p=u-boot.git;a=blob;f=board/xilinx/zynqmp/zynqmp-zcu106-revA/psu_init_gpl.c;h=fcd6a46ad9ffa0da06c4f0a67c2397aa4128ca29;hb=HEAD
[1]
http://git.denx.de/?p=u-boot.git;a=blob;f=board/xilinx/zynqmp/zynqmp-zcu102-revA/psu_init_gpl.c;h=5f21c4747584815ba86e50a36906b6c1fe8af1ca;hb=HEAD
Regards,
Signature · 1 line
Luca
PATCH v3 3/5 uboot: zynqmp: allow to use custom psu_init files
Quoted 3 lines · Luca Ceresoli
Hi Thomas,
On 28/05/2018 22:49, Thomas Petazzoni wrote:
[snip]
Quoted 8 lines
Quoted 3 lines
Since this really looks like a specialized patching step, I'm not sure it really makes sense to add this. Unless you can convince me otherwise :-)
The
psu_initfiles are special because they contain automatically-generated code to configure the SoC peripherals: enable devices, set pinmuxes etc, which is not otherwise done at runtime. Have a look at a few examples: [0] [1].
Regards,
Arnout
Quoted 12 lines
This file will change whenever the hardware *or* the configuration changes (e.g. to enable peripherals).
It is perfectly fine if one wants to use a mainline U-Boot release or a Xilinx release, unmodified, that works fine... *except* for the
psu_initfile. With your proposed workflow all users will be forced to use a custom git tree, just because they have a slightly differentpsu_initfile. With my patch these users can just use a "standard" U-Boot (downloaded straight from the Internet), throw apsu_initfile in their Buildroot boards/ dir and change their Buildroot config to point to it.
Quoted 2 lines
Even though it's technically code, you can consider the
psu_initsomewhat like a configuration file.
Yeah, I guess you could say it's a kind of dts but as a .c file instead of a
.dts file. Right?
Quoted 2 lines
Did I convince you? :-)
You convinced me :-)
Regards,
Arnout
Quoted 8 lines
[0]
http://git.denx.de/?p=u-boot.git;a=blob;f=board/xilinx/zynqmp/zynqmp-zcu106-revA/psu_init_gpl.c;h=fcd6a46ad9ffa0da06c4f0a67c2397aa4128ca29;hb=HEAD
[1]
http://git.denx.de/?p=u-boot.git;a=blob;f=board/xilinx/zynqmp/zynqmp-zcu102-revA/psu_init_gpl.c;h=5f21c4747584815ba86e50a36906b6c1fe8af1ca;hb=HEADRegards,
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH v3 3/5 uboot: zynqmp: allow to use custom psu_init files
Hi Arnout,
Quoted 29 lines · Arnout Vandecappelle
Quoted 3 lines · Luca Ceresoli
Hi Thomas,
On 28/05/2018 22:49, Thomas Petazzoni wrote:
[snip]
Quoted 8 lines
Quoted 3 lines
Since this really looks like a specialized patching step, I'm not sure it really makes sense to add this. Unless you can convince me otherwise :-)
The
psu_initfiles are special because they contain automatically-generated code to configure the SoC peripherals: enable devices, set pinmuxes etc, which is not otherwise done at runtime. Have a look at a few examples: [0] [1].Regards,
ArnoutQuoted 12 lines
This file will change whenever the hardware *or* the configuration changes (e.g. to enable peripherals).
It is perfectly fine if one wants to use a mainline U-Boot release or a Xilinx release, unmodified, that works fine... *except* for the
psu_initfile. With your proposed workflow all users will be forced to use a custom git tree, just because they have a slightly differentpsu_initfile. With my patch these users can just use a "standard" U-Boot (downloaded straight from the Internet), throw apsu_initfile in their Buildroot boards/ dir and change their Buildroot config to point to it.
Quoted 5 lines
Quoted 2 lines
Even though it's technically code, you can consider the
psu_initsomewhat like a configuration file.Yeah, I guess you could say it's a kind of dts but as a .c file instead of a
.dts file. Right?
Right, in that they both contain some configuration data. But with the difference that a dtb is usually a separate file from the kernel, while the psu_init is compiled and linked in the bootloader binary. psu_init is more similar to an appended DTB.
Signature · 1 line
Luca
PATCH v3 4/5 uboot: zynqmp: generate SPL image with PMUFW binary
In reply to Luca CeresoliIn order to boot on the Xilinx ZynqMP SoCs, U-Boot SPL requires a recent PMU firmware loaded. Instruct U-Boot to add pmufw.bin to the boot.bin file together with U-Boot SPL, and the boot ROM will load both.
---
Changes v2 -> v3:
- don't use a "zynqmp-pmufw-binaries" package, just download a file
- define kconfig fixups in a variable, then define UBOOT_KCONFIG_FIXUP_CMDS unconditionally at global scope (Thomas)
- use $(INSTALL), not cp (Thomas)
- $(...) instead of ${...} to reference make variables (Thomas)
Changes v1 -> v2:
- split from a larger patch doing 2 things.
--- boot/uboot/Config.in | 13 +++++++++++++ boot/uboot/uboot.mk | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+)
boot/uboot/Config.in +13 -0
@@ -373,6 +373,19 @@ config BR2_TARGET_UBOOT_ZYNQMP if BR2_TARGET_UBOOT_ZYNQMP +config BR2_TARGET_UBOOT_ZYNQMP_PMUFW + string "PMU firmware location" + help + Location of a PMU firmware binary. + + If set to an URL or a file path, instructs the U-Boot build + process to generate a boot.bin (to be loaded by the ZynqMP + boot ROM) containing both the U-Boot SPL and the PMU + firmware in the Xilinx-specific boot format. + + If empty, the generated boot.bin will not contain a PMU + firmware. + config BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR string "Custom psu_init_gpl files" help
boot/uboot/uboot.mk +19 -0
@@ -276,6 +276,21 @@ endef ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y) +UBOOT_ZYNQMP_PMUFW = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PMUFW)) + +ifneq ($(UBOOT_ZYNQMP_PMUFW),) +UBOOT_EXTRA_DOWNLOADS += $(UBOOT_ZYNQMP_PMUFW) +BR_NO_CHECK_HASH_FOR += $(notdir $(UBOOT_ZYNQMP_PMUFW)) +define UBOOT_ZYNQMP_KCONFIG_FIXUP + $(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"board/xilinx/zynqmp/pmufw.bin",$(@D)/.config) +endef +define UBOOT_ZYNQMP_COPY_PMUFW + $(INSTALL) -D -m 0644 $(UBOOT_DL_DIR)/$(notdir $(UBOOT_ZYNQMP_PMUFW)) \ + $(@D)/board/xilinx/zynqmp/pmufw.bin +endef +UBOOT_PRE_CONFIGURE_HOOKS += UBOOT_ZYNQMP_COPY_PMUFW +endif # UBOOT_ZYNQMP_PMUFW + ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR)),) define UBOOT_ZYNQMP_COPY_PSU_INIT # In U-Boot's board/xilinx/zynqmp/Makefile the bundled psu_init_gpl.c
@@ -339,6 +354,10 @@ UBOOT_DEPENDENCIES += host-mkpimage UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_CRC_ALTERA_SOCFPGA_IMAGE endif +define UBOOT_KCONFIG_FIXUP_CMDS + $(UBOOT_ZYNQMP_KCONFIG_FIXUP) +endef + ifeq ($(BR2_TARGET_UBOOT_ENVIMAGE),y) ifeq ($(BR_BUILDING),y) ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)),)
Signature · 1 line
2.7.4
PATCH v3 4/5 uboot: zynqmp: generate SPL image with PMUFW binary
Hello,
Quoted 10 lines · Luca Ceresoli
boot/uboot/uboot.mk +2
-0@@ -276,6 +276,21 @@ endef ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y) +UBOOT_ZYNQMP_PMUFW = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PMUFW)) +
boot/uboot/uboot.mk endef · line 290
Quoted 10 lines
boot/uboot/uboot.mk +10
-0+ifneq ($(UBOOT_ZYNQMP_PMUFW),) +UBOOT_EXTRA_DOWNLOADS += $(UBOOT_ZYNQMP_PMUFW) +BR_NO_CHECK_HASH_FOR += $(notdir $(UBOOT_ZYNQMP_PMUFW)) +define UBOOT_ZYNQMP_KCONFIG_FIXUP + $(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"board/xilinx/zynqmp/pmufw.bin",$(@D)/.config) +endef +define UBOOT_ZYNQMP_COPY_PMUFW + $(INSTALL) -D -m 0644 $(UBOOT_DL_DIR)/$(notdir $(UBOOT_ZYNQMP_PMUFW)) \ + $(@D)/board/xilinx/zynqmp/pmufw.bin +endef
I'm wondering if your solution that consists in copying the PMU firmware to the U-Boot source directory and then using that location in the U-Boot configuration is better, or if we should simply make the U-Boot configuration point to the location in $(UBOOT_DL_DIR), i.e:
$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,$(UBOOT_DL_DIR)/$(notdir $(UBOOT_ZYNQMP_PMUFW)),$(@D)/.config)
I'm not saying we _must_ do this, I'm wondering if it isn't simpler.
boot/uboot/uboot.mk UBOOT_DEPENDENCIES += host-mkpimage · line 359
Quoted 3 lines
boot/uboot/uboot.mk +3
-0+define UBOOT_KCONFIG_FIXUP_CMDS + $(UBOOT_ZYNQMP_KCONFIG_FIXUP) +endef
This obviously won't work with a non-kconfig capable U-Boot version, though admittedly ZynqMP support is sufficiently new in upstream U-Boot that we're pretty much guaranteed that someone trying to build for ZynqMP will have a kconfig-capable U-Boot. But to be sure, perhaps the BR2_TARGET_UBOOT_ZYNQMP_PMUFW should have a "depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG" ?
Best regards,
Thomas Petazzoni
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH v3 4/5 uboot: zynqmp: generate SPL image with PMUFW binary
Hi Thomas,
Quoted 29 lines · Thomas Petazzoni
Hello,
Quoted 10 lines · Luca Ceresoli
boot/uboot/uboot.mk +2
-0@@ -276,6 +276,21 @@ endef ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y) +UBOOT_ZYNQMP_PMUFW = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PMUFW)) +boot/uboot/uboot.mk endef · line 290
Quoted 10 lines
boot/uboot/uboot.mk +10
-0+ifneq ($(UBOOT_ZYNQMP_PMUFW),) +UBOOT_EXTRA_DOWNLOADS += $(UBOOT_ZYNQMP_PMUFW) +BR_NO_CHECK_HASH_FOR += $(notdir $(UBOOT_ZYNQMP_PMUFW)) +define UBOOT_ZYNQMP_KCONFIG_FIXUP + $(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"board/xilinx/zynqmp/pmufw.bin",$(@D)/.config) +endef +define UBOOT_ZYNQMP_COPY_PMUFW + $(INSTALL) -D -m 0644 $(UBOOT_DL_DIR)/$(notdir $(UBOOT_ZYNQMP_PMUFW)) \ + $(@D)/board/xilinx/zynqmp/pmufw.bin +endefI'm wondering if your solution that consists in copying the PMU firmware to the U-Boot source directory and then using that location in the U-Boot configuration is better, or if we should simply make the U-Boot configuration point to the location in $(UBOOT_DL_DIR), i.e:
Quoted 3 lines
$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,$(UBOOT_DL_DIR)/$(notdir $(UBOOT_ZYNQMP_PMUFW)),$(@D)/.config)
I'm not saying we _must_ do this, I'm wondering if it isn't simpler.
This would definitely be better, but it wouldn't work because the U-Boot makefile looks for $(srctree)/$(CONFIG_BOOT_INIT_FILE), not just $(CONFIG_BOOT_INIT_FILE). So the file must be relative to $(@D)/board/xilinx/zynqmp/, i.e. $(srctree).
Of course this could be fixed in U-Boot...
Quoted 8 lines
boot/uboot/uboot.mk UBOOT_DEPENDENCIES += host-mkpimage · line 359
Quoted 3 lines
boot/uboot/uboot.mk +3
-0+define UBOOT_KCONFIG_FIXUP_CMDS + $(UBOOT_ZYNQMP_KCONFIG_FIXUP) +endefThis obviously won't work with a non-kconfig capable U-Boot version, though admittedly ZynqMP support is sufficiently new in upstream U-Boot that we're pretty much guaranteed that someone trying to build for ZynqMP will have a kconfig-capable U-Boot.
Indeed.
Quoted 3 lines
But to be sure, perhaps the
BR2_TARGET_UBOOT_ZYNQMP_PMUFWshould have a "depends onBR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG" ?
Ok, that can be done anyway, no problem.
Signature · 1 line
Luca
PATCH v3 4/5 uboot: zynqmp: generate SPL image with PMUFW binary
Hi,
Quoted 34 lines · Luca Ceresoli
Hi Thomas,
Quoted 31 lines · Thomas Petazzoni
Hello,
Quoted 10 lines · Luca Ceresoli
boot/uboot/uboot.mk +2
-0@@ -276,6 +276,21 @@ endef ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y) +UBOOT_ZYNQMP_PMUFW = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PMUFW)) +boot/uboot/uboot.mk endef · line 290
Quoted 10 lines
boot/uboot/uboot.mk +10
-0+ifneq ($(UBOOT_ZYNQMP_PMUFW),) +UBOOT_EXTRA_DOWNLOADS += $(UBOOT_ZYNQMP_PMUFW) +BR_NO_CHECK_HASH_FOR += $(notdir $(UBOOT_ZYNQMP_PMUFW)) +define UBOOT_ZYNQMP_KCONFIG_FIXUP + $(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"board/xilinx/zynqmp/pmufw.bin",$(@D)/.config) +endef +define UBOOT_ZYNQMP_COPY_PMUFW + $(INSTALL) -D -m 0644 $(UBOOT_DL_DIR)/$(notdir $(UBOOT_ZYNQMP_PMUFW)) \ + $(@D)/board/xilinx/zynqmp/pmufw.bin +endefI'm wondering if your solution that consists in copying the PMU firmware to the U-Boot source directory and then using that location in the U-Boot configuration is better, or if we should simply make the U-Boot configuration point to the location in $(UBOOT_DL_DIR), i.e:
$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,$(UBOOT_DL_DIR)/$(notdir $(UBOOT_ZYNQMP_PMUFW)),$(@D)/.config)
Quoted 8 lines
Quoted 1 line
I'm not saying we _must_ do this, I'm wondering if it isn't simpler.
This would definitely be better, but it wouldn't work because the U-Boot makefile looks for $(srctree)/$(CONFIG_BOOT_INIT_FILE), not just $(CONFIG_BOOT_INIT_FILE). So the file must be relative to $(@D)/board/xilinx/zynqmp/, i.e. $(srctree).
Of course this could be fixed in U-Boot...
...which is in progress, see the patch:
https://patchwork.ozlabs.org/patch/923351/
Signature · 1 line
Luca
PATCH v3 5/5 configs: add Xilinx ZCU106 board (ZynqMP SoC)
In reply to Luca CeresoliThis adds support the Xilinx ZCU106 development board.
---
Changes v2 -> v3:
- adapt to changed ATF option name (BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT)
- adapt to the new pmufw implementation in uboot (no zynqmp-pmufw-binaries package, just a downloadable file)
- patches now upstream, update patch files
Changes v1 -> v2:
- don't provide psu_init files: the xilinx master branch has a defconfig that works (with 2 patches)
--- DEVELOPERS | 2 + board/zynqmp/genimage.cfg | 28 +++++ ...1-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch | 53 ++++++++++ .../0002-arm64-zynqmp-Enable-booting-to-ATF.patch | 115 +++++++++++++++++++++ board/zynqmp/post-image.sh | 13 +++ board/zynqmp/readme.txt | 52 ++++++++++ configs/zynqmp_zcu106_defconfig | 31 ++++++ 7 files changed, 294 insertions(+) create mode 100644 board/zynqmp/genimage.cfg create mode 100644 board/zynqmp/patches/uboot/0001-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch create mode 100644 board/zynqmp/patches/uboot/0002-arm64-zynqmp-Enable-booting-to-ATF.patch create mode 100755 board/zynqmp/post-image.sh create mode 100644 board/zynqmp/readme.txt create mode 100644 configs/zynqmp_zcu106_defconfig
DEVELOPERS +2 -0
@@ -1100,8 +1100,10 @@ F: package/ti-sgx-um/ N: Luca Ceresoli <[email protected]> F: board/olimex/a20_olinuxino/ F: board/zynq/ +F: board/zynqmp/ F: configs/olimex_a20_olinuxino_* F: configs/zynq_zed_defconfig +F: configs/zynqmp_zcu106_defconfig F: package/agentpp/ F: package/exim/ F: package/libpjsip/
board/zynqmp/genimage.cfg new file +28 -0
@@ -0,0 +1,28 @@ +image boot.vfat { + vfat { + files = { + "boot.bin", + "u-boot.bin", + "atf-uboot.ub", + "system.dtb", + "Image" + } + } + size = 32M +} + +image sdcard.img { + hdimage { + } + + partition boot { + partition-type = 0xC + bootable = "true" + image = "boot.vfat" + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + } +}
board/zynqmp/patches/uboot/0001-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch new file +53 -0
53 lines not on this page · raw message
board/zynqmp/patches/uboot/0002-arm64-zynqmp-Enable-booting-to-ATF.patch new file +115 -0
115 lines not on this page · raw message
board/zynqmp/post-image.sh new file +13 -0
@@ -0,0 +1,13 @@ +#!/bin/sh + +# By default U-Boot loads DTB from a file named "system.dtb", so +# let's use a symlink with that name that points to the *first* +# devicetree listed in the config. + +FIRST_DT=$(sed -nr \ + -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]]*).*"$|\1|p' \ + ${BR2_CONFIG}) + +[ -z "${FIRST_DT}" ] || ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/system.dtb + +support/scripts/genimage.sh -c board/zynqmp/genimage.cfg
board/zynqmp/readme.txt new file +52 -0
52 lines not on this page · raw message
configs/zynqmp_zcu106_defconfig new file +31 -0
@@ -0,0 +1,31 @@ +BR2_aarch64=y +BR2_GLOBAL_PATCH_DIR="board/zynqmp/patches/" +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/zynqmp/post-image.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://github.com/Xilinx/linux-xlnx.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.4" +BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynqmp" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/zynqmp-zcu106-revA" +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="zynqmp" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT=y +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_GIT=y +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://github.com/xilinx/u-boot-xlnx.git" +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="228801a215909365ae1dcdd799034195ad7264f7" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="xilinx_zynqmp_zcu106_revA" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin" +BR2_TARGET_UBOOT_ZYNQMP=y +BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/416bf2e1b625993a2fb9fc14924ffe2247d5a0c2/bin/pmufw-zcu106-default-v2017.1.bin" +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y
Signature · 1 line
2.7.4
PATCH v3 5/5 configs: add Xilinx ZCU106 board (ZynqMP SoC)
Hello,
Quoted 13 lines · Luca Ceresoli
configs/zynqmp_zcu106_defconfig new file +7
-0@@ -0,0 +1,31 @@ +BR2_aarch64=y +BR2_GLOBAL_PATCH_DIR="board/zynqmp/patches/" +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/zynqmp/post-image.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://github.com/Xilinx/linux-xlnx.git"
configs/zynqmp_zcu106_defconfig line 17
Quoted 10 lines
configs/zynqmp_zcu106_defconfig new file +10
-0+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.4" +BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynqmp" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/zynqmp-zcu106-revA" +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="zynqmp" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT=y
Shouldn't we specify an explicit version for ATF, just like it's done for U-Boot and Linux ?
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH v3 5/5 configs: add Xilinx ZCU106 board (ZynqMP SoC)
Hi Thomas,
Quoted 22 lines · Thomas Petazzoni
Hello,
Quoted 18 lines · Luca Ceresoli
configs/zynqmp_zcu106_defconfig new file +12
-0@@ -0,0 +1,31 @@ +BR2_aarch64=y +BR2_GLOBAL_PATCH_DIR="board/zynqmp/patches/" +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/zynqmp/post-image.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://github.com/Xilinx/linux-xlnx.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="xilinx-v2017.4" +BR2_LINUX_KERNEL_DEFCONFIG="xilinx_zynqmp" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/zynqmp-zcu106-revA" +BR2_TARGET_ROOTFS_EXT2=y
Quoted 8 lines
configs/zynqmp_zcu106_defconfig line 17
Quoted 5 lines
configs/zynqmp_zcu106_defconfig new file +5
-0+BR2_TARGET_ROOTFS_EXT2_4=y +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="zynqmp" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT=yShouldn't we specify an explicit version for ATF, just like it's done for U-Boot and Linux ?
Absolutely. Will fix that.
Thanks,
Signature · 1 line
Luca