2013-08-06 09:34:44

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/5] pdev: Fix platform device resource linking

On Tue, Aug 06, 2013 at 10:53:40AM +0300, Pantelis Antoniou wrote:
> Platform device removal uncovered a number of problems with
> the way resources are handled in the core platform code.
>
> Resources now form child/parent linkages and this requires
> proper linking of the resources. On top of that the OF core
> directly creates it's own platform devices. Simplify things
> by providing helper functions that manage the linking properly.

Ugh, the OF core shouldn't be creating platform devices. Well, yes, I
know it does that today, but ick, ick, ick.

> Two functions are provided:
>
> platform_device_link_resources(), which links all the
> linkable resources (if not already linked).
>
> and platform_device_unlink_resources(), which unlinks all the
> resources.

Why would anyone need to call this? I'm getting the feeling that OF
should just have it's own bus of devices to handle this type of mess.
ACPI is going through the same rewrite for this same type of problem
(they did things differently.) I suggest you work with the ACPI
developers to so the same thing they are, to solve it correctly for
everyone.

thanks,

greg k-h


2013-08-06 09:45:49

by Pantelis Antoniou

[permalink] [raw]
Subject: Re: [PATCH 1/5] pdev: Fix platform device resource linking

Hi Greg,

On Aug 6, 2013, at 12:36 PM, Greg Kroah-Hartman wrote:

> On Tue, Aug 06, 2013 at 10:53:40AM +0300, Pantelis Antoniou wrote:
>> Platform device removal uncovered a number of problems with
>> the way resources are handled in the core platform code.
>>
>> Resources now form child/parent linkages and this requires
>> proper linking of the resources. On top of that the OF core
>> directly creates it's own platform devices. Simplify things
>> by providing helper functions that manage the linking properly.
>
> Ugh, the OF core shouldn't be creating platform devices. Well, yes, I
> know it does that today, but ick, ick, ick.
>

Yep, ick, ick, ick is the correct form.

>> Two functions are provided:
>>
>> platform_device_link_resources(), which links all the
>> linkable resources (if not already linked).
>>
>> and platform_device_unlink_resources(), which unlinks all the
>> resources.
>
> Why would anyone need to call this? I'm getting the feeling that OF
> should just have it's own bus of devices to handle this type of mess.
> ACPI is going through the same rewrite for this same type of problem
> (they did things differently.) I suggest you work with the ACPI
> developers to so the same thing they are, to solve it correctly for
> everyone.
>

It's the same problem really. Another bus type might not fly well.
The same device driver should be (in theory) be made to work unchanged
either on an OF/ACPI/Fex( :) ) setup.

What would it take to move all this into driver core?

> thanks,
>
> greg k-h

Regards

-- Pantelis

2013-08-06 10:14:11

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/5] pdev: Fix platform device resource linking

On Tue, Aug 06, 2013 at 12:45:42PM +0300, Pantelis Antoniou wrote:
> Hi Greg,
>
> On Aug 6, 2013, at 12:36 PM, Greg Kroah-Hartman wrote:
>
> > On Tue, Aug 06, 2013 at 10:53:40AM +0300, Pantelis Antoniou wrote:
> >> Platform device removal uncovered a number of problems with
> >> the way resources are handled in the core platform code.
> >>
> >> Resources now form child/parent linkages and this requires
> >> proper linking of the resources. On top of that the OF core
> >> directly creates it's own platform devices. Simplify things
> >> by providing helper functions that manage the linking properly.
> >
> > Ugh, the OF core shouldn't be creating platform devices. Well, yes, I
> > know it does that today, but ick, ick, ick.
> >
>
> Yep, ick, ick, ick is the correct form.
>
> >> Two functions are provided:
> >>
> >> platform_device_link_resources(), which links all the
> >> linkable resources (if not already linked).
> >>
> >> and platform_device_unlink_resources(), which unlinks all the
> >> resources.
> >
> > Why would anyone need to call this? I'm getting the feeling that OF
> > should just have it's own bus of devices to handle this type of mess.
> > ACPI is going through the same rewrite for this same type of problem
> > (they did things differently.) I suggest you work with the ACPI
> > developers to so the same thing they are, to solve it correctly for
> > everyone.
> >
>
> It's the same problem really. Another bus type might not fly well.
> The same device driver should be (in theory) be made to work unchanged
> either on an OF/ACPI/Fex( :) ) setup.

