LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] DT: add MDIO node for FMan node
From: Shaohui Xie @ 2014-11-13  8:27 UTC (permalink / raw)
  To: Scott Wood
  Cc: Igal.Liberman@freescale.com, linuxppc-dev@lists.ozlabs.org,
	Emilian Medve, devicetree@vger.kernel.org
In-Reply-To: <1415865867.15957.58.camel@freescale.com>

DQoNCkJlc3QgUmVnYXJkcywgDQpTaGFvaHVpIFhpZQ0KDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNz
YWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290dC1CMDc0MjENCj4gU2VudDogVGh1cnNkYXksIE5v
dmVtYmVyIDEzLCAyMDE0IDQ6MDQgUE0NCj4gVG86IFhpZSBTaGFvaHVpLUIyMTk4OQ0KPiBDYzog
TGliZXJtYW4gSWdhbC1CMzE5NTA7IGxpbnV4cHBjLWRldkBsaXN0cy5vemxhYnMub3JnOw0KPiBk
ZXZpY2V0cmVlQHZnZXIua2VybmVsLm9yZzsgTWVkdmUgRW1pbGlhbi1FTU1FRFZFMQ0KPiBTdWJq
ZWN0OiBSZTogW1BBVENIXSBEVDogYWRkIE1ESU8gbm9kZSBmb3IgRk1hbiBub2RlDQo+IA0KPiBP
biBUaHUsIDIwMTQtMTEtMTMgYXQgMDI6MDIgLTA2MDAsIFhpZSBTaGFvaHVpLUIyMTk4OSB3cm90
ZToNCj4gPg0KPiA+DQo+ID4gQmVzdCBSZWdhcmRzLA0KPiA+IFNoYW9odWkgWGllDQo+ID4NCj4g
Pg0KPiA+ID4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gPiA+IEZyb206IFdvb2QgU2Nv
dHQtQjA3NDIxDQo+ID4gPiBTZW50OiBUaHVyc2RheSwgTm92ZW1iZXIgMTMsIDIwMTQgMzoxNSBQ
TQ0KPiA+ID4gVG86IFhpZSBTaGFvaHVpLUIyMTk4OQ0KPiA+ID4gQ2M6IExpYmVybWFuIElnYWwt
QjMxOTUwOyBsaW51eHBwYy1kZXZAbGlzdHMub3psYWJzLm9yZzsNCj4gPiA+IGRldmljZXRyZWVA
dmdlci5rZXJuZWwub3JnOyBNZWR2ZSBFbWlsaWFuLUVNTUVEVkUxDQo+ID4gPiBTdWJqZWN0OiBS
ZTogW1BBVENIXSBEVDogYWRkIE1ESU8gbm9kZSBmb3IgRk1hbiBub2RlDQo+ID4gPg0KPiA+ID4g
T24gVGh1LCAyMDE0LTExLTEzIGF0IDAxOjExIC0wNjAwLCBYaWUgU2hhb2h1aS1CMjE5ODkgd3Jv
dGU6DQo+ID4gPiA+ID4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gPiA+ID4gPiBGcm9t
OiBXb29kIFNjb3R0LUIwNzQyMQ0KPiA+ID4gPiA+IFNlbnQ6IFRodXJzZGF5LCBOb3ZlbWJlciAx
MywgMjAxNCAyOjE3IFBNDQo+ID4gPiA+ID4gVG86IFhpZSBTaGFvaHVpLUIyMTk4OQ0KPiA+ID4g
PiA+IENjOiBMaWJlcm1hbiBJZ2FsLUIzMTk1MDsgbGludXhwcGMtZGV2QGxpc3RzLm96bGFicy5v
cmc7DQo+ID4gPiA+ID4gZGV2aWNldHJlZUB2Z2VyLmtlcm5lbC5vcmc7IE1lZHZlIEVtaWxpYW4t
RU1NRURWRTENCj4gPiA+ID4gPiBTdWJqZWN0OiBSZTogW1BBVENIXSBEVDogYWRkIE1ESU8gbm9k
ZSBmb3IgRk1hbiBub2RlDQo+ID4gPiA+ID4NCj4gPiA+ID4gPiBPbiBXZWQsIDIwMTQtMTEtMTIg
YXQgMDc6NDAgLTA2MDAsIFhpZSBTaGFvaHVpLUIyMTk4OSB3cm90ZToNCj4gPiA+ID4gPiA+ID4g
LS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gPiA+ID4gPiA+ID4gRnJvbTogV29vZCBTY290
dC1CMDc0MjENCj4gPiA+ID4gPiA+ID4gU2VudDogV2VkbmVzZGF5LCBOb3ZlbWJlciAxMiwgMjAx
NCAxOjM4IEFNDQo+ID4gPiA+ID4gPiA+IFRvOiBYaWUgU2hhb2h1aS1CMjE5ODkNCj4gPiA+ID4g
PiA+ID4gQ2M6IExpYmVybWFuIElnYWwtQjMxOTUwOyBsaW51eHBwYy1kZXZAbGlzdHMub3psYWJz
Lm9yZzsNCj4gPiA+ID4gPiA+ID4gZGV2aWNldHJlZUB2Z2VyLmtlcm5lbC5vcmc7IE1lZHZlIEVt
aWxpYW4tRU1NRURWRTENCj4gPiA+ID4gPiA+ID4gU3ViamVjdDogUmU6IFtQQVRDSF0gRFQ6IGFk
ZCBNRElPIG5vZGUgZm9yIEZNYW4gbm9kZQ0KPiA+ID4gPiA+ID4gPg0KPiA+ID4gPiA+ID4gPiBP
biBUdWUsIDIwMTQtMTEtMTEgYXQgMDQ6MzIgLTA2MDAsIFhpZSBTaGFvaHVpLUIyMTk4OSB3cm90
ZToNCj4gPiA+ID4gPiA+ID4gPiA+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+ID4gPiA+
ID4gPiA+ID4gPiBGcm9tOiBXb29kIFNjb3R0LUIwNzQyMQ0KPiA+ID4gPiA+ID4gPiA+ID4gU2Vu
dDogVHVlc2RheSwgTm92ZW1iZXIgMTEsIDIwMTQgODoyMyBBTQ0KPiA+ID4gPiA+ID4gPiA+ID4g
VG86IHNoaC54aWVAZ21haWwuY29tDQo+ID4gPiA+ID4gPiA+ID4gPiBDYzogbGludXhwcGMtZGV2
QGxpc3RzLm96bGFicy5vcmc7DQo+ID4gPiA+ID4gPiA+ID4gPiBkZXZpY2V0cmVlQHZnZXIua2Vy
bmVsLm9yZzsgTWVkdmUgRW1pbGlhbi1FTU1FRFZFMTsgWGllDQo+ID4gPiA+ID4gPiA+ID4gPiBT
aGFvaHVpLUIyMTk4OQ0KPiA+ID4gPiA+ID4gPiA+ID4gU3ViamVjdDogUmU6IFtQQVRDSF0gRFQ6
IGFkZCBNRElPIG5vZGUgZm9yIEZNYW4gbm9kZQ0KPiA+ID4gPiA+ID4gPiA+ID4NCj4gPiA+ID4g
PiA+ID4gPiA+IE9uIFR1ZSwgMjAxNC0xMS0wNCBhdCAxOTo1NiArMDgwMCwgc2hoLnhpZUBnbWFp
bC5jb20NCj4gd3JvdGU6DQo+ID4gPiA+ID4gPiA+ID4gPiA+IEZyb206IFNoYW9odWkgWGllIDxT
aGFvaHVpLlhpZUBmcmVlc2NhbGUuY29tPg0KPiA+ID4gPiA+ID4gPiA+ID4gPg0KPiA+ID4gPiA+
ID4gPiA+ID4gPiBUaGlzIGJpbmRpbmcgaXMgZm9yIEZNYW4gTURJTywgaXQgY292ZXJzIEZNYW4g
djIgJiBGTWFuDQo+IHYzLg0KPiA+ID4gPiA+ID4gPiA+ID4gPg0KPiA+ID4gPiA+ID4gPiA+ID4g
PiBTaWduZWQtb2ZmLWJ5OiBTaGFvaHVpIFhpZSA8U2hhb2h1aS5YaWVAZnJlZXNjYWxlLmNvbT4N
Cj4gPiA+ID4gPiA+ID4gPiA+ID4gLS0tDQo+ID4gPiA+ID4gPiA+ID4gPiA+IGJhc2VkIG9uIGh0
dHA6Ly9wYXRjaHdvcmsub3psYWJzLm9yZy9wYXRjaC8zOTAzNTEvDQo+ID4gPiA+ID4gPiA+ID4g
PiA+IGZvciAnbmV4dCcgb2YNCj4gPiA+ID4gPiA+ID4gPiA+ID4NCj4gPiA+IGdpdDovL2dpdC5r
ZXJuZWwub3JnL3B1Yi9zY20vbGludXgva2VybmVsL2dpdC9zY290dHdvb2QvbGludXguDQo+ID4g
PiA+ID4gPiA+ID4gPiA+IGdpdA0KPiA+ID4gPiA+ID4gPiA+ID4NCj4gPiA+ID4gPiA+ID4gPiA+
IEFyZSB0aGVyZSBhbnkgb3RoZXIgRk1hbiBwaWVjZXMgdGhhdCBhcmUgbWlzc2luZyBmcm9tDQo+
ID4gPiA+ID4gPiA+ID4gPiB0aGUgYWJvdmUNCj4gPiA+ID4gPiBwYXRjaD8NCj4gPiA+ID4gPiA+
ID4gPiBbUy5IXSBJJ20gYWRkaW5nIElnYWwgZm9yIHRoaXMgY29tbWVudC4NCj4gPiA+ID4gPiA+
ID4gPg0KPiA+ID4gPiA+ID4gPiA+ID4NCj4gPiA+ID4gPiA+ID4gPiA+ID4gKy0gYnVzLWZyZXF1
ZW5jeQ0KPiA+ID4gPiA+ID4gPiA+ID4gPiArCQlVc2FnZTogb3B0aW9uYWwNCj4gPiA+ID4gPiA+
ID4gPiA+ID4gKwkJVmFsdWUgdHlwZTogPHUzMj4NCj4gPiA+ID4gPiA+ID4gPiA+ID4gKwkJRGVm
aW5pdGlvbjogRGVmYXVsdCBNRElPIGJ1cyBjbG9jayBzcGVlZC4NCj4gPiA+ID4gPiA+ID4gPiA+
DQo+ID4gPiA+ID4gPiA+ID4gPiBVc2UgY2xvY2tzL2Nsb2NrLW5hbWVzDQo+ID4gPiA+ID4gPiA+
ID4gW1MuSF0gVGhlIE1ESU8gdXNlcyBGbWFuIGNsb2NrIGFuZCBkaXZpZGVzIGl0IHRvIGEgcHJv
cGVyDQo+ID4gPiA+ID4gPiA+ID4gdmFsdWUgd2hpY2gNCj4gPiA+ID4gPiA+ID4gaXMgc3BlY2lm
aWVkIGJ5IHRoaXMgcHJvcGVydHkuDQo+ID4gPiA+ID4gPiA+DQo+ID4gPiA+ID4gPiA+IFVzZSBj
bG9ja3MvY2xvY2stbmFtZXMgdG8gZGVzY3JpYmUgdGhhdCByZWxhdGlvbnNoaXAuDQo+ID4gPiA+
ID4gPiA+DQo+ID4gPiA+ID4gPg0KPiA+ID4gPiA+ID4gW1MuSF0gVGhlIE1ESU8gbm9kZSBpcyBz
dWItbm9kZSBhbmQgZW1iZWRkZWQgaW4gRm1hbiBub2RlLCB0aGUNCj4gPiA+ID4gPiA+IGNsb2Nr
cy9jbG9jay1uYW1lcyBpcyBwcm92aWRlZCBieSBGbWFuIG5vZGUsIHNob3VsZCByZXBlYXQNCj4g
PiA+ID4gPiA+IHRoZW0gaW4gTURJTyBub2RlPyBGb3IgdGhlIGRlZmF1bHQgTURJTyBidXMgY2xv
Y2sgc3BlZWQsIG1heWJlDQo+ID4gPiA+ID4gPiAiY2xvY2stDQo+ID4gPiByYW5nZXMiDQo+ID4g
PiA+ID4gPiBzaG91bGQgYmUgdXNlZD8NCj4gPiA+ID4gPg0KPiA+ID4gPiA+IEl0J3MgYSBkaWZm
ZXJlbnQgY2xvY2suICBZb3Ugd291bGRuJ3QgYmUgcmVwZWF0aW5nLiAgSWYgaXQncw0KPiA+ID4g
PiA+IGRlcml2ZWQgZnJvbSB0aGUgRk1hbiBjbG9jaywgdGhlbiBtYXliZSB5b3UgZG9uJ3QgbmVl
ZCBhbnl0aGluZw0KPiA+ID4gPiA+IGhlcmUgKGRvZXMgdGhlIGRyaXZlciBrbm93IHdoYXQgdGhl
IGRpdmlkZXIgaXMsIG9yIHdvdWxkIHRoYXQNCj4gPiA+ID4gPiBuZWVkIHRvIGJlIHNwZWNpZmll
ZCBpbiB0aGUgZGV2aWNlIHRyZWU/KSwgYnV0IG5vIG1vcmUNCj4gPiA+ID4gPiBjbG9jay1mcmVx
dWVuY3kvYnVzLQ0KPiA+ID4gZnJlcXVlbmN5IHByb3BlcnRpZXMuDQo+ID4gPiA+ID4NCj4gPiA+
ID4gW1MuSF0gVGhlIHB1cnBvc2UgaGVyZSBpcyB0byBnZXQgYSBzcGVjaWZpYyBjbG9jayBmcmVx
dWVuY3ksDQo+ID4gPiA+IGRyaXZlciB0bw0KPiA+ID4gdXNlIGl0IHRvIGNhbGN1bGF0ZSB0aGUg
ZGl2aWRlci4NCj4gPiA+ID4gVGhlbiB0aGUgRm1hbiBjbG9jayBjYW4gYmUgZGl2aWRlZCB0byB0
aGUgZnJlcXVlbmN5Lg0KPiA+ID4NCj4gPiA+IE9oLCBzbyB0aGlzIGlzIHN0YXRpbmcgYSBkZXNp
cmVkIGZyZXF1ZW5jeSBhbmQgbm90IHNvbWV0aGluZyB0aGF0DQo+ID4gPiBhbHJlYWR5IGV4aXN0
cz8gIFdoYXQgZGV0ZXJtaW5lcyB0aGlzIGZyZXF1ZW5jeT8gIElzIGl0IGJhc2VkIG9uDQo+ID4g
PiBib2FyZCBkZXNpZ24sIG9yIGp1c3Qgb24gdGhlIE1ESU8gc3RhbmRhcmQsIGV0Yz8gIEknbSB3
b25kZXJpbmcgaWYNCj4gPiA+IHRoZSBkZXZpY2UgdHJlZSBpcyB0aGUgcmlnaHQgcGxhY2UgZm9y
IGl0Lg0KPiA+IFtTLkhdIFllcywgYSBkZXNpcmVkIGZyZXF1ZW5jeSB3aGljaCBpcyBkaWZmZXJl
bnQgd2l0aCBNRElPIHN0YW5kYXJkLg0KPiANCj4gSSdtIG5vdCBzdXJlIHdoYXQgeW91IG1lYW4g
YnkgImRpZmZlcmVudCB3aXRoIi4gIERvIHlvdSBtZWFuICJkaWZmZXJlbnQNCj4gZnJvbSI/ICBX
aGF0IGRvZXMgdGhlIHN0YW5kYXJkIHNheSBhYm91dCBmcmVxdWVuY3k/DQpbUy5IXSBUaGUgc3Rh
bmRhcmQgTURJTyBmcmVxdWVuY3kgaXMgMi41TUh6LiAgQnV0IGEgZGlmZmVyZW50IG9uZSBpcyBk
ZXNpcmVkLg0KDQo+IA0KPiA+IFRoZSBGbWFuIGNsb2NrIGFuZCB0aGUgZGl2aWRlciBkZXRlcm1p
bmVzIHRoaXMgZnJlcXVlbmN5Lg0KPiA+IFNpbmNlIEZtYW4gY2xvY2sgaXMgZGlmZmVyZW50IG9u
IGRpZmZlcmVudCBTb0NzLCBzbyBzcGVjaWZ5IHRoZQ0KPiA+IGRlc2lyZWQgZnJlcXVlbmN5LCB0
aGVuIHRvIGdldCB0aGUgcHJvcGVyIGRpdmlkZXIuDQo+IA0KPiBXaHkgZG9lcyB0aGUgZm1hbiBj
bG9jayBiZWluZyBkaWZmZXJlbnQgbWVhbiB0aGUgbWRpbyBjbG9jayBzaG91bGQgYmUNCj4gZGlm
ZmVyZW50Pw0KW1MuSF0gVGhlIG1kaW8gY2xvY2sgc2hvdWxkIGJlIHNhbWUsIGEgZGlmZmVyZW50
IGRpdmlkZXIgc2hvdWxkIGJlIHVzZWQgDQp0byBtYXRjaCB0aGUgRm1hbiBjbG9jayB0byBtYWtl
IHN1cmUgdGhlIG1kaW8gY2xvY2sga2VwdCBzYW1lLiBTbyB0byBzcGVjaWZ5DQpUaGUgZGVzaXJl
ZCBtZGlvIGZyZXF1ZW5jeSwgdGhlbiB0byBnZXQgcHJvcGVyIGRpdmlkZXIuDQoNClRoYW5rcy4N
ClNoYW9odWkNCg==

^ permalink raw reply

* Re: [PATCH] DT: add MDIO node for FMan node
From: Scott Wood @ 2014-11-13  8:29 UTC (permalink / raw)
  To: Xie Shaohui-B21989
  Cc: Liberman Igal-B31950, linuxppc-dev@lists.ozlabs.org,
	Medve Emilian-EMMEDVE1, devicetree@vger.kernel.org
In-Reply-To: <b7e76a785be4439bb1f69dc611703e1d@DM2PR0301MB0864.namprd03.prod.outlook.com>

On Thu, 2014-11-13 at 02:27 -0600, Xie Shaohui-B21989 wrote:
> 
> 
> Best Regards, 
> Shaohui Xie
> 
> 
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Thursday, November 13, 2014 4:04 PM
> > To: Xie Shaohui-B21989
> > Cc: Liberman Igal-B31950; linuxppc-dev@lists.ozlabs.org;
> > devicetree@vger.kernel.org; Medve Emilian-EMMEDVE1
> > Subject: Re: [PATCH] DT: add MDIO node for FMan node
> > 
> > On Thu, 2014-11-13 at 02:02 -0600, Xie Shaohui-B21989 wrote:
> > >
> > >
> > > Best Regards,
> > > Shaohui Xie
> > >
> > >
> > > > -----Original Message-----
> > > > From: Wood Scott-B07421
> > > > Sent: Thursday, November 13, 2014 3:15 PM
> > > > To: Xie Shaohui-B21989
> > > > Cc: Liberman Igal-B31950; linuxppc-dev@lists.ozlabs.org;
> > > > devicetree@vger.kernel.org; Medve Emilian-EMMEDVE1
> > > > Subject: Re: [PATCH] DT: add MDIO node for FMan node
> > > >
> > > > On Thu, 2014-11-13 at 01:11 -0600, Xie Shaohui-B21989 wrote:
> > > > > > -----Original Message-----
> > > > > > From: Wood Scott-B07421
> > > > > > Sent: Thursday, November 13, 2014 2:17 PM
> > > > > > To: Xie Shaohui-B21989
> > > > > > Cc: Liberman Igal-B31950; linuxppc-dev@lists.ozlabs.org;
> > > > > > devicetree@vger.kernel.org; Medve Emilian-EMMEDVE1
> > > > > > Subject: Re: [PATCH] DT: add MDIO node for FMan node
> > > > > >
> > > > > > On Wed, 2014-11-12 at 07:40 -0600, Xie Shaohui-B21989 wrote:
> > > > > > > > -----Original Message-----
> > > > > > > > From: Wood Scott-B07421
> > > > > > > > Sent: Wednesday, November 12, 2014 1:38 AM
> > > > > > > > To: Xie Shaohui-B21989
> > > > > > > > Cc: Liberman Igal-B31950; linuxppc-dev@lists.ozlabs.org;
> > > > > > > > devicetree@vger.kernel.org; Medve Emilian-EMMEDVE1
> > > > > > > > Subject: Re: [PATCH] DT: add MDIO node for FMan node
> > > > > > > >
> > > > > > > > On Tue, 2014-11-11 at 04:32 -0600, Xie Shaohui-B21989 wrote:
> > > > > > > > > > -----Original Message-----
> > > > > > > > > > From: Wood Scott-B07421
> > > > > > > > > > Sent: Tuesday, November 11, 2014 8:23 AM
> > > > > > > > > > To: shh.xie@gmail.com
> > > > > > > > > > Cc: linuxppc-dev@lists.ozlabs.org;
> > > > > > > > > > devicetree@vger.kernel.org; Medve Emilian-EMMEDVE1; Xie
> > > > > > > > > > Shaohui-B21989
> > > > > > > > > > Subject: Re: [PATCH] DT: add MDIO node for FMan node
> > > > > > > > > >
> > > > > > > > > > On Tue, 2014-11-04 at 19:56 +0800, shh.xie@gmail.com
> > wrote:
> > > > > > > > > > > From: Shaohui Xie <Shaohui.Xie@freescale.com>
> > > > > > > > > > >
> > > > > > > > > > > This binding is for FMan MDIO, it covers FMan v2 & FMan
> > v3.
> > > > > > > > > > >
> > > > > > > > > > > Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> > > > > > > > > > > ---
> > > > > > > > > > > based on http://patchwork.ozlabs.org/patch/390351/
> > > > > > > > > > > for 'next' of
> > > > > > > > > > >
> > > > git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.
> > > > > > > > > > > git
> > > > > > > > > >
> > > > > > > > > > Are there any other FMan pieces that are missing from
> > > > > > > > > > the above
> > > > > > patch?
> > > > > > > > > [S.H] I'm adding Igal for this comment.
> > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > +- bus-frequency
> > > > > > > > > > > +		Usage: optional
> > > > > > > > > > > +		Value type: <u32>
> > > > > > > > > > > +		Definition: Default MDIO bus clock speed.
> > > > > > > > > >
> > > > > > > > > > Use clocks/clock-names
> > > > > > > > > [S.H] The MDIO uses Fman clock and divides it to a proper
> > > > > > > > > value which
> > > > > > > > is specified by this property.
> > > > > > > >
> > > > > > > > Use clocks/clock-names to describe that relationship.
> > > > > > > >
> > > > > > >
> > > > > > > [S.H] The MDIO node is sub-node and embedded in Fman node, the
> > > > > > > clocks/clock-names is provided by Fman node, should repeat
> > > > > > > them in MDIO node? For the default MDIO bus clock speed, maybe
> > > > > > > "clock-
> > > > ranges"
> > > > > > > should be used?
> > > > > >
> > > > > > It's a different clock.  You wouldn't be repeating.  If it's
> > > > > > derived from the FMan clock, then maybe you don't need anything
> > > > > > here (does the driver know what the divider is, or would that
> > > > > > need to be specified in the device tree?), but no more
> > > > > > clock-frequency/bus-
> > > > frequency properties.
> > > > > >
> > > > > [S.H] The purpose here is to get a specific clock frequency,
> > > > > driver to
> > > > use it to calculate the divider.
> > > > > Then the Fman clock can be divided to the frequency.
> > > >
> > > > Oh, so this is stating a desired frequency and not something that
> > > > already exists?  What determines this frequency?  Is it based on
> > > > board design, or just on the MDIO standard, etc?  I'm wondering if
> > > > the device tree is the right place for it.
> > > [S.H] Yes, a desired frequency which is different with MDIO standard.
> > 
> > I'm not sure what you mean by "different with".  Do you mean "different
> > from"?  What does the standard say about frequency?
> [S.H] The standard MDIO frequency is 2.5MHz.  But a different one is desired.

