aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-01-20 16:26:07 -0800
committerMax Filippov <jcmvbkbc@gmail.com>2019-01-24 10:44:25 -0800
commit288a3f2ed70400bcb6fbabbe30410ee58f8263ba (patch)
tree252e021a51df85d6b1884d21714973ca400267d3 /hw
parent6230dac89b19d50567c44434b37a4c48a84ec200 (diff)
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>
Diffstat (limited to 'hw')
-rw-r--r--hw/xtensa/xtfpga.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index 21094319a6..d3afdfc247 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -234,10 +234,15 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
int n;
for (n = 0; n < smp_cpus; n++) {
+ CPUXtensaState *cenv = NULL;
+
cpu = XTENSA_CPU(cpu_create(machine->cpu_type));
- env = &cpu->env;
+ cenv = &cpu->env;
+ if (!env) {
+ env = cenv;
+ }
- env->sregs[PRID] = n;
+ 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