devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: bcm283x: Raspberry Pi Zero W support
@ 2017-07-20 19:37 Stefan Wahren
  2017-07-20 19:37 ` [PATCH 1/3] ARM: bcm283x: Define UART pinmuxing on board level Stefan Wahren
       [not found] ` <1500579429-9101-1-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Wahren @ 2017-07-20 19:37 UTC (permalink / raw)
  To: Eric Anholt, Rob Herring, Mark Rutland
  Cc: Florian Fainelli, Scott Branden,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Gerd Hoffmann,
	Stefan Wahren

This patch series adds support for the Raspberry Pi Zero W. It depends
on "ARM: bcm283x: Move the BCM2837 DT contents from arm64 to arm."

Currently there is a regression [1] in the brcmfmac driver. This hack [2]
avoids the issue and make wifi probe on RPi Zero W.

[1] - http://marc.info/?l=linux-wireless&m=150029709021719&w=2
[2] - https://github.com/lategoodbye/rpi-zero/commit/95ef5b8fbc05d9ec086970648767cafa10483622

Stefan Wahren (3):
  ARM: bcm283x: Define UART pinmuxing on board level
  dt-bindings: bcm: Add Raspberry Pi Zero W
  ARM: dts: bcm2835: Add Raspberry Pi Zero W

 .../devicetree/bindings/arm/bcm/brcm,bcm2835.txt   |  4 ++
 arch/arm/boot/dts/Makefile                         |  3 +-
 arch/arm/boot/dts/bcm2835-rpi-a-plus.dts           |  6 ++
 arch/arm/boot/dts/bcm2835-rpi-a.dts                |  6 ++
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts           |  6 ++
 arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts           |  6 ++
 arch/arm/boot/dts/bcm2835-rpi-b.dts                |  6 ++
 arch/arm/boot/dts/bcm2835-rpi-zero-w.dts           | 73 ++++++++++++++++++++++
 arch/arm/boot/dts/bcm2835-rpi-zero.dts             |  6 ++
 arch/arm/boot/dts/bcm2835-rpi.dtsi                 |  2 +-
 arch/arm/boot/dts/bcm2836-rpi-2-b.dts              |  6 ++
 arch/arm/boot/dts/bcm2837-rpi-3-b.dts              | 10 +++
 12 files changed, 132 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/bcm2835-rpi-zero-w.dts

-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 1/3] ARM: bcm283x: Define UART pinmuxing on board level
  2017-07-20 19:37 [PATCH 0/3] ARM: bcm283x: Raspberry Pi Zero W support Stefan Wahren
@ 2017-07-20 19:37 ` Stefan Wahren
       [not found] ` <1500579429-9101-1-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Wahren @ 2017-07-20 19:37 UTC (permalink / raw)
  To: Eric Anholt, Rob Herring, Mark Rutland
  Cc: Stefan Wahren, devicetree, Florian Fainelli, Scott Branden,
	linux-rpi-kernel, linux-arm-kernel, Gerd Hoffmann

Until RPI 3 and Zero W the pl011 (uart0) was always on pin 14/15. So in
order to take care of them and other boards in the future,
we need to define UART pinmuxing on board level.

This work based on Eric Anholt's patch "ARM: bcm2385: Don't force pl011
onto pins 14/15." and Fabian Vogt's patch "ARM64: dts: bcm2837: assign
uart0 to BT and uart1 to pin headers".

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 arch/arm/boot/dts/bcm2835-rpi-a-plus.dts |  6 ++++++
 arch/arm/boot/dts/bcm2835-rpi-a.dts      |  6 ++++++
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts |  6 ++++++
 arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts |  6 ++++++
 arch/arm/boot/dts/bcm2835-rpi-b.dts      |  6 ++++++
 arch/arm/boot/dts/bcm2835-rpi-zero.dts   |  6 ++++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi       |  2 +-
 arch/arm/boot/dts/bcm2836-rpi-2-b.dts    |  6 ++++++
 arch/arm/boot/dts/bcm2837-rpi-3-b.dts    | 10 ++++++++++
 9 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts
