boot/xilinx-prebuilt: install pld.pdi to target

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>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
This commit is contained in:
Neal Frager
2025-05-19 09:36:31 +01:00
committed by Julien Olivain
parent 3ee8569037
commit 526522a021
2 changed files with 38 additions and 1 deletions

View File

@@ -63,6 +63,15 @@ config BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA_LOCATION
endif # BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA
config BR2_TARGET_XILINX_PREBUILT_VERSAL_PLD_PDI
bool "install versal pld.pdi"
depends on BR2_TARGET_XILINX_PREBUILT_VERSAL
help
When using the Versal Segmented Configuration, there is a
pld.pdi file containing the FPGA bitstream which can be
loaded at run-time. By enabling this option, the pld.pdi
will be installed to the target /lib/firmware/xilinx dir.
config BR2_TARGET_XILINX_PREBUILT_FAMILY
string
default "zynqmp" if BR2_TARGET_XILINX_PREBUILT_ZYNQMP

View File

@@ -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,18 @@ define XILINX_PREBUILT_INSTALL_VERSAL_XSA_BOOT_PDI
) \
$(BINARIES_DIR)/boot.pdi
endef
ifeq ($(BR2_TARGET_XILINX_PREBUILT_VERSAL_PLD_PDI),y)
# 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
endif # BR2_TARGET_XILINX_PREBUILT_VERSAL_PLD_PDI
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 +74,18 @@ define XILINX_PREBUILT_INSTALL_VERSAL_BOOT_PDI
) \
$(BINARIES_DIR)/boot.pdi
endef
ifeq ($(BR2_TARGET_XILINX_PREBUILT_VERSAL_PLD_PDI),y)
# Install pld.pdi in target file system for run-time loading when using
# Versal 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_PLD_PDI
endif # BR2_TARGET_XILINX_PREBUILT_VERSAL_XSA
ifneq ($(BR2_TARGET_XILINX_EMBEDDEDSW_VERSAL_PLM),y)
@@ -96,4 +119,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))