Skip to contentSkip to conversation

uboot: zynqmp: allow to use custom psu_init files

PATCH New Joel Carlson 2 participants 5 messages Jul 9, 2018 – Jul 11, 2018 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH v4 1/3 uboot: zynqmp: allow to use custom psu_init files

In reply to a message not in the archive

Hello,

I've been using the v3 form of your patches to get our Zynqmp board booting. This morning I upgraded our U-Boot from v2018.05 to v2018.07, and on my 2018.05 buildroot branch I removed the v3 patches and applied the v4 ones. I had a few issues with this patch.

On 06/21/2018 03:26 PM, Luca Ceresoli <[email protected]> wrote:

<snip>

Quoted 70 lines
board/zynqmp/patches/uboot/0004-arm-arm64-zynq-zynqmp-pass-the-PS-init-file-as-a-kco.patch new file +64 -0
new file mode 100644
index 000000000000..ab8108ee0c6a
@@ -0,0 +1,175 @@
+From 4c9d54ab5a41d65000c8d249b6fb1b76056f1812 Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli<[email protected]>
+Date: Wed, 20 Jun 2018 12:11:50 +0200
+Subject: [PATCH] arm/arm64: zynq/zynqmp: pass the PS init file as a kconfig
+ variable
+
+U-Boot needs to link ps7_init_gpl.c on Zynq or psu_init_gpl.c on
+ZynqMP (PS init for short). The current logic to locate this file for
+both platforms is:
+
+ 1. if a board-specific file exists in
+    board/xilinx/zynq[mp]/$(CONFIG_DEFAULT_DEVICE_TREE)/ps?_init_gpl.c
+    then use it
+ 2. otherwise use board/xilinx/zynq/ps?_init_gpl.c
+
+In the latter case the file does not exist in the U-Boot sources and
+must be copied in the source tree from the outside before starting the
+build. This is typical when it is generated from Xilinx tools while
+developing a custom hardware. However making sure that a
+board-specific file is_not_  found (and used) requires some trickery
+such as removing or overwriting all PS init files (e.g.: the current
+meta-xilinx yocto layer [0]).
+
+This generates a few problems:
+
+ * if the source tree is shared among different out-of-tree builds,
+   they will pollute (and potentially corrupt) each other
+ * the source tree cannot be read-only
+ * any buildsystem must add a command to copy the PS init file binary
+ * overwriting or deleting files in the source tree is ugly as hell
+
+Simplify usage by allowing to pass the path to the desired PS init
+file in kconfig variable XILINX_PS_INIT_FILE. It can be an absolute
+path or relative to $(srctree). If the variable is set, the
+user-specified file will always be used without being copied
+around. If the the variable is left empty, for backward compatibility
+fall back to the old behaviour.
+
+Since the issue is the same for Zynq and ZynqMP, add one kconfig
+variable in a common place and use it for both.
+
+Also use the new kconfig help text to document all the ways to give
+U-Boot the PS init file.
+
+Build-tested with all combinations of:
+ - platform: zynq or zynqmp
+ - PS init file: from XILINX_PS_INIT_FILE (absolute, relative path,
+   non-existing), in-tree board-specific, in board/xilinx/zynq[mp]/
+ - building in-tree, in subdir, in other directory
+
+[0]https://github.com/Xilinx/meta-xilinx/blob/b2f74cc7fe5c4881589d5e440a17cb51fc66a7ab/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc#L9
+
+Signed-off-by: Luca Ceresoli<[email protected]>
+Cc: Albert Aribaud<[email protected]>
+Cc: Michal Simek<[email protected]>
+Cc: Nathan Rossi<[email protected]>
+Submitted upstream:https://patchwork.ozlabs.org/patch/932392/  (slightly adapted to fix conflicts)
+---
+ arch/arm/Kconfig             |  1 +
+ board/xilinx/Kconfig         | 41 +++++++++++++++++++++++++++++++++++++++++
+ board/xilinx/zynq/Makefile   | 10 +++++++++-
+ board/xilinx/zynqmp/Makefile | 10 +++++++++-
+ 4 files changed, 60 insertions(+), 2 deletions(-)
+ create mode 100644 board/xilinx/Kconfig

