pre-newbus address decoding
Marcel Moolenaar
marcel at xcllnt.net
Mon Jul 7 15:01:41 PDT 2003
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 at xcllnt.net
More information about the freebsd-sparc64
mailing list