adding 16550 UART to RM9200

Bernd Walter ticso at cicely12.cicely.de
Tue Apr 3 22:24:48 UTC 2007


On Tue, Apr 03, 2007 at 12:05:12PM -0700, Marcel Moolenaar wrote:
> 
> On Apr 3, 2007, at 9:07 AM, Warner Losh wrote:
> 
> >>I plan to add up to 48 16550 UART to an RM9200 system.
> *snip*
> >>- How can I attach our uart(4) driver to the chips?
> >>It will likely addressed with:
> >>UART0	0x30000000 - 0x30000007 IRQ0
> >>UART1	0x30000008 - 0x3000000f IRQ0
> >>UART2	0x30000010 - 0x30000017 IRQ0
> >>UART3	0x30000018 - 0x3000001f IRQ0
> >>UART4	0x30000020 - 0x30000027 IRQ0
> >>UART5	0x30000028 - 0x3000002f IRQ0
> >>[...]
> >>UART47	0x30000170 - 0x30000177 IRQ0
> >>UART48	0x30000178 - 0x3000017f IRQ0
> >>- I would like to use a 14,7456MHz xtal
> >>How can I tell uart(4) the frequency?
> >
> >I'd consider creating a puc device that attaches to the atmelarm bus.
> 
> Seconded. It's really easy to map all 48 uart(4) with a
> small configuration record in puc(4). This includes the
> ability to specify the RCLK. The only thing you need to
> do is have puc(4) attach to some bus so that it will
> end up using the configuration record. This, as has been
> suggested in another email, can be done with hints.

Yes absolutely - puc is perfect for this.
Just needs a bit of glue code added.

> >This device would need to manage the resources for the sub devices in
> >a minimal way (take a look at pccard_puc for a simple example).  The
> >advantage to doing this is that you also get the clock frequency as a
> >parameter for free.  You'll likely need to have a custom ISR routine,
> >depending on the details of the interrupt structure.  If there's no
> >external way to know quickly which of the parts interrupted, you may
> >be OK with the default one.
> 
> In -CURRENT, puc(4) uses the serdev I/F to ask each uart(4) device
> about pending interrupt status and then handle them in priority
> order. This may be good enough when serial I/O is sufficiently
> low-speed.
> 
> Of course, if you have something like an ILR (interrupt latch
> register), then you can use that with the serdev I/F as well. In
> that case puc(4) will only ask those uart(4) devices that have a
> bit set in the ILR. Given the number of ports, this may be
> worthwhile and it's easy enough to teach puc(4) about your
> particular implementation of an ILR anyway...

I already saw the related code and was very pleased with it.

-- 
B.Walter                http://www.bwct.de      http://www.fizon.de
bernd at bwct.de           info at bwct.de            support at fizon.de


More information about the freebsd-arm mailing list