hw/xtensa: xtfpga: fix bootloader placement in SMP

Use BSP reset PC as a place for the mini-bootloader because in SMP
configurations APs and BSP may have different boot addresses.
This fixes SMP linux uImage boot on xtfpga boards.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
Max Filippov 2019-01-20 16:26:07 -08:00
parent 6230dac89b
commit 288a3f2ed7

View file

@ -234,10 +234,15 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
int n;
for (n = 0; n < smp_cpus; n++) {
cpu = XTENSA_CPU(cpu_create(machine->cpu_type));
env = &cpu->env;
CPUXtensaState *cenv = NULL;
env->sregs[PRID] = n;
cpu = XTENSA_CPU(cpu_create(machine->cpu_type));
cenv = &cpu->env;
if (!env) {
env = cenv;
}
cenv->sregs[PRID] = n;
qemu_register_reset(xtfpga_reset, cpu);
/* Need MMU initialized prior to ELF loading,
* so that ELF gets loaded into virtual addresses