Skip to contentSkip to conversation

ARM: bcm2835: dt: fix memory of Raspberry Pi B+

PATCH New Stefan Wahren 4 participants 4 messages Oct 15, 2015 – Oct 21, 2015

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

PATCH 1/1 ARM: bcm2835: dt: fix memory of Raspberry Pi B+

Since the Raspberry Pi models differ in memory amount we better define it at board level. After that we are able to fix the memory node of the Raspberry Pi B+ .

---
 arch/arm/boot/dts/bcm2835-rpi-a-plus.dts |    4 ++++
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts |    4 ++++
 arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts |    4 ++++
 arch/arm/boot/dts/bcm2835-rpi-b.dts      |    4 ++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi       |    4 ----
 5 files changed, 16 insertions(+), 4 deletions(-)

This patch is only compile-tested.

arch/arm/boot/dts/bcm2835-rpi-a-plus.dts +4 -0
index b2bff43..c08dff2 100644
@@ -5,6 +5,10 @@
 	compatible = "raspberrypi,model-a-plus", "brcm,bcm2835";
 	model = "Raspberry Pi Model A+";
 
+	memory {
+		reg = <0 0x10000000>; /* 256 MB */
+	};
+
 	leds {
 		act {
 			gpios = <&gpio 47 0>;
arch/arm/boot/dts/bcm2835-rpi-b-plus.dts +4 -0
index 668442b..b4a1e56 100644
@@ -5,6 +5,10 @@
 	compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
 	model = "Raspberry Pi Model B+";
 
+	memory {
+		reg = <0 0x20000000>; /* 512 MB */
+	};
+
 	leds {
 		act {
 			gpios = <&gpio 47 0>;
arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts +4 -0
index eab8b591..e6ccfab 100644
@@ -5,6 +5,10 @@
 	compatible = "raspberrypi,model-b-rev2", "brcm,bcm2835";
 	model = "Raspberry Pi Model B rev2";
 
+	memory {
+		reg = <0 0x10000000>; /* 256 MB */
+	};
+
 	leds {
 		act {
 			gpios = <&gpio 16 1>;
arch/arm/boot/dts/bcm2835-rpi-b.dts +4 -0
index ff6b2d1..bfd917c 100644
@@ -5,6 +5,10 @@
 	compatible = "raspberrypi,model-b", "brcm,bcm2835";
 	model = "Raspberry Pi Model B";
 
+	memory {
+		reg = <0 0x10000000>; /* 256 MB */
+	};
+
 	leds {
 		act {
 			gpios = <&gpio 16 1>;
arch/arm/boot/dts/bcm2835-rpi.dtsi +0 -4
index 3572f03..d1c6538 100644
@@ -1,10 +1,6 @@
 #include "bcm2835.dtsi"
 
 / {
-	memory {
-		reg = <0 0x10000000>;
-	};
-
 	leds {
 		compatible = "gpio-leds";
 
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 ARM: bcm2835: dt: fix memory of Raspberry Pi B+

Quoted 65 lines · Stefan Wahren

Since the Raspberry Pi models differ in memory amount we better define it at board level. After that we are able to fix the memory node of the Raspberry Pi B+ .

---
 arch/arm/boot/dts/bcm2835-rpi-a-plus.dts |    4 ++++
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts |    4 ++++
 arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts |    4 ++++
 arch/arm/boot/dts/bcm2835-rpi-b.dts      |    4 ++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi       |    4 ----
 5 files changed, 16 insertions(+), 4 deletions(-)

This patch is only compile-tested.

arch/arm/boot/dts/bcm2835-rpi-a-plus.dts +4 -0
index b2bff43..c08dff2 100644
@@ -5,6 +5,10 @@
 	compatible = "raspberrypi,model-a-plus", "brcm,bcm2835";
 	model = "Raspberry Pi Model A+";
 
+	memory {
+		reg = <0 0x10000000>; /* 256 MB */
+	};
+
 	leds {
 		act {
 			gpios = <&gpio 47 0>;
arch/arm/boot/dts/bcm2835-rpi-b-plus.dts +4 -0
index 668442b..b4a1e56 100644
@@ -5,6 +5,10 @@
 	compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
 	model = "Raspberry Pi Model B+";
 
+	memory {
+		reg = <0 0x20000000>; /* 512 MB */
+	};
+
 	leds {
 		act {
 			gpios = <&gpio 47 0>;
arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts +4 -0
index eab8b591..e6ccfab 100644
@@ -5,6 +5,10 @@
 	compatible = "raspberrypi,model-b-rev2", "brcm,bcm2835";
 	model = "Raspberry Pi Model B rev2";
 
+	memory {
+		reg = <0 0x10000000>; /* 256 MB */
+	};
+
 	leds {
 		act {
 			gpios = <&gpio 16 1>;
arch/arm/boot/dts/bcm2835-rpi-b.dts +0 -0
index ff6b2d1..bfd917c 100644

arch/arm/boot/dts/bcm2835-rpi-b.dts line 14

Quoted 10 lines
arch/arm/boot/dts/bcm2835-rpi-b.dts +4 -0
@@ -5,6 +5,10 @@
 	compatible = "raspberrypi,model-b", "brcm,bcm2835";
 	model = "Raspberry Pi Model B";
 
+	memory {
+		reg = <0 0x10000000>; /* 256 MB */
+	};
+
 	leds {
 		act {
 			gpios = <&gpio 16 1>;

Seems like a good idea. The closed firmware passes us an edited devicetree with good memory fields, but I don't think U-Boot is up to it if you chainload it.

However, isn't the rpi-b-rev2 the 512MB variant of the rpi-b?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151020/2a404502/attachment.sig>

#2 lore raw

PATCH 1/1 ARM: bcm2835: dt: fix memory of Raspberry Pi B+

Am 20.10.2015 um 10:53 schrieb Eric Anholt:

Quoted 6 lines
Quoted 4 lines · Stefan Wahren

Since the Raspberry Pi models differ in memory amount we better define it at board level. After that we are able to fix the memory node of the Raspberry Pi B+ .

Quoted 9 lines
Quoted 1 line

[...]

Seems like a good idea. The closed firmware passes us an edited devicetree with good memory fields, but I don't think U-Boot is up to it if you chainload it.

However, isn't the rpi-b-rev2 the 512MB variant of the rpi-b?

Unfortunately not. There are rev2 boards with 256 MB and with 512 MB RAM [1]. I'm not sure it is worth to create 2 dts files for both.

[1] - http://elinux.org/Board_revisions

#3 lore raw

PATCH 1/1 ARM: bcm2835: dt: fix memory of Raspberry Pi B+

In reply to Eric Anholt
Quoted 9 lines · Eric Anholt
Quoted 6 lines · Stefan Wahren

Since the Raspberry Pi models differ in memory amount we better define it at board level. After that we are able to fix the memory node of the Raspberry Pi B+ .

arch/arm/boot/dts/bcm2835-rpi-a-plus.dts +0 -0
Quoted 6 lines

arch/arm/boot/dts/bcm2835-rpi-a-plus.dts

Quoted 1 line
arch/arm/boot/dts/bcm2835-rpi-a-plus.dts +1 -0
+	memory { +		reg = <0 0x10000000>; /* 256 MB */ +	}; +

Seems like a good idea. The closed firmware passes us an edited devicetree with good memory fields, but I don't think U-Boot is up to it if you chainload it.

U-Boot fills in the memory size in DT correctly too.

I have no objection to the patch since it looks correct at a very brief glance, but I think it will have zero practical effect.