index d070454..9f86649 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts
@@ -99,3 +99,9 @@
 &hdmi {
 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
 };
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_gpio14>;
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-a.dts b/arch/arm/boot/dts/bcm2835-rpi-a.dts
index 46d078e..4b1af06 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-a.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-a.dts
@@ -94,3 +94,9 @@
 &hdmi {
 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
 };
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_gpio14>;
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
index 432088e..a846f1e 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
@@ -101,3 +101,9 @@
 &hdmi {
 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
 };
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_gpio14>;
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
index 4133bc2..e860964 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
@@ -94,3 +94,9 @@
 &hdmi {
 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
 };
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_gpio14>;
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts
index 4d56fe3..5d77f3f 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
@@ -89,3 +89,9 @@
 &hdmi {
 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
 };
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_gpio14>;
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero.dts b/arch/arm/boot/dts/bcm2835-rpi-zero.dts
index 79a20d5..7036240 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-zero.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-zero.dts
@@ -103,3 +103,9 @@
 &hdmi {
 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
 };
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_gpio14>;
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
index e55b362..e36c392 100644
--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
@@ -39,7 +39,7 @@
 	};
 
 	alt0: alt0 {
-		brcm,pins = <4 5 7 8 9 10 11 14 15>;
+		brcm,pins = <4 5 7 8 9 10 11>;
 		brcm,function = <BCM2835_FSEL_ALT0>;
 	};
 };
diff --git a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
index bf19e8c..e8de414 100644
--- a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
+++ b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
@@ -39,3 +39,9 @@
 &hdmi {
 	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
 };
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_gpio14>;
+	status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
index 972f14d..20725ca 100644
--- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
@@ -19,7 +19,17 @@
 	};
 };
 
+/* uart0 communicates with the BT module */
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_gpio32 &gpclk2_gpio43>;
+	status = "okay";
+};
+
+/* uart1 is mapped to the pin header */
 &uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_gpio14>;
 	status = "okay";
 };
 
-- 
2.7.4

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

* [PATCH 2/3] dt-bindings: bcm: Add Raspberry Pi Zero W
       [not found] ` <1500579429-9101-1-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
@ 2017-07-20 19:37   ` Stefan Wahren
       [not found]     ` <1500579429-9101-3-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
  2017-07-20 19:37   ` [PATCH 3/3] ARM: dts: bcm2835: " Stefan Wahren
  1 sibling, 1 reply; 8+ messages in thread
From: Stefan Wahren @ 2017-07-20 19:37 UTC (permalink / raw)
  To: Eric Anholt, Rob Herring, Mark Rutland
  Cc: Florian Fainelli, Scott Branden,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Gerd Hoffmann,
	Stefan Wahren

This adds the root properties for the Raspberry Pi Zero W.

Signed-off-by: Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
Reviewed-by: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
---
 Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt b/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
index 9c97de2..3e3efa0 100644
--- a/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
+++ b/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
@@ -42,6 +42,10 @@ Raspberry Pi Zero
 Required root node properties:
 compatible = "raspberrypi,model-zero", "brcm,bcm2835";
 
+Raspberry Pi Zero W
+Required root node properties:
+compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
+
 Generic BCM2835 board
 Required root node properties:
 compatible = "brcm,bcm2835";
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 3/3] ARM: dts: bcm2835: Add Raspberry Pi Zero W
       [not found] ` <1500579429-9101-1-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
  2017-07-20 19:37   ` [PATCH 2/3] dt-bindings: bcm: Add Raspberry Pi Zero W Stefan Wahren
@ 2017-07-20 19:37   ` Stefan Wahren
       [not found]     ` <1500579429-9101-4-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
  1 sibling, 1 reply; 8+ messages in thread
From: Stefan Wahren @ 2017-07-20 19:37 UTC (permalink / raw)
  To: Eric Anholt, Rob Herring, Mark Rutland
  Cc: Florian Fainelli, Scott Branden,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Gerd Hoffmann,
	Stefan Wahren

The Raspberry Pi Zero W has the same components like the Zero plus
a Cypress CYW43438 wireless chip (wifi + bl).

