[U-Boot] [PATCH 1/4] ARM: define MON_MODE

From: Stephen Warren swarren@nvidia.com
Add a MON_MODE define for ARM's monitor mode. This can be used later by a secure monitor to avoid hard-coding mode IDs.
Signed-off-by: Stephen Warren swarren@nvidia.com --- arch/arm/include/asm/proc-armv/ptrace.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm/include/asm/proc-armv/ptrace.h b/arch/arm/include/asm/proc-armv/ptrace.h index 71df5a9e2538..183b00a08719 100644 --- a/arch/arm/include/asm/proc-armv/ptrace.h +++ b/arch/arm/include/asm/proc-armv/ptrace.h @@ -37,6 +37,7 @@ struct pt_regs { #define FIQ_MODE 0x11 #define IRQ_MODE 0x12 #define SVC_MODE 0x13 +#define MON_MODE 0x16 #define ABT_MODE 0x17 #define HYP_MODE 0x1a #define UND_MODE 0x1b

From: Stephen Warren swarren@nvidia.com
Enhance the PSCI DT editing code to allow setting a PSCI v0.2 compatible value in the DT. The CONFIG_ option is added to the whitelist to match the existing PSCI_1_0 option. While not adding new options to Kconfig isn't ideal, I figure it's better to keep related options together.
Signed-off-by: Stephen Warren swarren@nvidia.com --- arch/arm/lib/psci-dt.c | 2 ++ scripts/config_whitelist.txt | 1 + 2 files changed, 3 insertions(+)
diff --git a/arch/arm/lib/psci-dt.c b/arch/arm/lib/psci-dt.c index 825fe1eefb3c..348df893b7ae 100644 --- a/arch/arm/lib/psci-dt.c +++ b/arch/arm/lib/psci-dt.c @@ -67,6 +67,8 @@ init_psci_node: psci_ver = sec_firmware_support_psci_version(); #elif defined(CONFIG_ARMV7_PSCI_1_0) || defined(CONFIG_ARMV8_PSCI) psci_ver = ARM_PSCI_VER_1_0; +#elif defined(CONFIG_ARMV7_PSCI_0_2) + psci_ver = ARM_PSCI_VER_0_2; #endif if (psci_ver >= ARM_PSCI_VER_1_0) { tmp = fdt_setprop_string(fdt, nodeoff, diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 1a5433759409..049cbda6f126 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -52,6 +52,7 @@ CONFIG_ARMADA100 CONFIG_ARMADA100_FEC CONFIG_ARMADA168 CONFIG_ARMADA_39X +CONFIG_ARMV7_PSCI_0_2 CONFIG_ARMV7_PSCI_1_0 CONFIG_ARMV7_SECURE_BASE CONFIG_ARMV7_SECURE_MAX_SIZE

From: Stephen Warren swarren@nvidia.com
When fixing up the DT to report PSCI support, explicitly enable the node. DTs may ship with the node disabled in case a PSCI implementation is not present, and expect any PSCI implementation to enable the node if they are actually present.
Signed-off-by: Stephen Warren swarren@nvidia.com --- arch/arm/lib/psci-dt.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/lib/psci-dt.c b/arch/arm/lib/psci-dt.c index 348df893b7ae..246f3c7cb84a 100644 --- a/arch/arm/lib/psci-dt.c +++ b/arch/arm/lib/psci-dt.c @@ -116,6 +116,10 @@ init_psci_node: if (tmp) return tmp;
+ tmp = fdt_setprop_string(fdt, nodeoff, "status", "okay"); + if (tmp) + return tmp; + #endif return 0; }

From: Stephen Warren swarren@nvidia.com
If a secure carveout exists, U-Boot cannot use that memory. Fix carveout_size() to reflect this, and hence transitively fix usable_ram_size_below_4g() and board_get_usable_ram_top(). This change ensures that when U-Boot copies the secure monitor code to install it, the copy target is not in-use for U-Boot code/data.
Signed-off-by: Stephen Warren swarren@nvidia.com --- arch/arm/mach-tegra/board2.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c index 25da771607b7..5ecadf705e7e 100644 --- a/arch/arm/mach-tegra/board2.c +++ b/arch/arm/mach-tegra/board2.c @@ -249,6 +249,10 @@ static ulong carveout_size(void) { #ifdef CONFIG_ARM64 return SZ_512M; +#elif defined(CONFIG_ARMV7_SECURE_RESERVE_SIZE) + // BASE+SIZE might not == 4GB. If so, we want the carveout to cover + // from BASE to 4GB, not BASE to BASE+SIZE. + return (0 - CONFIG_ARMV7_SECURE_BASE); #else return 0; #endif
participants (1)
-
Stephen Warren