From 97a8196451d786e640fb96895a0e7dbefe6c9ff8 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Sun, 21 Dec 2014 09:45:11 +0000 Subject: ARM: bootm: do not add PSCI to fdt when booting in secure mode. Commit 8bc347e2ec17 "ARM: bootm: Allow booting in secure mode on hyp capable systems" added the capability to select nonsec vs sec mode boot via an environment var. There is a subtle gotcha with this functionality, which is that the PSCI nodes are still created in the fdt (via armv7_update_dt->fdt_psci) even when booting in secure mode. Which means that if the kernel is PSCI aware then it will fail to boot because it will try and do PSCI from secure world, which won't work. This likely didn't get noticed before because the original purpose was to support booting the legacy linux-sunxi kernels which don't understand PSCI. To fix expose boot_nonsec (renaming with armv7_ prefix) outside of bootm.c and use from the virt-dt code. As well as avoiding the creation of the PSCI nodes we should also avoid reserving the secure RAM, so do so. Signed-off-by: Ian Campbell Cc: Hans de Goede Cc: Albert ARIBAUD Cc: Tom Rini Acked-by: Hans de Goede --- arch/arm/cpu/armv7/virt-dt.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm/cpu') diff --git a/arch/arm/cpu/armv7/virt-dt.c b/arch/arm/cpu/armv7/virt-dt.c index 0b0d6a76fc..ad19e4c47c 100644 --- a/arch/arm/cpu/armv7/virt-dt.c +++ b/arch/arm/cpu/armv7/virt-dt.c @@ -90,6 +90,8 @@ static int fdt_psci(void *fdt) int armv7_update_dt(void *fdt) { + if (!armv7_boot_nonsec()) + return 0; #ifndef CONFIG_ARMV7_SECURE_BASE /* secure code lives in RAM, keep it alive */ fdt_add_mem_rsv(fdt, (unsigned long)__secure_start, -- cgit v1.2.1