LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* RE: Mega rename of device tree routines from of_*() to dt_*()
From: Stephen Neuendorffer @ 2010-11-24 17:02 UTC (permalink / raw)
  To: michael, LKML
  Cc: linuxppc-dev list, linux-mips, devicetree-discuss, sparclinux,
	microblaze-uclinux
In-Reply-To: <1290607413.12457.44.camel@concordia>

DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogbGludXhwcGMtZGV2LWJv
dW5jZXMrc3RlcGhlbj1uZXVlbmRvcmZmZXIubmFtZUBsaXN0cy5vemxhYnMub3JnIFttYWlsdG86
bGludXhwcGMtZGV2LQ0KPiBib3VuY2VzK3N0ZXBoZW49bmV1ZW5kb3JmZmVyLm5hbWVAbGlzdHMu
b3psYWJzLm9yZ10gT24gQmVoYWxmIE9mIE1pY2hhZWwgRWxsZXJtYW4NCj4gU2VudDogV2VkbmVz
ZGF5LCBOb3ZlbWJlciAyNCwgMjAxMCA2OjA0IEFNDQo+IFRvOiBMS01MDQo+IENjOiBsaW51eC1t
aXBzOyBtaWNyb2JsYXplLXVjbGludXhAaXRlZS51cS5lZHUuYXU7IGRldmljZXRyZWUtZGlzY3Vz
c0BsaXN0cy5vemxhYnMub3JnOyBsaW51eHBwYy1kZXYNCj4gbGlzdDsgc3BhcmNsaW51eEB2Z2Vy
Lmtlcm5lbC5vcmcNCj4gU3ViamVjdDogUkZDOiBNZWdhIHJlbmFtZSBvZiBkZXZpY2UgdHJlZSBy
b3V0aW5lcyBmcm9tIG9mXyooKSB0byBkdF8qKCkNCj4gDQo+IEhpIGFsbCwNCj4gDQo+IFRoZXJl
IHdlcmUgc29tZSBtdXJtdXJpbmdzIG9uIElSQyBsYXN0IHdlZWsgYWJvdXQgcmVuYW1pbmcgdGhl
IG9mXyooKQ0KPiByb3V0aW5lcy4gSSB3YXMgcHJvY3Jhc3RpbmF0aW5nIGF0IHRoZSB0aW1lIGFu
ZCBzYWlkIEknZCBoYXZlIGEgbG9vayBhdA0KPiBpdCwgc28gaGVyZSBJIGFtLg0KPiANCj4gVGhl
IHRoaW5raW5nIGlzIHRoYXQgb24gbWFueSBwbGF0Zm9ybXMgdGhhdCB1c2UgdGhlIG9mXygpIHJv
dXRpbmVzDQo+IE9wZW5GaXJtd2FyZSBpcyBub3QgaW52b2x2ZWQgYXQgYWxsLCB0aGlzIGlzIHRy
dWUgZXZlbiBvbiBtYW55IHBvd2VycGMNCj4gcGxhdGZvcm1zLiBBbHNvIGZvciBmb2xrcyB3aG8g
ZG9uJ3Qga25vdyB0aGUgT3BlbkZpcm13YXJlIGNvbm5lY3Rpb24gaXQNCj4gcmVhZHMgYXMgIm9m
IiwgYXMgaW4gImEgY2FuIG9mIHdvcm1zIi4NCj4gDQo+IFBlcnNvbmFsbHkgSSdtIGEgYml0IGFt
Yml2YWxlbnQgYWJvdXQgaXQsIHRoZSBPRiBuYW1lIGlzIGEgYml0IHdyb25nIHNvDQo+IGl0IHdv
dWxkIGJlIG5pY2UgdG8gZ2V0IHJpZCBvZiwgYnV0IGl0J3MgYSBsb3Qgb2YgY2h1cm4uDQo+IA0K
PiBTbyBJJ20gaG9waW5nIHBlb3BsZSB3aXRoIGVpdGhlciBzYXkgIllFUyB0aGlzIGlzIGEgZ3Jl
YXQgaWRlYSIsIG9yICJOTw0KPiB0aGlzIGlzIHN0dXBpZCIuDQoNClBlcnNvbmFsbHksIEkgdGhp
bmsgaXQncyBhIGdyZWF0IGlkZWEsIGlmIG9ubHkgYmVjYXVzZSBJIHN0YXJlZCBsb25nIGFuZCBo
YXJkDQphdCB0aGUgY29kZSBvbmNlIHVwb24gYSB0aW1lIHRyeWluZyB0byBmaWd1cmUgb3V0IHdo
YXQgaXMgcmVhbGx5IE9GLXJlbGF0ZWQNCmFuZCB3aGF0IGlzbid0LiAgSXQncyBzb21ld2hhdCBj
bGVhcmVyIG5vdyB0aGF0IGRyaXZlcnMvb2YgaGFzIGJlZW4gZmFjdG9yZWQNCm91dCAoYWx0aG91
Z2gsIHNob3VsZG4ndCBpdCBiZSBkcml2ZXJzL2R0Pz8/KQ0KDQpUaGF0IHNhaWQsIGl0ICppcyog
YWxvdCBvZiBjb2RlIGNodXJuLiAgSWYgaXQncyBnb2luZyB0byBiZSBkb25lLCBJIHRoaW5rIGl0
IHNob3VsZCBiZQ0KZG9uZSBpbiBjb25jZXJ0IHdpdGggZml4aW5nIGEgYnVuY2ggb2YgdGhlIGZ1
bmN0aW9uIG5hbWVzIHdoaWNoIGRvbid0IHJlYWxseSBmb2xsb3cgYW55DQpzYW5lIG5hbWluZyBj
b252ZW50aW9uLCBzbyB0aGF0IHRoZSBiYWNrcG9ydGluZyBkaXNjb250aW51aXR5IG9ubHkgaGFw
cGVucyBvbmNlLg0KDQpTdGV2ZQ0KClRoaXMgZW1haWwgYW5kIGFueSBhdHRhY2htZW50cyBhcmUg
aW50ZW5kZWQgZm9yIHRoZSBzb2xlIHVzZSBvZiB0aGUgbmFtZWQgcmVjaXBpZW50KHMpIGFuZCBj
b250YWluKHMpIGNvbmZpZGVudGlhbCBpbmZvcm1hdGlvbiB0aGF0IG1heSBiZSBwcm9wcmlldGFy
eSwgcHJpdmlsZWdlZCBvciBjb3B5cmlnaHRlZCB1bmRlciBhcHBsaWNhYmxlIGxhdy4gSWYgeW91
IGFyZSBub3QgdGhlIGludGVuZGVkIHJlY2lwaWVudCwgZG8gbm90IHJlYWQsIGNvcHksIG9yIGZv
cndhcmQgdGhpcyBlbWFpbCBtZXNzYWdlIG9yIGFueSBhdHRhY2htZW50cy4gRGVsZXRlIHRoaXMg
ZW1haWwgbWVzc2FnZSBhbmQgYW55IGF0dGFjaG1lbnRzIGltbWVkaWF0ZWx5Lgo=

^ permalink raw reply

* Re: Mega rename of device tree routines from of_*() to dt_*()
From: David Daney @ 2010-11-24 17:18 UTC (permalink / raw)
  To: Stephen Neuendorffer
  Cc: linux-mips, microblaze-uclinux, devicetree-discuss, LKML,
	linuxppc-dev list, sparclinux
In-Reply-To: <fa44e045-9600-4c46-939a-af246afab4f6@VA3EHSMHS019.ehs.local>

