Skip to contentSkip to conversation

loadpdi related code changes.

PATCH Applied Prasad Kummari 2 participants 5 messages Mar 27, 2025 – Apr 8, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover loadpdi related code changes.

Prasad Kummari (3):
arm64: versal-net: Add PL bit stream load support
arm64: versal2: Add PL bit stream load support
xilinx: versal: remove versal loadpdi command

 arch/arm/mach-versal-net/Kconfig         |   1 -
 arch/arm/mach-versal/Kconfig             |   1 -
 arch/arm/mach-versal2/Kconfig            |   1 -
 board/amd/versal2/Kconfig                |  16 ----
 board/amd/versal2/Makefile               |   1 -
 board/amd/versal2/board.c                |  13 +++
 board/amd/versal2/cmds.c                 |  80 ------------------
 board/xilinx/versal-net/Kconfig          |  17 ----
 board/xilinx/versal-net/Makefile         |   1 -
 board/xilinx/versal-net/board.c          |  12 +++
 board/xilinx/versal-net/cmds.c           |  80 ------------------
 board/xilinx/versal/Kconfig              |  14 ----
 board/xilinx/versal/Makefile             |   1 -
 board/xilinx/versal/cmds.c               | 101 -----------------------
 configs/amd_versal2_virt_defconfig       |   2 +
 configs/xilinx_versal_net_virt_defconfig |   2 +
 drivers/fpga/versalpl.c                  |  11 ++-
 include/xilinx.h                         |   2 +
 18 files changed, 40 insertions(+), 316 deletions(-)
 delete mode 100644 board/amd/versal2/Kconfig
 delete mode 100644 board/amd/versal2/cmds.c
 delete mode 100644 board/xilinx/versal-net/Kconfig
 delete mode 100644 board/xilinx/versal-net/cmds.c
 delete mode 100644 board/xilinx/versal/Kconfig
 delete mode 100644 board/xilinx/versal/cmds.c
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/3 arm64: versal-net: Add PL bit stream load support

Add support for loading the secure & non-secure pdi images and PL bitstream on the Versal NET platform. The FPGA driver is enabled to load the bitstream in PDI format on the AMD Versal NET device. PDI is the new programmable device image format for Versal NET, and the bitstream for the Versal NET platform is generated exclusively in this format.

The source code for the versalnet loadpdi command and the CONFIG_CMD_VERSAL_NET configuration has been removed. It now utilizes the fpga load <dev> <address> <length> command to load secure & non-secure pdi images.

---
 arch/arm/mach-versal-net/Kconfig         |  1 -
 board/xilinx/versal-net/Kconfig          | 17 -----
 board/xilinx/versal-net/Makefile         |  1 -
 board/xilinx/versal-net/board.c          | 12 ++++
 board/xilinx/versal-net/cmds.c           | 80 ------------------------
 configs/xilinx_versal_net_virt_defconfig |  2 +
 include/xilinx.h                         |  1 +
 7 files changed, 15 insertions(+), 99 deletions(-)
 delete mode 100644 board/xilinx/versal-net/Kconfig
 delete mode 100644 board/xilinx/versal-net/cmds.c
arch/arm/mach-versal-net/Kconfig +0 -1
index 54fb93aeb53..7def7b9139a 100644
@@ -45,6 +45,5 @@ config ZYNQ_SDHCI_MAX_FREQ
 	default 200000000
 
 source "board/xilinx/Kconfig"
-source "board/xilinx/versal-net/Kconfig"
 
 endif
board/xilinx/versal-net/Kconfig deleted +0 -17
deleted file mode 100644
index 2484429d3cb..00000000000
@@ -1,17 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Copyright (C) 2020 - 2022, Xilinx, Inc.
-# Copyright (C) 2022, Advanced Micro Devices, Inc.
-#
-
-if ARCH_VERSAL_NET
-
-config CMD_VERSAL_NET
-	bool "Enable Versal NET specific commands"
-	default y
-	depends on ZYNQMP_FIRMWARE
-	help
-	  Select this to enable Versal NET specific commands.
-	  Commands like versalnet loadpdi are enabled by this.
-
-endif
board/xilinx/versal-net/Makefile +0 -1
index f9ff07c11c6..2008d4e231c 100644
@@ -7,4 +7,3 @@
 #
 
 obj-y	:= board.o
-obj-$(CONFIG_CMD_VERSAL_NET)	+= cmds.o
board/xilinx/versal-net/board.c +12 -0
index 4d5913cff1d..870877fb4a8 100644
@@ -21,6 +21,7 @@
 #include <asm/arch/sys_proto.h>
 #include <dm/device.h>
 #include <dm/uclass.h>
+#include <versalpl.h>
 #include "../common/board.h"
 
 #include <linux/bitfield.h>
@@ -29,10 +30,21 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if defined(CONFIG_FPGA_VERSALPL)
+static xilinx_desc versalpl = {
+	xilinx_versal_net, csu_dma, 1, &versal_op, 0, &versal_op, NULL,
+	FPGA_LEGACY
+};
+#endif
+
 int board_init(void)
 {
 	printf("EL Level:\tEL%d\n", current_el());
 
+#if defined(CONFIG_FPGA_VERSALPL)
+	fpga_init();
+	fpga_add(fpga_xilinx, &versalpl);
+#endif
 	return 0;
 }
 
board/xilinx/versal-net/cmds.c deleted +0 -80

80 lines not on this page · raw message

configs/xilinx_versal_net_virt_defconfig +2 -0
index 1604b5915db..4da31b5c119 100644
@@ -73,6 +73,8 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SIMPLE_PM_BUS=y
 CONFIG_CLK_VERSAL=y
 CONFIG_DFU_RAM=y
+CONFIG_FPGA_XILINX=y
+CONFIG_FPGA_VERSALPL=y
 CONFIG_ARM_FFA_TRANSPORT=y
 CONFIG_ZYNQ_GPIO=y
 CONFIG_DM_I2C=y
include/xilinx.h +1 -0
index e4e29797988..2b4d6c9bb06 100644
@@ -34,6 +34,7 @@ typedef enum {			/* typedef xilinx_family */
 	xilinx_zynq,		/* Zynq Family */
 	xilinx_zynqmp,		/* ZynqMP Family */
 	xilinx_versal,		/* Versal Family */
+	xilinx_versal_net,	/* Versal NET Family */
 	max_xilinx_type		/* insert all new types before this */
 } xilinx_family;		/* end, typedef xilinx_family */
 
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/3 arm64: versal2: Add PL bit stream load support

In reply to Prasad Kummari

Add support for loading the secure & non-secure pdi images and PL bitstream on the Versal Gen2 platform. The FPGA driver is enabled to load the bitstream in PDI format on the AMD Versal Gen2 device. PDI is the new programmable device image format for Versal Gen2, and the bitstream for the Versal Gen2 platform is generated exclusively in this format.

With the enhanced SMC format in TF-A ensuring transparent payload forwarding for Versal Gen2, the u-boot driver must now handle the word swapping of PDI address that was previously done in TF-A for this API. The source code for the Versal2 loadpdi command and the CONFIG_CMD_VERSAL2 configuration has been removed. It now utilizes the fpga load <dev> <address> <length> command to load secure & non-secure pdi images.

---
 arch/arm/mach-versal2/Kconfig      |  1 -
 board/amd/versal2/Kconfig          | 16 ------
 board/amd/versal2/Makefile         |  1 -
 board/amd/versal2/board.c          | 13 +++++
 board/amd/versal2/cmds.c           | 80 ------------------------------
 configs/amd_versal2_virt_defconfig |  2 +
 drivers/fpga/versalpl.c            | 11 +++-
 include/xilinx.h                   |  1 +
 8 files changed, 25 insertions(+), 100 deletions(-)
 delete mode 100644 board/amd/versal2/Kconfig
 delete mode 100644 board/amd/versal2/cmds.c
arch/arm/mach-versal2/Kconfig +0 -1
index 3f18e3351aa..2a595151d6f 100644
@@ -50,6 +50,5 @@ config ZYNQ_SDHCI_MAX_FREQ
 	default 200000000
 
 source "board/xilinx/Kconfig"
-source "board/amd/versal2/Kconfig"
 
 endif
board/amd/versal2/Kconfig deleted +0 -16
deleted file mode 100644
index ab46af6935e..00000000000
@@ -1,16 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-#
-# Copyright (C) 2020 - 2022, Xilinx, Inc.
-# Copyright (C) 2022 - 2024, Advanced Micro Devices, Inc.
-#
-if ARCH_VERSAL2
-
-config CMD_VERSAL2
-	bool "Enable Versal Gen 2 specific commands"
-	default y
-	depends on ZYNQMP_FIRMWARE
-	help
-	  Select this to enable AMD Versal Gen 2 specific commands.
-	  Commands like versal2 loadpdi are enabled by this.
-
-endif
board/amd/versal2/Makefile +0 -1
index 3a044517f0c..1673be4a6df 100644
@@ -8,4 +8,3 @@
 
 obj-y	:= board.o
 
-obj-$(CONFIG_CMD_VERSAL2)   += cmds.o
board/amd/versal2/board.c +13 -0
index 5651d516a9e..150792b6494 100644
@@ -20,6 +20,7 @@
 #include <asm/arch/sys_proto.h>
 #include <dm/device.h>
 #include <dm/uclass.h>
+#include <versalpl.h>
 #include "../../xilinx/common/board.h"
 
 #include <linux/bitfield.h>
@@ -28,10 +29,22 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if defined(CONFIG_FPGA_VERSALPL)
+static xilinx_desc versalpl = {
+	xilinx_versal2, csu_dma, 1, &versal_op, 0, &versal_op, NULL,
+	FPGA_LEGACY
+};
+#endif
+
 int board_init(void)
 {
 	printf("EL Level:\tEL%d\n", current_el());
 
+#if defined(CONFIG_FPGA_VERSALPL)
+	fpga_init();
+	fpga_add(fpga_xilinx, &versalpl);
+#endif
+
 	return 0;
 }
 
board/amd/versal2/cmds.c deleted +0 -80

80 lines not on this page · raw message

configs/amd_versal2_virt_defconfig +2 -0
index 9911caa0e46..0694207a835 100644
@@ -74,6 +74,8 @@ CONFIG_SIMPLE_PM_BUS=y
 CONFIG_CLK_CCF=y
 CONFIG_CLK_SCMI=y
 CONFIG_DFU_RAM=y
+CONFIG_FPGA_XILINX=y
+CONFIG_FPGA_VERSALPL=y
 CONFIG_ARM_FFA_TRANSPORT=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_CADENCE=y
drivers/fpga/versalpl.c +9 -2
index 1957e8dcaca..d691f135e89 100644
@@ -41,8 +41,15 @@ static int versal_load(xilinx_desc *desc, const void *buf, size_t bsize,
 	buf_lo = lower_32_bits(bin_buf);
 	buf_hi = upper_32_bits(bin_buf);
 
-	ret = xilinx_pm_request(VERSAL_PM_LOAD_PDI, VERSAL_PM_PDI_TYPE, buf_lo,
-				buf_hi, 0, ret_payload);
+
+	if (desc->family == xilinx_versal2) {
+		ret = xilinx_pm_request(VERSAL_PM_LOAD_PDI, VERSAL_PM_PDI_TYPE, buf_hi,
+					buf_lo, 0, ret_payload);
+	} else {
+		ret = xilinx_pm_request(VERSAL_PM_LOAD_PDI, VERSAL_PM_PDI_TYPE, buf_lo,
+					buf_hi, 0, ret_payload);
+	}
+
 	if (ret)
 		printf("PL FPGA LOAD failed with err: 0x%08x\n", ret);
 
include/xilinx.h +1 -0
index 2b4d6c9bb06..c54d6dc1453 100644
@@ -35,6 +35,7 @@ typedef enum {			/* typedef xilinx_family */
 	xilinx_zynqmp,		/* ZynqMP Family */
 	xilinx_versal,		/* Versal Family */
 	xilinx_versal_net,	/* Versal NET Family */
+	xilinx_versal2,		/* Versal Gen 2 Family */
 	max_xilinx_type		/* insert all new types before this */
 } xilinx_family;		/* end, typedef xilinx_family */
 
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/3 xilinx: versal: remove versal loadpdi command

In reply to Prasad Kummari

The source code for the versal loadpdi command and the CONFIG_CMD_VERSAL configuration has been removed. It now utilizes the fpga load <dev> <address> <length> command to load secure & non-secure pdi images.

---
 arch/arm/mach-versal/Kconfig |   1 -
 board/xilinx/versal/Kconfig  |  14 -----
 board/xilinx/versal/Makefile |   1 -
 board/xilinx/versal/cmds.c   | 101 -----------------------------------
 4 files changed, 117 deletions(-)
 delete mode 100644 board/xilinx/versal/Kconfig
 delete mode 100644 board/xilinx/versal/cmds.c
arch/arm/mach-versal/Kconfig +0 -1
index 629a14129d5..5ab901c81ca 100644
@@ -46,6 +46,5 @@ config VERSAL_NO_DDR
 	  access to DDR memory where DDR is not present.
 
 source "board/xilinx/Kconfig"
-source "board/xilinx/versal/Kconfig"
 
 endif
board/xilinx/versal/Kconfig deleted +0 -14
deleted file mode 100644
index c0cccc2068b..00000000000
@@ -1,14 +0,0 @@
-# Copyright (c) 2020, Xilinx, Inc.
-#
-# SPDX-License-Identifier: GPL-2.0
-
-if ARCH_VERSAL
-
-config CMD_VERSAL
-	bool "Enable Versal specific commands"
-	default y
-	depends on ZYNQMP_FIRMWARE
-	help
-	  Enable Versal specific commands.
-
-endif
board/xilinx/versal/Makefile +0 -1
index d912f2e74f3..761e084e77c 100644
@@ -5,4 +5,3 @@
 #
 
 obj-y	:= board.o
-obj-$(CONFIG_CMD_VERSAL)	+= cmds.o
board/xilinx/versal/cmds.c deleted +0 -101

101 lines not on this page · raw message

Signature · 1 line
2.25.1
maintainer Applied
#4 lore raw
In reply to Prasad Kummari
Quoted 24 lines · Prasad Kummari

Prasad Kummari (3):
arm64: versal-net: Add PL bit stream load support
arm64: versal2: Add PL bit stream load support
xilinx: versal: remove versal loadpdi command

  arch/arm/mach-versal-net/Kconfig         |   1 -
  arch/arm/mach-versal/Kconfig             |   1 -
  arch/arm/mach-versal2/Kconfig            |   1 -
  board/amd/versal2/Kconfig                |  16 ----
  board/amd/versal2/Makefile               |   1 -
  board/amd/versal2/board.c                |  13 +++
  board/amd/versal2/cmds.c                 |  80 ------------------
  board/xilinx/versal-net/Kconfig          |  17 ----
  board/xilinx/versal-net/Makefile         |   1 -
  board/xilinx/versal-net/board.c          |  12 +++
  board/xilinx/versal-net/cmds.c           |  80 ------------------
  board/xilinx/versal/Kconfig              |  14 ----
  board/xilinx/versal/Makefile             |   1 -
  board/xilinx/versal/cmds.c               | 101 -----------------------
  configs/amd_versal2_virt_defconfig       |   2 +
  configs/xilinx_versal_net_virt_defconfig |   2 +
  drivers/fpga/versalpl.c                  |  11 ++-
  include/xilinx.h                         |   2 +
  18 files changed, 40 insertions(+), 316 deletions(-)
Quoted 7 lines

delete mode 100644 board/amd/versal2/Kconfig delete mode 100644 board/amd/versal2/cmds.c delete mode 100644 board/xilinx/versal-net/Kconfig delete mode 100644 board/xilinx/versal-net/cmds.c delete mode 100644 board/xilinx/versal/Kconfig delete mode 100644 board/xilinx/versal/cmds.c

Applied.
M