Skip to contentSkip to conversation

Allow the "reset" command to be omitted with CONFIG_CMD_RESET

PATCH New Kyle Moffett 3 participants 6 messages Dec 16, 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 in config_cmd_defaults.h (which is automatically included on every board by "mkconfig"), but this allows boards to elect to omit the "reset" command if necessary with "#undef CONFIG_CMD_RESET".

Cc Wolfgang Denk <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 README                        |    1 +
 common/cmd_boot.c             |    2 ++
 include/config_cmd_defaults.h |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)
README +1 -0
index ff72e47..90989db 100644
@@ -793,6 +793,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_defaults.h +1 -0
index a55b268..b65a945 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.7.3
#1 lore raw

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

Quoted 3 lines · On Thursday 15 December 2011 22:32:41 Kyle Moffett wrote:

This new #define is set in config_cmd_defaults.h (which is automatically included on every board by "mkconfig"), but this allows boards to elect to omit the "reset" command if necessary with "#undef CONFIG_CMD_RESET".

NAK: doesn't seem to address the feedback i posted last time ...
-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/20111216/b961bf58/attachment.pgp>

#2 lore raw

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

Quoted 6 lines · Mike Frysinger
Quoted 3 lines · On Thursday 15 December 2011 22:32:41 Kyle Moffett wrote:

This new #define is set in config_cmd_defaults.h (which is automatically included on every board by "mkconfig"), but this allows boards to elect to omit the "reset" command if necessary with "#undef CONFIG_CMD_RESET".

NAK: doesn't seem to address the feedback i posted last time ...

Hmm, I thought I addressed these:

Quoted 5 lines

include/config_cmd_defaults.h

Quoted 2 lines
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.

The "mkconfig" program automatically includes both config_defaults.h and config_cmd_defaults.h, so this is sufficient to not break boards. This is exactly how CONFIG_CMD_GO works. Since it's always on, there's no need to add it to config_cmd_all.h either (which is why I removed that hunk).

Quoted 2 lines

would be a good time to split this into a dedicated common/cmd_reset.c, we can also then fix cmd_boot.c to only build when CONFIG_CMD_GO is enabled

The only references to CONFIG_CMD_GO are in config_cmd_defaults.h, README, and common/cmd_boot.c, there is nothing that ever turns it off, so perhaps the config symbol should just be removed?

Cheers,
Kyle Moffett

#3 lore raw

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

Quoted 9 lines · Kyle D
Quoted 6 lines · Mike Frysinger
Quoted 3 lines · On Thursday 15 December 2011 22:32:41 Kyle Moffett wrote:

This new #define is set in config_cmd_defaults.h (which is automatically included on every board by "mkconfig"), but this allows boards to elect to omit the "reset" command if necessary with "#undef CONFIG_CMD_RESET".

NAK: doesn't seem to address the feedback i posted last time ...

Hmm, I thought I addressed these:

Quoted 8 lines
Quoted 5 lines

include/config_cmd_defaults.h

Quoted 2 lines
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.

The "mkconfig" program automatically includes both config_defaults.h and config_cmd_defaults.h, so this is sufficient to not break boards.

ah, you're right. sorry about that. i was thinking of "config_cmd_default.h" which is not the same as "config_cmd_defaults.h" ;).

Quoted 7 lines
Quoted 3 lines

would be a good time to split this into a dedicated common/cmd_reset.c, we can also then fix cmd_boot.c to only build when CONFIG_CMD_GO is enabled

The only references to CONFIG_CMD_GO are in config_cmd_defaults.h, README, and common/cmd_boot.c, there is nothing that ever turns it off, so perhaps the config symbol should just be removed?

i have some boards that turn it off
-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/20111216/e9d926ce/attachment.pgp>

#4 lore raw

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

Quoted 11 lines · Mike Frysinger
Quoted 10 lines · Kyle D
Quoted 8 lines · Mike Frysinger
Quoted 3 lines · On Thursday 15 December 2011 22:32:41 Kyle Moffett wrote:

This new #define is set in config_cmd_defaults.h (which is automatically included on every board by "mkconfig"), but this allows boards to elect to omit the "reset" command if necessary with "#undef CONFIG_CMD_RESET".

would be a good time to split this into a dedicated common/cmd_reset.c, we can also then fix cmd_boot.c to only build when CONFIG_CMD_GO is enabled

Quoted 5 lines
Quoted 3 lines

The only references to CONFIG_CMD_GO are in config_cmd_defaults.h, README, and common/cmd_boot.c, there is nothing that ever turns it off, so perhaps the config symbol should just be removed?

i have some boards that turn it off

Ok,

I really don't see the point in moving these 5 lines to their own file, especially since they are in is already just 78 lines long:
U_BOOT_CMD(

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

);

If you really think that's what I should do, though, I'll go ahead and make that change.

Cheers,
Kyle Moffett

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

#5 lore raw

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

Quoted 24 lines · Kyle D
Quoted 12 lines · Mike Frysinger
Quoted 11 lines · Kyle D
Quoted 9 lines · Mike Frysinger
Quoted 4 lines · On Thursday 15 December 2011 22:32:41 Kyle Moffett wrote:

This new #define is set in config_cmd_defaults.h (which is automatically included on every board by "mkconfig"), but this allows boards to elect to omit the "reset" command if necessary with "#undef CONFIG_CMD_RESET".

would be a good time to split this into a dedicated common/cmd_reset.c, we can also then fix cmd_boot.c to only build when CONFIG_CMD_GO is enabled

Quoted 5 lines
Quoted 3 lines

The only references to CONFIG_CMD_GO are in config_cmd_defaults.h, README, and common/cmd_boot.c, there is nothing that ever turns it off, so perhaps the config symbol should just be removed?

i have some boards that turn it off

Ok,

I really don't see the point in moving these 5 lines to their own file, especially since they are in is already just 78 lines long:
U_BOOT_CMD(

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

);

If you really think that's what I should do, though, I'll go ahead and make that change.

i think so, that way we can change cmd_boot.o in the Makefile to depend on CONFIG_CMD_GO and drop the ifdef logic from cmd_boot.c
-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/20111216/cda1c106/attachment.pgp>