board/zynqmp/patches/uboot/0004-arm-arm64-zynq-zynqmp-pass-the-PS-init-file-as-a-kco.patch line 74

Quoted 10 lines
board/zynqmp/patches/uboot/0004-arm-arm64-zynq-zynqmp-pass-the-PS-init-file-as-a-kco.patch new file +10 -0
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 22234cde2ab6..e04979d0ef7e 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -1293,4 +1293,5 @@ source "board/technologic/ts4600/Kconfig"
+ source "board/vscom/baltos/Kconfig"
+ source "board/woodburn/Kconfig"
+ source "board/work-microwave/work_92105/Kconfig"
++source "board/xilinx/Kconfig"

This patch does not apply with U-Boot 2018.07 - I don't know which version of U-Boot it is desired to maintain compatibility against. But it was a pretty small change to make it apply again, just adding:

Quoted 1 line

source "board/xilinx/zynqmp/Kconfig"

below the line the patch adds.

<snip>

Quoted 5 lines
boot/uboot/uboot.mk +0 -0
index 03bd7ea743ed..e4571a6ccf9f 100644

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

Quoted 9 lines
boot/uboot/uboot.mk +6 -0
@@ -274,6 +274,17 @@ 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_FILE)),)
+define UBOOT_ZYNQMP_KCONFIG_PSU_INIT
+	$(call KCONFIG_SET_OPT,CONFIG_XILINX_PS_INIT_FILE,"$(TOPDIR)/$(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE))", \
+           $(@D)/.config)

I think you should get rid of the "$(TOPDIR)/" part and let the user specify it as part of BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE if needed. My psu_init files are in a path that I reference via BR2_EXTERNAL, so having $(TOPDIR) prepended messed up the path to my files.

Quoted 20 lines
boot/uboot/uboot.mk +9 -1
+endef
+endif
+
+endif # BR2_TARGET_UBOOT_ZYNQMP
+
  define UBOOT_INSTALL_OMAP_IFT_IMAGE
  	cp -dpf $(@D)/$(UBOOT_BIN_IFT) $(BINARIES_DIR)/
  endef
@@ -323,6 +334,10 @@ UBOOT_DEPENDENCIES += host-mkpimage
  UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_CRC_ALTERA_SOCFPGA_IMAGE
  endif
 
+define UBOOT_KCONFIG_FIXUP_CMDS
+	$(UBOOT_ZYNQMP_KCONFIG_PSU_INIT)
+endef
+
  ifeq ($(BR2_TARGET_UBOOT_ENVIMAGE),y)
  ifeq ($(BR_BUILDING),y)
  ifeq ($(call qstrip,$(BR2_TARGET_UBOOT_ENVIMAGE_SOURCE)),)
-- 2.7.4
#5 lore raw

PATCH v4 2/3 uboot: zynqmp: generate SPL image with PMUFW binary

In reply to a message not in the archive

Hello,

On 06/21/2018 03:26 PM, Luca Ceresoli <[email protected]> wrote:

<snip>

Quoted 8 lines
boot/uboot/uboot.mk +0 -0
index e4571a6ccf9f..59b3fe07881d 100644
@@ -276,6 +276,17 @@ endef
 
 ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y)
 

boot/uboot/uboot.mk endef · line 288

Quoted 10 lines
boot/uboot/uboot.mk +10 -0
+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_PMUFW
+	$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"$(UBOOT_DL_DIR)/$(notdir $(UBOOT_ZYNQMP_PMUFW))", \
+	       $(@D)/.config)
+endef
+endif

What I thought would be ideal for me is to store my generated pmufw.bin file in our own local repo that is a BR2_EXTERNAL. I wanted to then just pass the path to this file using $(BR2_EXTERNAL_MY_REPO_PATH). But referencing a local file for something via *_EXTRA_DOWNLOADS doesn't seem to work when the supplied argument is a local path to the file. I don't know if I was doing something wrong or misunderstanding the dl-wrapper and other associated code. But I ended up modifying the changes here to look like this:

