mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] sandbox: use 'poweroff' command for exit
@ 2018-01-22 10:01 Antony Pavlov
  2018-01-22 13:40 ` Sam Ravnborg
  2018-01-25  7:14 ` Sascha Hauer
  0 siblings, 2 replies; 5+ messages in thread
From: Antony Pavlov @ 2018-01-22 10:01 UTC (permalink / raw)
  To: barebox

The 'poweroff' command is more appropriate for exit
barebox than 'reset'.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/sandbox/board/Makefile            |  2 +-
 arch/sandbox/board/poweroff.c          | 17 +++++++++++++++++
 arch/sandbox/board/restart.c           | 17 -----------------
 arch/sandbox/configs/sandbox_defconfig |  2 +-
 4 files changed, 19 insertions(+), 19 deletions(-)
 create mode 100644 arch/sandbox/board/poweroff.c
 delete mode 100644 arch/sandbox/board/restart.c

diff --git a/arch/sandbox/board/Makefile b/arch/sandbox/board/Makefile
index 333638ced6..b6c271c858 100644
--- a/arch/sandbox/board/Makefile
+++ b/arch/sandbox/board/Makefile
@@ -4,6 +4,6 @@ obj-y += hostfile.o
 obj-y += console.o
 obj-y += devices.o
 obj-y += dtb.o
-obj-y += restart.o
+obj-y += poweroff.o
 
 extra-y += barebox.lds
diff --git a/arch/sandbox/board/poweroff.c b/arch/sandbox/board/poweroff.c
new file mode 100644
index 0000000000..6b5a6dff15
--- /dev/null
+++ b/arch/sandbox/board/poweroff.c
@@ -0,0 +1,17 @@
+#include <common.h>
+#include <init.h>
+#include <poweroff.h>
+#include <mach/linux.h>
+
+static void sandbox_poweroff(struct poweroff_handler *poweroff)
+{
+	linux_exit();
+}
+
+static int poweroff_register_feature(void)
+{
+	poweroff_handler_register_fn(sandbox_poweroff);
+
+	return 0;
+}
+coredevice_initcall(poweroff_register_feature);
diff --git a/arch/sandbox/board/restart.c b/arch/sandbox/board/restart.c
deleted file mode 100644
index 79bf79a556..0000000000
--- a/arch/sandbox/board/restart.c
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <common.h>
-#include <init.h>
-#include <restart.h>
-#include <mach/linux.h>
-
-static void sandbox_restart_cpu(struct restart_handler *restart)
-{
-	linux_exit();
-}
-
-static int restart_register_feature(void)
-{
-	restart_handler_register_fn(sandbox_restart_cpu);
-
-	return 0;
-}
-coredevice_initcall(restart_register_feature);
diff --git a/arch/sandbox/configs/sandbox_defconfig b/arch/sandbox/configs/sandbox_defconfig
index dbaff12bfb..12b2479435 100644
--- a/arch/sandbox/configs/sandbox_defconfig
+++ b/arch/sandbox/configs/sandbox_defconfig
@@ -13,7 +13,6 @@ CONFIG_CMD_IMD=y
 CONFIG_CMD_MEMINFO=y
 # CONFIG_CMD_BOOTM is not set
 CONFIG_CMD_GO=y
-CONFIG_CMD_RESET=y
 CONFIG_CMD_UIMAGE=y
 CONFIG_CMD_PARTITION=y
 CONFIG_CMD_EXPORT=y
@@ -53,6 +52,7 @@ CONFIG_CMD_CRC_CMP=y
 CONFIG_CMD_MM=y
 CONFIG_CMD_DETECT=y
 CONFIG_CMD_FLASH=y
+CONFIG_CMD_POWEROFF=y
 CONFIG_CMD_2048=y
 CONFIG_CMD_OF_NODE=y
 CONFIG_CMD_OF_PROPERTY=y
-- 
2.15.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] sandbox: use 'poweroff' command for exit
  2018-01-22 10:01 [PATCH] sandbox: use 'poweroff' command for exit Antony Pavlov
@ 2018-01-22 13:40 ` Sam Ravnborg
  2018-01-22 14:08   ` Antony Pavlov
  2018-01-25  7:14 ` Sascha Hauer
  1 sibling, 1 reply; 5+ messages in thread
From: Sam Ravnborg @ 2018-01-22 13:40 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

Hi Antony

On Mon, Jan 22, 2018 at 01:01:31PM +0300, Antony Pavlov wrote:
> The 'poweroff' command is more appropriate for exit
> barebox than 'reset'.

Changelog says "reset" but code says "restart".

Could the restart command be useful for others than sandbox?
In other words, is it correct to delete this command?
	
	Sam

>  arch/sandbox/board/restart.c           | 17 -----------------

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] sandbox: use 'poweroff' command for exit
  2018-01-22 13:40 ` Sam Ravnborg
@ 2018-01-22 14:08   ` Antony Pavlov
  2018-01-22 14:27     ` Sam Ravnborg
  0 siblings, 1 reply; 5+ messages in thread
From: Antony Pavlov @ 2018-01-22 14:08 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: barebox

On Mon, 22 Jan 2018 14:40:20 +0100
Sam Ravnborg <sam@ravnborg.org> wrote:

> Hi Antony
> 
> On Mon, Jan 22, 2018 at 01:01:31PM +0300, Antony Pavlov wrote:
> > The 'poweroff' command is more appropriate for exit
> > barebox than 'reset'.
> 
> Changelog says "reset" but code says "restart".

The command name is 'reset'.
No matter what is the file's name.
I can't see 'restart' command in barebox mainline master branch.

> Could the restart command be useful for others than sandbox?
> In other words, is it correct to delete this command?

I see no reason for dropping 'reset' command.
Sometimes 'reset' and 'poweroff' commands are very handy.

> 	
> 	Sam
> 
> >  arch/sandbox/board/restart.c           | 17 -----------------


-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] sandbox: use 'poweroff' command for exit
  2018-01-22 14:08   ` Antony Pavlov
@ 2018-01-22 14:27     ` Sam Ravnborg
  0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2018-01-22 14:27 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Mon, Jan 22, 2018 at 05:08:31PM +0300, Antony Pavlov wrote:
> On Mon, 22 Jan 2018 14:40:20 +0100
> Sam Ravnborg <sam@ravnborg.org> wrote:
> 
> > Hi Antony
> > 
> > On Mon, Jan 22, 2018 at 01:01:31PM +0300, Antony Pavlov wrote:
> > > The 'poweroff' command is more appropriate for exit
> > > barebox than 'reset'.
> > 
> > Changelog says "reset" but code says "restart".
> 
> The command name is 'reset'.
> No matter what is the file's name.
> I can't see 'restart' command in barebox mainline master branch.

Sorry - I messed it up somehow.
The changelog said command and I did not see that this was
not a barebox command but a board thing.

So everything looks fine.

This is what happens writing mails with some lingering flu I guess.

	Sam

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] sandbox: use 'poweroff' command for exit
  2018-01-22 10:01 [PATCH] sandbox: use 'poweroff' command for exit Antony Pavlov
  2018-01-22 13:40 ` Sam Ravnborg
@ 2018-01-25  7:14 ` Sascha Hauer
  1 sibling, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2018-01-25  7:14 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Mon, Jan 22, 2018 at 01:01:31PM +0300, Antony Pavlov wrote:
> The 'poweroff' command is more appropriate for exit
> barebox than 'reset'.
> 
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
>  arch/sandbox/board/Makefile            |  2 +-
>  arch/sandbox/board/poweroff.c          | 17 +++++++++++++++++
>  arch/sandbox/board/restart.c           | 17 -----------------
>  arch/sandbox/configs/sandbox_defconfig |  2 +-
>  4 files changed, 19 insertions(+), 19 deletions(-)
>  create mode 100644 arch/sandbox/board/poweroff.c
>  delete mode 100644 arch/sandbox/board/restart.c

Applied, thanks

Sascha

> 
> diff --git a/arch/sandbox/board/Makefile b/arch/sandbox/board/Makefile
> index 333638ced6..b6c271c858 100644
> --- a/arch/sandbox/board/Makefile
> +++ b/arch/sandbox/board/Makefile
> @@ -4,6 +4,6 @@ obj-y += hostfile.o
>  obj-y += console.o
>  obj-y += devices.o
>  obj-y += dtb.o
> -obj-y += restart.o
> +obj-y += poweroff.o
>  
>  extra-y += barebox.lds
> diff --git a/arch/sandbox/board/poweroff.c b/arch/sandbox/board/poweroff.c
> new file mode 100644
> index 0000000000..6b5a6dff15
> --- /dev/null
> +++ b/arch/sandbox/board/poweroff.c
> @@ -0,0 +1,17 @@
> +#include <common.h>
> +#include <init.h>
> +#include <poweroff.h>
> +#include <mach/linux.h>
> +
> +static void sandbox_poweroff(struct poweroff_handler *poweroff)
> +{
> +	linux_exit();
> +}
> +
> +static int poweroff_register_feature(void)
> +{
> +	poweroff_handler_register_fn(sandbox_poweroff);
> +
> +	return 0;
> +}
> +coredevice_initcall(poweroff_register_feature);
> diff --git a/arch/sandbox/board/restart.c b/arch/sandbox/board/restart.c
> deleted file mode 100644
> index 79bf79a556..0000000000
> --- a/arch/sandbox/board/restart.c
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -#include <common.h>
> -#include <init.h>
> -#include <restart.h>
> -#include <mach/linux.h>
> -
> -static void sandbox_restart_cpu(struct restart_handler *restart)
> -{
> -	linux_exit();
> -}
> -
> -static int restart_register_feature(void)
> -{
> -	restart_handler_register_fn(sandbox_restart_cpu);
> -
> -	return 0;
> -}
> -coredevice_initcall(restart_register_feature);
> diff --git a/arch/sandbox/configs/sandbox_defconfig b/arch/sandbox/configs/sandbox_defconfig
> index dbaff12bfb..12b2479435 100644
> --- a/arch/sandbox/configs/sandbox_defconfig
> +++ b/arch/sandbox/configs/sandbox_defconfig
> @@ -13,7 +13,6 @@ CONFIG_CMD_IMD=y
>  CONFIG_CMD_MEMINFO=y
>  # CONFIG_CMD_BOOTM is not set
>  CONFIG_CMD_GO=y
> -CONFIG_CMD_RESET=y
>  CONFIG_CMD_UIMAGE=y
>  CONFIG_CMD_PARTITION=y
>  CONFIG_CMD_EXPORT=y
> @@ -53,6 +52,7 @@ CONFIG_CMD_CRC_CMP=y
>  CONFIG_CMD_MM=y
>  CONFIG_CMD_DETECT=y
>  CONFIG_CMD_FLASH=y
> +CONFIG_CMD_POWEROFF=y
>  CONFIG_CMD_2048=y
>  CONFIG_CMD_OF_NODE=y
>  CONFIG_CMD_OF_PROPERTY=y
> -- 
> 2.15.1
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2018-01-25  7:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-22 10:01 [PATCH] sandbox: use 'poweroff' command for exit Antony Pavlov
2018-01-22 13:40 ` Sam Ravnborg
2018-01-22 14:08   ` Antony Pavlov
2018-01-22 14:27     ` Sam Ravnborg
2018-01-25  7:14 ` Sascha Hauer

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