Skip to contentSkip to conversation

Add Xilinx ZynqMP and ZCU106 board support

PATCH New Luca Ceresoli 2 participants 14 messages Apr 6, 2018 – May 3, 2018 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

cover Add Xilinx ZynqMP and ZCU106 board support

Hi,

[*Resending since patchwork missed most patches last time*]

this patchset adds basic support for the ZynqMP family of ARM64 SoC+FPGA by Xilinx and for the ZCU106 board based on it.

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).

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, I've set up a repository with pre-built PMU firmwares and added a new package that just downloads from there. This is similar to the binaries-marvell and vexpress-firmware packages. This is added in patch 3.

Finally, U-Boot needs some tweaks in order for the PMU firmware to properly loaded and to initialize peripherals before starting Linux. This is done in patches 4 and 5.

With all these in place, patch 6 just adds the defconfig and board files.

Main changes since v1:
- Do not add the huge psu_init files to Buildroot. Instead use the zcu106 support in the Xilinx master branch (but add two patches to fix it). The option to use a user-provided psu_init file is still present because many users will use the same board in a different configuration or a custom board.
- Use a recent version of U-Boot. Upstream v2018.01 has been merged into the Xilinx master branch, which is a big step from the previous version based on upstream 2017.01. Xilinx has not tagged any version since that, so we use a SHA-1.
- Split patch 4 in two as it was doing two different things.

Luca

Luca Ceresoli (6):
arm-trusted-firmware: simplify release dir path
arm-trusted-firmware: generate atf-uboot.ub for ZynqMP booting
zynqmp-pmufw-binaries: new package
uboot: zynqmp: generate SPL image with PMUFW binary
uboot: zynqmp: allow to use custom psu_init files
configs: add Xilinx ZCU106 board (ZynqMP SoC)

 DEVELOPERS                                         |  3 ++
 board/zynqmp/genimage.cfg                          | 28 +++++++++++
 ...1-arm64-zynqmp-zcu106-fix-SPL-MMC-booting.patch | 56 ++++++++++++++++++++++
 ...arm64-zynqmp-zcu106-enable-booting-to-ATF.patch | 39 +++++++++++++++
 board/zynqmp/post-image.sh                         | 13 +++++
 board/zynqmp/readme.txt                            | 52 ++++++++++++++++++++
 boot/Config.in                                     |  1 +
 boot/arm-trusted-firmware/Config.in                |  9 ++++
 boot/arm-trusted-firmware/arm-trusted-firmware.mk  | 24 +++++++++-
 boot/uboot/Config.in                               | 33 +++++++++++++
 boot/uboot/uboot.mk                                | 25 ++++++++++
 boot/zynqmp-pmufw-binaries/Config.in               | 19 ++++++++
 .../zynqmp-pmufw-binaries.hash                     |  3 ++
 .../zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk | 26 ++++++++++
 configs/zynqmp_zcu106_defconfig                    | 31 ++++++++++++
 15 files changed, 361 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-zcu106-enable-booting-to-ATF.patch
 create mode 100755 board/zynqmp/post-image.sh
 create mode 100644 board/zynqmp/readme.txt
 create mode 100644 boot/zynqmp-pmufw-binaries/Config.in
 create mode 100644 boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.hash
 create mode 100644 boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk
 create mode 100644 configs/zynqmp_zcu106_defconfig
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/6 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 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
index 4bac916e3108..212bb5049f2b 100644
@@ -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
#2 lore raw

PATCH 2/6 arm-trusted-firmware: generate atf-uboot.ub for ZynqMP booting

In reply to Luca Ceresoli

U-Boot SPL for the Xilinx ZynqMP SoCs needs ATF in this format to load it.

Changes v1 -> v2: none.

---
 boot/arm-trusted-firmware/Config.in               |  9 +++++++++
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 21 +++++++++++++++++++++
 2 files changed, 30 insertions(+)
boot/arm-trusted-firmware/Config.in +9 -0
index 7aef87cb746c..dca9958423b9 100644
@@ -71,6 +71,15 @@ 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_ZYNQMP_UB_MKIMAGE
+	bool "Generate a U-Boot image (for Xilinx ZynqMP U-Boot)"
+	depends on BR2_cortex_a53
+	select BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
+	help
+	  Uses mkimage from uboot-tools to encapsulate bl31.bin into
+	  a U-Boot image named atf-uboot.ub. This is needed 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
index 212bb5049f2b..69aac4ee3eb4 100644
@@ -86,6 +86,27 @@ define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
 	cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/
 endef
 
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE),y)
+define ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE
+# Get the entry point address from the elf.
+	BASE_ADDR=$$($(TARGET_READELF) -h $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf | \
+	             grep -E -m 1 -i "entry point.*?0x" | \
+	             sed -r 's/.*?(0x.*?)/\1/g') && \
+	$(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_ZYNQMP_UB_INSTALL
+	install $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub $(BINARIES_DIR)
+endef
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += RESET_TO_BL31=1
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-uboot-tools
+ARM_TRUSTED_FIRMWARE_POST_BUILD_HOOKS += ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE
+ARM_TRUSTED_FIRMWARE_POST_INSTALL_IMAGES_HOOKS += ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_INSTALL
+endif
+
 # Configuration check
 ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE)$(BR_BUILDING),yy)
 
Signature · 1 line
2.7.4
#3 lore raw

PATCH 2/6 arm-trusted-firmware: generate atf-uboot.ub for ZynqMP booting

Hello,

Quoted 17 lines · Luca Ceresoli

U-Boot SPL for the Xilinx ZynqMP SoCs needs ATF in this format to load it.

Changes v1 -> v2: none.

---
 boot/arm-trusted-firmware/Config.in               |  9 +++++++++
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 21 +++++++++++++++++++++
 2 files changed, 30 insertions(+)
boot/arm-trusted-firmware/Config.in +0 -0
index 7aef87cb746c..dca9958423b9 100644
@@ -71,6 +71,15 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
 	  typically used on platforms where another bootloader (e.g

boot/arm-trusted-firmware/Config.in config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31 · line 81

Quoted 10 lines
boot/arm-trusted-firmware/Config.in +8 -0
 	  U-Boot) encapsulates ATF BL31.
 
+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE
+	bool "Generate a U-Boot image (for Xilinx ZynqMP U-Boot)"
+	depends on BR2_cortex_a53
+	select BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
+	help
+	  Uses mkimage from uboot-tools to encapsulate bl31.bin into
+	  a U-Boot image named atf-uboot.ub. This is needed by the
+	  Xilinx version of U-Boot SPL to load ATF on the ZynqMP SoC.

In fact this doesn't look like very Xilinx-specific. It just encapsulates the bl31 image in a U-Boot image format. This could potentially be used by other platforms as well.

So, perhaps we could make this:

config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT
bool "Build BL31 U-Boot image"
select BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
help
This option will generate a bl31.bin that is encapsulates into a U-Boot image named atf-uboot.ub. This is for example used by the Xilinx version of U-Boot SPL to load ATF on the ZynqMP SoC.

boot/arm-trusted-firmware/Config.in config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31

Quoted 6 lines
boot/arm-trusted-firmware/Config.in +6 -0
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE),y)
+define ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE
+# Get the entry point address from the elf.
+	BASE_ADDR=$$($(TARGET_READELF) -h $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf | \
+	             grep -E -m 1 -i "entry point.*?0x" | \
+	             sed -r 's/.*?(0x.*?)/\1/g') && \

Meh, what a mess to get the entry point address :-/ Could this be simplified with:

$(TARGET_READELF) -h $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf | sed '/^ Entry point address: *\(.*\)/!d; s//\1/'

(Thanks Yann!)

boot/arm-trusted-firmware/Config.in

Quoted 8 lines
boot/arm-trusted-firmware/Config.in +8 -0
+	$(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_ZYNQMP_UB_INSTALL
+	install $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub $(BINARIES_DIR)

Should be:

	$(INSTALL) -m 0644 -D $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub $(BINARIES_DIR)/atf-uboot.ub

boot/arm-trusted-firmware/Config.in

Quoted 5 lines
boot/arm-trusted-firmware/Config.in +5 -0
+endef
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += RESET_TO_BL31=1
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-uboot-tools
+ARM_TRUSTED_FIRMWARE_POST_BUILD_HOOKS += ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE
+ARM_TRUSTED_FIRMWARE_POST_INSTALL_IMAGES_HOOKS += ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_INSTALL

Rather than hooks, just use directly ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE and ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_INSTALL in the BUILD_CMDS and INSTALL_IMAGES_CMDS. Of course, remove the ZYNQMP part of the variable names if you agree with my proposal above.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 2/6 arm-trusted-firmware: generate atf-uboot.ub for ZynqMP booting

Hi,

Quoted 73 lines · Thomas Petazzoni

Hello,

Quoted 17 lines · Luca Ceresoli

U-Boot SPL for the Xilinx ZynqMP SoCs needs ATF in this format to load it.

Changes v1 -> v2: none.

---
 boot/arm-trusted-firmware/Config.in               |  9 +++++++++
 boot/arm-trusted-firmware/arm-trusted-firmware.mk | 21 +++++++++++++++++++++
 2 files changed, 30 insertions(+)
boot/arm-trusted-firmware/Config.in +0 -0
index 7aef87cb746c..dca9958423b9 100644
@@ -71,6 +71,15 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
 	  typically used on platforms where another bootloader (e.g

boot/arm-trusted-firmware/Config.in config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31 · line 81

Quoted 10 lines
boot/arm-trusted-firmware/Config.in +8 -0
 	  U-Boot) encapsulates ATF BL31.
 
+config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE
+	bool "Generate a U-Boot image (for Xilinx ZynqMP U-Boot)"
+	depends on BR2_cortex_a53
+	select BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
+	help
+	  Uses mkimage from uboot-tools to encapsulate bl31.bin into
+	  a U-Boot image named atf-uboot.ub. This is needed by the
+	  Xilinx version of U-Boot SPL to load ATF on the ZynqMP SoC.

In fact this doesn't look like very Xilinx-specific. It just encapsulates the bl31 image in a U-Boot image format. This could potentially be used by other platforms as well.

So, perhaps we could make this:

config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT
bool "Build BL31 U-Boot image"
select BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
help
This option will generate a bl31.bin that is encapsulates into a U-Boot image named atf-uboot.ub. This is for example used by the Xilinx version of U-Boot SPL to load ATF on the ZynqMP SoC.

boot/arm-trusted-firmware/Config.in config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31

Quoted 6 lines
boot/arm-trusted-firmware/Config.in +6 -0
+ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE),y)
+define ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE
+# Get the entry point address from the elf.
+	BASE_ADDR=$$($(TARGET_READELF) -h $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf | \
+	             grep -E -m 1 -i "entry point.*?0x" | \
+	             sed -r 's/.*?(0x.*?)/\1/g') && \

