From owner-freebsd-sparc64@FreeBSD.ORG Mon Jul 7 15:01:41 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 0813137B401 for ; Mon, 7 Jul 2003 15:01:41 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E5C743F85 for ; Mon, 7 Jul 2003 15:01:40 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from ns1.xcllnt.net (localhost [127.0.0.1]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h67M1dv1029873 for ; Mon, 7 Jul 2003 15:01:39 -0700 (PDT) (envelope-from marcel@ns1.xcllnt.net) Received: (from marcel@localhost) by ns1.xcllnt.net (8.12.9/8.12.9/Submit) id h67M1dkc029872 for sparc64@freebsd.org; Mon, 7 Jul 2003 15:01:39 -0700 (PDT) (envelope-from marcel) Date: Mon, 7 Jul 2003 15:01:39 -0700 From: Marcel Moolenaar To: sparc64@freebsd.org Message-ID: <20030707220139.GB29689@ns1.xcllnt.net> References: <20030707210543.GA29440@ns1.xcllnt.net> <20030707213416.GG44762@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030707213416.GG44762@funkthat.com> User-Agent: Mutt/1.5.1i 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: Mon, 07 Jul 2003 22:01:41 -0000 On Mon, Jul 07, 2003 at 02:34:16PM -0700, John-Mark Gurney wrote: > Marcel Moolenaar wrote this message on Mon, Jul 07, 2003 at 14:05 -0700: > > I have a current need and a possible future need to talk to hardware > > before newbus has been initialized properly. Yes, we're talking low- > > level console code (again :-), but also remote debugging for example. > > > > Using OFW it's easy enough to get the phandle of the the serial > > console (if the console is serial) and read the "reg" property. > > The address obtained that way is not (yet) suitable for actual > > I/O, because we need to decode it (I expect you know this, but > > it makes a nice introduction :-) > > What exactly are you trying to do with this? Why can't you interact > with the OFW interface to the device instead of trying to twiddle the > bits yourself? 3 reasons: 1. Portability. I'm working on a new UART driver that's going to support all platforms (especially ia64 and sparc64) and most hardware. The low-level console code uses the newbus functions for I/O, but since newbus itself hasn't been initialized, needs machine dependent code to construct tags and handles. See also sparc64_fake_bustag() in sys/sparc64/sparc64/bus_machdep.c for how this is expected to work on sparc64. 2. Consistency. All platforms are capable of supporting remote debugging using a serial interface and have the kernel drop into the debugger immediately after setting up the console. Not all platforms have this implemented. Clearly, we cannot use OFW to communicate over debug ports. 3. Extensibility. Our console code (ie pcvt and syscons) is in need for a replacement. It's too PC specific and is not going to work when UGA is the defacto standard on newer (EFI based) amd64, ia32 and ia64 machines. A possible future console framework is likely to be graphical to allow it to work with newer non-textual hardware. A similar argument applies to low-level console and/or debug port code that needs pre-newbus access to devices for with the OFW interfaces are not suitable. > Get a copy of P1275/D12 (P1275 draft 12) that is freely available. It > will tell you ALL you need to know about it. I have it. It's not answering my questions, specifically, it's not answering Q1. Q2 and on are FreeBSD specific, so clearly those are not answered... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net