summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/sandbox/cpu/cpu.c9
-rw-r--r--arch/sandbox/dts/test.dts8
-rw-r--r--arch/sandbox/include/asm/u-boot-sandbox.h3
-rw-r--r--configs/sandbox_defconfig1
-rw-r--r--drivers/misc/reset_sandbox.c2
5 files changed, 14 insertions, 9 deletions
diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index e6ddb17..3a7f5a0 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -20,7 +20,7 @@ static struct udevice *map_dev;
unsigned long map_len;
#endif
-void reset_cpu(ulong ignored)
+void sandbox_exit(void)
{
/* Do this here while it still has an effect */
os_fd_restore();
@@ -34,13 +34,6 @@ void reset_cpu(ulong ignored)
os_exit(0);
}
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
- reset_cpu(0);
-
- return 0;
-}
-
/* delay x useconds */
void __udelay(unsigned long usec)
{
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 3c9abb3..79b0175 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -196,6 +196,14 @@
};
};
+ reset@0 {
+ compatible = "sandbox,warm-reset";
+ };
+
+ reset@1 {
+ compatible = "sandbox,reset";
+ };
+
spi@0 {
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/sandbox/include/asm/u-boot-sandbox.h b/arch/sandbox/include/asm/u-boot-sandbox.h
index da87cc3..2f3c3f9 100644
--- a/arch/sandbox/include/asm/u-boot-sandbox.h
+++ b/arch/sandbox/include/asm/u-boot-sandbox.h
@@ -83,4 +83,7 @@ void sandbox_set_enable_pci_map(int enable);
*/
int sandbox_read_fdt_from_file(void);
+/* Exit sandbox (quit U-Boot) */
+void sandbox_exit(void);
+
#endif /* _U_BOOT_SANDBOX_H_ */
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 29e7b5b..907554f 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -46,3 +46,4 @@ CONFIG_UT_TIME=y
CONFIG_UT_DM=y
CONFIG_UT_ENV=y
CONFIG_CLK=y
+CONFIG_RESET=y
diff --git a/drivers/misc/reset_sandbox.c b/drivers/misc/reset_sandbox.c
index 3cc61ed..917121b 100644
--- a/drivers/misc/reset_sandbox.c
+++ b/drivers/misc/reset_sandbox.c
@@ -51,7 +51,7 @@ static int sandbox_reset_request(struct udevice *dev, enum reset_t type)
state->last_reset = type;
if (!state->reset_allowed[type])
return -EACCES;
- /* TODO: sandbox_exit(); */
+ sandbox_exit();
break;
default:
return -ENOSYS;