Subject: siop LE only?
To: None <tech-kern@netbsd.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: tech-kern
Date: 10/07/2001 22:45:58
Hi,

as Amiga should eventually move to use the machine-independent drivers
for siop / osiop (instead of its own amiga/dev/siop.c and amiga/dev/siop2.c),
I've started reading them.

I notice that the siop register offset definitions only apply to little endian
bus modes of the siop chips, e.g. PCI, while the chips in the Amiga (53c770,
53c710) are connected in big endian chip mode.

I wonder what to do about this - if it was only for the sake of Amiga, using
a special bus_space that does translations should work fine. But are there
any other non-PCI siop out there in NetBSD land, that would need a generic
solution? Or would they do the same bus_space abusing?

(I think there are for the old siop (53x700/710), but I forgot which
architecture is affected.) 

Short outline of such a proposal:

siop_softc gets a new field: sc_address_xor

siop_common gets two new functions, maybe defined as a macro or inline for 
efficiency:

siop_write_byte(sc, off, value)  {
	bus_space_write_1(sc->tag, sc->handle, off & sc->sc_address_xor, val)
}

siop_read_byte(sc, off)  {
	return bus_space_read_1(sc->tag, sc->handle, off  & sc->sc_address_xor);
}

Note the xor with sort of a variable value, which adds a new delay. Hiding the
operation inside bus_space access functions, where needed, will avoid this 
delay at least for PCI.)

Regards,
	-is