Why is a different frequency desired?

> > 
> > > The Fman clock and the divider determines this frequency.
> > > Since Fman clock is different on different SoCs, so specify the
> > > desired frequency, then to get the proper divider.
> > 
> > Why does the fman clock being different mean the mdio clock should be
> > different?
> [S.H] The mdio clock should be same, a different divider should be used 
> to match the Fman clock to make sure the mdio clock kept same. So to specify
> The desired mdio frequency, then to get proper divider.

What I'm trying to determine is why the MDIO frequency wouldn't always
be the same, and thus could be hardcoded in the driver rather than in
the device tree.

-Scott

^ permalink raw reply

* [PATCH 1/2] powerpc/mpc85xx: Create dts components for DPAA Q/BMan
From: Emil Medve @ 2014-11-13  9:17 UTC (permalink / raw)
  To: scottwood, linuxppc-dev; +Cc: Geoff Thorpe, Emil Medve

From: Kumar Gala <galak@kernel.crashing.org>

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Geoff Thorpe <Geoff.Thorpe@freescale.com>
Signed-off-by: Hai-Ying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Change-Id: I16e63db731e55a3d60d4e147573c1af8718082d3
---

Based on:
	http://patchwork.ozlabs.org/patch/407034
	http://patchwork.ozlabs.org/patch/407037
	http://patchwork.ozlabs.org/patch/407035
	http://patchwork.ozlabs.org/patch/407036

 arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi |  90 ++++++++++++++++++
 arch/powerpc/boot/dts/fsl/qoriq-bman1.dtsi         |  41 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-qman1-portals.dtsi | 101 +++++++++++++++++++++
 arch/powerpc/boot/dts/fsl/qoriq-qman1.dtsi         |  41 +++++++++
 arch/powerpc/boot/dts/fsl/qoriq-qman3.dtsi         |  41 +++++++++
 5 files changed, 314 insertions(+)
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-bman1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-qman1-portals.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-qman1.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-qman3.dtsi

diff --git a/arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi
new file mode 100644
index 0000000..5022432
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi
@@ -0,0 +1,90 @@
+/*
+ * QorIQ BMan Portal device tree stub for 10 portals
+ *
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *	 notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *	 notice, this list of conditions and the following disclaimer in the
+ *	 documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *	 names of its contributors may be used to endorse or promote products
+ *	 derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+&bportals {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "simple-bus";
+
+	bman-portal@0 {
+		compatible = "fsl,bman-portal";
+		reg = <0x0 0x4000>, <0x100000 0x1000>;
+		interrupts = <105 2 0 0>;
+	};
+	bman-portal@4000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x4000 0x4000>, <0x101000 0x1000>;
+		interrupts = <107 2 0 0>;
+	};
+	bman-portal@8000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x8000 0x4000>, <0x102000 0x1000>;
+		interrupts = <109 2 0 0>;
+	};
+	bman-portal@c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xc000 0x4000>, <0x103000 0x1000>;
+		interrupts = <111 2 0 0>;
+	};
+	bman-portal@10000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x10000 0x4000>, <0x104000 0x1000>;
+		interrupts = <113 2 0 0>;
+	};
+	bman-portal@14000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x14000 0x4000>, <0x105000 0x1000>;
+		interrupts = <115 2 0 0>;
+	};
+	bman-portal@18000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x18000 0x4000>, <0x106000 0x1000>;
+		interrupts = <117 2 0 0>;
+	};
+	bman-portal@1c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x1c000 0x4000>, <0x107000 0x1000>;
+		interrupts = <119 2 0 0>;
+	};
+	bman-portal@20000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x20000 0x4000>, <0x108000 0x1000>;
+		interrupts = <121 2 0 0>;
+	};
+	bman-portal@24000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x24000 0x4000>, <0x109000 0x1000>;
+		interrupts = <123 2 0 0>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-bman1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-bman1.dtsi
new file mode 100644
index 0000000..1adc09f
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-bman1.dtsi
@@ -0,0 +1,41 @@
+/*
+ * QorIQ BMan device tree stub [ controller @ offset 0x31a000 ]
+ *
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *	 notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *	 notice, this list of conditions and the following disclaimer in the
+ *	 documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *	 names of its contributors may be used to endorse or promote products
+ *	 derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+bman: bman@31a000 {
+	compatible = "fsl,bman";
+	reg = <0x31a000 0x1000>;
+	interrupts = <16 2 1 2>;
+	fsl,bman-portals = &bportals;
+	memory-region = <&bman_fbpr>;
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-qman1-portals.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-qman1-portals.dtsi
new file mode 100644
index 0000000..05d51ac
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-qman1-portals.dtsi
@@ -0,0 +1,101 @@
+/*
+ * QorIQ QMan Portal device tree stub for 10 portals & 15 pool channels
+ *
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *	 notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *	 notice, this list of conditions and the following disclaimer in the
+ *	 documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *	 names of its contributors may be used to endorse or promote products
+ *	 derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+&qportals {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "simple-bus";
+
+	qportal0: qman-portal@0 {
+		compatible = "fsl,qman-portal";
+		reg = <0x0 0x4000>, <0x100000 0x1000>;
+		interrupts = <104 2 0 0>;
+		fsl,qman-channel-id = <0x0>;
+	};
+	qportal1: qman-portal@4000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x4000 0x4000>, <0x101000 0x1000>;
+		interrupts = <106 2 0 0>;
+		fsl,qman-channel-id = <1>;
+	};
+	qportal2: qman-portal@8000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x8000 0x4000>, <0x102000 0x1000>;
+		interrupts = <108 2 0 0>;
+		fsl,qman-channel-id = <2>;
+	};
+	qportal3: qman-portal@c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xc000 0x4000>, <0x103000 0x1000>;
+		interrupts = <110 2 0 0>;
+		fsl,qman-channel-id = <3>;
+	};
+	qportal4: qman-portal@10000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x10000 0x4000>, <0x104000 0x1000>;
+		interrupts = <112 2 0 0>;
+		fsl,qman-channel-id = <4>;
+	};
+	qportal5: qman-portal@14000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x14000 0x4000>, <0x105000 0x1000>;
+		interrupts = <114 2 0 0>;
+		fsl,qman-channel-id = <5>;
+	};
+	qportal6: qman-portal@18000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x18000 0x4000>, <0x106000 0x1000>;
+		interrupts = <116 2 0 0>;
+		fsl,qman-channel-id = <6>;
+	};
+
+	qportal7: qman-portal@1c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x1c000 0x4000>, <0x107000 0x1000>;
+		interrupts = <118 2 0 0>;
+		fsl,qman-channel-id = <7>;
+	};
+	qportal8: qman-portal@20000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x20000 0x4000>, <0x108000 0x1000>;
+		interrupts = <120 2 0 0>;
+		fsl,qman-channel-id = <8>;
+	};
+	qportal9: qman-portal@24000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x24000 0x4000>, <0x109000 0x1000>;
+		interrupts = <122 2 0 0>;
+		fsl,qman-channel-id = <9>;
+	};
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-qman1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-qman1.dtsi
new file mode 100644
index 0000000..5c63b76
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-qman1.dtsi
@@ -0,0 +1,41 @@
+/*
+ * QorIQ QMan device tree stub [ controller @ offset 0x318000 ]
+ *
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *	 notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *	 notice, this list of conditions and the following disclaimer in the
+ *	 documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *	 names of its contributors may be used to endorse or promote products
+ *	 derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+qman: qman@318000 {
+	compatible = "fsl,qman";
+	reg = <0x318000 0x1000>;
+	interrupts = <16 2 1 3>;
+	fsl,qman-portals = &qportals;
+	memory-region = <&qman_fqd &qman_pfdr>;
+};
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-qman3.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-qman3.dtsi
new file mode 100644
index 0000000..f3f57c6
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-qman3.dtsi
@@ -0,0 +1,41 @@
+/*
+ * QorIQ QMan rev3 device tree stub [ controller @ offset 0x318000 ]
+ *
+ * Copyright 2014 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *	 notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *	 notice, this list of conditions and the following disclaimer in the
+ *	 documentation and/or other materials provided with the distribution.
+ *     * Neither the name of Freescale Semiconductor nor the
+ *	 names of its contributors may be used to endorse or promote products
+ *	 derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+qman: qman@318000 {
+	compatible = "fsl,qman";
+	reg = <0x318000 0x2000>;
+	interrupts = <16 2 1 3>;
+	fsl,qman-portals = &qportals;
+	memory-region = <&qman_fqd &qman_pfdr>;
+};
-- 
2.1.3

^ permalink raw reply related

* [PATCH 2/2] powerpc/mpc85xx: Add DPAA Q/BMan support to device tree(s)
From: Emil Medve @ 2014-11-13  9:21 UTC (permalink / raw)
  To: scottwood, linuxppc-dev
  Cc: Poonam Aggrwal, Geoff Thorpe, Emil Medve, Chunhe Lan

From: Kumar Gala <galak@kernel.crashing.org>

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Geoff Thorpe <Geoff.Thorpe@freescale.com>
Signed-off-by: Hai-Ying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Change-Id: If643fa5ba0a903aef8f5056a2c90ebecc995b760
---

Based on:
	http://patchwork.ozlabs.org/patch/407034
	http://patchwork.ozlabs.org/patch/407037
	http://patchwork.ozlabs.org/patch/407035
	http://patchwork.ozlabs.org/patch/407036

 arch/powerpc/boot/dts/b4qds.dtsi            |  42 +-
 arch/powerpc/boot/dts/fsl/b4420si-post.dtsi |   2 +-
 arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi  |   2 +-
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi | 129 ++++++-
 arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi  |   3 +-
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi    | 180 ++++++++-
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  61 ++-
 arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi  |   2 +-
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |   9 +-
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |   9 +-
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |   9 +-
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |   9 +-
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |   9 +-
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi | 128 ++++++-
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 216 ++++++++++-
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 568 +++++++++++++++++++++++++++-
 arch/powerpc/boot/dts/kmcoge4.dts           |  40 ++
 arch/powerpc/boot/dts/oca4080.dts           |  40 ++
 arch/powerpc/boot/dts/p1023rdb.dts          |  43 ++-
 arch/powerpc/boot/dts/p2041rdb.dts          |  42 +-
 arch/powerpc/boot/dts/p3041ds.dts           |  42 +-
 arch/powerpc/boot/dts/p4080ds.dts           |  42 +-
 arch/powerpc/boot/dts/p5020ds.dts           |  42 +-
 arch/powerpc/boot/dts/p5040ds.dts           |  42 +-
 arch/powerpc/boot/dts/t104xqds.dtsi         |  42 +-
 arch/powerpc/boot/dts/t104xrdb.dtsi         |  40 ++
 arch/powerpc/boot/dts/t208xqds.dtsi         |  42 +-
 arch/powerpc/boot/dts/t208xrdb.dtsi         |  40 ++
 arch/powerpc/boot/dts/t4240qds.dts          |  42 +-
 arch/powerpc/boot/dts/t4240rdb.dts          |  40 ++
 30 files changed, 1930 insertions(+), 27 deletions(-)

diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index 6188583..48c3fb4 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420DS Device Tree Source
  *
- * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -38,6 +38,7 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	aliases {
 		phy_sgmii_10 = &phy_sgmii_10;
@@ -104,10 +105,49 @@
 		device_type = "memory";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
+
 	dcsr: dcsr@f00000000 {
 		ranges = <0x00000000 0xf 0x00000000 0x01052000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x2000000>;
+	};
+
+	qportals: qman-portals@ff6000000 {
+		ranges = <0x0 0xf 0xf6000000 0x2000000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
index 86161ae..0f56263 100644
--- a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
diff --git a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
index 338af7e..f392949 100644
--- a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420 Silicon/SoC Device Tree Source (pre include)
  *
- * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index f356ed2..38e297b 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4860 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -109,6 +109,133 @@
 	};
 };
 
+&bportals {
+	bman-portal@38000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x38000 0x4000>, <0x100e000 0x1000>;
+		interrupts = <133 2 0 0>;
+	};
+	bman-portal@3c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x3c000 0x4000>, <0x100f000 0x1000>;
+		interrupts = <135 2 0 0>;
+	};
+	bman-portal@40000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x40000 0x4000>, <0x1010000 0x1000>;
+		interrupts = <137 2 0 0>;
+	};
+	bman-portal@44000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x44000 0x4000>, <0x1011000 0x1000>;
+		interrupts = <139 2 0 0>;
+	};
+	bman-portal@48000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x48000 0x4000>, <0x1012000 0x1000>;
+		interrupts = <141 2 0 0>;
+	};
+	bman-portal@4c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x4c000 0x4000>, <0x1013000 0x1000>;
+		interrupts = <143 2 0 0>;
+	};
+	bman-portal@50000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x50000 0x4000>, <0x1014000 0x1000>;
+		interrupts = <145 2 0 0>;
+	};
+	bman-portal@54000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x54000 0x4000>, <0x1015000 0x1000>;
+		interrupts = <147 2 0 0>;
+	};
+	bman-portal@58000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x58000 0x4000>, <0x1016000 0x1000>;
+		interrupts = <149 2 0 0>;
+	};
+	bman-portal@5c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x5c000 0x4000>, <0x1017000 0x1000>;
+		interrupts = <151 2 0 0>;
+	};
+	bman-portal@60000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x60000 0x4000>, <0x1018000 0x1000>;
+		interrupts = <153 2 0 0>;
+	};
+};
+
+&qportals {
+	qportal14: qman-portal@38000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x38000 0x4000>, <0x100e000 0x1000>;
+		interrupts = <132 0x2 0 0>;
+		fsl,qman-channel-id = <0xe>;
+	};
+	qportal15: qman-portal@3c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x3c000 0x4000>, <0x100f000 0x1000>;
+		interrupts = <134 0x2 0 0>;
+		fsl,qman-channel-id = <0xf>;
+	};
+	qportal16: qman-portal@40000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x40000 0x4000>, <0x1010000 0x1000>;
+		interrupts = <136 0x2 0 0>;
+		fsl,qman-channel-id = <0x10>;
+	};
+	qportal17: qman-portal@44000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x44000 0x4000>, <0x1011000 0x1000>;
+		interrupts = <138 0x2 0 0>;
+		fsl,qman-channel-id = <0x11>;
+	};
+	qportal18: qman-portal@48000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x48000 0x4000>, <0x1012000 0x1000>;
+		interrupts = <140 0x2 0 0>;
+		fsl,qman-channel-id = <0x12>;
+	};
+	qportal19: qman-portal@4c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x4c000 0x4000>, <0x1013000 0x1000>;
+		interrupts = <142 0x2 0 0>;
+		fsl,qman-channel-id = <0x13>;
+	};
+	qportal20: qman-portal@50000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x50000 0x4000>, <0x1014000 0x1000>;
+		interrupts = <144 0x2 0 0>;
+		fsl,qman-channel-id = <0x14>;
+	};
+	qportal21: qman-portal@54000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x54000 0x4000>, <0x1015000 0x1000>;
+		interrupts = <146 0x2 0 0>;
+		fsl,qman-channel-id = <0x15>;
+	};
+	qportal22: qman-portal@58000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x58000 0x4000>, <0x1016000 0x1000>;
+		interrupts = <148 0x2 0 0>;
+		fsl,qman-channel-id = <0x16>;
+	};
+	qportal23: qman-portal@5c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x5c000 0x4000>, <0x1017000 0x1000>;
+		interrupts = <150 0x2 0 0>;
+		fsl,qman-channel-id = <0x17>;
+	};
+	qportal24: qman-portal@60000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x60000 0x4000>, <0x1018000 0x1000>;
+		interrupts = <152 0x2 0 0>;
+		fsl,qman-channel-id = <0x18>;
+	};
+};
+
 &soc {
 	ddr2: memory-controller@9000 {
 		compatible = "fsl,qoriq-memory-controller-v4.5", "fsl,qoriq-memory-controller";
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
index a85e435..c10d3f3 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4860 Silicon/SoC Device Tree Source (pre include)
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -58,7 +58,6 @@
 		fman0 = &fman0;
 	};
 
-
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
diff --git a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
index 4cd4a31..62b9667 100644
--- a/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -128,6 +128,174 @@
 	};
 };
 
+&bportals {
+	#address-cells = <0x1>;
+	#size-cells = <0x1>;
+	compatible = "simple-bus";
+
+	bman-portal@0 {
+		compatible = "fsl,bman-portal";
+		reg = <0x0 0x4000>, <0x1000000 0x1000>;
+		interrupts = <105 2 0 0>;
+	};
+	bman-portal@4000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x4000 0x4000>, <0x1001000 0x1000>;
+		interrupts = <107 2 0 0>;
+	};
+	bman-portal@8000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x8000 0x4000>, <0x1002000 0x1000>;
+		interrupts = <109 2 0 0>;
+	};
+	bman-portal@c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xc000 0x4000>, <0x1003000 0x1000>;
+		interrupts = <111 2 0 0>;
+	};
+	bman-portal@10000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x10000 0x4000>, <0x1004000 0x1000>;
+		interrupts = <113 2 0 0>;
+	};
+	bman-portal@14000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x14000 0x4000>, <0x1005000 0x1000>;
+		interrupts = <115 2 0 0>;
+	};
+	bman-portal@18000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x18000 0x4000>, <0x1006000 0x1000>;
+		interrupts = <117 2 0 0>;
+	};
+	bman-portal@1c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x1c000 0x4000>, <0x1007000 0x1000>;
+		interrupts = <119 2 0 0>;
+	};
+	bman-portal@20000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x20000 0x4000>, <0x1008000 0x1000>;
+		interrupts = <121 2 0 0>;
+	};
+	bman-portal@24000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x24000 0x4000>, <0x1009000 0x1000>;
+		interrupts = <123 2 0 0>;
+	};
+	bman-portal@28000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x28000 0x4000>, <0x100a000 0x1000>;
+		interrupts = <125 2 0 0>;
+	};
+	bman-portal@2c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x2c000 0x4000>, <0x100b000 0x1000>;
+		interrupts = <127 2 0 0>;
+	};
+	bman-portal@30000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x30000 0x4000>, <0x100c000 0x1000>;
+		interrupts = <129 2 0 0>;
+	};
+	bman-portal@34000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x34000 0x4000>, <0x100d000 0x1000>;
+		interrupts = <131 2 0 0>;
+	};
+};
+
+&qportals {
+	#address-cells = <0x1>;
+	#size-cells = <0x1>;
+	compatible = "simple-bus";
+
+	qportal0: qman-portal@0 {
+		compatible = "fsl,qman-portal";
+		reg = <0x0 0x4000>, <0x1000000 0x1000>;
+		interrupts = <104 0x2 0 0>;
+		fsl,qman-channel-id = <0x0>;
+	};
+	qportal1: qman-portal@4000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x4000 0x4000>, <0x1001000 0x1000>;
+		interrupts = <106 0x2 0 0>;
+		fsl,qman-channel-id = <0x1>;
+	};
+	qportal2: qman-portal@8000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x8000 0x4000>, <0x1002000 0x1000>;
+		interrupts = <108 0x2 0 0>;
+		fsl,qman-channel-id = <0x2>;
+	};
+	qportal3: qman-portal@c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xc000 0x4000>, <0x1003000 0x1000>;
+		interrupts = <110 0x2 0 0>;
+		fsl,qman-channel-id = <0x3>;
+	};
+	qportal4: qman-portal@10000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x10000 0x4000>, <0x1004000 0x1000>;
+		interrupts = <112 0x2 0 0>;
+		fsl,qman-channel-id = <0x4>;
+	};
+	qportal5: qman-portal@14000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x14000 0x4000>, <0x1005000 0x1000>;
+		interrupts = <114 0x2 0 0>;
+		fsl,qman-channel-id = <0x5>;
+	};
+	qportal6: qman-portal@18000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x18000 0x4000>, <0x1006000 0x1000>;
+		interrupts = <116 0x2 0 0>;
+		fsl,qman-channel-id = <0x6>;
+	};
+	qportal7: qman-portal@1c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x1c000 0x4000>, <0x1007000 0x1000>;
+		interrupts = <118 0x2 0 0>;
+		fsl,qman-channel-id = <0x7>;
+	};
+	qportal8: qman-portal@20000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x20000 0x4000>, <0x1008000 0x1000>;
+		interrupts = <120 0x2 0 0>;
+		fsl,qman-channel-id = <0x8>;
+	};
+	qportal9: qman-portal@24000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x24000 0x4000>, <0x1009000 0x1000>;
+		interrupts = <122 0x2 0 0>;
+		fsl,qman-channel-id = <0x9>;
+	};
+	qportal10: qman-portal@28000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x28000 0x4000>, <0x100a000 0x1000>;
+		interrupts = <124 0x2 0 0>;
+		fsl,qman-channel-id = <0xa>;
+	};
+	qportal11: qman-portal@2c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x2c000 0x4000>, <0x100b000 0x1000>;
+		interrupts = <126 0x2 0 0>;
+		fsl,qman-channel-id = <0xb>;
+	};
+	qportal12: qman-portal@30000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x30000 0x4000>, <0x100c000 0x1000>;
+		interrupts = <128 0x2 0 0>;
+		fsl,qman-channel-id = <0xc>;
+	};
+	qportal13: qman-portal@34000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x34000 0x4000>, <0x100d000 0x1000>;
+		interrupts = <130 0x2 0 0>;
+		fsl,qman-channel-id = <0xd>;
+	};
+};
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
@@ -261,6 +429,16 @@
 /include/ "qoriq-duart-1.dtsi"
 /include/ "qoriq-sec5.3-0.dtsi"
 
+/include/ "qoriq-qman3.dtsi"
+	qman: qman@318000 {
+		interrupts = <16 2 1 28>;
+	};
+
+/include/ "qoriq-bman1.dtsi"
+	bman: bman@31a000 {
+		interrupts = <16 2 1 29>;
+	};
+
 /include/ "qoriq-fman3-0.dtsi"
 /include/ "qoriq-fman3-0-1g-0.dtsi"
 /include/ "qoriq-fman3-0-1g-1.dtsi"
diff --git a/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi b/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
index 01fd153..8cc40a6 100644
--- a/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p1023si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * P1023/P1017 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2011 Freescale Semiconductor Inc.
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -97,6 +97,53 @@
 	};
 };
 
+&qportals {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "simple-bus";
+
+	qportal0: qman-portal@0 {
+		compatible = "fsl,qman-portal";
+		reg = <0x0 0x4000>, <0x100000 0x1000>;
+		interrupts = <29 2 0 0>;
+		fsl,qman-channel-id = <0>;
+	};
+	qportal1: qman-portal@4000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x4000 0x4000>, <0x101000 0x1000>;
+		interrupts = <31 2 0 0>;
+		fsl,qman-channel-id = <1>;
+	};
+	qportal2: qman-portal@8000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x8000 0x4000>, <0x102000 0x1000>;
+		interrupts = <33 2 0 0>;
+		fsl,qman-channel-id = <2>;
+	};
+};
+
+&bportals {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "simple-bus";
+
+	bman-portal@0 {
+		compatible = "fsl,bman-portal";
+		reg = <0x0 0x4000>, <0x100000 0x1000>;
+		interrupts = <30 2 0 0>;
+	};
+	bman-portal@4000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x4000 0x4000>, <0x101000 0x1000>;
+		interrupts = <32 2 0 0>;
+	};
+	bman-portal@8000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x8000 0x4000>, <0x102000 0x1000>;
+		interrupts = <34 2 0 0>;
+	};
+};
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
@@ -221,6 +268,18 @@
 /include/ "pq3-mpic.dtsi"
 /include/ "pq3-mpic-timer-B.dtsi"
 
+	qman: qman@88000 {
+		compatible = "fsl,qman";
+		reg = <0x88000 0x1000>;
+		interrupts = <16 2 0 0>;
+	};
+
+	bman: bman@8a000 {
+		compatible = "fsl,bman";
+		reg = <0x8a000 0x1000>;
+		interrupts = <16 2 0 0>;
+	};
+
 	global-utilities@e0000 {
 		compatible = "fsl,p1023-guts";
 		reg = <0xe0000 0x1000>;
diff --git a/arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi
index 132a152..01d8b3f 100644
--- a/arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi
@@ -1,7 +1,7 @@
 /*
  * P1023/P1017 Silicon/SoC Device Tree Source (pre include)
  *
- * Copyright 2011 Freescale Semiconductor Inc.
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
index 37d35da..e21194b 100644
--- a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * P2041/P2040 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2011 Freescale Semiconductor Inc.
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -216,6 +216,10 @@
 	};
 };
 
+/include/ "qoriq-bman1-portals.dtsi"
+
+/include/ "qoriq-qman1-portals.dtsi"
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
@@ -408,6 +412,9 @@ crypto: crypto@300000 {
 		fsl,iommu-parent = <&pamu1>;
 	};
 
+/include/ "qoriq-qman1.dtsi"
+/include/ "qoriq-bman1.dtsi"
+
 /include/ "qoriq-fman-0.dtsi"
 /include/ "qoriq-fman-0-1g-0.dtsi"
 /include/ "qoriq-fman-0-1g-1.dtsi"
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
index 0e9a07d..c736456 100644
--- a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * P3041 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2011 Freescale Semiconductor Inc.
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -243,6 +243,10 @@
 	};
 };
 
+/include/ "qoriq-bman1-portals.dtsi"
+
+/include/ "qoriq-qman1-portals.dtsi"
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
@@ -435,6 +439,9 @@ crypto: crypto@300000 {
 		fsl,iommu-parent = <&pamu1>;
 	};
 
+/include/ "qoriq-qman1.dtsi"
+/include/ "qoriq-bman1.dtsi"
+
 /include/ "qoriq-fman-0.dtsi"
 /include/ "qoriq-fman-0-1g-0.dtsi"
 /include/ "qoriq-fman-0-1g-1.dtsi"
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
index 090c586..f30ef14 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * P4080/P4040 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2011 Freescale Semiconductor Inc.
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -243,6 +243,10 @@
 
 };
 
+/include/ "qoriq-bman1-portals.dtsi"
+
+/include/ "qoriq-qman1-portals.dtsi"
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
@@ -491,6 +495,9 @@ crypto: crypto@300000 {
 		fsl,iommu-parent = <&pamu1>;
 	};
 
+/include/ "qoriq-qman1.dtsi"
+/include/ "qoriq-bman1.dtsi"
+
 /include/ "qoriq-fman-0.dtsi"
 /include/ "qoriq-fman-0-1g-0.dtsi"
 /include/ "qoriq-fman-0-1g-1.dtsi"
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
index db82352..3285015 100644
--- a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * P5020/5010 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2011 Freescale Semiconductor Inc.
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -240,6 +240,10 @@
 	};
 };
 
+/include/ "qoriq-bman1-portals.dtsi"
+
+/include/ "qoriq-qman1-portals.dtsi"
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
@@ -421,6 +425,9 @@
 		fsl,iommu-parent = <&pamu1>;
 	};
 
+/include/ "qoriq-qman1.dtsi"
+/include/ "qoriq-bman1.dtsi"
+
 /include/ "qoriq-raid1.0-0.dtsi"
 	raideng@320000 {
 		fsl,iommu-parent = <&pamu1>;
diff --git a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
index cd44659..9a8141a 100644
--- a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * P5040 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -195,6 +195,10 @@
 	};
 };
 
+/include/ "qoriq-bman1-portals.dtsi"
+
+/include/ "qoriq-qman1-portals.dtsi"
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
@@ -400,6 +404,9 @@
 		fsl,iommu-parent = <&pamu4>;
 	};
 
+/include/ "qoriq-qman1.dtsi"
+/include/ "qoriq-bman1.dtsi"
+
 /include/ "qoriq-fman-0.dtsi"
 /include/ "qoriq-fman-0-1g-0.dtsi"
 /include/ "qoriq-fman-0-1g-1.dtsi"
diff --git a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
index 15ae462..ca1d42f 100644
--- a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * T1040 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2013 Freescale Semiconductor Inc.
+ * Copyright 2013 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -218,6 +218,130 @@
 	};
 };
 
+&bportals {
+	#address-cells = <0x1>;
+	#size-cells = <0x1>;
+	compatible = "simple-bus";
+
+	bman-portal@0 {
+		compatible = "fsl,bman-portal";
+		reg = <0x0 0x4000>, <0x1000000 0x1000>;
+		interrupts = <105 2 0 0>;
+	};
+	bman-portal@4000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x4000 0x4000>, <0x1001000 0x1000>;
+		interrupts = <107 2 0 0>;
+	};
+	bman-portal@8000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x8000 0x4000>, <0x1002000 0x1000>;
+		interrupts = <109 2 0 0>;
+	};
+	bman-portal@c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xc000 0x4000>, <0x1003000 0x1000>;
+		interrupts = <111 2 0 0>;
+	};
+	bman-portal@10000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x10000 0x4000>, <0x1004000 0x1000>;
+		interrupts = <113 2 0 0>;
+	};
+	bman-portal@14000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x14000 0x4000>, <0x1005000 0x1000>;
+		interrupts = <115 2 0 0>;
+	};
+	bman-portal@18000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x18000 0x4000>, <0x1006000 0x1000>;
+		interrupts = <117 2 0 0>;
+	};
+	bman-portal@1c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x1c000 0x4000>, <0x1007000 0x1000>;
+		interrupts = <119 2 0 0>;
+	};
+	bman-portal@20000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x20000 0x4000>, <0x1008000 0x1000>;
+		interrupts = <121 2 0 0>;
+	};
+	bman-portal@24000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x24000 0x4000>, <0x1009000 0x1000>;
+		interrupts = <123 2 0 0>;
+	};
+};
+
+&qportals {
+	#address-cells = <0x1>;
+	#size-cells = <0x1>;
+	compatible = "simple-bus";
+
+	qportal0: qman-portal@0 {
+		compatible = "fsl,qman-portal";
+		reg = <0x0 0x4000>, <0x1000000 0x1000>;
+		interrupts = <104 0x2 0 0>;
+		fsl,qman-channel-id = <0x0>;
+	};
+	qportal1: qman-portal@4000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x4000 0x4000>, <0x1001000 0x1000>;
+		interrupts = <106 0x2 0 0>;
+		fsl,qman-channel-id = <0x1>;
+	};
+	qportal2: qman-portal@8000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x8000 0x4000>, <0x1002000 0x1000>;
+		interrupts = <108 0x2 0 0>;
+		fsl,qman-channel-id = <0x2>;
+	};
+	qportal3: qman-portal@c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xc000 0x4000>, <0x1003000 0x1000>;
+		interrupts = <110 0x2 0 0>;
+		fsl,qman-channel-id = <0x3>;
+	};
+	qportal4: qman-portal@10000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x10000 0x4000>, <0x1004000 0x1000>;
+		interrupts = <112 0x2 0 0>;
+		fsl,qman-channel-id = <0x4>;
+	};
+	qportal5: qman-portal@14000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x14000 0x4000>, <0x1005000 0x1000>;
+		interrupts = <114 0x2 0 0>;
+		fsl,qman-channel-id = <0x5>;
+	};
+	qportal6: qman-portal@18000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x18000 0x4000>, <0x1006000 0x1000>;
+		interrupts = <116 0x2 0 0>;
+		fsl,qman-channel-id = <0x6>;
+	};
+	qportal7: qman-portal@1c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x1c000 0x4000>, <0x1007000 0x1000>;
+		interrupts = <118 0x2 0 0>;
+		fsl,qman-channel-id = <0x7>;
+	};
+	qportal8: qman-portal@20000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x20000 0x4000>, <0x1008000 0x1000>;
+		interrupts = <120 0x2 0 0>;
+		fsl,qman-channel-id = <0x8>;
+	};
+	qportal9: qman-portal@24000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x24000 0x4000>, <0x1009000 0x1000>;
+		interrupts = <122 0x2 0 0>;
+		fsl,qman-channel-id = <0x9>;
+	};
+};
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
@@ -401,4 +525,6 @@
 		fsl,liodn-reg = <&guts 0x554>; /* SATA2LIODNR */
 	};
 /include/ "qoriq-sec5.0-0.dtsi"
+/include/ "qoriq-qman3.dtsi"
+/include/ "qoriq-bman1.dtsi"
 };
diff --git a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
index 1ce91e3..0ce61c0 100644
--- a/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t2081si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * T2081 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2013 Freescale Semiconductor Inc.
+ * Copyright 2013 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -224,6 +224,218 @@
 	};
 };
 
+&bportals {
+	#address-cells = <0x1>;
+	#size-cells = <0x1>;
+	compatible = "simple-bus";
+
+	bman-portal@0 {
+		compatible = "fsl,bman-portal";
+		reg = <0x0 0x4000>, <0x1000000 0x1000>;
+		interrupts = <105 2 0 0>;
+	};
+	bman-portal@4000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x4000 0x4000>, <0x1001000 0x1000>;
+		interrupts = <107 2 0 0>;
+	};
+	bman-portal@8000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x8000 0x4000>, <0x1002000 0x1000>;
+		interrupts = <109 2 0 0>;
+	};
+	bman-portal@c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xc000 0x4000>, <0x1003000 0x1000>;
+		interrupts = <111 2 0 0>;
+	};
+	bman-portal@10000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x10000 0x4000>, <0x1004000 0x1000>;
+		interrupts = <113 2 0 0>;
+	};
+	bman-portal@14000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x14000 0x4000>, <0x1005000 0x1000>;
+		interrupts = <115 2 0 0>;
+	};
+	bman-portal@18000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x18000 0x4000>, <0x1006000 0x1000>;
+		interrupts = <117 2 0 0>;
+	};
+	bman-portal@1c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x1c000 0x4000>, <0x1007000 0x1000>;
+		interrupts = <119 2 0 0>;
+	};
+	bman-portal@20000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x20000 0x4000>, <0x1008000 0x1000>;
+		interrupts = <121 2 0 0>;
+	};
+	bman-portal@24000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x24000 0x4000>, <0x1009000 0x1000>;
+		interrupts = <123 2 0 0>;
+	};
+	bman-portal@28000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x28000 0x4000>, <0x100a000 0x1000>;
+		interrupts = <125 2 0 0>;
+	};
+	bman-portal@2c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x2c000 0x4000>, <0x100b000 0x1000>;
+		interrupts = <127 2 0 0>;
+	};
+	bman-portal@30000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x30000 0x4000>, <0x100c000 0x1000>;
+		interrupts = <129 2 0 0>;
+	};
+	bman-portal@34000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x34000 0x4000>, <0x100d000 0x1000>;
+		interrupts = <131 2 0 0>;
+	};
+	bman-portal@38000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x38000 0x4000>, <0x100e000 0x1000>;
+		interrupts = <133 2 0 0>;
+	};
+	bman-portal@3c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x3c000 0x4000>, <0x100f000 0x1000>;
+		interrupts = <135 2 0 0>;
+	};
+	bman-portal@40000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x40000 0x4000>, <0x1010000 0x1000>;
+		interrupts = <137 2 0 0>;
+	};
+	bman-portal@44000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x44000 0x4000>, <0x1011000 0x1000>;
+		interrupts = <139 2 0 0>;
+	};
+};
+
+&qportals {
+	#address-cells = <0x1>;
+	#size-cells = <0x1>;
+	compatible = "simple-bus";
+
+	qportal0: qman-portal@0 {
+		compatible = "fsl,qman-portal";
+		reg = <0x0 0x4000>, <0x1000000 0x1000>;
+		interrupts = <104 0x2 0 0>;
+		fsl,qman-channel-id = <0x0>;
+	};
+	qportal1: qman-portal@4000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x4000 0x4000>, <0x1001000 0x1000>;
+		interrupts = <106 0x2 0 0>;
+		fsl,qman-channel-id = <0x1>;
+	};
+	qportal2: qman-portal@8000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x8000 0x4000>, <0x1002000 0x1000>;
+		interrupts = <108 0x2 0 0>;
+		fsl,qman-channel-id = <0x2>;
+	};
+	qportal3: qman-portal@c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xc000 0x4000>, <0x1003000 0x1000>;
+		interrupts = <110 0x2 0 0>;
+		fsl,qman-channel-id = <0x3>;
+	};
+	qportal4: qman-portal@10000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x10000 0x4000>, <0x1004000 0x1000>;
+		interrupts = <112 0x2 0 0>;
+		fsl,qman-channel-id = <0x4>;
+	};
+	qportal5: qman-portal@14000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x14000 0x4000>, <0x1005000 0x1000>;
+		interrupts = <114 0x2 0 0>;
+		fsl,qman-channel-id = <0x5>;
+	};
+	qportal6: qman-portal@18000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x18000 0x4000>, <0x1006000 0x1000>;
+		interrupts = <116 0x2 0 0>;
+		fsl,qman-channel-id = <0x6>;
+	};
+	qportal7: qman-portal@1c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x1c000 0x4000>, <0x1007000 0x1000>;
+		interrupts = <118 0x2 0 0>;
+		fsl,qman-channel-id = <0x7>;
+	};
+	qportal8: qman-portal@20000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x20000 0x4000>, <0x1008000 0x1000>;
+		interrupts = <120 0x2 0 0>;
+		fsl,qman-channel-id = <0x8>;
+	};
+	qportal9: qman-portal@24000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x24000 0x4000>, <0x1009000 0x1000>;
+		interrupts = <122 0x2 0 0>;
+		fsl,qman-channel-id = <0x9>;
+	};
+	qportal10: qman-portal@28000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x28000 0x4000>, <0x100a000 0x1000>;
+		interrupts = <124 0x2 0 0>;
+		fsl,qman-channel-id = <0xa>;
+	};
+	qportal11: qman-portal@2c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x2c000 0x4000>, <0x100b000 0x1000>;
+		interrupts = <126 0x2 0 0>;
+		fsl,qman-channel-id = <0xb>;
+	};
+	qportal12: qman-portal@30000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x30000 0x4000>, <0x100c000 0x1000>;
+		interrupts = <128 0x2 0 0>;
+		fsl,qman-channel-id = <0xc>;
+	};
+	qportal13: qman-portal@34000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x34000 0x4000>, <0x100d000 0x1000>;
+		interrupts = <130 0x2 0 0>;
+		fsl,qman-channel-id = <0xd>;
+	};
+	qportal14: qman-portal@38000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x38000 0x4000>, <0x100e000 0x1000>;
+		interrupts = <132 0x2 0 0>;
+		fsl,qman-channel-id = <0xe>;
+	};
+	qportal15: qman-portal@3c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x3c000 0x4000>, <0x100f000 0x1000>;
+		interrupts = <134 0x2 0 0>;
+		fsl,qman-channel-id = <0xf>;
+	};
+	qportal16: qman-portal@40000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x40000 0x4000>, <0x1010000 0x1000>;
+		interrupts = <136 0x2 0 0>;
+		fsl,qman-channel-id = <0x10>;
+	};
+	qportal17: qman-portal@44000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x44000 0x4000>, <0x1011000 0x1000>;
+		interrupts = <138 0x2 0 0>;
+		fsl,qman-channel-id = <0x11>;
+	};
+};
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
@@ -400,6 +612,8 @@
 		phy_type = "utmi";
 	};
 /include/ "qoriq-sec5.2-0.dtsi"
+/include/ "qoriq-qman3.dtsi"
+/include/ "qoriq-bman1.dtsi"
 
 	L2_1: l2-cache-controller@c20000 {
 		/* Cluster 0 L2 cache */
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
index b73ee47..e5c2618 100644
--- a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * T4240 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -294,6 +294,570 @@
 	};
 };
 
