All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] Documentation: devicetree: add description for generic bus properties
@ 2013-11-27 17:28 ` Dave Martin
  0 siblings, 0 replies; 73+ messages in thread
From: Dave Martin @ 2013-11-27 17:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

SoC architectures are getting increasingly complex in ways that are not
transparent to software.

A particular emerging issue is that of multi-master SoCs, which may have
different address views, IOMMUs, and coherency behaviour from one master
to the next.

DT can't describe multi-master systems today except for PCI DMA and
similar.  This comes with constraints and assumptions that won't work
for emerging SoC bus architectures.  On-SoC, a device's interface to the
system can't be described in terms of a single interface to a single
"bus".

Different masters may have different views of the system too.  Software
needs to understand the true topology in order to do address mapping,
coherency management etc., in any generic way.

One piece of the puzzle is to define how to describe these topologies in
DT.

The other is how to get the right abstractions in the kernel to drive
these systems in a generic way.

The following proposal (originally from Will) begins to address the DT
part.

Comments encouraged -- I anticipate it may take some discussion to
reach a consensus here.

Cheers
---Dave

^ permalink raw reply	[flat|nested] 73+ messages in thread
* Re: [RFC PATCH] Documentation: devicetree: add description for generic bus properties
@ 2013-11-28 16:50 Dave Martin
  0 siblings, 0 replies; 73+ messages in thread
From: Dave Martin @ 2013-11-28 16:50 UTC (permalink / raw)
  To: Will Deacon
  Cc: Greg KH, Mark Rutland,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Stephen Warren, Thierry Reding,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Hiroshi Doyu

On Thu, Nov 28, 2013 at 10:28:45AM +0000, Will Deacon wrote:
> Hi Greg,
> 
> On Wed, Nov 27, 2013 at 11:06:50PM +0000, Greg KH wrote:
> > On Wed, Nov 27, 2013 at 05:28:06PM +0000, Dave Martin wrote:
> > > >From will.deacon-5wv7dgnIgG8@public.gmane.org Wed Nov 20 12:06:22 2013
> > > A number of discussion points remain to be resolved:
> > > 
> > >   - Use of the ranges property and describing slave vs master bus
> > >     address ranges. In the latter case, we actually want to describe our
> > >     address space with respect to the bus on which the bus masters,
> > >     rather than the parent. This could potentially be achieved by adding
> > >     properties such as dma-parent and dma-ranges (already used by PPC?)
> > > 
> > >   - Describing masters that master through multiple different buses
> > > 
> > >   - How on Earth this fits in with the Linux device model (it doesn't)
> > 
> > How does this _not_ fit into the Linux device model?  What am I missing
> > here that precludes the use of the "driver/device/bus" model we have
> > today?

The physical-sockets history of buses like PCI tends to force a simple
tree-like topology as a natural consequence.  You also end up with
closely linked topologies for power, clocks, interrupts etc., because
those all pass through the same sockets, so it's difficult to have a
different structure.

On SoC, those constraints have never existed and are not followed.  A
device's interface to the system is almost always split into multiple
connections, not covered by a single design or standard.  The problem
now is that increasing complexity means that the sometimes bizarre
topology features of SoCs are becoming less and less transparent for
software.

The device model currently seems to assume that certain things (power,
DMA and MMIO accessibility) follow the tree (which may not work for many
SoCs), and some other things (clocks, regulators, interrupts etc.) are
not incorporated at all -- making them independent, but it may make some
abstractions impossible today.

How much this matters for actual systems is hard to foresee yet.  Since
not _all_ possible insanities find their way into silicon.  The
onus should certainly be on us (i.e., the ARM/SoC community) to
demonstrate if the device model needs to change, and to find practical
ways to change it that minimise the resulting churn.

> The main problem is that we have devices which slave on one bus and master
> on another. That then complicates probing, power-management, IOMMU
> configuration, address mapping (e.g. I walk the slave buses to figure out
> where the slave registers live, but then I need a way to work out where
> exactly I master on a different bus) and dynamic coherency, amongst other
> things.
> 
> If we try to use the current infrastructure then we end up with one bus per
> device, which usually ends up being a fake bus representing both the slave
> and master buses (which is how the platform bus gets abused) and then device
> drivers having their own idea of the system topology where it's required.
> 
> This is fairly horrible and doesn't work for anything other than the trivial
> case, where one or both of the buses are `dumb' and don't require any work
> from Linux.

If we can come up with some generic bus type that is just a container for
a load of hooks that know how to deal with various aspects of each device's
interface to the system, on a per-device basis, than may be a start.

The platform bus kinda serves that role, but the trouble with that is that
it doesn't encourage any abstraction at all.  In the face of increasing
complexity, abstraction is desperately needed.