Quoted 4 lines
boot/uboot/uboot.mk +4 -0
+ifneq ($(UBOOT_ZYNQMP_PMUFW),)
+ifneq (file,$(firstword $(subst ://, ,$(UBOOT_ZYNQMP_PMUFW))))
+UBOOT_EXTRA_DOWNLOADS += $(UBOOT_ZYNQMP_PMUFW)
+BR_NO_CHECK_HASH_FOR += $(notdir $(UBOOT_ZYNQMP_PMUFW))

boot/uboot/uboot.mk endef

Quoted 10 lines
boot/uboot/uboot.mk +10 -0
+define UBOOT_ZYNQMP_KCONFIG_PMUFW
+	$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"$(UBOOT_DL_DIR)/$(notdir $(UBOOT_ZYNQMP_PMUFW))", \
+	       $(@D)/.config)
+endef
+else
+define UBOOT_ZYNQMP_KCONFIG_PMUFW
+	$(call KCONFIG_SET_OPT,CONFIG_PMUFW_INIT_FILE,"$(lastword $(subst ://, ,$(UBOOT_ZNYQMP_PMUFW)))", \
+	       $(@D)/.config)
+endef
+endif

Then I can set my BR2_TARGET_UBOOT_ZYNQMP_PMUFW value to "file://$(BR2_EXTERNAL_MY_REPO_PATH)/path/to/my/pmufw.bin" and it will work appropriately.

I'm not sure if that's best to put as part of this, so I guess I'm seeking input on that.

Quoted 11 lines
boot/uboot/uboot.mk +2 -0
+
 ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE)),)
 define UBOOT_ZYNQMP_KCONFIG_PSU_INIT
 	$(call KCONFIG_SET_OPT,CONFIG_XILINX_PS_INIT_FILE,"$(TOPDIR)/$(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE))", \
@@ -335,6 +346,7 @@ UBOOT_POST_INSTALL_IMAGES_HOOKS += UBOOT_CRC_ALTERA_SOCFPGA_IMAGE
 endif
 
 define UBOOT_KCONFIG_FIXUP_CMDS
+	$(UBOOT_ZYNQMP_KCONFIG_PMUFW)
 	$(UBOOT_ZYNQMP_KCONFIG_PSU_INIT)
 endef
#2 lore raw

PATCH v4 1/3 uboot: zynqmp: allow to use custom psu_init files

In reply to Joel Carlson

Hi Joel,

Quoted 6 lines · Joel Carlson

Hello,

I've been using the v3 form of your patches to get our Zynqmp board booting. This morning I upgraded our U-Boot from v2018.05 to v2018.07, and on my 2018.05 buildroot branch I removed the v3 patches and applied the v4 ones. I had a few issues with this patch.

Good to know this work is useful to somebody!

Thank you for your report, see below my comments.

Quoted 96 lines · Luca Ceresoli

<snip>

Quoted 79 lines

diff --git a/board/zynqmp/patches/uboot/0004-arm-arm64-zynq-zynqmp-pass-the-PS-init-file-as-a-kco.patch b/board/zynqmp/patches/uboot/0004-arm-arm64-zynq-zynqmp-pass-the-PS-init-file-as-a-kco.patch

new file mode 100644
index 000000000000..ab8108ee0c6a
--- /dev/null
+++
b/board/zynqmp/patches/uboot/0004-arm-arm64-zynq-zynqmp-pass-the-PS-init-file-as-a-kco.patch

(quoted diff) +4 -0
@@ -0,0 +1,175 @@
+From 4c9d54ab5a41d65000c8d249b6fb1b76056f1812 Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli<[email protected]>
+Date: Wed, 20 Jun 2018 12:11:50 +0200
+Subject: [PATCH] arm/arm64: zynq/zynqmp: pass the PS init file as a

kconfig
+ variable

(quoted diff) +52 -0
+
+U-Boot needs to link ps7_init_gpl.c on Zynq or psu_init_gpl.c on
+ZynqMP (PS init for short). The current logic to locate this file for
+both platforms is:
+
+ 1. if a board-specific file exists in
+??? board/xilinx/zynq[mp]/$(CONFIG_DEFAULT_DEVICE_TREE)/ps?_init_gpl.c
+??? then use it
+ 2. otherwise use board/xilinx/zynq/ps?_init_gpl.c
+
+In the latter case the file does not exist in the U-Boot sources and
+must be copied in the source tree from the outside before starting the
+build. This is typical when it is generated from Xilinx tools while
+developing a custom hardware. However making sure that a
+board-specific file is_not_? found (and used) requires some trickery
+such as removing or overwriting all PS init files (e.g.: the current
+meta-xilinx yocto layer [0]).
+
+This generates a few problems:
+
+ * if the source tree is shared among different out-of-tree builds,
+?? they will pollute (and potentially corrupt) each other
+ * the source tree cannot be read-only
+ * any buildsystem must add a command to copy the PS init file binary
+ * overwriting or deleting files in the source tree is ugly as hell
+
+Simplify usage by allowing to pass the path to the desired PS init
+file in kconfig variable XILINX_PS_INIT_FILE. It can be an absolute
+path or relative to $(srctree). If the variable is set, the
+user-specified file will always be used without being copied
+around. If the the variable is left empty, for backward compatibility
+fall back to the old behaviour.
+
+Since the issue is the same for Zynq and ZynqMP, add one kconfig
+variable in a common place and use it for both.
+
+Also use the new kconfig help text to document all the ways to give
+U-Boot the PS init file.
+
+Build-tested with all combinations of:
+ - platform: zynq or zynqmp
+ - PS init file: from XILINX_PS_INIT_FILE (absolute, relative path,
+?? non-existing), in-tree board-specific, in board/xilinx/zynq[mp]/
+ - building in-tree, in subdir, in other directory
+
+[0]https://github.com/Xilinx/meta-xilinx/blob/b2f74cc7fe5c4881589d5e440a17cb51fc66a7ab/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc#L9
 
+
+Signed-off-by: Luca Ceresoli<[email protected]>
+Cc: Albert Aribaud<[email protected]>
+Cc: Michal Simek<[email protected]>
+Cc: Nathan Rossi<[email protected]>
+Submitted upstream:https://patchwork.ozlabs.org/patch/932392/?

(slightly adapted to fix conflicts)

+---
+ arch/arm/Kconfig???????????? |? 1 +
+ board/xilinx/Kconfig???????? | 41

+++++++++++++++++++++++++++++++++++++++++
+ board/xilinx/zynq/Makefile?? | 10 +++++++++-
+ board/xilinx/zynqmp/Makefile | 10 +++++++++-
+ 4 files changed, 60 insertions(+), 2 deletions(-)
+ create mode 100644 board/xilinx/Kconfig

Review

Quoted 10 lines
(quoted diff) +10 -0
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 22234cde2ab6..e04979d0ef7e 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -1293,4 +1293,5 @@ source "board/technologic/ts4600/Kconfig"
+ source "board/vscom/baltos/Kconfig"
+ source "board/woodburn/Kconfig"
+ source "board/work-microwave/work_92105/Kconfig"
++source "board/xilinx/Kconfig"

This patch does not apply with U-Boot 2018.07 - I don't know which version of U-Boot it is desired to maintain compatibility against. But it was a pretty small change to make it apply again, just adding:

Quoted 2 lines
Quoted 1 line

source "board/xilinx/zynqmp/Kconfig"

below the line the patch adds.

Yes, IIRC that's the only relevant difference between this patch and the one that got applied (https://patchwork.ozlabs.org/patch/933198/).
However supporting a more recent version of U-Boot will probably require an extra work that I'd rather leave as a future improvement.

BTW, how are you building your PMU firmware?

Quoted 13 lines

<snip>

Quoted 12 lines
boot/uboot/uboot.mk +0 -0
index 03bd7ea743ed..e4571a6ccf9f 100644
@@ -274,6 +274,17 @@ define UBOOT_INSTALL_IMAGES_CMDS
 ????????????? $(BINARIES_DIR)/boot.scr)

