Does Dev Tree WORK with soc@y_xxxx_0000 <#address/size> = <2/1>
A message that is not in the archive (sent off-list or not yet received): [email protected]
I am sorry, but I've butted my head against a tree for over a=20 week and some things just aren't making sense...especially how the prom parse code is working to exact / resolve physical=20 addresses to then ioremap...
a) Setup, I have a working MPC8548E board using 2.6.23.8 (ARCH=3Dppc) with PHYS/PTE_64BIT enabled (with the proper patches)).
b) Goal: we want to move our board to a generic 2.6.23 version that=20 Freescale has produced to support the MPC8572DS (and eventually=20 use that kernel to build our BSP for our next board).
c) I have successfully gotten to work a pure '32-bit' dev tree=20 (PHYS/PTE_64BIT not defined - and the CCSRBAR @ 0xE000_0000)
The #address/#size <1/1> is '1' (as well as the #size is '1')
d) I have modified this dev tree to support the 36bit mode addressing (with the CCSRBAR and PCIExpress defined to in the last 4Gig (instead
of the default first 4Gig - e.g.: 0xC_E000_0000)...
e) I then set the soc to have #address-cells to '2' (#size-cells is '1') (and added the additional values accordingly to the ranges...=09
f) The prom_parse code has a problem with translating these addresses
The main question is: has anyone ever tested this with soc #address/size being <2/1> in this fashion?
I am more than happy to send my text dev tree - but I don't want to clog up the group with this info - if there are some fundamental questions=20 to be answered before then...
Thanks in advance!
Sincerely,
Tom Morrison
Principal Software Engineer
email: [email protected]=20
www.empirix.com
Quoted 7 lines · Tom
I am sorry, but I've butted my head against a tree for over a week and some things just aren't making sense...especially how the prom parse code is working to exact / resolve physical addresses to then ioremap...
a) Setup, I have a working MPC8548E board using 2.6.23.8 (ARCH=ppc) with PHYS/PTE_64BIT enabled (with the proper patches)).
So, how much RAM are you trying to use? If it's 4GB+, there are still patches you need that haven't been released yet but should be out in the next week or so (I'm in the middle of pulling everything up to top-of-tree and re-testing).
Quoted 10 lines
b) Goal: we want to move our board to a generic 2.6.23 version that Freescale has produced to support the MPC8572DS (and eventually use that kernel to build our BSP for our next board).
c) I have successfully gotten to work a pure '32-bit' dev tree (PHYS/PTE_64BIT not defined - and the CCSRBAR @ 0xE000_0000) The #address/#size <1/1> is '1' (as well as the #size is '1')
Quoted 7 lines
d) I have modified this dev tree to support the 36bit mode addressing (with the CCSRBAR and PCIExpress defined to in the last 4Gig
(instead
of the default first 4Gig - e.g.: 0xC_E000_0000)...e) I then set the soc to have #address-cells to '2' (#size-cells is '1') (and added the additional values accordingly to the ranges...
I'm not sure you've done the right thing here. In many cases, you don't actually need to modify the size/addr cells in the soc node - those just impact the children of that node, which are relative to the parent.
You do need to change your high-level platform node at the very top of the .dts to have the right width - here's a patch snippet from a dts I had with 2/1 formatting (this is a very old .dts, so it uses the old-style number formatting before we started using '0x'):
+ model = "MPC8641HPCN"; + compatible = "mpc86xx"; + #address-cells = <2>; + #size-cells = <1>;
and then the soc node itself was: (I located things at 0xf_xxx0_0000)
+ soc8641@ff8000000 {
+ #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + ranges = <00000000 0f f8000000 00100000>; + reg = <f f8000000 00001000>; // CCSRBAR
The reg and ranges now reflect the wider parent bus address.
Quoted 8 lines
f) The
prom_parsecode has a problem with translating these addressesThe main question is: has anyone ever tested this with soc #address/size being <2/1> in this fashion?
I did that a while ago with 8641D and it worked fine at that point; since then I've converted to a 2/2 format (which also works fine).
That, of course, assumes you've modified your bootloader to put the devices in the right spot. Without that, all bets are off.
Hope that helps.... if you're still confused, post some snippets of your dts and I'll take a look.
Cheers,
B
I recommend you look at <2/2> instead of <2/1>. <2/1> is just a degenerate case and it doesn't really get you much value.
- k
Thank you...I will take that recommendation...
I will try that and get some results before I complete my=20 response to Becky this morning...
T
-----Original Message-----
From: Kumar Gala [mailto:[email protected]]=20
Sent: Tuesday, August 12, 2008 8:42 AM
To: Morrison, Tom
Cc: ppc-dev list; Becky Bruce; Paul Mackerras
Subject: Re: Does Dev Tree WORK with soc@y_xxxx_0000 <#address/size> =3D <2/1>
I recommend you look at <2/2> instead of <2/1>. <2/1> is just a =20 degenerate case and it doesn't really get you much value.
- k
Thank you Becky (and Kumar) for all the information....and help!
To answer your questions, yes, we are using 4GB++ of memory (and plan more in the near future). But, for the initial bring up, I reduced the memory to 2Gig. Further, I have modified u-boot=20 to NOT modify the memory reg properties (see below my snippet)...
Question: what other 'devices' does u-boot put down that I care=20 about I have modified u-boot to put the correct memory structure?=20
Also, are you saying there are additional patches for=20 prom parsing code for this to work right - or are you=20 talking about in general for the 4Gig memory??
Here is a dts snippet with some of the interesting parts:
/{ model =3D "MPC8548_CHEETAH";
compatible =3D "MPC8548_CHEETAH";
#address-cells =3D <2>;
#size-cells =3D <2>;
=20
memory { device_type =3D "memory";
reg =3D <0 00000000 0 80000000>; // 2 GIG @ 0x0
};
soc8548@c6df00000 {
#address-cells =3D <1>;
#size-cells =3D <1>;
#interrupt-cells =3D <2>;
device_type =3D "soc";
ranges =3D <00001000 00000000c 6df00000 000ff000>;
reg =3D <0000000C 6df00000 0 001000>; // CCSRBAR.........
serial@4500 {
device_type =3D "serial";
compatible =3D "ns16550";
reg =3D <4500 100>; // reg base, size
clock-frequency =3D <0>; // should we fill in in
uboot?
interrupts =3D <2a 2>;
interrupt-parent =3D <&mpic>;
};
serial@4600 {
device_type =3D "serial";
compatible =3D "ns16550";
reg =3D <4600 100>; // reg base, size
clock-frequency =3D <0>; // should we fill in in
uboot?
interrupts =3D <2a 2>;
interrupt-parent =3D <&mpic>;
};.........
};
Now, it looks like I am successfully parsing and translating the=20 address to the expected address for the default stdout (0xc_6df0_4600)!
FWIW, I have identified that another problem with the code configuring the CCSRBAR (and am sure I'll figure that one out soon because we have=20 a working solution in the arch/ppc directory).
While I have your expert attention, I'd like to have you comment about what potentially could be right/wrong with my definitions for the pci express settings...
a) Do I put those ranges in the ranges for the parent soc device
(also)?
b) Do the below correctly define a 2 Gig PCI memory Window starting=20
at 0xC_6F00_0000 (to 0xC_EF00_0000) and PCI IO 16M Window starting
at 0xC_6E00_0000 (to 0xC_6F00_0000)?-----
/* PCI Express */
pcie@a000 {
compatible =3D "fsl,mpc8548-pcie";
device_type =3D "pci";
#interrupt-cells =3D <1>;
#size-cells =3D <2>;
#address-cells =3D <3>;
reg =3D <a000 1000>;
bus-range =3D <0 ff>;
ranges =3D <02000000 0 c 6f000000 c 6f000000 0 80000000 01000000 0 00000000 0000000c 6E000000 0 01000000>;
-----
Thank you for all your help/comments...
Sincerely,
Tom Morrison
-----Original Message-----
From: Becky Bruce [mailto:[email protected]]=20
Sent: Monday, August 11, 2008 6:26 PM
To: Morrison, Tom
Cc: [email protected]; Paul Mackerras
Subject: Re: Does Dev Tree WORK with soc@y_xxxx_0000 <#address/size> =3D <2/1>
Quoted 7 lines · Tom
I am sorry, but I've butted my head against a tree for over a week and some things just aren't making sense...especially how the prom parse code is working to exact / resolve physical addresses to then ioremap...
a) Setup, I have a working MPC8548E board using 2.6.23.8 (ARCH=3Dppc) with PHYS/PTE_64BIT enabled (with the proper patches)).
So, how much RAM are you trying to use? If it's 4GB+, there are still patches you need that haven't been released yet but should be out in the next week or so (I'm in the middle of pulling everything up to top-of-tree and re-testing).
Quoted 10 lines
b) Goal: we want to move our board to a generic 2.6.23 version that Freescale has produced to support the MPC8572DS (and eventually use that kernel to build our BSP for our next board).
c) I have successfully gotten to work a pure '32-bit' dev tree (PHYS/PTE_64BIT not defined - and the CCSRBAR @ 0xE000_0000) The #address/#size <1/1> is '1' (as well as the #size is '1')
Quoted 8 lines
d) I have modified this dev tree to support the 36bit mode addressing (with the CCSRBAR and PCIExpress defined to in the last 4Gig =20
(instead
of the default first 4Gig - e.g.: 0xC_E000_0000)...e) I then set the soc to have #address-cells to '2' (#size-cells is =20 '1')
(and added the additional values accordingly to the ranges...=09
I'm not sure you've done the right thing here. In many cases, you don't actually need to modify the size/addr cells in the soc node - those just impact the children of that node, which are relative to the parent.
You do need to change your high-level platform node at the very top of the .dts to have the right width - here's a patch snippet from a dts I =20 had
with 2/1 formatting (this is a very old .dts, so it uses the old-style number formatting before we started using '0x'):
+ model =3D "MPC8641HPCN"; + compatible =3D "mpc86xx"; + #address-cells =3D <2>; + #size-cells =3D <1>;
and then the soc node itself was: (I located things at 0xf_xxx0_0000)
+ soc8641@ff8000000 {
+ #address-cells =3D <1>; + #size-cells =3D <1>; + device_type =3D "soc"; + ranges =3D <00000000 0f f8000000 00100000>; + reg =3D <f f8000000 00001000>; // CCSRBAR
The reg and ranges now reflect the wider parent bus address.
Quoted 9 lines
f) The
prom_parsecode has a problem with translating these addressesThe main question is: has anyone ever tested this with soc #address/=20 size
being <2/1> in this fashion?
I did that a while ago with 8641D and it worked fine at that point; since then I've converted to a 2/2 format (which also works fine).
That, of course, assumes you've modified your bootloader to put the devices in the right spot. Without that, all bets are off.
Hope that helps.... if you're still confused, post some snippets of =20 your dts and I'll take a look.
Cheers,
B
Quoted 9 lines · Tom
Thank you Becky (and Kumar) for all the information....and help!
To answer your questions, yes, we are using 4GB++ of memory (and plan more in the near future). But, for the initial bring up, I reduced the memory to 2Gig. Further, I have modified u-boot to NOT modify the memory reg properties (see below my snippet)...
Question: what other 'devices' does u-boot put down that I care about I have modified u-boot to put the correct memory structure?
If you have 4GB of RAM, you need to move *all* devices in u-boot above 4GB. The config file for your board should have all the information you need about what's out there.
Quoted 5 lines
Also, are you saying there are additional patches for prom parsing code for this to work right - or are you talking about in general for the 4Gig memory??
I was talking about in general for 4GB. The prom parsing code should work already. The issue with having 4GB is that there are some devices that only recognize 32 bits of physical address. These devices will require bounce buffering a la swiotlb in order to do dmas when the dma buffer is somewhere above about 3.5GB (that number depends on your board - the reason you can't see the whole 4GB of space is that some portion of the PCI space is reserved for PCI-IO). I'm currently working through some issues that popped up when I updated to TOT and picked up the dma_attrs changes. I expect to have these patches out within a week or so.
Quoted 44 lines
Here is a dts snippet with some of the interesting parts:
/{ model = "MPC8548_CHEETAH"; compatible = "MPC8548_CHEETAH"; #address-cells = <2>; #size-cells = <2>; memory { device_type = "memory"; reg = <0 00000000 0 80000000>; // 2 GIG @ 0x0 }; soc8548@c6df00000 { #address-cells = <1>; #size-cells = <1>; #interrupt-cells = <2>; device_type = "soc"; ranges = <00001000 00000000c 6df00000 000ff000>; reg = <0000000C 6df00000 0 001000>; // CCSRBAR.........
serial@4500 { device_type = "serial"; compatible = "ns16550"; reg = <4500 100>; // reg base, size clock-frequency = <0>; // should we fill in in uboot? interrupts = <2a 2>; interrupt-parent = <&mpic>; }; serial@4600 { device_type = "serial"; compatible = "ns16550"; reg = <4600 100>; // reg base, size clock-frequency = <0>; // should we fill in in uboot? interrupts = <2a 2>; interrupt-parent = <&mpic>; };
Quoted 5 lines
.........
};Now, it looks like I am successfully parsing and translating the address to the expected address for the default stdout (0xc_6df0_4600)!
Yeah, this looks OK (other than the fact that you're using an old .dts format).
Quoted 5 lines
FWIW, I have identified that another problem with the code configuring the CCSRBAR (and am sure I'll figure that one out soon because we have a working solution in the
arch/ppcdirectory).
FWIW, I moved CCSRBAR in u-boot.
Quoted 25 lines
While I have your expert attention, I'd like to have you comment about what potentially could be right/wrong with my definitions for the pci express settings...
a) Do I put those ranges in the ranges for the parent soc device
(also)?b) Do the below correctly define a 2 Gig PCI memory Window starting
at 0xC_6F00_0000 (to 0xC_EF00_0000) and PCI IO 16M Window starting at 0xC_6E00_0000 (to 0xC_6F00_0000)?-----
/* PCI Express */pcie@a000 { compatible = "fsl,mpc8548-pcie"; device_type = "pci"; #interrupt-cells = <1>; #size-cells = <2>; #address-cells = <3>; reg = <a000 1000>; bus-range = <0 ff>; ranges = <02000000 0 c 6f000000 c 6f000000 0 80000000
Quoted 1 line
01000000 0 00000000
0000000c6E000000 0 01000000>;
This doesn't look right to me, assuming your pcie device is at the same tree level as mine. What's the parent node and what are address-cells and size-cells in the parent? I'm basically at next-to-top level, under the platform node.
Here's an example from my working tree:
model = "MPC8641HPCN";
compatible = "mpc86xx";
#address-cells = <2>;
#size-cells = <2>;
.......
pci0: pcie@ff8008000 {
cell-index = <0>;
compatible = "fsl,mpc8641-pcie";
device_type = "pci";
#interrupt-cells = <1>;
#size-cells = <2>;
#address-cells = <3>;
reg = <0x0f 0xf8008000 0x0 0x1000>;
bus-range = <0x0 0xff>;
ranges = <0x02000000 0x0 0x80000000 0x0f 0x80000000
0x0 0x20000000
0x01000000 0x0 0x00000000 0x0f 0xe2000000 0x0 0x00100000>;
I believe you should just need to change the parent bus address field in ranges, and you need to update your "reg" property.
Quoted 6 lines
-----
Thank you for all your help/comments...
Have fun :)
Cheers,
Becky