devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to describe a device that sits across two busses.
@ 2020-11-28  3:53 Daniel Palmer
  2020-11-30 19:11 ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Palmer @ 2020-11-28  3:53 UTC (permalink / raw)
  To: DTML; +Cc: Daniel Palmer

Hi all,

I have a driver for a SPI flash controller that I want to mainline
soon and I'm cleaning up the device tree part for it at the moment.

This device has registers that are children in a "simple bus" and a
memory mapped area that is in the soc simple bus because it's not
connected via the same bus as the registers.

Right now I have the driver's node in the soc simple bus like this:

isp: isp@1f001000 {
  compatible = "mstar,msc313-isp";
  reg = <0x1f001000 0x400>,
           <0x1f002c00 0x200>,
           <0x1f002e00 0x200>,
           <0x14000000 0x1000000>;
};

Really the first 3 reg values belong to this simple bus:

riu: bus@1f000000 {
  compatible = "simple-bus";
  reg = <0x1f000000 0x00400000>;
};

Is there a good way to describe this? I think maybe the memory mapped
area should be another node (syscon?) and that should be referenced in
the driver node and the driver node itself nested in the riu simple
bus where the registers are.

Thanks,

Daniel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to describe a device that sits across two busses.
  2020-11-28  3:53 How to describe a device that sits across two busses Daniel Palmer
@ 2020-11-30 19:11 ` Rob Herring
  2020-12-01 12:45   ` Daniel Palmer
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2020-11-30 19:11 UTC (permalink / raw)
  To: Daniel Palmer; +Cc: DTML

On Sat, Nov 28, 2020 at 11:00 AM Daniel Palmer <daniel@0x0f.com> wrote:
>
> Hi all,
>
> I have a driver for a SPI flash controller that I want to mainline
> soon and I'm cleaning up the device tree part for it at the moment.
>
> This device has registers that are children in a "simple bus" and a
> memory mapped area that is in the soc simple bus because it's not
> connected via the same bus as the registers.
>
> Right now I have the driver's node in the soc simple bus like this:
>
> isp: isp@1f001000 {
>   compatible = "mstar,msc313-isp";
>   reg = <0x1f001000 0x400>,
>            <0x1f002c00 0x200>,
>            <0x1f002e00 0x200>,
>            <0x14000000 0x1000000>;
> };
>
> Really the first 3 reg values belong to this simple bus:
>
> riu: bus@1f000000 {
>   compatible = "simple-bus";
>   reg = <0x1f000000 0x00400000>;

If it's 'simple', then it shouldn't have regs...

> };
>
> Is there a good way to describe this? I think maybe the memory mapped
> area should be another node (syscon?) and that should be referenced in
> the driver node and the driver node itself nested in the riu simple
> bus where the registers are.

There's not really a better way. I would stick with 'reg' and not a
syscon. Unless you restrict the address space with 'ranges' nothing
prevents having the above. The main thing we want to avoid is having
the same address used (in 'reg') by multiple nodes.

Rob

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to describe a device that sits across two busses.
  2020-11-30 19:11 ` Rob Herring
@ 2020-12-01 12:45   ` Daniel Palmer
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Palmer @ 2020-12-01 12:45 UTC (permalink / raw)
  To: Rob Herring; +Cc: DTML

Hi Rob,

On Tue, 1 Dec 2020 at 04:11, Rob Herring <robh@kernel.org> wrote:

> > Is there a good way to describe this? I think maybe the memory mapped
> > area should be another node (syscon?) and that should be referenced in
> > the driver node and the driver node itself nested in the riu simple
> > bus where the registers are.
>
> There's not really a better way. I would stick with 'reg' and not a
> syscon. Unless you restrict the address space with 'ranges' nothing
> prevents having the above. The main thing we want to avoid is having
> the same address used (in 'reg') by multiple nodes.

Ok, I'll go for a node with 'reg' that the driver node references. The
simple bus
the registers are in does now have a range that doesn't include where the
memory mapped region is.

Thank you for the input.

Daniel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-01 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-28  3:53 How to describe a device that sits across two busses Daniel Palmer
2020-11-30 19:11 ` Rob Herring
2020-12-01 12:45   ` Daniel Palmer

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