Re: Panic at boot on 4/330 with cgfour and cgsix

foo bar <[email protected]>
Newsgroups gmane.os.netbsd.ports.sparc
Message-ID <CAOddDr6yZ-7jR+96q=ELdgMyhYPE09+NOUQPcR+FejZ3mdCdLg@mail.gmail.com>
On Wed, Jan 29, 2025 at 12:59 PM David Brownlee <[email protected]> wrote:
> There is no guarantee the issue is in cgfour.c, but it seems like an
> excellent place to start :)
>
> So:
>
> - bus_space_probe() lost an arg (zero in this case)
>
> - bus_space_mmap() gains an arg (offset) as "sc->sc_paddr + poff"
> becomes "sc->sc_paddr, poff"
>
> - conversion from obio_bus_map() to bus_space_map() loses two args.
> They look like offsets as the diff ~line 276 changes "oba->oba_paddr,
> PFOUR_COLOR_OFF_CMAP" to "oba->oba_paddr + PFOUR_COLOR_OFF_CMAP"
> That is supported by sys/arch/sparc/include/autoconf.h which had
> #define obio_bus_map(t, a, o, s, f, v, hp)              \
>         bus_space_map2(t, 0, (long)(a) + o, s, f, (vaddr_t)v, hp)
>
> My first suspicion would be something in the obio_bus_map() to
> bus_space_map() changes, particularly as FOUR_COLOR_OFF_CMAP is
> 0xfff00000 which is 4,293,918,720 - a fair sized offset to pass in on
> a 32 bit machine

So this comment made me curious why that offset is so large and that
turned out to be the problem. It's defined in sys/dev/sun/pfourreg.h
as

#define PFOUR_COLOR_OFF_CMAP 0xfff00000 /* (-0x00100000) */

Since the cgfour works on sun3 I went and looked at what it does and
it has an equivalent file sys/arch/sun3/dev/p4reg.h that says the same
thing. However I noticed the sun3 cgfour driver doesn't use that file
instead it's using sys/arch/sun3/dev/cg4reg.h which says something
different.

/*
 * Memory layout of the Type B hardware (OBMEM)
 * P4 appears on the Sun3/60 at 0xFF300000, so
 * define things relative to that.
 */
#define CG4B_OFF_CMAP  (-0x100000)

So I changed PFOUR_COLOR_OFF_CMAP to (-0x00100000) and I was able to
boot successfully. I don't know if this is the right way to fix it but
at least now I can boot the system and test things some more. Thanks
everyone for the help so far, I'll be trying to run X and other things
soon and hopefully have some good news.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.