Subject: Re: NetBSD/pc98
To: None <kiyohara@kk.iij4u.or.jp>
From: M. Warner Losh <imp@bsdimp.com>
List: current-users
Date: 08/24/2006 16:28:12
hi kiyohara-san

In message: <20060823.011316.38695664.kiyohara@kk.iij4u.or.jp>
            KIYOHARA Takashi <kiyohara@kk.iij4u.or.jp> writes:
: Hi! Tsutsui-san,
: 
: 
: From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
: Date: Tue, 22 Aug 2006 23:47:40 +0900
: 
: > > IMHO can't support on ne(4) currently, because some boards do the map
: > > distorted. It is necessary the handlers as each registers.  (like wdc(4))
: > 
: > Are these variants really NE2000 compatible? Or just using dp8390?
: > If they are not real NE2000, we should have different attachment
: > like sys/arch/mac68k/nubus/if_ae_nubus.c, so that you can handle
: > weird mappings by sc_reg_map[] in struct dp8390_softc.
: 
: The position of each register is the same.  Perhaps, the address pin of
: the board has been changed.  And, FreeBSD guys is calling the function
: isa_alloc_resourcev() for this. This is a function that exists for PC98. 
: 
: (see ed98_alloc_port().)
: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/ed/if_ed_cbus.c?rev=1.27&content-type=text/x-cvsweb-markup
: 
: For instance, LA98 is mapped in base-address + 0x?000. 
: 
:   /* LA/T-98, LD-BDN, PC-9801-77, SB-9801 */
:   static	    bus_addr_t ed98_ioaddr_la98[] = {
: 	    0x0000, 0x1000, 0x2000, 0x3000, 0x4000, 0x5000, 0x6000, 0x7000,
: 	    0x8000, 0x9000, 0xa000, 0xb000, 0xc000, 0xd000, 0xe000, 0xf000,
: 	    0x0100  /* for NEC 77(see below) */
:   };

isa_alloc_resourcev (isa here should be cbus, but is isa for
historical reasons) creates a vector that FreeBSD's pc98 bus_space
uses to access the card.  FreeBSD/i386's bus space would do
approximately:
	inb(base + offset)
while FreeBSD/pc98's bus space would do approximately:
	inb(base[offset]);
to get the port address to read/write.  There appears to be no easy
way to encode the address lists so that the 'bus' can tell the driver
where the ports are located, but maybe netbsd's config system is more
flexible.  The indirection that FreeBSD's bus space does for pc98 for
this bus makes it possible to use the core of the driver unmodified.

However, I think that some modifications for the pc98 were needed to
support a wider range of, for example, storage of MAC address than ISA
ne-2000 cards...

Warner