+&bportals {
+	#address-cells = <0x1>;
+	#size-cells = <0x1>;
+	compatible = "simple-bus";
+
+	bman-portal@0 {
+		compatible = "fsl,bman-portal";
+		reg = <0x0 0x4000>, <0x1000000 0x1000>;
+		interrupts = <105 2 0 0>;
+	};
+	bman-portal@4000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x4000 0x4000>, <0x1001000 0x1000>;
+		interrupts = <107 2 0 0>;
+	};
+	bman-portal@8000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x8000 0x4000>, <0x1002000 0x1000>;
+		interrupts = <109 2 0 0>;
+	};
+	bman-portal@c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xc000 0x4000>, <0x1003000 0x1000>;
+		interrupts = <111 2 0 0>;
+	};
+	bman-portal@10000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x10000 0x4000>, <0x1004000 0x1000>;
+		interrupts = <113 2 0 0>;
+	};
+	bman-portal@14000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x14000 0x4000>, <0x1005000 0x1000>;
+		interrupts = <115 2 0 0>;
+	};
+	bman-portal@18000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x18000 0x4000>, <0x1006000 0x1000>;
+		interrupts = <117 2 0 0>;
+	};
+	bman-portal@1c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x1c000 0x4000>, <0x1007000 0x1000>;
+		interrupts = <119 2 0 0>;
+	};
+	bman-portal@20000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x20000 0x4000>, <0x1008000 0x1000>;
+		interrupts = <121 2 0 0>;
+	};
+	bman-portal@24000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x24000 0x4000>, <0x1009000 0x1000>;
+		interrupts = <123 2 0 0>;
+	};
+	bman-portal@28000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x28000 0x4000>, <0x100a000 0x1000>;
+		interrupts = <125 2 0 0>;
+	};
+	bman-portal@2c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x2c000 0x4000>, <0x100b000 0x1000>;
+		interrupts = <127 2 0 0>;
+	};
+	bman-portal@30000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x30000 0x4000>, <0x100c000 0x1000>;
+		interrupts = <129 2 0 0>;
+	};
+	bman-portal@34000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x34000 0x4000>, <0x100d000 0x1000>;
+		interrupts = <131 2 0 0>;
+	};
+	bman-portal@38000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x38000 0x4000>, <0x100e000 0x1000>;
+		interrupts = <133 2 0 0>;
+	};
+	bman-portal@3c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x3c000 0x4000>, <0x100f000 0x1000>;
+		interrupts = <135 2 0 0>;
+	};
+	bman-portal@40000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x40000 0x4000>, <0x1010000 0x1000>;
+		interrupts = <137 2 0 0>;
+	};
+	bman-portal@44000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x44000 0x4000>, <0x1011000 0x1000>;
+		interrupts = <139 2 0 0>;
+	};
+	bman-portal@48000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x48000 0x4000>, <0x1012000 0x1000>;
+		interrupts = <141 2 0 0>;
+	};
+	bman-portal@4c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x4c000 0x4000>, <0x1013000 0x1000>;
+		interrupts = <143 2 0 0>;
+	};
+	bman-portal@50000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x50000 0x4000>, <0x1014000 0x1000>;
+		interrupts = <145 2 0 0>;
+	};
+	bman-portal@54000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x54000 0x4000>, <0x1015000 0x1000>;
+		interrupts = <147 2 0 0>;
+	};
+	bman-portal@58000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x58000 0x4000>, <0x1016000 0x1000>;
+		interrupts = <149 2 0 0>;
+	};
+	bman-portal@5c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x5c000 0x4000>, <0x1017000 0x1000>;
+		interrupts = <151 2 0 0>;
+	};
+	bman-portal@60000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x60000 0x4000>, <0x1018000 0x1000>;
+		interrupts = <153 2 0 0>;
+	};
+	bman-portal@64000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x64000 0x4000>, <0x1019000 0x1000>;
+		interrupts = <155 2 0 0>;
+	};
+	bman-portal@68000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x68000 0x4000>, <0x101a000 0x1000>;
+		interrupts = <157 2 0 0>;
+	};
+	bman-portal@6c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x6c000 0x4000>, <0x101b000 0x1000>;
+		interrupts = <159 2 0 0>;
+	};
+	bman-portal@70000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x70000 0x4000>, <0x101c000 0x1000>;
+		interrupts = <161 2 0 0>;
+	};
+	bman-portal@74000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x74000 0x4000>, <0x101d000 0x1000>;
+		interrupts = <163 2 0 0>;
+	};
+	bman-portal@78000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x78000 0x4000>, <0x101e000 0x1000>;
+		interrupts = <165 2 0 0>;
+	};
+	bman-portal@7c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x7c000 0x4000>, <0x101f000 0x1000>;
+		interrupts = <167 2 0 0>;
+	};
+	bman-portal@80000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x80000 0x4000>, <0x1020000 0x1000>;
+		interrupts = <169 2 0 0>;
+	};
+	bman-portal@84000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x84000 0x4000>, <0x1021000 0x1000>;
+		interrupts = <171 2 0 0>;
+	};
+	bman-portal@88000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x88000 0x4000>, <0x1022000 0x1000>;
+		interrupts = <173 2 0 0>;
+	};
+	bman-portal@8c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x8c000 0x4000>, <0x1023000 0x1000>;
+		interrupts = <175 2 0 0>;
+	};
+	bman-portal@90000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x90000 0x4000>, <0x1024000 0x1000>;
+		interrupts = <385 2 0 0>;
+	};
+	bman-portal@94000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x94000 0x4000>, <0x1025000 0x1000>;
+		interrupts = <387 2 0 0>;
+	};
+	bman-portal@98000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x98000 0x4000>, <0x1026000 0x1000>;
+		interrupts = <389 2 0 0>;
+	};
+	bman-portal@9c000 {
+		compatible = "fsl,bman-portal";
+		reg = <0x9c000 0x4000>, <0x1027000 0x1000>;
+		interrupts = <391 2 0 0>;
+	};
+	bman-portal@a0000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xa0000 0x4000>, <0x1028000 0x1000>;
+		interrupts = <393 2 0 0>;
+	};
+	bman-portal@a4000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xa4000 0x4000>, <0x1029000 0x1000>;
+		interrupts = <395 2 0 0>;
+	};
+	bman-portal@a8000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xa8000 0x4000>, <0x102a000 0x1000>;
+		interrupts = <397 2 0 0>;
+	};
+	bman-portal@ac000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xac000 0x4000>, <0x102b000 0x1000>;
+		interrupts = <399 2 0 0>;
+	};
+	bman-portal@b0000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xb0000 0x4000>, <0x102c000 0x1000>;
+		interrupts = <401 2 0 0>;
+	};
+	bman-portal@b4000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xb4000 0x4000>, <0x102d000 0x1000>;
+		interrupts = <403 2 0 0>;
+	};
+	bman-portal@b8000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xb8000 0x4000>, <0x102e000 0x1000>;
+		interrupts = <405 2 0 0>;
+	};
+	bman-portal@bc000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xbc000 0x4000>, <0x102f000 0x1000>;
+		interrupts = <407 2 0 0>;
+	};
+	bman-portal@c0000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xc0000 0x4000>, <0x1030000 0x1000>;
+		interrupts = <409 2 0 0>;
+	};
+	bman-portal@c4000 {
+		compatible = "fsl,bman-portal";
+		reg = <0xc4000 0x4000>, <0x1031000 0x1000>;
+		interrupts = <411 2 0 0>;
+	};
+};
+
+&qportals {
+	#address-cells = <0x1>;
+	#size-cells = <0x1>;
+	compatible = "simple-bus";
+
+	qportal0: qman-portal@0 {
+		compatible = "fsl,qman-portal";
+		reg = <0x0 0x4000>, <0x1000000 0x1000>;
+		interrupts = <104 0x2 0 0>;
+		fsl,qman-channel-id = <0x0>;
+	};
+	qportal1: qman-portal@4000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x4000 0x4000>, <0x1001000 0x1000>;
+		interrupts = <106 0x2 0 0>;
+		fsl,qman-channel-id = <0x1>;
+	};
+	qportal2: qman-portal@8000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x8000 0x4000>, <0x1002000 0x1000>;
+		interrupts = <108 0x2 0 0>;
+		fsl,qman-channel-id = <0x2>;
+	};
+	qportal3: qman-portal@c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xc000 0x4000>, <0x1003000 0x1000>;
+		interrupts = <110 0x2 0 0>;
+		fsl,qman-channel-id = <0x3>;
+	};
+	qportal4: qman-portal@10000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x10000 0x4000>, <0x1004000 0x1000>;
+		interrupts = <112 0x2 0 0>;
+		fsl,qman-channel-id = <0x4>;
+	};
+	qportal5: qman-portal@14000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x14000 0x4000>, <0x1005000 0x1000>;
+		interrupts = <114 0x2 0 0>;
+		fsl,qman-channel-id = <0x5>;
+	};
+	qportal6: qman-portal@18000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x18000 0x4000>, <0x1006000 0x1000>;
+		interrupts = <116 0x2 0 0>;
+		fsl,qman-channel-id = <0x6>;
+	};
+	qportal7: qman-portal@1c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x1c000 0x4000>, <0x1007000 0x1000>;
+		interrupts = <118 0x2 0 0>;
+		fsl,qman-channel-id = <0x7>;
+	};
+	qportal8: qman-portal@20000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x20000 0x4000>, <0x1008000 0x1000>;
+		interrupts = <120 0x2 0 0>;
+		fsl,qman-channel-id = <0x8>;
+	};
+	qportal9: qman-portal@24000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x24000 0x4000>, <0x1009000 0x1000>;
+		interrupts = <122 0x2 0 0>;
+		fsl,qman-channel-id = <0x9>;
+	};
+	qportal10: qman-portal@28000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x28000 0x4000>, <0x100a000 0x1000>;
+		interrupts = <124 0x2 0 0>;
+		fsl,qman-channel-id = <0xa>;
+	};
+	qportal11: qman-portal@2c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x2c000 0x4000>, <0x100b000 0x1000>;
+		interrupts = <126 0x2 0 0>;
+		fsl,qman-channel-id = <0xb>;
+	};
+	qportal12: qman-portal@30000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x30000 0x4000>, <0x100c000 0x1000>;
+		interrupts = <128 0x2 0 0>;
+		fsl,qman-channel-id = <0xc>;
+	};
+	qportal13: qman-portal@34000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x34000 0x4000>, <0x100d000 0x1000>;
+		interrupts = <130 0x2 0 0>;
+		fsl,qman-channel-id = <0xd>;
+	};
+	qportal14: qman-portal@38000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x38000 0x4000>, <0x100e000 0x1000>;
+		interrupts = <132 0x2 0 0>;
+		fsl,qman-channel-id = <0xe>;
+	};
+	qportal15: qman-portal@3c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x3c000 0x4000>, <0x100f000 0x1000>;
+		interrupts = <134 0x2 0 0>;
+		fsl,qman-channel-id = <0xf>;
+	};
+	qportal16: qman-portal@40000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x40000 0x4000>, <0x1010000 0x1000>;
+		interrupts = <136 0x2 0 0>;
+		fsl,qman-channel-id = <0x10>;
+	};
+	qportal17: qman-portal@44000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x44000 0x4000>, <0x1011000 0x1000>;
+		interrupts = <138 0x2 0 0>;
+		fsl,qman-channel-id = <0x11>;
+	};
+	qportal18: qman-portal@48000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x48000 0x4000>, <0x1012000 0x1000>;
+		interrupts = <140 0x2 0 0>;
+		fsl,qman-channel-id = <0x12>;
+	};
+	qportal19: qman-portal@4c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x4c000 0x4000>, <0x1013000 0x1000>;
+		interrupts = <142 0x2 0 0>;
+		fsl,qman-channel-id = <0x13>;
+	};
+	qportal20: qman-portal@50000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x50000 0x4000>, <0x1014000 0x1000>;
+		interrupts = <144 0x2 0 0>;
+		fsl,qman-channel-id = <0x14>;
+	};
+	qportal21: qman-portal@54000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x54000 0x4000>, <0x1015000 0x1000>;
+		interrupts = <146 0x2 0 0>;
+		fsl,qman-channel-id = <0x15>;
+	};
+	qportal22: qman-portal@58000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x58000 0x4000>, <0x1016000 0x1000>;
+		interrupts = <148 0x2 0 0>;
+		fsl,qman-channel-id = <0x16>;
+	};
+	qportal23: qman-portal@5c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x5c000 0x4000>, <0x1017000 0x1000>;
+		interrupts = <150 0x2 0 0>;
+		fsl,qman-channel-id = <0x17>;
+	};
+	qportal24: qman-portal@60000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x60000 0x4000>, <0x1018000 0x1000>;
+		interrupts = <152 0x2 0 0>;
+		fsl,qman-channel-id = <0x18>;
+	};
+	qportal25: qman-portal@64000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x64000 0x4000>, <0x1019000 0x1000>;
+		interrupts = <154 0x2 0 0>;
+		fsl,qman-channel-id = <0x19>;
+	};
+	qportal26: qman-portal@68000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x68000 0x4000>, <0x101a000 0x1000>;
+		interrupts = <156 0x2 0 0>;
+		fsl,qman-channel-id = <0x1a>;
+	};
+	qportal27: qman-portal@6c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x6c000 0x4000>, <0x101b000 0x1000>;
+		interrupts = <158 0x2 0 0>;
+		fsl,qman-channel-id = <0x1b>;
+	};
+	qportal28: qman-portal@70000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x70000 0x4000>, <0x101c000 0x1000>;
+		interrupts = <160 0x2 0 0>;
+		fsl,qman-channel-id = <0x1c>;
+	};
+	qportal29: qman-portal@74000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x74000 0x4000>, <0x101d000 0x1000>;
+		interrupts = <162 0x2 0 0>;
+		fsl,qman-channel-id = <0x1d>;
+	};
+	qportal30: qman-portal@78000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x78000 0x4000>, <0x101e000 0x1000>;
+		interrupts = <164 0x2 0 0>;
+		fsl,qman-channel-id = <0x1e>;
+	};
+	qportal31: qman-portal@7c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x7c000 0x4000>, <0x101f000 0x1000>;
+		interrupts = <166 0x2 0 0>;
+		fsl,qman-channel-id = <0x1f>;
+	};
+	qportal32: qman-portal@80000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x80000 0x4000>, <0x1020000 0x1000>;
+		interrupts = <168 0x2 0 0>;
+		fsl,qman-channel-id = <0x20>;
+	};
+	qportal33: qman-portal@84000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x84000 0x4000>, <0x1021000 0x1000>;
+		interrupts = <170 0x2 0 0>;
+		fsl,qman-channel-id = <0x21>;
+	};
+	qportal34: qman-portal@88000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x88000 0x4000>, <0x1022000 0x1000>;
+		interrupts = <172 0x2 0 0>;
+		fsl,qman-channel-id = <0x22>;
+	};
+	qportal35: qman-portal@8c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x8c000 0x4000>, <0x1023000 0x1000>;
+		interrupts = <174 0x2 0 0>;
+		fsl,qman-channel-id = <0x23>;
+	};
+	qportal36: qman-portal@90000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x90000 0x4000>, <0x1024000 0x1000>;
+		interrupts = <384 0x2 0 0>;
+		fsl,qman-channel-id = <0x24>;
+	};
+	qportal37: qman-portal@94000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x94000 0x4000>, <0x1025000 0x1000>;
+		interrupts = <386 0x2 0 0>;
+		fsl,qman-channel-id = <0x25>;
+	};
+	qportal38: qman-portal@98000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x98000 0x4000>, <0x1026000 0x1000>;
+		interrupts = <388 0x2 0 0>;
+		fsl,qman-channel-id = <0x26>;
+	};
+	qportal39: qman-portal@9c000 {
+		compatible = "fsl,qman-portal";
+		reg = <0x9c000 0x4000>, <0x1027000 0x1000>;
+		interrupts = <390 0x2 0 0>;
+		fsl,qman-channel-id = <0x27>;
+	};
+	qportal40: qman-portal@a0000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xa0000 0x4000>, <0x1028000 0x1000>;
+		interrupts = <392 0x2 0 0>;
+		fsl,qman-channel-id = <0x28>;
+	};
+	qportal41: qman-portal@a4000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xa4000 0x4000>, <0x1029000 0x1000>;
+		interrupts = <394 0x2 0 0>;
+		fsl,qman-channel-id = <0x29>;
+	};
+	qportal42: qman-portal@a8000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xa8000 0x4000>, <0x102a000 0x1000>;
+		interrupts = <396 0x2 0 0>;
+		fsl,qman-channel-id = <0x2a>;
+	};
+	qportal43: qman-portal@ac000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xac000 0x4000>, <0x102b000 0x1000>;
+		interrupts = <398 0x2 0 0>;
+		fsl,qman-channel-id = <0x2b>;
+	};
+	qportal44: qman-portal@b0000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xb0000 0x4000>, <0x102c000 0x1000>;
+		interrupts = <400 0x2 0 0>;
+		fsl,qman-channel-id = <0x2c>;
+	};
+	qportal45: qman-portal@b4000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xb4000 0x4000>, <0x102d000 0x1000>;
+		interrupts = <402 0x2 0 0>;
+		fsl,qman-channel-id = <0x2d>;
+	};
+	qportal46: qman-portal@b8000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xb8000 0x4000>, <0x102e000 0x1000>;
+		interrupts = <404 0x2 0 0>;
+		fsl,qman-channel-id = <0x2e>;
+	};
+	qportal47: qman-portal@bc000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xbc000 0x4000>, <0x102f000 0x1000>;
+		interrupts = <406 0x2 0 0>;
+		fsl,qman-channel-id = <0x2f>;
+	};
+	qportal48: qman-portal@c0000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xc0000 0x4000>, <0x1030000 0x1000>;
+		interrupts = <408 0x2 0 0>;
+		fsl,qman-channel-id = <0x30>;
+	};
+	qportal49: qman-portal@c4000 {
+		compatible = "fsl,qman-portal";
+		reg = <0xc4000 0x4000>, <0x1031000 0x1000>;
+		interrupts = <410 0x2 0 0>;
+		fsl,qman-channel-id = <0x31>;
+	};
+};
+
 &soc {
 	#address-cells = <1>;
 	#size-cells = <1>;
@@ -486,6 +1050,8 @@
 /include/ "qoriq-sata2-0.dtsi"
 /include/ "qoriq-sata2-1.dtsi"
 /include/ "qoriq-sec5.0-0.dtsi"
+/include/ "qoriq-qman3.dtsi"
+/include/ "qoriq-bman1.dtsi"
 /include/ "qoriq-fman3-0.dtsi"
 /include/ "qoriq-fman3-0-1g-0.dtsi"
 /include/ "qoriq-fman3-0-1g-1.dtsi"
diff --git a/arch/powerpc/boot/dts/kmcoge4.dts b/arch/powerpc/boot/dts/kmcoge4.dts
index 89b4119..77ed595 100644
--- a/arch/powerpc/boot/dts/kmcoge4.dts
+++ b/arch/powerpc/boot/dts/kmcoge4.dts
@@ -20,15 +20,55 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	memory {
 		device_type = "memory";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+                qman_fqd: qman-fqd {
+                        compatible = "fsl,qman-fqd";
+                        alloc-ranges = <0 0 0xffff 0xffffffff>;
+                        size = <0 0x400000>;
+                        alignment = <0 0x400000>;
+                        no-map;
+                        reusable;
+                };
+                qman_pfdr: qman-pfdr {
+                        compatible = "fsl,qman-pfdr";
+                        alloc-ranges = <0 0 0xffff 0xffffffff>;
+                        size = <0 0x2000000>;
+                        alignment = <0 0x2000000>;
+                        no-map;
+                        reusable;
+                };
+	};
+
 	dcsr: dcsr@f00000000 {
 		ranges = <0x00000000 0xf 0x00000000 0x01008000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x200000>;
+	};
+
+	qportals: qman-portals@ff4200000 {
+		ranges = <0x0 0xf 0xf4200000 0x200000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/oca4080.dts b/arch/powerpc/boot/dts/oca4080.dts
index 3d4c751..60c9b0a 100644
--- a/arch/powerpc/boot/dts/oca4080.dts
+++ b/arch/powerpc/boot/dts/oca4080.dts
@@ -44,15 +44,55 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	memory {
 		device_type = "memory";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+                qman_fqd: qman-fqd {
+                        compatible = "fsl,qman-fqd";
+                        alloc-ranges = <0 0 0xffff 0xffffffff>;
+                        size = <0 0x400000>;
+                        alignment = <0 0x400000>;
+                        no-map;
+                        reusable;
+                };
+                qman_pfdr: qman-pfdr {
+                        compatible = "fsl,qman-pfdr";
+                        alloc-ranges = <0 0 0xffff 0xffffffff>;
+                        size = <0 0x2000000>;
+                        alignment = <0 0x2000000>;
+                        no-map;
+                        reusable;
+                };
+	};
+
 	dcsr: dcsr@f00000000 {
 		ranges = <0x00000000 0xf 0x00000000 0x01008000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x200000>;
+	};
+
+	qportals: qman-portals@ff4200000 {
+		ranges = <0x0 0xf 0xf4200000 0x200000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/p1023rdb.dts b/arch/powerpc/boot/dts/p1023rdb.dts
index d121bda..9335896 100644
--- a/arch/powerpc/boot/dts/p1023rdb.dts
+++ b/arch/powerpc/boot/dts/p1023rdb.dts
@@ -1,7 +1,7 @@
 /*
  * P1023 RDB Device Tree Source
  *
- *    Copyright 2013 Freescale Semiconductor Inc.
+ * Copyright 2013 - 2014 Freescale Semiconductor Inc.
  *
  * Author: Chunhe Lan <Chunhe.Lan@freescale.com>
  *
@@ -42,11 +42,51 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	memory {
 		device_type = "memory";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
+
+	qportals: qman-portals@ff000000 {
+		ranges = <0x0 0xf 0xff000000 0x200000>;
+	};
+
+	bportals: bman-portals@ff200000 {
+		ranges = <0x0 0xf 0xff200000 0x200000>;
+	};
+
 	soc: soc@ff600000 {
 		ranges = <0x0 0x0 0xff600000 0x200000>;
 
@@ -247,7 +287,6 @@
 				  0x0 0x100000>;
 		};
 	};
-
 };
 
 /include/ "fsl/p1023si-post.dtsi"
diff --git a/arch/powerpc/boot/dts/p2041rdb.dts b/arch/powerpc/boot/dts/p2041rdb.dts
index 1060716..15821f8 100644
--- a/arch/powerpc/boot/dts/p2041rdb.dts
+++ b/arch/powerpc/boot/dts/p2041rdb.dts
@@ -1,7 +1,7 @@
 /*
  * P2041RDB Device Tree Source
  *
- * Copyright 2011 Freescale Semiconductor Inc.
+ * Copyright 2011 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -40,6 +40,7 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	aliases {
 		phy_rgmii_0 = &phy_rgmii_0;
@@ -58,10 +59,49 @@
 		device_type = "memory";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
+
 	dcsr: dcsr@f00000000 {
 		ranges = <0x00000000 0xf 0x00000000 0x01008000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x200000>;
+	};
+
+	qportals: qman-portals@ff4200000 {
+		ranges = <0x0 0xf 0xf4200000 0x200000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/p3041ds.dts b/arch/powerpc/boot/dts/p3041ds.dts
index 253d01b..813213f 100644
--- a/arch/powerpc/boot/dts/p3041ds.dts
+++ b/arch/powerpc/boot/dts/p3041ds.dts
@@ -1,7 +1,7 @@
 /*
  * P3041DS Device Tree Source
  *
- * Copyright 2010-2011 Freescale Semiconductor Inc.
+ * Copyright 2010 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -40,6 +40,7 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	aliases{
 		phy_rgmii_0 = &phy_rgmii_0;
@@ -59,10 +60,49 @@
 		device_type = "memory";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
+
 	dcsr: dcsr@f00000000 {
 		ranges = <0x00000000 0xf 0x00000000 0x01008000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x200000>;
+	};
+
+	qportals: qman-portals@ff4200000 {
+		ranges = <0x0 0xf 0xf4200000 0x200000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/p4080ds.dts b/arch/powerpc/boot/dts/p4080ds.dts
index f6b4923..7a93b9e 100644
--- a/arch/powerpc/boot/dts/p4080ds.dts
+++ b/arch/powerpc/boot/dts/p4080ds.dts
@@ -1,7 +1,7 @@
 /*
  * P4080DS Device Tree Source
  *
- * Copyright 2009-2011 Freescale Semiconductor Inc.
+ * Copyright 2009 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -40,6 +40,7 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	aliases {
 		phy_rgmii = &phyrgmii;
@@ -59,10 +60,49 @@
 		device_type = "memory";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
+
 	dcsr: dcsr@f00000000 {
 		ranges = <0x00000000 0xf 0x00000000 0x01008000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x200000>;
+	};
+
+	qportals: qman-portals@ff4200000 {
+		ranges = <0x0 0xf 0xf4200000 0x200000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/p5020ds.dts b/arch/powerpc/boot/dts/p5020ds.dts
index 981f5df..b2ec893 100644
--- a/arch/powerpc/boot/dts/p5020ds.dts
+++ b/arch/powerpc/boot/dts/p5020ds.dts
@@ -1,7 +1,7 @@
 /*
  * P5020DS Device Tree Source
  *
- * Copyright 2010-2011 Freescale Semiconductor Inc.
+ * Copyright 2010 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -40,6 +40,7 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	aliases {
 		phy_rgmii_0 = &phy_rgmii_0;
@@ -59,10 +60,49 @@
 		device_type = "memory";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
+
 	dcsr: dcsr@f00000000 {
 		ranges = <0x00000000 0xf 0x00000000 0x01008000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x200000>;
+	};
+
+	qportals: qman-portals@ff4200000 {
+		ranges = <0x0 0xf 0xf4200000 0x200000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/p5040ds.dts b/arch/powerpc/boot/dts/p5040ds.dts
index a5be79d..1e4d88a 100644
--- a/arch/powerpc/boot/dts/p5040ds.dts
+++ b/arch/powerpc/boot/dts/p5040ds.dts
@@ -1,7 +1,7 @@
 /*
  * P5040DS Device Tree Source
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -40,6 +40,7 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	memory {
 		device_type = "memory";
@@ -73,10 +74,49 @@
 		hydra_xg_slot2 = &hydra_xg_slot2;
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
+
 	dcsr: dcsr@f00000000 {
 		ranges = <0x00000000 0xf 0x00000000 0x01008000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x200000>;
+	};
+
+	qportals: qman-portals@ff4200000 {
+		ranges = <0x0 0xf 0xf4200000 0x200000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/t104xqds.dtsi b/arch/powerpc/boot/dts/t104xqds.dtsi
index 234f4b5..57ed431 100644
--- a/arch/powerpc/boot/dts/t104xqds.dtsi
+++ b/arch/powerpc/boot/dts/t104xqds.dtsi
@@ -1,7 +1,7 @@
 /*
  * T104xQDS Device Tree Source
  *
- * Copyright 2013 Freescale Semiconductor Inc.
+ * Copyright 2013 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -37,6 +37,38 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
 
 	ifc: localbus@ffe124000 {
 		reg = <0xf 0xfe124000 0 0x2000>;
@@ -77,6 +109,14 @@
 		ranges = <0x00000000 0xf 0x00000000 0x01072000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x2000000>;
+	};
+
+	qportals: qman-portals@ff6000000 {
+		ranges = <0x0 0xf 0xf6000000 0x2000000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/t104xrdb.dtsi b/arch/powerpc/boot/dts/t104xrdb.dtsi
index 1cf0f3c..9f6b58b 100644
--- a/arch/powerpc/boot/dts/t104xrdb.dtsi
+++ b/arch/powerpc/boot/dts/t104xrdb.dtsi
@@ -33,6 +33,38 @@
  */
 
 / {
+	reserved-ranges;
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
 
 	ifc: localbus@ffe124000 {
 		reg = <0xf 0xfe124000 0 0x2000>;
@@ -69,6 +101,14 @@
 		ranges = <0x00000000 0xf 0x00000000 0x01072000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x2000000>;
+	};
+
+	qportals: qman-portals@ff6000000 {
+		ranges = <0x0 0xf 0xf6000000 0x2000000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/t208xqds.dtsi b/arch/powerpc/boot/dts/t208xqds.dtsi
index 555dc6e..598a781 100644
--- a/arch/powerpc/boot/dts/t208xqds.dtsi
+++ b/arch/powerpc/boot/dts/t208xqds.dtsi
@@ -1,7 +1,7 @@
 /*
  * T2080/T2081 QDS Device Tree Source
  *
- * Copyright 2013 Freescale Semiconductor Inc.
+ * Copyright 2013 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -38,6 +38,38 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
 
 	ifc: localbus@ffe124000 {
 		reg = <0xf 0xfe124000 0 0x2000>;
@@ -78,6 +110,14 @@
 		ranges = <0x00000000 0xf 0x00000000 0x01072000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x2000000>;
+	};
+
+	qportals: qman-portals@ff6000000 {
+		ranges = <0x0 0xf 0xf6000000 0x2000000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/t208xrdb.dtsi b/arch/powerpc/boot/dts/t208xrdb.dtsi
index 1481e19..ebe1c61 100644
--- a/arch/powerpc/boot/dts/t208xrdb.dtsi
+++ b/arch/powerpc/boot/dts/t208xrdb.dtsi
@@ -38,6 +38,38 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
 
 	ifc: localbus@ffe124000 {
 		reg = <0xf 0xfe124000 0 0x2000>;
@@ -79,6 +111,14 @@
 		ranges = <0x00000000 0xf 0x00000000 0x01072000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x2000000>;
+	};
+
+	qportals: qman-portals@ff6000000 {
+		ranges = <0x0 0xf 0xf6000000 0x2000000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/t4240qds.dts b/arch/powerpc/boot/dts/t4240qds.dts
index e9f528c..4c57324 100644
--- a/arch/powerpc/boot/dts/t4240qds.dts
+++ b/arch/powerpc/boot/dts/t4240qds.dts
@@ -1,7 +1,7 @@
 /*
  * T4240QDS Device Tree Source
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -40,6 +40,7 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	aliases{
 		phy_rgmii1 = &phyrgmii1;
@@ -288,10 +289,49 @@
 		device_type = "memory";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+		qman_fqd: qman-fqd {
+			compatible = "fsl,qman-fqd";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x400000>;
+			alignment = <0 0x400000>;
+			no-map;
+			reusable;
+		};
+		qman_pfdr: qman-pfdr {
+			compatible = "fsl,qman-pfdr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x2000000>;
+			alignment = <0 0x2000000>;
+			no-map;
+			reusable;
+		};
+	};
+
 	dcsr: dcsr@f00000000 {
 		ranges = <0x00000000 0xf 0x00000000 0x01072000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x2000000>;
+	};
+
+	qportals: qman-portals@ff6000000 {
+		ranges = <0x0 0xf 0xf6000000 0x2000000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
diff --git a/arch/powerpc/boot/dts/t4240rdb.dts b/arch/powerpc/boot/dts/t4240rdb.dts
index 53761d4..69f5e91 100644
--- a/arch/powerpc/boot/dts/t4240rdb.dts
+++ b/arch/powerpc/boot/dts/t4240rdb.dts
@@ -40,6 +40,7 @@
 	#address-cells = <2>;
 	#size-cells = <2>;
 	interrupt-parent = <&mpic>;
+	reserved-ranges;
 
 	ifc: localbus@ffe124000 {
 		reg = <0xf 0xfe124000 0 0x2000>;
@@ -69,10 +70,49 @@
 		device_type = "memory";
 	};
 
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bman_fbpr: bman-fbpr {
+			compatible = "fsl,bman-fbpr";
+			alloc-ranges = <0 0 0xffff 0xffffffff>;
+			size = <0 0x1000000>;
+			alignment = <0 0x1000000>;
+			no-map;
+			reusable;
+		};
+                qman_fqd: qman-fqd {
+                        compatible = "fsl,qman-fqd";
+                        alloc-ranges = <0 0 0xffff 0xffffffff>;
+                        size = <0 0x400000>;
+                        alignment = <0 0x400000>;
+                        no-map;
+                        reusable;
+                };
+                qman_pfdr: qman-pfdr {
+                        compatible = "fsl,qman-pfdr";
+                        alloc-ranges = <0 0 0xffff 0xffffffff>;
+                        size = <0 0x2000000>;
+                        alignment = <0 0x2000000>;
+                        no-map;
+                        reusable;
+                };
+	};
+
 	dcsr: dcsr@f00000000 {
 		ranges = <0x00000000 0xf 0x00000000 0x01072000>;
 	};
 
+	bportals: bman-portals@ff4000000 {
+		ranges = <0x0 0xf 0xf4000000 0x2000000>;
+	};
+
+	qportals: qman-portals@ff6000000 {
+		ranges = <0x0 0xf 0xf6000000 0x2000000>;
+	};
+
 	soc: soc@ffe000000 {
 		ranges = <0x00000000 0xf 0xfe000000 0x1000000>;
 		reg = <0xf 0xfe000000 0 0x00001000>;
-- 
2.1.3

^ permalink raw reply related

* Re: [PATCH V4 7/8] powerpc, ptrace: Enable support for miscellaneous debug registers
From: Anshuman Khandual @ 2014-11-13  9:45 UTC (permalink / raw)
  To: linux-kernel, linuxppc-dev
  Cc: mikey, james.hogan, avagin, Paul.Clothier, peterz, palves, oleg,
	dhowells, tglx, davej, akpm, sukadev, davem, sam.bobroff
In-Reply-To: <1415683597-22819-8-git-send-email-khandual@linux.vnet.ibm.com>

On 11/11/2014 10:56 AM, Anshuman Khandual wrote:
> This patch enables get and set of miscellaneous debug registers through
> ptrace PTRACE_GETREGSET-PTRACE_SETREGSET interface by implementing new
> powerpc specific register set REGSET_MISC support corresponding to the
> new ELF core note NT_PPC_MISC added previously in this regard.

Right now this one does not compile for "ppc64e_defconfig" and
"pmac32_defconfig" config options. The patch below will fix it
and would be part of next revision.

diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 61a2581..be566eb 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -1326,6 +1326,7 @@ static int tm_cvmx_set(struct task_struct *target,
 }
 #endif	/* CONFIG_PPC_TRANSACTIONAL_MEM */
 
+#ifdef CONFIG_PPC64
 /*
  * get_misc_dbg
  *
@@ -1339,6 +1340,9 @@ static int tm_cvmx_set(struct task_struct *target,
  *	unsigned long ppr;
  *	unsigned long tar;
  * };
+ *
+ * The data element 'tar' will be valid only if the
+ * kernel has CONFIG_PPC_BOOK3S_64 config option enabled.
  */
 static int get_misc_dbg(struct task_struct *target,
 			const struct user_regset *regset, unsigned int pos,
@@ -1348,7 +1352,10 @@ static int get_misc_dbg(struct task_struct *target,
 
 	/* Build test */
 	BUILD_BUG_ON(TSO(dscr) + 2 * sizeof(unsigned long) != TSO(ppr));
+
+#ifdef CONFIG_PPC_BOOK3S_64
 	BUILD_BUG_ON(TSO(ppr) + sizeof(unsigned long) != TSO(tar));
+#endif
 
 	/* DSCR register */
 	ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
@@ -1362,12 +1369,14 @@ static int get_misc_dbg(struct task_struct *target,
 						sizeof(unsigned long),
 						2 * sizeof(unsigned long));
 
+#ifdef CONFIG_PPC_BOOK3S_64
 	/* TAR register */
 	if (!ret)
 		ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
 						&target->thread.tar,
 						2 * sizeof(unsigned long),
 						3 * sizeof(unsigned long));
+#endif
 	return ret;
 }
 
@@ -1384,6 +1393,9 @@ static int get_misc_dbg(struct task_struct *target,
  *	unsigned long ppr;
  *	unsigned long tar;
  * };
+ *
+ * The data element 'tar' will be valid only if the
+ * kernel has CONFIG_PPC_BOOK3S_64 config option enabled.
  */
 static int set_misc_dbg(struct task_struct *target,
 			const struct user_regset *regset, unsigned int pos,
@@ -1394,7 +1406,10 @@ static int set_misc_dbg(struct task_struct *target,
 
 	/* Build test */
 	BUILD_BUG_ON(TSO(dscr) + 2 * sizeof(unsigned long) != TSO(ppr));
+
+#ifdef CONFIG_PPC_BOOK3S_64
 	BUILD_BUG_ON(TSO(ppr) + sizeof(unsigned long) != TSO(tar));
+#endif
 
 	/* DSCR register */
 	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
@@ -1407,15 +1422,17 @@ static int set_misc_dbg(struct task_struct *target,
 						&target->thread.ppr,
 						sizeof(unsigned long),
 						2 * sizeof(unsigned long));
-
+#ifdef CONFIG_PPC_BOOK3S_64
 	/* TAR register */
 	if (!ret)
 		ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
 						&target->thread.tar,
 						2 * sizeof(unsigned long),
 						3 * sizeof(unsigned long));
+#endif
 	return ret;
 }
+#endif /* CONFIG_PPC64 */
 
 /*
  * These are our native regset flavors.
@@ -1438,7 +1455,9 @@ enum powerpc_regset {
 	REGSET_TM_CFPR,		/* TM checkpointed FPR registers */
 	REGSET_TM_CVMX,		/* TM checkpointed VMX registers */
 #endif
+#ifdef CONFIG_PPC64
 	REGSET_MISC		/* Miscellaneous debug registers */
+#endif
 };
 
 static const struct user_regset native_regsets[] = {
@@ -1495,11 +1514,13 @@ static const struct user_regset native_regsets[] = {
 		.active = tm_cvmx_active, .get = tm_cvmx_get, .set = tm_cvmx_set
 	},
 #endif
+#ifdef CONFIG_PPC64
 	[REGSET_MISC] = {
 		.core_note_type = NT_PPC_MISC, .n = ELF_NMISCREG,
 		.size = sizeof(u64), .align = sizeof(u64),
 		.get = get_misc_dbg, .set = set_misc_dbg
 	},
+#endif
 };
 
 static const struct user_regset_view user_ppc_native_view = {

^ permalink raw reply related

* Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses
From: Benjamin Herrenschmidt @ 2014-11-13 10:56 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Neelesh Gupta, linuxppc-dev, linux-i2c
In-Reply-To: <20141113075817.GA1288@katana>

On Thu, 2014-11-13 at 08:58 +0100, Wolfram Sang wrote:

> > +#include <linux/module.h>
> > +#include <linux/kernel.h>
> > +#include <linux/slab.h>
> > +#include <linux/i2c.h>
> > +#include <linux/device.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/of.h>
> > +#include <linux/mm.h>
> > +#include <asm/opal.h>
> > +#include <asm/firmware.h>
> 
> Please sort the includes.

Ugh ? Since when do we do that ? :-)

> > +static int i2c_opal_send_request(u32 bus_id, struct opal_i2c_request *req)
> > +{
> > +	struct opal_msg msg;
> > +	int token, rc;
> > +
> > +	token = opal_async_get_token_interruptible();
> > +	if (token < 0) {
> > +		if (token != -ERESTARTSYS)
> > +			pr_err("Failed to get the async token\n");
> > +
> > +		return token;
> > +	}
> > +
> > +	rc = opal_i2c_request(token, bus_id, req);
> > +	if (rc != OPAL_ASYNC_COMPLETION) {
> > +		rc = -EIO;
> > +		goto exit;
> > +	}
> > +
> > +	rc = opal_async_wait_response(token, &msg);
> > +	if (rc) {
> > +		rc = -EIO;
> > +		goto exit;
> 
> Is it really -EIO? Maybe -ETIMEDOUT?

No, there is no timeout, if that fails something went quite wrong, it
could almost be a BUG_ON (basically we passed a wrong token or a NULL
msg).

> > +	}
> > +
> > +	rc = be64_to_cpu(msg.params[1]);
> > +	if (rc != OPAL_SUCCESS) {
> > +		rc = -EIO;
> > +		goto exit;
> > +	}
> > +
> > +exit:
> > +	opal_async_release_token(token);
> > +	return rc;
> > +}
> > +
> > +static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
> > +				int num)
> > +{
> > +	unsigned long opal_id = (unsigned long)adap->algo_data;
> > +	struct opal_i2c_request req;
> > +	int rc, i;
> > +
> > +	/* We only support fairly simple combinations here of one
> > +	 * or two messages
> > +	 */
> 
> I don't think you should offer I2C_FUNC_I2C with those limitations. Is
> there a case you really needs this?

Yes there is, and it's pretty common :-) I actually added this to
Neelesh original driver, it's the "smbus" style but with 2 bytes offset.
Typically what we need for driver such as at24. They use normal raw i2c
writes for writes but need the 2-bytes write + read combo without stop
for reads.

> > +	memset(&req, 0, sizeof(req));
> > +	switch (num) {
> > +	case 0:
> > +		return 0;
> > +	case 1:
> > +		req.type = (msgs[0].flags & I2C_M_RD) ?
> > +			OPAL_I2C_RAW_READ : OPAL_I2C_RAW_WRITE;
> > +		req.addr = cpu_to_be16(msgs[0].addr);
> > +		req.size = cpu_to_be32(msgs[0].len);
> > +		req.buffer_ra = cpu_to_be64(__pa(msgs[0].buf));
> > +		break;
> > +	case 2:
> > +		/* For two messages, we basically support only simple
> > +		 * smbus transactions of a write plus a read. We might
> > +		 * want to allow also two writes but we'd have to bounce
> > +		 * the data into a single buffer.
> > +		 */
> > +		if ((msgs[0].flags & I2C_M_RD) || !(msgs[1].flags & I2C_M_RD))
> > +			return -EIO;
> > +		if (msgs[0].len > 4)
> > +			return -EIO;
> > +		if (msgs[0].addr != msgs[1].addr)
> > +			return -EIO;
> 
> -EOPNOTSUPP? Please check Documentation/i2c/fault-codes for the error
> codes we use.

Ok.

> > +		req.type = OPAL_I2C_SM_READ;
> > +		req.addr = cpu_to_be16(msgs[0].addr);
> > +		req.subaddr_sz = msgs[0].len;
> > +		for (i = 0; i < msgs[0].len; i++)
> > +			req.subaddr = (req.subaddr << 8) | msgs[0].buf[i];
> > +		req.subaddr = cpu_to_be32(req.subaddr);
> > +		req.size = cpu_to_be32(msgs[1].len);
> > +		req.buffer_ra = cpu_to_be64(__pa(msgs[1].buf));
> > +		break;
> > +	default:
> > +		return -EIO;
> > +	}
> > +
> > +	rc = i2c_opal_send_request(opal_id, &req);
> > +	if (rc)
> > +		return rc;
> > +
> > +	return num;
> > +}
> > +
> > +static int i2c_opal_smbus_xfer(struct i2c_adapter *adap, u16 addr,
> > +			       unsigned short flags, char read_write,
> > +			       u8 command, int size, union i2c_smbus_data *data)
> > +{
> > +	unsigned long opal_id = (unsigned long)adap->algo_data;
> > +	struct opal_i2c_request req;
> > +	u8 local[2];
> > +	int rc;
> > +
> > +	memset(&req, 0, sizeof(req));
> > +
> > +	req.addr = cpu_to_be16(addr);
> > +	switch (size) {
> > +	case I2C_SMBUS_BYTE:
> > +		req.buffer_ra = cpu_to_be64(__pa(&data->byte));
> > +		req.size = cpu_to_be32(1);
> > +		/* Fall through */
> > +	case I2C_SMBUS_QUICK:
> > +		req.type = (read_write == I2C_SMBUS_READ) ?
> > +			OPAL_I2C_RAW_READ : OPAL_I2C_RAW_WRITE;
> > +		break;
> > +	case I2C_SMBUS_BYTE_DATA:
> > +		req.buffer_ra = cpu_to_be64(__pa(&data->byte));
> > +		req.size = cpu_to_be32(1);
> > +		req.subaddr = cpu_to_be32(command);
> > +		req.subaddr_sz = 1;
> > +		req.type = (read_write == I2C_SMBUS_READ) ?
> > +			OPAL_I2C_SM_READ : OPAL_I2C_SM_WRITE;
> > +		break;
> > +	case I2C_SMBUS_WORD_DATA:
> > +		if (!read_write) {
> > +			local[0] = data->word & 0xff;
> > +			local[1] = (data->word >> 8) & 0xff;
> > +		}
> > +		req.buffer_ra = cpu_to_be64(__pa(local));
> > +		req.size = cpu_to_be32(2);
> > +		req.subaddr = cpu_to_be32(command);
> > +		req.subaddr_sz = 1;
> > +		req.type = (read_write == I2C_SMBUS_READ) ?
> > +			OPAL_I2C_SM_READ : OPAL_I2C_SM_WRITE;
> > +		break;
> > +	case I2C_SMBUS_I2C_BLOCK_DATA:
> > +		req.buffer_ra = cpu_to_be64(__pa(&data->block[1]));
> > +		req.size = cpu_to_be32(data->block[0]);
> > +		req.subaddr = cpu_to_be32(command);
> > +		req.subaddr_sz = 1;
> > +		req.type = (read_write == I2C_SMBUS_READ) ?
> > +			OPAL_I2C_SM_READ : OPAL_I2C_SM_WRITE;
> > +		break;
> > +	default:
> > +		return -EINVAL;
> > +	}
> > +
> > +	rc = i2c_opal_send_request(opal_id, &req);
> > +	if (!rc && read_write && size == I2C_SMBUS_WORD_DATA) {
> > +		data->word = ((u16)local[1]) << 8;
> > +		data->word |= local[0];
> > +	}
> > +
> > +	return rc;
> > +}
> > +
> > +static u32 i2c_opal_func(struct i2c_adapter *adapter)
> > +{
> > +	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
> > +	       I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
> > +	       I2C_FUNC_SMBUS_I2C_BLOCK;
> > +}
> 
> See comment above about I2C_FUNC_I2C?

We really do need it.

> > +static const struct i2c_algorithm i2c_opal_algo = {
> > +	.master_xfer	= i2c_opal_master_xfer,
> > +	.smbus_xfer	= i2c_opal_smbus_xfer,
> > +	.functionality	= i2c_opal_func,
> > +};
> > +
> > +static int i2c_opal_probe(struct platform_device *pdev)
> > +{
> > +	struct i2c_adapter	*adapter;
> > +	const char		*pname;
> > +	u32			opal_id;
> > +	int			rc;
> > +
> > +	if (!pdev->dev.of_node)
> > +		return -ENODEV;
> 
> Can this happen? How would the match happen otherwise?

I wasn't sure we didn't have a way to force matches by hand using sysfs
like we do on pci, so better safe than sorry.

> > +	rc = of_property_read_u32(pdev->dev.of_node, "ibm,opal-id", &opal_id);
> > +	if (rc) {
> > +		dev_err(&pdev->dev, "Missing ibm,opal-id property !\n");
> > +		return -EIO;
> > +	}
> > +	adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
> 
> devm_kzalloc?

Ah, I never got the knack of using the new devm stuff, Neelesh, can you
take care of this ?

> > +	if (!adapter)
> > +		return -ENOMEM;
> > +	adapter->algo = &i2c_opal_algo;
> > +	adapter->algo_data = (void *)(unsigned long)opal_id;
> 
> double cast?

Yes, on purpose. opal_id is u32 which is an unsigned int. You need to
cast it to an unsigned long before you cast it to a pointer or you get a
warning.

> > +	adapter->dev.parent = &pdev->dev;
> > +	adapter->dev.of_node = of_node_get(pdev->dev.of_node);
> > +	pname = of_get_property(pdev->dev.of_node, "port-name", NULL);
> 
> I have never seen this binding before, it looks fishy. Where is it documented?

We made it up, like pretty every SoC vendor out there. What's fishy
about it ? It's a very good way to get fixed i2c port names on the
system, the firmware defines them.

> > +	if (pname)
> > +		strlcpy(adapter->name, pname, sizeof(adapter->name));
> > +	else
> > +		strlcpy(adapter->name, "opal", sizeof(adapter->name));
> > +
> > +	platform_set_drvdata(pdev, adapter);
> > +	rc = i2c_add_adapter(adapter);
> > +	if (rc)
> > +		dev_err(&pdev->dev, "Failed to register the i2c adapter\n");
> 
> Leaking 'adapter' here.
> 
> > +
> > +	return rc;
> > +}
> > +
> > +static int i2c_opal_remove(struct platform_device *pdev)
> > +{
> > +	struct i2c_adapter *adapter = platform_get_drvdata(pdev);
> > +
> > +	i2c_del_adapter(adapter);
> > +
> > +	kfree(adapter);
> > +
> > +	return 0;
> > +}
> > +
> > +static const struct of_device_id i2c_opal_of_match[] = {
> > +	{
> > +		.compatible = "ibm,power8-i2c-port",
> > +	},
> > +	{ }
> > +};
> > +MODULE_DEVICE_TABLE(of, i2c_opal_of_match);
> > +
> > +static struct platform_driver i2c_opal_driver = {
> > +	.probe	= i2c_opal_probe,
> > +	.remove	= i2c_opal_remove,
> > +	.driver	= {
> > +		.name		= "i2c-opal",
> > +		.owner		= THIS_MODULE,
> 
> Not needed.
> 
> > +		.of_match_table	= i2c_opal_of_match,
> > +	},
> > +};
> > +
> > +static int __init i2c_opal_init(void)
> > +{
> > +	if (!firmware_has_feature(FW_FEATURE_OPAL))
> > +		return -ENODEV;
> > +
> > +	return platform_driver_register(&i2c_opal_driver);
> > +}
> > +
> > +static void __exit i2c_opal_exit(void)
> > +{
> > +	return platform_driver_unregister(&i2c_opal_driver);
> > +}
> > +
> > +MODULE_AUTHOR("Neelesh Gupta <neelegup@linux.vnet.ibm.com>");
> > +MODULE_DESCRIPTION("IBM OPAL I2C driver");
> > +MODULE_LICENSE("GPL");
> > +
> > +module_init(i2c_opal_init);
> > +module_exit(i2c_opal_exit);
> 
> Please put thos right below the functions it references.
> 
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses
From: Benjamin Herrenschmidt @ 2014-11-13 12:40 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Neelesh Gupta, linuxppc-dev, linux-i2c
In-Reply-To: <1415876169.666.2.camel@kernel.crashing.org>

On Thu, 2014-11-13 at 21:56 +1100, Benjamin Herrenschmidt wrote:
> 
> No, there is no timeout, if that fails something went quite wrong, it
> could almost be a BUG_ON (basically we passed a wrong token or a NULL
> msg).
> 
> > > +   }
> > > +
> > > +   rc = be64_to_cpu(msg.params[1]);
> > > +   if (rc != OPAL_SUCCESS) {
> > > +           rc = -EIO;
> > > +           goto exit;
> > > +   }
> > > +

Actually, to correct myself, there are a number of error conditions
including timeouts inside the FW layer, but they are returned here, not
from opal_async_wait_response(). So indeed, we could do some error code
conversion at that point.

Neelesh, can you do that on top of your patch that adds the detailed
error codes ? We can merge it fw side tomorrow if you have a new spin,
worst case if the FW is old and only returns OPAL_HARDWARE we return
-EIO and if the FW is newer we'll have more precise error codes in Linux
too.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH] of/base: Fix PowerPC address parsing hack
From: Grant Likely @ 2014-11-13 12:44 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Stephen Rothwell, Arnd Bergmann, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linuxppc-dev, Rob Herring,
	Olof Johansson
In-Reply-To: <1415839522.5124.58.camel@kernel.crashing.org>

On Thu, Nov 13, 2014 at 12:45 AM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> What about this one instead ? I want to cache it because that function
> can be called quite a while and doing two additional property lookup
> and string compares every time might hurt some platforms.
>
> ----
>
> We have a historical hack that treats missing ranges properties as the
> equivalent of an empty one. This is needed for ancient PowerMac "bad"
> device-trees, and shouldn't be enabled for any other PowerPC platform,
> otherwise we get some nasty layout of devices in sysfs or even
> duplication when a set of otherwise identically named devices is
> created multiple times under a different parent node with no ranges
> property.
>
> This fix is needed for the PowerNV i2c busses to be exposed properly
> and will fix a number of other embedded cases.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: <stable@vger.kernel.org>

How far back does this need to go? I assume I need to get this in for v3.18.

>
> diff --git a/drivers/of/address.c b/drivers/of/address.c
> index e371825..5eae0cd 100644
> --- a/drivers/of/address.c
> +++ b/drivers/of/address.c
> @@ -403,6 +403,17 @@ static struct of_bus *of_match_bus(struct device_node *np)
>         return NULL;
>  }
>
> +static int of_empty_ranges_quirk(void)
> +{
> +       /* To save cycles, we cache the result */
> +       static int quirk_state = -1;
> +

if (IS_ENABLED(CONFIG_POWERPC)) {

> +       if (quirk_state < 0)
> +               quirk_state = of_machine_is_compatible("Power Macintosh") ||
> +                       of_machine_is_compatible("MacRISC");
> +       return quirk_state;

}
return 0;

So it gets compiled out for non powerpc.

> +}
> +
>  static int of_translate_one(struct device_node *parent, struct of_bus *bus,
>                             struct of_bus *pbus, __be32 *addr,
>                             int na, int ns, int pna, const char *rprop)
> @@ -428,12 +439,10 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
>          * This code is only enabled on powerpc. --gcl
>          */
>         ranges = of_get_property(parent, rprop, &rlen);
> -#if !defined(CONFIG_PPC)
> -       if (ranges == NULL) {
> +       if (ranges == NULL && !of_empty_ranges_quirk()) {
>                 pr_err("OF: no ranges; cannot translate\n");
>                 return 1;
>         }
> -#endif /* !defined(CONFIG_PPC) */
>         if (ranges == NULL || rlen == 0) {
>                 offset = of_read_number(addr, na);
>                 memset(addr, 0, pna * 4);
>
>

^ permalink raw reply

* Re: [PATCH] of/base: Fix PowerPC address parsing hack
From: Benjamin Herrenschmidt @ 2014-11-13 12:53 UTC (permalink / raw)
  To: Grant Likely
  Cc: Stephen Rothwell, Arnd Bergmann, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linuxppc-dev, Rob Herring,
	Olof Johansson
In-Reply-To: <CACxGe6s0CXL2oRKCLhzzycOKWJStxdZsc1pn_X8fLuAqCguBMA@mail.gmail.com>

On Thu, 2014-11-13 at 12:44 +0000, Grant Likely wrote:
> On Thu, Nov 13, 2014 at 12:45 AM, Benjamin Herrenschmidt
> <benh@kernel.crashing.org> wrote:
> > What about this one instead ? I want to cache it because that function
> > can be called quite a while and doing two additional property lookup
> > and string compares every time might hurt some platforms.
> >
> > ----
> >
> > We have a historical hack that treats missing ranges properties as the
> > equivalent of an empty one. This is needed for ancient PowerMac "bad"
> > device-trees, and shouldn't be enabled for any other PowerPC platform,
> > otherwise we get some nasty layout of devices in sysfs or even
> > duplication when a set of otherwise identically named devices is
> > created multiple times under a different parent node with no ranges
> > property.
> >
> > This fix is needed for the PowerNV i2c busses to be exposed properly
> > and will fix a number of other embedded cases.
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > CC: <stable@vger.kernel.org>
> 
> How far back does this need to go? I assume I need to get this in for v3.18.

I'd like some distro to pick it up in 3.16

> > diff --git a/drivers/of/address.c b/drivers/of/address.c
> > index e371825..5eae0cd 100644
> > --- a/drivers/of/address.c
> > +++ b/drivers/of/address.c
> > @@ -403,6 +403,17 @@ static struct of_bus *of_match_bus(struct device_node *np)
> >         return NULL;
> >  }
> >
> > +static int of_empty_ranges_quirk(void)
> > +{
> > +       /* To save cycles, we cache the result */
> > +       static int quirk_state = -1;
> > +
> 
> if (IS_ENABLED(CONFIG_POWERPC)) {
> 
> > +       if (quirk_state < 0)
> > +               quirk_state = of_machine_is_compatible("Power Macintosh") ||
> > +                       of_machine_is_compatible("MacRISC");
> > +       return quirk_state;
> 
> }
> return 0;
> 
> So it gets compiled out for non powerpc.

Yeah, I'm set in my ways, keep forgetting about all the shiny new stuff.

> > +}
> > +
> >  static int of_translate_one(struct device_node *parent, struct of_bus *bus,
> >                             struct of_bus *pbus, __be32 *addr,
> >                             int na, int ns, int pna, const char *rprop)
> > @@ -428,12 +439,10 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
> >          * This code is only enabled on powerpc. --gcl
> >          */
> >         ranges = of_get_property(parent, rprop, &rlen);
> > -#if !defined(CONFIG_PPC)
> > -       if (ranges == NULL) {
> > +       if (ranges == NULL && !of_empty_ranges_quirk()) {
> >                 pr_err("OF: no ranges; cannot translate\n");
> >                 return 1;
> >         }
> > -#endif /* !defined(CONFIG_PPC) */
> >         if (ranges == NULL || rlen == 0) {
> >                 offset = of_read_number(addr, na);
> >                 memset(addr, 0, pna * 4);
> >
> >
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses
From: Wolfram Sang @ 2014-11-13 13:10 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Neelesh Gupta, linuxppc-dev, linux-i2c
In-Reply-To: <1415876169.666.2.camel@kernel.crashing.org>

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


> > Please sort the includes.
> 
> Ugh ? Since when do we do that ? :-)

Since I realised it is more readable and reduces likeliness of
duplicated includes.

> > > +	rc = opal_i2c_request(token, bus_id, req);
> > > +	if (rc != OPAL_ASYNC_COMPLETION) {
> > > +		rc = -EIO;
> > > +		goto exit;
> > > +	}
> > > +
> > > +	rc = opal_async_wait_response(token, &msg);
> > > +	if (rc) {
> > > +		rc = -EIO;
> > > +		goto exit;
> > 
> > Is it really -EIO? Maybe -ETIMEDOUT?
> 
> No, there is no timeout, if that fails something went quite wrong, it
> could almost be a BUG_ON (basically we passed a wrong token or a NULL
> msg).

OK. I'd think it at least makes sense to use error codes which
distinguish I2C bus errors from OPAL interface errors. Always using -EIO
seems very generic :)

> > I don't think you should offer I2C_FUNC_I2C with those limitations. Is
> > there a case you really needs this?
> 
> Yes there is, and it's pretty common :-) I actually added this to
> Neelesh original driver, it's the "smbus" style but with 2 bytes offset.
> Typically what we need for driver such as at24. They use normal raw i2c
> writes for writes but need the 2-bytes write + read combo without stop
> for reads.

Understood. So, basically something like I2C_SMBUS_WORD_I2C_BLOCK_DATA
is missing where the 'command' argument is not u8 but u16? Brainstorming
here, not relevant for this driver now.

> > > +	adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
> > 
> > devm_kzalloc?
> 
> Ah, I never got the knack of using the new devm stuff, Neelesh, can you
> take care of this ?

New? :D This would be a dead simple exercise to learn about it ;)

> 
> > > +	adapter->dev.parent = &pdev->dev;
> > > +	adapter->dev.of_node = of_node_get(pdev->dev.of_node);
> > > +	pname = of_get_property(pdev->dev.of_node, "port-name", NULL);
> > 
> > I have never seen this binding before, it looks fishy. Where is it documented?
> 
> We made it up, like pretty every SoC vendor out there. What's fishy
> about it ? It's a very good way to get fixed i2c port names on the
> system, the firmware defines them.

But the SoC vendors prefix it with their company name and add
documentation for the binding.

Furthermore, this is just wrong, too. The adapter name is the name of
the IP core or chip or whatever which does the I2C bus. It is not the
functional name of the bus. It should be plain "Opal I2C" or similar.

Regards,

   Wolfram

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH] powerpc/powernv: Support OPAL requested heartbeat
From: Paul Clarke @ 2014-11-13 16:59 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev; +Cc: Jeremy Kerr
In-Reply-To: <1415772194.5124.37.camel@kernel.crashing.org>

