Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Apr 2007 12:05:12 -0700
From:      Marcel Moolenaar <xcllnt@mac.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        ticso@cicely12.cicely.de, freebsd-arm@FreeBSD.org, ticso@cicely.de
Subject:   Re: adding 16550 UART to RM9200
Message-ID:  <19589D66-9DF0-428B-80BD-2ECDC992A1EE@mac.com>
In-Reply-To: <20070403.100732.74697496.imp@bsdimp.com>
References:  <20070403154858.GR80382@cicely12.cicely.de> <20070403.100732.74697496.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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.

> 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...

-- 
Marcel Moolenaar
xcllnt@mac.com





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19589D66-9DF0-428B-80BD-2ECDC992A1EE>