Subject: Re: 16bit aligned NS16550 variant
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 10/21/2001 04:56:04
>> I'd like to change NS16550 serial driver, 'com' to add 16bit
>> register access support.  [...]

> The correct way to do this is to add a bus_space for the bus the
> device is connected to.  I'm currently using an embedded chip with a
> '550-alike with registers on 32-bit boundaries without any
> modifications to the bus_space_{read,write}_1's in com.c.

I once had to do something similar; an embedded processor I was working
with had a com.c-compatible chip, but it was connected oddly - it
wasn't actually behind any bus; instead, part of what would normally be
memory space was decoded oddly, such that the chip appeared near the
top of what the memory controller decodes as RAM, with registers 8
bytes apart (as if the address lines were permuted before decoding).

I solved this without touching com.c by creating a new bus_space.  It
wasn't very hard and once any of the accesses worked, everything worked.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B