Skip to contentSkip to conversation

MPC8272ADS: fix device tree for 8 MB flash size

PATCH Applied Wolfgang Denk 4 participants 6 messages May 12, 2009 – Jun 11, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MPC8272ADS: fix device tree for 8 MB flash size

The current device tree for the MPC8272ADS assumes a mapping of 32 MB of NOR flash at 0xFE00.0000, while there are actually only 8 MB on the boards, mapped at 0xFF80.0000. When booting an uImage with such a device tree, the kernel crashes because 0xFE00.0000 is not mapped.

Also introduce aliases for serial[01] and ethernet[01].

---
I am not really sure what the typical flash size on MPC8272ADS boards is. The board I used for testing is marked as "Prototype", so it may not be the release configuration. On the other hand, the manual also says 8 MB, Vitaly Borduk confirms 8 MB on his board, too, and Scott Wood eventually tested only with cuImage which fixes up the localbus mappings, thus eventually concealing the issue.

I'm posting this as reference in case the 8 MB should turn out to be correct. -- wd

 arch/powerpc/boot/dts/mpc8272ads.dts |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)
arch/powerpc/boot/dts/mpc8272ads.dts +13 -6
index 2a1929a..60f3327 100644
@@ -17,6 +17,13 @@
 	#address-cells = <1>;
 	#size-cells = <1>;
 
+	aliases {
+		ethernet0 = &eth0;
+		ethernet1 = &eth1;
+		serial0 = &scc1;
+		serial1 = &scc4;
+	};
+
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
@@ -46,13 +53,13 @@
 		#size-cells = <1>;
 		reg = <0xf0010100 0x40>;
 
-		ranges = <0x0 0x0 0xfe000000 0x2000000
+		ranges = <0x0 0x0 0xff800000 0x00800000
 		          0x1 0x0 0xf4500000 0x8000
 		          0x3 0x0 0xf8200000 0x8000>;
 
 		flash@0,0 {
 			compatible = "jedec-flash";
-			reg = <0x0 0x0 0x2000000>;
+			reg = <0x0 0x0 0x00800000>;
 			bank-width = <4>;
 			device-width = <1>;
 		};
@@ -144,7 +151,7 @@
 				reg = <0x119f0 0x10 0x115f0 0x10>;
 			};
 
-			serial@11a00 {
+			scc1: serial@11a00 {
 				device_type = "serial";
 				compatible = "fsl,mpc8272-scc-uart",
 				             "fsl,cpm2-scc-uart";
@@ -155,7 +162,7 @@
 				fsl,cpm-command = <0x800000>;
 			};
 
-			serial@11a60 {
+			scc4: serial@11a60 {
 				device_type = "serial";
 				compatible = "fsl,mpc8272-scc-uart",
 				             "fsl,cpm2-scc-uart";
@@ -192,7 +199,7 @@
 				};
 			};
 
-			ethernet@11300 {
+			eth0: ethernet@11300 {
 				device_type = "network";
 				compatible = "fsl,mpc8272-fcc-enet",
 				             "fsl,cpm2-fcc-enet";
@@ -205,7 +212,7 @@
 				fsl,cpm-command = <0x12000300>;
 			};
 
-			ethernet@11320 {
+			eth1: ethernet@11320 {
 				device_type = "network";
 				compatible = "fsl,mpc8272-fcc-enet",
 				             "fsl,cpm2-fcc-enet";
Signature · 1 line
1.6.0.6
#1 lore raw
Quoted 10 lines · Wolfgang Denk

The current device tree for the MPC8272ADS assumes a mapping of 32 MB of NOR flash at 0xFE00.0000, while there are actually only 8 MB on the boards, mapped at 0xFF80.0000. When booting an uImage with such a device tree, the kernel crashes because 0xFE00.0000 is not mapped.

Also introduce aliases for serial[01] and ethernet[01].

Quoted 7 lines

---
I am not really sure what the typical flash size on MPC8272ADS boards is. The board I used for testing is marked as "Prototype", so it may not be the release configuration. On the other hand, the manual also says 8 MB, Vitaly Borduk confirms 8 MB on his board, too, and Scott Wood eventually tested only with cuImage which fixes up the localbus mappings, thus eventually concealing the issue.

The latest reference board I got also has an 8MB SIMM flash module shipped in the box.

Quoted 3 lines

I'm posting this as reference in case the 8 MB should turn out to be correct. -- wd

Although 8MB seems to be the common size used. It can be very easy changed as a pluggable module. It might be better to make the code working for any reasonable flash sizes.

- Leo

#2 lore raw

Dear Li Yang,

Quoted 4 lines · In message <[email protected]> you…

Although 8MB seems to be the common size used. It can be very easy changed as a pluggable module. It might be better to make the code working for any reasonable flash sizes.

You either have to provide a correct device tree for your board, or use a boot loader / boot wrapper that fixes the flash base address and size.

At the moment, U-Boot does not contain any code yet to do that (patches welcome :-), and as far as I understand the cuImage wrapper works just the other way round: it adjusts the mappings to the settings in the device tree, which may or may not match the actual hardware. This may work, but at least gives you a different flash memory map in Linux than what you had before in U-Boot, so it's not really nice either.

Hm... it seems the majority of MPC8272ADS boards seems to come indeed with 8 MB NOR flash, so I wonder if the patch should actually go in?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
In accord with UNIX philosophy, Perl gives you enough  rope  to  hang
yourself.              - L. Wall & R. L. Schwartz, _Programming Perl_
#3 lore raw
Quoted 22 lines · Wolfgang Denk

Dear Li Yang,

In message <[email protected]

Quoted 5 lines

you wrote:

Although 8MB seems to be the common size used. It can be very easy changed as a pluggable module. It might be better to make the code working for any reasonable flash sizes.

You either have to provide a correct device tree for your board, or use a boot loader / boot wrapper that fixes the flash base address and size.

At the moment, U-Boot does not contain any code yet to do that (patches welcome :-), and as far as I understand the cuImage wrapper works just the other way round: it adjusts the mappings to the settings in the device tree, which may or may not match the actual hardware. This may work, but at least gives you a different flash memory map in Linux than what you had before in U-Boot, so it's not really nice either.

Quoted 6 lines

Hm... it seems the majority of MPC8272ADS boards seems to come indeed with 8 MB NOR flash, so I wonder if the patch should actually go in?

Best regards,

Wolfgang Denk

Scott, any feedback if our boards have 8M or 32M flash modules?

- k

#4 lore raw
Quoted 1 line · Kumar Gala

Scott, any feedback if our boards have 8M or 32M flash modules?

According to the manual, it comes with 8 but can be expanded to 32. I don't think we swapped out the flash SIMM that came with the board.

As I wrote earlier in the thread, I don't see any way a current u-boot would enable more than 8MiB of flash on this board anyway. I'd go ahead and apply the patch.

-Scott

Applied
#5 lore raw
In reply to Wolfgang Denk
Quoted 18 lines · Wolfgang Denk

The current device tree for the MPC8272ADS assumes a mapping of 32 MB of NOR flash at 0xFE00.0000, while there are actually only 8 MB on the boards, mapped at 0xFF80.0000. When booting an uImage with such a device tree, the kernel crashes because 0xFE00.0000 is not mapped.

Also introduce aliases for serial[01] and ethernet[01].

---
I am not really sure what the typical flash size on MPC8272ADS boards is. The board I used for testing is marked as "Prototype", so it may not be the release configuration. On the other hand, the manual also says 8 MB, Vitaly Borduk confirms 8 MB on his board, too, and Scott Wood eventually tested only with cuImage which fixes up the localbus mappings, thus eventually concealing the issue.

Quoted 5 lines

I'm posting this as reference in case the 8 MB should turn out to be correct. -- wd

arch/powerpc/boot/dts/mpc8272ads.dts | 19 +++++++++++++------

1 files changed, 13 insertions(+), 6 deletions(-)

applied to next.

- k