Meh, what a mess to get the entry point address :-/ Could this be simplified with:

$(TARGET_READELF) -h $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf | sed '/^ Entry point address: *\(.*\)/!d; s//\1/'

(Thanks Yann!)

boot/arm-trusted-firmware/Config.in

Quoted 8 lines
boot/arm-trusted-firmware/Config.in +8 -0
+	$(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_ZYNQMP_UB_INSTALL
+	install $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub $(BINARIES_DIR)

Should be:

	$(INSTALL) -m 0644 -D $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub $(BINARIES_DIR)/atf-uboot.ub
Quoted 11 lines

boot/arm-trusted-firmware/Config.in

Quoted 5 lines
boot/arm-trusted-firmware/Config.in +5 -0
+endef
+ARM_TRUSTED_FIRMWARE_MAKE_OPTS += RESET_TO_BL31=1
+ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-uboot-tools
+ARM_TRUSTED_FIRMWARE_POST_BUILD_HOOKS += ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE
+ARM_TRUSTED_FIRMWARE_POST_INSTALL_IMAGES_HOOKS += ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_INSTALL

Rather than hooks, just use directly ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_MKIMAGE and ARM_TRUSTED_FIRMWARE_ZYNQMP_UB_INSTALL in the BUILD_CMDS and INSTALL_IMAGES_CMDS. Of course, remove the ZYNQMP part of the variable names if you agree with my proposal above.

Thanks for the review. These changes will be in v3.

Bye,

Signature · 1 line
Luca
#5 lore raw

PATCH 3/6 zynqmp-pmufw-binaries: new package

In reply to Luca Ceresoli

Downloads pre-built binary firmwares for the Xilinx ZynqMP SoCs PMU.

---
Changes v1 -> v2: none.

---
 DEVELOPERS                                         |  1 +
 boot/Config.in                                     |  1 +
 boot/zynqmp-pmufw-binaries/Config.in               | 19 ++++++++++++++++
 .../zynqmp-pmufw-binaries.hash                     |  3 +++
 .../zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk | 26 ++++++++++++++++++++++
 5 files changed, 50 insertions(+)
 create mode 100644 boot/zynqmp-pmufw-binaries/Config.in
 create mode 100644 boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.hash
 create mode 100644 boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk
DEVELOPERS +1 -0
index 9d23fa51b876..eb4781c1e3cd 100644
@@ -1070,6 +1070,7 @@ F:	package/ti-sgx-um/
 
 N:	Luca Ceresoli <[email protected]>
 F:	board/olimex/a20_olinuxino/
+F:	boot/zynqmp-pmufw-binaries/
 F:	configs/olimex_a20_olinuxino_*
 F:	package/agentpp/
 F:	package/exim/
boot/Config.in +1 -0
index 3687c41a2c00..a23886997c9f 100644
@@ -19,5 +19,6 @@ source "boot/ts4800-mbrboot/Config.in"
 source "boot/uboot/Config.in"
 source "boot/vexpress-firmware/Config.in"
 source "boot/xloader/Config.in"
+source "boot/zynqmp-pmufw-binaries/Config.in"
 
 endmenu
boot/zynqmp-pmufw-binaries/Config.in new file +19 -0
new file mode 100644
index 000000000000..e39561cbf91e
@@ -0,0 +1,19 @@
+config BR2_TARGET_ZYNQMP_PMUFW_BINARIES
+	bool "Zynqmp PMU firmware"
+	depends on BR2_aarch64
+	help
+	  This package provides precompiled firmwares for the Platform
+	  Management Unit (PMU) of the Xilinx ZynqMP family of SoCs.
+
+	  https://github.com/lucaceresoli/zynqmp-pmufw-binaries
+
+if BR2_TARGET_ZYNQMP_PMUFW_BINARIES
+
+config BR2_TARGET_ZYNQMP_PMUFW_BINARIES_IMAGE
+	string "PMU firmware image file"
+	help
+	  Enter the path to the PMU firmware file for your board and
+	  configuration, relative to the repository top directory.
+	  Example: "zcu106-default/pmufw.bin".
+
+endif
boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.hash new file +3 -0
new file mode 100644
index 000000000000..a60566445290
@@ -0,0 +1,3 @@
+# Locally computed
+sha256  b74808c93522a39bedecd64bd5a75fd766f267e1d540f45dbfe868694f49b1d7  zynqmp-pmufw-binaries-ec64e06b836a0841f40bd52434f6919c5dafb133.tar.gz
+sha256  235b467980655706d5fded5baf3d8b52ddb102a9e0c26804a67c0ec719042d38  license.txt
boot/zynqmp-pmufw-binaries/zynqmp-pmufw-binaries.mk new file +26 -0
new file mode 100644
index 000000000000..91aec04f907a
@@ -0,0 +1,26 @@
+################################################################################
+#
+# zynqmp-pmufw-binaries
+#
+################################################################################
+
+ZYNQMP_PMUFW_BINARIES_VERSION = ec64e06b836a0841f40bd52434f6919c5dafb133
+ZYNQMP_PMUFW_BINARIES_SITE = $(call github,lucaceresoli,zynqmp-pmufw-binaries,$(ZYNQMP_PMUFW_BINARIES_VERSION))
+
+ZYNQMP_PMUFW_BINARIES_LICENSE = X11 with Xilinx exception
+ZYNQMP_PMUFW_BINARIES_LICENSE_FILES = license.txt
+
+ZYNQMP_PMUFW_BINARIES_IMAGE = $(call qstrip,$(BR2_TARGET_ZYNQMP_PMUFW_BINARIES_IMAGE))
+ZYNQMP_PMUFW_BINARIES_INSTALL_IMAGES = YES
+
+define ZYNQMP_PMUFW_BINARIES_INSTALL_IMAGES_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/$(ZYNQMP_PMUFW_BINARIES_IMAGE) $(BINARIES_DIR)/pmufw.bin
+endef
+
+ifeq ($(ZYNQMP_PMUFW_BINARIES),y)
+ifeq ($(ZYNQMP_PMUFW_BINARIES_IMAGE),)
+$(error No PMU firmware image file name set. Check your BR2_TARGET_ZYNQMP_PMUFW_BINARIES_IMAGE setting)
+endif
+endif
+
+$(eval $(generic-package))
Signature · 1 line
2.7.4
#6 lore raw

PATCH 3/6 zynqmp-pmufw-binaries: new package

Hello,

Quoted 13 lines · Luca Ceresoli
boot/zynqmp-pmufw-binaries/Config.in new file +7 -0
new file mode 100644
index 000000000000..e39561cbf91e
@@ -0,0 +1,19 @@
+config BR2_TARGET_ZYNQMP_PMUFW_BINARIES
+	bool "Zynqmp PMU firmware"
+	depends on BR2_aarch64
+	help
+	  This package provides precompiled firmwares for the Platform
+	  Management Unit (PMU) of the Xilinx ZynqMP family of SoCs.
+

boot/zynqmp-pmufw-binaries/Config.in line 17

Quoted 10 lines
boot/zynqmp-pmufw-binaries/Config.in new file +10 -0
+	  https://github.com/lucaceresoli/zynqmp-pmufw-binaries
+
+if BR2_TARGET_ZYNQMP_PMUFW_BINARIES
+
+config BR2_TARGET_ZYNQMP_PMUFW_BINARIES_IMAGE
+	string "PMU firmware image file"
+	help
+	  Enter the path to the PMU firmware file for your board and
+	  configuration, relative to the repository top directory.
+	  Example: "zcu106-default/pmufw.bin".

So this hints at the fact that this firmware is board specific. Is that correct ? If so, shouldn't we plan on making the Git repo and its version configurable ?

I mean, what are the chances that for some random ZynqMP board, your Github repo will contain the appropriate firmware file ?

Generally speaking, it's a bit annoying that we can't build this from source. I understand it needs a Microblaze toolchain, so it's very difficult to integrate in Buildroot :-/

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH 3/6 zynqmp-pmufw-binaries: new package

Hi Thomas,

Quoted 23 lines · Thomas Petazzoni

Hello,

Quoted 19 lines · Luca Ceresoli
boot/zynqmp-pmufw-binaries/Config.in new file +13 -0
new file mode 100644
index 000000000000..e39561cbf91e
@@ -0,0 +1,19 @@
+config BR2_TARGET_ZYNQMP_PMUFW_BINARIES
+	bool "Zynqmp PMU firmware"
+	depends on BR2_aarch64
+	help
+	  This package provides precompiled firmwares for the Platform
+	  Management Unit (PMU) of the Xilinx ZynqMP family of SoCs.
+
+	  https://github.com/lucaceresoli/zynqmp-pmufw-binaries
+
+if BR2_TARGET_ZYNQMP_PMUFW_BINARIES
+
+config BR2_TARGET_ZYNQMP_PMUFW_BINARIES_IMAGE
+	string "PMU firmware image file"
Quoted 8 lines

boot/zynqmp-pmufw-binaries/Config.in line 17

Quoted 4 lines
boot/zynqmp-pmufw-binaries/Config.in new file +4 -0
+	help
+	  Enter the path to the PMU firmware file for your board and
+	  configuration, relative to the repository top directory.
+	  Example: "zcu106-default/pmufw.bin".

So this hints at the fact that this firmware is board specific. Is that correct ? If so, shouldn't we plan on making the Git repo and its version configurable ?

The firmware is board-specific and configuration-specific. The plan for that repo, however, is to have all supported board+config combinations supported in all versions, thus the lack of a version selection knob.

But maybe we can reconsider this topic later, when the repo contains at least 2 versions, or at least 2 boards, or at least 2 configs... :)