No, that's not quite true, a driver needs to know how to talk to the
bus, as that is how it communicates to the hardware. It can be done for
different types of busses (see the OHCI USB controller for one example
of this), but a driver will have to know what type of bus it is on in
order to work properly.

> What would it take to move all this into driver core?

What specifically would you move into there?

thanks,

greg k-h

2013-08-06 10:19:39

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 1/5] pdev: Fix platform device resource linking

On Tue, Aug 06, 2013 at 06:15:27PM +0800, Greg Kroah-Hartman wrote:
> On Tue, Aug 06, 2013 at 12:45:42PM +0300, Pantelis Antoniou wrote:
> > What would it take to move all this into driver core?
>
> What specifically would you move into there?

A variable to hold the streaming dma_mask, so that its in struct device
rather than having to be separate. Yes, we can keep the pointer in there
too, because that appears to convey meaning in the kernel today - whether
the device can do DMA or not.

A NULL dma_mask pointer already means it can't and dma_set_mask() always
fails. A non-NULL dma_mask pointer means the driver can use
dma_set_mask() to set an appropriate mask.

2013-08-06 10:27:43

by Pantelis Antoniou

[permalink] [raw]
Subject: Re: [PATCH 1/5] pdev: Fix platform device resource linking

Hi Greg,

On Aug 6, 2013, at 1:15 PM, Greg Kroah-Hartman wrote:

> On Tue, Aug 06, 2013 at 12:45:42PM +0300, Pantelis Antoniou wrote:
>> Hi Greg,
>>
>> On Aug 6, 2013, at 12:36 PM, Greg Kroah-Hartman wrote:
>>
>>> On Tue, Aug 06, 2013 at 10:53:40AM +0300, Pantelis Antoniou wrote:
>>>> Platform device removal uncovered a number of problems with
>>>> the way resources are handled in the core platform code.
>>>>
>>>> Resources now form child/parent linkages and this requires
>>>> proper linking of the resources. On top of that the OF core
>>>> directly creates it's own platform devices. Simplify things
>>>> by providing helper functions that manage the linking properly.
>>>
>>> Ugh, the OF core shouldn't be creating platform devices. Well, yes, I
>>> know it does that today, but ick, ick, ick.
>>>
>>
>> Yep, ick, ick, ick is the correct form.
>>
>>>> Two functions are provided:
>>>>
>>>> platform_device_link_resources(), which links all the
>>>> linkable resources (if not already linked).
>>>>
>>>> and platform_device_unlink_resources(), which unlinks all the
>>>> resources.
>>>
>>> Why would anyone need to call this? I'm getting the feeling that OF
>>> should just have it's own bus of devices to handle this type of mess.
>>> ACPI is going through the same rewrite for this same type of problem
>>> (they did things differently.) I suggest you work with the ACPI
>>> developers to so the same thing they are, to solve it correctly for
>>> everyone.
>>>
>>
>> It's the same problem really. Another bus type might not fly well.
>> The same device driver should be (in theory) be made to work unchanged
>> either on an OF/ACPI/Fex( :) ) setup.
>
> No, that's not quite true, a driver needs to know how to talk to the
> bus, as that is how it communicates to the hardware. It can be done for
> different types of busses (see the OHCI USB controller for one example
> of this), but a driver will have to know what type of bus it is on in
> order to work properly.
>

In the case of OF & ACPI there is no 'bus'. The device is probably integrated
in the SoC's silicon, but there is absolutely no way to 'probe' for it's existence;
you have to use a-priori knowledge of the SoC's topology in order to configure it
(along with any per-board specific information if there is any kind of shared
resource configuration - i.e. pinmuxing or something else).

There are the 3 well known methods to do so in the Linux kernel right now:

1) Board files in which the configuration information is stored in the per-board
platform file encoded in platform data structures.

2) OF, in which case the information is provided via the flat device tree blob
the bootloader provides.

