aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-12-23 18:10:15 -0500
committerTom Rini <trini@konsulko.com>2020-12-23 18:10:15 -0500
commit958b9e2482538ebfeb2e1161257603d4dec498cb (patch)
tree6b9283b58c8684a239d25492c2e8a8b1319be8ca /arch/sandbox/cpu
parent8351a29d2df18c92d8e365cfa848218c3859f3d2 (diff)
parentec1add1e51affd4aacc308dc37439ea13dc1b70e (diff)
Merge tag 'dm-next-23dec20' of git://git.denx.de/u-boot-dm into next
dm: New sequence number implementation SPI handling of bus with different-speed devices patman supression of sign-offs
Diffstat (limited to 'arch/sandbox/cpu')
-rw-r--r--arch/sandbox/cpu/Makefile2
-rw-r--r--arch/sandbox/cpu/cache.c23
-rw-r--r--arch/sandbox/cpu/start.c10
3 files changed, 34 insertions, 1 deletions
diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index bac96447d5..de7fe7f391 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -5,7 +5,7 @@
# (C) Copyright 2000-2003
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
-obj-y := cpu.o state.o
+obj-y := cache.o cpu.o state.o
extra-y := start.o os.o
extra-$(CONFIG_SANDBOX_SDL) += sdl.o
obj-$(CONFIG_SPL_BUILD) += spl.o
diff --git a/arch/sandbox/cpu/cache.c b/arch/sandbox/cpu/cache.c
new file mode 100644
index 0000000000..46c62c0b44
--- /dev/null
+++ b/arch/sandbox/cpu/cache.c
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2020, Heinrich Schuchardt <xypron.glpk@gmx.de>
+ */
+
+#include <common.h>
+#include <cpu_func.h>
+#include <asm/state.h>
+
+void flush_cache(unsigned long addr, unsigned long size)
+{
+ /* Clang uses (char *) parameters, GCC (void *) */
+ __builtin___clear_cache((void *)addr, (void *)(addr + size));
+}
+
+void invalidate_icache_all(void)
+{
+ struct sandbox_state *state = state_get_current();
+
+ /* Clang uses (char *) parameters, GCC (void *) */
+ __builtin___clear_cache((void *)state->ram_buf,
+ (void *)(state->ram_buf + state->ram_size));
+}
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index f6c98545e0..fe494aef75 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <dm/root.h>
+#include <efi_loader.h>
#include <errno.h>
#include <init.h>
#include <os.h>
@@ -406,6 +407,15 @@ void state_show(struct sandbox_state *state)
printf("\n");
}
+void __efi_runtime EFIAPI efi_reset_system(
+ enum efi_reset_type reset_type,
+ efi_status_t reset_status,
+ unsigned long data_size, void *reset_data)
+{
+ os_fd_restore();
+ os_relaunch(os_argv);
+}
+
void sandbox_reset(void)
{
/* Do this here while it still has an effect */