Quoted 2 lines

I mean, what are the chances that for some random ZynqMP board, your Github repo will contain the appropriate firmware file ?

Good point. My repo there is ready to hold any possible board+config combination that is interesting for known boards. I would love to host more boards there (contributilns would be welcome). However I don't think we'll ever see any custom board, which reduces its usefulness.

Thus a simpler, but more flexible, option might be to nuke the zynqmp-pmufw-binaries BR package and let uboot fetch the pmufw.bin from a plain URL (https:// or file://). For standard devboards the URL could point to my repo, but it can be anywhere else (for custom boards).

Quoted 3 lines

Generally speaking, it's a bit annoying that we can't build this from source. I understand it needs a Microblaze toolchain, so it's very difficult to integrate in Buildroot :-/

Indeed, and this is *the* big topic.

There are several variations that could be considered, but none have been attempted AFAIK. Here they are, simplest to hardest:

1. Build the PMUFW in Buildroot (kind of)

Add a script (e.g. board/zynqmp/build-pmufw.sh) that builds a microblaze toolchain and the PMUFW with a given config. The commands are already
there: [0].

The script would then be called manually before Buildroot runs, or it could be wrapped in a Buildroot package that uboot depends on. Takes ~8 minutes on a modern quad core machine.

* Simple to do, not well integrated, longer build time.

2. Let SPL install the PMUFW config

This is what the Xilinx workflow does (in the Xilinx FSBL, which is more or less equivalent to U-Boot SPL). This allows The PMUFW can be a unique blob for all boards.

This moves the configuration object from a piece of early firmware (PMUFW) to another piece of early firmware (SPL). Both pieces are residing in the same BOOT.BIN file, so there's no added flexibility for the "user": upon a config change, you still have to update the BOOT.BIN file in the boot medium.

There are also licensing issues preventing this, since the configuration object file license is not compatible with the U-Boot license. Xilinx _might_ be willing to fix this, however.

* Could be doable, perhaps tricky.

3. Don't have any config object...

...and change the PMUFW source code to assign dynamically peripherals to cores at runtime, based on requests from cores! :->

* Maybe doable, potentially dangerous, definitely hard to do.

[0]
https://github.com/lucaceresoli/zynqmp-pmufw-builder/blob/master/build.sh

Any idea or suggestion is very welcome, although I think we cannot do much more than looking for the least evil solution...

Bye,

Signature · 1 line
Luca
#8 lore raw

PATCH 3/6 zynqmp-pmufw-binaries: new package

Hello Luca,

Quoted 7 lines · Luca Ceresoli
Quoted 3 lines

So this hints at the fact that this firmware is board specific. Is that correct ? If so, shouldn't we plan on making the Git repo and its version configurable ?

The firmware is board-specific and configuration-specific. The plan for that repo, however, is to have all supported board+config combinations supported in all versions, thus the lack of a version selection knob.

"all" ? I'm pretty sure a lot of people will be doing custom designs, and will not be willing to push their firmware binary to your public repository.

Quoted 8 lines
Quoted 2 lines

I mean, what are the chances that for some random ZynqMP board, your Github repo will contain the appropriate firmware file ?

Good point. My repo there is ready to hold any possible board+config combination that is interesting for known boards. I would love to host more boards there (contributilns would be welcome). However I don't think we'll ever see any custom board, which reduces its usefulness.

Quoted 4 lines

Thus a simpler, but more flexible, option might be to nuke the zynqmp-pmufw-binaries BR package and let uboot fetch the pmufw.bin from a plain URL (https:// or file://). For standard devboards the URL could point to my repo, but it can be anywhere else (for custom boards).

Ah, this seems like a better option indeed, especially since the firmware is a single file. It could be locally available, or downloaded from HTTP. Sounds like a good plan.

Quoted 15 lines
Quoted 3 lines

Generally speaking, it's a bit annoying that we can't build this from source. I understand it needs a Microblaze toolchain, so it's very difficult to integrate in Buildroot :-/

Indeed, and this is *the* big topic.

There are several variations that could be considered, but none have been attempted AFAIK. Here they are, simplest to hardest:

1. Build the PMUFW in Buildroot (kind of)

Add a script (e.g. board/zynqmp/build-pmufw.sh) that builds a microblaze toolchain and the PMUFW with a given config. The commands are already
there: [0].

Quoted 5 lines

The script would then be called manually before Buildroot runs, or it could be wrapped in a Buildroot package that uboot depends on. Takes ~8 minutes on a modern quad core machine.

* Simple to do, not well integrated, longer build time.

Yeah, the integration with Buildroot here is really not great, because Crosstool-NG will do its own downloading, etc.

Quoted 16 lines

2. Let SPL install the PMUFW config

This is what the Xilinx workflow does (in the Xilinx FSBL, which is more or less equivalent to U-Boot SPL). This allows The PMUFW can be a unique blob for all boards.

This moves the configuration object from a piece of early firmware (PMUFW) to another piece of early firmware (SPL). Both pieces are residing in the same BOOT.BIN file, so there's no added flexibility for the "user": upon a config change, you still have to update the BOOT.BIN file in the boot medium.

There are also licensing issues preventing this, since the configuration object file license is not compatible with the U-Boot license. Xilinx _might_ be willing to fix this, however.

Quoted 8 lines

* Could be doable, perhaps tricky.

3. Don't have any config object...

...and change the PMUFW source code to assign dynamically peripherals to cores at runtime, based on requests from cores! :->

* Maybe doable, potentially dangerous, definitely hard to do.

Not sure I understand enough of what the PMUFW is doing to understand
(2) and (3). And yes, I did attend your talk at FOSDEM about ZynqMP ! :-)

Quoted 2 lines

Any idea or suggestion is very welcome, although I think we cannot do much more than looking for the least evil solution...

I think for now the solution you propose to add an option in U-Boot to indicate the path/URL to the PMUFW binary is the easiest one. It can always be improved later if better solutions emerge.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#9 lore raw

PATCH 3/6 zynqmp-pmufw-binaries: new package

Hi,

Quoted 24 lines · Thomas Petazzoni

Hello Luca,

Quoted 7 lines · Luca Ceresoli
Quoted 3 lines

So this hints at the fact that this firmware is board specific. Is that correct ? If so, shouldn't we plan on making the Git repo and its version configurable ?

The firmware is board-specific and configuration-specific. The plan for that repo, however, is to have all supported board+config combinations supported in all versions, thus the lack of a version selection knob.

"all" ? I'm pretty sure a lot of people will be doing custom designs, and will not be willing to push their firmware binary to your public repository.

Quoted 8 lines
Quoted 2 lines

I mean, what are the chances that for some random ZynqMP board, your Github repo will contain the appropriate firmware file ?

Good point. My repo there is ready to hold any possible board+config combination that is interesting for known boards. I would love to host more boards there (contributilns would be welcome). However I don't think we'll ever see any custom board, which reduces its usefulness.

Quoted 8 lines
Quoted 4 lines

Thus a simpler, but more flexible, option might be to nuke the zynqmp-pmufw-binaries BR package and let uboot fetch the pmufw.bin from a plain URL (https:// or file://). For standard devboards the URL could point to my repo, but it can be anywhere else (for custom boards).

Ah, this seems like a better option indeed, especially since the firmware is a single file. It could be locally available, or downloaded from HTTP. Sounds like a good plan.

I just sent v3 which implements this. Thanks Yann for having fixed EXTRA_DOWNLOADS! :)

Quoted 44 lines
Quoted 15 lines
Quoted 3 lines

Generally speaking, it's a bit annoying that we can't build this from source. I understand it needs a Microblaze toolchain, so it's very difficult to integrate in Buildroot :-/

Indeed, and this is *the* big topic.

There are several variations that could be considered, but none have been attempted AFAIK. Here they are, simplest to hardest:

1. Build the PMUFW in Buildroot (kind of)

Add a script (e.g. board/zynqmp/build-pmufw.sh) that builds a microblaze toolchain and the PMUFW with a given config. The commands are already
there: [0].

Quoted 5 lines

The script would then be called manually before Buildroot runs, or it could be wrapped in a Buildroot package that uboot depends on. Takes ~8 minutes on a modern quad core machine.

* Simple to do, not well integrated, longer build time.

Yeah, the integration with Buildroot here is really not great, because Crosstool-NG will do its own downloading, etc.

Quoted 20 lines

2. Let SPL install the PMUFW config

This is what the Xilinx workflow does (in the Xilinx FSBL, which is more or less equivalent to U-Boot SPL). This allows The PMUFW can be a unique blob for all boards.

This moves the configuration object from a piece of early firmware (PMUFW) to another piece of early firmware (SPL). Both pieces are residing in the same BOOT.BIN file, so there's no added flexibility for the "user": upon a config change, you still have to update the BOOT.BIN file in the boot medium.

There are also licensing issues preventing this, since the configuration object file license is not compatible with the U-Boot license. Xilinx _might_ be willing to fix this, however.

* Could be doable, perhaps tricky.

3. Don't have any config object...

Quoted 8 lines
Quoted 4 lines

...and change the PMUFW source code to assign dynamically peripherals to cores at runtime, based on requests from cores! :->

* Maybe doable, potentially dangerous, definitely hard to do.

Not sure I understand enough of what the PMUFW is doing to understand
(2) and (3). And yes, I did attend your talk at FOSDEM about ZynqMP ! :-)

Which perhaps means I should improve my communication skills! :-\

Bye,

Signature · 1 line
Luca
#10 lore raw

PATCH 4/6 uboot: zynqmp: generate SPL image with PMUFW binary

In reply to Luca Ceresoli

In 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, to the boot ROM will load both.

---
Changes v1 -> v2:
- split from a larger patch doing 2 things.

---
 boot/uboot/Config.in | 11 +++++++++++
 boot/uboot/uboot.mk  | 13 +++++++++++++
 2 files changed, 24 insertions(+)
boot/uboot/Config.in +11 -0
index cef8ccd3cd0d..68c0be05d95a 100644
@@ -368,6 +368,17 @@ 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
+	select BR2_TARGET_ZYNQMP_PMUFW_BINARIES
+	help
+	  Instruct the U-Boot build process to generate a file named
+	  boot.bin, which is the file loaded by the ZynqMP boot ROM.
+	  boot.bin contains both the U-Boot SPL and the PMU firmware
+	  (downloaded by the zynqmp-pmufw-binaries package) formatted
+	  with the Xilinx-specific format.
+
 config BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC
 	bool "CRC image for Altera SoC FPGA (mkpimage)"
 	depends on BR2_arm
boot/uboot/uboot.mk +13 -0
index 24d3e4ef5485..e81a9fd41dab 100644
@@ -278,6 +278,19 @@ define UBOOT_INSTALL_IMAGES_CMDS
 			$(BINARIES_DIR)/boot.scr)
 endef
 
+ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y)
+
+UBOOT_DEPENDENCIES += zynqmp-pmufw-binaries
+define UBOOT_KCONFIG_FIXUP_CMDS
+	$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"board/xilinx/zynqmp/pmufw.bin",$(@D)/.config)
+endef
+define UBOOT_ZYNQMP_COPY_PMUFW
+	cp ${BINARIES_DIR}/pmufw.bin $(@D)/board/xilinx/zynqmp/
+endef
+UBOOT_PRE_CONFIGURE_HOOKS += UBOOT_ZYNQMP_COPY_PMUFW
+
+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
#11 lore raw

PATCH 4/6 uboot: zynqmp: generate SPL image with PMUFW binary

Hello,

Quoted 19 lines · Luca Ceresoli
boot/uboot/Config.in +11 -0
+config BR2_TARGET_UBOOT_ZYNQMP
+	bool "Boot on the Xilinx ZynqMP SoCs"
+	depends on BR2_aarch64
+	select BR2_TARGET_ZYNQMP_PMUFW_BINARIES
+	help
+	  Instruct the U-Boot build process to generate a file named
+	  boot.bin, which is the file loaded by the ZynqMP boot ROM.
+	  boot.bin contains both the U-Boot SPL and the PMU firmware
+	  (downloaded by the zynqmp-pmufw-binaries package) formatted
+	  with the Xilinx-specific format.
+
 config BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC
 	bool "CRC image for Altera SoC FPGA (mkpimage)"
 	depends on BR2_arm