Signed-off-by: Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
Reviewed-by: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
---
 arch/arm/boot/dts/Makefile               |  3 +-
 arch/arm/boot/dts/bcm2835-rpi-zero-w.dts | 73 ++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/bcm2835-rpi-zero-w.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index ec60f4f..f3bf9397 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -74,7 +74,8 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
 	bcm2835-rpi-a-plus.dtb \
 	bcm2836-rpi-2-b.dtb \
 	bcm2837-rpi-3-b.dtb \
-	bcm2835-rpi-zero.dtb
+	bcm2835-rpi-zero.dtb \
+	bcm2835-rpi-zero-w.dtb
 dtb-$(CONFIG_ARCH_BCM_5301X) += \
 	bcm4708-asus-rt-ac56u.dtb \
 	bcm4708-asus-rt-ac68u.dtb \
diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
new file mode 100644
index 0000000..9c6d714
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2017 Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include "bcm2835.dtsi"
+#include "bcm2835-rpi.dtsi"
+#include "bcm283x-rpi-usb-host.dtsi"
+
+/ {
+	compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
+	model = "Raspberry Pi Zero W";
+
+	aliases {
+		uart0 = "/soc/serial@7e201000";
+		uart1 = "/soc/serial@7e215040";
+		serial0 = "/soc/serial@7e201000";
+		serial1 = "/soc/serial@7e215040";
+	};
+
+	leds {
+		act {
+			gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	wifi_pwrseq: wifi-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl_on>;
+		reset-gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
+	};
+};
+
+&gpio {
+	pinctrl-0 = <&gpioout &alt0>;
+
+	wl_on: wl-on {
+		brcm,pins = <41>;
+		brcm,function = <BCM2835_FSEL_GPIO_OUT>;
+	};
+};
+
+&hdmi {
+	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
+};
+
+&sdhci {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	non-removable;
+	status = "okay";
+
+	brcmf: wifi@1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+	};
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_gpio14>;
+	status = "okay";
+};
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 2/3] dt-bindings: bcm: Add Raspberry Pi Zero W
       [not found]     ` <1500579429-9101-3-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
@ 2017-07-24 20:18       ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2017-07-24 20:18 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Eric Anholt, Mark Rutland, Florian Fainelli, Scott Branden,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Gerd Hoffmann

On Thu, Jul 20, 2017 at 09:37:08PM +0200, Stefan Wahren wrote:
> This adds the root properties for the Raspberry Pi Zero W.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
> Reviewed-by: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt | 4 ++++
>  1 file changed, 4 insertions(+)

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/3] ARM: dts: bcm2835: Add Raspberry Pi Zero W
       [not found]     ` <1500579429-9101-4-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
@ 2017-07-26 20:09       ` Eric Anholt
       [not found]         ` <87vamfx8nx.fsf-omZaPlIz5HhaEpDpdNBo/KxOck334EZe@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Anholt @ 2017-07-26 20:09 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland
  Cc: Florian Fainelli, Scott Branden,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Gerd Hoffmann,
	Stefan Wahren

