I can’t figure out this race condition but it causes an IRQ storm. I feel like I’m in the old days of PC’s when to had IRQ conflicts and had to sort them yourself deep in the bios. As a Mac person I only had to deal with that on a few friends PC’s. Starting the second CPU in a on state rather than halted just makes the race condition worse, twice as fast, and Openbios doesn’t want to get to the prompt, but throwing 3, 8, or 9 CPUs at it in a running state gets me to the prompt, but it ignores -prom-env setting with anything more that three.
300% cpu usage just speeds up the race condition and IRQ storm so IDE craps out before you can load BootX or a linux kernel.
Then noting happens but the IRG storm and GPIO 1 asserting 0, likely to all the other CPUs, and that is likely the race conditions and pulling that low trigger the IRQ storm.
I can’t make it stop, I even tied all IRQ and Interrupts handling to CPU0, and that working until the OS Kenral loads and starts sending stuff to CPU1, which is still in a halted state unless I start it with my hack. Even with only CPU0 dealing with IRQs and Interrupts the race condition is still there and the IRQ storm.
I have to figure out why GPIO 1keeps getting triggered in a loop to pull low????
On Feb 19, 2025, at 1:29 AM, Jd Lyons lyons_dj@yahoo.com wrote:
Thanks Mark, I got side traced thinking open-pic when I should have been looking at GPIO because it is the one that is the gpio-parent there should be no interrupt-parent property. I think the gpio phandle is 7.
Can you tell me how IRQ’s get assigned to CPU0?
Interrupts?
On Feb 18, 2025, at 5:00 PM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 18/02/2025 21:34, Jd Lyons via OpenBIOS wrote:
I don’t know why, I can’t seem to get Openbios to set and interrupt-parent in the init.c for any /cpus, this code should work, no? void add_cpu_nodes(void) { int num_cpus = fw_cfg_read_i32(FW_CFG_NB_CPUS); printk("Detected %d CPUs\n", num_cpus); /* Ensure /cpus node exists */ phandle cpus_node = dt_find_by_path("/cpus"); if (!cpus_node) { printk("ERROR: /cpus node not found! Delaying CPU setup.\n"); return; } /* Wait until the interrupt controller exists */ phandle intc_node = NULL; int retries = 5; while (retries-- > 0) { intc_node = dt_find_by_path("/pci/mac-io/@40000");
Is this for the mac99 machine? If so you probably want /pci@f2000000/mac-io@c/interrupt-controller@40000 (see the output of show-devs for the full device paths).
if (intc_node) { break; } printk("Waiting for /pci/mac-io/@40000...\\n"); msleep(100); // Wait 100ms before retrying } if (!intc_node) { printk("ERROR: Interrupt controller (/pci/mac-io/@40000) not found! SMP will not work.\\n"); return; } for (int i = 0; i < num_cpus; i++) { phandle cpu_node = dt_new_node(cpus_node); if (!cpu_node) { printk("ERROR: Failed to create CPU node for CPU %d!\\n", i); continue; } dt_set_property_string(cpu_node, "device_type", "cpu"); dt_set_property_string(cpu_node, "compatible", "PowerPC,G4"); /* Assign a unique CPU interrupt */ int cpu_irq[2] = { 16 + i, 0 }; dt_set_property_cells(cpu_node, "interrupts", cpu_irq, 2); printk("CPU %d assigned IRQ %d\\n", i, cpu_irq[0]); /* Ensure interrupt-parent is set */ dt_set_property_phandle(cpu_node, "interrupt-parent", intc_node); printk("CPU %d linked to interrupt-parent /pci/mac-io/@40000\\n", i); /* Register CPU ID */ PUSH(i); fword("encode-int"); push_str("reg"); fword("property"); fword("finish-device"); printk("Initialized CPU %d\\n", i); }
}
ATB,
Mark.