MPC8568E-MDS: add support for flash
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): 2eed9d85d53305b2b0d6e8f8287148f7a600ad19.1192730268.git.avorontsov@ru.mvista.com
PATCH v3 2/2 MPC8568E-MDS: add support for flash
MPC8568E-MDS have 1 32MB Spansion x16 CFI flash chip. Let's use it.
--- arch/powerpc/boot/dts/mpc8568mds.dts | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-)
arch/powerpc/boot/dts/mpc8568mds.dts +33 -1
@@ -47,12 +47,44 @@ #size-cells = <1>; compatible = "fsl,mpc8568-localbus"; reg = <e0005000 d8>; - ranges = <1 0 f8000000 0008000>; + ranges = <1 0 f8000000 0008000 + 0 0 fe000000 2000000>; bcsr@1,0 { device_type = "board-control"; reg = <1 0 8000>; }; + + flash@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash"; + reg = <0 0 2000000>; + bank-width = <2>; + device-width = <1>; + + hrcw@0 { + label = "hrcw"; + reg = <0 20000>; + read-only; + }; + + kernel@20000 { + label = "kernel"; + reg = <20000 200000>; + }; + + rootfs@220000 { + label = "rootfs"; + reg = <220000 1d60000>; + }; + + uboot@1f80000 { + label = "u-boot"; + reg = <1f80000 80000>; + read-only; + }; + }; }; soc8568@e0000000 {
Signature · 1 line
1.5.0.6
Quoted 23 lines · Anton Vorontsov
MPC8568E-MDS have 1 32MB Spansion x16 CFI flash chip. Let's use it.
Signed-off-by Anton Vorontsov <[email protected]>--- arch/powerpc/boot/dts/mpc8568mds.dts | 34 +++++++++++++++++++++++ ++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-)arch/powerpc/boot/dts/mpc8568mds.dts +2
-1@@ -47,12 +47,44 @@ #size-cells = <1>; compatible = "fsl,mpc8568-localbus"; reg = <e0005000 d8>; - ranges = <1 0 f8000000 0008000>; + ranges = <1 0 f8000000 0008000 + 0 0 fe000000 2000000>; bcsr@1,0 { device_type = "board-control"; reg = <1 0 8000>;
arch/powerpc/boot/dts/mpc8568mds.dts line 65
Quoted 10 lines
arch/powerpc/boot/dts/mpc8568mds.dts +9
-0}; + + flash@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash"; + reg = <0 0 2000000>; + bank-width = <2>; + device-width = <1>; +
Are you basing the partition map on something or making it up? Clearly hrcw & u-boot are at fixed offsets, wondering about kernel & rootfs?
Quoted 31 lines
arch/powerpc/boot/dts/mpc8568mds.dts +22
-0+ hrcw@0 { + label = "hrcw"; + reg = <0 20000>; + read-only; + }; + + kernel@20000 { + label = "kernel"; + reg = <20000 200000>; + }; + + rootfs@220000 { + label = "rootfs"; + reg = <220000 1d60000>; + }; + + uboot@1f80000 { + label = "u-boot"; + reg = <1f80000 80000>; + read-only; + }; + }; }; soc8568@e0000000 {Signature · 5 lines
1.5.0.6 _______________________________________________ Linuxppc-dev mailing list [email protected] https://ozlabs.org/mailman/listinfo/linuxppc-dev
On Thu, Oct 18, 2007 at 02:58:25PM -0500, Kumar Gala wrote:
[...]
Quoted 5 lines
Quoted 5 lines
arch/powerpc/boot/dts/mpc8568mds.dts +5
-0+ + flash@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash";
Quoted 8 lines
arch/powerpc/boot/dts/mpc8568mds.dts line 65
Quoted 4 lines
arch/powerpc/boot/dts/mpc8568mds.dts +4
-0+ reg = <0 0 2000000>; + bank-width = <2>; + device-width = <1>; +Are you basing the partition map on something or making it up? Clearly hrcw & u-boot are at fixed offsets, wondering about kernel & rootfs?
I'm making it up. From the brief look at the u-boot* git sources, there is no flashboot yet, thus I'm free to make this up...
I've partitioned this flash based on these thoughts:
1. HRCW - whole sector, to not wear out it, plus it's impossible to create just 64 bytes partition;
2. Kernel - 2MB, should be enough for bootup kernels?
3. Rootfs - the rest up to...
4. U-Boot at the end.
I'm not saying that it's best map ever, I'm open to suggestions. ;-)
* Unfortunately I didn't look at the stock Freescale u-boot, maybe there was flashboot, most probably.. I'll find the CD to look this up.
Much thanks for noticing this,
Signature · 4 lines
Anton Vorontsov email: [email protected] backup email: [email protected] irc://irc.freenode.net/bd2
Quoted 16 lines · Anton Vorontsov
On Thu, Oct 18, 2007 at 02:58:25PM -0500, Kumar Gala wrote:
[...]Quoted 5 lines
Quoted 5 lines
arch/powerpc/boot/dts/mpc8568mds.dts +5
-0+ + flash@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash";Quoted 8 lines
arch/powerpc/boot/dts/mpc8568mds.dts line 65
Quoted 4 lines
arch/powerpc/boot/dts/mpc8568mds.dts +4
-0+ reg = <0 0 2000000>; + bank-width = <2>; + device-width = <1>; +Are you basing the partition map on something or making it up? Clearly hrcw & u-boot are at fixed offsets, wondering about kernel & rootfs?
Quoted 7 lines
I'm making it up. From the brief look at the u-boot* git sources, there is no
flashbootyet, thus I'm free to make this up...I've partitioned this flash based on these thoughts:
1. HRCW - whole sector, to not wear out it, plus it's impossible to create just 64 bytes partition;
this makes sense.
Quoted 1 line
2. Kernel - 2MB, should be enough for bootup kernels?
seems reasonable.
Quoted 1 line
3. Rootfs - the rest up to...
do we need a small section for the device tree?
Quoted 1 line
4. U-Boot at the end.
can we reorder partitions? not sure if there is any value in having the things we know will always be there like hrcw & u-boot at fixed mtd0, mtd1, etc.
Quoted 6 lines
I'm not saying that it's best map ever, I'm open to suggestions. ;-)
* Unfortunately I didn't look at the stock Freescale u-boot, maybe there was flashboot, most probably.. I'll find the CD to look this up.
Yeah I have no idea what we ship w/regards to the BSPs.
- k
Quoted 22 lines · Kumar Gala
Quoted 19 lines · Anton Vorontsov
On Thu, Oct 18, 2007 at 02:58:25PM -0500, Kumar Gala wrote:
[...]Quoted 5 lines
Quoted 5 lines
(quoted diff) +5
-0+ + flash@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash";Quoted 8 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+ reg = <0 0 2000000>; + bank-width = <2>; + device-width = <1>; +Are you basing the partition map on something or making it up? Clearly hrcw & u-boot are at fixed offsets, wondering about kernel & rootfs?
I'm making it up. From the brief look at the u-boot* git sources, there is no
flashbootyet, thus I'm free to make this up...
Quoted 6 lines
Quoted 4 lines
I've partitioned this flash based on these thoughts:
1. HRCW - whole sector, to not wear out it, plus it's impossible to create just 64 bytes partition;
this makes sense.
[Unrelated to the patch.
I've tried to erase first (hrcw) sector, everything passes fine, but md fe000000 still gives data back. Probably some hardware magic used to prevent this? ;-)
=> erase fe000000 fe03ffff
.. done
Erased 2 sectors
=> md fe000000fe000000: 42424242 42424242 05050505 05050505 BBBBBBBB........fe000010: 00000000 00000000 83838383 83838383 ................fe000020: a0a0a0a0 a0a0a0a0 60606060 60606060 ........````````
...
=> md fe020000fe020000: ffffffff ffffffff ffffffff ffffffff ................
...]
Quoted 8 lines
Quoted 2 lines
2. Kernel - 2MB, should be enough for bootup kernels?
seems reasonable.
Quoted 1 line
3. Rootfs - the rest up to...
do we need a small section for the device tree?
Yes, apparently. :-)
Quoted 5 lines
Quoted 1 line
4. U-Boot at the end.
can we reorder partitions? not sure if there is any value in having the things we know will always be there like hrcw & u-boot at fixed mtd0, mtd1, etc.
Good idea.
Quoted 8 lines
Quoted 6 lines
I'm not saying that it's best map ever, I'm open to suggestions. ;-)
* Unfortunately I didn't look at the stock Freescale u-boot, maybe there was flashboot, most probably.. I'll find the CD to look this up.
Yeah I have no idea what we ship w/regards to the BSPs.
Here it is:
bootcmd=run ramargs;cp.b fff00000 400000 2000;bootm ff800000 ffa00000 400000
I.e.
0xFF800000 - kernel0xFFA00000 - ramdisk0xFFF00000 - dtb, one sector
Reworked patch (lbus+flash) follow, using this stock partitions map:
0x00000000-0x00020000 : "hrcw" <- 128 kB 0x01f80000-0x02000000 : "u-boot" <- 512 kB 0x00020000-0x01800000 : "rootfs" <- 24448 kB 0x01800000-0x01a00000 : "kernel" <- 2048 kB 0x01a00000-0x01f00000 : "ramdisk" <- 5120 kB 0x01f00000-0x01f20000 : "dtb" <- 128 kB 0x01f20000-0x01f80000 : "spare" <- 384 kB
I'm not sure about "ramdisk" partition though, maybe concatenate kernel+ramdisk to use with initramfs kernels instead?
- - - -
From: Anton Vorontsov <[email protected]>
Subject: [PATCH] [POWERPC] MPC8568E-MDS: create localbus node, add flash support
This patch:
- creates localbus node;
- moves bcsr into it;
- creates flash node (1 32MB Spansion x16 CFI) and its partitions;
- adds localbus to the probe path.
--- arch/powerpc/boot/dts/mpc8568mds.dts | 61 +++++++++++++++++++++++++++- arch/powerpc/platforms/85xx/mpc85xx_mds.c | 1 + 2 files changed, 59 insertions(+), 3 deletions(-)
arch/powerpc/boot/dts/mpc8568mds.dts +58 -3
@@ -42,9 +42,64 @@ reg = <00000000 10000000>; }; - bcsr@f8000000 { - device_type = "board-control"; - reg = <f8000000 8000>; + localbus@e0005000 { + #address-cells = <2>; + #size-cells = <1>; + compatible = "fsl,mpc8568-localbus"; + reg = <e0005000 d8>; + ranges = <1 0 f8000000 0008000 + 0 0 fe000000 2000000>; + + bcsr@1,0 { + device_type = "board-control"; + reg = <1 0 8000>; + }; + + flash@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash"; + reg = <0 0 2000000>; + bank-width = <2>; + device-width = <1>; + + hrcw@0 { + label = "hrcw"; + reg = <0 20000>; + read-only; + }; + + uboot@1f80000 { + label = "u-boot"; + reg = <1f80000 80000>; + read-only; + }; + + rootfs@20000 { + label = "rootfs"; + reg = <20000 17e0000>; + }; + + kernel@1800000 { + label = "kernel"; + reg = <1800000 200000>; + }; + + ramdisk@1a00000 { + label = "ramdisk"; + reg = <1a00000 500000>; + }; + + dtb@1f00000 { + label = "dtb"; + reg = <1f00000 20000>; + }; + + spare@1f20000 { + label = "spare"; + reg = <1f20000 60000>; + }; + }; }; soc8568@e0000000 {
arch/powerpc/platforms/85xx/mpc85xx_mds.c +1 -0
@@ -139,6 +139,7 @@ static struct of_device_id mpc85xx_ids[] = { { .type = "soc", }, { .compatible = "soc", }, { .type = "qe", }, + { .compatible = "fsl,mpc8568-localbus", }, {}, };
Signature · 1 line
1.5.0.6