mirror of https://github.com/xemu-project/xemu.git
hw/arm/versal: Let boot.c handle PSCI enablement
Instead of setting the CPU psci-conduit and start-powered-off properties in the xlnx-versal-virt board code, set the arm_boot_info psci_conduit field so that the boot.c code can do it. This will fix a corner case where we were incorrectly enabling PSCI emulation when booting guest code into EL3 because it was an ELF file passed to -kernel. (EL3 guest code started via -bios, -pflash, or the generic loader was already being run with PSCI emulation disabled.) Note that EL3 guest code has no way to turn on the secondary CPUs because there's no emulated power controller, but this was already true for EL3 guest code run via -bios, -pflash, or the generic loader. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com> Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Tested-by: Cédric Le Goater <clg@kaod.org> Tested-by: Niek Linnenbank <nieklinnenbank@gmail.com> Message-id: 20220127154639.2090164-8-peter.maydell@linaro.org
This commit is contained in:
parent
50c785f2c7
commit
9437a76e10
|
@ -628,6 +628,9 @@ static void versal_virt_init(MachineState *machine)
|
|||
* When loading an OS, we turn on QEMU's PSCI implementation with SMC
|
||||
* as the PSCI conduit. When there's no -kernel, we assume the user
|
||||
* provides EL3 firmware to handle PSCI.
|
||||
*
|
||||
* Even if the user provides a kernel filename, arm_load_kernel()
|
||||
* may suppress PSCI if it's going to boot that guest code at EL3.
|
||||
*/
|
||||
if (machine->kernel_filename) {
|
||||
psci_conduit = QEMU_PSCI_CONDUIT_SMC;
|
||||
|
@ -637,8 +640,6 @@ static void versal_virt_init(MachineState *machine)
|
|||
TYPE_XLNX_VERSAL);
|
||||
object_property_set_link(OBJECT(&s->soc), "ddr", OBJECT(machine->ram),
|
||||
&error_abort);
|
||||
object_property_set_int(OBJECT(&s->soc), "psci-conduit", psci_conduit,
|
||||
&error_abort);
|
||||
sysbus_realize(SYS_BUS_DEVICE(&s->soc), &error_fatal);
|
||||
|
||||
fdt_create(s);
|
||||
|
@ -679,6 +680,7 @@ static void versal_virt_init(MachineState *machine)
|
|||
s->binfo.loader_start = 0x0;
|
||||
s->binfo.get_dtb = versal_virt_get_dtb;
|
||||
s->binfo.modify_dtb = versal_virt_modify_dtb;
|
||||
s->binfo.psci_conduit = psci_conduit;
|
||||
if (machine->kernel_filename) {
|
||||
arm_load_kernel(&s->soc.fpd.apu.cpu[0], machine, &s->binfo);
|
||||
} else {
|
||||
|
|
|
@ -40,10 +40,8 @@ static void versal_create_apu_cpus(Versal *s)
|
|||
object_initialize_child(OBJECT(s), "apu-cpu[*]", &s->fpd.apu.cpu[i],
|
||||
XLNX_VERSAL_ACPU_TYPE);
|
||||
obj = OBJECT(&s->fpd.apu.cpu[i]);
|
||||
object_property_set_int(obj, "psci-conduit", s->cfg.psci_conduit,
|
||||
&error_abort);
|
||||
if (i) {
|
||||
/* Secondary CPUs start in PSCI powered-down state */
|
||||
/* Secondary CPUs start in powered-down state */
|
||||
object_property_set_bool(obj, "start-powered-off", true,
|
||||
&error_abort);
|
||||
}
|
||||
|
@ -667,7 +665,6 @@ static void versal_init(Object *obj)
|
|||
static Property versal_properties[] = {
|
||||
DEFINE_PROP_LINK("ddr", Versal, cfg.mr_ddr, TYPE_MEMORY_REGION,
|
||||
MemoryRegion *),
|
||||
DEFINE_PROP_UINT32("psci-conduit", Versal, cfg.psci_conduit, 0),
|
||||
DEFINE_PROP_END_OF_LIST()
|
||||
};
|
||||
|
||||
|
|
|
@ -103,7 +103,6 @@ struct Versal {
|
|||
|
||||
struct {
|
||||
MemoryRegion *mr_ddr;
|
||||
uint32_t psci_conduit;
|
||||
} cfg;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue