[PATCH 1/2] board: zynqmp: Move zynqmp commands from board/ to cmd/
Michal Simek
michal.simek at amd.com
Wed Apr 10 08:15:47 CEST 2024
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 at 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
More information about the U-Boot
mailing list