On 11/12/2014 12:03 AM, Benjamin Herrenschmidt wrote:
> If OPAL requests it, call it back via opal_poll_events() at a
> regular interval. Some versions of OPAL on some machines require
> this to operate some internal timeouts properly.

I don't see any reason why not, but wanted to ask to make sure: this 
daemon can be bound to a core, correct?  At least manually by taskset or 
similar?

It sounds a lot like the RTAS thread, which I was happy to see go away 
when running directly on OPAL, and don't want something else to take its 
place.  It was not bindable, but ran periodically on EVERY core, err 
hardware thread.

(Just looking to avoid latency blips.)

PC

^ permalink raw reply

* Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses
From: Neelesh Gupta @ 2014-11-13 18:08 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Wolfram Sang; +Cc: linuxppc-dev, linux-i2c
In-Reply-To: <1415882455.666.4.camel@kernel.crashing.org>


On 11/13/2014 06:10 PM, Benjamin Herrenschmidt wrote:
> On Thu, 2014-11-13 at 21:56 +1100, Benjamin Herrenschmidt wrote:
>> No, there is no timeout, if that fails something went quite wrong, it
>> could almost be a BUG_ON (basically we passed a wrong token or a NULL
>> msg).
>>
>>>> +   }
>>>> +
>>>> +   rc = be64_to_cpu(msg.params[1]);
>>>> +   if (rc != OPAL_SUCCESS) {
>>>> +           rc = -EIO;
>>>> +           goto exit;
>>>> +   }
>>>> +
> Actually, to correct myself, there are a number of error conditions
> including timeouts inside the FW layer, but they are returned here, not
> from opal_async_wait_response(). So indeed, we could do some error code
> conversion at that point.
>
> Neelesh, can you do that on top of your patch that adds the detailed
> error codes ? We can merge it fw side tomorrow if you have a new spin,
> worst case if the FW is old and only returns OPAL_HARDWARE we return
> -EIO and if the FW is newer we'll have more precise error codes in Linux
> too.