> > >  .../devicetree/bindings/arm/coherent-bus.txt       | 110 +++++++++++++++++++++
> > 
> > Why "arm"?
> > 
> > What makes it ARM specific?
> 
> This is just an RFC, so I'd be happy to put the binding somewhere more
> broad. I'm not sure how much of an issue this is outside of the SoC space,
> though.

I think that the ARM community are the ones who care the most today,
so are likely to make the most noise about it.

The binding is entirely generic in concept, so we should certainly
push for it to be non-ARM-specific.  Non-ARM SoCs will likely need
to solve this problem too at some point.

Cheers
---Dave
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2013-12-04 20:27 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27 17:28 [RFC PATCH] Documentation: devicetree: add description for generic bus properties Dave Martin
2013-11-27 17:28 ` Dave Martin
2013-11-27 23:06 ` Greg KH
2013-11-27 23:06   ` Greg KH
2013-11-28 10:28   ` Will Deacon
2013-11-28 10:28     ` Will Deacon
2013-11-28 17:33     ` Dave Martin
2013-11-28 17:33       ` Dave Martin
2013-11-28 19:13       ` Greg KH
2013-11-28 19:13         ` Greg KH
2013-11-28 19:39         ` Dave Martin
2013-11-28 19:39           ` Dave Martin
2013-11-28 21:25           ` Greg KH
2013-11-28 21:25             ` Greg KH
2013-11-29 11:44             ` Will Deacon
2013-11-29 11:44               ` Will Deacon
2013-11-29 17:37               ` Greg KH
2013-11-29 17:37                 ` Greg KH
2013-11-29 18:01                 ` Will Deacon
2013-11-29 18:01                   ` Will Deacon
2013-11-29 18:11                   ` Greg KH
2013-11-29 18:11                     ` Greg KH
2013-11-29 18:15                     ` Will Deacon
2013-11-29 18:15                       ` Will Deacon
2013-11-28 19:10     ` Greg KH
2013-11-28 19:10       ` Greg KH
2013-11-28 20:33 ` Thierry Reding
2013-11-28 20:33   ` Thierry Reding
2013-11-28 21:10   ` Jason Gunthorpe
2013-11-28 21:10     ` Jason Gunthorpe
2013-11-28 22:22     ` Thierry Reding
2013-11-28 22:22       ` Thierry Reding
2013-11-28 23:31       ` Jason Gunthorpe
2013-11-28 23:31         ` Jason Gunthorpe
2013-11-29  2:35         ` Greg KH
2013-11-29  2:35           ` Greg KH
2013-11-29  9:37           ` Thierry Reding
2013-11-29  9:37             ` Thierry Reding
2013-11-29  9:57             ` Russell King - ARM Linux
2013-11-29  9:57               ` Russell King - ARM Linux
2013-11-29 10:43               ` Thierry Reding
2013-11-29 10:43                 ` Thierry Reding
2013-11-29 13:13               ` Dave Martin
2013-11-29 13:13                 ` Dave Martin
2013-11-29 13:29                 ` Russell King - ARM Linux
2013-11-29 13:29                   ` Russell King - ARM Linux
2013-11-29 17:43                 ` Greg KH
2013-11-29 17:43                   ` Greg KH
2013-11-29 17:42             ` Greg KH
2013-11-29 17:42               ` Greg KH
2013-11-29 19:45               ` Thierry Reding
2013-11-29 19:45                 ` Thierry Reding
2013-12-04 18:43           ` Mark Brown
2013-12-04 18:43             ` Mark Brown
2013-12-04 19:03             ` Greg KH
2013-12-04 19:03               ` Greg KH
2013-12-04 20:27               ` Mark Brown
2013-12-04 20:27                 ` Mark Brown
2013-11-29  9:57         ` Thierry Reding
2013-11-29  9:57           ` Thierry Reding
2013-11-29 14:13           ` Dave Martin
2013-11-29 14:13             ` Dave Martin
2013-11-29 11:58         ` Dave Martin
2013-11-29 11:58           ` Dave Martin
2013-11-29 18:43           ` Jason Gunthorpe
2013-11-29 18:43             ` Jason Gunthorpe
2013-12-02 20:25             ` Dave Martin
2013-12-02 20:25               ` Dave Martin
2013-12-03  0:07               ` Jason Gunthorpe
2013-12-03  0:07                 ` Jason Gunthorpe
2013-12-03 11:45                 ` Dave Martin
2013-12-03 11:45                   ` Dave Martin
  -- strict thread matches above, loose matches on Subject: below --
2013-11-28 16:50 Dave Martin

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.