linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] ARM: dts: Add Raspberry Pi 400 support
@ 2021-05-30  9:26 Stefan Wahren
  2021-05-30  9:26 ` [PATCH 1/6] ARM: dts: bcm283x: Fix up MMC node names Stefan Wahren
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Stefan Wahren @ 2021-05-30  9:26 UTC (permalink / raw)
  To: Rob Herring, Nicolas Saenz Julienne
  Cc: Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Arnd Bergmann, Olof Johansson, soc,
	Wim Van Sebroeck, Guenter Roeck, devicetree, linux-rpi-kernel,
	linux-arm-kernel, linux-watchdog, Stefan Wahren

This series adds support for the Raspberry Pi 400.

Stefan Wahren (6):
  ARM: dts: bcm283x: Fix up MMC node names
  watchdog: bcm2835_wdt: consider system-power-controller property
  ARM: dts: Move BCM2711 RPi specific into separate dtsi
  dt-bindings: arm: bcm2835: Add Raspberry Pi 400 to DT schema
  ARM: dts: Add Raspberry Pi 400 support
  arm64: dts: broadcom: Add reference to RPi 400

 .../devicetree/bindings/arm/bcm/bcm2835.yaml       |   1 +
 arch/arm/boot/dts/Makefile                         |   1 +
 arch/arm/boot/dts/bcm2711-rpi-4-b.dts              |  62 +----
 arch/arm/boot/dts/bcm2711-rpi-400.dts              | 271 +++++++++++++++++++++
 arch/arm/boot/dts/bcm2711-rpi.dtsi                 |  75 ++++++
 arch/arm/boot/dts/bcm2711.dtsi                     |   2 +-
 arch/arm/boot/dts/bcm283x.dtsi                     |   2 +-
 arch/arm64/boot/dts/broadcom/Makefile              |   3 +-
 arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dts   |   2 +
 drivers/watchdog/bcm2835_wdt.c                     |  10 +-
 10 files changed, 362 insertions(+), 67 deletions(-)
 create mode 100644 arch/arm/boot/dts/bcm2711-rpi-400.dts
 create mode 100644 arch/arm/boot/dts/bcm2711-rpi.dtsi
 create mode 100644 arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dts

-- 
2.7.4


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

* [PATCH 1/6] ARM: dts: bcm283x: Fix up MMC node names
  2021-05-30  9:26 [PATCH 0/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
@ 2021-05-30  9:26 ` Stefan Wahren
  2021-05-30  9:26 ` [PATCH 2/6] watchdog: bcm2835_wdt: consider system-power-controller property Stefan Wahren
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Stefan Wahren @ 2021-05-30  9:26 UTC (permalink / raw)
  To: Rob Herring, Nicolas Saenz Julienne
  Cc: Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Arnd Bergmann, Olof Johansson, soc,
	Wim Van Sebroeck, Guenter Roeck, devicetree, linux-rpi-kernel,
	linux-arm-kernel, linux-watchdog, Stefan Wahren

Fix the node names for the MMC/SD card controller to conform
to the standard node name mmc@..

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 arch/arm/boot/dts/bcm2711.dtsi | 2 +-
 arch/arm/boot/dts/bcm283x.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
index 720beec..d872064 100644
--- a/arch/arm/boot/dts/bcm2711.dtsi
+++ b/arch/arm/boot/dts/bcm2711.dtsi
@@ -413,7 +413,7 @@
 		ranges = <0x0 0x7e000000  0x0 0xfe000000  0x01800000>;
 		dma-ranges = <0x0 0xc0000000  0x0 0x00000000  0x40000000>;
 
-		emmc2: emmc2@7e340000 {
+		emmc2: mmc@7e340000 {
 			compatible = "brcm,bcm2711-emmc2";
 			reg = <0x0 0x7e340000 0x100>;
 			interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index b83a864..0f3be55 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -420,7 +420,7 @@
 			status = "disabled";
 		};
 
-		sdhci: sdhci@7e300000 {
+		sdhci: mmc@7e300000 {
 			compatible = "brcm,bcm2835-sdhci";
 			reg = <0x7e300000 0x100>;
 			interrupts = <2 30>;
-- 
2.7.4


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

* [PATCH 2/6] watchdog: bcm2835_wdt: consider system-power-controller property
  2021-05-30  9:26 [PATCH 0/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
  2021-05-30  9:26 ` [PATCH 1/6] ARM: dts: bcm283x: Fix up MMC node names Stefan Wahren
@ 2021-05-30  9:26 ` Stefan Wahren
  2021-06-02 10:37   ` Guenter Roeck
       [not found]   ` <e61ba6f5b906fd26a61e9c79ef4dcf4792a364d7.camel@kernel.org>
  2021-05-30  9:26 ` [PATCH 3/6] ARM: dts: Move BCM2711 RPi specific into separate dtsi Stefan Wahren
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 11+ messages in thread
From: Stefan Wahren @ 2021-05-30  9:26 UTC (permalink / raw)
  To: Rob Herring, Nicolas Saenz Julienne
  Cc: Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Arnd Bergmann, Olof Johansson, soc,
	Wim Van Sebroeck, Guenter Roeck, devicetree, linux-rpi-kernel,
	linux-arm-kernel, linux-watchdog, Stefan Wahren