? endef
? +ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y)

boot/uboot/uboot.mk +4 -0
+
+ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE)),)
+define UBOOT_ZYNQMP_KCONFIG_PSU_INIT
+??? $(call
Quoted 8 lines
Quoted 3 lines

KCONFIG_SET_OPT,CONFIG_XILINX_PS_INIT_FILE,"$(TOPDIR)/$(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE))", \
+?????????? $(@D)/.config)

I think you should get rid of the "$(TOPDIR)/" part and let the user specify it as part of BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE if needed. My psu_init files are in a path that I reference via BR2_EXTERNAL, so having $(TOPDIR) prepended messed up the path to my files.

Uhm, my mistake, as I've never user BR2_EXTERNAL I tend to forget to test it... Sorry about that.

Since the kconfig option we're setting here will be evaulated during the build process, which will happen in another directory ($O/build/uboot-*/), I chose to tranform that path to an absolute one using $TOPDIR.

But as you noticed this is not a correct solution. At first sight we should rather copy the file in a proper place (sysroot or $O/build/uboot-*/) and then point the kconfig option to that path. I'll have a look to this, as well as to your comments to patch 2.

Bye,

Signature · 1 line
Luca
#3 lore raw

PATCH v4 1/3 uboot: zynqmp: allow to use custom psu_init files

Hello,

I just want to note that I was initially setup for message digests on the mailing list (and am now set to get individual messages). I had to do some copying and pasting trying to make it look like I was replying to the original patch email, but it looks like I lost something such that patchwork doesn't append these email responses to it. So a link to the original just for the sake of relating things for other readers:
https://patchwork.ozlabs.org/patch/932962/

Quoted 11 lines · Luca Ceresoli

Hi Joel,

Quoted 6 lines · Joel Carlson

Hello,

I've been using the v3 form of your patches to get our Zynqmp board booting. This morning I upgraded our U-Boot from v2018.05 to v2018.07, and on my 2018.05 buildroot branch I removed the v3 patches and applied the v4 ones. I had a few issues with this patch.

Good to know this work is useful to somebody!

Very useful for anybody that wants to boot zynqmp without relying on Xilinx's workflow! I was very happy when I found your initial patches.

<snip>

Quoted 13 lines
Quoted 13 lines

Review

Quoted 9 lines
(quoted diff) +9 -0
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 22234cde2ab6..e04979d0ef7e 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -1293,4 +1293,5 @@ source "board/technologic/ts4600/Kconfig"
+ source "board/vscom/baltos/Kconfig"
+ source "board/woodburn/Kconfig"
+ source "board/work-microwave/work_92105/Kconfig"
++source "board/xilinx/Kconfig"

This patch does not apply with U-Boot 2018.07 - I don't know which version of U-Boot it is desired to maintain compatibility against. But it was a pretty small change to make it apply again, just adding:

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

source "board/xilinx/zynqmp/Kconfig"

below the line the patch adds.

Yes, IIRC that's the only relevant difference between this patch and the one that got applied (https://patchwork.ozlabs.org/patch/933198/).
However supporting a more recent version of U-Boot will probably require an extra work that I'd rather leave as a future improvement.

That's fair enough. Pretty easy for me to keep my own modified patch for 2018.07.

Quoted 1 line

BTW, how are you building your PMU firmware?

I'm actually using your zynqmp-pmufw-builder tool on github. =) With the changes:
- I check out the embeddedsw submodule to the xilinx-v2018.1 tag
- I had to then tweak the 0001 patch a little
- I modify build.sh to add some extra flags to reduce the size (or else it overflows its available memory - I got these flags from how Xilinx compiles it)
- I think my pm_cfg_obj.c is the default one from Xilinx for 2018.1

Quoted 31 lines
Quoted 14 lines

<snip>

Quoted 12 lines
boot/uboot/uboot.mk +4 -0
index 03bd7ea743ed..e4571a6ccf9f 100644
@@ -274,6 +274,17 @@ 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_FILE)),)
+define UBOOT_ZYNQMP_KCONFIG_PSU_INIT
+??? $(call
Quoted 8 lines
Quoted 3 lines

KCONFIG_SET_OPT,CONFIG_XILINX_PS_INIT_FILE,"$(TOPDIR)/$(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE))", \
+?????????? $(@D)/.config)

