From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
devicetree-discuss
<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
Linux Kernel Mailing List
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH] of: Have of_device_add call platform_device_add rather than device_add
Date: Thu, 22 Nov 2012 15:36:21 +0000 [thread overview]
Message-ID: <20121122153621.452CA3E129E@localhost> (raw)
In-Reply-To: <20121121181430.GE6406-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
On Wed, 21 Nov 2012 11:14:30 -0700, Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote:
> On Wed, Nov 21, 2012 at 06:07:46PM +0000, Grant Likely wrote:
>
> > > Which is nesting the generic gpio driver under a larger region..
> >
> > Try two sibling nodes with overlapping addresses. There are powerpc
> > device trees doing that even though it isn't legal by the ofw and
> > epapr specs.
>
> Both my examples were using sibling nodes in the OF tree.
>
> pex@e0000000 {
> device_type = "pci";
> ranges = <0x02000000 0x00000000 0x00000000 0xe0000000 0x0 0x8000000>;
> bus-range = <0x0 0xFF>;
> chip@0 {
> ranges = <0x02000000 0x00000000 0x00000000 0x02000000 0x00000000 0x00000000 0x0 0x8000000>;
> chip_control@0 {
> compatible = "orc,chip,control";
> assigned-addresses = <0x02000000 0x0 0x0 0x0 4096>;
> };
>
> gpio3: chip_gpio@8 {
> #gpio-cells = <2>;
> compatible = "linux,basic-mmio-gpio";
> gpio-controller;
> reg-names = "dat", "set", "dirin";
> assigned-addresses = <0x02000000 0x0 0x8 0x0 4>,
> <0x02000000 0x0 0xc 0x0 4>,
> <0x02000000 0x0 0x10 0x0 4>;
> };
>
> Non-conformant yes, but it is the simplest way to get linux to bind
> two drivers to the same memory space.
Hmm... I've not tried it with assigned-address. I tried with two sibling
platform devices using just the 'reg' property. That the kernel will
complain about. For powerpc-only, the patch I posted allows the device
to get registered anyway even though the range incorrectly overlaps.
g.
WARNING: multiple messages have this Message-ID (diff)
From: Grant Likely <grant.likely@secretlab.ca>
To: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Rob Herring <rob.herring@calxeda.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devicetree-discuss <devicetree-discuss@lists.ozlabs.org>
Subject: Re: [PATCH] of: Have of_device_add call platform_device_add rather than device_add
Date: Thu, 22 Nov 2012 15:36:21 +0000 [thread overview]
Message-ID: <20121122153621.452CA3E129E@localhost> (raw)
In-Reply-To: <20121121181430.GE6406@obsidianresearch.com>
On Wed, 21 Nov 2012 11:14:30 -0700, Jason Gunthorpe <jgunthorpe@obsidianresearch.com> wrote:
> On Wed, Nov 21, 2012 at 06:07:46PM +0000, Grant Likely wrote:
>
> > > Which is nesting the generic gpio driver under a larger region..
> >
> > Try two sibling nodes with overlapping addresses. There are powerpc
> > device trees doing that even though it isn't legal by the ofw and
> > epapr specs.
>
> Both my examples were using sibling nodes in the OF tree.
>
> pex@e0000000 {
> device_type = "pci";
> ranges = <0x02000000 0x00000000 0x00000000 0xe0000000 0x0 0x8000000>;
> bus-range = <0x0 0xFF>;
> chip@0 {
> ranges = <0x02000000 0x00000000 0x00000000 0x02000000 0x00000000 0x00000000 0x0 0x8000000>;
> chip_control@0 {
> compatible = "orc,chip,control";
> assigned-addresses = <0x02000000 0x0 0x0 0x0 4096>;
> };
>
> gpio3: chip_gpio@8 {
> #gpio-cells = <2>;
> compatible = "linux,basic-mmio-gpio";
> gpio-controller;
> reg-names = "dat", "set", "dirin";
> assigned-addresses = <0x02000000 0x0 0x8 0x0 4>,
> <0x02000000 0x0 0xc 0x0 4>,
> <0x02000000 0x0 0x10 0x0 4>;
> };
>
> Non-conformant yes, but it is the simplest way to get linux to bind
> two drivers to the same memory space.
Hmm... I've not tried it with assigned-address. I tried with two sibling
platform devices using just the 'reg' property. That the kernel will
complain about. For powerpc-only, the patch I posted allows the device
to get registered anyway even though the range incorrectly overlaps.
g.
next prev parent reply other threads:[~2012-11-22 15:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-21 7:24 [PATCH] of: Have of_device_add call platform_device_add rather than device_add Jason Gunthorpe
2012-11-21 15:51 ` Grant Likely
2012-11-21 16:05 ` Grant Likely
2012-11-21 17:44 ` Jason Gunthorpe
2012-11-21 18:07 ` Grant Likely
2012-11-21 18:14 ` Jason Gunthorpe
[not found] ` <20121121181430.GE6406-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2012-11-22 15:36 ` Grant Likely [this message]
2012-11-22 15:36 ` Grant Likely
2012-11-22 17:30 ` Jason Gunthorpe
2012-11-22 17:30 ` Jason Gunthorpe
2012-11-26 14:30 ` Grant Likely
2012-11-26 15:28 ` Grant Likely
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=20121122153621.452CA3E129E@localhost \
--to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.