From owner-freebsd-sparc64@FreeBSD.ORG Tue Jul 8 12:38:04 2003 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 70C2237B401 for ; Tue, 8 Jul 2003 12:38:04 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id EA77643FBD for ; Tue, 8 Jul 2003 12:38:02 -0700 (PDT) (envelope-from tmoestl@gmx.net) Received: (qmail 18250 invoked by uid 65534); 8 Jul 2003 19:38:01 -0000 Received: from p508E765D.dip.t-dialin.net (EHLO galatea.local) (80.142.118.93) by mail.gmx.net (mp016) with SMTP; 08 Jul 2003 21:38:01 +0200 Received: from tmm by galatea.local with local (Exim 4.20 #1) id 19ZyJK-0000mn-S7; Tue, 08 Jul 2003 21:39:34 +0200 Date: Tue, 8 Jul 2003 21:39:34 +0200 From: Thomas Moestl To: Marcel Moolenaar Message-ID: <20030708193934.GB878@crow.dom2ip.de> Mail-Followup-To: Marcel Moolenaar , sparc64@freebsd.org References: <20030707210543.GA29440@ns1.xcllnt.net> <20030708132815.GA659@crow.dom2ip.de> <20030708181526.GA31152@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030708181526.GA31152@dhcp01.pn.xcllnt.net> User-Agent: Mutt/1.4.1i Sender: Thomas Moestl cc: sparc64@freebsd.org Subject: Re: pre-newbus address decoding X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jul 2003 19:38:04 -0000 On Tue, 2003/07/08 at 11:15:26 -0700, Marcel Moolenaar wrote: > On Tue, Jul 08, 2003 at 03:28:15PM +0200, Thomas Moestl wrote: > > > > > > Q2: Am I correct that the basic logic is to traverse to the root and > > > decode the address at each intermediate parent, until we end up > > > with what is then the physical address? > > > > Yes. I've put some old sio patches which I use at > > http://people.freebsd.org/~tmm/sio-s64-20030612.diff > > in case you are interested (this is a quick and dirty hack; the > > code I use to attach the console is at the very end). As you can see, > > I special-cased the register mapping at PCI and ISA/EBus level (which > > I guess you want to avoid to be more generic). > > Cool. This is exactly what I'm looking for. > > > > Q4: Given the above, does it make sense to add decoding functionality > > > to the bus drivers as a low-level interface between low-level > > > console drivers and OFW (ie not using newbus data structures)? > > > > I guess a generic mapping function would be preferable if it is > > possible and all firmware implementation are close enough to the > > standard to allow this. The bus drivers will mostly just do the same, > > but attaching them early would probably be more trouble. > > Ok. I'll add one on the uart branch. At first it'll be a copy of what > you have in the sio patch, but it'll probably evolve. Unfortunately > all my UARTs are on EBUS. Then again, a PCI multi I/O card shouldn't > be that expensive... EBus is very much like ISA (it was designed to allow easy adaption of devices designed for ISA); this includes the firmware properties, so the sparc64 EBus and ISA code share functions to handle them. > Last questions: Since I create a fake bustag, I need to have a valid > bus space type (bus_space_asi index). > Am I correct that the PCI types use little endian reads and writes? > If so, can I avoid the problem by always using 8-byte reads/writes > and just use type 0 or is the magic slightly more complex and do I > need to keep track of a proper type while traversing to the root? At the moment, there is no more magic. It should also be easy to track the types though; the PCI ones also apply to EBus and ISA. - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C