Yes, nice to have more precise error codes so I'm adding them in firmware
and rolling out new version of the FW. Please look at it.

Thanks,
Neelesh

>
> Cheers,
> Ben.
>
>

^ permalink raw reply

* Re: powerpc: mitigate impact of decrementer reset
From: Paul Clarke @ 2014-11-13 19:33 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: paulmck, linuxppc-dev
In-Reply-To: <1415846346.28703.1.camel@concordia>

On 11/12/2014 08:39 PM, Michael Ellerman wrote:
> On Wed, 2014-11-05 at 11:06 -0600, Paul Clarke wrote:
>> On 10/07/2014 09:52 PM, Michael Ellerman wrote:
>>> On Tue, 2014-07-10 at 19:13:24 UTC, Paul Clarke wrote:
>>>> This patch short-circuits the reset of the decrementer, exiting after
>>>> the decrementer reset, but before the housekeeping tasks if the only
>>>> need for the interrupt is simply to reset it.  After this patch,
>>>> the latency spike was measured at about 150 nanoseconds.
>>
>>> Thanks for the excellent changelog. But this patch makes me a bit nervous :)
>>>
>>> Do you know where the latency is coming from? Is it primarily the irq work?
>>
>> Yes, it is all under irq_enter (measured at ~10us) and irq_exit (~12us).
>
> Hmm, OK. I actually meant irq_work_run().
>
> AIUI irq_enter/exit() are just state tracking, they shouldn't be actually
> running work.
>
> How are you measuring it?

ftrace function_graph tracer:
--
   127.425212 |                |  .irq_enter() {
   127.425213 |                |    .rcu_irq_enter() {
   127.425213 |  + 12.206 us   |      .rcu_eqs_exit_common.isra.41();
   127.425226 |  + 12.750 us   |    }
... RCU is a big hitter
   127.425226 |                |    .vtime_common_account_irq_enter() {
   127.425226 |                |      .vtime_account_user() {
   127.425226 |    0.032 us    |        ._raw_spin_lock();
   127.425227 |    0.034 us    |        .get_vtime_delta();
   127.425227 |                |        .account_user_time() {
   127.425228 |    0.030 us    |          .cpuacct_account_field();
   127.425228 |                |          .acct_account_cputime() {
   127.425228 |    0.082 us    |            .__acct_update_integrals();
   127.425229 |    0.562 us    |          }
   127.425229 |    1.500 us    |        }
   127.425229 |    2.954 us    |      }
   127.425230 |    3.434 us    |    }
... but even accounting is not insignificant
   127.425230 |  + 17.218 us   |  }
   127.425230 |                |  /* timer_interrupt_entry: [...] */
... nothing to see here, because there's nothing to do except reset the 
decrementer
   127.425230 |                |  /* timer_interrupt_exit: [...] */
... (less than 1 us spent doing the "required" work)
   127.425231 |                |  .irq_exit() {
   127.425231 |                |    .vtime_gen_account_irq_exit() {
   127.425231 |    0.036 us    |      ._raw_spin_lock();
   127.425232 |                |      .__vtime_account_system() {
   127.425232 |    0.030 us    |        .get_vtime_delta();
   127.425232 |                |        .account_system_time() {
   127.425233 |    0.030 us    |          .cpuacct_account_field();
   127.425233 |                |          .acct_account_cputime() {
   127.425233 |    0.072 us    |            .__acct_update_integrals();
   127.425234 |    0.564 us    |          }
   127.425234 |    1.546 us    |        }
   127.425234 |    2.528 us    |      }
   127.425235 |    3.700 us    |    }
... significant accounting time
   127.425235 |    0.032 us    |    .idle_cpu();
   127.425235 |                |    .tick_nohz_irq_exit() {
   127.425236 |                |      .can_stop_full_tick() {
   127.425236 |    0.022 us    |        .sched_can_stop_tick();
   127.425236 |    0.020 us    |        .posix_cpu_timers_can_stop_tick()
   127.425237 |    0.970 us    |      }
   127.425237 |    0.082 us    |      .ktime_get();
   127.425238 |                |      .tick_nohz_stop_sched_tick() {
   127.425238 |    0.032 us    |        .timekeeping_max_deferment();
   127.425238 |                |        .get_next_timer_interrupt() {
   127.425239 |    0.038 us    |          ._raw_spin_lock();
   127.425239 |                |          .hrtimer_get_next_event() {
   127.425239 |    0.030 us    |            ._raw_spin_lock_irqsave();
   127.425240 |    0.028 us    |            ._raw_spin_unlock_irqrestore
   127.425240 |    0.984 us    |          }
   127.425241 |    1.936 us    |        }
   127.425241 |    0.032 us    |        .scheduler_tick_max_deferment();
   127.425241 |    3.438 us    |      }
   127.425242 |    5.880 us    |    }
   127.425242 |                |    .rcu_irq_exit() {
   127.425242 |    0.102 us    |      .rcu_eqs_enter_common.isra.40();
   127.425243 |    0.576 us    |    }
   127.425243 |  + 12.156 us   |  }

This one was almost 30 us total (17.218 + 12.156 = 29.374 us), just to 
reset the decrementer.

>>> If so I'd prefer if we could move the short circuit into __timer_interrupt()
>>> itself. That way we'd still have the trace points usable, and it would
>>> hopefully result in less duplicated logic.
>>
>> But irq_enter and irq_exit are called in timer_interrupt, before
>> __timer_interrupt is called.  I don't see how that helps.  The time
>> spent in __timer_interrupt is minuscule by comparison.
>
> Right, it won't help if it's irq_enter() that is causing the delay. But I was
> assuming it was irq_work_run().
>
>> Are you suggesting that irq_enter/exit be moved into __timer_interrupt
>> as well?  (I'm not sure how that would impact the existing call to
>> __timer_interrupt from tick_broadcast_ipi_handler?  And if there is no
>> impact, what's the point of separating timer_interrupt and
>> __timer_interrupt?)
>
> The point is __timer_interrupt() is called from tick_broadcast_ipi_handler(),
> which is called from smp_ipi_demux(), from icp_hv_ipi_action(), from
> __do_irq(), which has already done irq_enter() (and will do irq_exit()).

If that's the only impact, maybe an "IRQ entered" flag would suffice to 
either prevent a 2nd call to irq_enter(), or allow irq_enter to be 
"reentrant" (where it just returns if it was called and the last call 
was not paired with an irq_exit yet?  Alternatively, a new parameter to 
__timer_interrupt() which indicates the same.

PC

^ permalink raw reply

* Re: [PATCH] powerpc/powernv: Support OPAL requested heartbeat
From: Benjamin Herrenschmidt @ 2014-11-13 20:35 UTC (permalink / raw)
  To: Paul Clarke; +Cc: linuxppc-dev, Jeremy Kerr
In-Reply-To: <5464E388.6060507@us.ibm.com>

On Thu, 2014-11-13 at 10:59 -0600, Paul Clarke wrote:
> On 11/12/2014 12:03 AM, Benjamin Herrenschmidt wrote:
> > If OPAL requests it, call it back via opal_poll_events() at a
> > regular interval. Some versions of OPAL on some machines require
> > this to operate some internal timeouts properly.
> 
> I don't see any reason why not, but wanted to ask to make sure: this 
> daemon can be bound to a core, correct?  At least manually by taskset or 
> similar?

I think so... it's a kernel thread, but I haven't tried. It should be
akin to the existing khvcd.

> It sounds a lot like the RTAS thread, which I was happy to see go away 
> when running directly on OPAL, and don't want something else to take its 
> place.  It was not bindable, but ran periodically on EVERY core, err 
> hardware thread.
> 
> (Just looking to avoid latency blips.)

Right, I know where you come from. But you'll get those blips whether I
use a thread or an interrupt. Basically, I'm trying to get the HW guys
to give me a modified SLW engine image that I can use to request time by
setting up a delayed interrupt.

I'm trying to reduce the work done in there, and in fact I'm hoping to
only schedule my internal timers that rely on this (or the SLW
interrupt) for cases where we have a pending i2c or IPMI command, and
possibly only on machines without a functional external interrupt (so
lab bringup) or when accessing Centaur i2c (very very rarely).

But I do need that source of time...

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses
From: Benjamin Herrenschmidt @ 2014-11-13 20:53 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Neelesh Gupta, linuxppc-dev, linux-i2c
In-Reply-To: <20141113131014.GA8025@katana>

On Thu, 2014-11-13 at 14:10 +0100, Wolfram Sang wrote:
> > > Please sort the includes.
> > 
> > Ugh ? Since when do we do that ? :-)
> 
> Since I realised it is more readable and reduces likeliness of
> duplicated includes.

Ok, I assume alphabetical rather than Ingo's aesthetic "tree" ?

> > > > +	rc = opal_i2c_request(token, bus_id, req);
> > > > +	if (rc != OPAL_ASYNC_COMPLETION) {
> > > > +		rc = -EIO;
> > > > +		goto exit;
> > > > +	}
> > > > +
> > > > +	rc = opal_async_wait_response(token, &msg);
> > > > +	if (rc) {
> > > > +		rc = -EIO;
> > > > +		goto exit;
> > > 
> > > Is it really -EIO? Maybe -ETIMEDOUT?
> > 
> > No, there is no timeout, if that fails something went quite wrong, it
> > could almost be a BUG_ON (basically we passed a wrong token or a NULL
> > msg).
> 
> OK. I'd think it at least makes sense to use error codes which
> distinguish I2C bus errors from OPAL interface errors. Always using -EIO
> seems very generic :)

Ok, any suggestion ? We don't have a -EINTERNAL :) In any case, I'm not
too worried, the above basically cannot happen.

> > > I don't think you should offer I2C_FUNC_I2C with those limitations. Is
> > > there a case you really needs this?
> > 
> > Yes there is, and it's pretty common :-) I actually added this to
> > Neelesh original driver, it's the "smbus" style but with 2 bytes offset.
> > Typically what we need for driver such as at24. They use normal raw i2c
> > writes for writes but need the 2-bytes write + read combo without stop
> > for reads.
> 
> Understood. So, basically something like I2C_SMBUS_WORD_I2C_BLOCK_DATA
> is missing where the 'command' argument is not u8 but u16? Brainstorming
> here, not relevant for this driver now.

Yes, or a generic "N bytes command". My FW driver supports up to 4 bytes
in fact at the moment.

> > > > +	adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
> > > 
> > > devm_kzalloc?
> > 
> > Ah, I never got the knack of using the new devm stuff, Neelesh, can you
> > take care of this ?
> 
> New? :D This would be a dead simple exercise to learn about it ;)

Oh I *know* about it, it's just a habit I didn't catch ... yet :-) I'm
probably getting old and set in my ways ..... :-)

> > > > +	adapter->dev.parent = &pdev->dev;
> > > > +	adapter->dev.of_node = of_node_get(pdev->dev.of_node);
> > > > +	pname = of_get_property(pdev->dev.of_node, "port-name", NULL);
> > > 
> > > I have never seen this binding before, it looks fishy. Where is it documented?
> > 
> > We made it up, like pretty every SoC vendor out there. What's fishy
> > about it ? It's a very good way to get fixed i2c port names on the
> > system, the firmware defines them.
> 
> But the SoC vendors prefix it with their company name and add
> documentation for the binding.

Why do we need to prefix arbitrary props for a very specific device ?
When adding things to an existing more/less generic device it makes some
sense but here I don't see much point. I can whip up a "binding"
document for this adapter and make "port-name" be part of it if you
want :) In fact a better name for the property might be "bus-id"...

> Furthermore, this is just wrong, too. The adapter name is the name of
> the IP core or chip or whatever which does the I2C bus. It is not the
> functional name of the bus. It should be plain "Opal I2C" or similar.

But that really makes no sense. On one hand we have a way to get
something decent and useful out of i2c-detect -l, and on the other hand,
we get a list of N (N = 3*number of P8 chips at least) identical names
and have to go through hoops figuring out which is which ...

I don't see why we can't use the name for that... the name scheme I use
does convey both bits of information btw, I use something like:

	p8_xxxxxxxx_eypz (ex: p8_00000000_e0p0)

Where p8 means power 8 (centaur's, our memory buffers, will have
something else there), xxxxxxxx is the chip ID (identify a processor or
centaur chip uniquely in the system), y the engine number on the chip
and z the port number on the engine.

Cheers,
Ben.

> Regards,
> 
>    Wolfram

^ permalink raw reply

* Re: [PATCH 2/2] powerpc/mpc85xx: Add DPAA Q/BMan support to device tree(s)
From: Scott Wood @ 2014-11-13 21:42 UTC (permalink / raw)
  To: Emil Medve; +Cc: Poonam Aggrwal, Geoff Thorpe, linuxppc-dev, Chunhe Lan
In-Reply-To: <1415870513-10632-1-git-send-email-Emilian.Medve@Freescale.com>

On Thu, 2014-11-13 at 03:21 -0600, Emil Medve wrote:
> From: Kumar Gala <galak@kernel.crashing.org>
> 
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> Signed-off-by: Geoff Thorpe <Geoff.Thorpe@freescale.com>
> Signed-off-by: Hai-Ying Wang <Haiying.Wang@freescale.com>
> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
> Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
> Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
> Change-Id: If643fa5ba0a903aef8f5056a2c90ebecc995b760

I suspect these patches are changed quite a bit from Kumar's version...
It's good to note changes after the listed author has stopped being
involved, so they don't get the blame for anything they wouldn't have
put in there.

Why is the devicetree list not CCed?

> ---
> 
> Based on:
> 	http://patchwork.ozlabs.org/patch/407034
> 	http://patchwork.ozlabs.org/patch/407037
> 	http://patchwork.ozlabs.org/patch/407035
> 	http://patchwork.ozlabs.org/patch/407036
> 
>  arch/powerpc/boot/dts/b4qds.dtsi            |  42 +-
>  arch/powerpc/boot/dts/fsl/b4420si-post.dtsi |   2 +-
>  arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi  |   2 +-
>  arch/powerpc/boot/dts/fsl/b4860si-post.dtsi | 129 ++++++-
>  arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi  |   3 +-
>  arch/powerpc/boot/dts/fsl/b4si-post.dtsi    | 180 ++++++++-
>  arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  61 ++-
>  arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi  |   2 +-
>  arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |   9 +-
>  arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |   9 +-
>  arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |   9 +-
>  arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |   9 +-
>  arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |   9 +-
>  arch/powerpc/boot/dts/fsl/t1040si-post.dtsi | 128 ++++++-
>  arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 216 ++++++++++-
>  arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 568 +++++++++++++++++++++++++++-
>  arch/powerpc/boot/dts/kmcoge4.dts           |  40 ++
>  arch/powerpc/boot/dts/oca4080.dts           |  40 ++
>  arch/powerpc/boot/dts/p1023rdb.dts          |  43 ++-
>  arch/powerpc/boot/dts/p2041rdb.dts          |  42 +-
>  arch/powerpc/boot/dts/p3041ds.dts           |  42 +-
>  arch/powerpc/boot/dts/p4080ds.dts           |  42 +-
>  arch/powerpc/boot/dts/p5020ds.dts           |  42 +-
>  arch/powerpc/boot/dts/p5040ds.dts           |  42 +-
>  arch/powerpc/boot/dts/t104xqds.dtsi         |  42 +-
>  arch/powerpc/boot/dts/t104xrdb.dtsi         |  40 ++
>  arch/powerpc/boot/dts/t208xqds.dtsi         |  42 +-
>  arch/powerpc/boot/dts/t208xrdb.dtsi         |  40 ++
>  arch/powerpc/boot/dts/t4240qds.dts          |  42 +-
>  arch/powerpc/boot/dts/t4240rdb.dts          |  40 ++
>  30 files changed, 1930 insertions(+), 27 deletions(-)
> 
> diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
> index 6188583..48c3fb4 100644
> --- a/arch/powerpc/boot/dts/b4qds.dtsi
> +++ b/arch/powerpc/boot/dts/b4qds.dtsi
> @@ -1,7 +1,7 @@
>  /*
>   * B4420DS Device Tree Source
>   *
> - * Copyright 2012 Freescale Semiconductor, Inc.
> + * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions are met:
> @@ -38,6 +38,7 @@
>  	#address-cells = <2>;
>  	#size-cells = <2>;
>  	interrupt-parent = <&mpic>;
> +	reserved-ranges;

I don't see reserved-ranges documented anywhere, and from the code in
arch/powerpc I don't see how it has any effect when empty.

> +	reserved-memory {
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +		ranges;
> +
> +		bman_fbpr: bman-fbpr {
> +			compatible = "fsl,bman-fbpr";
> +			alloc-ranges = <0 0 0xffff 0xffffffff>;
> +			size = <0 0x1000000>;
> +			alignment = <0 0x1000000>;
> +			no-map;
> +			reusable;
> +		};
> +		qman_fqd: qman-fqd {
> +			compatible = "fsl,qman-fqd";
> +			alloc-ranges = <0 0 0xffff 0xffffffff>;
> +			size = <0 0x400000>;
> +			alignment = <0 0x400000>;
> +			no-map;
> +			reusable;
> +		};
> +		qman_pfdr: qman-pfdr {
> +			compatible = "fsl,qman-pfdr";
> +			alloc-ranges = <0 0 0xffff 0xffffffff>;
> +			size = <0 0x2000000>;
> +			alignment = <0 0x2000000>;
> +			no-map;
> +			reusable;
> +		};
> +	};

no-map and reusable don't make sense together.  How can the OS reuse the
memory if it can't map it?

no-map is burdensome (and I believe not yet implemented) on mpc85xx,
where we want to use huge TLB entries to cover all of (low) memory.  Is
it really needed?

What do we gain from specifying reusable here?  How is it actually
supposed to work?

> diff --git a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
> index 86161ae..0f56263 100644
> --- a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
> +++ b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
> @@ -1,7 +1,7 @@
>  /*
>   * B4420 Silicon/SoC Device Tree Source (post include)
>   *
> - * Copyright 2012 Freescale Semiconductor, Inc.
> + * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions are met:
> diff --git a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
> index 338af7e..f392949 100644
> --- a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
> +++ b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
> @@ -1,7 +1,7 @@
>  /*
>   * B4420 Silicon/SoC Device Tree Source (pre include)
>   *
> - * Copyright 2012 Freescale Semiconductor, Inc.
> + * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions are met:

Why are you updating the copyright year on files you didn't change?

-Scott

^ permalink raw reply

* [PATCH 1/3] powerpc/eeh: Refactor eeh_reset_pe()
From: Gavin Shan @ 2014-11-13 23:47 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Gavin Shan

The patch refactors eeh_reset_pe() in order for:

   * Varied return values for different failure cases.
   * Replace pr_err() with pr_warn() and print function name.
   * Coding style cleanup.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/eeh.c | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 2248a19..967e4a0 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -758,30 +758,37 @@ static void eeh_reset_pe_once(struct eeh_pe *pe)
 int eeh_reset_pe(struct eeh_pe *pe)
 {
 	int flags = (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE);
-	int i, rc;
+	int i, state, ret;
 
 	/* Take three shots at resetting the bus */
-	for (i=0; i<3; i++) {
+	for (i = 0; i < 3; i++) {
 		eeh_reset_pe_once(pe);
 
 		/*
 		 * EEH_PE_ISOLATED is expected to be removed after
 		 * BAR restore.
 		 */
-		rc = eeh_ops->wait_state(pe, PCI_BUS_RESET_WAIT_MSEC);
-		if ((rc & flags) == flags)
-			return 0;
+		state = eeh_ops->wait_state(pe, PCI_BUS_RESET_WAIT_MSEC);
+		if ((state & flags) == flags) {
+			ret = 0;
+			goto out;
+		}
 
-		if (rc < 0) {
-			pr_err("%s: Unrecoverable slot failure on PHB#%d-PE#%x",
+		if (state < 0) {
+			pr_warn("%s: Unrecoverable slot failure on PHB#%d-PE#%x",
 				__func__, pe->phb->global_number, pe->addr);
-			return -1;
+			ret = -ENOTRECOVERABLE;
+			goto out;
 		}
-		pr_err("EEH: bus reset %d failed on PHB#%d-PE#%x, rc=%d\n",
-			i+1, pe->phb->global_number, pe->addr, rc);
+
+		/* We might run out of credits */
+		ret = -EIO;
+		pr_warn("%s: Failure %d resetting PHB#%x-PE#%x\n (%d)\n",
+			__func__, state, pe->phb->global_number, pe->addr, (i + 1));
 	}
 
-	return -1;
+out:
+	return ret;
 }
 
 /**
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 3/3] powerpc/eeh: Recover EEH error on ownership change for BCM5719
From: Gavin Shan @ 2014-11-13 23:47 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Gavin Shan
In-Reply-To: <1415922450-29581-1-git-send-email-gwshan@linux.vnet.ibm.com>

In PCI passthrou scenario, we need simulate EEH recovery for Emulex
adapters when their ownership changes, as we did in commit 5cfb20b96
("powerpc/eeh: Emulate EEH recovery for VFIO devices"). Broadcom
BCM5719 adpaters are facing same problem and needs same cure.

Reported-by: Rajeshkumar Subramanian <rajeshkumars@in.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/eeh.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index b372bfd..f1c6b11 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -1220,6 +1220,7 @@ int eeh_unfreeze_pe(struct eeh_pe *pe, bool sw_state)
 static struct pci_device_id eeh_reset_ids[] = {
 	{ PCI_DEVICE(0x19a2, 0x0710) },	/* Emulex, BE     */
 	{ PCI_DEVICE(0x10df, 0xe220) },	/* Emulex, Lancer */
+	{ PCI_DEVICE(0x14e4, 0x1657) }, /* Broadcom BCM5719 */
 	{ 0 }
 };
 
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 2/3] powerpc/eeh: Set EEH_PE_RESET on PE reset
From: Gavin Shan @ 2014-11-13 23:47 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Gavin Shan
In-Reply-To: <1415922450-29581-1-git-send-email-gwshan@linux.vnet.ibm.com>

The patch introduces additional flag EEH_PE_RESET to indicate the
corresponding PE is under reset. In turn, the PE retrieval bakcend
on PowerNV platform can return unfrozen state for the EEH core to
moving forward. Flag EEH_PE_CFG_BLOCKED isn't the correct one for
the purpose.

In PCI passthrou case, the problem is more worse: Guest doesn't
recover 6th EEH error. The PE is left in isolated (frozen) and
config blocked state on Broadcom adapters. We can't retrieve the
PE's state correctly any more, even from the host side via sysfs
/sys/bus/pci/devices/xxx/eeh_pe_state.

Reported-by: Rajeshkumar Subramanian <rajeshkumars@in.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/eeh.h            |  1 +
 arch/powerpc/kernel/eeh.c                 |  4 ++++
 arch/powerpc/kernel/eeh_driver.c          | 10 ++--------
 arch/powerpc/platforms/powernv/eeh-ioda.c |  2 +-
 4 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index ca07f9c..2e633b4 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -72,6 +72,7 @@ struct device_node;
 #define EEH_PE_ISOLATED		(1 << 0)	/* Isolated PE		*/
 #define EEH_PE_RECOVERING	(1 << 1)	/* Recovering PE	*/
 #define EEH_PE_CFG_BLOCKED	(1 << 2)	/* Block config access	*/
+#define EEH_PE_RESET		(1 << 3)	/* PE reset in progress */
 
 #define EEH_PE_KEEP		(1 << 8)	/* Keep PE on hotplug	*/
 #define EEH_PE_CFG_RESTRICTED	(1 << 9)	/* Block config on error */
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 967e4a0..b372bfd 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -760,6 +760,9 @@ int eeh_reset_pe(struct eeh_pe *pe)
 	int flags = (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE);
 	int i, state, ret;
 
+	/* Mark as reset and block config space */
+	eeh_pe_state_mark(pe, EEH_PE_RESET | EEH_PE_CFG_BLOCKED);
+
 	/* Take three shots at resetting the bus */
 	for (i = 0; i < 3; i++) {
 		eeh_reset_pe_once(pe);
@@ -788,6 +791,7 @@ int eeh_reset_pe(struct eeh_pe *pe)
 	}
 
 out:
+	eeh_pe_state_clear(pe, EEH_PE_RESET | EEH_PE_CFG_BLOCKED);
 	return ret;
 }
 
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index 6535936..b17e793 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -528,13 +528,11 @@ int eeh_pe_reset_and_recover(struct eeh_pe *pe)
 	eeh_pe_dev_traverse(pe, eeh_report_error, &result);
 
 	/* Issue reset */
-	eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
 	ret = eeh_reset_pe(pe);
 	if (ret) {
-		eeh_pe_state_clear(pe, EEH_PE_RECOVERING | EEH_PE_CFG_BLOCKED);
+		eeh_pe_state_clear(pe, EEH_PE_RECOVERING);
 		return ret;
 	}
-	eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
 
 	/* Unfreeze the PE */
 	ret = eeh_clear_pe_frozen_state(pe, true);
@@ -601,19 +599,15 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
 	 * config accesses. So we prefer to block them. However, controlled
 	 * PCI config accesses initiated from EEH itself are allowed.
 	 */
-	eeh_pe_state_mark(pe, EEH_PE_CFG_BLOCKED);
 	rc = eeh_reset_pe(pe);
-	if (rc) {
-		eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
+	if (rc)
 		return rc;
-	}
 
 	pci_lock_rescan_remove();
 
 	/* Restore PE */
 	eeh_ops->configure_bridge(pe);
 	eeh_pe_restore_bars(pe);