boot/uboot/uboot.mk +0 -0
index 24d3e4ef5485..e81a9fd41dab 100644

boot/uboot/uboot.mk define UBOOT_INSTALL_IMAGES_CMDS · line 286

Quoted 9 lines
boot/uboot/uboot.mk +6 -0
@@ -278,6 +278,19 @@ define UBOOT_INSTALL_IMAGES_CMDS
 			$(BINARIES_DIR)/boot.scr)
 endef
 
+ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y)
+
+UBOOT_DEPENDENCIES += zynqmp-pmufw-binaries
+define UBOOT_KCONFIG_FIXUP_CMDS
+	$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"board/xilinx/zynqmp/pmufw.bin",$(@D)/.config)
+endef

I'd prefer if the definition of UBOOT_KCONFIG_FIXUP_CMDS was outside this condition, and uses a variable like $(UBOOT_ZYNQMP_CONFIG_FIXUP) instead.

boot/uboot/uboot.mk define UBOOT_INSTALL_IMAGES_CMDS · line 288

Quoted 2 lines
boot/uboot/uboot.mk +2 -0
+define UBOOT_ZYNQMP_COPY_PMUFW
+	cp ${BINARIES_DIR}/pmufw.bin $(@D)/board/xilinx/zynqmp/

Please use $(...) instead of ${...} to reference make variables. And use $(INSTALL) -D -m 0644 :)

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#12 lore raw

PATCH 5/6 uboot: zynqmp: allow to use custom psu_init files

In reply to Luca Ceresoli

U-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 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 | 22 ++++++++++++++++++++++
 boot/uboot/uboot.mk  | 12 ++++++++++++
 2 files changed, 34 insertions(+)
