summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-06-12 16:42:37 -0400
committerTom Rini <trini@konsulko.com>2023-06-12 16:42:37 -0400
commit7da82de916d6aaeeef62431810cb3335e1207b28 (patch)
tree9d994cb47482d2679acd701ebb09d0caf4b2122f /board
parent260d4962e06c0a7d2713523c131416a3f70d7f2c (diff)
parent89240bc0c44b985e461a4220475cb462263df5be (diff)
Merge tag 'xilinx-for-v2023.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next
Xilinx changes for v2023.10-rc1 global: - Use proper U-Boot project name Fix sparse warnings in zynqmp-clk, zynqmp handoff, board cmd: - Cover incorrect 0 length entries Versal NET: - Add bootmode logic - Support SPP production version - Add loadpdi command ZynqMP: - Clear pmufw node command ID handling - Change power domain behavior around zynqmp_pmufw_node() - Fix zynqmp cmd return values and pmufw command - Fix R5 tcm init and modes mmc: - Sync Versal NET emmc DT binding pcie: - Add support for ZynqMP PCIe root port video: - Add support for ZynqMP DP tools: - Fix debug message in relocate-rela
Diffstat (limited to 'board')
-rw-r--r--board/bosch/acc/acc.c2
-rw-r--r--board/bosch/shc/README2
-rw-r--r--board/compulab/cl-som-imx7/cl-som-imx7.c2
-rw-r--r--board/hisilicon/poplar/README2
-rw-r--r--board/isee/igep003x/board.c2
-rw-r--r--board/isee/igep00x0/igep00x0.c2
-rw-r--r--board/keymile/Kconfig8
-rw-r--r--board/keymile/README2
-rw-r--r--board/kontron/sl-mx6ul/spl.c2
-rw-r--r--board/phytec/pcm058/README18
-rw-r--r--board/synopsys/hsdk/hsdk.c14
-rw-r--r--board/xilinx/common/board.h7
-rw-r--r--board/xilinx/versal-net/Kconfig8
-rw-r--r--board/xilinx/versal-net/Makefile1
-rw-r--r--board/xilinx/versal-net/board.c149
-rw-r--r--board/xilinx/versal-net/cmds.c81
-rw-r--r--board/xilinx/zynqmp/cmds.c26
17 files changed, 283 insertions, 45 deletions
diff --git a/board/bosch/acc/acc.c b/board/bosch/acc/acc.c
index 732d823826b..7c49b206c15 100644
--- a/board/bosch/acc/acc.c
+++ b/board/bosch/acc/acc.c
@@ -542,7 +542,7 @@ int board_mmc_init(struct bd_info *bis)
gpio_direction_input(USDHC2_CD_GPIO);
/*
* According to the board_mmc_init() the following map is done:
- * (U-boot device node) (Physical Port)
+ * (U-Boot device node) (Physical Port)
* mmc0 USDHC2
* mmc1 USDHC4
*/
diff --git a/board/bosch/shc/README b/board/bosch/shc/README
index 2f206e0d551..74704cdc115 100644
--- a/board/bosch/shc/README
+++ b/board/bosch/shc/README
@@ -68,7 +68,7 @@ Netboot
- see also doc/SPL/README.am335x-network
- set the jumper into netboot mode
-- compile the U-boot sources with:
+- compile the U-Boot sources with:
make am335x_shc_netboot_defconfig
make all
- copy the images into your tftp boot directory
diff --git a/board/compulab/cl-som-imx7/cl-som-imx7.c b/board/compulab/cl-som-imx7/cl-som-imx7.c
index 1b08a2c5abf..af19a658b54 100644
--- a/board/compulab/cl-som-imx7/cl-som-imx7.c
+++ b/board/compulab/cl-som-imx7/cl-som-imx7.c
@@ -86,7 +86,7 @@ int board_mmc_init(struct bd_info *bis)
int i, ret;
/*
* According to the board_mmc_init() the following map is done:
- * (U-boot device node) (Physical Port)
+ * (U-Boot device node) (Physical Port)
* mmc0 USDHC1
* mmc2 USDHC3 (eMMC)
*/
diff --git a/board/hisilicon/poplar/README b/board/hisilicon/poplar/README
index 99ed6ce295e..77dcc3ba115 100644
--- a/board/hisilicon/poplar/README
+++ b/board/hisilicon/poplar/README
@@ -30,7 +30,7 @@ CONNECTORS One connector for Smart Card One connector for TSI
Note of warning:
================
-U-boot has a *strong* dependency with the l-loader and the arm trusted firmware
+U-Boot has a *strong* dependency with the l-loader and the arm trusted firmware
repositories.
The boot sequence is:
diff --git a/board/isee/igep003x/board.c b/board/isee/igep003x/board.c
index 5462a3dea22..7dbb0800892 100644
--- a/board/isee/igep003x/board.c
+++ b/board/isee/igep003x/board.c
@@ -37,7 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
/* GPIO0_27 and GPIO0_26 are used to read board revision from IGEP003x boards
* and control IGEP0034 green and red LEDs.
- * U-boot configures these pins as input pullup to detect board revision:
+ * U-Boot configures these pins as input pullup to detect board revision:
* IGEP0034-LITE = 0b00
* IGEP0034 (FULL) = 0b01
* IGEP0033 = 0b1X
diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
index f1599306e61..0f0a9c592fc 100644
--- a/board/isee/igep00x0/igep00x0.c
+++ b/board/isee/igep00x0/igep00x0.c
@@ -47,7 +47,7 @@ U_BOOT_DRVINFO(igep_uart) = {
* IGEP00x0 boards. First of all, it is necessary to reset USB transceiver from
* IGEP0030 in order to read GPIO_IGEP00X0_BOARD_DETECTION correctly, because
* this functionality is shared by USB HOST.
- * Once USB reset is applied, U-boot configures these pins as input pullup to
+ * Once USB reset is applied, U-Boot configures these pins as input pullup to
* detect board and revision:
* IGEP0020-RF = 0b00
* IGEP0020-RC = 0b01
diff --git a/board/keymile/Kconfig b/board/keymile/Kconfig
index bf899d005c4..c6576aa6523 100644
--- a/board/keymile/Kconfig
+++ b/board/keymile/Kconfig
@@ -123,7 +123,7 @@ config SYS_IVM_EEPROM_PAGE_LEN
Page size of inventory in EEPROM.
config PG_WCOM_UBOOT_UPDATE_SUPPORTED
- bool "Enable U-boot Field Fail-Safe Update Functionality"
+ bool "Enable U-Boot Field Fail-Safe Update Functionality"
select EVENT
default n
help
@@ -132,7 +132,7 @@ config PG_WCOM_UBOOT_UPDATE_SUPPORTED
from parallel NOR flash.
config PG_WCOM_UBOOT_BOOTPACKAGE
- bool "U-boot Is Part Of Factory Boot-Package Image"
+ bool "U-Boot Is Part Of Factory Boot-Package Image"
default n
help
Indicates that u-boot will be a part of the factory programmed
@@ -140,7 +140,7 @@ config PG_WCOM_UBOOT_BOOTPACKAGE
Has to be set for original u-boot programmed at factory.
config PG_WCOM_UBOOT_UPDATE_TEXT_BASE
- hex "Text Base For U-boot Programmed Outside Factory"
+ hex "Text Base For U-Boot Programmed Outside Factory"
default 0xFFFFFFFF
help
Text base of an updated u-boot that is not factory programmed but
@@ -148,7 +148,7 @@ config PG_WCOM_UBOOT_UPDATE_TEXT_BASE
Has to be set for original u-boot programmed at factory.
config PG_WCOM_UBOOT_UPDATE
- bool "U-boot Is Part Of Factory Boot-Package Image"
+ bool "U-Boot Is Part Of Factory Boot-Package Image"
default n
help
Indicates that u-boot will be a part of the embedded software and
diff --git a/board/keymile/README b/board/keymile/README
index 4e5cfb142a3..99f27e576aa 100644
--- a/board/keymile/README
+++ b/board/keymile/README
@@ -1,4 +1,4 @@
-Field Fail-Save U-boot Update
+Field Fail-Save U-Boot Update
-----------------------------
Field Fail-Save u-boot update is a feature that allows save u-boot update
of FOX and XMC products that are rolled out in the field.
diff --git a/board/kontron/sl-mx6ul/spl.c b/board/kontron/sl-mx6ul/spl.c
index bae0e70a657..a9d370bc854 100644
--- a/board/kontron/sl-mx6ul/spl.c
+++ b/board/kontron/sl-mx6ul/spl.c
@@ -101,7 +101,7 @@ int board_mmc_init(struct bd_info *bis)
/*
* According to the board_mmc_init() the following map is done:
- * (U-boot device node) (Physical Port)
+ * (U-Boot device node) (Physical Port)
* mmc0 USDHC1
* mmc1 USDHC2
*/
diff --git a/board/phytec/pcm058/README b/board/phytec/pcm058/README
index 687366bffbd..4b6984cd54f 100644
--- a/board/phytec/pcm058/README
+++ b/board/phytec/pcm058/README
@@ -37,12 +37,12 @@ not supported.
Flashing U-Boot onto an SD card
-------------------------------
-After a successful build, the generated SPL and U-boot binaries can be copied
+After a successful build, the generated SPL and U-Boot binaries can be copied
to an SD card. Adjust the SD card device as necessary:
$ sudo dd if=u-boot-with-spl.imx of=/dev/mmcblk0 bs=1k seek=1
-This is equivalent to separately copying the SPL and U-boot using:
+This is equivalent to separately copying the SPL and U-Boot using:
$ sudo dd if=SPL of=/dev/mmcblk0 bs=1k seek=1
$ sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 bs=1k seek=197
@@ -50,11 +50,11 @@ $ sudo dd if=u-boot-dtb.img of=/dev/mmcblk0 bs=1k seek=197
The default bootscripts expect a kernel fit-image file named "fitImage" in the
first partition and Linux ext4 rootfs in the second partition.
-Flashing U-boot to the SPI Flash, for booting Linux from NAND
+Flashing U-Boot to the SPI Flash, for booting Linux from NAND
-------------------------------------------------------------
-The SD card created above can also be used to install the SPL and U-boot into
-the SPI flash. Boot U-boot from the SD card as above, and stop at the autoboot.
+The SD card created above can also be used to install the SPL and U-Boot into
+the SPI flash. Boot U-Boot from the SD card as above, and stop at the autoboot.
Then, clear the SPI flash:
@@ -64,13 +64,13 @@ Then, clear the SPI flash:
Load the equivalent of u-boot-with-spl.imx from the raw MMC into memory and
copy to the SPI. The SPL is expected at an offset of 0x400, and its size is
maximum 392*512-byte blocks in size, therefore 0x188 blocks, totaling 0x31000
-bytes. Assume U-boot should fit into 640KiB, therefore 0x500 512-byte blocks,
+bytes. Assume U-Boot should fit into 640KiB, therefore 0x500 512-byte blocks,
totalling 0xA0000 bytes. Adding these together:
=> mmc read ${loadaddr} 0x2 0x688
=> sf write ${loadaddr} 0x400 0xD1000
-The SPL is located at offset 0x400, and U-boot at 0x31400 in SPI flash, as to
+The SPL is located at offset 0x400, and U-Boot at 0x31400 in SPI flash, as to
match the SD Card layout. This would allow, instead of reading from the SD Card
above, with networking and TFTP correctly configured, the equivalent of:
@@ -84,7 +84,7 @@ image) and "root" (which contains a ubifs root filesystem).
The "bootm_size" variable in the environment
--------------------------------------------
-By default, U-boot relocates the device tree towards the upper end of the RAM,
+By default, U-Boot relocates the device tree towards the upper end of the RAM,
which kernels using CONFIG_HIGHMEM=y may not be able to access during early
-boot. With the bootm_size variable set to 0x30000000, U-boot relocates the
+boot. With the bootm_size variable set to 0x30000000, U-Boot relocates the
device tree to below this address instead.
diff --git a/board/synopsys/hsdk/hsdk.c b/board/synopsys/hsdk/hsdk.c
index 4308c7e440a..6cbc89ae787 100644
--- a/board/synopsys/hsdk/hsdk.c
+++ b/board/synopsys/hsdk/hsdk.c
@@ -583,7 +583,7 @@ enum hsdk_axi_masters {
*
* Please read ARC HS Development IC Specification, section 17.2 for more
* information about apertures configuration.
- * NOTE: we intentionally modify default settings in U-boot. Default settings
+ * NOTE: we intentionally modify default settings in U-Boot. Default settings
* are specified in "Table 111 CREG Address Decoder register reset values".
*/
@@ -942,7 +942,7 @@ static int do_hsdk_go(struct cmd_tbl *cmdtp, int flag, int argc,
int ret;
if (board_mismatch()) {
- printf("ERR: U-boot is not configured for this board!\n");
+ printf("ERR: U-Boot is not configured for this board!\n");
return CMD_RET_FAILURE;
}
@@ -983,10 +983,10 @@ U_BOOT_CMD(
/*
* We may simply use static variable here to store init status, but we also want
- * to avoid the situation when we reload U-boot via MDB after previous
+ * to avoid the situation when we reload U-Boot via MDB after previous
* init is done but HW reset (board reset) isn't done. So let's store the
* init status in any unused register (i.e CREG_CPU_0_ENTRY) so status will
- * survive after U-boot is reloaded via MDB.
+ * survive after U-Boot is reloaded via MDB.
*/
#define INIT_MARKER_REGISTER ((void __iomem *)CREG_CPU_0_ENTRY)
/* must be equal to INIT_MARKER_REGISTER reset value */
@@ -1008,7 +1008,7 @@ static int do_hsdk_init(struct cmd_tbl *cmdtp, int flag, int argc,
int ret;
if (board_mismatch()) {
- printf("ERR: U-boot is not configured for this board!\n");
+ printf("ERR: U-Boot is not configured for this board!\n");
return CMD_RET_FAILURE;
}
@@ -1258,11 +1258,11 @@ int checkboard(void)
printf("Board: Synopsys %s\n", board_name(get_board_type_runtime()));
if (board_mismatch())
- printf("WARN: U-boot is configured NOT for this board but for %s!\n",
+ printf("WARN: U-Boot is configured NOT for this board but for %s!\n",
board_name(get_board_type_config()));
reg = readl(CREG_AXI_M_HS_CORE_BOOT) & CREG_CORE_BOOT_IMAGE;
- printf("U-boot autostart: %s\n", reg ? "enabled" : "disabled");
+ printf("U-Boot autostart: %s\n", reg ? "enabled" : "disabled");
return 0;
};
diff --git a/board/xilinx/common/board.h b/board/xilinx/common/board.h
index 69e642429b8..922c9d557af 100644
--- a/board/xilinx/common/board.h
+++ b/board/xilinx/common/board.h
@@ -11,4 +11,11 @@ int board_late_init_xilinx(void);
int xilinx_read_eeprom(void);
+char *board_name_decode(void);
+
+bool board_detection(void);
+
+char *soc_name_decode(void);
+
+bool soc_detection(void);
#endif /* BOARD_XILINX_COMMON_BOARD_H */
diff --git a/board/xilinx/versal-net/Kconfig b/board/xilinx/versal-net/Kconfig
index 8f94d2bb399..2484429d3cb 100644
--- a/board/xilinx/versal-net/Kconfig
+++ b/board/xilinx/versal-net/Kconfig
@@ -6,4 +6,12 @@
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
diff --git a/board/xilinx/versal-net/Makefile b/board/xilinx/versal-net/Makefile
index 2008d4e231c..f9ff07c11c6 100644
--- a/board/xilinx/versal-net/Makefile
+++ b/board/xilinx/versal-net/Makefile
@@ -7,3 +7,4 @@
#
obj-y := board.o
+obj-$(CONFIG_CMD_VERSAL_NET) += cmds.o
diff --git a/board/xilinx/versal-net/board.c b/board/xilinx/versal-net/board.c
index 6724c7290f8..a68b608b82c 100644
--- a/board/xilinx/versal-net/board.c
+++ b/board/xilinx/versal-net/board.c
@@ -10,6 +10,7 @@
#include <cpu_func.h>
#include <fdtdec.h>
#include <init.h>
+#include <env_internal.h>
#include <log.h>
#include <malloc.h>
#include <time.h>
@@ -74,32 +75,45 @@ char *soc_name_decode(void)
bool soc_detection(void)
{
- u32 version;
+ u32 version, ps_version;
version = readl(PMC_TAP_VERSION);
platform_id = FIELD_GET(PLATFORM_MASK, version);
+ ps_version = FIELD_GET(PS_VERSION_MASK, version);
debug("idcode %x, version %x, usercode %x\n",
readl(PMC_TAP_IDCODE), version,
readl(PMC_TAP_USERCODE));
- debug("pmc_ver %lx, ps version %lx, rtl version %lx\n",
+ debug("pmc_ver %lx, ps version %x, rtl version %lx\n",
FIELD_GET(PMC_VERSION_MASK, version),
- FIELD_GET(PS_VERSION_MASK, version),
+ ps_version,
FIELD_GET(RTL_VERSION_MASK, version));
platform_version = FIELD_GET(PLATFORM_VERSION_MASK, version);
if (platform_id == VERSAL_NET_SPP ||
platform_id == VERSAL_NET_EMU) {
- /*
- * 9 is diff for
- * 0 means 0.9 version
- * 1 means 1.0 version
- * 2 means 1.1 version
- * etc,
- */
- platform_version += 9;
+ if (ps_version == PS_VERSION_PRODUCTION) {
+ /*
+ * ES1 version ends at 1.9 version where there was +9
+ * used because of IPP/SPP conversion. Production
+ * version have platform_version started from 0 again
+ * that's why adding +20 to continue with the same line.
+ * It means the last ES1 version ends at 1.9 version and
+ * new PRODUCTION line starts at 2.0.
+ */
+ platform_version += 20;
+ } else {
+ /*
+ * 9 is diff for
+ * 0 means 0.9 version
+ * 1 means 1.0 version
+ * 2 means 1.1 version
+ * etc,
+ */
+ platform_version += 9;
+ }
}
debug("Platform id: %d version: %d.%d\n", platform_id,
@@ -165,8 +179,32 @@ int board_early_init_r(void)
return 0;
}
+static u8 versal_net_get_bootmode(void)
+{
+ u8 bootmode;
+ u32 reg = 0;
+
+ reg = readl(&crp_base->boot_mode_usr);
+
+ if (reg >> BOOT_MODE_ALT_SHIFT)
+ reg >>= BOOT_MODE_ALT_SHIFT;
+
+ bootmode = reg & BOOT_MODES_MASK;
+
+ return bootmode;
+}
+
int board_late_init(void)
{
+ u8 bootmode;
+ struct udevice *dev;
+ int bootseq = -1;
+ int bootseq_len = 0;
+ int env_targets_len = 0;
+ const char *mode;
+ char *new_targets;
+ char *env_targets;
+
if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
debug("Saved variables - Skipping\n");
return 0;
@@ -175,6 +213,95 @@ int board_late_init(void)
if (!IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG))
return 0;
+ bootmode = versal_net_get_bootmode();
+
+ puts("Bootmode: ");
+ switch (bootmode) {
+ case USB_MODE:
+ puts("USB_MODE\n");
+ mode = "usb_dfu0 usb_dfu1";
+ break;
+ case JTAG_MODE:
+ puts("JTAG_MODE\n");
+ mode = "jtag pxe dhcp";
+ break;
+ case QSPI_MODE_24BIT:
+ puts("QSPI_MODE_24\n");
+ mode = "xspi0";
+ break;
+ case QSPI_MODE_32BIT:
+ puts("QSPI_MODE_32\n");
+ mode = "xspi0";
+ break;
+ case OSPI_MODE:
+ puts("OSPI_MODE\n");
+ mode = "xspi0";
+ break;
+ case EMMC_MODE:
+ puts("EMMC_MODE\n");
+ mode = "mmc";
+ bootseq = dev_seq(dev);
+ break;
+ case SD_MODE:
+ puts("SD_MODE\n");
+ if (uclass_get_device_by_name(UCLASS_MMC,
+ "mmc@f1040000", &dev)) {
+ puts("Boot from SD0 but without SD0 enabled!\n");
+ return -1;
+ }
+ debug("mmc0 device found at %p, seq %d\n", dev, dev_seq(dev));
+
+ mode = "mmc";
+ bootseq = dev_seq(dev);
+ break;
+ case SD1_LSHFT_MODE:
+ puts("LVL_SHFT_");
+ fallthrough;
+ case SD_MODE1:
+ puts("SD_MODE1\n");
+ if (uclass_get_device_by_name(UCLASS_MMC,
+ "mmc@f1050000", &dev)) {
+ puts("Boot from SD1 but without SD1 enabled!\n");
+ return -1;
+ }
+ debug("mmc1 device found at %p, seq %d\n", dev, dev_seq(dev));
+
+ mode = "mmc";
+ bootseq = dev_seq(dev);
+ break;
+ default:
+ mode = "";
+ printf("Invalid Boot Mode:0x%x\n", bootmode);
+ break;
+ }
+
+ if (bootseq >= 0) {
+ bootseq_len = snprintf(NULL, 0, "%i", bootseq);
+ debug("Bootseq len: %x\n", bootseq_len);
+ }
+
+ /*
+ * One terminating char + one byte for space between mode
+ * and default boot_targets
+ */
+ env_targets = env_get("boot_targets");
+ if (env_targets)
+ env_targets_len = strlen(env_targets);
+
+ new_targets = calloc(1, strlen(mode) + env_targets_len + 2 +
+ bootseq_len);
+ if (!new_targets)
+ return -ENOMEM;
+
+ if (bootseq >= 0)
+ sprintf(new_targets, "%s%x %s", mode, bootseq,
+ env_targets ? env_targets : "");
+ else
+ sprintf(new_targets, "%s %s", mode,
+ env_targets ? env_targets : "");
+
+ env_set("boot_targets", new_targets);
+
return board_late_init_xilinx();
}
diff --git a/board/xilinx/versal-net/cmds.c b/board/xilinx/versal-net/cmds.c
new file mode 100644
index 00000000000..b18a71fe52c
--- /dev/null
+++ b/board/xilinx/versal-net/cmds.c
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2023, Advanced Micro Devices, Inc.
+ *
+ * Michal Simek <michal.simek@amd.com>
+ */
+
+#include <cpu_func.h>
+#include <command.h>
+#include <common.h>
+#include <log.h>
+#include <memalign.h>
+#include <versalpl.h>
+#include <zynqmp_firmware.h>
+
+/**
+ * do_versalnet_load_pdi - Handle the "versalnet load pdi" command-line command
+ * @cmdtp: Command data struct pointer
+ * @flag: Command flag
+ * @argc: Command-line argument count
+ * @argv: Array of command-line arguments
+ *
+ * Processes the Versal NET load pdi command
+ *
+ * Return: return 0 on success, Error value if command fails.
+ * CMD_RET_USAGE incase of incorrect/missing parameters.
+ */
+static int do_versalnet_load_pdi(struct cmd_tbl *cmdtp, int flag, int argc,
+ char * const argv[])
+{
+ u32 buf_lo, buf_hi;
+ u32 ret_payload[PAYLOAD_ARG_CNT];
+ ulong addr, *pdi_buf;
+ size_t len;
+ int ret;
+
+ if (argc != cmdtp->maxargs) {
+ debug("pdi_load: incorrect parameters passed\n");
+ return CMD_RET_USAGE;
+ }
+
+ addr = simple_strtol(argv[1], NULL, 16);
+ if (!addr) {
+ debug("pdi_load: zero pdi_data address\n");
+ return CMD_RET_USAGE;
+ }
+
+ len = hextoul(argv[2], NULL);
+ if (!len) {
+ debug("pdi_load: zero size\n");
+ return CMD_RET_USAGE;
+ }
+
+ pdi_buf = (ulong *)ALIGN((ulong)addr, ARCH_DMA_MINALIGN);
+ if ((ulong)addr != (ulong)pdi_buf) {
+ memcpy((void *)pdi_buf, (void *)addr, len);
+ debug("Pdi addr:0x%lx aligned to 0x%lx\n",
+ addr, (ulong)pdi_buf);
+ }
+
+ flush_dcache_range((ulong)pdi_buf, (ulong)pdi_buf + len);
+
+ buf_lo = lower_32_bits((ulong)pdi_buf);
+ buf_hi = upper_32_bits((ulong)pdi_buf);
+
+ ret = xilinx_pm_request(VERSAL_PM_LOAD_PDI, VERSAL_PM_PDI_TYPE, buf_lo,
+ buf_hi, 0, ret_payload);
+ if (ret)
+ printf("PDI load failed with err: 0x%08x\n", ret);
+
+ return cmd_process_error(cmdtp, ret);
+}
+
+static char versalnet_help_text[] =
+ "loadpdi addr len - Load pdi image\n"
+ "load pdi image at ddr address 'addr' with pdi image size 'len'\n"
+;
+
+U_BOOT_CMD_WITH_SUBCMDS(versalnet, "Versal NET sub-system", versalnet_help_text,
+ U_BOOT_SUBCMD_MKENT(loadpdi, 3, 1,
+ do_versalnet_load_pdi));
diff --git a/board/xilinx/zynqmp/cmds.c b/board/xilinx/zynqmp/cmds.c
index e20030ecda7..dd1ad66f90c 100644
--- a/board/xilinx/zynqmp/cmds.c
+++ b/board/xilinx/zynqmp/cmds.c
@@ -187,6 +187,11 @@ static int do_zynqmp_tcm_init(struct cmd_tbl *cmdtp, int flag, int argc,
if (argc != cmdtp->maxargs)
return CMD_RET_USAGE;
+ if (strcmp(argv[2], "lockstep") && strcmp(argv[2], "split")) {
+ printf("mode param should be lockstep or split\n");
+ return CMD_RET_FAILURE;
+ }
+
mode = hextoul(argv[2], NULL);
if (mode != TCM_LOCK && mode != TCM_SPLIT) {
printf("Mode should be either 0(lock)/1(split)\n");
@@ -211,15 +216,24 @@ static int do_zynqmp_pmufw(struct cmd_tbl *cmdtp, int flag, int argc,
if (!strncmp(argv[2], "node", 4)) {
u32 id;
+ int ret;
if (!strncmp(argv[3], "close", 5))
return zynqmp_pmufw_config_close();
id = dectoul(argv[3], NULL);
+ if (!id) {
+ printf("Incorrect ID passed\n");
+ return CMD_RET_USAGE;
+ }
printf("Enable permission for node ID %d\n", id);
- return zynqmp_pmufw_node(id);
+ ret = zynqmp_pmufw_node(id);
+ if (ret == -ENODEV)
+ ret = 0;
+
+ return ret;
}
addr = hextoul(argv[2], NULL);
@@ -390,17 +404,17 @@ static int do_zynqmp(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
struct cmd_tbl *c;
+ int ret = CMD_RET_USAGE;
if (argc < 2)
return CMD_RET_USAGE;
c = find_cmd_tbl(argv[1], &cmd_zynqmp_sub[0],
ARRAY_SIZE(cmd_zynqmp_sub));
-
if (c)
- return c->cmd(c, flag, argc, argv);
- else
- return CMD_RET_USAGE;
+ ret = c->cmd(c, flag, argc, argv);
+
+ return cmd_process_error(c, ret);
}
/***************************************************/
@@ -429,7 +443,7 @@ static char zynqmp_help_text[] =
" lock(0)/split(1)\n"
#endif
"zynqmp pmufw address size - load PMU FW configuration object\n"
- "zynqmp pmufw node <id> - load PMU FW configuration object\n"
+ "zynqmp pmufw node <id> - load PMU FW configuration object, <id> in dec\n"
"zynqmp pmufw node close - disable config object loading\n"
" node: keyword, id: NODE_ID in decimal format\n"
"zynqmp rsa srcaddr srclen mod exp rsaop -\n"