Subject: Re: NetBSD 1.4N/pmax not bootable on 5000/133
To: None <port-pmax@netbsd.org>
From: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
List: port-pmax
Date: 11/20/1999 13:26:18
>>I really want to see ibus moved out of pmax/ and under /dev (perhaps
>>putting making it dbus).  I think that the ibus device attachments 
>>should be common with the vax port.  the dc/dz for instance.  any
>>wscons support should be port neutral.  
>
>That doesnt actually make much sense.  The "ibus" was supposed
>to be an `internal bus' onto which to attach PMAX (2100, 3100)
>baseboard devices.  The 5100 fell out `for free'.

I have following files under development in [nisimura-pmax-wscons].

$ ls pmax/ibus/*.?
pmax/ibus/dc.c            pmax/ibus/dcms.c          pmax/ibus/if_le_ibus.c
pmax/ibus/dc7085reg.h     pmax/ibus/dctty.c         pmax/ibus/mcclock_ibus.c
pmax/ibus/dc7085var.h     pmax/ibus/ibus.c          pmax/ibus/pm.c
pmax/ibus/dc_ibus.c       pmax/ibus/ibus_pmax.c
pmax/ibus/dckbd.c         pmax/ibus/ibusvar.h

Four files (dc.c, dctty, dcms.c, dckbd.c) have little/no exposure to
MIPS/DECstation.  Since intr_establish/disestablish() are designed to
be independent from how target platforms handle hardware interrupt
registers, there is little obstracle, besides 'ibus' naming
convention, to move {ibus,dc} stuff into dev/dec/ or dev/anothernew/.
Matt points out the fact. 

Jonathan, I analysed your kn01_ca/kn230_ca to have 'ibus' node, and I
guess you have troubles in adapting it to 3max.  So as you already know,
the approach doesn't fit with new-config machinary.  There are
solutions and techniques to avoid verbose intermediate device nodes by
arranging match/attach sequences smartly.

Let's look at 'tc' node.  DEC3000 has a handy way to attach 'tc'
because it has 'tcasic' node just under 'mainbus'.  The existence
of 'tcasic' (TcIA, I guess) comfortable and consistent with wide
varieties of other Alpha product lines.

Now, DECstation has no 'tcasic' hardware and no need to have the
device node.  The challenge is how to cope with existing codes in dev/tc/.
This can be easily done with new-config.

  attach  tc at mainbus with tcbus
  file    arch/pmax/tc/tcbus.c            tc

The trick is, to bypass tcmatch()::dev/tc/tc.c routine and to call
tcmatch() directly from tcbus_match()::pmax/tc/tcbus.c.  In fact, this
is not a magic at all as new-config allows the design.
'platform.iobus' provides a seed point to start device node tree
traverse.  The only one downside is tcattach() and 'struct cfattach
tc_ca' will be never useful in DECstation, but it is neglectable.

A Similiar approach was taken in implementing 3max 'ibus' device node.
Now NetBSD/pmax has a consistent internal which allows each platform to
have its own intr_establish()/disetablish() routines.

I found the easiest way to understand how new-config can be used is to
take a look and analyse ioconf.c generated by config(8).

Tohru Nishimura