u-boot-brain/arch/arm/cpu/armv7
Andre Przywara 16212b594f ARM: add assembly routine to switch to non-secure state
While actually switching to non-secure state is one thing, another
part of this process is to make sure that we still have full access
to the interrupt controller (GIC).
The GIC is fully aware of secure vs. non-secure state, some
registers are banked, others may be configured to be accessible from
secure state only.
To be as generic as possible, we get the GIC memory mapped address
based on the PERIPHBASE value in the CBAR register. Since this
register is not architecturally defined, we check the MIDR before to
be from an A15 or A7.
For CPUs not having the CBAR or boards with wrong information herein
we allow providing the base address as a configuration variable.

Now that we know the GIC address, we:
a) allow private interrupts to be delivered to the core
   (GICD_IGROUPR0 = 0xFFFFFFFF)
b) enable the CPU interface (GICC_CTLR[0] = 1)
c) set the priority filter to allow non-secure interrupts
   (GICC_PMR = 0xFF)

Also we allow access to all coprocessor interfaces from non-secure
state by writing the appropriate bits in the NSACR register.

The generic timer base frequency register is only accessible from
secure state, so we have to program it now. Actually this should be
done from primary firmware before, but some boards seems to omit
this, so if needed we do this here with a board specific value.
The Versatile Express board does not need this, so we remove the
frequency from the configuration file here.

After having switched to non-secure state, we also enable the
non-secure GIC CPU interface, since this register is banked.

Since we need to call this routine also directly from the smp_pen
later (where we don't have any stack), we can only use caller saved
registers r0-r3 and r12 to not mess with the compiler.

Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
2013-10-03 21:28:25 +02:00
..
am33xx am335x:Handle worst case scenario for Errata 1.0.24 2013-09-20 16:57:40 -04:00
at91 arm: atmel: add gmac support for sama5d3xek board 2013-08-22 16:49:54 +02:00
exynos Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
highbank Merge branch 'u-boot/master' into u-boot-arm/master 2013-07-25 17:57:46 +02:00
mx5 usb: ehci-mx5: Use 'bool' instead of 'unsigned char' 2013-08-26 21:56:34 +02:00
mx6 mx6: Fix use of improper value in enable_ipu_clock 2013-09-27 13:53:35 +02:00
omap3 arm: omap3: fix SRAM copy and execution sequence 2013-08-28 11:44:58 -04:00
omap4 ARM: OMAP4470: Add Elpida EDB8164B3PF memory configuration 2013-08-28 11:44:58 -04:00
omap5 ARM: OMAP5: Avoid writing into LDO SRAM bits 2013-09-20 16:57:40 -04:00
omap-common ARM: OMAP5: Avoid writing into LDO SRAM bits 2013-09-20 16:57:40 -04:00
rmobile ARM: refactor compiler options in config.mk 2013-09-23 17:03:05 +02:00
s5p-common Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
s5pc1xx Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
socfpga socfpga: Creating driver for Reset Manager 2013-09-06 12:09:06 +02:00
tegra20 config: don't define CONFIG_ARCH_DEVICE_TREE 2013-08-02 18:30:11 -04:00
tegra30 config: don't define CONFIG_ARCH_DEVICE_TREE 2013-08-02 18:30:11 -04:00
tegra114 config: don't define CONFIG_ARCH_DEVICE_TREE 2013-08-02 18:30:11 -04:00
tegra-common Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
u8500 Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
vf610 Merge branch 'master' of git://git.denx.de/u-boot-i2c 2013-07-24 09:50:24 -04:00
zynq arm: zynq: Fix timer loadaddress 2013-09-23 16:26:32 +02:00
cache_v7.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
config.mk ARM: refactor compiler options in config.mk 2013-09-23 17:03:05 +02:00
cpu.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
lowlevel_init.S ARM: use r9 for gd 2013-09-23 18:00:02 +02:00
Makefile ARM: add secure monitor handler to switch to non-secure state 2013-10-03 21:27:11 +02:00
nonsec_virt.S ARM: add assembly routine to switch to non-secure state 2013-10-03 21:28:25 +02:00
start.S Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
syslib.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00