qemu-patch-raspberry4/hw
Joel Stanley 9bb6d14081 aspeed: Add boot stub for smp booting
This is a boot stub that is similar to the code u-boot runs, allowing
the kernel to boot the secondary CPU.

u-boot works as follows:

 1. Initialises the SMP mailbox area in the SCU at 0x1e6e2180 with default values

 2. Copies a stub named 'mailbox_insn' from flash to the SCU, just above the
    mailbox area

 3. Sets AST_SMP_MBOX_FIELD_READY to a magic value to indicate the
    secondary can begin execution from the stub

 4. The stub waits until the AST_SMP_MBOX_FIELD_GOSIGN register is set to
    a magic value

 5. Jumps to the address in AST_SMP_MBOX_FIELD_ENTRY, starting Linux

Linux indicates it is ready by writing the address of its entrypoint
function to AST_SMP_MBOX_FIELD_ENTRY and the 'go' magic number to
AST_SMP_MBOX_FIELD_GOSIGN. The secondary CPU sees this at step 4 and
breaks out of it's loop.

To be compatible, a fixed qemu stub is loaded into the mailbox area. As
qemu can ensure the stub is loaded before execution starts, we do not
need to emulate the AST_SMP_MBOX_FIELD_READY behaviour of u-boot. The
secondary CPU's program counter points to the beginning of the stub,
allowing qemu to start secondaries at step four.

Reboot behaviour is preserved by resetting AST_SMP_MBOX_FIELD_GOSIGN
when the secondaries are reset.

This is only configured when the system is booted with -kernel and qemu
does not execute u-boot first.

Reviewed-by: Cédric Le Goater <clg@kaod.org>
Tested-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-05-11 10:40:24 +01:00
..
9pfs 9p/proxy: Fix export_flags 2020-03-10 16:12:49 +01:00
acpi hw/arm/virt: Add nvdimm hotplug support 2020-05-04 10:25:02 -04:00
adc hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
alpha hw/ide: Do ide_drive_get() within pci_ide_create_devs() 2020-03-17 12:22:36 -04:00
arm aspeed: Add boot stub for smp booting 2020-05-11 10:40:24 +01:00
audio Compress lines for immediate return 2020-05-04 14:43:22 +02:00
block vhost-user-blk: fix invalid memory access 2020-05-04 10:25:02 -04:00
char hw/char/cadence_uart: add clock support 2020-04-30 15:35:41 +01:00
core Merge tpm 2020/05/06 v1 2020-05-06 21:13:05 +01:00
cpu cpu/arm11mpcore: Set number of GIC priority bits to 4 2020-02-28 16:14:57 +00:00
cris hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
display trivial patches (20200504) 2020-05-05 14:03:28 +01:00
dma dma/xlnx-zdma: Fix descriptor loading (REG) wrt endianness 2020-04-30 11:52:25 +01:00
gpio hw/gpio/aspeed_gpio: Remove dead assignment 2020-05-04 14:43:24 +02:00
hppa hw/ide: Remove unneeded inclusion of hw/ide.h 2020-03-17 12:22:36 -04:00
hyperv lockable: Replace locks with lock guard macros 2020-05-04 16:07:43 +01:00
i2c hw/i2c/pm_smbus: Remove dead assignment 2020-05-04 14:43:24 +02:00
i386 hw: add compat machines for 5.1 2020-05-06 10:12:16 -04:00
ide hw/ide/sii3112: Remove dead assignment 2020-05-04 14:43:24 +02:00
input hw/input/adb-kbd: Remove dead assignment 2020-05-04 14:43:24 +02:00
intc bugfix: Use gicr_typer in arm_gicv3_icc_reset 2020-04-30 11:52:27 +01:00
ipack qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ipmi qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
isa trivial patches (20200504) 2020-05-05 14:03:28 +01:00
lm32 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
m68k hw/m68k: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:47 +01:00
mem trivial patches (20200504) 2020-05-05 14:03:28 +01:00
microblaze hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
mips smbus: Fix spd_data_generate() error API violation 2020-04-29 08:01:52 +02:00
misc hw/misc/zynq_slcr: add clock generation for uarts 2020-04-30 15:35:41 +01:00
moxie hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
net target-arm queue: 2020-04-30 15:45:34 +01:00
nios2 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
nubus hw/m68k: add Nubus support 2019-10-28 19:06:47 +01:00
nvram fw_cfg: Migrate ACPI table mr sizes separately 2020-04-13 06:55:54 -04:00
openrisc hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
pci hw/pci/pcie: Replace PCI_DEVICE() casts with existing variable 2020-05-04 10:25:02 -04:00
pci-bridge pcie_root_port: Add hotplug disabling option 2020-03-08 09:18:29 -04:00
pci-host hw/pci-host: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:47 +01:00
pcmcia hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
ppc ppc patch queue for 2020-04-07 2020-05-07 10:55:12 +01:00
rdma lockable: Replace locks with lock guard macros 2020-05-04 16:07:43 +01:00
riscv hw/riscv/spike: Allow more than one CPUs 2020-04-29 13:16:38 -07:00
rtc rtc: add RTC_ISA_BASE 2020-05-04 10:25:02 -04:00
s390x hw: add compat machines for 5.1 2020-05-06 10:12:16 -04:00
scsi scsi/esp-pci: add g_assert() for fix clang analyzer warning in esp_pci_io_write() 2020-05-04 11:17:27 +02:00
sd various: Remove suspicious '\' character outside of #define in C code 2020-04-29 08:01:51 +02:00
semihosting semihosting: add qemu_semihosting_console_inc for SYS_READC 2020-01-09 11:41:29 +00:00
sh4 hw/sh4: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:47 +01:00
smbios hw/smbios/smbios: Remove unused include 2020-02-06 10:38:57 +01:00
sparc hw/sparc: Use memory_region_init_rom() with read-only regions 2020-03-17 15:18:48 +01:00
sparc64 hw/ide: Do ide_drive_get() within pci_ide_create_devs() 2020-03-17 12:22:36 -04:00
ssi aspeed/smc: Fix DMA support for AST2600 2020-03-23 17:22:30 +00:00
timer hw/timer/pxa2xx_timer: Add assertion to silent static analyzer warning 2020-05-04 14:43:24 +02:00
tpm tpm: tpm-tis-device: set PPI to false by default 2020-05-06 10:12:16 -04:00
tricore hw: Do not initialize MachineClass::is_default to 0 2020-02-28 14:57:19 -05:00
unicore32 hw: Make MachineClass::is_default a boolean type 2020-02-28 14:57:19 -05:00
usb hw/usb/xen-usb.c: Pass struct usbback_req* to usbback_packet_complete() 2020-04-07 16:13:26 +01:00
vfio lockable: replaced locks with lock guard macros where appropriate 2020-05-04 16:07:43 +01:00
virtio Refactor vhost_user_set_mem_table functions 2020-05-04 10:25:03 -04:00
watchdog qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
xen xen/pt: Fix flawed conversion to realize() 2020-04-29 08:01:52 +02:00
xenpv trivial: Remove xenfb_enabled from sysemu.h 2020-02-04 09:00:57 +01:00
xtensa hw/xtensa/xtfpga:fix leak of fdevice tree blob 2020-02-19 10:33:38 +01:00
Kconfig Remove the core bluetooth code 2019-12-17 09:01:14 +01:00
Makefile.objs Remove the core bluetooth code 2019-12-17 09:01:14 +01:00