public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET
@ 2011-10-20 19:05 Kyle Moffett
  2011-10-20 19:53 ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: Kyle Moffett @ 2011-10-20 19:05 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
 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(-)

diff --git a/README b/README
index 7e032a9..98c6192 100644
--- a/README
+++ b/README
@@ -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
diff --git a/common/cmd_boot.c b/common/cmd_boot.c
index 0afd939..f5779e9 100644
--- a/common/cmd_boot.c
+++ b/common/cmd_boot.c
@@ -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
diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h
index 9716f9c..b972cfa 100644
--- a/include/config_cmd_all.h
+++ b/include/config_cmd_all.h
@@ -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		*/
diff --git a/include/config_cmd_defaults.h b/include/config_cmd_defaults.h
index a55b268..9877aac 100644
--- a/include/config_cmd_defaults.h
+++ b/include/config_cmd_defaults.h
@@ -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
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET
  2011-10-20 19:05 [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET Kyle Moffett
@ 2011-10-20 19:53 ` Mike Frysinger
  2011-10-20 20:10   ` Moffett, Kyle D
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2011-10-20 19:53 UTC (permalink / raw)
  To: u-boot

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 ...

> --- a/common/cmd_boot.c
> +++ b/common/cmd_boot.c
> @@ -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

> --- a/include/config_cmd_all.h
> +++ b/include/config_cmd_all.h
>
> --- a/include/config_cmd_defaults.h
> +++ b/include/config_cmd_defaults.h

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 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET
  2011-10-20 19:53 ` Mike Frysinger
@ 2011-10-20 20:10   ` Moffett, Kyle D
  2011-10-20 20:22     ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: Moffett, Kyle D @ 2011-10-20 20:10 UTC (permalink / raw)
  To: u-boot

On Oct 20, 2011, at 15:53, Mike Frysinger wrote:
> On Thursday 20 October 2011 15:05:50 Kyle Moffett wrote:
>> --- a/common/cmd_boot.c
>> +++ b/common/cmd_boot.c
>> @@ -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

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.

>> --- a/include/config_cmd_all.h
>> +++ b/include/config_cmd_all.h
>> 
>> --- a/include/config_cmd_defaults.h
>> +++ b/include/config_cmd_defaults.h
> 
> 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET
  2011-10-20 20:10   ` Moffett, Kyle D
@ 2011-10-20 20:22     ` Mike Frysinger
  0 siblings, 0 replies; 10+ messages in thread
From: Mike Frysinger @ 2011-10-20 20:22 UTC (permalink / raw)
  To: u-boot

On Thursday 20 October 2011 16:10:10 Moffett, Kyle D wrote:
> On Oct 20, 2011, at 15:53, Mike Frysinger wrote:
> > On Thursday 20 October 2011 15:05:50 Kyle Moffett wrote:
> >> --- a/common/cmd_boot.c
> >> +++ b/common/cmd_boot.c
> >> @@ -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
> 
> 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 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET
@ 2011-12-16  3:32 Kyle Moffett
  2011-12-16  5:05 ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: Kyle Moffett @ 2011-12-16  3:32 UTC (permalink / raw)
  To: u-boot

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".

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
---
 README                        |    1 +
 common/cmd_boot.c             |    2 ++
 include/config_cmd_defaults.h |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/README b/README
index ff72e47..90989db 100644
--- a/README
+++ b/README
@@ -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
diff --git a/common/cmd_boot.c b/common/cmd_boot.c
index 0afd939..f5779e9 100644
--- a/common/cmd_boot.c
+++ b/common/cmd_boot.c
@@ -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
diff --git a/include/config_cmd_defaults.h b/include/config_cmd_defaults.h
index a55b268..b65a945 100644
--- a/include/config_cmd_defaults.h
+++ b/include/config_cmd_defaults.h
@@ -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
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET
  2011-12-16  3:32 Kyle Moffett
@ 2011-12-16  5:05 ` Mike Frysinger
  2011-12-16 18:49   ` Moffett, Kyle D
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2011-12-16  5:05 UTC (permalink / raw)
  To: u-boot

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>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET
  2011-12-16  5:05 ` Mike Frysinger
@ 2011-12-16 18:49   ` Moffett, Kyle D
  2011-12-16 19:30     ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: Moffett, Kyle D @ 2011-12-16 18:49 UTC (permalink / raw)
  To: u-boot

On Dec 16, 2011, at 00:05, Mike Frysinger wrote:
> 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:

>> --- a/include/config_cmd_defaults.h
>> +++ b/include/config_cmd_defaults.h
> 
> 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).

> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET
  2011-12-16 18:49   ` Moffett, Kyle D
@ 2011-12-16 19:30     ` Mike Frysinger
  2011-12-16 20:42       ` Moffett, Kyle D
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Frysinger @ 2011-12-16 19:30 UTC (permalink / raw)
  To: u-boot

On Friday 16 December 2011 13:49:15 Moffett, Kyle D wrote:
> On Dec 16, 2011, at 00:05, Mike Frysinger wrote:
> > 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:
> >> --- a/include/config_cmd_defaults.h
> >> +++ b/include/config_cmd_defaults.h
> > 
> > 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" ;).

> > 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>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET
  2011-12-16 19:30     ` Mike Frysinger
@ 2011-12-16 20:42       ` Moffett, Kyle D
  2011-12-16 22:07         ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: Moffett, Kyle D @ 2011-12-16 20:42 UTC (permalink / raw)
  To: u-boot

On Dec 16, 2011, at 14:30, Mike Frysinger wrote:
> On Friday 16 December 2011 13:49:15 Moffett, Kyle D wrote:
>> On Dec 16, 2011, at 00:05, Mike Frysinger wrote:
>>> 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
>> 
>> 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET
  2011-12-16 20:42       ` Moffett, Kyle D
@ 2011-12-16 22:07         ` Mike Frysinger
  0 siblings, 0 replies; 10+ messages in thread
From: Mike Frysinger @ 2011-12-16 22:07 UTC (permalink / raw)
  To: u-boot

On Friday 16 December 2011 15:42:26 Moffett, Kyle D wrote:
> On Dec 16, 2011, at 14:30, Mike Frysinger wrote:
> > On Friday 16 December 2011 13:49:15 Moffett, Kyle D wrote:
> >> On Dec 16, 2011, at 00:05, Mike Frysinger wrote:
> >>> 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
> >> 
> >> 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.

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>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-12-16 22:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-20 19:05 [U-Boot] [PATCH] Allow the "reset" command to be omitted with CONFIG_CMD_RESET Kyle Moffett
2011-10-20 19:53 ` Mike Frysinger
2011-10-20 20:10   ` Moffett, Kyle D
2011-10-20 20:22     ` Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2011-12-16  3:32 Kyle Moffett
2011-12-16  5:05 ` Mike Frysinger
2011-12-16 18:49   ` Moffett, Kyle D
2011-12-16 19:30     ` Mike Frysinger
2011-12-16 20:42       ` Moffett, Kyle D
2011-12-16 22:07         ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox