linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [RFC] AmigaOne device tree source v2
Date: Fri, 7 Sep 2007 10:20:49 +1000	[thread overview]
Message-ID: <20070907002049.GB26079@localhost.localdomain> (raw)
In-Reply-To: <22dc6fa3382b591fe721c1b9dee88097@kernel.crashing.org>

On Thu, Sep 06, 2007 at 03:56:38PM +0200, Segher Boessenkool wrote:
> > That looks totally bogus.  Unlike Segher, I think there are a few
> > cases where overlapping reg and ranges can make sense
> 
> That's not unlike me -- I may have lower tolerance for it though :-)

I see.  Can't imagine how I got another impression... :-p

: Date: Thu, 19 Jul 2007 17:51:17 +0200
: From: Segher Boessenkool <segher@kernel.crashing.org>
: Subject: Re: [PATCH] Add 8548CDS with Arcadia 3.0 support
...
: "reg" and "ranges" overlap, that can't be right.

: Date: Tue, 7 Aug 2007 18:51:04 +0200
: From: Segher Boessenkool <segher@kernel.crashing.org>
: Subject: Re: [PATCH 2/6] PowerPC 440EPx: Sequoia DTS
...
: > To be honest this looks rather to me like another case where having
: > overlapping 'reg' and 'ranges' would actually make sense.
:
: It never makes sense.  You should give the "master" device
: the full "reg" range it covers, and have it define its own
...

> > (PCI bridges
> > where config space is accessed indirectly via MMIO registers which lie
> > in the legacy ISA IO space is an example).
> 
> That's a good example yes.
> 
> > But this doesn't look like
> > such a case - it just looks like whoever did the device tree
> > misunderstood the distinction between reg and ranges.
> 
> Indeed.
> 
> >>> PCI legacy I/O is not direct mapped: there is no legacy I/O on a
> >>> PowerPC system bus.  So, it can not be mentioned in the "ranges"
> >>> property, but the PHB registers used to access it should be shown
> >>> in the "reg" property.  It could be a simple linear window (it
> >>> sounds like it is here?), but it could for example also be 
> >>> implemented
> >>> via an address/data register pair.
> >
> > Err... huh?  The legacy IO space is assigned a block of addresses in
> > 3-word "OF-PCI-space by the PCI binding.  When that is translated into
> > an MMIO range by the bridge, there's no reason that can't be encoded
> > into the ranges property.
> 
> Sure, it can be encoded like that.  But does it make sense?
> You cannot use legacy I/O space as normal memory space.

Well, no, but you can't use *any* MMIO space as normal memory space,
and that's handled routinely by 'ranges'.

> On an arch like x86, where "I/O addresses" exist on the system
> bus as well, it would make sense, since you can translate I/O
> addresses to I/O addresses that way (except on x86 even it cannot
> be done either, since I/O addresses cannot be encoded on the root
> bus -- at least not in existing device trees.  There is no official
> x86 binding yet though).

What!?  This is nuts, Segher.  Why should the binding have to define
some bridge-specific way of encoding the legacy I/O information, when
the PCI-binding's address encoding plus 'ranges' provides a perfectly
unambiguous way of doing so.  *And* it makes the normal semantics of
ranges do just the right thing for a subordinate PCI<->ISA bridge.

> Also, from a driver standpoint, a PHB driver needs to find out
> two main things about the bridge: a) how and where to generate
> config cycles; b) how and where to generate legacy I/O cycles.
> It is told "how" by the "compatible" property, and "where" by
> the "reg" property, normally.
> 
> But yes, you _can_ use "ranges" for this purpose on PHBs where
> legacy I/O is linearly mapped.  It just doesn't make much sense.
> The binding for your specific PHB should tell you what to do.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  parent reply	other threads:[~2007-09-07  0:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-31 17:50 [RFC] AmigaOne device tree source v2 Gerhard Pircher
2007-09-03  1:34 ` David Gibson
2007-09-03  8:41   ` Benjamin Herrenschmidt
2007-09-03 10:02     ` Segher Boessenkool
2007-09-03 10:12       ` David Gibson
2007-09-03 16:11         ` Gerhard Pircher
2007-09-03 22:52           ` Segher Boessenkool
2007-09-04  0:27             ` David Gibson
2007-09-06 13:31               ` Segher Boessenkool
2007-09-04 12:20             ` Gerhard Pircher
2007-09-06 13:41               ` Segher Boessenkool
2007-09-03 14:58   ` Gerhard Pircher
2007-09-03 22:32     ` Segher Boessenkool
2007-09-04 11:49       ` Gerhard Pircher
2007-09-05  2:48         ` David Gibson
2007-09-05 11:54           ` Gerhard Pircher
2007-09-06 14:00             ` Segher Boessenkool
2007-09-06 14:09               ` Sven Luther
2007-09-06 14:42                 ` Segher Boessenkool
2007-09-06 13:56           ` Segher Boessenkool
2007-09-06 14:15             ` PCI I/O space -- reg or ranges? Scott Wood
2007-09-06 20:51               ` Gerhard Pircher
2007-09-06 21:01                 ` Segher Boessenkool
2007-09-07  0:20             ` David Gibson [this message]
2007-09-06 13:36         ` [RFC] AmigaOne device tree source v2 Segher Boessenkool
2007-09-06 21:09           ` Gerhard Pircher
2007-09-07  0:21           ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070907002049.GB26079@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).