3) ACPI in which case the information is provided via the firmware's ACPI tables
(I'm not overly familiar with ACPI, so there might be some more nuance here).

The device driver for all these cases is absolutely the same; the only place where
it differs it's in the way it uses to retrieve that configuration information.

The board file method is pretty much no-go due to the need to support multiple
boards from a single kernel; that leaves OF and ACPI.

>From what I can tell what ACPI supports is a very small subset of what OF can support right now;
that is both number of device drivers, as well as what you can do with device driver
functionality (see things like gpios etc, how much easier is to use with OF).

Since we're in the let's make a wish stage, what I wish for is a board-file & ACPI
translator stage to OF data, and depreciating everything else gradually.
That would kill platform_device and ACPI specific data and move everything
to a common device structure supporting OF for configuration.

>> What would it take to move all this into driver core?
>
> What specifically would you move into there?
>

Pretty much everything that's in the union of platform_device & whatever
acpi uses to hold it's configuration info.

> thanks,
>
> greg k-h

Regards

-- Pantelis

2013-08-07 05:55:14

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/5] pdev: Fix platform device resource linking

On Tue, Aug 06, 2013 at 01:27:35PM +0300, Pantelis Antoniou wrote:
> Hi Greg,
>
> On Aug 6, 2013, at 1:15 PM, Greg Kroah-Hartman wrote:
>
> > On Tue, Aug 06, 2013 at 12:45:42PM +0300, Pantelis Antoniou wrote:
> >> Hi Greg,
> >>
> >> On Aug 6, 2013, at 12:36 PM, Greg Kroah-Hartman wrote:
> >>
> >>> On Tue, Aug 06, 2013 at 10:53:40AM +0300, Pantelis Antoniou wrote:
> >>>> Platform device removal uncovered a number of problems with
> >>>> the way resources are handled in the core platform code.
> >>>>
> >>>> Resources now form child/parent linkages and this requires
> >>>> proper linking of the resources. On top of that the OF core
> >>>> directly creates it's own platform devices. Simplify things
> >>>> by providing helper functions that manage the linking properly.
> >>>
> >>> Ugh, the OF core shouldn't be creating platform devices. Well, yes, I
> >>> know it does that today, but ick, ick, ick.
> >>>
> >>
> >> Yep, ick, ick, ick is the correct form.
> >>
> >>>> Two functions are provided:
> >>>>
> >>>> platform_device_link_resources(), which links all the
> >>>> linkable resources (if not already linked).
> >>>>
> >>>> and platform_device_unlink_resources(), which unlinks all the
> >>>> resources.
> >>>
> >>> Why would anyone need to call this? I'm getting the feeling that OF
> >>> should just have it's own bus of devices to handle this type of mess.
> >>> ACPI is going through the same rewrite for this same type of problem
> >>> (they did things differently.) I suggest you work with the ACPI
> >>> developers to so the same thing they are, to solve it correctly for
> >>> everyone.
> >>>
> >>
> >> It's the same problem really. Another bus type might not fly well.
> >> The same device driver should be (in theory) be made to work unchanged
> >> either on an OF/ACPI/Fex( :) ) setup.
> >
> > No, that's not quite true, a driver needs to know how to talk to the
> > bus, as that is how it communicates to the hardware. It can be done for
> > different types of busses (see the OHCI USB controller for one example
> > of this), but a driver will have to know what type of bus it is on in
> > order to work properly.
> >
>
> In the case of OF & ACPI there is no 'bus'. The device is probably integrated
> in the SoC's silicon, but there is absolutely no way to 'probe' for it's existence;
> you have to use a-priori knowledge of the SoC's topology in order to configure it
> (along with any per-board specific information if there is any kind of shared
> resource configuration - i.e. pinmuxing or something else).

Not all busses need to have the aiblity to "probe" for new devices,
that's not a requirement at all. Some of them just "know" where the
devices are at in the driver model, and create the devices for the bus
just fine.

So don't think that just because of that lack of probing, they should be
on the "platform" bus at all. Platform is for the "oh crap, I have no
way to bind this to anything else, make it a platform device then."

> There are the 3 well known methods to do so in the Linux kernel right now:
>
> 1) Board files in which the configuration information is stored in the per-board
> platform file encoded in platform data structures.
>
> 2) OF, in which case the information is provided via the flat device tree blob
> the bootloader provides.
>
> 3) ACPI in which case the information is provided via the firmware's ACPI tables
> (I'm not overly familiar with ACPI, so there might be some more nuance here).
>
> The device driver for all these cases is absolutely the same; the only place where
> it differs it's in the way it uses to retrieve that configuration information.

Not at all, they all should be differing in how to talk to the hardware,
right? Or even if not, it should be pretty trivial for all of them to
have drivers that bind to a multiple of different types of busses just
fine, no need to want to abuse the platform code because people feel
lazy.

> > What specifically would you move into there?
> >
>
> Pretty much everything that's in the union of platform_device & whatever
> acpi uses to hold it's configuration info.

Specifically what is that? I've never had a problem with moving stuff
into struct device that is common among different subsystems that can
share the pointers, as that is exactly what the structure is there for.

thanks,

greg k-h

2013-08-07 05:55:42

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/5] pdev: Fix platform device resource linking

On Tue, Aug 06, 2013 at 11:19:14AM +0100, Russell King - ARM Linux wrote:
> On Tue, Aug 06, 2013 at 06:15:27PM +0800, Greg Kroah-Hartman wrote:
> > On Tue, Aug 06, 2013 at 12:45:42PM +0300, Pantelis Antoniou wrote:
> > > What would it take to move all this into driver core?
> >
> > What specifically would you move into there?
>
> A variable to hold the streaming dma_mask, so that its in struct device
> rather than having to be separate. Yes, we can keep the pointer in there
> too, because that appears to convey meaning in the kernel today - whether
> the device can do DMA or not.
>
> A NULL dma_mask pointer already means it can't and dma_set_mask() always
> fails. A non-NULL dma_mask pointer means the driver can use
> dma_set_mask() to set an appropriate mask.

Ok, that sounds fine to me, for some reason I thought I said yes to this
a long time ago, did no one ever send me a patch for it?

thanks,

greg k-h

2013-08-07 07:37:25

by Pantelis Antoniou

[permalink] [raw]
Subject: Re: [PATCH 1/5] pdev: Fix platform device resource linking

Hi Greg,

On Aug 7, 2013, at 8:56 AM, Greg Kroah-Hartman wrote:

> On Tue, Aug 06, 2013 at 01:27:35PM +0300, Pantelis Antoniou wrote:
>> Hi Greg,
>>
>> On Aug 6, 2013, at 1:15 PM, Greg Kroah-Hartman wrote:
>>
>>> On Tue, Aug 06, 2013 at 12:45:42PM +0300, Pantelis Antoniou wrote:
>>>> Hi Greg,
>>>>
>>>> On Aug 6, 2013, at 12:36 PM, Greg Kroah-Hartman wrote:
>>>>
>>>>> On Tue, Aug 06, 2013 at 10:53:40AM +0300, Pantelis Antoniou wrote:
>>>>>> Platform device removal uncovered a number of problems with
>>>>>> the way resources are handled in the core platform code.
>>>>>>
>>>>>> Resources now form child/parent linkages and this requires
>>>>>> proper linking of the resources. On top of that the OF core
>>>>>> directly creates it's own platform devices. Simplify things
>>>>>> by providing helper functions that manage the linking properly.
>>>>>
>>>>> Ugh, the OF core shouldn't be creating platform devices. Well, yes, I
>>>>> know it does that today, but ick, ick, ick.
>>>>>
>>>>
>>>> Yep, ick, ick, ick is the correct form.
>>>>
>>>>>> Two functions are provided:
>>>>>>
>>>>>> platform_device_link_resources(), which links all the
>>>>>> linkable resources (if not already linked).
>>>>>>
>>>>>> and platform_device_unlink_resources(), which unlinks all the
>>>>>> resources.
>>>>>
>>>>> Why would anyone need to call this? I'm getting the feeling that OF
>>>>> should just have it's own bus of devices to handle this type of mess.
>>>>> ACPI is going through the same rewrite for this same type of problem
>>>>> (they did things differently.) I suggest you work with the ACPI
>>>>> developers to so the same thing they are, to solve it correctly for
>>>>> everyone.
>>>>>
>>>>
>>>> It's the same problem really. Another bus type might not fly well.
>>>> The same device driver should be (in theory) be made to work unchanged
>>>> either on an OF/ACPI/Fex( :) ) setup.
>>>
>>> No, that's not quite true, a driver needs to know how to talk to the
>>> bus, as that is how it communicates to the hardware. It can be done for
>>> different types of busses (see the OHCI USB controller for one example
>>> of this), but a driver will have to know what type of bus it is on in
>>> order to work properly.
>>>
>>
>> In the case of OF & ACPI there is no 'bus'. The device is probably integrated
>> in the SoC's silicon, but there is absolutely no way to 'probe' for it's existence;
>> you have to use a-priori knowledge of the SoC's topology in order to configure it
>> (along with any per-board specific information if there is any kind of shared
>> resource configuration - i.e. pinmuxing or something else).
>
> Not all busses need to have the aiblity to "probe" for new devices,
> that's not a requirement at all. Some of them just "know" where the
> devices are at in the driver model, and create the devices for the bus
> just fine.
>
> So don't think that just because of that lack of probing, they should be
> on the "platform" bus at all. Platform is for the "oh crap, I have no
> way to bind this to anything else, make it a platform device then."
>

I'm not sure if you remember, but a long time ago when OF started getting
into the kernel, there actually was an OCP (On Chip Peripheral) bus,
and the switch to platform devices was mandated by kernel people, by their
insistance that platform devices would cover every case.

See here:

http://lkml.indiana.edu/hypermail/linux/kernel/0405.1/0930.html

I'm sure Matt Porter can shed some light on the exchange that led to the
abandonment of the ocp bus concept.

Since I've been down the new 'non hardware' bus road before, it seems that there
is absolutely no consensus about when a new bus is acceptable or not.


>> There are the 3 well known methods to do so in the Linux kernel right now:
>>
>> 1) Board files in which the configuration information is stored in the per-board
>> platform file encoded in platform data structures.
>>
>> 2) OF, in which case the information is provided via the flat device tree blob
>> the bootloader provides.
>>
>> 3) ACPI in which case the information is provided via the firmware's ACPI tables
>> (I'm not overly familiar with ACPI, so there might be some more nuance here).
>>
>> The device driver for all these cases is absolutely the same; the only place where
>> it differs it's in the way it uses to retrieve that configuration information.
>
> Not at all, they all should be differing in how to talk to the hardware,
> right? Or even if not, it should be pretty trivial for all of them to
> have drivers that bind to a multiple of different types of busses just
> fine, no need to want to abuse the platform code because people feel
> lazy.
>

My point is that there are now a lot of ways to store the configuration options of
a given driver; instead of coming up with different ways to get that depending
on the bus type the platform happens to be using, let's dictate a single method
of getting that information.

I just don't feel that having N new bus types is the way to go there, since each
bus type will require modification in each driver file for the bus type.

OF configuration is pretty much there already, use that as a base and have converters
from whatever else is out there to OF.

>>> What specifically would you move into there?
>>>
>>
>> Pretty much everything that's in the union of platform_device & whatever
>> acpi uses to hold it's configuration info.
>
> Specifically what is that? I've never had a problem with moving stuff
> into struct device that is common among different subsystems that can
> share the pointers, as that is exactly what the structure is there for.
>

Resources (memory ranges, dma, irq, etc).

> thanks,
>
> greg k-h

Regards

-- Pantelis

2013-08-07 08:27:47

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 1/5] pdev: Fix platform device resource linking

On Wed, Aug 07, 2013 at 02:57:00PM +0900, Greg Kroah-Hartman wrote:
> On Tue, Aug 06, 2013 at 11:19:14AM +0100, Russell King - ARM Linux wrote:
> > On Tue, Aug 06, 2013 at 06:15:27PM +0800, Greg Kroah-Hartman wrote:
> > > On Tue, Aug 06, 2013 at 12:45:42PM +0300, Pantelis Antoniou wrote:
> > > > What would it take to move all this into driver core?
> > >
> > > What specifically would you move into there?
> >
> > A variable to hold the streaming dma_mask, so that its in struct device
> > rather than having to be separate. Yes, we can keep the pointer in there
> > too, because that appears to convey meaning in the kernel today - whether
> > the device can do DMA or not.
> >
> > A NULL dma_mask pointer already means it can't and dma_set_mask() always
> > fails. A non-NULL dma_mask pointer means the driver can use
> > dma_set_mask() to set an appropriate mask.
>
> Ok, that sounds fine to me, for some reason I thought I said yes to this
> a long time ago, did no one ever send me a patch for it?

Apparantly not. I'll see what I can do, and I'll add it to my dma-masks
series, probably below most of the existing patches that are already
there.

2013-08-07 17:13:55

by Matt Porter

[permalink] [raw]
Subject: Re: [PATCH 1/5] pdev: Fix platform device resource linking

[trimmed my old email]

On Wed, Aug 07, 2013 at 10:37:17AM +0300, Pantelis Antoniou wrote:
> Hi Greg,
>
> On Aug 7, 2013, at 8:56 AM, Greg Kroah-Hartman wrote:
>
> > On Tue, Aug 06, 2013 at 01:27:35PM +0300, Pantelis Antoniou wrote:
> >> Hi Greg,
> >>
> >> On Aug 6, 2013, at 1:15 PM, Greg Kroah-Hartman wrote:
> >>
> >>> On Tue, Aug 06, 2013 at 12:45:42PM +0300, Pantelis Antoniou wrote:
> >>>> Hi Greg,
> >>>>
> >>>> On Aug 6, 2013, at 12:36 PM, Greg Kroah-Hartman wrote:
> >>>>
> >>>>> On Tue, Aug 06, 2013 at 10:53:40AM +0300, Pantelis Antoniou wrote:
> >>>>>> Platform device removal uncovered a number of problems with
> >>>>>> the way resources are handled in the core platform code.
> >>>>>>
> >>>>>> Resources now form child/parent linkages and this requires
> >>>>>> proper linking of the resources. On top of that the OF core
> >>>>>> directly creates it's own platform devices. Simplify things
> >>>>>> by providing helper functions that manage the linking properly.
> >>>>>
> >>>>> Ugh, the OF core shouldn't be creating platform devices. Well, yes, I
> >>>>> know it does that today, but ick, ick, ick.
> >>>>>
> >>>>
> >>>> Yep, ick, ick, ick is the correct form.
> >>>>
> >>>>>> Two functions are provided:
> >>>>>>
> >>>>>> platform_device_link_resources(), which links all the
> >>>>>> linkable resources (if not already linked).
> >>>>>>
> >>>>>> and platform_device_unlink_resources(), which unlinks all the
> >>>>>> resources.
> >>>>>
> >>>>> Why would anyone need to call this? I'm getting the feeling that OF
> >>>>> should just have it's own bus of devices to handle this type of mess.
> >>>>> ACPI is going through the same rewrite for this same type of problem
> >>>>> (they did things differently.) I suggest you work with the ACPI
> >>>>> developers to so the same thing they are, to solve it correctly for
> >>>>> everyone.
> >>>>>
> >>>>
> >>>> It's the same problem really. Another bus type might not fly well.
> >>>> The same device driver should be (in theory) be made to work unchanged
> >>>> either on an OF/ACPI/Fex( :) ) setup.
> >>>
> >>> No, that's not quite true, a driver needs to know how to talk to the
> >>> bus, as that is how it communicates to the hardware. It can be done for
> >>> different types of busses (see the OHCI USB controller for one example
> >>> of this), but a driver will have to know what type of bus it is on in
> >>> order to work properly.
> >>>
> >>
> >> In the case of OF & ACPI there is no 'bus'. The device is probably integrated
> >> in the SoC's silicon, but there is absolutely no way to 'probe' for it's existence;
> >> you have to use a-priori knowledge of the SoC's topology in order to configure it
> >> (along with any per-board specific information if there is any kind of shared
> >> resource configuration - i.e. pinmuxing or something else).
> >
> > Not all busses need to have the aiblity to "probe" for new devices,
> > that's not a requirement at all. Some of them just "know" where the
> > devices are at in the driver model, and create the devices for the bus
> > just fine.
> >
> > So don't think that just because of that lack of probing, they should be
> > on the "platform" bus at all. Platform is for the "oh crap, I have no
> > way to bind this to anything else, make it a platform device then."
> >
>
> I'm not sure if you remember, but a long time ago when OF started getting
> into the kernel, there actually was an OCP (On Chip Peripheral) bus,
> and the switch to platform devices was mandated by kernel people, by their
> insistance that platform devices would cover every case.
>
> See here:
>
> http://lkml.indiana.edu/hypermail/linux/kernel/0405.1/0930.html
>
> I'm sure Matt Porter can shed some light on the exchange that led to the
> abandonment of the ocp bus concept.

Heh, that OCP support looks a bit antiquated by today's standards. If it
helps, http://lkml.indiana.edu/hypermail/linux/kernel/0501.2/0696.html
is the posting where Kumar starts taking arch/ppc away from using
drivers/ocp/. I can't find any public discussion that led to this, but I
recall the common advice was "just use platform devices". This was,
incidentally, just before the move to arch/powerpc (and DT for all)
began.

Keep in mind that this is 8ish years ago before embedded was
fashionable since we didn't all have Linux machines in our pockets.
I suspect that advice was given because nobody cared about
platform_device removal and it worked for the use cases at the time.

-Matt