openrisc: Initial SMP support
authorStafford Horne <shorne@gmail.com>
Fri, 20 Oct 2017 21:36:58 +0000 (06:36 +0900)
committerStafford Horne <shorne@gmail.com>
Fri, 20 Oct 2017 21:36:58 +0000 (06:36 +0900)
commit13f1c773640171efa8175b1ba6dcd624c1ad68c1
tree8ec3db710faa9852df3b482a38dcc9c739c791e4
parent6b4bbd6aeb8e187c0e3be58c8f77a484f82e6f87
openrisc: Initial SMP support

Wire in ompic and add basic support for SMP.  The OpenRISC is special in
that interrupts for devices are routed to each core's PIC.  This is
achieved using the qemu_irq_split utility, but this currently limits
OpenRISC to 2 cores.

This models the reference architecture described in the OpenRISC spec
1.2 proposal.

  https://github.com/stffrdhrn/doc/raw/arch-1.2-proposal/openrisc-arch-1.2-rev0.pdf

The changes to the intialization of the sim include:

CPU Reset
 o Reset each cpu to the bootstrap PC rather than only a single cpu as
   done before.
 o During Kernel loading the bootstrap PC is saved in a static global.

Network Initialization
 o Connect the interrupt to each CPU
 o Use more simple sysbus_mmio_map() rather than memory_region_add_subregion()

Sim Initialization
 o Initialize the pic and tick timer per cpu
 o Wire in the OMPIC if SMP is enabled
 o Wire the serial irq to each CPU using qemu_irq_split()

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Stafford Horne <shorne@gmail.com>
hw/openrisc/openrisc_sim.c