powerpc/44x: Add MTD support (NOR FLASH) to Katmai dts
Subsystems (2)
PATCH 1/2 powerpc/44x: Add MTD support (NOR FLASH) to Katmai dts
This patch adds NOR FLASH MTD support to the Katmai (440SPe) dts file.
Additionally with a small whitespace cleanup.
--- arch/powerpc/boot/dts/katmai.dts | 71 +++++++++++++++++++++++++++---------- 1 files changed, 52 insertions(+), 19 deletions(-)
arch/powerpc/boot/dts/katmai.dts +52 -19
@@ -156,7 +156,7 @@ compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb"; #address-cells = <1>; #size-cells = <1>; - ranges = <0x00000000 0x00000004 0xe0000000 0x20000000>; + ranges = <0xe0000000 0x00000004 0xe0000000 0x20000000>; clock-frequency = <0>; /* Filled in by zImage */ EBC0: ebc {
@@ -165,14 +165,47 @@ #address-cells = <2>; #size-cells = <1>; clock-frequency = <0>; /* Filled in by zImage */ + /* ranges property is supplied by U-Boot */ interrupts = <0x5 0x1>; interrupt-parent = <&UIC1>; + + nor_flash@0,0 { + compatible = "cfi-flash"; + bank-width = <2>; + reg = <0x00000000 0x00000000 0x01000000>; + #address-cells = <1>; + #size-cells = <1>; + partition@0 { + label = "kernel"; + reg = <0x00000000 0x001e0000>; + }; + partition@1e0000 { + label = "dtb"; + reg = <0x001e0000 0x00020000>; + }; + partition@200000 { + label = "root"; + reg = <0x00200000 0x00200000>; + }; + partition@400000 { + label = "user"; + reg = <0x00400000 0x00b60000>; + }; + partition@f60000 { + label = "env"; + reg = <0x00f60000 0x00040000>; + }; + partition@fa0000 { + label = "u-boot"; + reg = <0x00fa0000 0x00060000>; + }; + }; }; - UART0: serial@10000200 { + UART0: serial@f0000200 { device_type = "serial"; compatible = "ns16550"; - reg = <0x10000200 0x00000008>; + reg = <0xf0000200 0x00000008>; virtual-reg = <0xa0000200>; clock-frequency = <0>; /* Filled in by zImage */ current-speed = <115200>;
@@ -180,10 +213,10 @@ interrupts = <0x0 0x4>; }; - UART1: serial@10000300 { + UART1: serial@f0000300 { device_type = "serial"; compatible = "ns16550"; - reg = <0x10000300 0x00000008>; + reg = <0xf0000300 0x00000008>; virtual-reg = <0xa0000300>; clock-frequency = <0>; current-speed = <0>;
@@ -192,10 +225,10 @@ }; - UART2: serial@10000600 { + UART2: serial@f0000600 { device_type = "serial"; compatible = "ns16550"; - reg = <0x10000600 0x00000008>; + reg = <0xf0000600 0x00000008>; virtual-reg = <0xa0000600>; clock-frequency = <0>; current-speed = <0>;
@@ -203,27 +236,27 @@ interrupts = <0x5 0x4>; }; - IIC0: i2c@10000400 { + IIC0: i2c@f0000400 { compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic"; - reg = <0x10000400 0x00000014>; + reg = <0xf0000400 0x00000014>; interrupt-parent = <&UIC0>; interrupts = <0x2 0x4>; }; - IIC1: i2c@10000500 { + IIC1: i2c@f0000500 { compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic"; - reg = <0x10000500 0x00000014>; + reg = <0xf0000500 0x00000014>; interrupt-parent = <&UIC0>; interrupts = <0x3 0x4>; }; - EMAC0: ethernet@10000800 { + EMAC0: ethernet@f0000800 { linux,network-index = <0x0>; device_type = "network"; compatible = "ibm,emac-440spe", "ibm,emac4"; interrupt-parent = <&UIC1>; interrupts = <0x1c 0x4 0x1d 0x4>; - reg = <0x10000800 0x00000074>; + reg = <0xf0000800 0x00000074>; local-mac-address = [000000000000]; mal-device = <&MAL0>; mal-tx-channel = <0>;
@@ -248,11 +281,11 @@ primary; large-inbound-windows; enable-msi-hole; - reg = <0x0000000c 0x0ec00000 0x00000008 /* Config space access */ - 0x00000000 0x00000000 0x00000000 /* no IACK cycles */ - 0x0000000c 0x0ed00000 0x00000004 /* Special cycles */ - 0x0000000c 0x0ec80000 0x00000100 /* Internal registers */ - 0x0000000c 0x0ec80100 0x000000fc>; /* Internal messaging registers */ + reg = <0x0000000c 0x0ec00000 0x00000008 /* Config space access */ + 0x00000000 0x00000000 0x00000000 /* no IACK cycles */ + 0x0000000c 0x0ed00000 0x00000004 /* Special cycles */ + 0x0000000c 0x0ec80000 0x00000100 /* Internal registers */ + 0x0000000c 0x0ec80100 0x000000fc>; /* Internal messaging registers */ /* Outbound ranges, one memory and one IO, * later cannot be changed
@@ -453,6 +486,6 @@ }; chosen { - linux,stdout-path = "/plb/opb/serial@10000200"; + linux,stdout-path = "/plb/opb/serial@f0000200"; }; };
Signature · 1 line
1.6.6.1
Quoted 15 lines · Stefan Roese
This patch adds NOR FLASH MTD support to the Katmai (440SPe) dts file.
Additionally with a small whitespace cleanup.
Signed-off-by Stefan Roese <[email protected]>Cc Josh Boyer <[email protected]>---
arch/powerpc/boot/dts/katmai.dts| 71 +++++++++++++++++++++++++++----------1 files changed, 52 insertions(+), 19 deletions(-)arch/powerpc/boot/dts/katmai.dts +0
-0
arch/powerpc/boot/dts/katmai.dts line 159
Quoted 5 lines
arch/powerpc/boot/dts/katmai.dts +1
-1@@ -156,7 +156,7 @@ compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb"; #address-cells = <1>; #size-cells = <1>; - ranges = <0x00000000 0x00000004 0xe0000000 0x20000000>; + ranges = <0xe0000000 0x00000004 0xe0000000 0x20000000>;
Could you explain why this was needed? It seems to shift the addresses of all the rest of the devices under the OPB.
arch/powerpc/boot/dts/katmai.dts line 168
Quoted 8 lines
arch/powerpc/boot/dts/katmai.dts +1
-0clock-frequency = <0>; /* Filled in by zImage */ EBC0: ebc {@@ -165,14 +165,47 @@ #address-cells = <2>; #size-cells = <1>; clock-frequency = <0>; /* Filled in by zImage */ + /* ranges property is supplied by U-Boot */
That's probably true for newer U-Boot versions, but Katmai shipped with an old version of U-Boot that wasn't FDT-aware. Wouldn't this break a new kernel on the older boards that don't have an updated U-Boot since the ranges property will be missing entirely there?
josh
Quoted 12 lines · On Tuesday 26 January 2010 16:04:03 Josh Boyer wrote:
Quoted 11 lines · Stefan Roese
This patch adds NOR FLASH MTD support to the Katmai (440SPe) dts file.
Additionally with a small whitespace cleanup.
Signed-off-by Stefan Roese <[email protected]>Cc Josh Boyer <[email protected]>---
arch/powerpc/boot/dts/katmai.dts| 71
+++++++++++++++++++++++++++---------- 1 files changed, 52 insertions(+), 19 deletions(-)
Quoted 13 lines
arch/powerpc/boot/dts/katmai.dts line 159
Quoted 10 lines
(quoted diff) +0
-0
b/arch/powerpc/boot/dts/katmai.dtsindex 8f345de..8cf2c0c 100644arch/powerpc/boot/dts/katmai.dts +1
-1@@ -156,7 +156,7 @@ compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb"; #address-cells = <1>; #size-cells = <1>; - ranges = <0x00000000 0x00000004 0xe0000000 0x20000000>; + ranges = <0xe0000000 0x00000004 0xe0000000 0x20000000>;Could you explain why this was needed? It seems to shift the addresses of
all the rest of the devices under the OPB.
Yes. This is needed to being able to map the EBC ranges (physical addresses of each chip-select) correctly.
I'll update the commit text to explain this change a bit.
Quoted 13 lines
arch/powerpc/boot/dts/katmai.dts line 168
Quoted 8 lines
arch/powerpc/boot/dts/katmai.dts +1
-0clock-frequency = <0>; /* Filled in by zImage */ EBC0: ebc {@@ -165,14 +165,47 @@ #address-cells = <2>; #size-cells = <1>; clock-frequency = <0>; /* Filled in by zImage */ + /* ranges property is supplied by U-Boot */That's probably true for newer U-Boot versions, but Katmai shipped with an
old version of U-Boot that wasn't FDT-aware. Wouldn't this break a new kernel on the older boards that don't have an updated U-Boot since the ranges property will be missing entirely there?
When the ranges property is missing in this EBC node, the NOR FLASH mapping will not work. So not MTD devices. But it won't break anything.
Cheers,
Stefan