public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: bcm2835: add device tree for Raspberry Pi model B+
@ 2014-10-28  0:52 Matthias Klein
  2014-10-29  1:33 ` Stephen Warren
  0 siblings, 1 reply; 7+ messages in thread
From: Matthias Klein @ 2014-10-28  0:52 UTC (permalink / raw)
  To: linux-rpi-kernel, swarren; +Cc: linux-kernel

The model B and B+ differ in the GPIO lines for ACT and PWR led.
The PWR led on the B+ model is active low.

Signed-off-by: Matthias Klein <matthias.klein@linux.com>
---
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 64 ++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts

diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
new file mode 100644
index 0000000..c01d7cb
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
@@ -0,0 +1,64 @@
+/dts-v1/;
+/include/ "bcm2835.dtsi"
+
+/ {
+	compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
+	model = "Raspberry Pi Model B+";
+
+	memory {
+		reg = <0 0x10000000>;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		act {
+			label = "ACT";
+			gpios = <&gpio 47 1>;
+			default-state = "keep";
+			linux,default-trigger = "heartbeat";
+		};
+
+		pwr {
+			label = "PWR";
+			gpios = <&gpio 35 0>;
+			default-state = "keep";
+			linux,default-trigger = "default-on";
+		};
+	};
+};
+
+&gpio {
+	pinctrl-names = "default";
+	pinctrl-0 = <&gpioout &alt0 &alt3>;
+
+	gpioout: gpioout {
+		brcm,pins = <6>;
+		brcm,function = <1>; /* GPIO out */
+	};
+
+	alt0: alt0 {
+		brcm,pins = <0 1 2 3 4 5 7 8 9 10 11 14 15 40 45>;
+		brcm,function = <4>; /* alt0 */
+	};
+
+	alt3: alt3 {
+		brcm,pins = <48 49 50 51 52 53>;
+		brcm,function = <7>; /* alt3 */
+	};
+};
+
+&i2c0 {
+	status = "okay";
+	clock-frequency = <100000>;
+};
+
+&i2c1 {
+	status = "okay";
+	clock-frequency = <100000>;
+};
+
+&mmc {
+	status = "okay";
+	bus-width = <4>;
+};
-- 
2.1.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: bcm2835: add device tree for Raspberry Pi model B+
  2014-10-28  0:52 [PATCH] ARM: bcm2835: add " Matthias Klein
@ 2014-10-29  1:33 ` Stephen Warren
  2014-10-29  9:07   ` Matthias Klein
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Warren @ 2014-10-29  1:33 UTC (permalink / raw)
  To: Matthias Klein, linux-rpi-kernel; +Cc: linux-kernel

On 10/27/2014 06:52 PM, Matthias Klein wrote:
> The model B and B+ differ in the GPIO lines for ACT and PWR led.
> The PWR led on the B+ model is active low.

This new file is almost identical to bcm2835-rpi.dts. Perhaps we can use
some include files to share the common portions so they aren't
duplicated. Roughly:

* Move all the common content from bcm2835-rpi.dts into bcm2835-rpi.dtsi.

* Update bcm2835-rpi.dts to include bcm2835-rpi.dtsi to get all the
common parts, and add the few lines of differences.

* Update this patch similarly.

Does that make sense?

A couple changes to this patch and the existing bcm2835-rpi.dts might
reduce the differences even further, leading to more common code in
bcm2835-rpi.dtsi:

- Add the PWR LED to bcm2835-rpi-b.dts, if appropriate.
- Add the I2S pinmux settings for B+ too.

> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
...
> +&mmc {

That label doesn't exist; it should be &sdhci. Consequently:

> Error: arch/arm/boot/dts/bcm2835-rpi-b-plus.dts:64.2-3 label or path, 'mmc', not found
> FATAL ERROR: Syntax error parsing input tree
> make[1]: *** [arch/arm/boot/dts/bcm2835-rpi-b-plus.dtb] Error 1

This new DT file should be added to arch/arm/boot/dts/Makefile too.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: bcm2835: add device tree for Raspberry Pi model B+
  2014-10-29  1:33 ` Stephen Warren
@ 2014-10-29  9:07   ` Matthias Klein
  2014-10-29 16:40     ` Stephen Warren
  0 siblings, 1 reply; 7+ messages in thread
From: Matthias Klein @ 2014-10-29  9:07 UTC (permalink / raw)
  To: Stephen Warren, linux-rpi-kernel; +Cc: linux-kernel


Am 29.10.2014 um 02:33 schrieb Stephen Warren:
> On 10/27/2014 06:52 PM, Matthias Klein wrote:
>> The model B and B+ differ in the GPIO lines for ACT and PWR led.
>> The PWR led on the B+ model is active low.
> This new file is almost identical to bcm2835-rpi.dts. Perhaps we can use
> some include files to share the common portions so they aren't
> duplicated. Roughly:
>
> * Move all the common content from bcm2835-rpi.dts into bcm2835-rpi.dtsi.
>
> * Update bcm2835-rpi.dts to include bcm2835-rpi.dtsi to get all the
> common parts, and add the few lines of differences.
>
> * Update this patch similarly.
>
> Does that make sense?
Yes, I will work on such a patchset.

>
> A couple changes to this patch and the existing bcm2835-rpi.dts might
> reduce the differences even further, leading to more common code in
> bcm2835-rpi.dtsi:
>
> - Add the PWR LED to bcm2835-rpi-b.dts, if appropriate.
> - Add the I2S pinmux settings for B+ too.
>
>> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> ...
>> +&mmc {
> That label doesn't exist; it should be &sdhci. Consequently:

Sorry, I based my patch on the wrong tree. I used 
https://github.com/pietrushnic/rpi-dt-linux/tree/rpi-3.17.y which 
contains non upstream commits.

Which tree should I use in general for work on the BCM2835? Is 
linux-next the right tree?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: bcm2835: add device tree for Raspberry Pi model B+
  2014-10-29  9:07   ` Matthias Klein
@ 2014-10-29 16:40     ` Stephen Warren
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Warren @ 2014-10-29 16:40 UTC (permalink / raw)
  To: Matthias Klein, linux-rpi-kernel; +Cc: linux-kernel

On 10/29/2014 03:07 AM, Matthias Klein wrote:
>
> Am 29.10.2014 um 02:33 schrieb Stephen Warren:
>> On 10/27/2014 06:52 PM, Matthias Klein wrote:
>>> The model B and B+ differ in the GPIO lines for ACT and PWR led.
>>> The PWR led on the B+ model is active low.
>> This new file is almost identical to bcm2835-rpi.dts. Perhaps we can use
>> some include files to share the common portions so they aren't
>> duplicated. Roughly:
>>
>> * Move all the common content from bcm2835-rpi.dts into bcm2835-rpi.dtsi.
>>
>> * Update bcm2835-rpi.dts to include bcm2835-rpi.dtsi to get all the
>> common parts, and add the few lines of differences.
>>
>> * Update this patch similarly.
>>
>> Does that make sense?
> Yes, I will work on such a patchset.
>
>>
>> A couple changes to this patch and the existing bcm2835-rpi.dts might
>> reduce the differences even further, leading to more common code in
>> bcm2835-rpi.dtsi:
>>
>> - Add the PWR LED to bcm2835-rpi-b.dts, if appropriate.
>> - Add the I2S pinmux settings for B+ too.
>>
>>> diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
>>> b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
>> ...
>>> +&mmc {
>> That label doesn't exist; it should be &sdhci. Consequently:
>
> Sorry, I based my patch on the wrong tree. I used
> https://github.com/pietrushnic/rpi-dt-linux/tree/rpi-3.17.y which
> contains non upstream commits.
>
> Which tree should I use in general for work on the BCM2835? Is
> linux-next the right tree?

linux-next would usually work.

The most recent Linus kernel would also often be a good base, or perhaps 
any recent branch (of which there are none at present) in:

https://git.kernel.org/cgit/linux/kernel/git/swarren/linux-rpi.git/
(
which will hopefully soon move to:
https://git.kernel.org/cgit/linux/kernel/git/rpi/linux-rpi.git/
)

Which you pick depends on things like how many other patches touch the 
same files, and which branches/repos they were applied in, and what 
conflicts/dependencies exist.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: bcm2835: Add device tree for Raspberry Pi model B+
@ 2014-11-20 10:52 Lee Jones
  2014-11-20 11:18 ` Arnd Bergmann
  0 siblings, 1 reply; 7+ messages in thread
From: Lee Jones @ 2014-11-20 10:52 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel; +Cc: arm, Matthias Klein, Lee Jones

From: Matthias Klein <matthias.klein@linux.com>

The model B and B+ differ in the GPIO lines for ACT and PWR leds, and the
I2S interface.

Signed-off-by: Matthias Klein <matthias.klein@linux.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---

As requested by Arnd.

 arch/arm/boot/dts/Makefile               |  1 +
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 30 +++++++++++++++++++
 arch/arm/boot/dts/bcm2835-rpi-b.dts      | 46 ++--------------------------
 arch/arm/boot/dts/bcm2835-rpi.dtsi       | 51 ++++++++++++++++++++++++++++++++
 4 files changed, 85 insertions(+), 43 deletions(-)
 create mode 100644 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
 create mode 100644 arch/arm/boot/dts/bcm2835-rpi.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 38c89ca..cbf7db6 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -54,6 +54,7 @@ dtb-$(CONFIG_ARCH_AT91)	+= at91-sama5d4ek.dtb
 dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb
 dtb-$(CONFIG_ARCH_AXXIA) += axm5516-amarillo.dtb
 dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
+dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b-plus.dtb
 dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb
 dtb-$(CONFIG_ARCH_BCM_63XX) += bcm963138dvt.dtb
 dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm28155-ap.dtb \
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
new file mode 100644
index 0000000..e479515
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
@@ -0,0 +1,30 @@
+/dts-v1/;
+/include/ "bcm2835-rpi.dtsi"
+
+/ {
+	compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
+	model = "Raspberry Pi Model B+";
+
+	leds {
+		act {
+			gpios = <&gpio 47 0>;
+		};
+
+		pwr {
+			label = "PWR";
+			gpios = <&gpio 35 0>;
+			default-state = "keep";
+			linux,default-trigger = "default-on";
+		};
+	};
+};
+
+&gpio {
+	pinctrl-0 = <&gpioout &alt0 &i2s_alt0 &alt3>;
+
+	/* I2S interface */
+	i2s_alt0: i2s_alt0 {
+		brcm,pins = <18 19 20 21>;
+		brcm,function = <4>; /* alt0 */
+	};
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts
index 58a0d60..bafa46f 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
@@ -1,63 +1,23 @@
 /dts-v1/;
-/include/ "bcm2835.dtsi"
+/include/ "bcm2835-rpi.dtsi"
 
 / {
 	compatible = "raspberrypi,model-b", "brcm,bcm2835";
 	model = "Raspberry Pi Model B";
 
-	memory {
-		reg = <0 0x10000000>;
-	};
-
 	leds {
-		compatible = "gpio-leds";
-
 		act {
-			label = "ACT";
 			gpios = <&gpio 16 1>;
-			default-state = "keep";
-			linux,default-trigger = "heartbeat";
 		};
 	};
 };
 
 &gpio {
-	pinctrl-names = "default";
-	pinctrl-0 = <&gpioout &alt0 &alt2 &alt3>;
-
-	gpioout: gpioout {
-		brcm,pins = <6>;
-		brcm,function = <1>; /* GPIO out */
-	};
-
-	alt0: alt0 {
-		brcm,pins = <0 1 2 3 4 5 7 8 9 10 11 14 15 40 45>;
-		brcm,function = <4>; /* alt0 */
-	};
-
-	alt3: alt3 {
-		brcm,pins = <48 49 50 51 52 53>;
-		brcm,function = <7>; /* alt3 */
-	};
+	pinctrl-0 = <&gpioout &alt0 &i2s_alt2 &alt3>;
 
 	/* I2S interface */
-	alt2: alt2 {
+	i2s_alt2: i2s_alt2 {
 		brcm,pins = <28 29 30 31>;
 		brcm,function = <6>; /* alt2 */
 	};
 };
-
-&i2c0 {
-	status = "okay";
-	clock-frequency = <100000>;
-};
-
-&i2c1 {
-	status = "okay";
-	clock-frequency = <100000>;
-};
-
-&sdhci {
-	status = "okay";
-	bus-width = <4>;
-};
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
new file mode 100644
index 0000000..c706448
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
@@ -0,0 +1,51 @@
+/include/ "bcm2835.dtsi"
+
+/ {
+	memory {
+		reg = <0 0x10000000>;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		act {
+			label = "ACT";
+			default-state = "keep";
+			linux,default-trigger = "heartbeat";
+		};
+	};
+};
+
+&gpio {
+	pinctrl-names = "default";
+
+	gpioout: gpioout {
+		brcm,pins = <6>;
+		brcm,function = <1>; /* GPIO out */
+	};
+
+	alt0: alt0 {
+		brcm,pins = <0 1 2 3 4 5 7 8 9 10 11 14 15 40 45>;
+		brcm,function = <4>; /* alt0 */
+	};
+
+	alt3: alt3 {
+		brcm,pins = <48 49 50 51 52 53>;
+		brcm,function = <7>; /* alt3 */
+	};
+};
+
+&i2c0 {
+	status = "okay";
+	clock-frequency = <100000>;
+};
+
+&i2c1 {
+	status = "okay";
+	clock-frequency = <100000>;
+};
+
+&sdhci {
+	status = "okay";
+	bus-width = <4>;
+};
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: bcm2835: Add device tree for Raspberry Pi model B+
  2014-11-20 10:52 [PATCH] ARM: bcm2835: Add device tree for Raspberry Pi model B+ Lee Jones
@ 2014-11-20 11:18 ` Arnd Bergmann
  2014-11-20 11:22   ` Lee Jones
  0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2014-11-20 11:18 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Lee Jones, linux-kernel, arm, Lee Jones, Matthias Klein

On Thursday 20 November 2014 10:52:45 Lee Jones wrote:
> From: Matthias Klein <matthias.klein@linux.com>
> 
> The model B and B+ differ in the GPIO lines for ACT and PWR leds, and the
> I2S interface.
> 
> Signed-off-by: Matthias Klein <matthias.klein@linux.com>
> Tested-by: Stephen Warren <swarren@nvidia.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
> 
> As requested by Arnd.
> 
>  arch/arm/boot/dts/Makefile               |  1 +
>  arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 30 +++++++++++++++++++
>  arch/arm/boot/dts/bcm2835-rpi-b.dts      | 46 ++--------------------------
>  arch/arm/boot/dts/bcm2835-rpi.dtsi       | 51 ++++++++++++++++++++++++++++++++
>  4 files changed, 85 insertions(+), 43 deletions(-)
>  create mode 100644 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
>  create mode 100644 arch/arm/boot/dts/bcm2835-rpi.dtsi
> 

Applied to next/dt.

When you send a patch for inclusion the next time, better
be explicit and ask for it to be picked up into arm-soc, so we
know it's not just for review.

Thanks,

	Arnd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM: bcm2835: Add device tree for Raspberry Pi model B+
  2014-11-20 11:18 ` Arnd Bergmann
@ 2014-11-20 11:22   ` Lee Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2014-11-20 11:22 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-kernel, arm, Lee Jones, Matthias Klein

On Thu, 20 Nov 2014, Arnd Bergmann wrote:

> On Thursday 20 November 2014 10:52:45 Lee Jones wrote:
> > From: Matthias Klein <matthias.klein@linux.com>
> > 
> > The model B and B+ differ in the GPIO lines for ACT and PWR leds, and the
> > I2S interface.
> > 
> > Signed-off-by: Matthias Klein <matthias.klein@linux.com>
> > Tested-by: Stephen Warren <swarren@nvidia.com>
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > ---
> > 
> > As requested by Arnd.
> > 
> >  arch/arm/boot/dts/Makefile               |  1 +
> >  arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 30 +++++++++++++++++++
> >  arch/arm/boot/dts/bcm2835-rpi-b.dts      | 46 ++--------------------------
> >  arch/arm/boot/dts/bcm2835-rpi.dtsi       | 51 ++++++++++++++++++++++++++++++++
> >  4 files changed, 85 insertions(+), 43 deletions(-)
> >  create mode 100644 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
> >  create mode 100644 arch/arm/boot/dts/bcm2835-rpi.dtsi
> > 
> 
> Applied to next/dt.
> 
> When you send a patch for inclusion the next time, better
> be explicit and ask for it to be picked up into arm-soc, so we
> know it's not just for review.

Sounds reasonable.  Thanks Arnd.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-11-20 11:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-20 10:52 [PATCH] ARM: bcm2835: Add device tree for Raspberry Pi model B+ Lee Jones
2014-11-20 11:18 ` Arnd Bergmann
2014-11-20 11:22   ` Lee Jones
  -- strict thread matches above, loose matches on Subject: below --
2014-10-28  0:52 [PATCH] ARM: bcm2835: add " Matthias Klein
2014-10-29  1:33 ` Stephen Warren
2014-10-29  9:07   ` Matthias Klein
2014-10-29 16:40     ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox