summaryrefslogtreecommitdiff
path: root/include/mach/rockchip/bootrom.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2023-04-19 08:59:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-04-19 08:59:13 +0200
commitd5a06d4800305af6740cde3894d8f4b65b26b392 (patch)
tree2e70629b56a411184faf62496410f87f48b47642 /include/mach/rockchip/bootrom.h
parent8dd99807baf0b15b74e68e4e66d93bb0fe597621 (diff)
parent7bf493b1a646e1ee2e88cc7d41b462a6714eafee (diff)
downloadbarebox-d5a06d4800305af6740cde3894d8f4b65b26b392.tar.gz
Merge branch 'for-next/rockchip'
Diffstat (limited to 'include/mach/rockchip/bootrom.h')
-rw-r--r--include/mach/rockchip/bootrom.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/mach/rockchip/bootrom.h b/include/mach/rockchip/bootrom.h
new file mode 100644
index 0000000000..96eb147ae4
--- /dev/null
+++ b/include/mach/rockchip/bootrom.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __MACH_ROCKCHIP_BOOTROM_H
+#define __MACH_ROCKCHIP_BOOTROM_H
+
+#include <linux/compiler.h>
+#include <linux/string.h>
+#include <asm/barebox-arm.h>
+
+struct rockchip_scratch_space {
+ u32 irom[16];
+};
+
+static inline void rockchip_store_bootrom_iram(ulong membase,
+ ulong memsize,
+ const void *iram)
+{
+ void *dst = (void *)__arm_mem_scratch(membase + memsize);
+ memcpy(dst, iram, sizeof(struct rockchip_scratch_space));
+}
+
+static inline const struct rockchip_scratch_space *rockchip_scratch_space(void)
+{
+ return arm_mem_scratch_get();
+}
+
+void rockchip_parse_bootrom_iram(const void *iram);
+
+int rockchip_bootsource_get_active_slot(void);
+
+
+#endif