Until now all Raspberry Pi boards used the power off function of the SoC.
But the Raspberry Pi 400 uses gpio-poweroff for the whole board which
possibly cannot register the poweroff handler because the it's
already registered by this watchdog driver. So consider the
system-power-controller property for registering, which is already
defined in soc/bcm/brcm,bcm2835-pm.txt .

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 drivers/watchdog/bcm2835_wdt.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
index dec6ca0..9490717 100644
--- a/drivers/watchdog/bcm2835_wdt.c
+++ b/drivers/watchdog/bcm2835_wdt.c
@@ -205,9 +205,13 @@ static int bcm2835_wdt_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	if (pm_power_off == NULL) {
-		pm_power_off = bcm2835_power_off;
-		bcm2835_power_off_wdt = wdt;
+	if (of_device_is_system_power_controller(pdev->dev.parent->of_node)) {
+		if (!pm_power_off) {
+			pm_power_off = bcm2835_power_off;
+			bcm2835_power_off_wdt = wdt;
+		} else {
+			dev_info(dev, "Poweroff handler already present!\n");
+		}
 	}
 
 	dev_info(dev, "Broadcom BCM2835 watchdog timer");
-- 
2.7.4


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

* [PATCH 3/6] ARM: dts: Move BCM2711 RPi specific into separate dtsi
  2021-05-30  9:26 [PATCH 0/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
  2021-05-30  9:26 ` [PATCH 1/6] ARM: dts: bcm283x: Fix up MMC node names Stefan Wahren
  2021-05-30  9:26 ` [PATCH 2/6] watchdog: bcm2835_wdt: consider system-power-controller property Stefan Wahren
@ 2021-05-30  9:26 ` Stefan Wahren
       [not found]   ` <86a7cded6e3e17b0ab347e55b38a44e10bc4e46a.camel@kernel.org>
  2021-05-30  9:26 ` [PATCH 4/6] dt-bindings: arm: bcm2835: Add Raspberry Pi 400 to DT schema Stefan Wahren
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Stefan Wahren @ 2021-05-30  9:26 UTC (permalink / raw)
  To: Rob Herring, Nicolas Saenz Julienne
  Cc: Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Arnd Bergmann, Olof Johansson, soc,
	Wim Van Sebroeck, Guenter Roeck, devicetree, linux-rpi-kernel,
	linux-arm-kernel, linux-watchdog, Stefan Wahren

There is a lot of Raspberry Pi specific stuff (neither SoC or board
specific) for the BCM2711 which is currently in the RPi 4 B dts. In order
to avoid copy & paste for every new BCM2711 based Raspberry Pi, move it
into a separate dtsi.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 62 +----------------------------
 arch/arm/boot/dts/bcm2711-rpi.dtsi    | 75 +++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 61 deletions(-)
 create mode 100644 arch/arm/boot/dts/bcm2711-rpi.dtsi

diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
index 3b4ab94..78142a0 100644
--- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
+++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
@@ -1,11 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 #include "bcm2711.dtsi"
-#include "bcm2835-rpi.dtsi"
+#include "bcm2711-rpi.dtsi"
 #include "bcm283x-rpi-usb-peripheral.dtsi"
 
-#include <dt-bindings/reset/raspberrypi,firmware-reset.h>
-
 / {
 	compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
 	model = "Raspberry Pi 4 Model B";
@@ -22,10 +20,7 @@
 	};
 
 	aliases {
-		emmc2bus = &emmc2bus;
 		ethernet0 = &genet;
-		pcie0 = &pcie0;
-		blconfig = &blconfig;
 	};
 
 	leds {
@@ -80,11 +75,6 @@
 };
 
 &firmware {
-	firmware_clocks: clocks {
-		compatible = "raspberrypi,firmware-clocks";
-		#clock-cells = <1>;
-	};
-
 	expgpio: gpio {
 		compatible = "raspberrypi,firmware-gpio";
 		gpio-controller;
@@ -99,11 +89,6 @@
 				  "";
 		status = "okay";
 	};
-
-	reset: reset {
-		compatible = "raspberrypi,firmware-reset";
-		#reset-cells = <1>;
-	};
 };
 
 &gpio {
@@ -180,23 +165,13 @@
 };
 
 &hdmi0 {
-	clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>;
-	clock-names = "hdmi", "bvb", "audio", "cec";
-	wifi-2.4ghz-coexistence;
 	status = "okay";
 };
 
 &hdmi1 {
-	clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>;
-	clock-names = "hdmi", "bvb", "audio", "cec";
-	wifi-2.4ghz-coexistence;
 	status = "okay";
 };
 
-&hvs {
-	clocks = <&firmware_clocks 4>;
-};
-
 &pixelvalve0 {
 	status = "okay";
 };
@@ -219,22 +194,6 @@
 	status = "okay";
 };
 
-&rmem {
-	/*
-	 * RPi4's co-processor will copy the board's bootloader configuration
-	 * into memory for the OS to consume. It'll also update this node with
-	 * its placement information.
-	 */
-	blconfig: nvram@0 {
-		compatible = "raspberrypi,bootloader-config", "nvmem-rmem";
-		#address-cells = <1>;
-		#size-cells = <1>;
-		reg = <0x0 0x0 0x0>;
-		no-map;
-		status = "disabled";
-	};
-};
-
 /* SDHCI is used to control the SDIO for wireless */
 &sdhci {
 	#address-cells = <1>;
@@ -273,21 +232,6 @@
 	};
 };
 
-&pcie0 {
-	pci@1,0 {
-		#address-cells = <3>;
-		#size-cells = <2>;
-		ranges;
-
-		reg = <0 0 0 0 0>;
-
-		usb@1,0 {
-			reg = <0x10000 0 0 0 0>;
-			resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
-		};
-	};
-};
-
 /* uart0 communicates with the BT module */
 &uart0 {
 	pinctrl-names = "default";
@@ -309,10 +253,6 @@
 	status = "okay";
 };
 
-&vchiq {
-	interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
-};
-
 &vc4 {
 	status = "okay";
 };
diff --git a/arch/arm/boot/dts/bcm2711-rpi.dtsi b/arch/arm/boot/dts/bcm2711-rpi.dtsi
new file mode 100644
index 0000000..b4bc7f6
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2711-rpi.dtsi
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "bcm2835-rpi.dtsi"
+
+#include <dt-bindings/reset/raspberrypi,firmware-reset.h>
+
+/ {
+	aliases {
+		emmc2bus = &emmc2bus;
+		pcie0 = &pcie0;
+		blconfig = &blconfig;
+	};
+};
+
+&firmware {
+	firmware_clocks: clocks {
+		compatible = "raspberrypi,firmware-clocks";
+		#clock-cells = <1>;
+	};
+
+	reset: reset {
+		compatible = "raspberrypi,firmware-reset";
+		#reset-cells = <1>;
+	};
+};
+
+&hdmi0 {
+	clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>;
+	clock-names = "hdmi", "bvb", "audio", "cec";
+	wifi-2.4ghz-coexistence;
+};
+
+&hdmi1 {
+	clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>;
+	clock-names = "hdmi", "bvb", "audio", "cec";
+	wifi-2.4ghz-coexistence;
+};
+
+&hvs {
+	clocks = <&firmware_clocks 4>;
+};
+
+&pcie0 {
+	pci@1,0 {
+		#address-cells = <3>;
+		#size-cells = <2>;
+		ranges;
+
+		reg = <0 0 0 0 0>;
+
+		usb@1,0 {
+			reg = <0x10000 0 0 0 0>;
+			resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
+		};
+	};
+};
+
+&rmem {
+	/*
+	 * RPi4's co-processor will copy the board's bootloader configuration
+	 * into memory for the OS to consume. It'll also update this node with
+	 * its placement information.
+	 */
+	blconfig: nvram@0 {
+		compatible = "raspberrypi,bootloader-config", "nvmem-rmem";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0x0 0x0 0x0>;
+		no-map;
+		status = "disabled";
+	};
+};
+
+&vchiq {
+	interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
+};
-- 
2.7.4


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

* [PATCH 4/6] dt-bindings: arm: bcm2835: Add Raspberry Pi 400 to DT schema
  2021-05-30  9:26 [PATCH 0/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
                   ` (2 preceding siblings ...)
  2021-05-30  9:26 ` [PATCH 3/6] ARM: dts: Move BCM2711 RPi specific into separate dtsi Stefan Wahren
@ 2021-05-30  9:26 ` Stefan Wahren
  2021-06-04 21:31   ` Rob Herring
  2021-05-30  9:26 ` [PATCH 5/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
  2021-05-30  9:26 ` [PATCH 6/6] arm64: dts: broadcom: Add reference to RPi 400 Stefan Wahren
  5 siblings, 1 reply; 11+ messages in thread
From: Stefan Wahren @ 2021-05-30  9:26 UTC (permalink / raw)
  To: Rob Herring, Nicolas Saenz Julienne
  Cc: Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Arnd Bergmann, Olof Johansson, soc,
	Wim Van Sebroeck, Guenter Roeck, devicetree, linux-rpi-kernel,
	linux-arm-kernel, linux-watchdog, Stefan Wahren

Add new Raspberry Pi 400 to DT schema.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml b/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
index 812ae8c..230b80d 100644
--- a/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
+++ b/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
@@ -18,6 +18,7 @@ properties:
       - description: BCM2711 based Boards
         items:
           - enum:
+              - raspberrypi,400
               - raspberrypi,4-model-b
           - const: brcm,bcm2711
 
-- 
2.7.4


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

* [PATCH 5/6] ARM: dts: Add Raspberry Pi 400 support
  2021-05-30  9:26 [PATCH 0/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
                   ` (3 preceding siblings ...)
  2021-05-30  9:26 ` [PATCH 4/6] dt-bindings: arm: bcm2835: Add Raspberry Pi 400 to DT schema Stefan Wahren
@ 2021-05-30  9:26 ` Stefan Wahren
  2021-05-30  9:26 ` [PATCH 6/6] arm64: dts: broadcom: Add reference to RPi 400 Stefan Wahren
  5 siblings, 0 replies; 11+ messages in thread
From: Stefan Wahren @ 2021-05-30  9:26 UTC (permalink / raw)
  To: Rob Herring, Nicolas Saenz Julienne
  Cc: Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Arnd Bergmann, Olof Johansson, soc,
	Wim Van Sebroeck, Guenter Roeck, devicetree, linux-rpi-kernel,
	linux-arm-kernel, linux-watchdog, Stefan Wahren

The Raspberry Pi 400 is like a Pi 4 B designed into a keyboard. But there
are some minor differences:

- higher CPU clock rate (1.8 GHz)
- different Wifi chip (BCM43456)
- power off is now handled via GPIO
- no ACT LED

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 arch/arm/boot/dts/Makefile            |   1 +
 arch/arm/boot/dts/bcm2711-rpi-400.dts | 271 ++++++++++++++++++++++++++++++++++
 2 files changed, 272 insertions(+)
 create mode 100644 arch/arm/boot/dts/bcm2711-rpi-400.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index f8f09c5..ec00dba 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -88,6 +88,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
 	bcm2837-rpi-3-b.dtb \
 	bcm2837-rpi-3-b-plus.dtb \
 	bcm2837-rpi-cm3-io3.dtb \
+	bcm2711-rpi-400.dtb \
 	bcm2711-rpi-4-b.dtb \
 	bcm2835-rpi-zero.dtb \
 	bcm2835-rpi-zero-w.dtb
diff --git a/arch/arm/boot/dts/bcm2711-rpi-400.dts b/arch/arm/boot/dts/bcm2711-rpi-400.dts
new file mode 100644
index 0000000..f063c5e
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2711-rpi-400.dts
@@ -0,0 +1,271 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+#include "bcm2711.dtsi"
+#include "bcm2711-rpi.dtsi"
+#include "bcm283x-rpi-usb-peripheral.dtsi"
+
+/ {
+	compatible = "raspberrypi,400", "brcm,bcm2711";
+	model = "Raspberry Pi 400";
+
+	chosen {
+		/* 8250 auxiliary UART instead of pl011 */
+		stdout-path = "serial1:115200n8";
+	};
+
+	/* Will be filled by the bootloader */
+	memory@0 {
+		device_type = "memory";
+		reg = <0 0 0>;
+	};
+
+	aliases {
+		ethernet0 = &genet;
+	};
+
+	leds {
+		/delete-node/ act;
+
+		led-pwr {
+			label = "PWR";
+			gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
+			default-state = "keep";
+			linux,default-trigger = "default-on";
+		};
+	};
+
+	wifi_pwrseq: wifi-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
+	};
+
+	gpio-poweroff {
+		compatible = "gpio-poweroff";
+		gpios = <&expgpio 5 GPIO_ACTIVE_HIGH>;
+	};
+
+	sd_io_1v8_reg: sd_io_1v8_reg {
+		compatible = "regulator-gpio";
+		regulator-name = "vdd-sd-io";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+		regulator-settling-time-us = <5000>;
+		gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>;
+		states = <1800000 0x1
+			  3300000 0x0>;
+		status = "okay";
+	};
+
+	sd_vcc_reg: sd_vcc_reg {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc-sd";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		enable-active-high;
+		gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>;
+	};
+};
+
+&ddc0 {
+	status = "okay";
+};
+
+&ddc1 {
+	status = "okay";
+};
+
+&firmware {
+	expgpio: gpio {
+		compatible = "raspberrypi,firmware-gpio";
+		gpio-controller;
+		#gpio-cells = <2>;
+		gpio-line-names = "BT_ON",
+				  "WL_ON",
+				  "",
+				  "GLOBAL_RESET",
+				  "VDD_SD_IO_SEL",
+				  "CAM_GPIO",
+				  "SD_PWR_ON",
+				  "SD_OC_N";
+		status = "okay";
+	};
+};
+
+&gpio {
+	/*
+	 * Parts taken from rpi_SCH_4b_4p0_reduced.pdf and
+	 * the official GPU firmware DT blob.
+	 *
+	 * Legend:
+	 * "FOO" = GPIO line named "FOO" on the schematic
+	 * "FOO_N" = GPIO line named "FOO" on schematic, active low
+	 */
+	gpio-line-names = "ID_SDA",
+			  "ID_SCL",
+			  "SDA1",
+			  "SCL1",
+			  "GPIO_GCLK",
+			  "GPIO5",
+			  "GPIO6",
+			  "SPI_CE1_N",
+			  "SPI_CE0_N",
+			  "SPI_MISO",
+			  "SPI_MOSI",
+			  "SPI_SCLK",
+			  "GPIO12",
+			  "GPIO13",
+			  /* Serial port */
+			  "TXD1",
+			  "RXD1",
+			  "GPIO16",
+			  "GPIO17",
+			  "GPIO18",
+			  "GPIO19",
+			  "GPIO20",
+			  "GPIO21",
+			  "GPIO22",
+			  "GPIO23",
+			  "GPIO24",
+			  "GPIO25",
+			  "GPIO26",
+			  "GPIO27",
+			  "RGMII_MDIO",
+			  "RGMIO_MDC",
+			  /* Used by BT module */
+			  "CTS0",
+			  "RTS0",
+			  "TXD0",
+			  "RXD0",
+			  /* Used by Wifi */
+			  "SD1_CLK",
+			  "SD1_CMD",
+			  "SD1_DATA0",
+			  "SD1_DATA1",
+			  "SD1_DATA2",
+			  "SD1_DATA3",
+			  /* Shared with SPI flash */
+			  "PWM0_MISO",
+			  "PWM1_MOSI",
+			  "STATUS_LED_G_CLK",
+			  "SPIFLASH_CE_N",
+			  "SDA0",
+			  "SCL0",
+			  "RGMII_RXCLK",
+			  "RGMII_RXCTL",
+			  "RGMII_RXD0",
+			  "RGMII_RXD1",
+			  "RGMII_RXD2",
+			  "RGMII_RXD3",
+			  "RGMII_TXCLK",
+			  "RGMII_TXCTL",
+			  "RGMII_TXD0",
+			  "RGMII_TXD1",
+			  "RGMII_TXD2",
+			  "RGMII_TXD3";
+};
+
+&hdmi0 {
+	status = "okay";
+};
+
+&hdmi1 {
+	status = "okay";
+};
+
+&pixelvalve0 {
+	status = "okay";
+};
+
+&pixelvalve1 {
+	status = "okay";
+};
+
+&pixelvalve2 {
+	status = "okay";
+};
+
+&pixelvalve4 {
+	status = "okay";
+};
+
+&pm {
+	/delete-property/ system-power-controller;
+};
+
+&pwm1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwm1_0_gpio40 &pwm1_1_gpio41>;
+	status = "okay";
+};
+
+/* SDHCI is used to control the SDIO for wireless */
+&sdhci {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&emmc_gpio34>;
+	bus-width = <4>;
+	non-removable;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	status = "okay";
+
+	brcmf: wifi@1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+	};
+};
+
+/* EMMC2 is used to drive the SD card */
+&emmc2 {
+	vqmmc-supply = <&sd_io_1v8_reg>;
+	vmmc-supply = <&sd_vcc_reg>;
+	broken-cd;
+	status = "okay";
+};
+
+&genet {
+	phy-handle = <&phy1>;
+	phy-mode = "rgmii-rxid";
+	status = "okay";
+};
+
+&genet_mdio {
+	clock-frequency = <1950000>;
+
+	phy1: ethernet-phy@1 {
+		/* No PHY interrupt */
+		reg = <0x1>;
+	};
+};
+
+/* uart0 communicates with the BT module */
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32>;
+	uart-has-rtscts;
+	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		max-speed = <2000000>;
+		shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>;
+	};
+};
+
+/* uart1 is mapped to the pin header */
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_gpio14>;
+	status = "okay";
+};
+
+&vc4 {
+	status = "okay";
+};
+
+&vec {
+	status = "disabled";
+};
-- 
2.7.4


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

* [PATCH 6/6] arm64: dts: broadcom: Add reference to RPi 400
  2021-05-30  9:26 [PATCH 0/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
                   ` (4 preceding siblings ...)
  2021-05-30  9:26 ` [PATCH 5/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
@ 2021-05-30  9:26 ` Stefan Wahren
  5 siblings, 0 replies; 11+ messages in thread
From: Stefan Wahren @ 2021-05-30  9:26 UTC (permalink / raw)
  To: Rob Herring, Nicolas Saenz Julienne
  Cc: Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Arnd Bergmann, Olof Johansson, soc,
	Wim Van Sebroeck, Guenter Roeck, devicetree, linux-rpi-kernel,
	linux-arm-kernel, linux-watchdog, Stefan Wahren

This adds a reference to the dts of the Raspberry Pi 400,
so we don't need to maintain the content in arm64.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 arch/arm64/boot/dts/broadcom/Makefile            | 3 ++-
 arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dts | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dts

diff --git a/arch/arm64/boot/dts/broadcom/Makefile b/arch/arm64/boot/dts/broadcom/Makefile
index 998e240..11eae3e 100644
--- a/arch/arm64/boot/dts/broadcom/Makefile
+++ b/arch/arm64/boot/dts/broadcom/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
-dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-4-b.dtb \
+dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb \
+			      bcm2711-rpi-4-b.dtb \
 			      bcm2837-rpi-3-a-plus.dtb \
 			      bcm2837-rpi-3-b.dtb \
 			      bcm2837-rpi-3-b-plus.dtb \
diff --git a/arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dts b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dts
new file mode 100644
index 0000000..b9000f5
--- /dev/null
+++ b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-400.dts
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "arm/bcm2711-rpi-400.dts"
-- 
2.7.4


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

* Re: [PATCH 3/6] ARM: dts: Move BCM2711 RPi specific into separate dtsi
       [not found]   ` <86a7cded6e3e17b0ab347e55b38a44e10bc4e46a.camel@kernel.org>
@ 2021-06-01 18:51     ` Stefan Wahren
  0 siblings, 0 replies; 11+ messages in thread
From: Stefan Wahren @ 2021-06-01 18:51 UTC (permalink / raw)
  To: nicolas saenz julienne, Rob Herring
  Cc: Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Arnd Bergmann, Olof Johansson, soc,
	Wim Van Sebroeck, Guenter Roeck, devicetree, linux-rpi-kernel,
	linux-arm-kernel, linux-watchdog

Hi Nicolas,

Am 01.06.21 um 12:03 schrieb nicolas saenz julienne:
> Hi Stefan,
> Thanks for having a go at this.
>
> On Sun, 2021-05-30 at 11:26 +0200, Stefan Wahren wrote:
>> There is a lot of Raspberry Pi specific stuff (neither SoC or board
>> specific) for the BCM2711 which is currently in the RPi 4 B dts. In order
>> to avoid copy & paste for every new BCM2711 based Raspberry Pi, move it
>> into a separate dtsi.
>>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> ---
>>  arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 62 +----------------------------
>>  arch/arm/boot/dts/bcm2711-rpi.dtsi    | 75 +++++++++++++++++++++++++++++++++++
>>  2 files changed, 76 insertions(+), 61 deletions(-)
>>  create mode 100644 arch/arm/boot/dts/bcm2711-rpi.dtsi
>>
>> diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
>> index 3b4ab94..78142a0 100644
>> --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
>> +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
>> @@ -1,11 +1,9 @@
>>  // SPDX-License-Identifier: GPL-2.0
>>  /dts-v1/;
>>  #include "bcm2711.dtsi"
>> -#include "bcm2835-rpi.dtsi"
>> +#include "bcm2711-rpi.dtsi"
>>  #include "bcm283x-rpi-usb-peripheral.dtsi"
>>  
>>
>> -#include <dt-bindings/reset/raspberrypi,firmware-reset.h>
>> -
>>  / {
>>  	compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
>>  	model = "Raspberry Pi 4 Model B";
>> @@ -22,10 +20,7 @@
>>  	};
>>  
>>
>>  	aliases {
>> -		emmc2bus = &emmc2bus;
>>  		ethernet0 = &genet;
> Why not picking this one? nor the relevant DT nodes? I belive it's available on
> all the bcm2711 based boards.
While i agree that most of the boards [1] support Ethernet, the PHY
stuff is almost board specific.
>
>> -		pcie0 = &pcie0;
>> -		blconfig = &blconfig;
>>  	};
>>  
>>
>>  	leds {
>> @@ -80,11 +75,6 @@
>>  };
>>  
>>
>>  &firmware {
>> -	firmware_clocks: clocks {
>> -		compatible = "raspberrypi,firmware-clocks";
>> -		#clock-cells = <1>;
>> -	};
>> -
>>  	expgpio: gpio {
> Why not taking this one too and letting each dts file define its own
> 'gpio-line-names'?
Agree
>
>>  		compatible = "raspberrypi,firmware-gpio";
>>  		gpio-controller;
>> @@ -99,11 +89,6 @@
>>  				  "";
>>  		status = "okay";
>>  	};
>> -
>> -	reset: reset {
>> -		compatible = "raspberrypi,firmware-reset";
>> -		#reset-cells = <1>;
>> -	};
>>  };
>>  
>>
>>  &gpio {
>> @@ -180,23 +165,13 @@
>>  };
>>  
>>
>>  &hdmi0 {
>> -	clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 0>, <&clk_27MHz>;
>> -	clock-names = "hdmi", "bvb", "audio", "cec";
>> -	wifi-2.4ghz-coexistence;
>>  	status = "okay";
>>  };
>>  
>>
>>  &hdmi1 {
>> -	clocks = <&firmware_clocks 13>, <&firmware_clocks 14>, <&dvp 1>, <&clk_27MHz>;
>> -	clock-names = "hdmi", "bvb", "audio", "cec";
>> -	wifi-2.4ghz-coexistence;
>>  	status = "okay";
>>  };
>>  
>>
>> -&hvs {
>> -	clocks = <&firmware_clocks 4>;
>> -};
>> -
>>  &pixelvalve0 {
>>  	status = "okay";
>>  };
>> @@ -219,22 +194,6 @@
>>  	status = "okay";
>>  };
>>  
>>
>> -&rmem {
>> -	/*
>> -	 * RPi4's co-processor will copy the board's bootloader configuration
>> -	 * into memory for the OS to consume. It'll also update this node with
>> -	 * its placement information.
>> -	 */
>> -	blconfig: nvram@0 {
>> -		compatible = "raspberrypi,bootloader-config", "nvmem-rmem";
>> -		#address-cells = <1>;
>> -		#size-cells = <1>;
>> -		reg = <0x0 0x0 0x0>;
>> -		no-map;
>> -		status = "disabled";
>> -	};
>> -};
>> -
>>  /* SDHCI is used to control the SDIO for wireless */
>>  &sdhci {
>>  	#address-cells = <1>;
>> @@ -273,21 +232,6 @@
>>  	};
>>  };
>>  
>>
>> -&pcie0 {
>> -	pci@1,0 {
>> -		#address-cells = <3>;
>> -		#size-cells = <2>;
>> -		ranges;
>> -
>> -		reg = <0 0 0 0 0>;
>> -
>> -		usb@1,0 {
>> -			reg = <0x10000 0 0 0 0>;
>> -			resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>;
>> -		};
>> -	};
>> -};
>> -
> This is not relevant to CM4, maybe we should leave it in the .dts
Okay
>
>>  /* uart0 communicates with the BT module */
>>  &uart0 {
> What about 'uart1'? I belive the configuration is the same for all boards. pwm1
> also comes to mind.

I wouldn't include pinmux dependent stuff here, because this is very
specific to the board and use case [1].

But there is a trick for the Pi 400, which is very similiar to the Pi 4
B. We could include the pi4.dts in the pi400.dts. Additional i would
keep this patch for CM4 and co.

Regards
Stefan

[1] -
https://afterhourscoding.wordpress.com/2021/02/21/a-list-of-raspberry-pi-compute-module-carrier-boards-and-devices/

>
> Regards,
> Nicolas
>
>


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

* Re: [PATCH 2/6] watchdog: bcm2835_wdt: consider system-power-controller property
  2021-05-30  9:26 ` [PATCH 2/6] watchdog: bcm2835_wdt: consider system-power-controller property Stefan Wahren
@ 2021-06-02 10:37   ` Guenter Roeck
       [not found]   ` <e61ba6f5b906fd26a61e9c79ef4dcf4792a364d7.camel@kernel.org>
  1 sibling, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2021-06-02 10:37 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Rob Herring, Nicolas Saenz Julienne, Florian Fainelli, Ray Jui,
	Scott Branden, bcm-kernel-feedback-list, Arnd Bergmann,
	Olof Johansson, soc, Wim Van Sebroeck, devicetree,
	linux-rpi-kernel, linux-arm-kernel, linux-watchdog

On Sun, May 30, 2021 at 11:26:11AM +0200, Stefan Wahren wrote:
> Until now all Raspberry Pi boards used the power off function of the SoC.
> But the Raspberry Pi 400 uses gpio-poweroff for the whole board which
> possibly cannot register the poweroff handler because the it's
> already registered by this watchdog driver. So consider the
> system-power-controller property for registering, which is already
> defined in soc/bcm/brcm,bcm2835-pm.txt .
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/bcm2835_wdt.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
> index dec6ca0..9490717 100644
> --- a/drivers/watchdog/bcm2835_wdt.c
> +++ b/drivers/watchdog/bcm2835_wdt.c
> @@ -205,9 +205,13 @@ static int bcm2835_wdt_probe(struct platform_device *pdev)
>  	if (err)
>  		return err;
>  
> -	if (pm_power_off == NULL) {
> -		pm_power_off = bcm2835_power_off;
> -		bcm2835_power_off_wdt = wdt;
> +	if (of_device_is_system_power_controller(pdev->dev.parent->of_node)) {
> +		if (!pm_power_off) {
> +			pm_power_off = bcm2835_power_off;
> +			bcm2835_power_off_wdt = wdt;
> +		} else {
> +			dev_info(dev, "Poweroff handler already present!\n");
> +		}
>  	}
>  
>  	dev_info(dev, "Broadcom BCM2835 watchdog timer");
> -- 
> 2.7.4
> 

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

* Re: [PATCH 2/6] watchdog: bcm2835_wdt: consider system-power-controller property
       [not found]   ` <e61ba6f5b906fd26a61e9c79ef4dcf4792a364d7.camel@kernel.org>
@ 2021-06-02 10:40     ` Guenter Roeck
  0 siblings, 0 replies; 11+ messages in thread
From: Guenter Roeck @ 2021-06-02 10:40 UTC (permalink / raw)
  To: nicolas saenz julienne
  Cc: Stefan Wahren, Rob Herring, Florian Fainelli, Ray Jui,
	Scott Branden, bcm-kernel-feedback-list, Arnd Bergmann,
	Olof Johansson, soc, Wim Van Sebroeck, devicetree,
	linux-rpi-kernel, linux-arm-kernel, linux-watchdog

On Tue, Jun 01, 2021 at 11:43:27AM +0200, nicolas saenz julienne wrote:
> On Sun, 2021-05-30 at 11:26 +0200, Stefan Wahren wrote:
> > Until now all Raspberry Pi boards used the power off function of the SoC.
> > But the Raspberry Pi 400 uses gpio-poweroff for the whole board which
> > possibly cannot register the poweroff handler because the it's
> > already registered by this watchdog driver. So consider the
> > system-power-controller property for registering, which is already
> > defined in soc/bcm/brcm,bcm2835-pm.txt .
> > 
> > Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> > ---
> >  drivers/watchdog/bcm2835_wdt.c | 10 +++++++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
> > index dec6ca0..9490717 100644
> > --- a/drivers/watchdog/bcm2835_wdt.c
> > +++ b/drivers/watchdog/bcm2835_wdt.c
> > @@ -205,9 +205,13 @@ static int bcm2835_wdt_probe(struct platform_device *pdev)
> >  	if (err)
> >  		return err;
> >  
> > 
> > -	if (pm_power_off == NULL) {
> > -		pm_power_off = bcm2835_power_off;
> > -		bcm2835_power_off_wdt = wdt;
> > +	if (of_device_is_system_power_controller(pdev->dev.parent->of_node)) {
> > +		if (!pm_power_off) {
> > +			pm_power_off = bcm2835_power_off;
> > +			bcm2835_power_off_wdt = wdt;
> > +		} else {
> > +			dev_info(dev, "Poweroff handler already present!\n");
> 
> nit: shoudln't this be a warning?
> 
No. If anything, it should not be there in the first place, but I didn't want
to argue about it. It is perfectly valid for a system to have more than one
means to reset it, meaning this message is just noise. Making it a warning
would just make it worse.

Guenter

> Other than that,
> 
> Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
> 
> Regards,
> Nicolas
> 
> 

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

* Re: [PATCH 4/6] dt-bindings: arm: bcm2835: Add Raspberry Pi 400 to DT schema
  2021-05-30  9:26 ` [PATCH 4/6] dt-bindings: arm: bcm2835: Add Raspberry Pi 400 to DT schema Stefan Wahren
@ 2021-06-04 21:31   ` Rob Herring
  0 siblings, 0 replies; 11+ messages in thread
From: Rob Herring @ 2021-06-04 21:31 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Rob Herring, bcm-kernel-feedback-list, soc, Scott Branden,
	Olof Johansson, Nicolas Saenz Julienne, Florian Fainelli,
	devicetree, linux-arm-kernel, Ray Jui, Arnd Bergmann,
	linux-watchdog, Wim Van Sebroeck, Guenter Roeck,
	linux-rpi-kernel

On Sun, 30 May 2021 11:26:13 +0200, Stefan Wahren wrote:
> Add new Raspberry Pi 400 to DT schema.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---
>  Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2021-06-04 21:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-30  9:26 [PATCH 0/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
2021-05-30  9:26 ` [PATCH 1/6] ARM: dts: bcm283x: Fix up MMC node names Stefan Wahren
2021-05-30  9:26 ` [PATCH 2/6] watchdog: bcm2835_wdt: consider system-power-controller property Stefan Wahren
2021-06-02 10:37   ` Guenter Roeck
     [not found]   ` <e61ba6f5b906fd26a61e9c79ef4dcf4792a364d7.camel@kernel.org>
2021-06-02 10:40     ` Guenter Roeck
2021-05-30  9:26 ` [PATCH 3/6] ARM: dts: Move BCM2711 RPi specific into separate dtsi Stefan Wahren
     [not found]   ` <86a7cded6e3e17b0ab347e55b38a44e10bc4e46a.camel@kernel.org>
2021-06-01 18:51     ` Stefan Wahren
2021-05-30  9:26 ` [PATCH 4/6] dt-bindings: arm: bcm2835: Add Raspberry Pi 400 to DT schema Stefan Wahren
2021-06-04 21:31   ` Rob Herring
2021-05-30  9:26 ` [PATCH 5/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
2021-05-30  9:26 ` [PATCH 6/6] arm64: dts: broadcom: Add reference to RPi 400 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).