On Fri, 17 May 2024, Andrew Randrianasulu wrote:
> I also tried to add multiple cpu support in openbios qemu ppc arch like it
> was done for sparc, but sparc just dump cpus in / of device tree?
>
> so same trick ofc failed because I do not really know forth so no idea
> where to put for() loop start :)
No Forth needed for that. The device tree is constucred in in
openbios/arch/ppc/qemu/init.c::arch_of_init(). You can try to put a loop
around cpu->initfn(cpu); in this function, you still have the number of
CPUs in temp at that point so maybe something like:
for (int i = 0; i < temp; i++)
cpu->initfn(cpu);
might work but I did not try it.
Thanks.
Right now I am trying to modify hw/intc/openpic.c
case OPENPIC_MODEL_KEYLARGO:
opp->nb_irqs = KEYLARGO_MAX_EXT + KEYLARGO_MAX_IPI;
// because I think this is total number of IRQs, not just external ones?
opp->vid = VID_REVISION_1_2;
opp->vir = VIR_GENERIC;
opp->frr = ((opp->nb_irqs - 1) << FRR_NIRQ_SHIFT) |
((opp->nb_cpus - 1) << FRR_NCPU_SHIFT) |
(opp->vid << FRR_VID_SHIFT);
// for some reason Linux mpic probe still thinks I have only one CPU ? see p. 390 of CPC 945 manual
opp->vector_mask = 0xFF;
opp->tfrr_reset = 4160000;
opp->ivpr_reset = IVPR_MASK_MASK | IVPR_MODE_MASK;
opp->idr_reset = 0;
opp->max_irq = KEYLARGO_MAX_IRQ;
opp->irq_ipi0 = KEYLARGO_IPI_IRQ;
opp->irq_tim0 = KEYLARGO_TMR_IRQ;
opp->brr1 = -1;
opp->mpic_mode_mask = GCR_MODE_MIXED;
for (i = KEYLARGO_MAX_EXT; i < KEYLARGO_MAX_IRQ; i++) {
opp->src[i].type = IRQ_TYPE_FSLSPECIAL;
opp->src[i].level = false;
}
// here i tried to init IPI sources ....
if (opp->nb_cpus != 1) {
//error_setg(errp, "Only UP supported today");
//return;
}
map_list(opp, list_le, &list_count);
break;
}
Regards,
BALATON Zoltan