qemu-e2k/include/hw/arm
Clement Deschamps 45c078f163 hw/arm/boot: Set NSACR.{CP11, CP10} in dummy SMC setup routine
The boot.c code usually puts the CPU into NS mode directly when it is
booting a kernel.  Since fc1120a7f5 this has included a
requirement to set NSACR to give NS state access to the FPU; we fixed
that for the usual code path in ece628fcf6.  However, it is also
possible for a board model to request an alternative mode of booting,
where its 'board_setup' code hook runs in Secure state and is
responsible for doing the S->NS transition after it has done whatever
work it must do in Secure state.  In this situation the board_setup
code now also needs to update NSACR.

This affects all boards which set info->secure_board_setup, which is
currently the 'raspi' and 'highbank' families.  They both use the
common arm_write_secure_board_setup_dummy_smc().

Set the NSACR CP11 and CP10 bits in the code written by that
function, to allow FPU access in Non-Secure state when using dummy
SMC setup routine.  Otherwise an AArch32 kernel booted on the
highbank or raspi boards will UNDEF as soon as it tries to use the
FPU.

Update the comment describing secure_board_setup to note the new
requirements on users of it.

This fixes a kernel panic when booting raspbian on raspi2.

Successfully tested with:
  2017-01-11-raspbian-jessie-lite.img
  2018-11-13-raspbian-stretch-lite.img
  2019-07-10-raspbian-buster-lite.img

Fixes: fc1120a7f5
Signed-off-by: Clement Deschamps <clement.deschamps@greensocs.com>
Tested-by: Laurent Bonnans <laurent.bonnans@here.com>
Message-id: 20191104151137.81931-1-clement.deschamps@greensocs.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: updated comment to boot.h to note new requirement on
 users of secure_board_setup; edited/rewrote commit message]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-11-11 13:44:16 +00:00
..
allwinner-a10.h Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
armsse.h hw/arm: Correctly disable FPU/DSP for some ARMSSE-based boards 2019-06-17 15:12:25 +01:00
armv7m.h hw/arm/armv7m: Forward "vfp" and "dsp" properties to CPU 2019-06-17 15:12:25 +01:00
aspeed_soc.h hw: Move Aspeed RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:31:44 +02:00
aspeed.h aspeed: Add an AST2600 eval board 2019-10-24 17:16:27 +01:00
bcm2835_peripherals.h hw/arm/bcm2835_peripherals: Use the SYS_timer 2019-10-25 13:09:27 +01:00
bcm2836.h hw/arm/bcm2836: Rename cpus[] as cpu[].core 2019-10-25 13:09:27 +01:00
boot.h hw/arm/boot: Set NSACR.{CP11, CP10} in dummy SMC setup routine 2019-11-11 13:44:16 +00:00
digic.h
exynos4210.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
fdt.h
fsl-imx6.h arm: Rename hw/arm/arm.h to hw/arm/boot.h 2019-05-23 14:47:43 +01:00
fsl-imx6ul.h hw/arm/fsl-imx6ul.c: Remove dead SMP-related code 2019-07-22 14:07:39 +01:00
fsl-imx7.h Include exec/memory.h slightly less 2019-08-16 13:31:52 +02:00
fsl-imx25.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
fsl-imx31.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
linux-boot-if.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
msf2-soc.h msf2: Add Smartfusion2 SoC 2017-09-21 16:36:56 +01:00
nrf51_soc.h Clean up decorations and whitespace around header guards 2019-05-13 08:58:55 +02:00
nrf51.h arm: Stub out NRF51 TWI magnetometer/accelerometer detection 2019-01-29 11:46:03 +00:00
omap.h hw/arm/omap1: Create the RAM in the board 2019-10-22 17:44:01 +01:00
primecell.h
pxa.h hw/pcmcia: Remove PCMCIACardState from "qemu/typedefs.h" 2019-01-22 05:14:32 +01:00
raspi_platform.h hw/arm/bcm2835_peripherals: Use the thermal sensor block 2019-10-25 13:09:27 +01:00
sharpsl.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
smmu-common.h Clean up decorations and whitespace around header guards 2019-05-13 08:58:55 +02:00
smmuv3.h hw/arm/smmuv3: Cache/invalidate config data 2018-06-26 17:50:42 +01:00
soc_dma.h Include exec/memory.h slightly less 2019-08-16 13:31:52 +02:00
stm32f205_soc.h arm: drop intermediate cpu_model -> cpu type parsing and use cpu type directly 2017-09-19 09:09:32 -03:00
sysbus-fdt.h arm/boot: split load_dtb() from arm_load_kernel() 2018-05-10 18:10:56 +01:00
virt.h hw/arm: Factor out powerdown notifier from GPIO 2019-10-05 17:12:09 -04:00
xlnx-versal.h arm: Rename hw/arm/arm.h to hw/arm/boot.h 2019-05-23 14:47:43 +01:00
xlnx-zynqmp.h hw: Move Xilinx ZynqMP RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:28:01 +02:00