-	eeh_pe_state_clear(pe, EEH_PE_CFG_BLOCKED);
 
 	/* Clear frozen state */
 	rc = eeh_clear_pe_frozen_state(pe, false);
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index eba9cb1..426814a 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -373,7 +373,7 @@ static int ioda_eeh_get_pe_state(struct eeh_pe *pe)
 	 * moving forward, we have to return operational
 	 * state during PE reset.
 	 */
-	if (pe->state & EEH_PE_CFG_BLOCKED) {
+	if (pe->state & EEH_PE_RESET) {
 		result = (EEH_STATE_MMIO_ACTIVE  |
 			  EEH_STATE_DMA_ACTIVE   |
 			  EEH_STATE_MMIO_ENABLED |
-- 
1.8.3.2

^ permalink raw reply related

* Re: [PATCH v2] drivers/char/ipmi: Add powernv IPMI driver
From: Corey Minyard @ 2014-11-14  1:42 UTC (permalink / raw)
  To: Jeremy Kerr, linuxppc-dev, openipmi-developer; +Cc: Michael Ellerman
In-Reply-To: <1415778065.431549.108606915276.1.gpush@pablo>

This looks good.  Can this go into the IPMI tree now, or does it need
work done in the PowerPC tree first?

Thanks,

-corey

On 11/12/2014 01:41 AM, Jeremy Kerr wrote:
> This change adds an initial IPMI driver for powerpc OPAL firmware. The
> interface is exposed entirely through firmware: we have two functions to
> send and receive IPMI messages, and an interrupt notification from the
> firmware to signify that a message is available.
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
>
> ---
> v2: Update for ipmi/for-next tree, add copyright header
>
> ---
>  drivers/char/ipmi/Kconfig        |    6 
>  drivers/char/ipmi/Makefile       |    1 
>  drivers/char/ipmi/ipmi_powernv.c |  307 +++++++++++++++++++++++++++++++
>  3 files changed, 314 insertions(+)
>
> diff --git a/drivers/char/ipmi/Kconfig b/drivers/char/ipmi/Kconfig
> index c1fccf4..65fb008 100644
> --- a/drivers/char/ipmi/Kconfig
> +++ b/drivers/char/ipmi/Kconfig
> @@ -72,6 +72,12 @@ config IPMI_SSIF
>  	 have a driver that must be accessed over an I2C bus instead of a
>  	 standard interface.  This module requires I2C support.
>  
> +config IPMI_POWERNV
> +       depends on PPC_POWERNV
> +       tristate 'POWERNV (OPAL firmware) IPMI interface'
> +       help
> +         Provides a driver for OPAL firmware-based IPMI interfaces.
> +
>  config IPMI_WATCHDOG
>         tristate 'IPMI Watchdog Timer'
>         help
> diff --git a/drivers/char/ipmi/Makefile b/drivers/char/ipmi/Makefile
> index 115c08d..f3ffde1 100644
> --- a/drivers/char/ipmi/Makefile
> +++ b/drivers/char/ipmi/Makefile
> @@ -8,5 +8,6 @@ obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o
>  obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o
>  obj-$(CONFIG_IPMI_SI) += ipmi_si.o
>  obj-$(CONFIG_IPMI_SSIF) += ipmi_ssif.o
> +obj-$(CONFIG_IPMI_POWERNV) += ipmi_powernv.o
>  obj-$(CONFIG_IPMI_WATCHDOG) += ipmi_watchdog.o
>  obj-$(CONFIG_IPMI_POWEROFF) += ipmi_poweroff.o
> diff --git a/drivers/char/ipmi/ipmi_powernv.c b/drivers/char/ipmi/ipmi_powernv.c
> new file mode 100644
> index 0000000..50134ec
> --- /dev/null
> +++ b/drivers/char/ipmi/ipmi_powernv.c
> @@ -0,0 +1,307 @@
> +/*
> + * PowerNV OPAL IPMI driver
> + *
> + * Copyright 2014 IBM Corp.
> + *
> + * 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.
> + */
> +
> +#define pr_fmt(fmt)        "ipmi-powernv: " fmt
> +
> +#include <linux/ipmi_smi.h>
> +#include <linux/list.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +
> +#include <asm/opal.h>
> +
> +
> +struct ipmi_smi_powernv {
> +	u64			interface_id;
> +	struct ipmi_device_id	ipmi_id;
> +	ipmi_smi_t		intf;
> +	u64			event;
> +	struct notifier_block	event_nb;
> +
> +	/**
> +	 * We assume that there can only be one outstanding request, so
> +	 * keep the pending message in cur_msg. We protect this from concurrent
> +	 * updates through send & recv calls, (and consequently opal_msg, which
> +	 * is in-use when cur_msg is set) with msg_lock
> +	 */
> +	spinlock_t		msg_lock;
> +	struct ipmi_smi_msg	*cur_msg;
> +	struct opal_ipmi_msg	*opal_msg;
> +};
> +
> +static int ipmi_powernv_start_processing(void *send_info, ipmi_smi_t intf)
> +{
> +	struct ipmi_smi_powernv *smi = send_info;
> +	smi->intf = intf;
> +	return 0;
> +}
> +
> +static void send_error_reply(struct ipmi_smi_powernv *smi,
> +		struct ipmi_smi_msg *msg, u8 completion_code)
> +{
> +	msg->rsp[0] = msg->data[0] | 0x4;
> +	msg->rsp[1] = msg->data[1];
> +	msg->rsp[2] = completion_code;
> +	msg->rsp_size = 3;
> +	ipmi_smi_msg_received(smi->intf, msg);
> +}
> +
> +static void ipmi_powernv_send(void *send_info, struct ipmi_smi_msg *msg)
> +{
> +	struct ipmi_smi_powernv *smi = send_info;
> +	struct opal_ipmi_msg *opal_msg;
> +	unsigned long flags;
> +	int comp, rc;
> +	size_t size;
> +
> +	/* ensure data_len will fit in the opal_ipmi_msg buffer... */
> +	if (msg->data_size > IPMI_MAX_MSG_LENGTH) {
> +		comp = IPMI_REQ_LEN_EXCEEDED_ERR;
> +		goto err;
> +	}
> +
> +	/* ... and that we at least have netfn and cmd bytes */
> +	if (msg->data_size < 2) {
> +		comp = IPMI_REQ_LEN_INVALID_ERR;
> +		goto err;
> +	}
> +
> +	spin_lock_irqsave(&smi->msg_lock, flags);
> +
> +	if (smi->cur_msg) {
> +		comp = IPMI_NODE_BUSY_ERR;
> +		goto err_unlock;
> +	}
> +
> +	/* format our data for the OPAL API */
> +	opal_msg = smi->opal_msg;
> +	opal_msg->version = OPAL_IPMI_MSG_FORMAT_VERSION_1;
> +	opal_msg->netfn = msg->data[0];
> +	opal_msg->cmd = msg->data[1];
> +	if (msg->data_size > 2)
> +		memcpy(opal_msg->data, msg->data + 2, msg->data_size - 2);
> +
> +	/* data_size already includes the netfn and cmd bytes */
> +	size = sizeof(*opal_msg) + msg->data_size - 2;
> +
> +	pr_devel("%s: opal_ipmi_send(0x%llx, %p, %ld)\n", __func__,
> +			smi->interface_id, opal_msg, size);
> +	rc = opal_ipmi_send(smi->interface_id, opal_msg, size);
> +	pr_devel("%s:  -> %d\n", __func__, rc);
> +
> +	if (!rc) {
> +		smi->cur_msg = msg;
> +		spin_unlock_irqrestore(&smi->msg_lock, flags);
> +		return;
> +	}
> +
> +	comp = IPMI_ERR_UNSPECIFIED;
> +err_unlock:
> +	spin_unlock_irqrestore(&smi->msg_lock, flags);
> +err:
> +	send_error_reply(smi, msg, comp);
> +}
> +
> +static int ipmi_powernv_recv(struct ipmi_smi_powernv *smi)
> +{
> +	struct opal_ipmi_msg *opal_msg;
> +	struct ipmi_smi_msg *msg;
> +	unsigned long flags;
> +	uint64_t size;
> +	int rc;
> +
> +	pr_devel("%s: opal_ipmi_recv(%llx, msg, sz)\n", __func__,
> +			smi->interface_id);
> +
> +	spin_lock_irqsave(&smi->msg_lock, flags);
> +
> +	if (!smi->cur_msg) {
> +		pr_warn("no current message?\n");
> +		return 0;
> +	}
> +
> +	msg = smi->cur_msg;
> +	opal_msg = smi->opal_msg;
> +
> +	size = cpu_to_be64(sizeof(*opal_msg) + IPMI_MAX_MSG_LENGTH);
> +
> +	rc = opal_ipmi_recv(smi->interface_id,
> +			opal_msg,
> +			&size);
> +	size = be64_to_cpu(size);
> +	pr_devel("%s:   -> %d (size %lld)\n", __func__,
> +			rc, rc == 0 ? size : 0);
> +	if (rc) {
> +		spin_unlock_irqrestore(&smi->msg_lock, flags);
> +		ipmi_free_smi_msg(msg);
> +		return 0;
> +	}
> +
> +	if (size < sizeof(*opal_msg)) {
> +		spin_unlock_irqrestore(&smi->msg_lock, flags);
> +		pr_warn("unexpected IPMI message size %lld\n", size);
> +		return 0;
> +	}
> +
> +	if (opal_msg->version != OPAL_IPMI_MSG_FORMAT_VERSION_1) {
> +		spin_unlock_irqrestore(&smi->msg_lock, flags);
> +		pr_warn("unexpected IPMI message format (version %d)\n",
> +				opal_msg->version);
> +		return 0;
> +	}
> +
> +	msg->rsp[0] = opal_msg->netfn;
> +	msg->rsp[1] = opal_msg->cmd;
> +	if (size > sizeof(*opal_msg))
> +		memcpy(&msg->rsp[2], opal_msg->data, size - sizeof(*opal_msg));
> +	msg->rsp_size = 2 + size - sizeof(*opal_msg);
> +
> +	smi->cur_msg = NULL;
> +	spin_unlock_irqrestore(&smi->msg_lock, flags);
> +	ipmi_smi_msg_received(smi->intf, msg);
> +	return 0;
> +}
> +
> +static void ipmi_powernv_request_events(void *send_info)
> +{
> +}
> +
> +static void ipmi_powernv_set_run_to_completion(void *send_info,
> +		bool run_to_completion)
> +{
> +}
> +
> +static void ipmi_powernv_poll(void *send_info)
> +{
> +	struct ipmi_smi_powernv *smi = send_info;
> +	ipmi_powernv_recv(smi);
> +}
> +
> +static struct ipmi_smi_handlers ipmi_powernv_smi_handlers = {
> +	.owner			= THIS_MODULE,
> +	.start_processing	= ipmi_powernv_start_processing,
> +	.sender			= ipmi_powernv_send,
> +	.request_events		= ipmi_powernv_request_events,
> +	.set_run_to_completion	= ipmi_powernv_set_run_to_completion,
> +	.poll			= ipmi_powernv_poll,
> +};
> +
> +static int ipmi_opal_event(struct notifier_block *nb,
> +			  unsigned long events, void *change)
> +{
> +	struct ipmi_smi_powernv *smi = container_of(nb,
> +					struct ipmi_smi_powernv, event_nb);
> +
> +	if (events & smi->event)
> +		ipmi_powernv_recv(smi);
> +	return 0;
> +}
> +
> +static int ipmi_powernv_probe(struct platform_device *pdev)
> +{
> +	struct ipmi_smi_powernv *ipmi;
> +	struct device *dev;
> +	u32 prop;
> +	int rc;
> +
> +	if (!pdev || !pdev->dev.of_node)
> +		return -ENODEV;
> +
> +	dev = &pdev->dev;
> +
> +	ipmi = devm_kzalloc(dev, sizeof(*ipmi), GFP_KERNEL);
> +	if (!ipmi)
> +		return -ENOMEM;
> +
> +	spin_lock_init(&ipmi->msg_lock);
> +
> +	rc = of_property_read_u32(dev->of_node, "ibm,ipmi-interface-id",
> +			&prop);
> +	if (rc) {
> +		dev_warn(dev, "No interface ID property\n");
> +		goto err_free;
> +	}
> +	ipmi->interface_id = prop;
> +
> +	rc = of_property_read_u32(dev->of_node, "interrupts", &prop);
> +	if (rc) {
> +		dev_warn(dev, "No interrupts property\n");
> +		goto err_free;
> +	}
> +
> +	ipmi->event = 1ull << prop;
> +	ipmi->event_nb.notifier_call = ipmi_opal_event;
> +
> +	rc = opal_notifier_register(&ipmi->event_nb);
> +	if (rc) {
> +		dev_warn(dev, "OPAL notifier registration failed (%d)\n", rc);
> +		goto err_free;
> +	}
> +
> +	ipmi->opal_msg = devm_kmalloc(dev,
> +			sizeof(*ipmi->opal_msg) + IPMI_MAX_MSG_LENGTH,
> +			GFP_KERNEL);
> +	if (!ipmi->opal_msg) {
> +		rc = -ENOMEM;
> +		goto err_unregister;
> +	}
> +
> +	/* todo: query actual ipmi_device_id */
> +	rc = ipmi_register_smi(&ipmi_powernv_smi_handlers, ipmi,
> +			&ipmi->ipmi_id, dev, 0);
> +	if (rc) {
> +		dev_warn(dev, "IPMI SMI registration failed (%d)\n", rc);
> +		goto err_free_msg;
> +	}
> +
> +	dev_set_drvdata(dev, ipmi);
> +	return 0;
> +
> +err_free_msg:
> +	devm_kfree(dev, ipmi->opal_msg);
> +err_unregister:
> +	opal_notifier_unregister(&ipmi->event_nb);
> +err_free:
> +	devm_kfree(dev, ipmi);
> +	return rc;
> +}
> +
> +static int ipmi_powernv_remove(struct platform_device *pdev)
> +{
> +	struct ipmi_smi_powernv *smi = dev_get_drvdata(&pdev->dev);
> +	ipmi_unregister_smi(smi->intf);
> +	opal_notifier_unregister(&smi->event_nb);
> +	return 0;
> +}
> +
> +static const struct of_device_id ipmi_powernv_match[] = {
> +	{ .compatible = "ibm,opal-ipmi" },
> +	{ },
> +};
> +
> +
> +static struct platform_driver powernv_ipmi_driver = {
> +	.driver = {
> +		.name		= "ipmi-powernv",
> +		.owner		= THIS_MODULE,
> +		.of_match_table	= ipmi_powernv_match,
> +	},
> +	.probe	= ipmi_powernv_probe,
> +	.remove	= ipmi_powernv_remove,
> +};
> +
> +
> +module_platform_driver(powernv_ipmi_driver);
> +
> +MODULE_DEVICE_TABLE(of, ipmi_powernv_match);
> +MODULE_DESCRIPTION("powernv IPMI driver");
> +MODULE_AUTHOR("Jeremy Kerr <jk@ozlabs.org>");
> +MODULE_LICENSE("GPL");

^ permalink raw reply

* Re: [PATCH v2] drivers/char/ipmi: Add powernv IPMI driver
From: Jeremy Kerr @ 2014-11-14  2:00 UTC (permalink / raw)
  To: minyard, linuxppc-dev, openipmi-developer; +Cc: Michael Ellerman
In-Reply-To: <54655DFE.6080503@acm.org>

Hi Corey,

> This looks good.  Can this go into the IPMI tree now, or does it need
> work done in the PowerPC tree first?

The 1/2 patch is already in the powerpc tree - but to ensure that we hit
Linus' tree in the right order, Michael has suggested that you merge his
topic branch (which only has that one change):


https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/log/?h=topic/opal-ipmi

- then apply the patch. This way, whichever tree Linus pulls first will
have the changes in the correct order.

Cheers,


Jeremy

^ permalink raw reply

* Re: [PATCH v2] drivers/char/ipmi: Add powernv IPMI driver
From: Michael Ellerman @ 2014-11-14  2:04 UTC (permalink / raw)
  To: minyard; +Cc: openipmi-developer, linuxppc-dev, Jeremy Kerr
In-Reply-To: <54655DFE.6080503@acm.org>

On Thu, 2014-11-13 at 19:42 -0600, Corey Minyard wrote:
> This looks good.  Can this go into the IPMI tree now, or does it need
> work done in the PowerPC tree first?

You need to merge this first:

  https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/log/?h=topic/opal-ipmi

ie.

  $ git fetch git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux.git topic/opal-ipmi
  $ git merge FETCH_HEAD

cheers

^ permalink raw reply

* Re: [PATCH] powerpc/powernv: Support OPAL requested heartbeat
From: Alistair Popple @ 2014-11-14  3:01 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Jeremy Kerr, linuxppc-dev
In-Reply-To: <1415772194.5124.37.camel@kernel.crashing.org>

Hi Ben,

On Wed, 12 Nov 2014 17:03:14 Benjamin Herrenschmidt wrote:

<snip>

> +
> +static int kopald(void *unused)
> +{
> +	set_freezable();
> +	do {
> +		try_to_freeze();
> +		opal_poll_events(NULL);

Do we need to check for outstanding events (and call opal_do_notifier)? The 
Linux OPAL-IPMI interface signals an event which the interrupt handler 
(opal_interrupt) checks for, but if interrupts aren't functional no event will 
be signalled and hence the Linux IPMI layer won't get a response.

It's probably only an issue for lab bring up though as I would expect 
interrupts to generally be working...

> +		msleep_interruptible(opal_heartbeat);
> +	} while (!kthread_should_stop());
> +
> +	return 0;
> +}
> +

Regards,

Alistair

^ permalink raw reply

* Re: [PATCH] powerpc/powernv: Support OPAL requested heartbeat
From: Benjamin Herrenschmidt @ 2014-11-14  4:26 UTC (permalink / raw)
  To: Alistair Popple; +Cc: linuxppc-dev, linuxppc-dev, Jeremy Kerr
In-Reply-To: <40458133.nYBXtuXJmS@mexican>

On Fri, 2014-11-14 at 14:01 +1100, Alistair Popple wrote:
> Hi Ben,
> 
> On Wed, 12 Nov 2014 17:03:14 Benjamin Herrenschmidt wrote:
> 
> <snip>
> 
> > +
> > +static int kopald(void *unused)
> > +{
> > +	set_freezable();
> > +	do {
> > +		try_to_freeze();
> > +		opal_poll_events(NULL);
> 
> Do we need to check for outstanding events (and call opal_do_notifier)? The 
> Linux OPAL-IPMI interface signals an event which the interrupt handler 
> (opal_interrupt) checks for, but if interrupts aren't functional no event will 
> be signalled and hence the Linux IPMI layer won't get a response.
> 
> It's probably only an issue for lab bring up though as I would expect 
> interrupts to generally be working...

Well, it would somewhat double up with the OCC interrupt ... OPAL will
sent a local OCC interrupt if we change the event mask as a result of a
call that isn't opal_handle_interrupts() ... but yes, I suppose if that
doesn't work either... though this is not known to be problematic unless
the external one.

> > +		msleep_interruptible(opal_heartbeat);
> > +	} while (!kthread_should_stop());
> > +
> > +	return 0;
> > +}
> > +
> 
> Regards,
> 
> Alistair

^ permalink raw reply

* [PATCH v2] powerpc/powernv: Support OPAL requested heartbeat
From: Benjamin Herrenschmidt @ 2014-11-14  5:13 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Jeremy Kerr

If OPAL requests it, call it back via opal_poll_events() at a
regular interval. Some versions of OPAL on some machines require
this to operate some internal timeouts properly.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

V2. Change device-tree property to "ibm,heartbeat-ms"

 arch/powerpc/platforms/powernv/opal.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index fc2d26a..1ad82ca 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -22,6 +22,8 @@
 #include <linux/kobject.h>
 #include <linux/delay.h>
 #include <linux/memblock.h>
+#include <linux/kthread.h>
+#include <linux/freezer.h>
 
 #include <asm/machdep.h>
 #include <asm/opal.h>
@@ -58,6 +60,7 @@ static struct atomic_notifier_head opal_msg_notifier_head[OPAL_MSG_TYPE_MAX];
 static DEFINE_SPINLOCK(opal_notifier_lock);
 static uint64_t last_notified_mask = 0x0ul;
 static atomic_t opal_notifier_hold = ATOMIC_INIT(0);
+static uint32_t opal_heartbeat;
 
 static void opal_reinit_cores(void)
 {
@@ -687,6 +690,29 @@ static void opal_request_interrupts(void)
 	}
 }
 
+static int kopald(void *unused)
+{
+	set_freezable();
+	do {
+		try_to_freeze();
+		opal_poll_events(NULL);
+		msleep_interruptible(opal_heartbeat);
+	} while (!kthread_should_stop());
+
+	return 0;
+}
+
+static void opal_init_heartbeat(void)
+{
+	/* Old firwmware, we assume the HVC heartbeat is sufficient */
+	if (of_property_read_u32(opal_node, "ibm,heartbeat-ms",
+				 &opal_heartbeat) != 0)
+		opal_heartbeat = 0;
+
+	if (opal_heartbeat)
+		kthread_run(kopald, NULL, "kopald");
+}
+
 static int __init opal_init(void)
 {
 	int rc;
@@ -703,6 +729,9 @@ static int __init opal_init(void)
 	/* Create i2c platform devices */
 	opal_i2c_create_devs();
 
+	/* Setup a heatbeat thread if requested by OPAL */
+	opal_init_heartbeat();
+
 	/* Register OPAL interrupts */
 	opal_request_interrupts();
 
@@ -723,6 +752,7 @@ static int __init opal_init(void)
 		opal_msglog_init();
 	}
 
+	/* Initialize OPAL IPMI backend */
 	opal_ipmi_init(opal_node);
 
 	return 0;

^ permalink raw reply related


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