boot/uboot/Config.in +22 -0
index 68c0be05d95a..55a99aea23d8 100644
@@ -379,6 +379,28 @@ config BR2_TARGET_UBOOT_ZYNQMP
 	  (downloaded by the zynqmp-pmufw-binaries package) formatted
 	  with the Xilinx-specific format.
 
+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), generated by the Xilinx development tools,
+	  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
+	  provide a different file here, and U-Boot will build and link
+	  the user-provided file instead of the built-in one.
+
+	  Set this variable to the path where the psu_init_gpl.c file (and
+	  psu_init_gpl.h if needed) is located. 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 +12 -0
index e81a9fd41dab..38d3c4019ee9 100644
@@ -289,6 +289,18 @@ define UBOOT_ZYNQMP_COPY_PMUFW
 endef
 UBOOT_PRE_CONFIGURE_HOOKS += UBOOT_ZYNQMP_COPY_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
+# 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
Signature · 1 line
2.7.4
#13 lore raw

PATCH 6/6 configs: add Xilinx ZCU106 board (ZynqMP SoC)

In reply to Luca Ceresoli

This adds support the Xilinx ZCU106 development board.

Mainline U-Boot does not have a zcu106 defconfig, so iet's use U-Boot from the Xilinx master branch, which has one. But since that defconfig does not boot from SD card, add two patches to fix that.

[Tested on the ES2 (Engineering Sample 2) version of the board]

---
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 | 56 ++++++++++++++++++++++
 ...arm64-zynqmp-zcu106-enable-booting-to-ATF.patch | 39 +++++++++++++++
 board/zynqmp/post-image.sh                         | 13 +++++
 board/zynqmp/readme.txt                            | 52 ++++++++++++++++++++
 configs/zynqmp_zcu106_defconfig                    | 31 ++++++++++++
 7 files changed, 221 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-zcu106-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
index eb4781c1e3cd..228a731a9de6 100644
@@ -1070,8 +1070,10 @@ F:	package/ti-sgx-um/
 
 N:	Luca Ceresoli <[email protected]>
 F:	board/olimex/a20_olinuxino/
+F:	board/zynqmp/
 F:	boot/zynqmp-pmufw-binaries/
 F:	configs/olimex_a20_olinuxino_*
+F:	configs/zynqmp_zcu106_defconfig
 F:	package/agentpp/
 F:	package/exim/
 F:	package/libpjsip/
board/zynqmp/genimage.cfg new file +28 -0
new file mode 100644
index 000000000000..30be086d7d42
@@ -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 +56 -0

56 lines not on this page · raw message

board/zynqmp/patches/uboot/0002-arm64-zynqmp-zcu106-enable-booting-to-ATF.patch new file +39 -0
new file mode 100644
index 000000000000..df6a57eb1667
@@ -0,0 +1,39 @@
+From 2e3b94597550501a58488504ad506ba50074aecd Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <[email protected]>
+Date: Wed, 7 Mar 2018 18:29:26 +0100
+Subject: [PATCH 2/2] arm64: zynqmp: zcu106: enable booting to ATF
+
+U-Boot is now able to boot to ARM Trusted Firmware (ATF). The boot
+flow is SPL(EL3) loads ATF and full u-boot and jump to ATF(EL3) which
+pass control to full u-boot(EL2). This has been tested on zcu106, so
+enable it in this defconfig.
+
+To generate an image that triggers this booting flow, you need to pass
+'-O arm-trusted-firmware' to mkimage.
+
+Patch submitted upstream.
+
+Signed-off-by: Luca Ceresoli <[email protected]>
+Cc: Michal Simek <[email protected]>
+
+---
+Changes v1 -> v2: none.
+---
+ configs/xilinx_zynqmp_zcu106_revA_defconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configs/xilinx_zynqmp_zcu106_revA_defconfig b/configs/xilinx_zynqmp_zcu106_revA_defconfig
+index 71da160cd78b..0575ee00fd8b 100644
+--- a/configs/xilinx_zynqmp_zcu106_revA_defconfig
++++ b/configs/xilinx_zynqmp_zcu106_revA_defconfig
+@@ -27,6 +27,7 @@ CONFIG_SPL=y
+ CONFIG_SPL_OS_BOOT=y
+ CONFIG_SPL_RAM_SUPPORT=y
+ CONFIG_SPL_RAM_DEVICE=y
++CONFIG_SPL_ATF=y
+ CONFIG_SYS_PROMPT="ZynqMP> "
+ CONFIG_FASTBOOT=y
+ CONFIG_FASTBOOT_FLASH=y
+-- 
+2.7.4
+
board/zynqmp/post-image.sh new file +13 -0
new file mode 100755
index 000000000000..2e7bcbaab60f
@@ -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
new file mode 100644
index 000000000000..cf8f2b14a971
@@ -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_ZYNQMP_UB_MKIMAGE=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_ZYNQMP_PMUFW_BINARIES_IMAGE="zcu106-default/pmufw.bin"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
Signature · 1 line
2.7.4