diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-10-27 22:29:25 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-11-05 19:11:30 +0300 |
commit | 329dccc0675b97d8a1ab9debfb610165262f35c6 (patch) | |
tree | 6f7b32ab18a4807d7967853ff137aa009cb59f73 /drivers | |
parent | c0b19f25a1a2ba935333899e5dcbe4429851cb18 (diff) | |
download | u-boot-329dccc0675b97d8a1ab9debfb610165262f35c6.tar.xz |
sandbox: implement reset
Up to now the sandbox would shutdown upon a cold reset request. Instead it
should be reset.
In our coding we use static variables like LIST_HEAD(efi_obj_list). A reset
can occur at any time, e.g. via an UEFI binary calling the reset service.
The only safe way to return to an initial state is to relaunch the U-Boot
binary.
The reset implementation uses execv() to relaunch U-Boot.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/sysreset/sysreset_sandbox.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/sysreset/sysreset_sandbox.c b/drivers/sysreset/sysreset_sandbox.c index 71cabd1956..7026a48c4b 100644 --- a/drivers/sysreset/sysreset_sandbox.c +++ b/drivers/sysreset/sysreset_sandbox.c @@ -56,6 +56,9 @@ static int sandbox_sysreset_request(struct udevice *dev, enum sysreset_t type) switch (type) { case SYSRESET_COLD: state->last_sysreset = type; + if (!state->sysreset_allowed[type]) + return -EACCES; + sandbox_reset(); break; case SYSRESET_POWER_OFF: state->last_sysreset = type; |