[-- Attachment #1: Type: text/plain, Size: 3382 bytes --]

Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org> writes:

> The Raspberry Pi Zero W has the same components like the Zero plus
> a Cypress CYW43438 wireless chip (wifi + bl).

I sent out v2 of the arm64 patch so that hopefully we can get started
merging this.  Couple of comments on a re-read.

> Signed-off-by: Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
> Reviewed-by: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
> ---
>  arch/arm/boot/dts/Makefile               |  3 +-
>  arch/arm/boot/dts/bcm2835-rpi-zero-w.dts | 73 ++++++++++++++++++++++++++++++++
>  2 files changed, 75 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
>
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index ec60f4f..f3bf9397 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -74,7 +74,8 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
>  	bcm2835-rpi-a-plus.dtb \
>  	bcm2836-rpi-2-b.dtb \
>  	bcm2837-rpi-3-b.dtb \
> -	bcm2835-rpi-zero.dtb
> +	bcm2835-rpi-zero.dtb \
> +	bcm2835-rpi-zero-w.dtb
>  dtb-$(CONFIG_ARCH_BCM_5301X) += \
>  	bcm4708-asus-rt-ac56u.dtb \
>  	bcm4708-asus-rt-ac68u.dtb \
> diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
> new file mode 100644
> index 0000000..9c6d714
> --- /dev/null
> +++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
> @@ -0,0 +1,73 @@
> +/*
> + * Copyright (C) 2017 Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
> + *
> + * The code contained herein is licensed under the GNU General Public
> + * License. You may obtain a copy of the GNU General Public License
> + * Version 2 or later at the following locations:
> + *
> + * http://www.opensource.org/licenses/gpl-license.html
> + * http://www.gnu.org/copyleft/gpl.html
> + */
> +
> +/dts-v1/;
> +#include "bcm2835.dtsi"
> +#include "bcm2835-rpi.dtsi"
> +#include "bcm283x-rpi-usb-host.dtsi"
> +
> +/ {
> +	compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
> +	model = "Raspberry Pi Zero W";
> +
> +	aliases {
> +		uart0 = "/soc/serial@7e201000";
> +		uart1 = "/soc/serial@7e215040";
> +		serial0 = "/soc/serial@7e201000";
> +		serial1 = "/soc/serial@7e215040";
> +	};

Should we have this in the other board DTs?  What does it do?

> +
> +	leds {
> +		act {
> +			gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
> +		};
> +	};
> +
> +	wifi_pwrseq: wifi-pwrseq {
> +		compatible = "mmc-pwrseq-simple";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&wl_on>;
> +		reset-gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
> +	};
> +};
> +
> +&gpio {
> +	pinctrl-0 = <&gpioout &alt0>;
> +
> +	wl_on: wl-on {
> +		brcm,pins = <41>;
> +		brcm,function = <BCM2835_FSEL_GPIO_OUT>;
> +	};
> +};

Would you be up for adding gpio-line-names based on the dt-blob.dts?

> +
> +&hdmi {
> +	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
> +};
> +
> +&sdhci {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +	pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>;
> +	mmc-pwrseq = <&wifi_pwrseq>;
> +	non-removable;
> +	status = "okay";
> +
> +	brcmf: wifi@1 {
> +		reg = <1>;
> +		compatible = "brcm,bcm4329-fmac";
> +	};
> +};
> +
> +&uart0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&uart0_gpio14>;
> +	status = "okay";
> +};
> -- 
> 2.7.4

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [PATCH 3/3] ARM: dts: bcm2835: Add Raspberry Pi Zero W
       [not found]         ` <87vamfx8nx.fsf-omZaPlIz5HhaEpDpdNBo/KxOck334EZe@public.gmane.org>
@ 2017-07-27 11:35           ` Stefan Wahren
       [not found]             ` <1bc16f65-7872-d554-d29b-d9cd746c28bd-eS4NqCHxEME@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Wahren @ 2017-07-27 11:35 UTC (permalink / raw)
  To: Eric Anholt, Rob Herring, Mark Rutland
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Florian Fainelli,
	Scott Branden, linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Gerd Hoffmann

Am 26.07.2017 um 22:09 schrieb Eric Anholt:
> Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org> writes:
>
>> The Raspberry Pi Zero W has the same components like the Zero plus
>> a Cypress CYW43438 wireless chip (wifi + bl).
> I sent out v2 of the arm64 patch so that hopefully we can get started
> merging this.  Couple of comments on a re-read.
>
>> Signed-off-by: Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
>> Reviewed-by: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
>> ---
>>  arch/arm/boot/dts/Makefile               |  3 +-
>>  arch/arm/boot/dts/bcm2835-rpi-zero-w.dts | 73 ++++++++++++++++++++++++++++++++
>>  2 files changed, 75 insertions(+), 1 deletion(-)
>>  create mode 100644 arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
>>
>> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
>> index ec60f4f..f3bf9397 100644
>> --- a/arch/arm/boot/dts/Makefile
>> +++ b/arch/arm/boot/dts/Makefile
>> @@ -74,7 +74,8 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
>>  	bcm2835-rpi-a-plus.dtb \
>>  	bcm2836-rpi-2-b.dtb \
>>  	bcm2837-rpi-3-b.dtb \
>> -	bcm2835-rpi-zero.dtb
>> +	bcm2835-rpi-zero.dtb \
>> +	bcm2835-rpi-zero-w.dtb
>>  dtb-$(CONFIG_ARCH_BCM_5301X) += \
>>  	bcm4708-asus-rt-ac56u.dtb \
>>  	bcm4708-asus-rt-ac68u.dtb \
>> diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
>> new file mode 100644
>> index 0000000..9c6d714
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
>> @@ -0,0 +1,73 @@
>> +/*
>> + * Copyright (C) 2017 Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
>> + *
>> + * The code contained herein is licensed under the GNU General Public
>> + * License. You may obtain a copy of the GNU General Public License
>> + * Version 2 or later at the following locations:
>> + *
>> + * http://www.opensource.org/licenses/gpl-license.html
>> + * http://www.gnu.org/copyleft/gpl.html
>> + */
>> +
>> +/dts-v1/;
>> +#include "bcm2835.dtsi"
>> +#include "bcm2835-rpi.dtsi"
>> +#include "bcm283x-rpi-usb-host.dtsi"
>> +
>> +/ {
>> +	compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
>> +	model = "Raspberry Pi Zero W";
>> +
>> +	aliases {
>> +		uart0 = "/soc/serial@7e201000";
>> +		uart1 = "/soc/serial@7e215040";
>> +		serial0 = "/soc/serial@7e201000";
>> +		serial1 = "/soc/serial@7e215040";
>> +	};
> Should we have this in the other board DTs?  What does it do?

This was the hardest part to make the Zero W useable. I took it from
downstream [1], because without it i don't see anything on debug UART
(config.txt already has enable_uart=1).

I could add a helpful comment, but i can't explain why it's necessary
for RPI Zero W and not for the older RPI Zero.

Maybe the foundation guys have an alternative solution or at least
explanation.

[1] -
https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm/boot/dts/bcm2708-rpi.dtsi
[2] -
https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm/boot/dts/overlays/pi3-disable-bt-overlay.dts

>
>> +
>> +	leds {
>> +		act {
>> +			gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
>> +		};
>> +	};
>> +
>> +	wifi_pwrseq: wifi-pwrseq {
>> +		compatible = "mmc-pwrseq-simple";
>> +		pinctrl-names = "default";
>> +		pinctrl-0 = <&wl_on>;
>> +		reset-gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
>> +	};
>> +};
>> +
>> +&gpio {
>> +	pinctrl-0 = <&gpioout &alt0>;
>> +
>> +	wl_on: wl-on {
>> +		brcm,pins = <41>;
>> +		brcm,function = <BCM2835_FSEL_GPIO_OUT>;
>> +	};
>> +};
> Would you be up for adding gpio-line-names based on the dt-blob.dts?

Sure

>
>> +
>> +&hdmi {
>> +	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
>> +};
>> +
>> +&sdhci {
>> +	#address-cells = <1>;
>> +	#size-cells = <0>;
>> +	pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>;
>> +	mmc-pwrseq = <&wifi_pwrseq>;
>> +	non-removable;
>> +	status = "okay";
>> +
>> +	brcmf: wifi@1 {
>> +		reg = <1>;
>> +		compatible = "brcm,bcm4329-fmac";
>> +	};
>> +};
>> +
>> +&uart0 {
>> +	pinctrl-names = "default";
>> +	pinctrl-0 = <&uart0_gpio14>;
>> +	status = "okay";
>> +};
>> -- 
>> 2.7.4
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/3] ARM: dts: bcm2835: Add Raspberry Pi Zero W
       [not found]             ` <1bc16f65-7872-d554-d29b-d9cd746c28bd-eS4NqCHxEME@public.gmane.org>
@ 2017-07-27 18:41               ` Stefan Wahren
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Wahren @ 2017-07-27 18:41 UTC (permalink / raw)
  To: Eric Anholt, Rob Herring, Mark Rutland
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Scott Branden,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r


> Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org> hat am 27. Juli 2017 um 13:35 geschrieben:
> 
> 
> Am 26.07.2017 um 22:09 schrieb Eric Anholt:
> > Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org> writes:
> >
> >> +/dts-v1/;
> >> +#include "bcm2835.dtsi"
> >> +#include "bcm2835-rpi.dtsi"
> >> +#include "bcm283x-rpi-usb-host.dtsi"
> >> +
> >> +/ {
> >> +	compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
> >> +	model = "Raspberry Pi Zero W";
> >> +
> >> +	aliases {
> >> +		uart0 = "/soc/serial@7e201000";
> >> +		uart1 = "/soc/serial@7e215040";
> >> +		serial0 = "/soc/serial@7e201000";
> >> +		serial1 = "/soc/serial@7e215040";
> >> +	};
> > Should we have this in the other board DTs?  What does it do?
> 
> This was the hardest part to make the Zero W useable. I took it from
> downstream [1], because without it i don't see anything on debug UART
> (config.txt already has enable_uart=1).
> 
> I could add a helpful comment, but i can't explain why it's necessary
> for RPI Zero W and not for the older RPI Zero.
> 
> Maybe the foundation guys have an alternative solution or at least
> explanation.
> 

Here is Phil Elwell's explanation (he couldn't reply via plain text today):

Serial port usage became an issue with the release of the Pi 3. The good
UART (uart0, ttyAMA0, pl011) was required to drive the Bluetooth modem,
leaving the "mini-UART" (uart1, ttyS0, AUX UART, 8250), with limited
capabilities and even smaller FIFOs, available for a console and other
uses. However, not all users want to use Bluetooth, and some need the
better UART for other purposes.

For some reason (possibly clock related) the firmware initialises a UART
for the OS to use - I believe UBoot makes use of it. If the roles are no
longer fixed there has to be a way to tell the firmware which UART to
initialise. This is particularly important using ttyS0 because the VPU
clock has to be fixed to avoid data corruption due to baud rate changes.

At the same time, we have always tried to make it possible to use the same
SD card in any Pi, so we wanted a way to abstract away the differences in
serial port usage. I couldn't find a standard mechanism to give serial
ports in Linux arbitrary names or numbers to insulate userland from the
hardware specifics, so I added the /dev/serial<n> symbolic links.

I was trying to move away from a proliferation of config.txt settings and
make device tree the communication mechanism between user, firmware and
kernel, so I chose to use DT aliases to declare the name-to-UART mapping -
it seemed like a nice fit. Overlays can change them, and the firmware,
kernel and userspace scripts can read them. For example, a udev rule
creates the symbolic links during the boot process based on the contents of
/proc/device-tree/aliases, and the firmware rewrites the kernel command
line, replacing the aliases with the appropriate device name.

On the firmware side we added one new setting - enable_uart - which
defaults to 1 unless the mini-UART is the primary (console) UART, in which
case it must be explicitly set to 1 in config.txt in order for the UART
(and GPIO pins) to be configured. This difference is because most users
will never use the serial ports, and the need for a constant baud rate
makes it necessary to lock the VPU core frequency to 250MHz which could be
seen as a performance penalty.

To answer the question you originally asked, the aliases are needed on a
Zero W (just as on a Pi 3) because by default it uses ttyS0 for Bluetooth,
but the firmware doesn't know this unless the DT tells it so via the
aliases. Otherwise it behaves like all Pis before the 3 and puts the
console on ttyAMA0.

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

end of thread, other threads:[~2017-07-27 18:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-20 19:37 [PATCH 0/3] ARM: bcm283x: Raspberry Pi Zero W support Stefan Wahren
2017-07-20 19:37 ` [PATCH 1/3] ARM: bcm283x: Define UART pinmuxing on board level Stefan Wahren
     [not found] ` <1500579429-9101-1-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2017-07-20 19:37   ` [PATCH 2/3] dt-bindings: bcm: Add Raspberry Pi Zero W Stefan Wahren
     [not found]     ` <1500579429-9101-3-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2017-07-24 20:18       ` Rob Herring
2017-07-20 19:37   ` [PATCH 3/3] ARM: dts: bcm2835: " Stefan Wahren
     [not found]     ` <1500579429-9101-4-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2017-07-26 20:09       ` Eric Anholt
     [not found]         ` <87vamfx8nx.fsf-omZaPlIz5HhaEpDpdNBo/KxOck334EZe@public.gmane.org>
2017-07-27 11:35           ` Stefan Wahren
     [not found]             ` <1bc16f65-7872-d554-d29b-d9cd746c28bd-eS4NqCHxEME@public.gmane.org>
2017-07-27 18:41               ` Stefan Wahren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).