[PATCH 0/2] arch: zynqmp: Make zynqmp command more accessible.

While working on a third-party board using a ZynqMP, I was unable to use the zynqmp command even with the proper config definitions. While that command appears tied to the architecture, it was being included based on the board selection instead.
This patch series moves the command to be accessible to any ZynqMP arch based board.

The zynqmp cmds.c is currently tied to the board but the commands contained within are more closely tied to the architecture. To allow usage of those commands when the architecture is ZynqMP but the board is not, this change moves the cmds into the cmd/ tree instead of the board tree that would only be included if the board were also a ZynqMP predefined board.
Signed-off-by: Charlie Johnston charlie.johnston@loftorbital.com --- board/xilinx/zynqmp/Makefile | 4 ---- cmd/Makefile | 3 +++ board/xilinx/zynqmp/cmds.c => cmd/zynqmp.c | 0 3 files changed, 3 insertions(+), 4 deletions(-) rename board/xilinx/zynqmp/cmds.c => cmd/zynqmp.c (100%)
diff --git a/board/xilinx/zynqmp/Makefile b/board/xilinx/zynqmp/Makefile index 204e4fadf0..9ab50eca40 100644 --- a/board/xilinx/zynqmp/Makefile +++ b/board/xilinx/zynqmp/Makefile @@ -40,10 +40,6 @@ $(obj)/pm_cfg_obj.o: $(shell cd $(srctree); readlink -f $(CONFIG_ZYNQMP_SPL_PM_C endif endif
-ifndef CONFIG_SPL_BUILD -obj-$(CONFIG_CMD_ZYNQMP) += cmds.o -endif - # Suppress "warning: function declaration isn't a prototype" CFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes
diff --git a/cmd/Makefile b/cmd/Makefile index 87133cc27a..7afb1c9a7c 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -232,6 +232,9 @@ obj-$(CONFIG_CMD_SCP03) += scp03.o
obj-$(CONFIG_HUSH_SELECTABLE) += cli.o
+# ZynqMP +obj-$(CONFIG_CMD_ZYNQMP) += zynqmp.o + obj-$(CONFIG_ARM) += arm/ obj-$(CONFIG_RISCV) += riscv/ obj-$(CONFIG_SANDBOX) += sandbox/ diff --git a/board/xilinx/zynqmp/cmds.c b/cmd/zynqmp.c similarity index 100% rename from board/xilinx/zynqmp/cmds.c rename to cmd/zynqmp.c

On 4/8/24 22:13, Charlie Johnston wrote:
The zynqmp cmds.c is currently tied to the board but the commands contained within are more closely tied to the architecture. To allow usage of those commands when the architecture is ZynqMP but the board is not, this change moves the cmds into the cmd/ tree instead of the board tree that would only be included if the board were also a ZynqMP predefined board.
Signed-off-by: Charlie Johnston charlie.johnston@loftorbital.com
board/xilinx/zynqmp/Makefile | 4 ---- cmd/Makefile | 3 +++ board/xilinx/zynqmp/cmds.c => cmd/zynqmp.c | 0 3 files changed, 3 insertions(+), 4 deletions(-) rename board/xilinx/zynqmp/cmds.c => cmd/zynqmp.c (100%)
diff --git a/board/xilinx/zynqmp/Makefile b/board/xilinx/zynqmp/Makefile index 204e4fadf0..9ab50eca40 100644 --- a/board/xilinx/zynqmp/Makefile +++ b/board/xilinx/zynqmp/Makefile @@ -40,10 +40,6 @@ $(obj)/pm_cfg_obj.o: $(shell cd $(srctree); readlink -f $(CONFIG_ZYNQMP_SPL_PM_C endif endif
-ifndef CONFIG_SPL_BUILD -obj-$(CONFIG_CMD_ZYNQMP) += cmds.o -endif
- # Suppress "warning: function declaration isn't a prototype" CFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes
diff --git a/cmd/Makefile b/cmd/Makefile index 87133cc27a..7afb1c9a7c 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -232,6 +232,9 @@ obj-$(CONFIG_CMD_SCP03) += scp03.o
obj-$(CONFIG_HUSH_SELECTABLE) += cli.o
+# ZynqMP +obj-$(CONFIG_CMD_ZYNQMP) += zynqmp.o
- obj-$(CONFIG_ARM) += arm/ obj-$(CONFIG_RISCV) += riscv/ obj-$(CONFIG_SANDBOX) += sandbox/
diff --git a/board/xilinx/zynqmp/cmds.c b/cmd/zynqmp.c similarity index 100% rename from board/xilinx/zynqmp/cmds.c rename to cmd/zynqmp.c
I have no problem of moving these commands to architecture and when I grep git grep U_BOOT_CMD I see that commands are defined inside arch/arm/mach-* folders. That's why I would prefer to move it there instead of cmd/ which is supposed to be used for generic command not really soc specific.
Also please squash both patches together and do it via single one.
Thanks, Michal

Since the previous commit moved the zynqmp command to cmds and the command depends on the arch rather than the board, this commit moves the Kconfig entry into the arch/arm/mach-zynqmp/Kconfig
Signed-off-by: Charlie Johnston charlie.johnston@loftorbital.com --- arch/arm/mach-zynqmp/Kconfig | 13 ++++++++++++- board/xilinx/zynqmp/Kconfig | 19 ------------------- 2 files changed, 12 insertions(+), 20 deletions(-) delete mode 100644 board/xilinx/zynqmp/Kconfig
diff --git a/arch/arm/mach-zynqmp/Kconfig b/arch/arm/mach-zynqmp/Kconfig index 6a7be0b427..ed0aa29c12 100644 --- a/arch/arm/mach-zynqmp/Kconfig +++ b/arch/arm/mach-zynqmp/Kconfig @@ -212,7 +212,18 @@ config SD1_LSHFT_MODE
endchoice
+config CMD_ZYNQMP + bool "Enable ZynqMP specific commands" + depends on ZYNQMP_FIRMWARE + default y + help + Enable ZynqMP specific commands like "zynqmp secure" + which is used for zynqmp secure image verification. + The secure image is a xilinx specific BOOT.BIN with + either authentication or encryption or both encryption + and authentication feature enabled while generating + BOOT.BIN using Xilinx bootgen tool. + source "board/xilinx/Kconfig" -source "board/xilinx/zynqmp/Kconfig"
endif diff --git a/board/xilinx/zynqmp/Kconfig b/board/xilinx/zynqmp/Kconfig deleted file mode 100644 index ffa2f0215d..0000000000 --- a/board/xilinx/zynqmp/Kconfig +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2018, Xilinx, Inc. -# -# SPDX-License-Identifier: GPL-2.0 - -if ARCH_ZYNQMP - -config CMD_ZYNQMP - bool "Enable ZynqMP specific commands" - depends on ZYNQMP_FIRMWARE - default y - help - Enable ZynqMP specific commands like "zynqmp secure" - which is used for zynqmp secure image verification. - The secure image is a xilinx specific BOOT.BIN with - either authentication or encryption or both encryption - and authentication feature enabled while generating - BOOT.BIN using Xilinx bootgen tool. - -endif
participants (2)
-
Charlie Johnston
-
Michal Simek