On 11/24/2010 09:02 AM, Stephen Neuendorffer wrote:
>
>
>> -----Original Message-----
>> From: linuxppc-dev-bounces+stephen=neuendorffer.name@lists.ozlabs.org [mailto:linuxppc-dev-
>> bounces+stephen=neuendorffer.name@lists.ozlabs.org] On Behalf Of Michael Ellerman
>> Sent: Wednesday, November 24, 2010 6:04 AM
>> To: LKML
>> Cc: linux-mips; microblaze-uclinux@itee.uq.edu.au; devicetree-discuss@lists.ozlabs.org; linuxppc-dev
>> list; sparclinux@vger.kernel.org
>> Subject: RFC: Mega rename of device tree routines from of_*() to dt_*()
>>
>> Hi all,
>>
>> There were some murmurings on IRC last week about renaming the of_*()
>> routines. I was procrastinating at the time and said I'd have a look at
>> it, so here I am.
>>
>> The thinking is that on many platforms that use the of_() routines
>> OpenFirmware is not involved at all, this is true even on many powerpc
>> platforms. Also for folks who don't know the OpenFirmware connection it
>> reads as "of", as in "a can of worms".
>>
>> Personally I'm a bit ambivalent about it, the OF name is a bit wrong so
>> it would be nice to get rid of, but it's a lot of churn.
>>
>> So I'm hoping people with either say "YES this is a great idea", or "NO
>> this is stupid".
>
> Personally, I think it's a great idea, if only because I stared long and hard
> at the code once upon a time trying to figure out what is really OF-related
> and what isn't.  It's somewhat clearer now that drivers/of has been factored
> out (although, shouldn't it be drivers/dt???)
>
> That said, it *is* alot of code churn.  If it's going to be done, I think it should be
> done in concert with fixing a bunch of the function names which don't really follow any
> sane naming convention, so that the backporting discontinuity only happens once.
>

Oh, you mean things like:

of_{,un}register_platform_driver vs. platform_driver_{,un}register

That one is particularly annoying to me.

David Daney

^ permalink raw reply

* Re: Mega rename of device tree routines from of_*() to dt_*()
From: Grant Likely @ 2010-11-24 18:02 UTC (permalink / raw)
  To: David Daney
  Cc: linux-mips, microblaze-uclinux, LKML, linuxppc-dev list,
	sparclinux, devicetree-discuss
In-Reply-To: <4CED48CE.5060300@caviumnetworks.com>

On Wed, Nov 24, 2010 at 10:18 AM, David Daney <ddaney@caviumnetworks.com> w=
rote:
> On 11/24/2010 09:02 AM, Stephen Neuendorffer wrote:
>>
>>
>>> -----Original Message-----
>>> From: linuxppc-dev-bounces+stephen=3Dneuendorffer.name@lists.ozlabs.org
>>> [mailto:linuxppc-dev-
>>> bounces+stephen=3Dneuendorffer.name@lists.ozlabs.org] On Behalf Of Mich=
ael
>>> Ellerman
>>> Sent: Wednesday, November 24, 2010 6:04 AM
>>> To: LKML
>>> Cc: linux-mips; microblaze-uclinux@itee.uq.edu.au;
>>> devicetree-discuss@lists.ozlabs.org; linuxppc-dev
>>> list; sparclinux@vger.kernel.org
>>> Subject: RFC: Mega rename of device tree routines from of_*() to dt_*()
>>>
>>> Hi all,
>>>
>>> There were some murmurings on IRC last week about renaming the of_*()
>>> routines. I was procrastinating at the time and said I'd have a look at
>>> it, so here I am.
>>>
>>> The thinking is that on many platforms that use the of_() routines
>>> OpenFirmware is not involved at all, this is true even on many powerpc
>>> platforms. Also for folks who don't know the OpenFirmware connection it
>>> reads as "of", as in "a can of worms".
>>>
>>> Personally I'm a bit ambivalent about it, the OF name is a bit wrong so
>>> it would be nice to get rid of, but it's a lot of churn.
>>>
>>> So I'm hoping people with either say "YES this is a great idea", or "NO
>>> this is stupid".
>>
>> Personally, I think it's a great idea, if only because I stared long and
>> hard
>> at the code once upon a time trying to figure out what is really
>> OF-related
>> and what isn't. =A0It's somewhat clearer now that drivers/of has been
>> factored
>> out (although, shouldn't it be drivers/dt???)

Yes, the directory name should change, as should the CONFIG_OF* defines.

>>
>> That said, it *is* alot of code churn. =A0If it's going to be done, I th=
ink
>> it should be
>> done in concert with fixing a bunch of the function names which don't
>> really follow any
>> sane naming convention, so that the backporting discontinuity only happe=
ns
>> once.
>>
>
> Oh, you mean things like:
>
> of_{,un}register_platform_driver vs. platform_driver_{,un}register
>
> That one is particularly annoying to me.

Ignore that one.  of_{,un}platform_driver is deprecated and users will
all be converted to platform_drivers.

g.

^ permalink raw reply

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
From: David VomLehn @ 2010-11-24 18:18 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-mips, microblaze-uclinux, devicetree-discuss, LKML,
	linuxppc-dev list, sparclinux
In-Reply-To: <1290607413.12457.44.camel@concordia>

On Thu, Nov 25, 2010 at 01:03:33AM +1100, Michael Ellerman wrote:
> Hi all,
> 
> There were some murmurings on IRC last week about renaming the of_*()
> routines. I was procrastinating at the time and said I'd have a look at
> it, so here I am.
> 
> The thinking is that on many platforms that use the of_() routines
> OpenFirmware is not involved at all, this is true even on many powerpc
> platforms. Also for folks who don't know the OpenFirmware connection it
> reads as "of", as in "a can of worms".
> 
> Personally I'm a bit ambivalent about it, the OF name is a bit wrong so
> it would be nice to get rid of, but it's a lot of churn.
> 
> So I'm hoping people with either say "YES this is a great idea", or "NO
> this is stupid".
> 
> As step one I've just renamed as many routines as I could find to see
> what the resulting patch looks like, so we can quantify the churn. I
> also did device.of_node, which is used quite a bit.
> 
> Thoughts?

I'm looking at it the other way. There are inconsistencies in naming of
symbols and files we definitely should clean up. Since we're doing that,
let's take the opportunity to move from of* to dt*. With multiple
architectures adding device tree support, this is about the last chance
to do this without impacting too many people.
-- 
David VL

^ permalink raw reply

* RE: Mega rename of device tree routines from of_*() to dt_*()
From: Stephen Neuendorffer @ 2010-11-24 18:32 UTC (permalink / raw)
  To: David Daney
  Cc: linux-mips, microblaze-uclinux, devicetree-discuss, LKML,
	linuxppc-dev list, sparclinux
In-Reply-To: <4CED48CE.5060300@caviumnetworks.com>

DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogRGF2aWQgRGFuZXkgW21h
aWx0bzpkZGFuZXlAY2F2aXVtbmV0d29ya3MuY29tXQ0KPiBTZW50OiBXZWRuZXNkYXksIE5vdmVt
YmVyIDI0LCAyMDEwIDk6MTggQU0NCj4gVG86IFN0ZXBoZW4gTmV1ZW5kb3JmZmVyDQo+IENjOiBt
aWNoYWVsQGVsbGVybWFuLmlkLmF1OyBMS01MOyBsaW51eC1taXBzOyBtaWNyb2JsYXplLXVjbGlu
dXhAaXRlZS51cS5lZHUuYXU7IGRldmljZXRyZWUtDQo+IGRpc2N1c3NAbGlzdHMub3psYWJzLm9y
ZzsgbGludXhwcGMtZGV2IGxpc3Q7IHNwYXJjbGludXhAdmdlci5rZXJuZWwub3JnDQo+IFN1Ympl
Y3Q6IFJlOiBNZWdhIHJlbmFtZSBvZiBkZXZpY2UgdHJlZSByb3V0aW5lcyBmcm9tIG9mXyooKSB0
byBkdF8qKCkNCj4gDQo+IE9uIDExLzI0LzIwMTAgMDk6MDIgQU0sIFN0ZXBoZW4gTmV1ZW5kb3Jm
ZmVyIHdyb3RlOg0KPiA+DQo+ID4NCj4gPj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4g
Pj4gRnJvbTogbGludXhwcGMtZGV2LWJvdW5jZXMrc3RlcGhlbj1uZXVlbmRvcmZmZXIubmFtZUBs
aXN0cy5vemxhYnMub3JnIFttYWlsdG86bGludXhwcGMtZGV2LQ0KPiA+PiBib3VuY2VzK3N0ZXBo
ZW49bmV1ZW5kb3JmZmVyLm5hbWVAbGlzdHMub3psYWJzLm9yZ10gT24gQmVoYWxmIE9mIE1pY2hh
ZWwgRWxsZXJtYW4NCj4gPj4gU2VudDogV2VkbmVzZGF5LCBOb3ZlbWJlciAyNCwgMjAxMCA2OjA0
IEFNDQo+ID4+IFRvOiBMS01MDQo+ID4+IENjOiBsaW51eC1taXBzOyBtaWNyb2JsYXplLXVjbGlu
dXhAaXRlZS51cS5lZHUuYXU7IGRldmljZXRyZWUtZGlzY3Vzc0BsaXN0cy5vemxhYnMub3JnOyBs
aW51eHBwYy0NCj4gZGV2DQo+ID4+IGxpc3Q7IHNwYXJjbGludXhAdmdlci5rZXJuZWwub3JnDQo+
ID4+IFN1YmplY3Q6IFJGQzogTWVnYSByZW5hbWUgb2YgZGV2aWNlIHRyZWUgcm91dGluZXMgZnJv
bSBvZl8qKCkgdG8gZHRfKigpDQo+ID4+DQo+ID4+IEhpIGFsbCwNCj4gPj4NCj4gPj4gVGhlcmUg
d2VyZSBzb21lIG11cm11cmluZ3Mgb24gSVJDIGxhc3Qgd2VlayBhYm91dCByZW5hbWluZyB0aGUg
b2ZfKigpDQo+ID4+IHJvdXRpbmVzLiBJIHdhcyBwcm9jcmFzdGluYXRpbmcgYXQgdGhlIHRpbWUg
YW5kIHNhaWQgSSdkIGhhdmUgYSBsb29rIGF0DQo+ID4+IGl0LCBzbyBoZXJlIEkgYW0uDQo+ID4+
DQo+ID4+IFRoZSB0aGlua2luZyBpcyB0aGF0IG9uIG1hbnkgcGxhdGZvcm1zIHRoYXQgdXNlIHRo
ZSBvZl8oKSByb3V0aW5lcw0KPiA+PiBPcGVuRmlybXdhcmUgaXMgbm90IGludm9sdmVkIGF0IGFs
bCwgdGhpcyBpcyB0cnVlIGV2ZW4gb24gbWFueSBwb3dlcnBjDQo+ID4+IHBsYXRmb3Jtcy4gQWxz
byBmb3IgZm9sa3Mgd2hvIGRvbid0IGtub3cgdGhlIE9wZW5GaXJtd2FyZSBjb25uZWN0aW9uIGl0
DQo+ID4+IHJlYWRzIGFzICJvZiIsIGFzIGluICJhIGNhbiBvZiB3b3JtcyIuDQo+ID4+DQo+ID4+
IFBlcnNvbmFsbHkgSSdtIGEgYml0IGFtYml2YWxlbnQgYWJvdXQgaXQsIHRoZSBPRiBuYW1lIGlz
IGEgYml0IHdyb25nIHNvDQo+ID4+IGl0IHdvdWxkIGJlIG5pY2UgdG8gZ2V0IHJpZCBvZiwgYnV0
IGl0J3MgYSBsb3Qgb2YgY2h1cm4uDQo+ID4+DQo+ID4+IFNvIEknbSBob3BpbmcgcGVvcGxlIHdp
dGggZWl0aGVyIHNheSAiWUVTIHRoaXMgaXMgYSBncmVhdCBpZGVhIiwgb3IgIk5PDQo+ID4+IHRo
aXMgaXMgc3R1cGlkIi4NCj4gPg0KPiA+IFBlcnNvbmFsbHksIEkgdGhpbmsgaXQncyBhIGdyZWF0
IGlkZWEsIGlmIG9ubHkgYmVjYXVzZSBJIHN0YXJlZCBsb25nIGFuZCBoYXJkDQo+ID4gYXQgdGhl
IGNvZGUgb25jZSB1cG9uIGEgdGltZSB0cnlpbmcgdG8gZmlndXJlIG91dCB3aGF0IGlzIHJlYWxs
eSBPRi1yZWxhdGVkDQo+ID4gYW5kIHdoYXQgaXNuJ3QuICBJdCdzIHNvbWV3aGF0IGNsZWFyZXIg
bm93IHRoYXQgZHJpdmVycy9vZiBoYXMgYmVlbiBmYWN0b3JlZA0KPiA+IG91dCAoYWx0aG91Z2gs
IHNob3VsZG4ndCBpdCBiZSBkcml2ZXJzL2R0Pz8/KQ0KPiA+DQo+ID4gVGhhdCBzYWlkLCBpdCAq
aXMqIGFsb3Qgb2YgY29kZSBjaHVybi4gIElmIGl0J3MgZ29pbmcgdG8gYmUgZG9uZSwgSSB0aGlu
ayBpdCBzaG91bGQgYmUNCj4gPiBkb25lIGluIGNvbmNlcnQgd2l0aCBmaXhpbmcgYSBidW5jaCBv
ZiB0aGUgZnVuY3Rpb24gbmFtZXMgd2hpY2ggZG9uJ3QgcmVhbGx5IGZvbGxvdyBhbnkNCj4gPiBz
YW5lIG5hbWluZyBjb252ZW50aW9uLCBzbyB0aGF0IHRoZSBiYWNrcG9ydGluZyBkaXNjb250aW51
aXR5IG9ubHkgaGFwcGVucyBvbmNlLg0KPiA+DQo+IA0KPiBPaCwgeW91IG1lYW4gdGhpbmdzIGxp
a2U6DQo+IA0KPiBvZl97LHVufXJlZ2lzdGVyX3BsYXRmb3JtX2RyaXZlciB2cy4gcGxhdGZvcm1f
ZHJpdmVyX3ssdW59cmVnaXN0ZXINCj4gDQo+IFRoYXQgb25lIGlzIHBhcnRpY3VsYXJseSBhbm5v
eWluZyB0byBtZS4NCj4gDQo+IERhdmlkIERhbmV5DQoNCkFjdHVhbGx5LCBJIHdhcyBwYXJ0aWN1
bGFybHkgdGhpbmtpbmcgb2YgZHJpdmVycy9vZi9mZHQuYywgd2hpY2ggSSB3YXMgcmVjZW50bHkg
aGFja2luZyBhcm91bmQgd2l0aCwNCmJ1dCBJJ20gc3VyZSB0aGVyZSBhcmUgb3RoZXJzLi4uIDop
DQoNClN0ZXZlDQoKVGhpcyBlbWFpbCBhbmQgYW55IGF0dGFjaG1lbnRzIGFyZSBpbnRlbmRlZCBm
b3IgdGhlIHNvbGUgdXNlIG9mIHRoZSBuYW1lZCByZWNpcGllbnQocykgYW5kIGNvbnRhaW4ocykg
Y29uZmlkZW50aWFsIGluZm9ybWF0aW9uIHRoYXQgbWF5IGJlIHByb3ByaWV0YXJ5LCBwcml2aWxl
Z2VkIG9yIGNvcHlyaWdodGVkIHVuZGVyIGFwcGxpY2FibGUgbGF3LiBJZiB5b3UgYXJlIG5vdCB0
aGUgaW50ZW5kZWQgcmVjaXBpZW50LCBkbyBub3QgcmVhZCwgY29weSwgb3IgZm9yd2FyZCB0aGlz
IGVtYWlsIG1lc3NhZ2Ugb3IgYW55IGF0dGFjaG1lbnRzLiBEZWxldGUgdGhpcyBlbWFpbCBtZXNz
YWdlIGFuZCBhbnkgYXR0YWNobWVudHMgaW1tZWRpYXRlbHkuCg==

^ permalink raw reply

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
From: Michael Ellerman @ 2010-11-25 13:34 UTC (permalink / raw)
  To: LKML
  Cc: linux-arch, linux-mips, microblaze-uclinux, devicetree-discuss,
	linuxppc-dev list, sparclinux
In-Reply-To: <1290607413.12457.44.camel@concordia>

[-- Attachment #1: Type: text/plain, Size: 6771 bytes --]

On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote:
> Hi all,
> 
> There were some murmurings on IRC last week about renaming the of_*()
> routines.
...
> The thinking is that on many platforms that use the of_() routines
> OpenFirmware is not involved at all, this is true even on many powerpc
> platforms. Also for folks who don't know the OpenFirmware connection
> it reads as "of", as in "a can of worms".
...
> So I'm hoping people with either say "YES this is a great idea", or "NO
> this is stupid".

I'm still hoping, but so far it seems most people have got better things
to do, and of those that do have an opinion the balance is slightly
positive.

So here's a first cut of a patch to add the new names. I've not touched
of_platform because that is supposed to go away. That will lead to some
odd looking code in the interim, but I think is the right approach.

Most of these are straight renames, but some have changed more
substantially. The routines for the flat tree have all become fdt_foo().
I'd be inclined to drop "early_init" from them too, because they're
basically all about early init, but Grant said he'd prefer not to I
think. I've also renamed the flat tree tag constants to match libfdt.

I've left for_each_child_of_node(), because I read it as "of", but maybe
it's "OF"?

cheers

#ifndef __DT_H
#define __DT_H

/* include/linux/device.h */
#define dt_match_table			of_match_table
#define dt_node				of_node

/* include/linux/mod_devicetable.h */
#define dt_device_id			of_device_id

/* include/linux/of.h */
#define dt_node_to_nid			of_node_to_nid
#define dt_chosen			of_chosen
#define dt_node_is_root			of_node_is_root
#define dt_node_check_flag		of_node_check_flag
#define dt_node_set_flag		of_node_set_flag
#define dt_find_all_nodes		of_find_all_nodes
#define dt_node_get			of_node_get
#define dt_node_put			of_node_put
#define dt_read_number			of_read_number
#define dt_read_ulong			of_read_ulong
#define dt_find_node_by_name		of_find_node_by_name
#define dt_find_node_by_type		of_find_node_by_type
#define dt_find_compatible_node		of_find_compatible_node
#define dt_find_matching_node		of_find_matching_node
#define dt_find_node_by_path		of_find_node_by_path
#define dt_find_node_by_phandle		of_find_node_by_phandle
#define dt_get_parent			of_get_parent
#define dt_get_next_parent		of_get_next_parent
#define dt_get_next_child		of_get_next_child
#define dt_find_node_with_property	of_find_node_with_property
#define dt_device_is_compatible		of_device_is_compatible
#define dt_device_is_available		of_device_is_available
#define dt_get_property			of_get_property
#define dt_n_addr_cells			of_n_addr_cells
#define dt_n_size_cells			of_n_size_cells
#define dt_match_node			of_match_node
#define dt_modalias_node		of_modalias_node
#define dt_parse_phandle		of_parse_phandle
#define dt_parse_phandles_with_args	of_parse_phandles_with_args
#define dt_machine_is_compatible	of_machine_is_compatible
#define dt_attach_node			of_attach_node
#define dt_detach_node			of_detach_node
#define dt_find_property		of_find_property

/* include/linux/of_fdt.h */
#define fdt_find_string			find_flat_dt_string
#define fdt_scan			of_scan_flat_dt
#define fdt_get_prop			of_get_flat_dt_prop
#define fdt_is_compatible		of_flat_dt_is_compatible
#define fdt_get_root			of_get_flat_dt_root
#define fdt_early_init_scan_chosen	early_init_dt_scan_chosen
#define fdt_early_init_check_for_initrd	early_init_dt_check_for_initrd
#define fdt_early_init_scan_memory	early_init_dt_scan_memory
#define fdt_early_init_add_memory_arch	early_init_dt_add_memory_arch
#define fdt_early_init_alloc_memory_arch early_init_dt_alloc_memory_arch
#define fdt_early_init_setup_initrd_arch early_init_dt_setup_initrd_arch
#define fdt_early_init_scan_root	early_init_dt_scan_root
#define fdt_unflatten			unflatten_device_tree
#define fdt_early_init			early_init_devtree
#define FDT_MAGIC			OF_DT_HEADER
#define FDT_BEGIN_NODE			OF_DT_BEGIN_NODE
#define FDT_END_NODE			OF_DT_END_NODE
#define FDT_PROP			OF_DT_PROP
#define FDT_NOP				OF_DT_NOP
#define FDT_END				OF_DT_END
#define FDT_VERSION			OF_DT_VERSION

/* include/linux/of_address.h */
#define dt_translate_address		of_translate_address
#define dt_address_to_resource		of_address_to_resource
#define dt_iomap			of_iomap
#define dt_get_address			of_get_address
#define dt_get_pci_address		of_get_pci_address
#define dt_pci_address_to_resource	of_pci_address_to_resource

/* include/linux/of_device.h */
#define dt_match_device			of_match_device
#define dt_device_make_bus_id		of_device_make_bus_id
#define dt_driver_match_device		of_driver_match_device
#define dt_dev_get			of_dev_get
#define dt_dev_put			of_dev_put
#define dt_device_add			of_device_add
#define dt_device_register		of_device_register
#define dt_device_unregister		of_device_unregister
#define dt_device_get_modalias		of_device_get_modalias
#define dt_device_uevent		of_device_uevent
#define dt_device_node_put		of_device_node_put

/* include/linux/of_irq.h */
#define dt_irq				of_irq
#define dt_irq_parse_and_map		irq_of_parse_and_map
#define dt_irq_workarounds		of_irq_workarounds
#define dt_irq_dflt_pic			of_irq_dflt_pic
#define dt_irq_map_oldworld		of_irq_map_oldworld
#define dt_irq_map_raw			of_irq_map_raw
#define dt_irq_map_one			of_irq_map_one
#define dt_irq_create_mapping		irq_create_of_mapping
#define dt_irq_to_resource		of_irq_to_resource
#define dt_irq_count			of_irq_count
#define dt_irq_to_resource_table	of_irq_to_resource_table
#define DT_IRQ_MAX_SPEC			OF_MAX_IRQ_SPEC
#define DT_IRQ_QUIRK_OLDWORLD_MAC	OF_IMAP_OLDWORLD_MAC
#define DT_IRQ_QUIRK_NO_PHANDLE		OF_IMAP_NO_PHANDLE

/* include/linux/of_mdio.h */
#define dt_mdiobus_register		of_mdiobus_register
#define dt_phy_find_device		of_phy_find_device
#define dt_phy_connect			of_phy_connect
#define dt_phy_connect_fixed_link	of_phy_connect_fixed_link

/* include/linux/of_spi.h */
#define dt_register_spi_devices		of_register_spi_devices

/* include/linux/of_gpio.h */
#define dt_gpio_flags			of_gpio_flags
#define DT_GPIO_ACTIVE_LOW		OF_GPIO_ACTIVE_LOW
#define dt_mm_gpio_chip			of_mm_gpio_chip
#define to_dt_mm_gpio_chip		to_of_mm_gpio_chip
#define dt_get_gpio_flags		of_get_gpio_flags
#define dt_gpio_count			of_gpio_count
#define dt_mm_gpiochip_add		of_mm_gpiochip_add
#define dt_gpiochip_add			of_gpiochip_add
#define dt_gpiochip_remove		of_gpiochip_remove
#define dt_node_to_gpiochip		of_node_to_gpiochip
#define dt_get_gpio			of_get_gpio

/* include/linux/dt_i2c.h */
#define dt_i2c_register_devices		of_i2c_register_devices
#define dt_find_i2c_device_by_node	of_find_i2c_device_by_node

#endif /* __DT_H */




[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
From: Geert Uytterhoeven @ 2010-11-25 14:01 UTC (permalink / raw)
  To: michael
  Cc: linux-arch, linux-mips, microblaze-uclinux, devicetree-discuss,
	LKML, linuxppc-dev list, sparclinux
In-Reply-To: <1290692075.689.20.camel@concordia>

On Thu, Nov 25, 2010 at 14:34, Michael Ellerman <michael@ellerman.id.au> wr=
ote:
> I've left for_each_child_of_node(), because I read it as "of", but maybe
> it's "OF"?

I always read it as "for each child-OF-node", so I would rename it to
"dt_for_each_child_node".

Gr{oetje,eeting}s,

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k=
.org

In personal conversations with technical people, I call myself a hacker. Bu=
t
when I'm talking to journalists I just say "programmer" or something like t=
hat.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0=C2=A0 -- Linus Torvalds

^ permalink raw reply

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
From: Grant Likely @ 2010-11-25 16:17 UTC (permalink / raw)
  To: michael
  Cc: linux-arch, linux-mips, microblaze-uclinux, devicetree-discuss,
	LKML, linuxppc-dev list, sparclinux, Andrew Morton,
	Linus Torvalds
In-Reply-To: <1290692075.689.20.camel@concordia>

On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman
<michael@ellerman.id.au> wrote:
> On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote:
>> Hi all,
>>
>> There were some murmurings on IRC last week about renaming the of_*()
>> routines.
> ...
>> The thinking is that on many platforms that use the of_() routines
>> OpenFirmware is not involved at all, this is true even on many powerpc
>> platforms. Also for folks who don't know the OpenFirmware connection
>> it reads as "of", as in "a can of worms".
> ...
>> So I'm hoping people with either say "YES this is a great idea", or "NO
>> this is stupid".
>
> I'm still hoping, but so far it seems most people have got better things
> to do, and of those that do have an opinion the balance is slightly
> positive.

I assume you'll be also publishing the script that you use for
generating the massive patch.  I expect that there will be a few
iterations of running the rename script to convert over all the
stragglers.  It should also be negotiated with Linus about when this
patch should get applied.  I do NOT want to cause massive merge pain
during the merge window.

Andrew/Linus: Before Michael proceeds too far with this rename, are
you okay with a mass rename of the device tree functions from of_* to
dt_*?  Nobody likes the ambiguous 'of_' prefix ("of?  of what?"), but
to fix it means large cross-tree patches and potential merge
conflicts.

> So here's a first cut of a patch to add the new names. I've not touched
> of_platform because that is supposed to go away. That will lead to some
> odd looking code in the interim, but I think is the right approach.

I would split it up into separate dt*.h files, one for each of*.h file
so that the #include lines can be changed in the C code at the same
time.  Each dt*.h file would include it's of*.h counterpart.  Then
after the code is renamed, and a release or two has passed to catch
the majority of users, the old definitions can be moved into the dt*.h
files.

However, it may be better to move and rename the definitions
immediately, and leave "#define of_*  dt_*" macros in the old of*.h
files which can be removed with a simple patch after all the users are
converted.  That would have a smaller impact in the cleanup stage.

> Most of these are straight renames, but some have changed more
> substantially. The routines for the flat tree have all become fdt_foo().
> I'd be inclined to drop "early_init" from them too, because they're
> basically all about early init, but Grant said he'd prefer not to I
> think. I've also renamed the flat tree tag constants to match libfdt.

It is all about early init now in Linus' tree, but Stephen
Neuendorffer has patches that use the fdt code at driver probe time
for parsing device tree fragments that describe an FPGA add-in board.

>
> I've left for_each_child_of_node(), because I read it as "of", but maybe
> it's "OF"?

hahaha!  I never considered that it might be OF, but now I probably
won't be able to help but read it that way!  I like Geert's suggestion
of dt_for_each_child_node

g.

>
> cheers
>
> #ifndef __DT_H
> #define __DT_H
>
> /* include/linux/device.h */
> #define dt_match_table =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_match_table
> #define dt_node =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node

This could be very messy.  I've nervous about using #define to rename
structure members.  You'll need to check that any structure members
that use the same name as a global symbol are handled appropriately.

>
> /* include/linux/mod_devicetable.h */
> #define dt_device_id =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_device_id
>
> /* include/linux/of.h */
> #define dt_node_to_nid =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_node_to_nid
> #define dt_chosen =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_chosen
> #define dt_node_is_root =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node_is_root
> #define dt_node_check_flag =A0 =A0 =A0 =A0 =A0 =A0 =A0of_node_check_flag
> #define dt_node_set_flag =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_node_set_flag
> #define dt_find_all_nodes =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_find_all_nodes
> #define dt_node_get =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node_get
> #define dt_node_put =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node_put
> #define dt_read_number =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_read_number
> #define dt_read_ulong =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_read_ulong
> #define dt_find_node_by_name =A0 =A0 =A0 =A0 =A0 =A0of_find_node_by_name
> #define dt_find_node_by_type =A0 =A0 =A0 =A0 =A0 =A0of_find_node_by_type
> #define dt_find_compatible_node =A0 =A0 =A0 =A0 of_find_compatible_node
> #define dt_find_matching_node =A0 =A0 =A0 =A0 =A0 of_find_matching_node
> #define dt_find_node_by_path =A0 =A0 =A0 =A0 =A0 =A0of_find_node_by_path
> #define dt_find_node_by_phandle =A0 =A0 =A0 =A0 of_find_node_by_phandle
> #define dt_get_parent =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_get_parent
> #define dt_get_next_parent =A0 =A0 =A0 =A0 =A0 =A0 =A0of_get_next_parent
> #define dt_get_next_child =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_get_next_child
> #define dt_find_node_with_property =A0 =A0 =A0of_find_node_with_property
> #define dt_device_is_compatible =A0 =A0 =A0 =A0 of_device_is_compatible
> #define dt_device_is_available =A0 =A0 =A0 =A0 =A0of_device_is_available
> #define dt_get_property =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_get_property
> #define dt_n_addr_cells =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_n_addr_cells
> #define dt_n_size_cells =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_n_size_cells
> #define dt_match_node =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_match_node
> #define dt_modalias_node =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_modalias_node
> #define dt_parse_phandle =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_parse_phandle
> #define dt_parse_phandles_with_args =A0 =A0 of_parse_phandles_with_args
> #define dt_machine_is_compatible =A0 =A0 =A0 =A0of_machine_is_compatible
> #define dt_attach_node =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_attach_node
> #define dt_detach_node =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_detach_node
> #define dt_find_property =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_find_property
>
> /* include/linux/of_fdt.h */
> #define fdt_find_string =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 find_flat_dt_stri=
ng
> #define fdt_scan =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_scan_f=
lat_dt
> #define fdt_get_prop =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_get_flat_d=
t_prop
> #define fdt_is_compatible =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_flat_dt_is_compa=
tible
> #define fdt_get_root =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_get_flat_d=
t_root
> #define fdt_early_init_scan_chosen =A0 =A0 =A0early_init_dt_scan_chosen
> #define fdt_early_init_check_for_initrd early_init_dt_check_for_initrd
> #define fdt_early_init_scan_memory =A0 =A0 =A0early_init_dt_scan_memory
> #define fdt_early_init_add_memory_arch =A0early_init_dt_add_memory_arch
> #define fdt_early_init_alloc_memory_arch early_init_dt_alloc_memory_arch
> #define fdt_early_init_setup_initrd_arch early_init_dt_setup_initrd_arch
> #define fdt_early_init_scan_root =A0 =A0 =A0 =A0early_init_dt_scan_root
> #define fdt_unflatten =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 unflatten_devic=
e_tree
> #define fdt_early_init =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0early_init_devt=
ree
> #define FDT_MAGIC =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 OF_DT_HEADE=
R
> #define FDT_BEGIN_NODE =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0OF_DT_BEGIN_NOD=
E
> #define FDT_END_NODE =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0OF_DT_END_NOD=
E
> #define FDT_PROP =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0OF_DT_PRO=
P
> #define FDT_NOP =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 OF_DT_NOP
> #define FDT_END =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 OF_DT_END
> #define FDT_VERSION =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 OF_DT_VERSION
>
> /* include/linux/of_address.h */
> #define dt_translate_address =A0 =A0 =A0 =A0 =A0 =A0of_translate_address
> #define dt_address_to_resource =A0 =A0 =A0 =A0 =A0of_address_to_resource
> #define dt_iomap =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_iomap
> #define dt_get_address =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_get_address
> #define dt_get_pci_address =A0 =A0 =A0 =A0 =A0 =A0 =A0of_get_pci_address
> #define dt_pci_address_to_resource =A0 =A0 =A0of_pci_address_to_resource
>
> /* include/linux/of_device.h */
> #define dt_match_device =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_match_device
> #define dt_device_make_bus_id =A0 =A0 =A0 =A0 =A0 of_device_make_bus_id
> #define dt_driver_match_device =A0 =A0 =A0 =A0 =A0of_driver_match_device
> #define dt_dev_get =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_dev_get
> #define dt_dev_put =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_dev_put
> #define dt_device_add =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_device_add
> #define dt_device_register =A0 =A0 =A0 =A0 =A0 =A0 =A0of_device_register
> #define dt_device_unregister =A0 =A0 =A0 =A0 =A0 =A0of_device_unregister
> #define dt_device_get_modalias =A0 =A0 =A0 =A0 =A0of_device_get_modalias
> #define dt_device_uevent =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_device_uevent
> #define dt_device_node_put =A0 =A0 =A0 =A0 =A0 =A0 =A0of_device_node_put
>
> /* include/linux/of_irq.h */
> #define dt_irq =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_irq
> #define dt_irq_parse_and_map =A0 =A0 =A0 =A0 =A0 =A0irq_of_parse_and_map
> #define dt_irq_workarounds =A0 =A0 =A0 =A0 =A0 =A0 =A0of_irq_workarounds
> #define dt_irq_dflt_pic =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_irq_dflt_pic
> #define dt_irq_map_oldworld =A0 =A0 =A0 =A0 =A0 =A0 of_irq_map_oldworld
> #define dt_irq_map_raw =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_irq_map_raw
> #define dt_irq_map_one =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_irq_map_one
> #define dt_irq_create_mapping =A0 =A0 =A0 =A0 =A0 irq_create_of_mapping
> #define dt_irq_to_resource =A0 =A0 =A0 =A0 =A0 =A0 =A0of_irq_to_resource
> #define dt_irq_count =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_irq_count
> #define dt_irq_to_resource_table =A0 =A0 =A0 =A0of_irq_to_resource_table
> #define DT_IRQ_MAX_SPEC =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 OF_MAX_IRQ_SPEC
> #define DT_IRQ_QUIRK_OLDWORLD_MAC =A0 =A0 =A0 OF_IMAP_OLDWORLD_MAC
> #define DT_IRQ_QUIRK_NO_PHANDLE =A0 =A0 =A0 =A0 OF_IMAP_NO_PHANDLE
>
> /* include/linux/of_mdio.h */
> #define dt_mdiobus_register =A0 =A0 =A0 =A0 =A0 =A0 of_mdiobus_register
> #define dt_phy_find_device =A0 =A0 =A0 =A0 =A0 =A0 =A0of_phy_find_device
> #define dt_phy_connect =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0of_phy_connect
> #define dt_phy_connect_fixed_link =A0 =A0 =A0 of_phy_connect_fixed_link
>
> /* include/linux/of_spi.h */
> #define dt_register_spi_devices =A0 =A0 =A0 =A0 of_register_spi_devices
>
> /* include/linux/of_gpio.h */
> #define dt_gpio_flags =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_gpio_flags
> #define DT_GPIO_ACTIVE_LOW =A0 =A0 =A0 =A0 =A0 =A0 =A0OF_GPIO_ACTIVE_LOW
> #define dt_mm_gpio_chip =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_mm_gpio_chip
> #define to_dt_mm_gpio_chip =A0 =A0 =A0 =A0 =A0 =A0 =A0to_of_mm_gpio_chip
> #define dt_get_gpio_flags =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_get_gpio_flags
> #define dt_gpio_count =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_gpio_count
> #define dt_mm_gpiochip_add =A0 =A0 =A0 =A0 =A0 =A0 =A0of_mm_gpiochip_add
> #define dt_gpiochip_add =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_gpiochip_add
> #define dt_gpiochip_remove =A0 =A0 =A0 =A0 =A0 =A0 =A0of_gpiochip_remove
> #define dt_node_to_gpiochip =A0 =A0 =A0 =A0 =A0 =A0 of_node_to_gpiochip
> #define dt_get_gpio =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_get_gpio
>
> /* include/linux/dt_i2c.h */
> #define dt_i2c_register_devices =A0 =A0 =A0 =A0 of_i2c_register_devices
> #define dt_find_i2c_device_by_node =A0 =A0 =A0of_find_i2c_device_by_node
>
> #endif /* __DT_H */
>
>
>
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
>
>



--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
From: Benjamin Herrenschmidt @ 2010-11-25 20:52 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-arch, linux-mips, microblaze-uclinux, devicetree-discuss,
	LKML, linuxppc-dev list, sparclinux
In-Reply-To: <AANLkTim9fPPWO-240dmavng+j=70G8Y4P-+j3Y+OZTL0@mail.gmail.com>

On Thu, 2010-11-25 at 15:01 +0100, Geert Uytterhoeven wrote:
> 
> I always read it as "for each child-OF-node", so I would rename it to
> "dt_for_each_child_node".

Well, it was meant to be for_child_of_node not _OF_node :-)

Cheers,
Ben.

^ permalink raw reply

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
From: Michael Ellerman @ 2010-11-26  3:15 UTC (permalink / raw)
  To: Grant Likely
  Cc: linux-arch, linux-mips, microblaze-uclinux, devicetree-discuss,
	LKML, linuxppc-dev list, sparclinux, Andrew Morton,
	Linus Torvalds
In-Reply-To: <AANLkTiknyKi1pzvUP2WnasudZwH27-a0FxCX0BSHBdQp@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4928 bytes --]

On Thu, 2010-11-25 at 09:17 -0700, Grant Likely wrote:
> On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman
> <michael@ellerman.id.au> wrote:
> > On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote:
> >> Hi all,
> >>
> >> There were some murmurings on IRC last week about renaming the of_*()
> >> routines.
> > ...
> >> The thinking is that on many platforms that use the of_() routines
> >> OpenFirmware is not involved at all, this is true even on many powerpc
> >> platforms. Also for folks who don't know the OpenFirmware connection
> >> it reads as "of", as in "a can of worms".
> > ...
> >> So I'm hoping people with either say "YES this is a great idea", or "NO
> >> this is stupid".
> >
> > I'm still hoping, but so far it seems most people have got better things
> > to do, and of those that do have an opinion the balance is slightly
> > positive.
> 
> I assume you'll be also publishing the script that you use for
> generating the massive patch.  I expect that there will be a few
> iterations of running the rename script to convert over all the
> stragglers. 

Yep sure, I'll just make it less crap first.

> It should also be negotiated with Linus about when this
> patch should get applied.  I do NOT want to cause massive merge pain
> during the merge window.

Obviously.

> Andrew/Linus: Before Michael proceeds too far with this rename, are
> you okay with a mass rename of the device tree functions from of_* to
> dt_*?  Nobody likes the ambiguous 'of_' prefix ("of?  of what?"), but
> to fix it means large cross-tree patches and potential merge
> conflicts.

It'd also be good to hear from DaveM, sparc is the platform with the
strongest link to real OF AFAIK, so the of_() names make more sense
there.

> > So here's a first cut of a patch to add the new names. I've not touched
> > of_platform because that is supposed to go away. That will lead to some
> > odd looking code in the interim, but I think is the right approach.
> 
> I would split it up into separate dt*.h files, one for each of*.h file
> so that the #include lines can be changed in the C code at the same
> time.  Each dt*.h file would include it's of*.h counterpart.  Then
> after the code is renamed, and a release or two has passed to catch
> the majority of users, the old definitions can be moved into the dt*.h
> files.

Yep that sounds like a plan. I did it as a single header for starters so
I could autogenerate the rename script easily.

> However, it may be better to move and rename the definitions
> immediately, and leave "#define of_*  dt_*" macros in the old of*.h
> files which can be removed with a simple patch after all the users are
> converted.  That would have a smaller impact in the cleanup stage.

True, though a bigger impact to start with. I did that originally but
decided it might be better to start with the minimal patch to add the
new names. That way Linus might accept it this release, meaning we'd
have the new names in place for code in -next.

> > Most of these are straight renames, but some have changed more
> > substantially. The routines for the flat tree have all become fdt_foo().
> > I'd be inclined to drop "early_init" from them too, because they're
> > basically all about early init, but Grant said he'd prefer not to I
> > think. I've also renamed the flat tree tag constants to match libfdt.
> 
> It is all about early init now in Linus' tree, but Stephen
> Neuendorffer has patches that use the fdt code at driver probe time
> for parsing device tree fragments that describe an FPGA add-in board.

OK fair enough.

> > I've left for_each_child_of_node(), because I read it as "of", but maybe
> > it's "OF"?
> 
> hahaha!  I never considered that it might be OF, but now I probably
> won't be able to help but read it that way!  I like Geert's suggestion
> of dt_for_each_child_node

OK, I like it the way it is, but if the consensus is to change it then
we can. There's a bunch actually:

for_each_node_by_name(dn, name) \
for_each_node_by_type(dn, type) \
for_each_compatible_node(dn, type, compatible) \
for_each_matching_node(dn, matches) \
for_each_child_of_node(parent, child) \
for_each_node_with_property(dn, prop_name) \

So either dt_for_each_blah(), or for_each_dt_node_blah() ?

> > /* include/linux/device.h */
> > #define dt_match_table                  of_match_table
> > #define dt_node                         of_node
> 
> This could be very messy.  I've nervous about using #define to rename
> structure members.  You'll need to check that any structure members
> that use the same name as a global symbol are handled appropriately.

I'm not sure what you mean about global symbols.

I think it's fairly safe, in that direction, ie. defining the dt_*
names. Neither of those strings appears anywhere in the tree at the
moment (as a token).

cheers


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
From: Mitch Bradley @ 2010-11-26  4:42 UTC (permalink / raw)
  To: michael
  Cc: linux-arch, linux-mips, microblaze-uclinux, devicetree-discuss,
	LKML, linuxppc-dev list, sparclinux, Andrew Morton,
	Linus Torvalds
In-Reply-To: <1290741341.9453.377.camel@concordia>

On 11/25/2010 5:15 PM, Michael Ellerman wrote:
> On Thu, 2010-11-25 at 09:17 -0700, Grant Likely wrote:
>> On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman
>> <michael@ellerman.id.au>  wrote:
>>> On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote:
>>>> Hi all,
>>>>
>>>> There were some murmurings on IRC last week about renaming the of_*()
>>>> routines.
>>> ...
>>>> The thinking is that on many platforms that use the of_() routines
>>>> OpenFirmware is not involved at all, this is true even on many powerpc
>>>> platforms. Also for folks who don't know the OpenFirmware connection
>>>> it reads as "of", as in "a can of worms".
>>> ...
>>>> So I'm hoping people with either say "YES this is a great idea", or "NO
>>>> this is stupid".
>>>
>>> I'm still hoping, but so far it seems most people have got better things
>>> to do, and of those that do have an opinion the balance is slightly
>>> positive.
>>
>> I assume you'll be also publishing the script that you use for
>> generating the massive patch.  I expect that there will be a few
>> iterations of running the rename script to convert over all the
>> stragglers.
>
> Yep sure, I'll just make it less crap first.
>
>> It should also be negotiated with Linus about when this
>> patch should get applied.  I do NOT want to cause massive merge pain
>> during the merge window.
>
> Obviously.
>
>> Andrew/Linus: Before Michael proceeds too far with this rename, are
>> you okay with a mass rename of the device tree functions from of_* to
>> dt_*?  Nobody likes the ambiguous 'of_' prefix ("of?  of what?"), but
>> to fix it means large cross-tree patches and potential merge
>> conflicts.
>
> It'd also be good to hear from DaveM, sparc is the platform with the
> strongest link to real OF AFAIK, so the of_() names make more sense
> there.


One Laptop Per Child ships real Open Firmware on its x86 Linux systems, 
of which approximately 2 million have been shipped or ordered.  An ARM 
version, also with OFW, is in the works.  From the standpoint of "number 
of units in the field actually running Linux", I expect that compares 
favorably with SPARC.

That said, I don't particularly like the abbreviation "of" either; I 
abbreviate Open Firmware as "OFW".

I don't mind using "dt_" to apply to device tree things; I think it's 
clearer than "of_".   Ideally, it would be nice to acknowledge the 
historical connection in some way, but confusing nomenclature probably 
is not the way to go about it.



>
>>> So here's a first cut of a patch to add the new names. I've not touched
>>> of_platform because that is supposed to go away. That will lead to some
>>> odd looking code in the interim, but I think is the right approach.
>>
>> I would split it up into separate dt*.h files, one for each of*.h file
>> so that the #include lines can be changed in the C code at the same
>> time.  Each dt*.h file would include it's of*.h counterpart.  Then
>> after the code is renamed, and a release or two has passed to catch
>> the majority of users, the old definitions can be moved into the dt*.h
>> files.
>
> Yep that sounds like a plan. I did it as a single header for starters so
> I could autogenerate the rename script easily.
>
>> However, it may be better to move and rename the definitions
>> immediately, and leave "#define of_*  dt_*" macros in the old of*.h
>> files which can be removed with a simple patch after all the users are
>> converted.  That would have a smaller impact in the cleanup stage.
>
> True, though a bigger impact to start with. I did that originally but
> decided it might be better to start with the minimal patch to add the
> new names. That way Linus might accept it this release, meaning we'd
> have the new names in place for code in -next.
>
>>> Most of these are straight renames, but some have changed more
>>> substantially. The routines for the flat tree have all become fdt_foo().
>>> I'd be inclined to drop "early_init" from them too, because they're
>>> basically all about early init, but Grant said he'd prefer not to I
>>> think. I've also renamed the flat tree tag constants to match libfdt.
>>
>> It is all about early init now in Linus' tree, but Stephen
>> Neuendorffer has patches that use the fdt code at driver probe time
>> for parsing device tree fragments that describe an FPGA add-in board.
>
> OK fair enough.
>
>>> I've left for_each_child_of_node(), because I read it as "of", but maybe
>>> it's "OF"?
>>
>> hahaha!  I never considered that it might be OF, but now I probably
>> won't be able to help but read it that way!  I like Geert's suggestion
>> of dt_for_each_child_node
>
> OK, I like it the way it is, but if the consensus is to change it then
> we can. There's a bunch actually:
>
> for_each_node_by_name(dn, name) \
> for_each_node_by_type(dn, type) \
> for_each_compatible_node(dn, type, compatible) \
> for_each_matching_node(dn, matches) \
> for_each_child_of_node(parent, child) \
> for_each_node_with_property(dn, prop_name) \
>
> So either dt_for_each_blah(), or for_each_dt_node_blah() ?
>
>>> /* include/linux/device.h */
>>> #define dt_match_table                  of_match_table
>>> #define dt_node                         of_node
>>
>> This could be very messy.  I've nervous about using #define to rename
>> structure members.  You'll need to check that any structure members
>> that use the same name as a global symbol are handled appropriately.
>
> I'm not sure what you mean about global symbols.
>
> I think it's fairly safe, in that direction, ie. defining the dt_*
> names. Neither of those strings appears anywhere in the tree at the
> moment (as a token).
>
> cheers
>
>
>
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss

^ permalink raw reply

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
From: Michael Ellerman @ 2010-11-26  5:50 UTC (permalink / raw)
  To: Mitch Bradley
  Cc: linux-arch, linux-mips, microblaze-uclinux, devicetree-discuss,
	LKML, linuxppc-dev list, sparclinux, Andrew Morton,
	Linus Torvalds
In-Reply-To: <4CEF3AB1.9060200@firmworks.com>

[-- Attachment #1: Type: text/plain, Size: 2900 bytes --]

On Thu, 2010-11-25 at 18:42 -1000, Mitch Bradley wrote:
> On 11/25/2010 5:15 PM, Michael Ellerman wrote:
> > On Thu, 2010-11-25 at 09:17 -0700, Grant Likely wrote:
> >> On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman
> >> <michael@ellerman.id.au>  wrote:
> >>> On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote:
> >>>> Hi all,
> >>>>
> >>>> There were some murmurings on IRC last week about renaming the of_*()
> >>>> routines.
> >>> ...
> >>>> The thinking is that on many platforms that use the of_() routines
> >>>> OpenFirmware is not involved at all, this is true even on many powerpc
> >>>> platforms. Also for folks who don't know the OpenFirmware connection
> >>>> it reads as "of", as in "a can of worms".
> >>> ...
> >>>> So I'm hoping people with either say "YES this is a great idea", or "NO
> >>>> this is stupid".
> >>>
> >>> I'm still hoping, but so far it seems most people have got better things
> >>> to do, and of those that do have an opinion the balance is slightly
> >>> positive.
> >>
> >> I assume you'll be also publishing the script that you use for
> >> generating the massive patch.  I expect that there will be a few
> >> iterations of running the rename script to convert over all the
> >> stragglers.
> >
> > Yep sure, I'll just make it less crap first.
> >
> >> It should also be negotiated with Linus about when this
> >> patch should get applied.  I do NOT want to cause massive merge pain
> >> during the merge window.
> >
> > Obviously.
> >
> >> Andrew/Linus: Before Michael proceeds too far with this rename, are
> >> you okay with a mass rename of the device tree functions from of_* to
> >> dt_*?  Nobody likes the ambiguous 'of_' prefix ("of?  of what?"), but
> >> to fix it means large cross-tree patches and potential merge
> >> conflicts.
> >
> > It'd also be good to hear from DaveM, sparc is the platform with the
> > strongest link to real OF AFAIK, so the of_() names make more sense
> > there.
> 
> 
> One Laptop Per Child ships real Open Firmware on its x86 Linux systems, 
> of which approximately 2 million have been shipped or ordered.  An ARM 
> version, also with OFW, is in the works.

OK. I don't see any code under arch/x86 or arch/arm that uses of_()
routines though? Or is it under drivers or something?

> That said, I don't particularly like the abbreviation "of" either; I 
> abbreviate Open Firmware as "OFW".
> 
> I don't mind using "dt_" to apply to device tree things; I think it's 
> clearer than "of_".   Ideally, it would be nice to acknowledge the 
> historical connection in some way, but confusing nomenclature probably 
> is not the way to go about it.

Cool. I think there will still be a few things that have OF in the name,
at least for a while, and I'm sure the doco will still mention OF, so I
don't think the connection will be lost.

cheers


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
From: Grant Likely @ 2010-11-26  7:15 UTC (permalink / raw)
  To: michael
  Cc: linux-arch, linux-mips, sparclinux, microblaze-uclinux,
	devicetree-discuss, LKML, linuxppc-dev list, Mitch Bradley,
	Andrew Morton, Linus Torvalds
In-Reply-To: <1290750606.9453.394.camel@concordia>

On Thu, Nov 25, 2010 at 10:50 PM, Michael Ellerman
<michael@ellerman.id.au> wrote:
> On Thu, 2010-11-25 at 18:42 -1000, Mitch Bradley wrote:
>> On 11/25/2010 5:15 PM, Michael Ellerman wrote:
>> > On Thu, 2010-11-25 at 09:17 -0700, Grant Likely wrote:
>> >> On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman
>> >> <michael@ellerman.id.au> =A0wrote:
>> >>> On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote:
>> >>>> Hi all,
>> >>>>
>> >>>> There were some murmurings on IRC last week about renaming the of_*=
()
>> >>>> routines.
>> >>> ...
>> >>>> The thinking is that on many platforms that use the of_() routines
>> >>>> OpenFirmware is not involved at all, this is true even on many powe=
rpc
>> >>>> platforms. Also for folks who don't know the OpenFirmware connectio=
n
>> >>>> it reads as "of", as in "a can of worms".
>> >>> ...
>> >>>> So I'm hoping people with either say "YES this is a great idea", or=
 "NO
>> >>>> this is stupid".
>> >>>
>> >>> I'm still hoping, but so far it seems most people have got better th=
ings
>> >>> to do, and of those that do have an opinion the balance is slightly
>> >>> positive.
>> >>
>> >> I assume you'll be also publishing the script that you use for
>> >> generating the massive patch. =A0I expect that there will be a few
>> >> iterations of running the rename script to convert over all the
>> >> stragglers.
>> >
>> > Yep sure, I'll just make it less crap first.
>> >
>> >> It should also be negotiated with Linus about when this
>> >> patch should get applied. =A0I do NOT want to cause massive merge pai=
n
>> >> during the merge window.
>> >
>> > Obviously.
>> >
>> >> Andrew/Linus: Before Michael proceeds too far with this rename, are
>> >> you okay with a mass rename of the device tree functions from of_* to
>> >> dt_*? =A0Nobody likes the ambiguous 'of_' prefix ("of? =A0of what?"),=
 but
>> >> to fix it means large cross-tree patches and potential merge
>> >> conflicts.
>> >
>> > It'd also be good to hear from DaveM, sparc is the platform with the
>> > strongest link to real OF AFAIK, so the of_() names make more sense
>> > there.
>>
>>
>> One Laptop Per Child ships real Open Firmware on its x86 Linux systems,
>> of which approximately 2 million have been shipped or ordered. =A0An ARM
>> version, also with OFW, is in the works.
>
> OK. I don't see any code under arch/x86 or arch/arm that uses of_()
> routines though? Or is it under drivers or something?
>
>> That said, I don't particularly like the abbreviation "of" either; I
>> abbreviate Open Firmware as "OFW".
>>
>> I don't mind using "dt_" to apply to device tree things; I think it's
>> clearer than "of_". =A0 Ideally, it would be nice to acknowledge the
>> historical connection in some way, but confusing nomenclature probably
>> is not the way to go about it.

Yes, I like the ofw_ prefix too, and briefly considered renaming to
that, but decide that dt_ was better due to the number of systems
using the device tree without real openfirmware.

However, the ofw_ prefix would make sense if any of the promtree code
is renamed.

> Cool. I think there will still be a few things that have OF in the name,
> at least for a while, and I'm sure the doco will still mention OF, so I
> don't think the connection will be lost.

Considering that pretty much all the documentation makes some
reference back to the openfirmware origins, I'm pretty sure the ofw
legacy is safe.  :-)

g.

^ permalink raw reply

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
From: Mitch Bradley @ 2010-11-26  7:36 UTC (permalink / raw)
  To: michael
  Cc: linux-arch, linux-mips, microblaze-uclinux, devicetree-discuss,
	LKML, linuxppc-dev list, sparclinux, Andrew Morton, Andrea Scian,
	Linus Torvalds
In-Reply-To: <1290750606.9453.394.camel@concordia>


>> One Laptop Per Child ships real Open Firmware on its x86 Linux systems,
>> of which approximately 2 million have been shipped or ordered.  An ARM
>> version, also with OFW, is in the works.
>
> OK. I don't see any code under arch/x86 or arch/arm that uses of_()
> routines though? Or is it under drivers or something?
>

Andres Salomon has been working for some time to get some Open Firmware 
support for x86 upstream.  As you can probably imagine, it has been slow 
going, but seems to be getting close.

The OLPC ARM work is just beginning, so nothing has been submitted yet. 
  The first hardware prototypes are still being debugged. Lennert 
Buytenhek is the key OS person who will be involved.

^ permalink raw reply

* [PATCH] ucc_geth: fix ucc halt problem in half duplex mode
From: Li Yang @ 2010-11-26  9:29 UTC (permalink / raw)
  To: linuxppc-dev, netdev, davem
  Cc: Anton Vorontsov, Jean-Denis Boyer, Andreas Schmitz

In commit 58933c64(ucc_geth: Fix the wrong the Rx/Tx FIFO size),
the UCC_GETH_UTFTT_INIT is set to 512 based on the recommendation
of the QE Reference Manual.  But that will sometimes cause tx halt
while working in half duplex mode.

According to errata draft QE_GENERAL-A003(High Tx Virtual FIFO
threshold size can cause UCC to halt), setting UTFTT less than
[(UTFS x (M - 8)/M) - 128] will prevent this from happening
(M is the minimum buffer size).

The patch changes UTFTT back to 256.

Signed-off-by: Li Yang <leoli@freescale.com>
Cc: Jean-Denis Boyer <jdboyer@media5corp.com>
Cc: Andreas Schmitz <Andreas.Schmitz@riedel.net>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 drivers/net/ucc_geth.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h
index 05a9558..a78b9c0 100644
--- a/drivers/net/ucc_geth.h
+++ b/drivers/net/ucc_geth.h
@@ -899,7 +899,8 @@ struct ucc_geth_hardware_statistics {
 #define UCC_GETH_UTFS_INIT                      512	/* Tx virtual FIFO size
 							 */
 #define UCC_GETH_UTFET_INIT                     256	/* 1/2 utfs */
-#define UCC_GETH_UTFTT_INIT                     512
+#define UCC_GETH_UTFTT_INIT                     256	/* 1/2 utfs
+							   due to errata */
 /* Gigabit Ethernet (1000 Mbps) */
 #define UCC_GETH_URFS_GIGA_INIT                 4096/*2048*/	/* Rx virtual
 								   FIFO size */
-- 
1.6.6-rc1.GIT

^ permalink raw reply related

* [PATCH v3] ppc44x:PHY fixup for USB on canyonlands board
From: Rupjyoti Sarmah @ 2010-11-26 11:10 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel; +Cc: rsarmah

This fix is a reset for USB PHY that requires some amount of time for power to be stable on Canyonlands.

Signed-off-by: Rupjyoti Sarmah <rsarmah@apm.com>
---
changes from previous version:
- moved a Macro from header file to the source file
- corrected & updated comments 
- replaced the out_be32 calls by setbits32 calls
- bootup delay reduced, udelay is replaced by msleep

 arch/powerpc/boot/dts/canyonlands.dts      |   13 +++
 arch/powerpc/platforms/44x/44x.h           |    4 +
 arch/powerpc/platforms/44x/Makefile        |    1 +
 arch/powerpc/platforms/44x/canyonlands.c   |  120 ++++++++++++++++++++++++++++
 arch/powerpc/platforms/44x/ppc44x_simple.c |    1 -
 5 files changed, 138 insertions(+), 1 deletions(-)
 create mode 100644 arch/powerpc/platforms/44x/canyonlands.c

diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts
index a303703..a9f7538 100644
--- a/arch/powerpc/boot/dts/canyonlands.dts
+++ b/arch/powerpc/boot/dts/canyonlands.dts
@@ -224,6 +224,13 @@
 					};
 				};
 
+				cpld@2,0 {
+					#address-cells = <1>;
+					#size-cells = <1>;
+					compatible = "apm,ppc460ex-bcsr";
+					reg = <2 0x0 0x9>;
+				};
+
 				ndfc@3,0 {
 					compatible = "ibm,ndfc";
 					reg = <0x00000003 0x00000000 0x00002000>;
@@ -320,6 +327,12 @@
 				interrupts = <0x3 0x4>;
 			};
 
+			GPIO0: gpio@ef600b00 {
+				compatible = "ibm,ppc4xx-gpio";
+				reg = <0xef600b00 0x00000048>;
+				gpio-controller;
+			};
+
 			ZMII0: emac-zmii@ef600d00 {
 				compatible = "ibm,zmii-460ex", "ibm,zmii";
 				reg = <0xef600d00 0x0000000c>;
diff --git a/arch/powerpc/platforms/44x/44x.h b/arch/powerpc/platforms/44x/44x.h
index dbc4d2b..63f703e 100644
--- a/arch/powerpc/platforms/44x/44x.h
+++ b/arch/powerpc/platforms/44x/44x.h
@@ -4,4 +4,8 @@
 extern u8 as1_readb(volatile u8 __iomem  *addr);
 extern void as1_writeb(u8 data, volatile u8 __iomem *addr);
 
+#define GPIO0_OSRH	0xC
+#define GPIO0_TSRH	0x14
+#define GPIO0_ISR1H	0x34
+
 #endif /* __POWERPC_PLATFORMS_44X_44X_H */
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 82ff326..6854e73 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_WARP)	+= warp.o
 obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
 obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o
 obj-$(CONFIG_ISS4xx)	+= iss4xx.o
+obj-$(CONFIG_CANYONLANDS)+= canyonlands.o
diff --git a/arch/powerpc/platforms/44x/canyonlands.c b/arch/powerpc/platforms/44x/canyonlands.c
new file mode 100644
index 0000000..61e80ce
--- /dev/null
+++ b/arch/powerpc/platforms/44x/canyonlands.c
@@ -0,0 +1,120 @@
+/*
+ * This contain platform specific code for Canyonlands board based on
+ * APM ppc44x series of processors.
+ *
+ * Copyright (c) 2010, Applied Micro Circuits Corporation
+ * Author: Rupjyoti Sarmah <rsarmah@apm.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <asm/pci-bridge.h>
+#include <asm/ppc4xx.h>
+#include <asm/udbg.h>
+#include <asm/uic.h>
+#include <linux/of_platform.h>
+#include <linux/delay.h>
+#include "44x.h"
+
+#define BCSR_USB_EN	0x11
+
+static __initdata struct of_device_id ppc44x_of_bus[] = {
+	{ .compatible = "ibm,plb4", },
+	{ .compatible = "ibm,opb", },
+	{ .compatible = "ibm,ebc", },
+	{ .compatible = "simple-bus", },
+	{},
+};
+
+static int __init ppc44x_device_probe(void)
+{
+	of_platform_bus_probe(NULL, ppc44x_of_bus, NULL);
+
+	return 0;
+}
+machine_device_initcall(canyonlands, ppc44x_device_probe);
+
+/* Using this code only for the Canyonlands board.  */
+
+static int __init ppc44x_probe(void)
+{
+	unsigned long root = of_get_flat_dt_root();
+		if (of_flat_dt_is_compatible(root, "amcc,canyonlands")) {
+			ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);
+			return 1;
+		}
+	return 0;
+}
+
+/* USB PHY fixup code on Canyonlands kit. */
+
+static int __init ppc460ex_canyonlands_fixup(void)
+{
+	u8 __iomem *bcsr ;
+	void __iomem *vaddr;
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "apm,ppc460ex-bcsr");
+	if (!np) {
+		printk(KERN_ERR "failed did not find apm, ppc460ex bcsr node\n");
+		return -ENODEV;
+	}
+
+	bcsr = of_iomap(np, 0);
+	of_node_put(np);
+
+	if (!bcsr) {
+		printk(KERN_CRIT "Could not remap bcsr\n");
+		return -ENODEV;
+	}
+
+	np = of_find_compatible_node(NULL, NULL, "ibm,ppc4xx-gpio");
+	vaddr = of_iomap(np, 0);
+	if (!vaddr) {
+		printk(KERN_CRIT "Could not get gpio node address\n");
+		return -ENODEV;
+	}
+	/* Disable USB, through the BCSR7 bits */
+	setbits8(&bcsr[7], BCSR_USB_EN);
+
+	/* Wait for a while after reset */
+	msleep(100);
+
+	/* Enable USB here */
+	clrbits8(&bcsr[7], BCSR_USB_EN);
+
+	/*
+	 * Configure multiplexed gpio16 and gpio19 as alternate1 output
+	 * source after USB reset.This configuration is done through GPIO0_TSRH
+	 * and GPIO0_OSRH bits 0:1 and 6:7.
+	 */
+	setbits32((vaddr + GPIO0_OSRH), 0x42000000);
+	setbits32((vaddr + GPIO0_TSRH), 0x42000000);
+	of_node_put(np);
+	return 0;
+}
+machine_device_initcall(canyonlands, ppc460ex_canyonlands_fixup);
+define_machine(canyonlands) {
+	.name = "Canyonlands",
+	.probe = ppc44x_probe,
+	.progress = udbg_progress,
+	.init_IRQ = uic_init_tree,
+	.get_irq = uic_get_irq,
+	.restart = ppc4xx_reset_system,
+	.calibrate_decr = generic_calibrate_decr,
+};
diff --git a/arch/powerpc/platforms/44x/ppc44x_simple.c b/arch/powerpc/platforms/44x/ppc44x_simple.c
index 7ddcba3..c81c19c 100644
--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
@@ -53,7 +53,6 @@ static char *board[] __initdata = {
 	"amcc,arches",
 	"amcc,bamboo",
 	"amcc,bluestone",
-	"amcc,canyonlands",
 	"amcc,glacier",
 	"ibm,ebony",
 	"amcc,eiger",
-- 
1.5.6.3

^ permalink raw reply related

* Re: [PATCH v3] ppc44x:PHY fixup for USB on canyonlands board
From: Wolfgang Denk @ 2010-11-26 14:23 UTC (permalink / raw)
  To: Rupjyoti Sarmah; +Cc: linuxppc-dev, rsarmah, linux-kernel
In-Reply-To: <201011261110.oAQBANZL012455@amcc.com>

Dear Rupjyoti Sarmah,

In message <201011261110.oAQBANZL012455@amcc.com> you wrote:
>
> +				cpld@2,0 {
> +					#address-cells = <1>;
> +					#size-cells = <1>;
> +					compatible = "apm,ppc460ex-bcsr";

This results in a mix of "amcc," and "apm," strings.

Are there any plans to unify this?


> diff --git a/arch/powerpc/platforms/44x/canyonlands.c b/arch/powerpc/platforms/44x/canyonlands.c
> new file mode 100644
> index 0000000..61e80ce
> --- /dev/null
> +++ b/arch/powerpc/platforms/44x/canyonlands.c
> @@ -0,0 +1,120 @@
> +/*
> + * This contain platform specific code for Canyonlands board based on
> + * APM ppc44x series of processors.

Canyonlands is always PPC460EX, or does it ever come with other
processors as well?

> +static int __init ppc44x_probe(void)
> +{
> +	unsigned long root = of_get_flat_dt_root();
> +		if (of_flat_dt_is_compatible(root, "amcc,canyonlands")) {
> +			ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);
> +			return 1;
> +		}
> +	return 0;
> +}

Bad indentation.

> +	/* Disable USB, through the BCSR7 bits */
> +	setbits8(&bcsr[7], BCSR_USB_EN);
> +
> +	/* Wait for a while after reset */
> +	msleep(100);
> +
> +	/* Enable USB here */
> +	clrbits8(&bcsr[7], BCSR_USB_EN);
> +
> +	/*
> +	 * Configure multiplexed gpio16 and gpio19 as alternate1 output
> +	 * source after USB reset.This configuration is done through GPIO0_TSRH
> +	 * and GPIO0_OSRH bits 0:1 and 6:7.
> +	 */

Earlier versions of the patch included a delay after the clrbits8()
call as well. Is it intentional that you dropped this now?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Every program has at least one bug and can be shortened by  at  least
one instruction - from which, by induction, one can deduce that every
program can be reduced to one instruction which doesn't work.

^ permalink raw reply

* RE: [PATCH v3] ppc44x:PHY fixup for USB on canyonlands board
From: Rupjyoti Sarmah @ 2010-11-26 15:32 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20101126142342.E05A411D94F1@gemini.denx.de>

Hi Wolfgang,

>> This results in a mix of "amcc," and "apm," strings.
>> Are there any plans to unify this?
We can make all as apm, but right now I believe there is no plan to do so.

>>Earlier versions of the patch included a delay after the clrbits8()
>>call as well. Is it intentional that you dropped this now?
It is dropped intentionally.

Rest of your suggestions, I will modify and resubmit. Thanks.

Regards,
Rup

^ permalink raw reply

* RE: [PATCH v3] ppc44x:PHY fixup for USB on canyonlands board
From: Benjamin Herrenschmidt @ 2010-11-26 21:22 UTC (permalink / raw)
  To: Rupjyoti Sarmah; +Cc: linuxppc-dev, Wolfgang Denk, linux-kernel
In-Reply-To: <ade8814261339ab5028557ae3dc15c0b@mail.gmail.com>

On Fri, 2010-11-26 at 21:02 +0530, Rupjyoti Sarmah wrote:
> Hi Wolfgang,
> 
> >> This results in a mix of "amcc," and "apm," strings.
> >> Are there any plans to unify this?
> We can make all as apm, but right now I believe there is no plan to do so.
> 
> >>Earlier versions of the patch included a delay after the clrbits8()
> >>call as well. Is it intentional that you dropped this now?
> It is dropped intentionally.
> 
> Rest of your suggestions, I will modify and resubmit. Thanks.

I think this should remain consistent within the platform and stick to
"amcc".

Cheers,
Ben.

^ permalink raw reply

* PHY/FEC Network adapter failed to initialize on MPC52xx Board
From: Peter @ 2010-11-27 13:31 UTC (permalink / raw)
  To: linuxppc-dev

Hi all

I got completely stuck with a network adapter problem on my
ppc board (MPC52xx style). The ntwork adapter does not seem
to intialize correctly when booted without 'help from uboot'

The adapter works properly when I first use it with uboot. E.g.
using tftp to load the kernel or just issuing a dummy sntp
command. It does not get intialized if I boot linux without
using any network relevant command in ubboot

The difference manifests on the boot message: (working)
PHY working
...
mpc52xx MII bus: probed
TCP cubic registered
NET: Registered protocol family 17
IP-Config: Complete:
     device=eth0, addr=192.168.1.245, mask=255.254.0.0, gw=192.168.1.2,
     host=192.168.1.245, domain=, nis-domain=(none),
     bootserver=192.168.1.244, rootserver=192.168.1.244, rootpath=
Looking up port of RPC 100003/2 on 192.168.1.244
Looking up port of RPC 100005/1 on 192.168.1.244
VFS: Mounted root (nfs filesystem) on device 0:11.
Freeing unused kernel memory: 124k init
PHY: f0003000:00 - Link is Up - 100/Full

# ping 192.168.1.2  returns proper results.

PHY Not working:
...
mpc52xx MII bus: probed
TCP cubic registered
NET: Registered protocol family 17
IP-Config: Complete:
     device=eth0, addr=192.168.1.245, mask=255.254.0.0, gw=192.168.1.2,
     host=192.168.1.245, domain=, nis-domain=(none),
     bootserver=192.168.1.244, rootserver=192.168.1.244, rootpath=
VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
Freeing unused kernel memory: 124k init

# ping 192.168.1.2  hangs


The second snipped does not have "Looking up.." messages because it
boots from flash. Main difference is "PHY: f0003000:00 - Link is Up - 100/Full"
which does not appear at the failing case.

Linux Version is 2.6.35.7 patched with xenomai 2.5
U-Boot 2010.06 (Aug 05 2010 - 19:54:45)

Linux configuration see below: ( i left most entries out that are not set)
I also experimented with different settings but finally only
CONFIG_FEC_MPC52xx=y  and CONFIG_FEC_MPC52xx_MDIO=y
seem to be of any relevance. If both are set, the adapter works
when initialized by uboot.

Any help or tips will be very much appreciated,

Regards, Peter


Linux .config

...
#
# Platform support
#
# CONFIG_PPC_CHRP is not set
# CONFIG_MPC5121_ADS is not set
# CONFIG_MPC5121_GENERIC is not set
CONFIG_PPC_MPC52xx=y
CONFIG_PPC_MPC5200_SIMPLE=y
# CONFIG_PPC_EFIKA is not set
CONFIG_PPC_LITE5200=y
# CONFIG_PPC_MEDIA5200 is not set
CONFIG_PPC_MPC5200_BUGFIX=y
# CONFIG_PPC_MPC5200_GPIO is not set
CONFIG_PPC_MPC5200_LPBFIFO=y

CONFIG_PPC_BESTCOMM=y
CONFIG_PPC_BESTCOMM_FEC=y
CONFIG_PPC_BESTCOMM_GEN_BD=y
# CONFIG_SIMPLE_GPIO is not set
..
# Bus options
#
CONFIG_ZONE_DMA=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_PPC_PCI_CHOICE=y
...
#
# Generic Driver Options
#
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_MTD=y
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_CMDLINE_PARTS=y

#
# MII PHY device drivers
#
CONFIG_LXT_PHY=y                        ## Does not seem to have any influence
CONFIG_NET_ETHERNET=y
CONFIG_MII=y
CONFIG_ETHOC=y                           ## Does not seem to have any influence
CONFIG_FEC_MPC52xx=y              ## Must be Y in roder to get adapter working with uboot's init
CONFIG_FEC_MPC52xx_MDIO=y  ## Must be Y in roder to get adapter working with uboot's init

^ permalink raw reply

* ppc_set_hwdebug vs ptrace_set_debugreg
From: Andreas Schwab @ 2010-11-27 19:36 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Dave Kleikamp, K.Prasad

Why does ptrace_set_debugreg call register_user_hw_breakpoint, but
ppc_set_hwdebug doesn't?  Shouldn't ppc_set_hwdebug set the
DABR_DATA_(READ|WRITE|TRANSLATION) bits in the dabr?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* [PATCH] powerpc: fix PPC_PTRACE_SETHWDEBUG on PPC_BOOK3S
From: Andreas Schwab @ 2010-11-28  0:24 UTC (permalink / raw)
  To: linuxppc-dev

Properly set the DABR_TRANSLATION/DABR_DATA_READ/DABR_DATA_READ bits in
the dabr when setting the debug register via PPC_PTRACE_SETHWDEBUG.  Also
don't reject trigger type of PPC_BREAKPOINT_TRIGGER_READ.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
---
 arch/powerpc/kernel/ptrace.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index a9b3296..9065369 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -1316,6 +1316,10 @@ static int set_dac_range(struct task_struct *child,
 static long ppc_set_hwdebug(struct task_struct *child,
 		     struct ppc_hw_breakpoint *bp_info)
 {
+#ifndef CONFIG_PPC_ADV_DEBUG_REGS
+	unsigned long dabr;
+#endif
+
 	if (bp_info->version != 1)
 		return -ENOTSUPP;
 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
@@ -1353,11 +1357,10 @@ static long ppc_set_hwdebug(struct task_struct *child,
 	/*
 	 * We only support one data breakpoint
 	 */
-	if (((bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_RW) == 0) ||
-	    ((bp_info->trigger_type & ~PPC_BREAKPOINT_TRIGGER_RW) != 0) ||
-	    (bp_info->trigger_type != PPC_BREAKPOINT_TRIGGER_WRITE) ||
-	    (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) ||
-	    (bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE))
+	if ((bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_RW) == 0 ||
+	    (bp_info->trigger_type & ~PPC_BREAKPOINT_TRIGGER_RW) != 0 ||
+	    bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT ||
+	    bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE)
 		return -EINVAL;
 
 	if (child->thread.dabr)
@@ -1366,7 +1369,14 @@ static long ppc_set_hwdebug(struct task_struct *child,
 	if ((unsigned long)bp_info->addr >= TASK_SIZE)
 		return -EIO;
 
-	child->thread.dabr = (unsigned long)bp_info->addr;
+	dabr = (unsigned long)bp_info->addr & ~7UL;
+	dabr |= DABR_TRANSLATION;
+	if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ)
+		dabr |= DABR_DATA_READ;
+	if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE)
+		dabr |= DABR_DATA_WRITE;
+
+	child->thread.dabr = dabr;
 
 	return 1;
 #endif /* !CONFIG_PPC_ADV_DEBUG_DVCS */
-- 
1.7.3.2


-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply related

* Re: PHY/FEC Network adapter failed to initialize on MPC52xx Board
From: Gary Thomas @ 2010-11-28 11:55 UTC (permalink / raw)
  To: Peter; +Cc: linuxppc-dev
In-Reply-To: <4CF10819.4050007@crane-soft.de>

On 11/27/2010 06:31 AM, Peter wrote:
> Hi all
>
> I got completely stuck with a network adapter problem on my
> ppc board (MPC52xx style). The ntwork adapter does not seem
> to intialize correctly when booted without 'help from uboot'
>
> The adapter works properly when I first use it with uboot. E.g.
> using tftp to load the kernel or just issuing a dummy sntp
> command. It does not get intialized if I boot linux without
> using any network relevant command in ubboot
>
> The difference manifests on the boot message: (working)
> PHY working
> ...
> mpc52xx MII bus: probed
> TCP cubic registered
> NET: Registered protocol family 17
> IP-Config: Complete:
>       device=eth0, addr=192.168.1.245, mask=255.254.0.0, gw=192.168.1.2,
>       host=192.168.1.245, domain=, nis-domain=(none),
>       bootserver=192.168.1.244, rootserver=192.168.1.244, rootpath=
> Looking up port of RPC 100003/2 on 192.168.1.244
> Looking up port of RPC 100005/1 on 192.168.1.244
> VFS: Mounted root (nfs filesystem) on device 0:11.
> Freeing unused kernel memory: 124k init
> PHY: f0003000:00 - Link is Up - 100/Full
>
> # ping 192.168.1.2  returns proper results.
>
> PHY Not working:
> ...
> mpc52xx MII bus: probed
> TCP cubic registered
> NET: Registered protocol family 17
> IP-Config: Complete:
>       device=eth0, addr=192.168.1.245, mask=255.254.0.0, gw=192.168.1.2,
>       host=192.168.1.245, domain=, nis-domain=(none),
>       bootserver=192.168.1.244, rootserver=192.168.1.244, rootpath=
> VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
> Freeing unused kernel memory: 124k init
>
> # ping 192.168.1.2  hangs
>
>
> The second snipped does not have "Looking up.." messages because it
> boots from flash. Main difference is "PHY: f0003000:00 - Link is Up - 100/Full"
> which does not appear at the failing case.
>
> Linux Version is 2.6.35.7 patched with xenomai 2.5
> U-Boot 2010.06 (Aug 05 2010 - 19:54:45)
>
> Linux configuration see below: ( i left most entries out that are not set)
> I also experimented with different settings but finally only
> CONFIG_FEC_MPC52xx=y  and CONFIG_FEC_MPC52xx_MDIO=y
> seem to be of any relevance. If both are set, the adapter works
> when initialized by uboot.
>
> Any help or tips will be very much appreciated,

There are a couple of possibilities:

* Many PHY devices will have an external RESET or enable pin which is
   driven by GPIO.  The board support package in U-Boot for your board
   would then enable the PHY device as part of network initialization.
   The Linux kernel typically does not fiddle with such things.

* The actual PHY device may need some setup (adjustment of internal
   PHY registers) before it will come on-line, e.g. the device may not
   be strapped to auto-negotiate on the wire to find a link.  U-Boot
   might be turning this on, or even forcing the link up (I've seen
   such devices that needed this level of hand-holding).  Again, the
   Linux network driver typically will not be doing these sort of
   operations.

To figure out what's going on and what else you might need, you should
look at both the U-Boot code for your board and the board documentation
(schematics, etc).  Then you should be able to see what U-Boot does that
the Linux kernel is not.  In the end, you may need to add some code in
your target platform support in Linux to add the additional stuff to make
the PHY work.

> Linux .config
>
> ...
> #
> # Platform support
> #
> # CONFIG_PPC_CHRP is not set
> # CONFIG_MPC5121_ADS is not set
> # CONFIG_MPC5121_GENERIC is not set
> CONFIG_PPC_MPC52xx=y
> CONFIG_PPC_MPC5200_SIMPLE=y
> # CONFIG_PPC_EFIKA is not set
> CONFIG_PPC_LITE5200=y
> # CONFIG_PPC_MEDIA5200 is not set
> CONFIG_PPC_MPC5200_BUGFIX=y
> # CONFIG_PPC_MPC5200_GPIO is not set
> CONFIG_PPC_MPC5200_LPBFIFO=y
>
> CONFIG_PPC_BESTCOMM=y
> CONFIG_PPC_BESTCOMM_FEC=y
> CONFIG_PPC_BESTCOMM_GEN_BD=y
> # CONFIG_SIMPLE_GPIO is not set
> ..
> # Bus options
> #
> CONFIG_ZONE_DMA=y
> CONFIG_NEED_SG_DMA_LENGTH=y
> CONFIG_GENERIC_ISA_DMA=y
> CONFIG_PPC_PCI_CHOICE=y
> ...
> #
> # Generic Driver Options
> #
> CONFIG_STANDALONE=y
> CONFIG_PREVENT_FIRMWARE_BUILD=y
> CONFIG_MTD=y
> CONFIG_MTD_PARTITIONS=y
> CONFIG_MTD_CMDLINE_PARTS=y
>
> #
> # MII PHY device drivers
> #
> CONFIG_LXT_PHY=y                        ## Does not seem to have any influence
> CONFIG_NET_ETHERNET=y
> CONFIG_MII=y
> CONFIG_ETHOC=y                           ## Does not seem to have any influence
> CONFIG_FEC_MPC52xx=y              ## Must be Y in roder to get adapter working with uboot's init
> CONFIG_FEC_MPC52xx_MDIO=y  ## Must be Y in roder to get adapter working with uboot's init
>
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

^ permalink raw reply

* [PATCH] powerpc: update compat_arch_ptrace
From: Andreas Schwab @ 2010-11-28 16:33 UTC (permalink / raw)
  To: linuxppc-dev

Update compat_arch_ptrace to follow recent changes in
PTRACE_GET_DEBUGREG and the addition of
PPC_PTRACE_{GETHWDBGINFO|{SET|DEL}HWDEBUG}.  The latter three can be
forwarded to arch_ptrace unchanged.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
---
 arch/powerpc/kernel/ptrace32.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
index 8a6daf4..69c4be9 100644
--- a/arch/powerpc/kernel/ptrace32.c
+++ b/arch/powerpc/kernel/ptrace32.c
@@ -280,7 +280,11 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
 		/* We only support one DABR and no IABRS at the moment */
 		if (addr > 0)
 			break;
+#ifdef CONFIG_PPC_ADV_DEBUG_REGS
+		ret = put_user(child->thread.dac1, (u32 __user *)data);
+#else
 		ret = put_user(child->thread.dabr, (u32 __user *)data);
+#endif
 		break;
 	}
 
@@ -312,6 +316,9 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
 	case PTRACE_SET_DEBUGREG:
 	case PTRACE_SYSCALL:
 	case PTRACE_CONT:
+	case PPC_PTRACE_GETHWDBGINFO:
+	case PPC_PTRACE_SETHWDEBUG:
+	case PPC_PTRACE_DELHWDEBUG:
 		ret = arch_ptrace(child, request, addr, data);
 		break;
 
-- 
1.7.3.2


-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply related

* Re: [PATCH] ucc_geth: fix ucc halt problem in half duplex mode
From: David Miller @ 2010-11-29  2:37 UTC (permalink / raw)
  To: leoli; +Cc: netdev, Andreas.Schmitz, avorontsov, linuxppc-dev, jdboyer
In-Reply-To: <1290763798-22844-1-git-send-email-leoli@freescale.com>

From: Li Yang <leoli@freescale.com>
Date: Fri, 26 Nov 2010 17:29:58 +0800

> In commit 58933c64(ucc_geth: Fix the wrong the Rx/Tx FIFO size),
> the UCC_GETH_UTFTT_INIT is set to 512 based on the recommendation
> of the QE Reference Manual.  But that will sometimes cause tx halt
> while working in half duplex mode.
> 
> According to errata draft QE_GENERAL-A003(High Tx Virtual FIFO
> threshold size can cause UCC to halt), setting UTFTT less than
> [(UTFS x (M - 8)/M) - 128] will prevent this from happening
> (M is the minimum buffer size).
> 
> The patch changes UTFTT back to 256.
> 
> Signed-off-by: Li Yang <leoli@freescale.com>
> Cc: Jean-Denis Boyer <jdboyer@media5corp.com>
> Cc: Andreas Schmitz <Andreas.Schmitz@riedel.net>
> Cc: Anton Vorontsov <avorontsov@ru.mvista.com>

Applied, thank you.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox