Re: [PATCH 09/12] commands: reginfo: make command mpc5xxx-specific

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 14, 2024 at 01:50:37PM +0200, Ahmad Fatoum wrote:
> The reginfo command sounds very generic, but it's actually only used on
> the PowerPC MPC5xxx. Move the command there using the new
> DEFINE_SIMPLE_COMMAND helper.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
> ---
>  arch/powerpc/mach-mpc5xxx/Kconfig   |  4 ----
>  arch/powerpc/mach-mpc5xxx/Makefile  |  2 +-
>  arch/powerpc/mach-mpc5xxx/reginfo.c |  4 +++-
>  commands/Kconfig                    | 11 -----------
>  commands/Makefile                   |  1 -
>  commands/reginfo.c                  | 21 ---------------------
>  include/common.h                    |  5 -----
>  7 files changed, 4 insertions(+), 44 deletions(-)
>  delete mode 100644 commands/reginfo.c
> 
> diff --git a/arch/powerpc/mach-mpc5xxx/Kconfig b/arch/powerpc/mach-mpc5xxx/Kconfig
> index e78c2fa350b1..df6d8c187459 100644
> --- a/arch/powerpc/mach-mpc5xxx/Kconfig
> +++ b/arch/powerpc/mach-mpc5xxx/Kconfig
> @@ -7,10 +7,6 @@ config ARCH_TEXT_BASE
>  	default 0x00000000 if RELOCATABLE
>  	default 0x01000000 if MACH_PHYCORE_MPC5200B_TINY
>  
> -config HAS_REGINFO
> -	bool
> -	default y if ARCH_MPC5200
> -
>  choice
>  	prompt "Select your board"
>  
> diff --git a/arch/powerpc/mach-mpc5xxx/Makefile b/arch/powerpc/mach-mpc5xxx/Makefile
> index 9fc45c08bb31..b9b4cb8e434e 100644
> --- a/arch/powerpc/mach-mpc5xxx/Makefile
> +++ b/arch/powerpc/mach-mpc5xxx/Makefile
> @@ -8,4 +8,4 @@ obj-y				+= traps.o
>  obj-y				+= time.o
>  extra-y				+= start.o
>  obj-$(CONFIG_MPC5200)		+= firmware_sc_task_bestcomm.impl.o
> -obj-$(CONFIG_REGINFO)		+= reginfo.o
> +obj-$(CONFIG_COMMAND_SUPPORT)	+= reginfo.o
> diff --git a/arch/powerpc/mach-mpc5xxx/reginfo.c b/arch/powerpc/mach-mpc5xxx/reginfo.c
> index 64816faffc22..1a958b2cefbf 100644
> --- a/arch/powerpc/mach-mpc5xxx/reginfo.c
> +++ b/arch/powerpc/mach-mpc5xxx/reginfo.c
> @@ -4,9 +4,10 @@
>  #include <common.h>
>  #include <config.h>
>  #include <mach/mpc5xxx.h>
> +#include <command.h>
>  #include <asm/io.h>
>  
> -void reginfo(void)
> +static void reginfo(void)
>  {
>  	puts ("\nMPC5200 registers\n");
>  	printf ("MBAR=%08x\n", CFG_MBAR);
> @@ -61,3 +62,4 @@ void reginfo(void)
>  	printf ("\tSDRAMCS1: %08X\n",
>  		in_be32((void*)MPC5XXX_SDRAM_CS1CFG));
>  }
> +DEFINE_SIMPLE_COMMAND(reginfo);

This is great for development, but not so nice for a broader use in the
tree.

> -BAREBOX_CMD_START(reginfo)
> -	.cmd		= do_reginfo,
> -	BAREBOX_CMD_DESC("print register information")

We are losing the command description and get a "call func reginfo"
instead which is not really an improvement.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux