To help to at least solve the CPU reset problem and to understand better
what's going on I've collected the patches that are needed at a minimum. This
won't allow SMP to work yet but hopefully at least help bring everybody
interested in this on the same page and show what I was trying to explain in
the past few days to at least get past that.
Attached is a patch to openbios that adds device nodes for multiple CPUs but
I did not check if this is correct. Maybe the properties need to be adjusted
to match the real machine. I think we would need a PowerMac3,3 device tree
which is the closest dual CPU machine to the PowerMac3,1 that we currently
emulate but up to PowerMac3,6 may be similar enough. There are some device
tree dumps in the previous thread from last year for PowerMac3,6 but those
are not easy to read. Could somebody with a real machine get a text dump from
OpenFirmware, something like this:
http://nandra.segv.jp/NetBSD/G4.dump-device-tree.txt
but for PowerMac3,3 or similar with two G4 CPUs. Then compare what you get in
OpenBIOS with this patch to that and correct the CPU nodes.
The other patch is for QEMU that hacks the gpio register Linux writes to
reset the CPU to change the corresponding irq and connects that to the CPU
reset. (I've sent two clean up patches separately that are useful
regardless.) I don't know if this IRQ should connect to HRESET or SRESET on
the CPU but neither seems to work and Linux still says the CPU is stuck even
if the CPU now gets the reset interrupt. This can be verified by adding
-trace enable="macio*" -trace enable="ppc_irq*" (or you may want to tune the
latter as one of these is very verbose). The second CPU seems to start
stopped but then gets an IRQ on pin 5 (see /* 6xx bus input pins */ in
qemu/target/ppc/cpu.h line 2552, 5 is PPC6xx_INPUT_INT) before it's reset so