From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 09/12] commands: reginfo: make command mpc5xxx-specific
Date: Mon, 14 Oct 2024 13:50:37 +0200 [thread overview]
Message-ID: <20241014115040.2843121-10-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20241014115040.2843121-1-a.fatoum@pengutronix.de>
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@pengutronix.de>
---
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);
diff --git a/commands/Kconfig b/commands/Kconfig
index 4a0486861186..313fa51dcadd 100644
--- a/commands/Kconfig
+++ b/commands/Kconfig
@@ -1,8 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
-config REGINFO
- bool
-
config COMMAND_SUPPORT
bool
depends on !SHELL_NONE
@@ -247,14 +244,6 @@ config CMD_ARM_MMUINFO
SuperSection [1]: 0x0
Failure [0]: 0x0
-config CMD_REGINFO
- depends on HAS_REGINFO
- select REGINFO
- tristate
- prompt "reginfo"
- help
- Print register information.
-
config CMD_BLKSTATS
bool
depends on BLOCK
diff --git a/commands/Makefile b/commands/Makefile
index ff5d713ca72c..a98c39637cee 100644
--- a/commands/Makefile
+++ b/commands/Makefile
@@ -37,7 +37,6 @@ obj-$(CONFIG_CMD_CAT) += cat.o
obj-$(CONFIG_CMD_MOUNT) += mount.o
obj-$(CONFIG_CMD_UMOUNT) += umount.o
obj-$(CONFIG_CMD_FINDMNT) += findmnt.o
-obj-$(CONFIG_CMD_REGINFO) += reginfo.o
obj-$(CONFIG_CMD_CRC) += crc.o
obj-$(CONFIG_CMD_CLEAR) += clear.o
obj-$(CONFIG_CMD_TEST) += test.o
diff --git a/commands/reginfo.c b/commands/reginfo.c
deleted file mode 100644
index bd46cf15e7de..000000000000
--- a/commands/reginfo.c
+++ /dev/null
@@ -1,21 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-// SPDX-FileCopyrightText: © 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
-
-/* reginfo.c - print information about SoC specifc registers */
-
-#include <common.h>
-#include <command.h>
-#include <complete.h>
-
-static int do_reginfo(int argc, char *argv[])
-{
- reginfo();
- return 0;
-}
-
-BAREBOX_CMD_START(reginfo)
- .cmd = do_reginfo,
- BAREBOX_CMD_DESC("print register information")
- BAREBOX_CMD_GROUP(CMD_GRP_INFO)
- BAREBOX_CMD_COMPLETE(empty_complete)
-BAREBOX_CMD_END
diff --git a/include/common.h b/include/common.h
index dd0d6548e5db..1f00baf8067a 100644
--- a/include/common.h
+++ b/include/common.h
@@ -23,11 +23,6 @@
#include <linux/printk.h>
#include <barebox-info.h>
-/*
- * Function Prototypes
- */
-void reginfo(void);
-
/* common/memsize.c */
long get_ram_size (volatile long *, long);
--
2.39.5
next prev parent reply other threads:[~2024-10-14 13:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 11:50 [PATCH 00/12] include: common.h: make it include only headers Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 01/12] include: common.h: move barebox startup functions into separate header Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 02/12] include: common.h: move ctrlc() functions into stdio.h Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 03/12] include: common.h: move out integer string parsing functions Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 04/12] include: common.h: move out endianness macro sanity check Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 05/12] include: common.h: move out user interface functions into stdio.h Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 06/12] include: common.h: move out memory option parsing prototypes Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 07/12] include: common.h: move out RW_BUF_SIZE definition Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 08/12] commands: add macro to simplify defining one shot commands Ahmad Fatoum
2024-10-14 11:50 ` Ahmad Fatoum [this message]
2024-10-15 7:13 ` [PATCH 09/12] commands: reginfo: make command mpc5xxx-specific Sascha Hauer
2024-10-15 7:20 ` Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 10/12] include: common.h: move out get_ram_size Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 11/12] include: align: reword STACK_ALIGN_ARRAY macro parameter for clarity Ahmad Fatoum
2024-10-14 11:50 ` [PATCH 12/12] ARM: bcm283x: remove common.h include in mbox.h Ahmad Fatoum
2024-10-15 7:10 ` [PATCH 00/12] include: common.h: make it include only headers Sascha Hauer
2024-10-15 7:16 ` Sascha Hauer
2024-10-15 13:35 ` Konstantin Ryabitsev
2024-10-16 10:25 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241014115040.2843121-10-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox