Skip to contentSkip to conversation

Allow the "reset" command to be omitted with CONFIG_CMD_RESET

PATCH New Kyle Moffett 3 participants 4 messages Oct 20, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow the "reset" command to be omitted with CONFIG_CMD_RESET

This new #define is set by default in config_cmd_defaults.h, and config_cmd_all.h, but this allows boards to conditionally omit the "reset" command if necessary.

---
 README                        |    1 +
 common/cmd_boot.c             |    2 ++
 include/config_cmd_all.h      |    1 +
 include/config_cmd_defaults.h |    1 +
 4 files changed, 5 insertions(+), 0 deletions(-)
README +1 -0
index 7e032a9..98c6192 100644
@@ -772,6 +772,7 @@ The following options need to be configured:
 					  host
 		CONFIG_CMD_PORTIO	* Port I/O
 		CONFIG_CMD_REGINFO	* Register dump
+		CONFIG_CMD_RESET	  Reset the CPU
 		CONFIG_CMD_RUN		  run command in env variable
 		CONFIG_CMD_SAVES	* save S record dump
 		CONFIG_CMD_SCSI		* SCSI Support
common/cmd_boot.c +2 -0
index 0afd939..f5779e9 100644
@@ -71,8 +71,10 @@ U_BOOT_CMD(
 
 #endif
 
+#ifdef CONFIG_CMD_RESET
 U_BOOT_CMD(
 	reset, 1, 0,	do_reset,
 	"Perform RESET of the CPU",
 	""
 );
+#endif
include/config_cmd_all.h +1 -0
index 9716f9c..b972cfa 100644
@@ -71,6 +71,7 @@
 #define CONFIG_CMD_REGINFO	/* Register dump		*/
 #define CONFIG_CMD_REISER	/* Reiserfs support		*/
 #define CONFIG_CMD_RARP		/* rarpboot support		*/
+#define CONFIG_CMD_RESET	/* reset the CPU		*/
 #define CONFIG_CMD_RUN		/* run command in env variable	*/
 #define CONFIG_CMD_SAVEENV	/* saveenv			*/
 #define CONFIG_CMD_SAVES	/* save S record dump		*/
include/config_cmd_defaults.h +1 -0
index a55b268..9877aac 100644
@@ -14,5 +14,6 @@
 #define CONFIG_CMD_EXPORTENV 1
 #define CONFIG_CMD_GO 1
 #define CONFIG_CMD_IMPORTENV 1
+#define CONFIG_CMD_RESET 1
 
 #endif
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/1 Allow the "reset" command to be omitted with CONFIG_CMD_RESET

Quoted 3 lines · On Thursday 20 October 2011 15:05:50 Kyle Moffett wrote:

This new #define is set by default in config_cmd_defaults.h, and config_cmd_all.h, but this allows boards to conditionally omit the "reset" command if necessary.

ignoring the related issues as i'm sure Wolfgang will chime in ...

common/cmd_boot.c U_BOOT_CMD( · line 80

Quoted 13 lines
common/cmd_boot.c +2 -0
@@ -71,8 +71,10 @@ U_BOOT_CMD(
 
 #endif
 
+#ifdef CONFIG_CMD_RESET
 U_BOOT_CMD(
 	reset, 1, 0,	do_reset,
 	"Perform RESET of the CPU",
 	""
 );
+#endif

would be a good time to split this into a dedicated common/cmd_reset.c

include/config_cmd_defaults.h

Quoted 5 lines
include/config_cmd_all.h +0 -0
include/config_cmd_defaults.h +0 -0

updating these files is not sufficient and will break boards. drop the hunks to these files and update include/config_defaults.h instead.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111020/33e75fe2/attachment.pgp

#2 lore raw

PATCH 1/1 Allow the "reset" command to be omitted with CONFIG_CMD_RESET

Quoted 7 lines · Mike Frysinger
Quoted 6 lines · On Thursday 20 October 2011 15:05:50 Kyle Moffett wrote:
common/cmd_boot.c +0 -0
@@ -71,8 +71,10 @@ U_BOOT_CMD(
 
 #endif
 
Quoted 9 lines
Quoted 7 lines
common/cmd_boot.c +1 -0
+#ifdef CONFIG_CMD_RESET

U_BOOT_CMD(

	reset, 1, 0,	do_reset,
	"Perform RESET of the CPU",
	""

);
+#endif

would be a good time to split this into a dedicated common/cmd_reset.c

Is it really worth a separate file for just 7 lines of code?

The "do_reset" function itself is defined in the architecture-specific code that implements it (EG: arch/powerpc/cpu/mpc85xx/cpu.c), so there is nothing else generic about the command.

Quoted 8 lines

include/config_cmd_defaults.h

Quoted 5 lines
include/config_cmd_all.h +0 -0
include/config_cmd_defaults.h +0 -0

updating these files is not sufficient and will break boards. drop the hunks to these files and update include/config_defaults.h instead.

Ah, ok. The README docs weren't very clear about that. Fixed, thanks!

Cheers,
Kyle Moffett

--
Curious about my work on the Debian powerpcspe port? I'm keeping a blog here: http://pureperl.blogspot.com/

#3 lore raw

PATCH 1/1 Allow the "reset" command to be omitted with CONFIG_CMD_RESET

Quoted 20 lines · Kyle D
Quoted 10 lines · Mike Frysinger
Quoted 9 lines · On Thursday 20 October 2011 15:05:50 Kyle Moffett wrote:
common/cmd_boot.c +1 -0
@@ -71,8 +71,10 @@ U_BOOT_CMD(
 
 #endif
 
+#ifdef CONFIG_CMD_RESET

U_BOOT_CMD(

Quoted 8 lines
Quoted 6 lines
	reset, 1, 0,	do_reset,
	"Perform RESET of the CPU",
	""

);
+#endif

would be a good time to split this into a dedicated common/cmd_reset.c

Quoted 5 lines

Is it really worth a separate file for just 7 lines of code?

The "do_reset" function itself is defined in the architecture-specific code that implements it (EG: arch/powerpc/cpu/mpc85xx/cpu.c), so there is nothing else generic about the command.

we can also then fix cmd_boot.c to only build when CONFIG_CMD_GO is enabled -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20111020/0973fd81/attachment.pgp