summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/board/poweroff.c
Commit message (Collapse)AuthorAgeFilesLines
* sandbox: poweroff: migrate to driver probed from device treeAhmad Fatoum2020-10-131-42/+0
| | | | | | | | | | Follow-up will extend the poweroff driver to support system reset source. Set the stage by renaming the driver to power (as it does reset as well) and make it probe from device tree, so it can point at the system reset source syscon via phandle. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: implement actual sandbox reset via exec(2)Ahmad Fatoum2020-09-151-0/+13
| | | | | | | | | | | | | | | | | | | | On Linux, /proc/self/exe is a symlink to the originally exec(2)d executable. We can exec that with the original argv to simulate a reset. This is useful for shorter development cycles on sandbox and in future, could be used to test barebox behavior around resets (e.g. reset reason can be passed through via libc environment). We leave the original hanging reset in place though, because: - Many boards have multiple reset providers and incoming patches will allow users to select a specific one. Having this on sandbox as well makes testing easier. - /proc/self/exe is Linux-specific and wouldn't work when being run on e.g. BSDs or macOS Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: implement simple, ^C-interruptible, restart handlerAhmad Fatoum2020-09-141-0/+12
| | | | | | | | | | Typing reset in sandbox results in hang() while the terminal is not cooked and ^C is ineffective. Only way to terminate barebox then is via kill. Reinstate cooked mode on reset, so ^C termination is possible. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: use 'poweroff' command for exitAntony Pavlov2018-01-251-0/+17
The 'poweroff' command is more appropriate for exit barebox than 'reset'. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>