Re: MP(G2)

Michael <[email protected]> Mon, 20 Apr 2026 06:30:22 -0400
Newsgroups gmane.os.netbsd.ports.macppc
Message-ID <20260420063022.5b8a249d@bushmills>
Hello,


first of all, thank you for working on this!

On Sun, 19 Apr 2026 22:20:50 +0900
"Naruaki.Etomi" <[email protected]> wrote:

> It's been a while since I reported NetBSD PR #57394, but I've managed
> to get the second CPU working again on my G2 macppc.
> (It still just runs and generates heat, though.)
> https://dmesgd.nycbug.org/dmesgd?do=3Dview&id=3D8907
>=20
> I'm thinking of using DayStar CPU cards, like those used in the
> 9500/180MP and 9600/200MP.
> UMAX MP configurations don't work.

When we reworked the powerpc interrupt code over 10 years ago we were
unable to test the pre-openpic SMP support for lack of hardware. In
fact I've spent the last decade looking for a suitable, reasonably
priced machine / CPU card, without success :/=20
Getting it to work again shouldn't be too difficult, the difference is
CPU spinup ( as in, which GPIOs control the reset pins of the extra
CPUs ) and IPI delivery. The rest *should* work...

> I'm hobbyist/amateur programmer, so the source code is messy, but I'll
> leave a patch here.
> (NetBSD 11.0_RC2 version)
>=20
> I'll submit a pull request for the Current version once it works a
> bit better.
>=20
> -------------------------------------------------------------------------=
--------------------------
>=20
> Regarding the following design flaws
> =E2=94=97 macppc/cpu.c contains OpenPIC machine's CPU setup code and Grand
> Central machine's CPU setup code.
>     However, the Grand Central side of the code cannot be compiled.
>     My patch fails to compile on the OpenPIC side.
>     How can I fix it neatly?

Why do you need this part?

> diff -Naru src.orig/sys/arch/macppc/macppc/cpu.c
> src/sys/arch/macppc/macppc/cpu.c
> --- src.orig/sys/arch/macppc/macppc/cpu.c 2023-08-03
> 08:16:31.000000000 +0000 +++ src/sys/arch/macppc/macppc/cpu.c
> 2026-04-12 00:58:12.958727695 +0000 @@ -70,12 +70,15 @@
>=20
>  #include "pic_openpic.h"
>  #include "pic_u3_ht.h"
> +#include "pic_ohare.h"
>=20
> +#ifndef NPIC_OHARE
>  #ifndef OPENPIC
>  #if NPIC_OPENPIC > 0
>  #define OPENPIC
>  #endif /* NOPENPIC > 0 */
>  #endif /* OPENPIC */
> +#endif /* NOOHARE */
>=20
>  int cpumatch(device_t, cfdata_t, void *);
>  void cpuattach(device_t, device_t, void *);

... I left it out and both GENERIC.MP and and my other openpic-only SMP
kernels build just fine.

Finally, we register an IPI handler in ipi_hammerhead.c - why not use a
custom handler that deals with the GPIO writes, calls ipi_intr(), and
leave pic_ohare.c alone? That way we wouldn't need special treatment
for IPIs and all the support code would be in ipi_hammerhead.c

have fun
Michael