Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support
@ 2025-04-09 11:04 Neal Frager via buildroot
  2025-04-09 11:04 ` [Buildroot] [PATCH v3 2/3] board/versal: change pdi filename to boot.pdi Neal Frager via buildroot
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Neal Frager via buildroot @ 2025-04-09 11:04 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, brandon.maier, ju.o,
	thomas.petazzoni, Neal Frager, fabio.caccamo, romain.naour,
	michal.simek, arnout

AMD has created a new segmented configuration for Versal products.  It splits
the Vivado hardware design into two PDI files, one containing the minimal
required configuration for the DDR and booting the processors, and a second PDI
file which contains the rest of the FPGA design and can be loaded at run-time
via U-boot or Linux.

The file names generated when using the Vivado Segmented Configuration are as
follows:

<design>_boot.pdi - Minimal DDR and PS config for booting
<design>_pld.pdi - Remainder of FPGA design to be loaded at run-time

Since two PDI files will be included in the XSA file when using Segmented
Configuration, the xilinx-prebuilt package needs to be updated to support
this feature.

For Buildroot purposes, the <design>_boot.pdi is the file that needs to be
included in the boot.bin for booting the processors, so this patch checks
for a file named *boot*.pdi which will indicate that Segmented Configuration
is being used and will make sure to use the <design>_boot.pdi file and not
the <design>_pld.pdi file when generating the boot.bin image.

If no pdi files contain the word "boot" in the filename, it can be assumed
that Segmented Configuration is not being used, so the single file *.pdi
method is the appropriate one for this case, and this patch is thus
backwards compatible with prior designs not using Segmented Configuration.

Also, Segmented Configuration is going to become the default mode for Versal
products, so the xilinx-prebuilt github location will also soon have two PDI
files for each board.  For this reason, this patch is also handling Segmented
Configuration for files downloaded from the xilinx-prebuilt repo.

For further information about the AMD Segmented Configuration, please see the
github tutorial below.

https://github.com/Xilinx/Vivado-Design-Tutorials/tree/2024.2/Versal/Boot_and_Config/Segmented_Configuration

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
- $(@D) is not available in time for wildcard evaluation outside of shell
  script, so moved the wildcard functions into the install scripts
V2->V3:
- Moved if statement inside of $(INSTALL) commands to make the code easier
  to read.
- Changed wildcards to more specific name "*_boot.pdi".
- Changed pdi file permissions to 0644.
---
 boot/xilinx-prebuilt/xilinx-prebuilt.mk | 36 ++++++++++++++++++-------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/boot/xilinx-prebuilt/xilinx-prebuilt.mk b/boot/xilinx-prebuilt/xilinx-prebuilt.mk
index d0817d3cc7..4d1dfc5ca0 100644
--- a/boot/xilinx-prebuilt/xilinx-prebuilt.mk
+++ b/boot/xilinx-prebuilt/xilinx-prebuilt.mk
@@ -28,9 +28,6 @@ XILINX_PREBUILT_BOARD = $(call qstrip,$(BR2_TARGET_XILINX_PREBUILT_BOARD))
 XILINX_PREBUILT_BOARD_DIR = $(@D)/$(XILINX_PREBUILT_BOARD)-$(XILINX_PREBUILT_FAMILY)
 
 ifeq ($(BR2_TARGET_XILINX_PREBUILT_VERSAL),y)
-# We need the *.pdi glob, because the file has different names for the
-# different boards, but there is only one, and it has to be named
-# vpl_gen_fixed.pdi when installed.
 ifeq ($(BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA),y)
 XILINX_PREBUILT_PLM = $(@D)/pdi_files/gen_files/plm.elf
 # Unlike the psmfw.elf file for Xilinx development boards,
@@ -39,11 +36,33 @@ XILINX_PREBUILT_PLM = $(@D)/pdi_files/gen_files/plm.elf
 # so to support current and future AMD Vivado versions, the filename
 # psm*fw.elf is used.
 XILINX_PREBUILT_PSMFW = $(@D)/pdi_files/static_files/psm*fw.elf
-XILINX_PREBUILT_PDI = $(@D)/*.pdi
+# We need the *.pdi glob, because the file has different names for the
+# different boards, and it has to be named vpl_gen_fixed.pdi when installed.
+# If Segmented Configuration is used, there will be two pdi files and we need
+# the file that has "_boot.pdi" in the filename.
+define XILINX_PREBUILT_INSTALL_VERSAL_XSA_BOOT_PDI
+	$(INSTALL) -D -m 0644 \
+		$(if $(wildcard $(@D)/*_boot.pdi), \
+			$(@D)/*_boot.pdi, \
+			$(@D)/*.pdi \
+		) \
+		$(BINARIES_DIR)/vpl_gen_fixed.pdi
+endef
 else # BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA
 XILINX_PREBUILT_PLM = $(XILINX_PREBUILT_BOARD_DIR)/plm.elf
 XILINX_PREBUILT_PSMFW = $(XILINX_PREBUILT_BOARD_DIR)/psmfw.elf
-XILINX_PREBUILT_PDI = $(XILINX_PREBUILT_BOARD_DIR)/*.pdi
+# We need the *.pdi glob, because the file has different names for the
+# different boards, and it has to be named vpl_gen_fixed.pdi when installed.
+# If Segmented Configuration is used, there will be two pdi files and we need
+# the file that has "_boot.pdi" in the filename.
+define XILINX_PREBUILT_INSTALL_VERSAL_BOOT_PDI
+	$(INSTALL) -D -m 0644 \
+		$(if $(wildcard $(XILINX_PREBUILT_BOARD_DIR)/*_boot.pdi), \
+			$(XILINX_PREBUILT_BOARD_DIR)/*_boot.pdi, \
+			$(XILINX_PREBUILT_BOARD_DIR)/*.pdi \
+		) \
+		$(BINARIES_DIR)/vpl_gen_fixed.pdi
+endef
 endif # BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA
 
 ifneq ($(BR2_TARGET_XILINX_EMBEDDEDSW_VERSAL_PLM),y)
@@ -60,10 +79,6 @@ define XILINX_PREBUILT_INSTALL_VERSAL_PSMFW
 endef
 endif # !BR2_TARGET_XILINX_EMBEDDEDSW_VERSAL_PSMFW
 
-define XILINX_PREBUILT_INSTALL_VERSAL_PDI
-	$(INSTALL) -D -m 0755 $(XILINX_PREBUILT_PDI) \
-		$(BINARIES_DIR)/vpl_gen_fixed.pdi
-endef
 else # BR2_TARGET_XILINX_PREBUILT_VERSAL
 ifneq ($(BR2_TARGET_XILINX_EMBEDDEDSW_ZYNQMP_PMUFW),y)
 define XILINX_PREBUILT_INSTALL_ZYNQMP_PMUFW
@@ -76,7 +91,8 @@ endif # BR2_TARGET_XILINX_PREBUILT_VERSAL
 define XILINX_PREBUILT_INSTALL_IMAGES_CMDS
 	$(XILINX_PREBUILT_INSTALL_VERSAL_PLM)
 	$(XILINX_PREBUILT_INSTALL_VERSAL_PSMFW)
-	$(XILINX_PREBUILT_INSTALL_VERSAL_PDI)
+	$(XILINX_PREBUILT_INSTALL_VERSAL_BOOT_PDI)
+	$(XILINX_PREBUILT_INSTALL_VERSAL_XSA_BOOT_PDI)
 	$(XILINX_PREBUILT_INSTALL_ZYNQMP_PMUFW)
 endef
 
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/3] board/versal: change pdi filename to boot.pdi
  2025-04-09 11:04 [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support Neal Frager via buildroot
@ 2025-04-09 11:04 ` Neal Frager via buildroot
  2025-05-16  8:13   ` Luca Ceresoli via buildroot
  2025-04-09 11:04 ` [Buildroot] [PATCH v3 3/3] boot/xilinx-prebuilt: install pld.pdi to target Neal Frager via buildroot
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Neal Frager via buildroot @ 2025-04-09 11:04 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, brandon.maier, ju.o,
	thomas.petazzoni, Neal Frager, fabio.caccamo, romain.naour,
	michal.simek, arnout

With the Segmented Configuration, the Versal PDI files will have new names:
<design>_boot.pdi - Minimal DDR and PS config for booting
<design>_pld.pdi - Remainder of FPGA design to be loaded at run-time

Since this will be the new default, this patch aligns the Buildroot file
naming by replacing the obscure vpl_gen_fixed.pdi filename with a simpler
boot.pdi filename.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
- Rebased due to changes in first patch of series
V2->V3:
- Rebased due to changes in first patch of series
---
 board/versal/post-image.sh              | 2 +-
 boot/xilinx-prebuilt/xilinx-prebuilt.mk | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/board/versal/post-image.sh b/board/versal/post-image.sh
index 22367d5028..b5ce2e3f0c 100755
--- a/board/versal/post-image.sh
+++ b/board/versal/post-image.sh
@@ -17,7 +17,7 @@ cat <<-__HEADER_EOF > "${BINARIES_DIR}/bootgen.bif"
 	the_ROM_image:
 	{
 	  image {
-	    { type=bootimage, file=${BINARIES_DIR}/vpl_gen_fixed.pdi }
+	    { type=bootimage, file=${BINARIES_DIR}/boot.pdi }
 	    { type=bootloader, file=${BINARIES_DIR}/plm.elf }
 	    { core=psm, file=${BINARIES_DIR}/psmfw.elf }
 	  }
diff --git a/boot/xilinx-prebuilt/xilinx-prebuilt.mk b/boot/xilinx-prebuilt/xilinx-prebuilt.mk
index 4d1dfc5ca0..05dc9aebe8 100644
--- a/boot/xilinx-prebuilt/xilinx-prebuilt.mk
+++ b/boot/xilinx-prebuilt/xilinx-prebuilt.mk
@@ -37,7 +37,7 @@ XILINX_PREBUILT_PLM = $(@D)/pdi_files/gen_files/plm.elf
 # psm*fw.elf is used.
 XILINX_PREBUILT_PSMFW = $(@D)/pdi_files/static_files/psm*fw.elf
 # We need the *.pdi glob, because the file has different names for the
-# different boards, and it has to be named vpl_gen_fixed.pdi when installed.
+# different boards, and it has to be named boot.pdi when installed.
 # If Segmented Configuration is used, there will be two pdi files and we need
 # the file that has "_boot.pdi" in the filename.
 define XILINX_PREBUILT_INSTALL_VERSAL_XSA_BOOT_PDI
@@ -46,13 +46,13 @@ define XILINX_PREBUILT_INSTALL_VERSAL_XSA_BOOT_PDI
 			$(@D)/*_boot.pdi, \
 			$(@D)/*.pdi \
 		) \
-		$(BINARIES_DIR)/vpl_gen_fixed.pdi
+		$(BINARIES_DIR)/boot.pdi
 endef
 else # BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA
 XILINX_PREBUILT_PLM = $(XILINX_PREBUILT_BOARD_DIR)/plm.elf
 XILINX_PREBUILT_PSMFW = $(XILINX_PREBUILT_BOARD_DIR)/psmfw.elf
 # We need the *.pdi glob, because the file has different names for the
-# different boards, and it has to be named vpl_gen_fixed.pdi when installed.
+# different boards, and it has to be named boot.pdi when installed.
 # If Segmented Configuration is used, there will be two pdi files and we need
 # the file that has "_boot.pdi" in the filename.
 define XILINX_PREBUILT_INSTALL_VERSAL_BOOT_PDI
@@ -61,7 +61,7 @@ define XILINX_PREBUILT_INSTALL_VERSAL_BOOT_PDI
 			$(XILINX_PREBUILT_BOARD_DIR)/*_boot.pdi, \
 			$(XILINX_PREBUILT_BOARD_DIR)/*.pdi \
 		) \
-		$(BINARIES_DIR)/vpl_gen_fixed.pdi
+		$(BINARIES_DIR)/boot.pdi
 endef
 endif # BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA
 
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 3/3] boot/xilinx-prebuilt: install pld.pdi to target
  2025-04-09 11:04 [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support Neal Frager via buildroot
  2025-04-09 11:04 ` [Buildroot] [PATCH v3 2/3] board/versal: change pdi filename to boot.pdi Neal Frager via buildroot
@ 2025-04-09 11:04 ` Neal Frager via buildroot
  2025-05-16  8:13   ` Luca Ceresoli via buildroot
  2025-05-13 10:32 ` [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support Frager, Neal via buildroot
  2025-05-16  8:13 ` Luca Ceresoli via buildroot
  3 siblings, 1 reply; 8+ messages in thread
From: Neal Frager via buildroot @ 2025-04-09 11:04 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, brandon.maier, ju.o,
	thomas.petazzoni, Neal Frager, fabio.caccamo, romain.naour,
	michal.simek, arnout

With the Versal Segmented Configuration, it is possible to load a PL bitstream
at run-time using the Linux fpgautil application.  Whenever Segmented
Configuration is used, both the boot.pdi and pld.pdi files will be available
to Buildroot.  For this reason, this patch improves the user experience by
installing the pld.pdi file to the target file system for run-time loading
whenever Versal Segemented Configuration is used.

If the fpgautil application is available in the target file system, it can
be used for loading the pld.pdi using the target command below.

fpgautil -b /lib/firmware/xilinx/*_pld.pdi

The source code for the fpgautil application can be found here:
https://github.com/Xilinx/meta-xilinx/blob/master/meta-xilinx-core/recipes-bsp/fpga-manager-script/files/fpgautil.c

Along with usage details:
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1188397412/Solution+Versal+PL+Programming

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
- New to patch series
V2->V3:
- Changed wildcards to more specific name "*_pld.pdi".
- Changed install directory for _pld.pdi to $(TARGET_DIR)/lib/firmware/xilinx
  to match Yocto default location.
- Changed pdi file permissions to 0644.
---
 boot/xilinx-prebuilt/xilinx-prebuilt.mk | 26 ++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/boot/xilinx-prebuilt/xilinx-prebuilt.mk b/boot/xilinx-prebuilt/xilinx-prebuilt.mk
index 05dc9aebe8..decc54b136 100644
--- a/boot/xilinx-prebuilt/xilinx-prebuilt.mk
+++ b/boot/xilinx-prebuilt/xilinx-prebuilt.mk
@@ -19,7 +19,6 @@ XILINX_PREBUILT_LICENSE = MIT
 XILINX_PREBUILT_LICENSE_FILES = LICENSE
 endif # BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA
 
-XILINX_PREBUILT_INSTALL_TARGET = NO
 XILINX_PREBUILT_INSTALL_IMAGES = YES
 
 XILINX_PREBUILT_FAMILY = $(call qstrip,$(BR2_TARGET_XILINX_PREBUILT_FAMILY))
@@ -48,6 +47,16 @@ define XILINX_PREBUILT_INSTALL_VERSAL_XSA_BOOT_PDI
 		) \
 		$(BINARIES_DIR)/boot.pdi
 endef
+
+# Install pld.pdi in target file system for run-time loading when using
+# Versal Segmented Configuration.
+define XILINX_PREBUILT_INSTALL_VERSAL_XSA_PLD_PDI
+	$(if $(wildcard $(@D)/*_pld.pdi),
+		mkdir -p $(TARGET_DIR)/lib/firmware/xilinx && \
+		$(INSTALL) -D -m 0644 $(@D)/*_pld.pdi \
+			$(TARGET_DIR)/lib/firmware/xilinx
+	)
+endef
 else # BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA
 XILINX_PREBUILT_PLM = $(XILINX_PREBUILT_BOARD_DIR)/plm.elf
 XILINX_PREBUILT_PSMFW = $(XILINX_PREBUILT_BOARD_DIR)/psmfw.elf
@@ -63,6 +72,16 @@ define XILINX_PREBUILT_INSTALL_VERSAL_BOOT_PDI
 		) \
 		$(BINARIES_DIR)/boot.pdi
 endef
+
+# Install pld.pdi in target file system for run-time loading when using
+# Segmented Configuration.
+define XILINX_PREBUILT_INSTALL_VERSAL_PLD_PDI
+	$(if $(wildcard $(XILINX_PREBUILT_BOARD_DIR)/*_pld.pdi),
+		mkdir -p $(TARGET_DIR)/lib/firmware/xilinx && \
+		$(INSTALL) -D -m 0644 $(XILINX_PREBUILT_BOARD_DIR)/*_pld.pdi \
+			$(TARGET_DIR)/lib/firmware/xilinx
+	)
+endef
 endif # BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA
 
 ifneq ($(BR2_TARGET_XILINX_EMBEDDEDSW_VERSAL_PLM),y)
@@ -96,4 +115,9 @@ define XILINX_PREBUILT_INSTALL_IMAGES_CMDS
 	$(XILINX_PREBUILT_INSTALL_ZYNQMP_PMUFW)
 endef
 
+define XILINX_PREBUILT_INSTALL_TARGET_CMDS
+	$(XILINX_PREBUILT_INSTALL_VERSAL_PLD_PDI)
+	$(XILINX_PREBUILT_INSTALL_VERSAL_XSA_PLD_PDI)
+endef
+
 $(eval $(generic-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support
  2025-04-09 11:04 [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support Neal Frager via buildroot
  2025-04-09 11:04 ` [Buildroot] [PATCH v3 2/3] board/versal: change pdi filename to boot.pdi Neal Frager via buildroot
  2025-04-09 11:04 ` [Buildroot] [PATCH v3 3/3] boot/xilinx-prebuilt: install pld.pdi to target Neal Frager via buildroot
@ 2025-05-13 10:32 ` Frager, Neal via buildroot
  2025-05-16  8:13 ` Luca Ceresoli via buildroot
  3 siblings, 0 replies; 8+ messages in thread
From: Frager, Neal via buildroot @ 2025-05-13 10:32 UTC (permalink / raw)
  To: buildroot@buildroot.org
  Cc: Erkiaga Elorza, Ibai, luca.ceresoli@bootlin.com,
	brandon.maier@collins.com, ju.o@free.fr,
	thomas.petazzoni@bootlin.com, Caccamo, Fabio,
	romain.naour@smile.fr, Simek, Michal, arnout@mind.be

[AMD Official Use Only - AMD Internal Distribution Only]

Hello everyone,

Just a friendly reminder for this patch set...

> AMD has created a new segmented configuration for Versal products.  It splits
> the Vivado hardware design into two PDI files, one containing the minimal
> required configuration for the DDR and booting the processors, and a second PDI
> file which contains the rest of the FPGA design and can be loaded at run-time
> via U-boot or Linux.

> The file names generated when using the Vivado Segmented Configuration are as
> follows:

> <design>_boot.pdi - Minimal DDR and PS config for booting
> <design>_pld.pdi - Remainder of FPGA design to be loaded at run-time

> Since two PDI files will be included in the XSA file when using Segmented
> Configuration, the xilinx-prebuilt package needs to be updated to support
> this feature.

> For Buildroot purposes, the <design>_boot.pdi is the file that needs to be
> included in the boot.bin for booting the processors, so this patch checks
> for a file named *boot*.pdi which will indicate that Segmented Configuration
> is being used and will make sure to use the <design>_boot.pdi file and not
> the <design>_pld.pdi file when generating the boot.bin image.

> If no pdi files contain the word "boot" in the filename, it can be assumed
> that Segmented Configuration is not being used, so the single file *.pdi
> method is the appropriate one for this case, and this patch is thus
> backwards compatible with prior designs not using Segmented Configuration.

>Also, Segmented Configuration is going to become the default mode for Versal
> products, so the xilinx-prebuilt github location will also soon have two PDI
> files for each board.  For this reason, this patch is also handling Segmented
> Configuration for files downloaded from the xilinx-prebuilt repo.

> For further information about the AMD Segmented Configuration, please see the
> github tutorial below.

> https://github.com/Xilinx/Vivado-Design-Tutorials/tree/2024.2/Versal/Boot_and_Config/Segmented_Configuration

> Signed-off-by: Neal Frager <neal.frager@amd.com>

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support
  2025-04-09 11:04 [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support Neal Frager via buildroot
                   ` (2 preceding siblings ...)
  2025-05-13 10:32 ` [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support Frager, Neal via buildroot
@ 2025-05-16  8:13 ` Luca Ceresoli via buildroot
  3 siblings, 0 replies; 8+ messages in thread
From: Luca Ceresoli via buildroot @ 2025-05-16  8:13 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, arnout, brandon.maier, ju.o,
	thomas.petazzoni, buildroot, fabio.caccamo, romain.naour,
	michal.simek

Hello Neal,

On Wed, 9 Apr 2025 12:04:53 +0100
Neal Frager <neal.frager@amd.com> wrote:

> AMD has created a new segmented configuration for Versal products.  It splits
> the Vivado hardware design into two PDI files, one containing the minimal
> required configuration for the DDR and booting the processors, and a second PDI
> file which contains the rest of the FPGA design and can be loaded at run-time
> via U-boot or Linux.
> 
> The file names generated when using the Vivado Segmented Configuration are as
> follows:
> 
> <design>_boot.pdi - Minimal DDR and PS config for booting
> <design>_pld.pdi - Remainder of FPGA design to be loaded at run-time
> 
> Since two PDI files will be included in the XSA file when using Segmented
> Configuration, the xilinx-prebuilt package needs to be updated to support
> this feature.
> 
> For Buildroot purposes, the <design>_boot.pdi is the file that needs to be
> included in the boot.bin for booting the processors, so this patch checks
> for a file named *boot*.pdi which will indicate that Segmented Configuration
> is being used and will make sure to use the <design>_boot.pdi file and not
> the <design>_pld.pdi file when generating the boot.bin image.
> 
> If no pdi files contain the word "boot" in the filename, it can be assumed
> that Segmented Configuration is not being used, so the single file *.pdi
> method is the appropriate one for this case, and this patch is thus
> backwards compatible with prior designs not using Segmented Configuration.
> 
> Also, Segmented Configuration is going to become the default mode for Versal
> products, so the xilinx-prebuilt github location will also soon have two PDI
> files for each board.  For this reason, this patch is also handling Segmented
> Configuration for files downloaded from the xilinx-prebuilt repo.
> 
> For further information about the AMD Segmented Configuration, please see the
> github tutorial below.
> 
> https://github.com/Xilinx/Vivado-Design-Tutorials/tree/2024.2/Versal/Boot_and_Config/Segmented_Configuration
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
> V1->V2:
> - $(@D) is not available in time for wildcard evaluation outside of shell
>   script, so moved the wildcard functions into the install scripts
> V2->V3:
> - Moved if statement inside of $(INSTALL) commands to make the code easier
>   to read.
> - Changed wildcards to more specific name "*_boot.pdi".
> - Changed pdi file permissions to 0644.
> ---
>  boot/xilinx-prebuilt/xilinx-prebuilt.mk | 36 ++++++++++++++++++-------
>  1 file changed, 26 insertions(+), 10 deletions(-)
> 
> diff --git a/boot/xilinx-prebuilt/xilinx-prebuilt.mk b/boot/xilinx-prebuilt/xilinx-prebuilt.mk
> index d0817d3cc7..4d1dfc5ca0 100644
> --- a/boot/xilinx-prebuilt/xilinx-prebuilt.mk
> +++ b/boot/xilinx-prebuilt/xilinx-prebuilt.mk
> @@ -28,9 +28,6 @@ XILINX_PREBUILT_BOARD = $(call qstrip,$(BR2_TARGET_XILINX_PREBUILT_BOARD))
>  XILINX_PREBUILT_BOARD_DIR = $(@D)/$(XILINX_PREBUILT_BOARD)-$(XILINX_PREBUILT_FAMILY)
>  
>  ifeq ($(BR2_TARGET_XILINX_PREBUILT_VERSAL),y)
> -# We need the *.pdi glob, because the file has different names for the
> -# different boards, but there is only one, and it has to be named
> -# vpl_gen_fixed.pdi when installed.
>  ifeq ($(BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA),y)
>  XILINX_PREBUILT_PLM = $(@D)/pdi_files/gen_files/plm.elf
>  # Unlike the psmfw.elf file for Xilinx development boards,
> @@ -39,11 +36,33 @@ XILINX_PREBUILT_PLM = $(@D)/pdi_files/gen_files/plm.elf
>  # so to support current and future AMD Vivado versions, the filename
>  # psm*fw.elf is used.
>  XILINX_PREBUILT_PSMFW = $(@D)/pdi_files/static_files/psm*fw.elf
> -XILINX_PREBUILT_PDI = $(@D)/*.pdi
> +# We need the *.pdi glob, because the file has different names for the
> +# different boards, and it has to be named vpl_gen_fixed.pdi when installed.
> +# If Segmented Configuration is used, there will be two pdi files and we need
> +# the file that has "_boot.pdi" in the filename.
> +define XILINX_PREBUILT_INSTALL_VERSAL_XSA_BOOT_PDI
> +	$(INSTALL) -D -m 0644 \

I still think fixing the permissions from 755 to 644 should have been a
separate, initial patch, because it is a fix. This would allow for
example to cherry-pick the fix on a stable branch, without adding the
new feature.

If maintainers are OK with this patch as is, I'm OK to apply it because
the "bug" probably does not create practical issues. But if you send a
v4 please split it.

Otherwise looks good:
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v3 3/3] boot/xilinx-prebuilt: install pld.pdi to target
  2025-04-09 11:04 ` [Buildroot] [PATCH v3 3/3] boot/xilinx-prebuilt: install pld.pdi to target Neal Frager via buildroot
@ 2025-05-16  8:13   ` Luca Ceresoli via buildroot
  2025-05-17  9:56     ` Frager, Neal via buildroot
  0 siblings, 1 reply; 8+ messages in thread
From: Luca Ceresoli via buildroot @ 2025-05-16  8:13 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, arnout, brandon.maier, ju.o,
	thomas.petazzoni, buildroot, fabio.caccamo, romain.naour,
	michal.simek

On Wed, 9 Apr 2025 12:04:55 +0100
Neal Frager <neal.frager@amd.com> wrote:

> With the Versal Segmented Configuration, it is possible to load a PL bitstream
> at run-time using the Linux fpgautil application.  Whenever Segmented
> Configuration is used, both the boot.pdi and pld.pdi files will be available
> to Buildroot.  For this reason, this patch improves the user experience by
> installing the pld.pdi file to the target file system for run-time loading
> whenever Versal Segemented Configuration is used.
> 
> If the fpgautil application is available in the target file system, it can
> be used for loading the pld.pdi using the target command below.
> 
> fpgautil -b /lib/firmware/xilinx/*_pld.pdi
> 
> The source code for the fpgautil application can be found here:
> https://github.com/Xilinx/meta-xilinx/blob/master/meta-xilinx-core/recipes-bsp/fpga-manager-script/files/fpgautil.c
> 
> Along with usage details:
> https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1188397412/Solution+Versal+PL+Programming
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>

You are proposing to install this file unconditionally. Aren't there
use cases where this is not desired? Also, how large can this file be
for a complex FPGA design?

I think a Kconfig boolean to enable this installation (defaulting no
'n') should be added.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v3 2/3] board/versal: change pdi filename to boot.pdi
  2025-04-09 11:04 ` [Buildroot] [PATCH v3 2/3] board/versal: change pdi filename to boot.pdi Neal Frager via buildroot
@ 2025-05-16  8:13   ` Luca Ceresoli via buildroot
  0 siblings, 0 replies; 8+ messages in thread
From: Luca Ceresoli via buildroot @ 2025-05-16  8:13 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, arnout, brandon.maier, ju.o,
	thomas.petazzoni, buildroot, fabio.caccamo, romain.naour,
	michal.simek

On Wed, 9 Apr 2025 12:04:54 +0100
Neal Frager <neal.frager@amd.com> wrote:

> With the Segmented Configuration, the Versal PDI files will have new names:
> <design>_boot.pdi - Minimal DDR and PS config for booting
> <design>_pld.pdi - Remainder of FPGA design to be loaded at run-time
> 
> Since this will be the new default, this patch aligns the Buildroot file
> naming by replacing the obscure vpl_gen_fixed.pdi filename with a simpler
> boot.pdi filename.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Buildroot] [PATCH v3 3/3] boot/xilinx-prebuilt: install pld.pdi to target
  2025-05-16  8:13   ` Luca Ceresoli via buildroot
@ 2025-05-17  9:56     ` Frager, Neal via buildroot
  0 siblings, 0 replies; 8+ messages in thread
From: Frager, Neal via buildroot @ 2025-05-17  9:56 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: Erkiaga Elorza, Ibai, arnout@mind.be, brandon.maier@collins.com,
	ju.o@free.fr, thomas.petazzoni@bootlin.com,
	buildroot@buildroot.org, Caccamo, Fabio, romain.naour@smile.fr,
	Simek, Michal

[AMD Official Use Only - AMD Internal Distribution Only]

Hello Luca,

> With the Versal Segmented Configuration, it is possible to load a PL bitstream
> at run-time using the Linux fpgautil application.  Whenever Segmented
> Configuration is used, both the boot.pdi and pld.pdi files will be available
> to Buildroot.  For this reason, this patch improves the user experience by
> installing the pld.pdi file to the target file system for run-time loading
> whenever Versal Segemented Configuration is used.
>
> If the fpgautil application is available in the target file system, it can
> be used for loading the pld.pdi using the target command below.
>
> fpgautil -b /lib/firmware/xilinx/*_pld.pdi
>
> The source code for the fpgautil application can be found here:
> https://github.com/Xilinx/meta-xilinx/blob/master/meta-xilinx-core/recipes-bsp/fpga-manager-script/files/fpgautil.c
>
> Along with usage details:
> https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1188397412/Solution+Versal+PL+Programming
>
> Signed-off-by: Neal Frager <neal.frager@amd.com>

> You are proposing to install this file unconditionally. Aren't there
> use cases where this is not desired? Also, how large can this file be
> for a complex FPGA design?

> I think a Kconfig boolean to enable this installation (defaulting no
> 'n') should be added.

You are right that larger Versal devices may have pld.pdi files that are
several MB in size.  Users may not always want an image this large to be
installed automatically to their target root file system.

I will add a Kconfig boolean for enabling this installation when it is wanted.

Thank you for the thorough review!

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-05-17  9:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09 11:04 [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support Neal Frager via buildroot
2025-04-09 11:04 ` [Buildroot] [PATCH v3 2/3] board/versal: change pdi filename to boot.pdi Neal Frager via buildroot
2025-05-16  8:13   ` Luca Ceresoli via buildroot
2025-04-09 11:04 ` [Buildroot] [PATCH v3 3/3] boot/xilinx-prebuilt: install pld.pdi to target Neal Frager via buildroot
2025-05-16  8:13   ` Luca Ceresoli via buildroot
2025-05-17  9:56     ` Frager, Neal via buildroot
2025-05-13 10:32 ` [Buildroot] [PATCH v3 1/3] boot/xilinx-prebuilt: add segmented config support Frager, Neal via buildroot
2025-05-16  8:13 ` Luca Ceresoli via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox