Skip to contentSkip to conversation

cmd: mp: change the command name from cpu to mp

RFC PATCH Superseded Pragnesh Patel 3 participants 3 messages Mar 14, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 cmd: mp: change the command name from cpu to mp

when CONFIG_CMD_CPU and CONFIG_MP both are enabled, u-boot compilation gives an error of "multiple definition of `_u_boot_list_2_cmd_2_cpu'" so cpu command(cmd/cpu.c) and mp command(cmd/mp.c) should have different command name.

---
 cmd/mp.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
cmd/mp.c +6 -6
index 4c8f5fc3fa..26995c9976 100644
@@ -68,11 +68,11 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #ifdef CONFIG_SYS_LONGHELP
 static char cpu_help_text[] =
-	    "<num> reset                 - Reset cpu <num>\n"
-	"cpu status                      - Status of all cpus\n"
-	"cpu <num> status                - Status of cpu <num>\n"
-	"cpu <num> disable               - Disable cpu <num>\n"
-	"cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]"
+	"mp <num> reset                 - Reset cpu <num>\n"
+	"mp status                      - Status of all cpus\n"
+	"mp <num> status                - Status of cpu <num>\n"
+	"mp <num> disable               - Disable cpu <num>\n"
+	"mp <num> release <addr> [args] - Release cpu <num> at <addr> with [args]"
 #ifdef CONFIG_PPC
 	"\n"
 	"                         [args] : <pir> <r3> <r6>\n" \
@@ -90,6 +90,6 @@ static char cpu_help_text[] =
 #endif
 
 U_BOOT_CMD(
-	cpu, CONFIG_SYS_MAXARGS, 1, cpu_cmd,
+	mp, CONFIG_SYS_MAXARGS, 1, cpu_cmd,
 	"Multiprocessor CPU boot manipulation and release", cpu_help_text
 );
Signature · 1 line
2.17.1
#1 lore raw

RFC PATCH 1/1 cmd: mp: change the command name from cpu to mp

Quoted 16 lines · Pragnesh Patel

when CONFIG_CMD_CPU and CONFIG_MP both are enabled, u-boot compilation gives an error of "multiple definition of `_u_boot_list_2_cmd_2_cpu'" so cpu command(cmd/cpu.c) and mp command(cmd/mp.c) should have different command name.

---
 cmd/mp.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
cmd/mp.c +0 -0
index 4c8f5fc3fa..26995c9976 100644

cmd/mp.c cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 70

Quoted 3 lines
cmd/mp.c +0 -0
@@ -68,11 +68,11 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #ifdef CONFIG_SYS_LONGHELP
 static char cpu_help_text[] =

rename this to mp_help_text[]?

Quoted 14 lines
cmd/mp.c +5 -5
-           "<num> reset                 - Reset cpu <num>\n"
-       "cpu status                      - Status of all cpus\n"
-       "cpu <num> status                - Status of cpu <num>\n"
-       "cpu <num> disable               - Disable cpu <num>\n"
-       "cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]"
+       "mp <num> reset                 - Reset cpu <num>\n"
+       "mp status                      - Status of all cpus\n"
+       "mp <num> status                - Status of cpu <num>\n"
+       "mp <num> disable               - Disable cpu <num>\n"
+       "mp <num> release <addr> [args] - Release cpu <num> at <addr> with [args]"
 #ifdef CONFIG_PPC
        "\n"
        "                         [args] : <pir> <r3> <r6>\n" \

cmd/mp.c static char cpu_help_text[] = · line 93

Quoted 5 lines
cmd/mp.c +1 -1
@@ -90,6 +90,6 @@ static char cpu_help_text[] =
 #endif
 
 U_BOOT_CMD(
-       cpu, CONFIG_SYS_MAXARGS, 1, cpu_cmd,
+       mp, CONFIG_SYS_MAXARGS, 1, cpu_cmd,

mp_cmd

cmd/mp.c static char cpu_help_text[] =

Quoted 3 lines
cmd/mp.c +0 -1
        "Multiprocessor CPU boot manipulation and release", cpu_help_text
 );
--

Please check the same file, there are some additional places using 'cpu'

Regards,
Bin

#2 lore raw

RFC PATCH 1/1 cmd: mp: change the command name from cpu to mp

In reply to Pragnesh Patel

Hi,

Quoted 19 lines · Pragnesh Patel

when CONFIG_CMD_CPU and CONFIG_MP both are enabled, u-boot compilation gives an error of "multiple definition of `_u_boot_list_2_cmd_2_cpu'" so cpu command(cmd/cpu.c) and mp command(cmd/mp.c) should have different command name.

---
 cmd/mp.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
cmd/mp.c +0 -0
index 4c8f5fc3fa..26995c9976 100644
@@ -68,11 +68,11 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #ifdef CONFIG_SYS_LONGHELP
 static char cpu_help_text[] =

cmd/mp.c cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 75

Quoted 10 lines
cmd/mp.c +5 -5
-           "<num> reset                 - Reset cpu <num>\n"
-       "cpu status                      - Status of all cpus\n"
-       "cpu <num> status                - Status of cpu <num>\n"
-       "cpu <num> disable               - Disable cpu <num>\n"
-       "cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]"
+       "mp <num> reset                 - Reset cpu <num>\n"
+       "mp status                      - Status of all cpus\n"
+       "mp <num> status                - Status of cpu <num>\n"
+       "mp <num> disable               - Disable cpu <num>\n"
+       "mp <num> release <addr> [args] - Release cpu <num> at <addr> with [args]"

This interface should be migrated to driver model (using UCLASS_CPU) instead.

Regards,
Simon