From owner-freebsd-arm@FreeBSD.ORG Tue Apr 3 19:16:58 2007 Return-Path: X-Original-To: freebsd-arm@FreeBSD.org Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0ABD16A405 for ; Tue, 3 Apr 2007 19:16:58 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.172]) by mx1.freebsd.org (Postfix) with ESMTP id 825B213C458 for ; Tue, 3 Apr 2007 19:16:58 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from mac.com (smtpin08-en2 [10.13.10.153]) by smtpout.mac.com (Xserve/smtpout02/MantshX 4.0) with ESMTP id l33J62vo013486; Tue, 3 Apr 2007 12:06:04 -0700 (PDT) Received: from [172.24.104.104] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mac.com (Xserve/smtpin08/MantshX 4.0) with ESMTP id l33J5wtX019828 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 3 Apr 2007 12:06:00 -0700 (PDT) In-Reply-To: <20070403.100732.74697496.imp@bsdimp.com> References: <20070403154858.GR80382@cicely12.cicely.de> <20070403.100732.74697496.imp@bsdimp.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <19589D66-9DF0-428B-80BD-2ECDC992A1EE@mac.com> Content-Transfer-Encoding: 7bit From: Marcel Moolenaar Date: Tue, 3 Apr 2007 12:05:12 -0700 To: Warner Losh X-Mailer: Apple Mail (2.752.3) X-Brightmail-Tracker: AAAAAA== X-Brightmail-scanned: yes Cc: ticso@cicely12.cicely.de, freebsd-arm@FreeBSD.org, ticso@cicely.de Subject: Re: adding 16550 UART to RM9200 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2007 19:16:58 -0000 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