Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jul 2003 14:05:43 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        sparc64@FreeBSD.org
Subject:   pre-newbus address decoding
Message-ID:  <20030707210543.GA29440@ns1.xcllnt.net>

next in thread | raw e-mail | index | archive | help
[this probably applies to PowerPC as well. Not CC'd however]

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 :-)

Q1: Is there an OFW client interface that decodes the unit address,
    much like the decode-unit method?

The following applies only when the answer to the previous question
is no.

If OFW does not have an interface for this, then we have to do it
the hard way.

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?

Q3: Is there an upper bound to the space needed for the value of the
    "address-ranges" property so that we can obtain the necessary
    information from OFW, without having to allocate memory and thus
    make it possible to decode before the VM is up and running?

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)?

Thanks,

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030707210543.GA29440>