I think you should get rid of the "$(TOPDIR)/" part and let the user specify it as part of BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE if needed. My psu_init files are in a path that I reference via BR2_EXTERNAL, so having $(TOPDIR) prepended messed up the path to my files.

Uhm, my mistake, as I've never user BR2_EXTERNAL I tend to forget to test it... Sorry about that.

Since the kconfig option we're setting here will be evaulated during the build process, which will happen in another directory ($O/build/uboot-*/), I chose to tranform that path to an absolute one using $TOPDIR.

Quoted 4 lines

But as you noticed this is not a correct solution. At first sight we should rather copy the file in a proper place (sysroot or $O/build/uboot-*/) and then point the kconfig option to that path. I'll have a look to this, as well as to your comments to patch 2.

This did work for me using a $(BR2_EXTERNAL_MY_BSP_PATH) variable in the value once I simply removed '$(TOPDIR)'. Though I did not test using $(TOPDIR) within the variable value, but I think that should still work. But I suppose copying it into uboot's build folder might seem more appropriate than paths to elsewhere on the system.

#4 lore raw

PATCH v4 1/3 uboot: zynqmp: allow to use custom psu_init files

Hi Joel,

On 11/07/2018 04:48, Joel Carlson wrote:
[...]

Quoted 3 lines
Quoted 1 line

BTW, how are you building your PMU firmware?

I'm actually using your zynqmp-pmufw-builder tool on github. =)

Oh, cool! :)

Quoted 7 lines

With the changes:
- I check out the embeddedsw submodule to the xilinx-v2018.1 tag
- I had to then tweak the 0001 patch a little
- I modify build.sh to add some extra flags to reduce the size (or else it overflows its available memory - I got these flags from how Xilinx compiles it)
- I think my pm_cfg_obj.c is the default one from Xilinx for 2018.1

The changes you made to reduce the size and support more recent versions would be useful to other people, would you like to contribute them to zynqmp-pmufw-builder? This would ultimately improve the quality of ZynqMP support in Buildroot as well. As this is quite off topic here, feel free to just send me patches or a github PR, or t contact me directly for any question.

Quoted 35 lines
Quoted 30 lines
Quoted 13 lines

<snip>

Quoted 12 lines
boot/uboot/uboot.mk +0 -0
index 03bd7ea743ed..e4571a6ccf9f 100644
@@ -274,6 +274,17 @@ define UBOOT_INSTALL_IMAGES_CMDS
 ?????????????? $(BINARIES_DIR)/boot.scr)

?? endef
?? +ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y)

boot/uboot/uboot.mk +4 -0
+
+ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE)),)
+define UBOOT_ZYNQMP_KCONFIG_PSU_INIT
+??? $(call
Quoted 8 lines
Quoted 3 lines

KCONFIG_SET_OPT,CONFIG_XILINX_PS_INIT_FILE,"$(TOPDIR)/$(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE))", \
+?????????? $(@D)/.config)

I think you should get rid of the "$(TOPDIR)/" part and let the user specify it as part of BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE if needed. My psu_init files are in a path that I reference via BR2_EXTERNAL, so having $(TOPDIR) prepended messed up the path to my files.

Uhm, my mistake, as I've never user BR2_EXTERNAL I tend to forget to test it... Sorry about that.

Since the kconfig option we're setting here will be evaulated during the build process, which will happen in another directory ($O/build/uboot-*/), I chose to tranform that path to an absolute one using $TOPDIR.

Quoted 4 lines

But as you noticed this is not a correct solution. At first sight we should rather copy the file in a proper place (sysroot or $O/build/uboot-*/) and then point the kconfig option to that path. I'll have a look to this, as well as to your comments to patch 2.

Quoted 5 lines

This did work for me using a $(BR2_EXTERNAL_MY_BSP_PATH) variable in the value once I simply removed '$(TOPDIR)'. Though I did not test using $(TOPDIR) within the variable value, but I think that should still work. But I suppose copying it into uboot's build folder might seem more appropriate than paths to elsewhere on the system.

Well, perhaps using TOPDIR in the variable would work, but it would be rather ugly and different from other Buildroot settings. Copying looks like the best solution at the moment.

Regards,

Signature · 1 line
Luca