0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2025-03-01 10:21:22 +00:00
Lakka-LibreELEC/projects/Allwinner/devices/H3/patches/u-boot/0004-sunxi-Put-secure-monitor-in-SRAM-A2.patch
2021-01-30 12:37:36 +01:00

52 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Fri, 20 Nov 2020 01:26:34 -0600
Subject: [PATCH] sunxi: Put secure monitor in SRAM A2
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/arm/include/asm/arch-sunxi/cpu.h | 9 +++++++++
arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 1 -
include/configs/sunxi-common.h | 2 ++
3 files changed, 11 insertions(+), 1 deletion(-)
--- a/arch/arm/include/asm/arch-sunxi/cpu.h
+++ b/arch/arm/include/asm/arch-sunxi/cpu.h
@@ -14,6 +14,15 @@
#include <asm/arch/cpu_sun4i.h>
#endif
+#if defined(CONFIG_MACH_SUN4I)
+#define SUNXI_SRAM_A2_BASE 0x00004000
+#elif defined(CONFIG_MACH_SUN6I) || \
+ defined(CONFIG_MACH_SUN8I) || \
+ defined(CONFIG_MACH_SUN50I) || \
+ defined(CONFIG_MACH_SUN50I_H5)
+#define SUNXI_SRAM_A2_BASE 0x00040000
+#endif
+
#define SOCID_A64 0x1689
#define SOCID_H3 0x1680
#define SOCID_V3S 0x1681
--- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
+++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h
@@ -11,7 +11,6 @@
#define SUNXI_SRAM_A1_BASE 0x00000000
#define SUNXI_SRAM_A1_SIZE (16 * 1024) /* 16 kiB */
-#define SUNXI_SRAM_A2_BASE 0x00004000 /* 16 kiB */
#define SUNXI_SRAM_A3_BASE 0x00008000 /* 13 kiB */
#define SUNXI_SRAM_A4_BASE 0x0000b400 /* 3 kiB */
#define SUNXI_SRAM_D_BASE 0x00010000 /* 4 kiB */
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -192,6 +192,8 @@
#define CONFIG_SPL_PAD_TO 32768 /* decimal for 'dd' */
+#define CONFIG_ARMV7_SECURE_BASE SUNXI_SRAM_A2_BASE + 0x4000
+#define CONFIG_ARMV7_SECURE_MAX_SIZE (16 * 1024) /* 16 KB */
/* I2C */
#if defined CONFIG_AXP152_POWER || defined CONFIG_AXP209_POWER || \