Small fixes for the Ebony device tree
Subsystems (3)
This patch corrects a number of minor errors in the Ebony device tree:
- Missing (given as 0) cache sizes are added to the CPU node
- device_type properties are removed from nodes which don't
have a reasonably well defined device_type binding. This does require a very small code change to locate the busses to be probed for of_platform devices by 'compatible' instead of 'device_type'.
- A node is added for the SRAM controller
- The unit address of the small-flash node is adjusted to
correctly reflect the reg property.
- device_type values for the MAL and ZMII are updated to
reflected more up-to-date versions of the binding.
- An incorrect offset in the partition map for the large-flash
node is corrected.
- Some redundant values, already commented out are removed
entirely.
---
The flash partition offset correction, at least, should go into 2.6.22. I think the rest while only borderline "bugfixes" is also reasonable for inclusion in 2.6.22.
arch/powerpc/boot/dts/ebony.dts +11 -20
@@ -33,8 +33,8 @@ timebase-frequency = <0>; // Filled in by zImage i-cache-line-size = <32>; d-cache-line-size = <32>; - i-cache-size = <0>; - d-cache-size = <0>; + i-cache-size = <2000000>; /* 32 kB */ + d-cache-size = <2000000>; /* 32 kB */ dcr-controller; dcr-access-method = "native"; };
@@ -46,7 +46,6 @@ }; UIC0: interrupt-controller0 { - device_type = "ibm,uic"; compatible = "ibm,uic-440gp", "ibm,uic"; interrupt-controller; cell-index = <0>;
@@ -58,7 +57,6 @@ }; UIC1: interrupt-controller1 { - device_type = "ibm,uic"; compatible = "ibm,uic-440gp", "ibm,uic"; interrupt-controller; cell-index = <1>;
@@ -71,14 +69,12 @@ }; CPC0: cpc { - device_type = "ibm,cpc"; compatible = "ibm,cpc-440gp"; dcr-reg = <0b0 003 0e0 010>; // FIXME: anything else? }; plb { - device_type = "ibm,plb"; compatible = "ibm,plb-440gp", "ibm,plb4"; #address-cells = <2>; #size-cells = <1>;
@@ -86,21 +82,24 @@ clock-frequency = <0>; // Filled in by zImage SDRAM0: sdram { - device_type = "memory-controller"; compatible = "ibm,sdram-440gp", "ibm,sdram"; dcr-reg = <010 2>; // FIXME: anything else? }; + SRAM0: sram { + compatible = "ibm,sram440gp"; + dcr-reg = <020 8 00a 1>; + }; + DMA0: dma { // FIXME: ??? - device_type = "ibm,dma-4xx"; compatible = "ibm,dma-440gp", "ibm,dma-4xx"; dcr-reg = <100 027>; }; MAL0: mcmal { - device_type = "mcmal-dma"; + device_type = "dma-controller"; compatible = "ibm,mcmal-440gp", "ibm,mcmal"; dcr-reg = <180 62>; num-tx-chans = <4>;
@@ -119,7 +118,6 @@ }; POB0: opb { - device_type = "ibm,opb"; compatible = "ibm,opb-440gp", "ibm,opb"; #address-cells = <1>; #size-cells = <1>;
@@ -133,7 +131,6 @@ clock-frequency = <0>; // Filled in by zImage EBC0: ebc { - device_type = "ibm,ebc"; compatible = "ibm,ebc-440gp"; dcr-reg = <012 2>; #address-cells = <2>;
@@ -147,7 +144,7 @@ interrupts = <5 4>; interrupt-parent = <&UIC1>; - small-flash@0,0 { + small-flash@0,80000 { device_type = "rom"; compatible = "direct-mapped"; probe-type = "JEDEC";
@@ -159,7 +156,6 @@ ds1743@1,0 { /* NVRAM & RTC */ - device_type = "nvram"; compatible = "ds1743"; reg = <1 0 2000>; };
@@ -170,7 +166,7 @@ probe-type = "JEDEC"; bank-width = <1>; partitions = <0 380000 - 280000 80000>; + 380000 80000>; partition-names = "fs", "firmware"; reg = <2 0 400000>; };
@@ -226,13 +222,12 @@ GPIO0: gpio@40000700 { /* FIXME */ - device_type = "gpio"; compatible = "ibm,gpio-440gp"; reg = <40000700 20>; }; ZMII0: emac-zmii@40000780 { - device_type = "emac-zmii"; + device_type = "zmii-interface"; compatible = "ibm,zmii-440gp", "ibm,zmii"; reg = <40000780 c>; };
@@ -299,9 +294,5 @@ chosen { linux,stdout-path = "/plb/opb/serial@40000200"; -// linux,initrd-start = <0>; /* FIXME */ -// linux,initrd-end = <0>; -// bootargs = ""; }; }; -
arch/powerpc/platforms/44x/ebony.c +3 -3
@@ -27,9 +27,9 @@#include "44x.h" static struct of_device_id ebony_of_bus[] = { - { .type ="ibm,plb" , }, - { .type ="ibm,opb" , }, - { .type ="ibm,ebc" , }, + { .compatible ="ibm,plb" , }, + { .compatible ="ibm,opb" , }, + { .compatible ="ibm,ebc" , }, {}, };
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Josh Boyer
Acked-byQuoted 16 lines · David Gibson
This patch corrects a number of minor errors in the Ebony device tree:
- Missing (given as 0) cache sizes are added to the CPU node
-device_typeproperties are removed from nodes which don't
have a reasonably well defineddevice_typebinding. This does require a very small code change to locate the busses to be probed forof_platformdevices by 'compatible' instead of 'device_type'.
- A node is added for the SRAM controller
- The unit address of the small-flash node is adjusted to
correctly reflect the reg property.
-device_typevalues for the MAL and ZMII are updated to
reflected more up-to-date versions of the binding.
- An incorrect offset in the partition map for the large-flash
node is corrected.
- Some redundant values, already commented out are removed
entirely.
Quoted 1 line
Signed-off-by David Gibson <[email protected]>
arch/powerpc/boot/dts/ebony.dts line 37
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +2
-2- i-cache-size = <0>; - d-cache-size = <0>; + i-cache-size = <2000000>; /* 32 kB */ + d-cache-size = <2000000>; /* 32 kB */
That's 32MB, not 32kB. Better fix this :-)
arch/powerpc/boot/dts/ebony.dts line 59
Quoted 3 lines
arch/powerpc/boot/dts/ebony.dts +0
-0UIC0: interrupt-controller0 { UIC1: interrupt-controller1 {
It's a shame you can't use unit addresses for these since you use "dcr-reg" instead of "reg". Oh well.
arch/powerpc/boot/dts/ebony.dts line 85
Quoted 3 lines
arch/powerpc/boot/dts/ebony.dts +0
-1SDRAM0: sdram { - device_type = "memory-controller"; compatible = "ibm,sdram-440gp", "ibm,sdram";
Maybe rename the node to "memory-controller"?
arch/powerpc/boot/dts/ebony.dts line 93
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +4
-0+ SRAM0: sram { + compatible = "ibm,sram440gp"; + dcr-reg = <020 8 00a 1>; + };
Is this thing _only_ addressable over DCRs? Weird.
arch/powerpc/boot/dts/ebony.dts line 103
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +1
-1MAL0: mcmal { - device_type = "mcmal-dma"; + device_type = "dma-controller"; compatible = "ibm,mcmal-440gp", "ibm,mcmal";
Remove "device_type", change name to "dma-controller"?
arch/powerpc/boot/dts/ebony.dts line 134
Quoted 3 lines
arch/powerpc/boot/dts/ebony.dts +0
-1EBC0: ebc { - device_type = "ibm,ebc"; compatible = "ibm,ebc-440gp";
You forgot "ibm,ebc" here.
Segher
Quoted 6 lines · Segher Boessenkool
arch/powerpc/boot/dts/ebony.dts line 37
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +2
-2- i-cache-size = <0>; - d-cache-size = <0>; + i-cache-size = <2000000>; /* 32 kB */ + d-cache-size = <2000000>; /* 32 kB */That's 32MB, not 32kB. Better fix this :-)
Argh. What's even sadder is I just did the exact same thing for Bamboo.
Quoted 6 lines
arch/powerpc/boot/dts/ebony.dts line 93
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +4
-0+ SRAM0: sram { + compatible = "ibm,sram440gp"; + dcr-reg = <020 8 00a 1>; + };Is this thing _only_ addressable over DCRs? Weird.
Yes.
Quoted 8 lines
arch/powerpc/boot/dts/ebony.dts line 103
Quoted 5 lines
arch/powerpc/boot/dts/ebony.dts +1
-1MAL0: mcmal { - device_type = "mcmal-dma"; + device_type = "dma-controller"; compatible = "ibm,mcmal-440gp", "ibm,mcmal";Remove "
device_type", change name to "dma-controller"?
Quoted 5 lines
arch/powerpc/boot/dts/ebony.dts line 134
Quoted 3 lines
arch/powerpc/boot/dts/ebony.dts +0
-1EBC0: ebc { - device_type = "ibm,ebc"; compatible = "ibm,ebc-440gp";You forgot "ibm,ebc" here.
/me notes that for Bamboo
josh
Quoted 6 lines · Segher Boessenkool
arch/powerpc/boot/dts/ebony.dts line 37
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +2
-2- i-cache-size = <0>; - d-cache-size = <0>; + i-cache-size = <2000000>; /* 32 kB */ + d-cache-size = <2000000>; /* 32 kB */That's 32MB, not 32kB. Better fix this :-)
Duh. Fixed.
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts line 59
Quoted 3 lines
arch/powerpc/boot/dts/ebony.dts +0
-0UIC0: interrupt-controller0 { UIC1: interrupt-controller1 {
Quoted 8 lines
It's a shame you can't use unit addresses for these since you use "dcr-reg" instead of "reg". Oh well.
arch/powerpc/boot/dts/ebony.dts line 85
Quoted 3 lines
arch/powerpc/boot/dts/ebony.dts +0
-1SDRAM0: sdram { - device_type = "memory-controller"; compatible = "ibm,sdram-440gp", "ibm,sdram";Maybe rename the node to "memory-controller"?
Hmm, yeah, I guess so.
Quoted 6 lines
arch/powerpc/boot/dts/ebony.dts line 93
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +4
-0+ SRAM0: sram { + compatible = "ibm,sram440gp"; + dcr-reg = <020 8 00a 1>; + };Is this thing _only_ addressable over DCRs? Weird.
Well... the control registers are certainly DCR only. I guess there's the actual SRAM itself, though whether this belongs in this node, or elsewhere isn't immediately clear. I haven't yet investigated how the SRAM is mapped (it depends on DIP switch settings) so I'm certainly not considering this node complete yet.
Quoted 6 lines
arch/powerpc/boot/dts/ebony.dts line 103
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +1
-1MAL0: mcmal { - device_type = "mcmal-dma"; + device_type = "dma-controller"; compatible = "ibm,mcmal-440gp", "ibm,mcmal";Remove "
device_type", change name to "dma-controller"?
Don't really want to remove the device_type, because the MAL driver looks for it at present. Don't really want to change the name, since that might encourage confusion with the other (more conventional) DMA controller.
Quoted 5 lines
arch/powerpc/boot/dts/ebony.dts line 134
Quoted 3 lines
arch/powerpc/boot/dts/ebony.dts +0
-1EBC0: ebc { - device_type = "ibm,ebc"; compatible = "ibm,ebc-440gp";You forgot "ibm,ebc" here.
Hmm.. yeah, I guess.
Revised patch coming shortly.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 7 lines
Quoted 6 lines
arch/powerpc/boot/dts/ebony.dts line 93
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +4
-0+ SRAM0: sram { + compatible = "ibm,sram440gp"; + dcr-reg = <020 8 00a 1>; + };Is this thing _only_ addressable over DCRs? Weird.
Quoted 5 lines
Well... the control registers are certainly DCR only. I guess there's the actual SRAM itself, though whether this belongs in this node, or elsewhere isn't immediately clear. I haven't yet investigated how the SRAM is mapped (it depends on DIP switch settings) so I'm certainly not considering this node complete yet.
If it is supposed to have a "reg" property, and it doesn't yet, it might be a good idea to comment it out in the DTS for now, so later kernels can work with the older device tree correctly.
Quoted 9 lines
Quoted 6 lines
arch/powerpc/boot/dts/ebony.dts line 103
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +1
-1MAL0: mcmal { - device_type = "mcmal-dma"; + device_type = "dma-controller"; compatible = "ibm,mcmal-440gp", "ibm,mcmal";Remove "
device_type", change name to "dma-controller"?Don't really want to remove the
device_type, because the MAL driver looks for it at present.
Fair enough. But you change the "device_type" in this patch, so presumably you change it in the kernel driver as well -- can't you just *fix* the kernel driver, instead?
Quoted 3 lines
Don't really want to change the name, since
that might encourage confusion with the other (more conventional) DMA controller.
Nah, just look at the other properties in the node and you know what is what. It is quite common to have nodes with the same name representing different devices (for example, "ethernet" devices -- "dma-controller" would be a bit more unusual, sure).
I have no strong feelings about the name, "mcmal" is generic enough a name as far as I'm concerned.
Quoted 7 lines
Quoted 5 lines
arch/powerpc/boot/dts/ebony.dts line 134
Quoted 3 lines
arch/powerpc/boot/dts/ebony.dts +0
-1EBC0: ebc { - device_type = "ibm,ebc"; compatible = "ibm,ebc-440gp";You forgot "ibm,ebc" here.
Hmm.. yeah, I guess.
Well that's what the kernel code matches on ;-)
Quoted 1 line
Revised patch coming shortly.
Looking forward to it!
Segher
Quoted 13 lines · Segher Boessenkool
Quoted 7 lines
Quoted 6 lines
arch/powerpc/boot/dts/ebony.dts line 93
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +4
-0+ SRAM0: sram { + compatible = "ibm,sram440gp"; + dcr-reg = <020 8 00a 1>; + };Is this thing _only_ addressable over DCRs? Weird.
Quoted 5 lines
Well... the control registers are certainly DCR only. I guess there's the actual SRAM itself, though whether this belongs in this node, or elsewhere isn't immediately clear. I haven't yet investigated how the SRAM is mapped (it depends on DIP switch settings) so I'm certainly not considering this node complete yet.
Quoted 4 lines
If it is supposed to have a "reg" property, and it doesn't yet, it might be a good idea to comment it out in the DTS for now, so later kernels can work with the older device tree correctly.
Given that I'm not aware of any Ebony firmwares that actually supply a device tree, so in practice the kernel's tree will always come from an attached zImage, I don't think this is really a big consideration.
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
arch/powerpc/boot/dts/ebony.dts line 103
Quoted 4 lines
arch/powerpc/boot/dts/ebony.dts +1
-1MAL0: mcmal { - device_type = "mcmal-dma"; + device_type = "dma-controller"; compatible = "ibm,mcmal-440gp", "ibm,mcmal";Remove "
device_type", change name to "dma-controller"?
Quoted 5 lines
Quoted 2 lines
Don't really want to remove the
device_type, because the MAL driver looks for it at present.Fair enough. But you change the "
device_type" in this patch, so presumably you change it in the kernel
The kernel driver recognizes both variants, but the one I had previously is marked deprecated.
Quoted 2 lines
driver as well -- can't you just *fix* the kernel driver, instead?
Well.. I guess, but I'd prefer to leave that to BenH, who wrote the driver.
Quoted 19 lines
Quoted 3 lines
Don't really want to change the name, since
that might encourage confusion with the other (more conventional) DMA controller.Nah, just look at the other properties in the node and you know what is what. It is quite common to have nodes with the same name representing different devices (for example, "ethernet" devices -- "dma-controller" would be a bit more unusual, sure).
I have no strong feelings about the name, "mcmal" is generic enough a name as far as I'm concerned.
Quoted 6 lines
Quoted 5 lines
arch/powerpc/boot/dts/ebony.dts line 134
Quoted 3 lines
arch/powerpc/boot/dts/ebony.dts +0
-1EBC0: ebc { - device_type = "ibm,ebc"; compatible = "ibm,ebc-440gp";You forgot "ibm,ebc" here.
Quoted 3 lines
Quoted 1 line
Hmm.. yeah, I guess.
Well that's what the kernel code matches on ;-)
Um.. yes. I wonder how it was working before...
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 5 lines · David Gibson
Index:
working-2.6/arch/powerpc/boot/dts/ebony.dts
===================================================================
arch/powerpc/boot/dts/ebony.dts line 40
Quoted 10 lines
arch/powerpc/boot/dts/ebony.dts +2
-2@@ -33,8 +33,8 @@ timebase-frequency = <0>; // Filled in by zImage i-cache-line-size = <32>; d-cache-line-size = <32>; - i-cache-size = <0>; - d-cache-size = <0>; + i-cache-size = <2000000>; /* 32 kB */ + d-cache-size = <2000000>; /* 32 kB */ dcr-controller; dcr-access-method = "native"; };
Ahh HA! You did it too! :)
Quoted 1 line · David Gibson
On Tue, May 15, 2007 at 06:59:49AM +0200, Segher Boessenkool wrote:
[snip]
Quoted 5 lines
Quoted 2 lines
driver as well -- can't you just *fix* the kernel driver, instead?
Well.. I guess, but I'd prefer to leave that to BenH, who wrote the driver.
On second thoughts I will alter the driver, the new version I sent out today has the fix to only look at 'compatible'.
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Don't really want to change the name, since
that might encourage confusion with the other (more conventional) DMA controller.
Quoted 8 lines
Quoted 8 lines
Nah, just look at the other properties in the node and you know what is what. It is quite common to have nodes with the same name representing different devices (for example, "ethernet" devices -- "dma-controller" would be a bit more unusual, sure).
I have no strong feelings about the name, "mcmal" is generic enough a name as far as I'm concerned.
I'll leave it then.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson