linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support
@ 2019-09-28 12:07 Stefan Wahren
  2019-09-28 12:07 ` [PATCH V3 1/8] ARM: dts: bcm283x: Remove simple-bus from fixed clocks Stefan Wahren
                   ` (9 more replies)
  0 siblings, 10 replies; 25+ messages in thread
From: Stefan Wahren @ 2019-09-28 12:07 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Eric Anholt, Florian Fainelli,
	Ray Jui, Scott Branden
  Cc: devicetree, Catalin Marinas, bcm-kernel-feedback-list,
	Stefan Wahren, Will Deacon, linux-arm-kernel

This series adds minimal support for the new Raspberry Pi 4, so we are able
to login via debug UART.

Patch 1-2:   Fix some DT schema warnings
Patch 3-4:   Prepare DTS for the new SoC BMC2711
Patch 5-7:   Add Raspberry Pi 4 DTS support
Patch 8:     Update MAINTAINERS

Unfortunately the Raspberry Pi Foundation didn't released a
peripheral documentation for the new SoC yet. So we only have a preliminary
datasheet [1] and reduced schematics [2].

Known issues:
Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
i reverted the following patch to test this series:

79a98672 "dma-mapping: remove dma_max_pfn"
7559d612 "mmc: core: let the dma map ops handle bouncing"

Changes in V3:
- rebased series
- add Reviewed-by
- enable ARM_GIC for ARCH_BCM2835 on arm64 too
- configure i2c pull-up in bcm2711.dtsi
- move i2c2 to bcm2835-common.dtsi
- add missing compatibles to DT schema as suggested by Rob
- fix DT schema warnings in dtsi files
- replace brcm pintrl with generic pinctrl as suggested by Linus
- make dma_zone_size depend on CONFIG_ZONE_DMA as suggested by Matthias

Changes in V2:
- use separate board file for BCM2711
- enable ARM_GIC for ARCH_BCM2835
- add Acked-by and Reviewed-by
- fix arm-pmu and timer nodes for BCM2711 reported by Marc Zyngier
- enable HDMI at board level
- move HDMI and pixelvalve into bcm2835-common.dtsi as suggested by Eric Anholt
- fix DWC2 probing warning by setting USB role to peripheral
- fix order of node references in bcm2711.dtsi
- disable I2C clock stretching quirk for BCM2711
- mark PLLD_PER as critical clock
- make PLLH clock unavailable on BCM2711
- fix compile warning in clk-bcm2835 for arm64

Changes since RFC:
- change BCM2838 -> BCM2711 as discussed in RFC
- update MAINTAINERS accordingly
- drop "spi: bcm2835: enable shared interrupt support" from series
- squash all pinctrl-bcm2835 changes into one patch
- introduce SoC specific clock registration as suggested by Florian
- fix watchdog probing for Raspberry Pi 4
- convert brcm,bcm2835.txt to json-schema
- move VC4 node to bcm2835-common.dtsi
- fallback to legacy pull config for Raspberry Pi 4
- revert unintended change of mailbox in bcm283x.dtsi
- add reference for arm64

[1] - https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/rpi_DATA_2711_1p0_preliminary.pdf
[2] - https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_4b_4p0_reduced.pdf

Stefan Wahren (8):
  ARM: dts: bcm283x: Remove simple-bus from fixed clocks
  ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
  ARM: dts: bcm283x: Move BCM2835/6/7 specific to bcm2835-common.dtsi
  dt-bindings: arm: Convert BCM2835 board/soc bindings to json-schema
  dt-bindings: arm: bcm2835: Add Raspberry Pi 4 to DT schema
  ARM: bcm: Add support for BCM2711 SoC
  ARM: dts: Add minimal Raspberry Pi 4 support
  MAINTAINERS: Add BCM2711 to BCM2835 ARCH

 .../devicetree/bindings/arm/bcm/bcm2835.yaml       |  54 ++
 .../devicetree/bindings/arm/bcm/brcm,bcm2835.txt   |  67 --
 MAINTAINERS                                        |   3 +-
 arch/arm/boot/dts/Makefile                         |   1 +
 arch/arm/boot/dts/bcm2711-rpi-4-b.dts              | 121 +++
 arch/arm/boot/dts/bcm2711.dtsi                     | 838 +++++++++++++++++++++
 arch/arm/boot/dts/bcm2835-common.dtsi              | 194 +++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi                 |   4 -
 arch/arm/boot/dts/bcm2835.dtsi                     |   1 +
 arch/arm/boot/dts/bcm2836.dtsi                     |   1 +
 arch/arm/boot/dts/bcm2837.dtsi                     |   1 +
 arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi  |   7 +
 arch/arm/boot/dts/bcm283x.dtsi                     | 190 +----
 arch/arm/mach-bcm/Kconfig                          |   3 +-
 arch/arm/mach-bcm/Makefile                         |   3 +-
 arch/arm/mach-bcm/bcm2711.c                        |  24 +
 arch/arm64/Kconfig.platforms                       |   5 +-
 17 files changed, 1257 insertions(+), 260 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
 delete mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
 create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b.dts
 create mode 100644 arch/arm/boot/dts/bcm2711.dtsi
 create mode 100644 arch/arm/boot/dts/bcm2835-common.dtsi
 create mode 100644 arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi
 create mode 100644 arch/arm/mach-bcm/bcm2711.c

--
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 1/8] ARM: dts: bcm283x: Remove simple-bus from fixed clocks
  2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
@ 2019-09-28 12:07 ` Stefan Wahren
  2019-09-28 12:07 ` [PATCH V3 2/8] ARM: dts: bcm283x: Remove brcm, bcm2835-pl011 compatible Stefan Wahren
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 25+ messages in thread
From: Stefan Wahren @ 2019-09-28 12:07 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Eric Anholt, Florian Fainelli,
	Ray Jui, Scott Branden
  Cc: devicetree, Catalin Marinas, bcm-kernel-feedback-list,
	Stefan Wahren, Will Deacon, linux-arm-kernel

The fixed clocks doesn't form some kind of bus. So let's remove it.
This fixes the follow DT schema warnings:

clocks: clock@3:reg:0: [3] is too short
clocks: clock@4:reg:0: [4] is too short
clocks: $nodename:0: 'clocks' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
clocks: #size-cells:0:0: 0 is not one of [1, 2]
clocks: 'ranges' is a required property
clock@3: 'reg' does not match any of the regexes: 'pinctrl-[0-9]+'
clock@4: 'reg' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 arch/arm/boot/dts/bcm283x.dtsi | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index 2d191fc..f16899d 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -650,22 +650,16 @@
 	};

 	clocks {
-		compatible = "simple-bus";
-		#address-cells = <1>;
-		#size-cells = <0>;
-
 		/* The oscillator is the root of the clock tree. */
-		clk_osc: clock@3 {
+		clk_osc: clk-osc {
 			compatible = "fixed-clock";
-			reg = <3>;
 			#clock-cells = <0>;
 			clock-output-names = "osc";
 			clock-frequency = <19200000>;
 		};

-		clk_usb: clock@4 {
+		clk_usb: clk-usb {
 			compatible = "fixed-clock";
-			reg = <4>;
 			#clock-cells = <0>;
 			clock-output-names = "otg";
 			clock-frequency = <480000000>;
--
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 2/8] ARM: dts: bcm283x: Remove brcm, bcm2835-pl011 compatible
  2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
  2019-09-28 12:07 ` [PATCH V3 1/8] ARM: dts: bcm283x: Remove simple-bus from fixed clocks Stefan Wahren
@ 2019-09-28 12:07 ` Stefan Wahren
  2019-09-28 12:07 ` [PATCH V3 3/8] ARM: dts: bcm283x: Move BCM2835/6/7 specific to bcm2835-common.dtsi Stefan Wahren
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 25+ messages in thread
From: Stefan Wahren @ 2019-09-28 12:07 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Eric Anholt, Florian Fainelli,
	Ray Jui, Scott Branden
  Cc: devicetree, Catalin Marinas, bcm-kernel-feedback-list,
	Stefan Wahren, Will Deacon, linux-arm-kernel

The downstream compatible brcm,bcm2835-pl011 hasn't been upstreamed yet.
So remove it.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 arch/arm/boot/dts/bcm283x.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index f16899d..ae8296f 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -396,7 +396,7 @@
 		};

 		uart0: serial@7e201000 {
-			compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
+			compatible = "arm,pl011", "arm,primecell";
 			reg = <0x7e201000 0x200>;
 			interrupts = <2 25>;
 			clocks = <&clocks BCM2835_CLOCK_UART>,
--
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 3/8] ARM: dts: bcm283x: Move BCM2835/6/7 specific to bcm2835-common.dtsi
  2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
  2019-09-28 12:07 ` [PATCH V3 1/8] ARM: dts: bcm283x: Remove simple-bus from fixed clocks Stefan Wahren
  2019-09-28 12:07 ` [PATCH V3 2/8] ARM: dts: bcm283x: Remove brcm, bcm2835-pl011 compatible Stefan Wahren
@ 2019-09-28 12:07 ` Stefan Wahren
  2019-09-28 12:07 ` [PATCH V3 4/8] dt-bindings: arm: Convert BCM2835 board/soc bindings to json-schema Stefan Wahren
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 25+ messages in thread
From: Stefan Wahren @ 2019-09-28 12:07 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Eric Anholt, Florian Fainelli,
	Ray Jui, Scott Branden
  Cc: devicetree, Catalin Marinas, bcm-kernel-feedback-list,
	Stefan Wahren, Will Deacon, linux-arm-kernel

As preparation we want all common BCM2711 + BCM2835/6/7 functions in
bcm283x.dtsi and all BCM2835/6/7 specific in the new
bcm2835-common.dtsi. Since i2c2 is BCM2835 specific, we also need
to move it to bcm2835-common.dtsi.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Eric Anholt <eric@anholt.net>
---
 arch/arm/boot/dts/bcm2835-common.dtsi | 194 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi    |   4 -
 arch/arm/boot/dts/bcm2835.dtsi        |   1 +
 arch/arm/boot/dts/bcm2836.dtsi        |   1 +
 arch/arm/boot/dts/bcm2837.dtsi        |   1 +
 arch/arm/boot/dts/bcm283x.dtsi        | 174 +-----------------------------
 6 files changed, 198 insertions(+), 177 deletions(-)
 create mode 100644 arch/arm/boot/dts/bcm2835-common.dtsi

diff --git a/arch/arm/boot/dts/bcm2835-common.dtsi b/arch/arm/boot/dts/bcm2835-common.dtsi
new file mode 100644
index 0000000..fe1ab40
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2835-common.dtsi
@@ -0,0 +1,194 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/* This include file covers the common peripherals and configuration between
+ * bcm2835, bcm2836 and bcm2837 implementations.
+ */
+
+/ {
+	interrupt-parent = <&intc>;
+
+	soc {
+		dma: dma@7e007000 {
+			compatible = "brcm,bcm2835-dma";
+			reg = <0x7e007000 0xf00>;
+			interrupts = <1 16>,
+				     <1 17>,
+				     <1 18>,
+				     <1 19>,
+				     <1 20>,
+				     <1 21>,
+				     <1 22>,
+				     <1 23>,
+				     <1 24>,
+				     <1 25>,
+				     <1 26>,
+				     /* dma channel 11-14 share one irq */
+				     <1 27>,
+				     <1 27>,
+				     <1 27>,
+				     <1 27>,
+				     /* unused shared irq for all channels */
+				     <1 28>;
+			interrupt-names = "dma0",
+					  "dma1",
+					  "dma2",
+					  "dma3",
+					  "dma4",
+					  "dma5",
+					  "dma6",
+					  "dma7",
+					  "dma8",
+					  "dma9",
+					  "dma10",
+					  "dma11",
+					  "dma12",
+					  "dma13",
+					  "dma14",
+					  "dma-shared-all";
+			#dma-cells = <1>;
+			brcm,dma-channel-mask = <0x7f35>;
+		};
+
+		intc: interrupt-controller@7e00b200 {
+			compatible = "brcm,bcm2835-armctrl-ic";
+			reg = <0x7e00b200 0x200>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
+		pm: watchdog@7e100000 {
+			compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
+			#power-domain-cells = <1>;
+			#reset-cells = <1>;
+			reg = <0x7e100000 0x114>,
+			      <0x7e00a000 0x24>;
+			clocks = <&clocks BCM2835_CLOCK_V3D>,
+				 <&clocks BCM2835_CLOCK_PERI_IMAGE>,
+				 <&clocks BCM2835_CLOCK_H264>,
+				 <&clocks BCM2835_CLOCK_ISP>;
+			clock-names = "v3d", "peri_image", "h264", "isp";
+			system-power-controller;
+		};
+
+		pixelvalve@7e206000 {
+			compatible = "brcm,bcm2835-pixelvalve0";
+			reg = <0x7e206000 0x100>;
+			interrupts = <2 13>; /* pwa0 */
+		};
+
+		pixelvalve@7e207000 {
+			compatible = "brcm,bcm2835-pixelvalve1";
+			reg = <0x7e207000 0x100>;
+			interrupts = <2 14>; /* pwa1 */
+		};
+
+		thermal: thermal@7e212000 {
+			compatible = "brcm,bcm2835-thermal";
+			reg = <0x7e212000 0x8>;
+			clocks = <&clocks BCM2835_CLOCK_TSENS>;
+			#thermal-sensor-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c2: i2c@7e805000 {
+			compatible = "brcm,bcm2835-i2c";
+			reg = <0x7e805000 0x1000>;
+			interrupts = <2 21>;
+			clocks = <&clocks BCM2835_CLOCK_VPU>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "okay";
+		};
+
+		pixelvalve@7e807000 {
+			compatible = "brcm,bcm2835-pixelvalve2";
+			reg = <0x7e807000 0x100>;
+			interrupts = <2 10>; /* pixelvalve */
+		};
+
+		hdmi: hdmi@7e902000 {
+			compatible = "brcm,bcm2835-hdmi";
+			reg = <0x7e902000 0x600>,
+			      <0x7e808000 0x100>;
+			interrupts = <2 8>, <2 9>;
+			ddc = <&i2c2>;
+			clocks = <&clocks BCM2835_PLLH_PIX>,
+				 <&clocks BCM2835_CLOCK_HSM>;
+			clock-names = "pixel", "hdmi";
+			dmas = <&dma 17>;
+			dma-names = "audio-rx";
+			status = "disabled";
+		};
+
+		v3d: v3d@7ec00000 {
+			compatible = "brcm,bcm2835-v3d";
+			reg = <0x7ec00000 0x1000>;
+			interrupts = <1 10>;
+			power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>;
+		};
+
+		vc4: gpu {
+			compatible = "brcm,bcm2835-vc4";
+		};
+	};
+};
+
+&cpu_thermal {
+	thermal-sensors = <&thermal>;
+};
+
+&gpio {
+	i2c_slave_gpio18: i2c_slave_gpio18 {
+		brcm,pins = <18 19 20 21>;
+		brcm,function = <BCM2835_FSEL_ALT3>;
+	};
+
+	jtag_gpio4: jtag_gpio4 {
+		brcm,pins = <4 5 6 12 13>;
+		brcm,function = <BCM2835_FSEL_ALT5>;
+	};
+
+	pwm0_gpio12: pwm0_gpio12 {
+		brcm,pins = <12>;
+		brcm,function = <BCM2835_FSEL_ALT0>;
+	};
+	pwm0_gpio18: pwm0_gpio18 {
+		brcm,pins = <18>;
+		brcm,function = <BCM2835_FSEL_ALT5>;
+	};
+	pwm0_gpio40: pwm0_gpio40 {
+		brcm,pins = <40>;
+		brcm,function = <BCM2835_FSEL_ALT0>;
+	};
+	pwm1_gpio13: pwm1_gpio13 {
+		brcm,pins = <13>;
+		brcm,function = <BCM2835_FSEL_ALT0>;
+	};
+	pwm1_gpio19: pwm1_gpio19 {
+		brcm,pins = <19>;
+		brcm,function = <BCM2835_FSEL_ALT5>;
+	};
+	pwm1_gpio41: pwm1_gpio41 {
+		brcm,pins = <41>;
+		brcm,function = <BCM2835_FSEL_ALT0>;
+	};
+	pwm1_gpio45: pwm1_gpio45 {
+		brcm,pins = <45>;
+		brcm,function = <BCM2835_FSEL_ALT0>;
+	};
+};
+
+&i2s {
+	dmas = <&dma 2>, <&dma 3>;
+	dma-names = "tx", "rx";
+};
+
+&sdhost {
+	dmas = <&dma 13>;
+	dma-names = "rx-tx";
+};
+
+&spi {
+	dmas = <&dma 6>, <&dma 7>;
+	dma-names = "tx", "rx";
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
index 6c6a7f6..394c8a7 100644
--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
@@ -59,10 +59,6 @@
 	clock-frequency = <100000>;
 };

-&i2c2 {
-	status = "okay";
-};
-
 &usb {
 	power-domains = <&power RPI_POWER_DOMAIN_USB>;
 };
diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi
index a5c3824..53bf457 100644
--- a/arch/arm/boot/dts/bcm2835.dtsi
+++ b/arch/arm/boot/dts/bcm2835.dtsi
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "bcm283x.dtsi"
+#include "bcm2835-common.dtsi"

 / {
 	compatible = "brcm,bcm2835";
diff --git a/arch/arm/boot/dts/bcm2836.dtsi b/arch/arm/boot/dts/bcm2836.dtsi
index c933e84..82d6c46 100644
--- a/arch/arm/boot/dts/bcm2836.dtsi
+++ b/arch/arm/boot/dts/bcm2836.dtsi
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "bcm283x.dtsi"
+#include "bcm2835-common.dtsi"

 / {
 	compatible = "brcm,bcm2836";
diff --git a/arch/arm/boot/dts/bcm2837.dtsi b/arch/arm/boot/dts/bcm2837.dtsi
index beb6c50..9e95fee 100644
--- a/arch/arm/boot/dts/bcm2837.dtsi
+++ b/arch/arm/boot/dts/bcm2837.dtsi
@@ -1,4 +1,5 @@
 #include "bcm283x.dtsi"
+#include "bcm2835-common.dtsi"

 / {
 	compatible = "brcm,bcm2837";
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index ae8296f..addf3be 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -18,7 +18,6 @@
 / {
 	compatible = "brcm,bcm2835";
 	model = "BCM2835";
-	interrupt-parent = <&intc>;
 	#address-cells = <1>;
 	#size-cells = <1>;

@@ -36,8 +35,6 @@
 			polling-delay-passive = <0>;
 			polling-delay = <1000>;

-			thermal-sensors = <&thermal>;
-
 			trips {
 				cpu-crit {
 					temperature	= <80000>;
@@ -73,68 +70,6 @@
 			interrupts = <1 11>;
 		};

-		dma: dma@7e007000 {
-			compatible = "brcm,bcm2835-dma";
-			reg = <0x7e007000 0xf00>;
-			interrupts = <1 16>,
-				     <1 17>,
-				     <1 18>,
-				     <1 19>,
-				     <1 20>,
-				     <1 21>,
-				     <1 22>,
-				     <1 23>,
-				     <1 24>,
-				     <1 25>,
-				     <1 26>,
-				     /* dma channel 11-14 share one irq */
-				     <1 27>,
-				     <1 27>,
-				     <1 27>,
-				     <1 27>,
-				     /* unused shared irq for all channels */
-				     <1 28>;
-			interrupt-names = "dma0",
-					  "dma1",
-					  "dma2",
-					  "dma3",
-					  "dma4",
-					  "dma5",
-					  "dma6",
-					  "dma7",
-					  "dma8",
-					  "dma9",
-					  "dma10",
-					  "dma11",
-					  "dma12",
-					  "dma13",
-					  "dma14",
-					  "dma-shared-all";
-			#dma-cells = <1>;
-			brcm,dma-channel-mask = <0x7f35>;
-		};
-
-		intc: interrupt-controller@7e00b200 {
-			compatible = "brcm,bcm2835-armctrl-ic";
-			reg = <0x7e00b200 0x200>;
-			interrupt-controller;
-			#interrupt-cells = <2>;
-		};
-
-		pm: watchdog@7e100000 {
-			compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
-			#power-domain-cells = <1>;
-			#reset-cells = <1>;
-			reg = <0x7e100000 0x114>,
-			      <0x7e00a000 0x24>;
-			clocks = <&clocks BCM2835_CLOCK_V3D>,
-				 <&clocks BCM2835_CLOCK_PERI_IMAGE>,
-				 <&clocks BCM2835_CLOCK_H264>,
-				 <&clocks BCM2835_CLOCK_ISP>;
-			clock-names = "v3d", "peri_image", "h264", "isp";
-			system-power-controller;
-		};
-
 		clocks: cprman@7e101000 {
 			compatible = "brcm,bcm2835-cprman";
 			#clock-cells = <1>;
@@ -184,8 +119,7 @@
 			interrupt-controller;
 			#interrupt-cells = <2>;

-			/* Defines pin muxing groups according to
-			 * BCM2835-ARM-Peripherals.pdf page 102.
+			/* Defines common pin muxing groups
 			 *
 			 * While each pin can have its mux selected
 			 * for various functions individually, some
@@ -263,15 +197,7 @@
 				brcm,pins = <44 45>;
 				brcm,function = <BCM2835_FSEL_ALT2>;
 			};
-			i2c_slave_gpio18: i2c_slave_gpio18 {
-				brcm,pins = <18 19 20 21>;
-				brcm,function = <BCM2835_FSEL_ALT3>;
-			};

-			jtag_gpio4: jtag_gpio4 {
-				brcm,pins = <4 5 6 12 13>;
-				brcm,function = <BCM2835_FSEL_ALT5>;
-			};
 			jtag_gpio22: jtag_gpio22 {
 				brcm,pins = <22 23 24 25 26 27>;
 				brcm,function = <BCM2835_FSEL_ALT4>;
@@ -286,35 +212,6 @@
 				brcm,function = <BCM2835_FSEL_ALT2>;
 			};

-			pwm0_gpio12: pwm0_gpio12 {
-				brcm,pins = <12>;
-				brcm,function = <BCM2835_FSEL_ALT0>;
-			};
-			pwm0_gpio18: pwm0_gpio18 {
-				brcm,pins = <18>;
-				brcm,function = <BCM2835_FSEL_ALT5>;
-			};
-			pwm0_gpio40: pwm0_gpio40 {
-				brcm,pins = <40>;
-				brcm,function = <BCM2835_FSEL_ALT0>;
-			};
-			pwm1_gpio13: pwm1_gpio13 {
-				brcm,pins = <13>;
-				brcm,function = <BCM2835_FSEL_ALT0>;
-			};
-			pwm1_gpio19: pwm1_gpio19 {
-				brcm,pins = <19>;
-				brcm,function = <BCM2835_FSEL_ALT5>;
-			};
-			pwm1_gpio41: pwm1_gpio41 {
-				brcm,pins = <41>;
-				brcm,function = <BCM2835_FSEL_ALT0>;
-			};
-			pwm1_gpio45: pwm1_gpio45 {
-				brcm,pins = <45>;
-				brcm,function = <BCM2835_FSEL_ALT0>;
-			};
-
 			sdhost_gpio48: sdhost_gpio48 {
 				brcm,pins = <48 49 50 51 52 53>;
 				brcm,function = <BCM2835_FSEL_ALT0>;
@@ -410,8 +307,6 @@
 			reg = <0x7e202000 0x100>;
 			interrupts = <2 24>;
 			clocks = <&clocks BCM2835_CLOCK_VPU>;
-			dmas = <&dma 13>;
-			dma-names = "rx-tx";
 			status = "disabled";
 		};

@@ -419,10 +314,6 @@
 			compatible = "brcm,bcm2835-i2s";
 			reg = <0x7e203000 0x24>;
 			clocks = <&clocks BCM2835_CLOCK_PCM>;
-
-			dmas = <&dma 2>,
-			       <&dma 3>;
-			dma-names = "tx", "rx";
 			status = "disabled";
 		};

@@ -431,8 +322,6 @@
 			reg = <0x7e204000 0x200>;
 			interrupts = <2 22>;
 			clocks = <&clocks BCM2835_CLOCK_VPU>;
-			dmas = <&dma 6>, <&dma 7>;
-			dma-names = "tx", "rx";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
@@ -448,18 +337,6 @@
 			status = "disabled";
 		};

-		pixelvalve@7e206000 {
-			compatible = "brcm,bcm2835-pixelvalve0";
-			reg = <0x7e206000 0x100>;
-			interrupts = <2 13>; /* pwa0 */
-		};
-
-		pixelvalve@7e207000 {
-			compatible = "brcm,bcm2835-pixelvalve1";
-			reg = <0x7e207000 0x100>;
-			interrupts = <2 14>; /* pwa1 */
-		};
-
 		dpi: dpi@7e208000 {
 			compatible = "brcm,bcm2835-dpi";
 			reg = <0x7e208000 0x8c>;
@@ -490,14 +367,6 @@

 		};

-		thermal: thermal@7e212000 {
-			compatible = "brcm,bcm2835-thermal";
-			reg = <0x7e212000 0x8>;
-			clocks = <&clocks BCM2835_CLOCK_TSENS>;
-			#thermal-sensor-cells = <0>;
-			status = "disabled";
-		};
-
 		aux: aux@7e215000 {
 			compatible = "brcm,bcm2835-aux";
 			#clock-cells = <1>;
@@ -587,16 +456,6 @@
 			status = "disabled";
 		};

-		i2c2: i2c@7e805000 {
-			compatible = "brcm,bcm2835-i2c";
-			reg = <0x7e805000 0x1000>;
-			interrupts = <2 21>;
-			clocks = <&clocks BCM2835_CLOCK_VPU>;
-			#address-cells = <1>;
-			#size-cells = <0>;
-			status = "disabled";
-		};
-
 		vec: vec@7e806000 {
 			compatible = "brcm,bcm2835-vec";
 			reg = <0x7e806000 0x1000>;
@@ -605,26 +464,6 @@
 			status = "disabled";
 		};

-		pixelvalve@7e807000 {
-			compatible = "brcm,bcm2835-pixelvalve2";
-			reg = <0x7e807000 0x100>;
-			interrupts = <2 10>; /* pixelvalve */
-		};
-
-		hdmi: hdmi@7e902000 {
-			compatible = "brcm,bcm2835-hdmi";
-			reg = <0x7e902000 0x600>,
-			      <0x7e808000 0x100>;
-			interrupts = <2 8>, <2 9>;
-			ddc = <&i2c2>;
-			clocks = <&clocks BCM2835_PLLH_PIX>,
-				 <&clocks BCM2835_CLOCK_HSM>;
-			clock-names = "pixel", "hdmi";
-			dmas = <&dma 17>;
-			dma-names = "audio-rx";
-			status = "disabled";
-		};
-
 		usb: usb@7e980000 {
 			compatible = "brcm,bcm2835-usb";
 			reg = <0x7e980000 0x10000>;
@@ -636,17 +475,6 @@
 			phys = <&usbphy>;
 			phy-names = "usb2-phy";
 		};
-
-		v3d: v3d@7ec00000 {
-			compatible = "brcm,bcm2835-v3d";
-			reg = <0x7ec00000 0x1000>;
-			interrupts = <1 10>;
-			power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>;
-		};
-
-		vc4: gpu {
-			compatible = "brcm,bcm2835-vc4";
-		};
 	};

 	clocks {
--
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 4/8] dt-bindings: arm: Convert BCM2835 board/soc bindings to json-schema
  2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
                   ` (2 preceding siblings ...)
  2019-09-28 12:07 ` [PATCH V3 3/8] ARM: dts: bcm283x: Move BCM2835/6/7 specific to bcm2835-common.dtsi Stefan Wahren
@ 2019-09-28 12:07 ` Stefan Wahren
  2019-10-01 13:46   ` Rob Herring
  2019-09-28 12:07 ` [PATCH V3 5/8] dt-bindings: arm: bcm2835: Add Raspberry Pi 4 to DT schema Stefan Wahren
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 25+ messages in thread
From: Stefan Wahren @ 2019-09-28 12:07 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Eric Anholt, Florian Fainelli,
	Ray Jui, Scott Branden
  Cc: devicetree, Catalin Marinas, bcm-kernel-feedback-list,
	Stefan Wahren, Will Deacon, linux-arm-kernel

Convert the BCM2835/6/7 SoC bindings to DT schema format using json-schema.
All the other Broadcom boards are maintained by Florian Fainelli.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Eric Anholt <eric@anholt.net>
---
 .../devicetree/bindings/arm/bcm/bcm2835.yaml       | 48 ++++++++++++++++
 .../devicetree/bindings/arm/bcm/brcm,bcm2835.txt   | 67 ----------------------
 2 files changed, 48 insertions(+), 67 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
 delete mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt

diff --git a/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml b/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
new file mode 100644
index 0000000..67bf9e2
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/bcm/bcm2835.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom BCM2711/BCM2835 Platforms Device Tree Bindings
+
+maintainers:
+  - Eric Anholt <eric@anholt.net>
+  - Stefan Wahren <wahrenst@gmx.net>
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    oneOf:
+      - description: BCM2835 based Boards
+        items:
+          - enum:
+              - raspberrypi,model-a
+              - raspberrypi,model-a-plus
+              - raspberrypi,model-b
+              - raspberrypi,model-b-i2c0  # Raspberry Pi Model B (no P5)
+              - raspberrypi,model-b-rev2
+              - raspberrypi,model-b-plus
+              - raspberrypi,compute-module
+              - raspberrypi,model-zero
+              - raspberrypi,model-zero-w
+          - const: brcm,bcm2835
+
+      - description: BCM2836 based Boards
+        items:
+          - enum:
+              - raspberrypi,2-model-b
+          - const: brcm,bcm2836
+
+      - description: BCM2837 based Boards
+        items:
+          - enum:
+              - raspberrypi,3-model-a-plus
+              - raspberrypi,3-model-b
+              - raspberrypi,3-model-b-plus
+              - raspberrypi,3-compute-module
+              - raspberrypi,3-compute-module-lite
+          - const: brcm,bcm2837
+
+...
diff --git a/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt b/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
deleted file mode 100644
index 245328f..0000000
--- a/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-Broadcom BCM2835 device tree bindings
--------------------------------------------
-
-Raspberry Pi Model A
-Required root node properties:
-compatible = "raspberrypi,model-a", "brcm,bcm2835";
-
-Raspberry Pi Model A+
-Required root node properties:
-compatible = "raspberrypi,model-a-plus", "brcm,bcm2835";
-
-Raspberry Pi Model B
-Required root node properties:
-compatible = "raspberrypi,model-b", "brcm,bcm2835";
-
-Raspberry Pi Model B (no P5)
-early model B with I2C0 rather than I2C1 routed to the expansion header
-Required root node properties:
-compatible = "raspberrypi,model-b-i2c0", "brcm,bcm2835";
-
-Raspberry Pi Model B rev2
-Required root node properties:
-compatible = "raspberrypi,model-b-rev2", "brcm,bcm2835";
-
-Raspberry Pi Model B+
-Required root node properties:
-compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
-
-Raspberry Pi 2 Model B
-Required root node properties:
-compatible = "raspberrypi,2-model-b", "brcm,bcm2836";
-
-Raspberry Pi 3 Model A+
-Required root node properties:
-compatible = "raspberrypi,3-model-a-plus", "brcm,bcm2837";
-
-Raspberry Pi 3 Model B
-Required root node properties:
-compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
-
-Raspberry Pi 3 Model B+
-Required root node properties:
-compatible = "raspberrypi,3-model-b-plus", "brcm,bcm2837";
-
-Raspberry Pi Compute Module
-Required root node properties:
-compatible = "raspberrypi,compute-module", "brcm,bcm2835";
-
-Raspberry Pi Compute Module 3
-Required root node properties:
-compatible = "raspberrypi,3-compute-module", "brcm,bcm2837";
-
-Raspberry Pi Compute Module 3 Lite
-Required root node properties:
-compatible = "raspberrypi,3-compute-module-lite", "brcm,bcm2837";
-
-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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 5/8] dt-bindings: arm: bcm2835: Add Raspberry Pi 4 to DT schema
  2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
                   ` (3 preceding siblings ...)
  2019-09-28 12:07 ` [PATCH V3 4/8] dt-bindings: arm: Convert BCM2835 board/soc bindings to json-schema Stefan Wahren
@ 2019-09-28 12:07 ` Stefan Wahren
  2019-10-01 13:46   ` Rob Herring
  2019-09-28 12:07 ` [PATCH V3 6/8] ARM: bcm: Add support for BCM2711 SoC Stefan Wahren
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 25+ messages in thread
From: Stefan Wahren @ 2019-09-28 12:07 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Eric Anholt, Florian Fainelli,
	Ray Jui, Scott Branden
  Cc: devicetree, Catalin Marinas, bcm-kernel-feedback-list,
	Stefan Wahren, Will Deacon, linux-arm-kernel

Add new Raspberry Pi 4 to DT schema.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Eric Anholt <eric@anholt.net>
---
 Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml b/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
index 67bf9e2..dd52e29 100644
--- a/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
+++ b/Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
@@ -15,6 +15,12 @@ properties:
     const: '/'
   compatible:
     oneOf:
+      - description: BCM2711 based Boards
+        items:
+          - enum:
+              - raspberrypi,4-model-b
+          - const: brcm,bcm2711
+
       - description: BCM2835 based Boards
         items:
           - enum:
--
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 6/8] ARM: bcm: Add support for BCM2711 SoC
  2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
                   ` (4 preceding siblings ...)
  2019-09-28 12:07 ` [PATCH V3 5/8] dt-bindings: arm: bcm2835: Add Raspberry Pi 4 to DT schema Stefan Wahren
@ 2019-09-28 12:07 ` Stefan Wahren
  2019-09-28 19:16   ` Florian Fainelli
  2019-09-28 12:07 ` [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support Stefan Wahren
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 25+ messages in thread
From: Stefan Wahren @ 2019-09-28 12:07 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Eric Anholt, Florian Fainelli,
	Ray Jui, Scott Branden
  Cc: devicetree, Catalin Marinas, bcm-kernel-feedback-list,
	Stefan Wahren, Will Deacon, linux-arm-kernel

Add the BCM2711 to ARCH_BCM2835, but use new machine board code
because of the differences.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
---
 arch/arm/mach-bcm/Kconfig    |  3 ++-
 arch/arm/mach-bcm/Makefile   |  3 ++-
 arch/arm/mach-bcm/bcm2711.c  | 24 ++++++++++++++++++++++++
 arch/arm64/Kconfig.platforms |  5 +++--
 4 files changed, 31 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mach-bcm/bcm2711.c

diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index 5e5f1fa..39bcbea 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -161,6 +161,7 @@ config ARCH_BCM2835
 	select GPIOLIB
 	select ARM_AMBA
 	select ARM_ERRATA_411920 if ARCH_MULTI_V6
+	select ARM_GIC if ARCH_MULTI_V7
 	select ARM_TIMER_SP804
 	select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
 	select TIMER_OF
@@ -169,7 +170,7 @@ config ARCH_BCM2835
 	select PINCTRL_BCM2835
 	select MFD_CORE
 	help
-	  This enables support for the Broadcom BCM2835 and BCM2836 SoCs.
+	  This enables support for the Broadcom BCM2711 and BCM283x SoCs.
 	  This SoC is used in the Raspberry Pi and Roku 2 devices.

 config ARCH_BCM_53573
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
index b59c813..7baa8c9 100644
--- a/arch/arm/mach-bcm/Makefile
+++ b/arch/arm/mach-bcm/Makefile
@@ -42,8 +42,9 @@ obj-$(CONFIG_ARCH_BCM_MOBILE_L2_CACHE) += kona_l2_cache.o
 obj-$(CONFIG_ARCH_BCM_MOBILE_SMC) += bcm_kona_smc.o

 # BCM2835
-obj-$(CONFIG_ARCH_BCM2835)	+= board_bcm2835.o
 ifeq ($(CONFIG_ARCH_BCM2835),y)
+obj-y				+= board_bcm2835.o
+obj-y				+= bcm2711.o
 ifeq ($(CONFIG_ARM),y)
 obj-$(CONFIG_SMP)		+= platsmp.o
 endif
diff --git a/arch/arm/mach-bcm/bcm2711.c b/arch/arm/mach-bcm/bcm2711.c
new file mode 100644
index 0000000..dbe2967
--- /dev/null
+++ b/arch/arm/mach-bcm/bcm2711.c
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Stefan Wahren
+ */
+
+#include <linux/of_address.h>
+
+#include <asm/mach/arch.h>
+
+#include "platsmp.h"
+
+static const char * const bcm2711_compat[] = {
+#ifdef CONFIG_ARCH_MULTI_V7
+	"brcm,bcm2711",
+#endif
+};
+
+DT_MACHINE_START(BCM2711, "BCM2711")
+#ifdef CONFIG_ZONE_DMA
+	.dma_zone_size	= SZ_1G,
+#endif
+	.dt_compat = bcm2711_compat,
+	.smp = smp_ops(bcm2836_smp_ops),
+MACHINE_END
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 16d7614..b5d31dc 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -37,11 +37,12 @@ config ARCH_BCM2835
 	select PINCTRL
 	select PINCTRL_BCM2835
 	select ARM_AMBA
+	select ARM_GIC
 	select ARM_TIMER_SP804
 	select HAVE_ARM_ARCH_TIMER
 	help
-	  This enables support for the Broadcom BCM2837 SoC.
-	  This SoC is used in the Raspberry Pi 3 device.
+	  This enables support for the Broadcom BCM2837 and BCM2711 SoC.
+	  This SoC is used in the Raspberry Pi 3 and 4 device.

 config ARCH_BCM_IPROC
 	bool "Broadcom iProc SoC Family"
--
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support
  2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
                   ` (5 preceding siblings ...)
  2019-09-28 12:07 ` [PATCH V3 6/8] ARM: bcm: Add support for BCM2711 SoC Stefan Wahren
@ 2019-09-28 12:07 ` Stefan Wahren
  2019-09-28 19:58   ` Florian Fainelli
  2019-09-29 11:25   ` Marc Zyngier
  2019-09-28 12:07 ` [PATCH V3 8/8] MAINTAINERS: Add BCM2711 to BCM2835 ARCH Stefan Wahren
                   ` (2 subsequent siblings)
  9 siblings, 2 replies; 25+ messages in thread
From: Stefan Wahren @ 2019-09-28 12:07 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Eric Anholt, Florian Fainelli,
	Ray Jui, Scott Branden
  Cc: devicetree, Catalin Marinas, bcm-kernel-feedback-list,
	Stefan Wahren, Will Deacon, linux-arm-kernel

This adds minimal support for the new Raspberry Pi 4 without the
fancy stuff like GENET, PCIe, xHCI, 40 bit DMA and V3D. The RPi 4 is
available in 3 different variants (1, 2 and 4 GB RAM), so leave the memory
size to zero and let the bootloader take care of it. The DWC2 is still
usable as peripheral via the USB-C port.

Other differences to the Raspberry Pi 3:
- additional GIC 400 Interrupt controller
- new thermal IP and HWRNG
- additional MMC interface (emmc2)
- additional UART, I2C, SPI and PWM interfaces
- clock stretching bug in I2C IP has been fixed

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Eric Anholt <eric@anholt.net>
---
 arch/arm/boot/dts/Makefile                        |   1 +
 arch/arm/boot/dts/bcm2711-rpi-4-b.dts             | 121 ++++
 arch/arm/boot/dts/bcm2711.dtsi                    | 838 ++++++++++++++++++++++
 arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi |   7 +
 arch/arm/boot/dts/bcm283x.dtsi                    |   4 +-
 5 files changed, 969 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b.dts
 create mode 100644 arch/arm/boot/dts/bcm2711.dtsi
 create mode 100644 arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b21b3a6..21002cd 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -83,6 +83,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
 	bcm2837-rpi-3-b.dtb \
 	bcm2837-rpi-3-b-plus.dtb \
 	bcm2837-rpi-cm3-io3.dtb \
+	bcm2711-rpi-4-b.dtb \
 	bcm2835-rpi-zero.dtb \
 	bcm2835-rpi-zero-w.dtb
 dtb-$(CONFIG_ARCH_BCM_5301X) += \
diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
new file mode 100644
index 0000000..3825273
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
@@ -0,0 +1,121 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+#include "bcm2711.dtsi"
+#include "bcm2835-rpi.dtsi"
+#include "bcm283x-rpi-usb-peripheral.dtsi"
+
+/ {
+	compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
+	model = "Raspberry Pi 4 Model B";
+
+	chosen {
+		/* 8250 auxiliary UART instead of pl011 */
+		stdout-path = "serial1:115200n8";
+	};
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0 0 0x00000000>;
+	};
+
+	leds {
+		act {
+			gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
+		};
+
+		pwr {
+			label = "PWR";
+			gpios = <&expgpio 2 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	wifi_pwrseq: wifi-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>;
+	};
+
+	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";
+	};
+};
+
+&firmware {
+	expgpio: gpio {
+		compatible = "raspberrypi,firmware-gpio";
+		gpio-controller;
+		#gpio-cells = <2>;
+		gpio-line-names = "BT_ON",
+				  "WL_ON",
+				  "PWR_LED_OFF",
+				  "GLOBAL_RESET",
+				  "VDD_SD_IO_SEL",
+				  "CAM_GPIO",
+				  "",
+				  "";
+		status = "okay";
+	};
+};
+
+&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>;
+	broken-cd;
+	status = "okay";
+};
+
+/* uart0 communicates with the BT module */
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_ctsrts_gpio30 &uart0_gpio32 &gpclk2_gpio43>;
+	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";
+};
+
+&vchiq {
+	interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
+};
diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
new file mode 100644
index 0000000..a369a7e5
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2711.dtsi
@@ -0,0 +1,838 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "bcm283x.dtsi"
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/soc/bcm2835-pm.h>
+
+/ {
+	compatible = "brcm,bcm2711";
+
+	#address-cells = <2>;
+	#size-cells = <1>;
+
+	interrupt-parent = <&gicv2>;
+
+	soc {
+		ranges = <0x7e000000  0x0 0xfe000000  0x01800000>,
+			 <0x7c000000  0x0 0xfc000000  0x02000000>,
+			 <0x40000000  0x0 0xff800000  0x00800000>;
+		/* Emulate a contiguous 30-bit address range for DMA */
+		dma-ranges = <0xc0000000  0x0 0x00000000  0x3c000000>;
+
+		local_intc: local_intc@40000000 {
+			compatible = "brcm,bcm2836-l1-intc";
+			reg = <0x40000000 0x100>;
+		};
+
+		gicv2: interrupt-controller@40041000 {
+			interrupt-controller;
+			#interrupt-cells = <3>;
+			compatible = "arm,gic-400";
+			reg =	<0x40041000 0x1000>,
+				<0x40042000 0x2000>,
+				<0x40044000 0x2000>,
+				<0x40046000 0x2000>;
+			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) |
+						 IRQ_TYPE_LEVEL_HIGH)>;
+		};
+
+		dma: dma@7e007000 {
+			compatible = "brcm,bcm2835-dma";
+			reg = <0x7e007000 0xb00>;
+			interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>,
+				     /* DMA lite 7 - 10 */
+				     <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "dma0",
+					  "dma1",
+					  "dma2",
+					  "dma3",
+					  "dma4",
+					  "dma5",
+					  "dma6",
+					  "dma7",
+					  "dma8",
+					  "dma9",
+					  "dma10";
+			#dma-cells = <1>;
+			brcm,dma-channel-mask = <0x07f5>;
+		};
+
+		pm: watchdog@7e100000 {
+			compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
+			#power-domain-cells = <1>;
+			#reset-cells = <1>;
+			reg = <0x7e100000 0x114>,
+			      <0x7e00a000 0x24>,
+			      <0x7ec11000 0x20>;
+			clocks = <&clocks BCM2835_CLOCK_V3D>,
+				 <&clocks BCM2835_CLOCK_PERI_IMAGE>,
+				 <&clocks BCM2835_CLOCK_H264>,
+				 <&clocks BCM2835_CLOCK_ISP>;
+			clock-names = "v3d", "peri_image", "h264", "isp";
+			system-power-controller;
+		};
+
+		rng@7e104000 {
+			interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;
+
+			/* RNG is incompatible to brcm,bcm2835-rng */
+			status = "disabled";
+		};
+
+		uart2: serial@7e201400 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0x7e201400 0x200>;
+			interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_UART>,
+				 <&clocks BCM2835_CLOCK_VPU>;
+			clock-names = "uartclk", "apb_pclk";
+			arm,primecell-periphid = <0x00241011>;
+			status = "disabled";
+		};
+
+		uart3: serial@7e201600 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0x7e201600 0x200>;
+			interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_UART>,
+				 <&clocks BCM2835_CLOCK_VPU>;
+			clock-names = "uartclk", "apb_pclk";
+			arm,primecell-periphid = <0x00241011>;
+			status = "disabled";
+		};
+
+		uart4: serial@7e201800 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0x7e201800 0x200>;
+			interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_UART>,
+				 <&clocks BCM2835_CLOCK_VPU>;
+			clock-names = "uartclk", "apb_pclk";
+			arm,primecell-periphid = <0x00241011>;
+			status = "disabled";
+		};
+
+		uart5: serial@7e201a00 {
+			compatible = "arm,pl011", "arm,primecell";
+			reg = <0x7e201a00 0x200>;
+			interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_UART>,
+				 <&clocks BCM2835_CLOCK_VPU>;
+			clock-names = "uartclk", "apb_pclk";
+			arm,primecell-periphid = <0x00241011>;
+			status = "disabled";
+		};
+
+		spi@7e204000 {
+			reg = <0x7e204000 0x0200>;
+			interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+		};
+
+		spi3: spi@7e204600 {
+			compatible = "brcm,bcm2835-spi";
+			reg = <0x7e204600 0x0200>;
+			interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_VPU>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		spi4: spi@7e204800 {
+			compatible = "brcm,bcm2835-spi";
+			reg = <0x7e204800 0x0200>;
+			interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_VPU>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		spi5: spi@7e204a00 {
+			compatible = "brcm,bcm2835-spi";
+			reg = <0x7e204a00 0x0200>;
+			interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_VPU>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		spi6: spi@7e204c00 {
+			compatible = "brcm,bcm2835-spi";
+			reg = <0x7e204c00 0x0200>;
+			interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_VPU>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c3: i2c@7e205600 {
+			compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c";
+			reg = <0x7e205600 0x200>;
+			interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_VPU>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c4: i2c@7e205800 {
+			compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c";
+			reg = <0x7e205800 0x200>;
+			interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_VPU>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c5: i2c@7e205a00 {
+			compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c";
+			reg = <0x7e205a00 0x200>;
+			interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_VPU>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c6: i2c@7e205c00 {
+			compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c";
+			reg = <0x7e205c00 0x200>;
+			interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2835_CLOCK_VPU>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		pwm1: pwm@7e20c800 {
+			compatible = "brcm,bcm2835-pwm";
+			reg = <0x7e20c800 0x28>;
+			clocks = <&clocks BCM2835_CLOCK_PWM>;
+			assigned-clocks = <&clocks BCM2835_CLOCK_PWM>;
+			assigned-clock-rates = <10000000>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		emmc2: emmc2@7e340000 {
+			compatible = "brcm,bcm2711-emmc2";
+			reg = <0x7e340000 0x100>;
+			interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clocks BCM2711_CLOCK_EMMC2>;
+			status = "disabled";
+		};
+
+		hvs@7e400000 {
+			interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
+		};
+	};
+
+	arm-pmu {
+		compatible = "arm,cortex-a72-pmu", "arm,armv8-pmuv3";
+		interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
+			<GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
+			<GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
+			<GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
+	};
+
+	timer {
+		compatible = "arm,armv8-timer";
+		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) |
+					  IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) |
+					  IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) |
+					  IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) |
+					  IRQ_TYPE_LEVEL_LOW)>;
+		/* This only applies to the ARMv7 stub */
+		arm,cpu-registers-not-fw-configured;
+
+		/* The ARM cores doesn't enter deep enough states */
+		always-on;
+	};
+
+	cpus: cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		enable-method = "brcm,bcm2836-smp"; // for ARM 32-bit
+
+		cpu0: cpu@0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a72";
+			reg = <0>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x000000d8>;
+		};
+
+		cpu1: cpu@1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a72";
+			reg = <1>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x000000e0>;
+		};
+
+		cpu2: cpu@2 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a72";
+			reg = <2>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x000000e8>;
+		};
+
+		cpu3: cpu@3 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a72";
+			reg = <3>;
+			enable-method = "spin-table";
+			cpu-release-addr = <0x0 0x000000f0>;
+		};
+	};
+};
+
+&clk_osc {
+	clock-frequency = <54000000>;
+};
+
+&clocks {
+	compatible = "brcm,bcm2711-cprman";
+};
+
+&cpu_thermal {
+	coefficients = <(-487) 410040>;
+};
+
+&dsi0 {
+	interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&dsi1 {
+	interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&gpio {
+	compatible = "brcm,bcm2711-gpio";
+	interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
+
+	gpclk0_gpio49: gpclk0_gpio49 {
+		pin-gpclk {
+			pins = "gpio49";
+			function = "alt1";
+			bias-disable;
+		};
+	};
+	gpclk1_gpio50: gpclk1_gpio50 {
+		pin-gpclk {
+			pins = "gpio50";
+			function = "alt1";
+			bias-disable;
+		};
+	};
+	gpclk2_gpio51: gpclk2_gpio51 {
+		pin-gpclk {
+			pins = "gpio51";
+			function = "alt1";
+			bias-disable;
+		};
+	};
+
+	i2c0_gpio46: i2c0_gpio46 {
+		pin-sda {
+			function = "alt0";
+			pins = "gpio46";
+			bias-pull-up;
+		};
+		pin-scl {
+			function = "alt0";
+			pins = "gpio47";
+			bias-disable;
+		};
+	};
+	i2c1_gpio46: i2c1_gpio46 {
+		pin-sda {
+			function = "alt1";
+			pins = "gpio46";
+			bias-pull-up;
+		};
+		pin-scl {
+			function = "alt1";
+			pins = "gpio47";
+			bias-disable;
+		};
+	};
+	i2c3_gpio2: i2c3_gpio2 {
+		pin-sda {
+			function = "alt5";
+			pins = "gpio2";
+			bias-pull-up;
+		};
+		pin-scl {
+			function = "alt5";
+			pins = "gpio3";
+			bias-disable;
+		};
+	};
+	i2c3_gpio4: i2c3_gpio4 {
+		pin-sda {
+			function = "alt5";
+			pins = "gpio4";
+			bias-pull-up;
+		};
+		pin-scl {
+			function = "alt5";
+			pins = "gpio5";
+			bias-disable;
+		};
+	};
+	i2c4_gpio6: i2c4_gpio6 {
+		pin-sda {
+			function = "alt5";
+			pins = "gpio6";
+			bias-pull-up;
+		};
+		pin-scl {
+			function = "alt5";
+			pins = "gpio7";
+			bias-disable;
+		};
+	};
+	i2c4_gpio8: i2c4_gpio8 {
+		pin-sda {
+			function = "alt5";
+			pins = "gpio8";
+			bias-pull-up;
+		};
+		pin-scl {
+			function = "alt5";
+			pins = "gpio9";
+			bias-disable;
+		};
+	};
+	i2c5_gpio10: i2c5_gpio10 {
+		pin-sda {
+			function = "alt5";
+			pins = "gpio10";
+			bias-pull-up;
+		};
+		pin-scl {
+			function = "alt5";
+			pins = "gpio11";
+			bias-disable;
+		};
+	};
+	i2c5_gpio12: i2c5_gpio12 {
+		pin-sda {
+			function = "alt5";
+			pins = "gpio12";
+			bias-pull-up;
+		};
+		pin-scl {
+			function = "alt5";
+			pins = "gpio13";
+			bias-disable;
+		};
+	};
+	i2c6_gpio0: i2c6_gpio0 {
+		pin-sda {
+			function = "alt5";
+			pins = "gpio0";
+			bias-pull-up;
+		};
+		pin-scl {
+			function = "alt5";
+			pins = "gpio1";
+			bias-disable;
+		};
+	};
+	i2c6_gpio22: i2c6_gpio22 {
+		pin-sda {
+			function = "alt5";
+			pins = "gpio22";
+			bias-pull-up;
+		};
+		pin-scl {
+			function = "alt5";
+			pins = "gpio23";
+			bias-disable;
+		};
+	};
+	i2c_slave_gpio8: i2c_slave_gpio8 {
+		pins-i2c-slave {
+			pins = "gpio8",
+			       "gpio9",
+			       "gpio10",
+			       "gpio11";
+			function = "alt3";
+		};
+	};
+
+	jtag_gpio48: jtag_gpio48 {
+		pins-jtag {
+			pins = "gpio48",
+			       "gpio49",
+			       "gpio50",
+			       "gpio51",
+			       "gpio52",
+			       "gpio53";
+			function = "alt4";
+		};
+	};
+
+	mii_gpio28: mii_gpio28 {
+		pins-mii {
+			pins = "gpio28",
+			       "gpio29",
+			       "gpio30",
+			       "gpio31";
+			function = "alt4";
+		};
+	};
+	mii_gpio36: mii_gpio36 {
+		pins-mii {
+			pins = "gpio36",
+			       "gpio37",
+			       "gpio38",
+			       "gpio39";
+			function = "alt5";
+		};
+	};
+
+	pcm_gpio50: pcm_gpio50 {
+		pins-pcm {
+			pins = "gpio50",
+			       "gpio51",
+			       "gpio52",
+			       "gpio53";
+			function = "alt2";
+		};
+	};
+
+	pwm0_0_gpio12: pwm0_0_gpio12 {
+		pin-pwm {
+			pins = "gpio12";
+			function = "alt0";
+			bias-disable;
+		};
+	};
+	pwm0_0_gpio18: pwm0_0_gpio18 {
+		pin-pwm {
+			pins = "gpio18";
+			function = "alt5";
+			bias-disable;
+		};
+	};
+	pwm1_0_gpio40: pwm1_0_gpio40 {
+		pin-pwm {
+			pins = "gpio40";
+			function = "alt0";
+			bias-disable;
+		};
+	};
+	pwm0_1_gpio13: pwm0_1_gpio13 {
+		pin-pwm {
+			pins = "gpio13";
+			function = "alt0";
+			bias-disable;
+		};
+	};
+	pwm0_1_gpio19: pwm0_1_gpio19 {
+		pin-pwm {
+			pins = "gpio19";
+			function = "alt5";
+			bias-disable;
+		};
+	};
+	pwm1_1_gpio41: pwm1_1_gpio41 {
+		pin-pwm {
+			pins = "gpio41";
+			function = "alt0";
+			bias-disable;
+		};
+	};
+	pwm0_1_gpio45: pwm0_1_gpio45 {
+		pin-pwm {
+			pins = "gpio45";
+			function = "alt0";
+			bias-disable;
+		};
+	};
+	pwm0_0_gpio52: pwm0_0_gpio52 {
+		pin-pwm {
+			pins = "gpio52";
+			function = "alt1";
+			bias-disable;
+		};
+	};
+	pwm0_1_gpio53: pwm0_1_gpio53 {
+		pin-pwm {
+			pins = "gpio53";
+			function = "alt1";
+			bias-disable;
+		};
+	};
+
+	rgmii_gpio35: rgmii_gpio35 {
+		pin-start-stop {
+			pins = "gpio35";
+			function = "alt4";
+		};
+		pin-rx-ok {
+			pins = "gpio36";
+			function = "alt4";
+		};
+	};
+	rgmii_irq_gpio34: rgmii_irq_gpio34 {
+		pin-irq {
+			pins = "gpio34";
+			function = "alt5";
+		};
+	};
+	rgmii_irq_gpio39: rgmii_irq_gpio39 {
+		pin-irq {
+			pins = "gpio39";
+			function = "alt4";
+		};
+	};
+	rgmii_mdio_gpio28: rgmii_mdio_gpio28 {
+		pins-mdio {
+			pins = "gpio28",
+			       "gpio29";
+			function = "alt5";
+		};
+	};
+	rgmii_mdio_gpio37: rgmii_mdio_gpio37 {
+		pins-mdio {
+			pins = "gpio37",
+			       "gpio38";
+			function = "alt4";
+		};
+	};
+
+	spi0_gpio46: spi0_gpio46 {
+		pins-spi {
+			pins = "gpio46",
+			       "gpio47",
+			       "gpio48",
+			       "gpio49";
+			function = "alt2";
+		};
+	};
+	spi2_gpio46: spi2_gpio46 {
+		pins-spi {
+			pins = "gpio46",
+			       "gpio47",
+			       "gpio48",
+			       "gpio49",
+			       "gpio50";
+			function = "alt5";
+		};
+	};
+	spi3_gpio0: spi3_gpio0 {
+		pins-spi {
+			pins = "gpio0",
+			       "gpio1",
+			       "gpio2",
+			       "gpio3";
+			function = "alt3";
+		};
+	};
+	spi4_gpio4: spi4_gpio4 {
+		pins-spi {
+			pins = "gpio4",
+			       "gpio5",
+			       "gpio6",
+			       "gpio7";
+			function = "alt3";
+		};
+	};
+	spi5_gpio12: spi5_gpio12 {
+		pins-spi {
+			pins = "gpio12",
+			       "gpio13",
+			       "gpio14",
+			       "gpio15";
+			function = "alt3";
+		};
+	};
+	spi6_gpio18: spi6_gpio18 {
+		pins-spi {
+			pins = "gpio18",
+			       "gpio19",
+			       "gpio20",
+			       "gpio21";
+			function = "alt3";
+		};
+	};
+
+	uart2_gpio0: uart2_gpio0 {
+		pin-tx {
+			pins = "gpio0";
+			function = "alt4";
+			bias-disable;
+		};
+		pin-rx {
+			pins = "gpio1";
+			function = "alt4";
+			bias-pull-up;
+		};
+	};
+	uart2_ctsrts_gpio2: uart2_ctsrts_gpio2 {
+		pin-cts {
+			pins = "gpio2";
+			function = "alt4";
+			bias-pull-up;
+		};
+		pin-rts {
+			pins = "gpio3";
+			function = "alt4";
+			bias-disable;
+		};
+	};
+	uart3_gpio4: uart3_gpio4 {
+		pin-tx {
+			pins = "gpio4";
+			function = "alt4";
+			bias-disable;
+		};
+		pin-rx {
+			pins = "gpio5";
+			function = "alt4";
+			bias-pull-up;
+		};
+	};
+	uart3_ctsrts_gpio6: uart3_ctsrts_gpio6 {
+		pin-cts {
+			pins = "gpio6";
+			function = "alt4";
+			bias-pull-up;
+		};
+		pin-rts {
+			pins = "gpio7";
+			function = "alt4";
+			bias-disable;
+		};
+	};
+	uart4_gpio8: uart4_gpio8 {
+		pin-tx {
+			pins = "gpio8";
+			function = "alt4";
+			bias-disable;
+		};
+		pin-rx {
+			pins = "gpio9";
+			function = "alt4";
+			bias-pull-up;
+		};
+	};
+	uart4_ctsrts_gpio10: uart4_ctsrts_gpio10 {
+		pin-cts {
+			pins = "gpio10";
+			function = "alt4";
+			bias-pull-up;
+		};
+		pin-rts {
+			pins = "gpio11";
+			function = "alt4";
+			bias-disable;
+		};
+	};
+	uart5_gpio12: uart5_gpio12 {
+		pin-tx {
+			pins = "gpio12";
+			function = "alt4";
+			bias-disable;
+		};
+		pin-rx {
+			pins = "gpio13";
+			function = "alt4";
+			bias-pull-up;
+		};
+	};
+	uart5_ctsrts_gpio14: uart5_ctsrts_gpio14 {
+		pin-cts {
+			pins = "gpio14";
+			function = "alt4";
+			bias-pull-up;
+		};
+		pin-rts {
+			pins = "gpio15";
+			function = "alt4";
+			bias-disable;
+		};
+	};
+};
+
+&i2c0 {
+	compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c";
+	interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&i2c1 {
+	compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c";
+	interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&mailbox {
+	interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&sdhci {
+	interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&sdhost {
+	interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&spi1 {
+	interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&spi2 {
+	interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&system_timer {
+	interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>,
+		     <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&txp {
+	interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&uart0 {
+	interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&uart1 {
+	interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&usb {
+	interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&vec {
+	interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
+};
diff --git a/arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi b/arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi
new file mode 100644
index 0000000..0ff0e9e
--- /dev/null
+++ b/arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
+&usb {
+	dr_mode = "peripheral";
+	g-rx-fifo-size = <256>;
+	g-np-tx-fifo-size = <32>;
+	g-tx-fifo-size = <256 256 512 512 512 768 768>;
+};
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index addf3be..3caaa57 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -53,7 +53,7 @@
 		#address-cells = <1>;
 		#size-cells = <1>;

-		timer@7e003000 {
+		system_timer: timer@7e003000 {
 			compatible = "brcm,bcm2835-system-timer";
 			reg = <0x7e003000 0x1000>;
 			interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
@@ -64,7 +64,7 @@
 			clock-frequency = <1000000>;
 		};

-		txp@7e004000 {
+		txp: txp@7e004000 {
 			compatible = "brcm,bcm2835-txp";
 			reg = <0x7e004000 0x20>;
 			interrupts = <1 11>;
--
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V3 8/8] MAINTAINERS: Add BCM2711 to BCM2835 ARCH
  2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
                   ` (6 preceding siblings ...)
  2019-09-28 12:07 ` [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support Stefan Wahren
@ 2019-09-28 12:07 ` Stefan Wahren
  2019-09-28 20:01 ` [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Florian Fainelli
  2019-10-03 17:09 ` Nicolas Saenz Julienne
  9 siblings, 0 replies; 25+ messages in thread
From: Stefan Wahren @ 2019-09-28 12:07 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Eric Anholt, Florian Fainelli,
	Ray Jui, Scott Branden
  Cc: devicetree, Catalin Marinas, bcm-kernel-feedback-list,
	Stefan Wahren, Will Deacon, linux-arm-kernel

Clarify that BCM2711 belongs to the BCM2835 ARCH.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Eric Anholt <eric@anholt.net>
---
 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 857611c..49420e0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3186,7 +3186,7 @@ N:	bcm216*
 N:	kona
 F:	arch/arm/mach-bcm/

-BROADCOM BCM2835 ARM ARCHITECTURE
+BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE
 M:	Eric Anholt <eric@anholt.net>
 M:	Stefan Wahren <wahrenst@gmx.net>
 L:	bcm-kernel-feedback-list@broadcom.com
@@ -3194,6 +3194,7 @@ L:	linux-rpi-kernel@lists.infradead.org (moderated for non-subscribers)
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 T:	git git://github.com/anholt/linux
 S:	Maintained
+N:	bcm2711
 N:	bcm2835
 F:	drivers/staging/vc04_services

--
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 6/8] ARM: bcm: Add support for BCM2711 SoC
  2019-09-28 12:07 ` [PATCH V3 6/8] ARM: bcm: Add support for BCM2711 SoC Stefan Wahren
@ 2019-09-28 19:16   ` Florian Fainelli
  2019-09-28 23:09     ` Stefan Wahren
  0 siblings, 1 reply; 25+ messages in thread
From: Florian Fainelli @ 2019-09-28 19:16 UTC (permalink / raw)
  To: Stefan Wahren, Rob Herring, Mark Rutland, Eric Anholt,
	Florian Fainelli, Ray Jui, Scott Branden
  Cc: Catalin Marinas, devicetree, Will Deacon, linux-arm-kernel,
	bcm-kernel-feedback-list



On 9/28/2019 5:07 AM, Stefan Wahren wrote:
> Add the BCM2711 to ARCH_BCM2835, but use new machine board code
> because of the differences.
> 
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> Reviewed-by: Eric Anholt <eric@anholt.net>
> ---
>  arch/arm/mach-bcm/Kconfig    |  3 ++-
>  arch/arm/mach-bcm/Makefile   |  3 ++-
>  arch/arm/mach-bcm/bcm2711.c  | 24 ++++++++++++++++++++++++
>  arch/arm64/Kconfig.platforms |  5 +++--
>  4 files changed, 31 insertions(+), 4 deletions(-)
>  create mode 100644 arch/arm/mach-bcm/bcm2711.c
> 
> diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
> index 5e5f1fa..39bcbea 100644
> --- a/arch/arm/mach-bcm/Kconfig
> +++ b/arch/arm/mach-bcm/Kconfig
> @@ -161,6 +161,7 @@ config ARCH_BCM2835
>  	select GPIOLIB
>  	select ARM_AMBA
>  	select ARM_ERRATA_411920 if ARCH_MULTI_V6
> +	select ARM_GIC if ARCH_MULTI_V7
>  	select ARM_TIMER_SP804
>  	select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
>  	select TIMER_OF

Are not we missing a select ZONE_DMA here?

> @@ -169,7 +170,7 @@ config ARCH_BCM2835
>  	select PINCTRL_BCM2835
>  	select MFD_CORE
>  	help
> -	  This enables support for the Broadcom BCM2835 and BCM2836 SoCs.
> +	  This enables support for the Broadcom BCM2711 and BCM283x SoCs.
>  	  This SoC is used in the Raspberry Pi and Roku 2 devices.
> 
>  config ARCH_BCM_53573
> diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
> index b59c813..7baa8c9 100644
> --- a/arch/arm/mach-bcm/Makefile
> +++ b/arch/arm/mach-bcm/Makefile
> @@ -42,8 +42,9 @@ obj-$(CONFIG_ARCH_BCM_MOBILE_L2_CACHE) += kona_l2_cache.o
>  obj-$(CONFIG_ARCH_BCM_MOBILE_SMC) += bcm_kona_smc.o
> 
>  # BCM2835
> -obj-$(CONFIG_ARCH_BCM2835)	+= board_bcm2835.o
>  ifeq ($(CONFIG_ARCH_BCM2835),y)
> +obj-y				+= board_bcm2835.o
> +obj-y				+= bcm2711.o
>  ifeq ($(CONFIG_ARM),y)
>  obj-$(CONFIG_SMP)		+= platsmp.o
>  endif
> diff --git a/arch/arm/mach-bcm/bcm2711.c b/arch/arm/mach-bcm/bcm2711.c
> new file mode 100644
> index 0000000..dbe2967
> --- /dev/null
> +++ b/arch/arm/mach-bcm/bcm2711.c
> @@ -0,0 +1,24 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (C) 2019 Stefan Wahren
> + */
> +
> +#include <linux/of_address.h>
> +
> +#include <asm/mach/arch.h>
> +
> +#include "platsmp.h"
> +
> +static const char * const bcm2711_compat[] = {
> +#ifdef CONFIG_ARCH_MULTI_V7
> +	"brcm,bcm2711",
> +#endif
> +};
> +
> +DT_MACHINE_START(BCM2711, "BCM2711")
> +#ifdef CONFIG_ZONE_DMA
> +	.dma_zone_size	= SZ_1G,
> +#endif
> +	.dt_compat = bcm2711_compat,
> +	.smp = smp_ops(bcm2836_smp_ops),
> +MACHINE_END
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 16d7614..b5d31dc 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -37,11 +37,12 @@ config ARCH_BCM2835
>  	select PINCTRL
>  	select PINCTRL_BCM2835
>  	select ARM_AMBA
> +	select ARM_GIC
>  	select ARM_TIMER_SP804
>  	select HAVE_ARM_ARCH_TIMER
>  	help
> -	  This enables support for the Broadcom BCM2837 SoC.
> -	  This SoC is used in the Raspberry Pi 3 device.
> +	  This enables support for the Broadcom BCM2837 and BCM2711 SoC.
> +	  This SoC is used in the Raspberry Pi 3 and 4 device.

Nit:

These SoCs are used in the Raspberry Pi 3 and 4 devices.

With that:

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support
  2019-09-28 12:07 ` [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support Stefan Wahren
@ 2019-09-28 19:58   ` Florian Fainelli
  2019-10-02 16:24     ` Stefan Wahren
  2019-09-29 11:25   ` Marc Zyngier
  1 sibling, 1 reply; 25+ messages in thread
From: Florian Fainelli @ 2019-09-28 19:58 UTC (permalink / raw)
  To: Stefan Wahren, Rob Herring, Mark Rutland, Eric Anholt,
	Florian Fainelli, Ray Jui, Scott Branden
  Cc: Catalin Marinas, devicetree, Will Deacon, linux-arm-kernel,
	bcm-kernel-feedback-list



On 9/28/2019 5:07 AM, Stefan Wahren wrote:
> This adds minimal support for the new Raspberry Pi 4 without the
> fancy stuff like GENET, PCIe, xHCI, 40 bit DMA and V3D. The RPi 4 is
> available in 3 different variants (1, 2 and 4 GB RAM), so leave the memory
> size to zero and let the bootloader take care of it. The DWC2 is still
> usable as peripheral via the USB-C port.

That comment is useful, and probably belongs where the memory node is
declared, see below.

> 
> Other differences to the Raspberry Pi 3:
> - additional GIC 400 Interrupt controller
> - new thermal IP and HWRNG
> - additional MMC interface (emmc2)
> - additional UART, I2C, SPI and PWM interfaces
> - clock stretching bug in I2C IP has been fixed
> 
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> Acked-by: Eric Anholt <eric@anholt.net>
> ---

[snip]

> +/ {
> +	compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
> +	model = "Raspberry Pi 4 Model B";
> +
> +	chosen {
> +		/* 8250 auxiliary UART instead of pl011 */
> +		stdout-path = "serial1:115200n8";
> +	};
> +

Might be worth a comment that the reg property of the memory node is
filed by the boot loader based on the populated amount of DRAM. You can
also go with a shorter format for the size (0)?

> +	memory@0 {
> +		device_type = "memory";
> +		reg = <0 0 0x00000000>;
> +	};
> +

[snip]

> +#include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/soc/bcm2835-pm.h>
> +
> +/ {
> +	compatible = "brcm,bcm2711";
> +
> +	#address-cells = <2>;
> +	#size-cells = <1>;

Trying to see if we may need a #size-cells property value of 2 here, for
the 4GB model, I would assume that we would have to, unless we are fine
with supporting 4GB - 1byte of DRAM?

> +
> +	interrupt-parent = <&gicv2>;
> +
> +	soc {
> +		ranges = <0x7e000000  0x0 0xfe000000  0x01800000>,
> +			 <0x7c000000  0x0 0xfc000000  0x02000000>,
> +			 <0x40000000  0x0 0xff800000  0x00800000>;

Might be nice to get some comments about

> +		/* Emulate a contiguous 30-bit address range for DMA */
> +		dma-ranges = <0xc0000000  0x0 0x00000000  0x3c000000>;
> +
> +		local_intc: local_intc@40000000 {
> +			compatible = "brcm,bcm2836-l1-intc";
> +			reg = <0x40000000 0x100>;
> +		};

This deserves a comment to indicate that this node is the provider for
the enable-method for bringing up secondary cores. And no PSCI, still,
what year is this?

[snip]

> +		rng@7e104000 {
> +			interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;
> +
> +			/* RNG is incompatible to brcm,bcm2835-rng */

Nit: s/to/with/

[snip]

> +		spi@7e204000 {
> +			reg = <0x7e204000 0x0200>;
> +			interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
> +		};

Why is this SPI node incomplete, are you just overriding a previously
defined node here?

[snip]

> +
> +	timer {
> +		compatible = "arm,armv8-timer";
> +		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) |
> +					  IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) |
> +					  IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) |
> +					  IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) |
> +					  IRQ_TYPE_LEVEL_LOW)>;
> +		/* This only applies to the ARMv7 stub */
> +		arm,cpu-registers-not-fw-configured;
> +
> +		/* The ARM cores doesn't enter deep enough states */

Nit: s/doesn't/do not/
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support
  2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
                   ` (7 preceding siblings ...)
  2019-09-28 12:07 ` [PATCH V3 8/8] MAINTAINERS: Add BCM2711 to BCM2835 ARCH Stefan Wahren
@ 2019-09-28 20:01 ` Florian Fainelli
  2019-10-03 17:09 ` Nicolas Saenz Julienne
  9 siblings, 0 replies; 25+ messages in thread
From: Florian Fainelli @ 2019-09-28 20:01 UTC (permalink / raw)
  To: Stefan Wahren, Rob Herring, Mark Rutland, Eric Anholt,
	Florian Fainelli, Ray Jui, Scott Branden
  Cc: Catalin Marinas, devicetree, Will Deacon, linux-arm-kernel,
	bcm-kernel-feedback-list



On 9/28/2019 5:07 AM, Stefan Wahren wrote:
> This series adds minimal support for the new Raspberry Pi 4, so we are able
> to login via debug UART.
> 
> Patch 1-2:   Fix some DT schema warnings
> Patch 3-4:   Prepare DTS for the new SoC BMC2711
> Patch 5-7:   Add Raspberry Pi 4 DTS support
> Patch 8:     Update MAINTAINERS
> 
> Unfortunately the Raspberry Pi Foundation didn't released a
> peripheral documentation for the new SoC yet. So we only have a preliminary
> datasheet [1] and reduced schematics [2].

Overall this looks good to me, just a few comments in specific patches,
if you can re-spin those patches we should try to get that in 5.5?

> 
> Known issues:
> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
> i reverted the following patch to test this series:
> 
> 79a98672 "dma-mapping: remove dma_max_pfn"
> 7559d612 "mmc: core: let the dma map ops handle bouncing"
> 
> Changes in V3:
> - rebased series
> - add Reviewed-by
> - enable ARM_GIC for ARCH_BCM2835 on arm64 too
> - configure i2c pull-up in bcm2711.dtsi
> - move i2c2 to bcm2835-common.dtsi
> - add missing compatibles to DT schema as suggested by Rob
> - fix DT schema warnings in dtsi files
> - replace brcm pintrl with generic pinctrl as suggested by Linus
> - make dma_zone_size depend on CONFIG_ZONE_DMA as suggested by Matthias
> 
> Changes in V2:
> - use separate board file for BCM2711
> - enable ARM_GIC for ARCH_BCM2835
> - add Acked-by and Reviewed-by
> - fix arm-pmu and timer nodes for BCM2711 reported by Marc Zyngier
> - enable HDMI at board level
> - move HDMI and pixelvalve into bcm2835-common.dtsi as suggested by Eric Anholt
> - fix DWC2 probing warning by setting USB role to peripheral
> - fix order of node references in bcm2711.dtsi
> - disable I2C clock stretching quirk for BCM2711
> - mark PLLD_PER as critical clock
> - make PLLH clock unavailable on BCM2711
> - fix compile warning in clk-bcm2835 for arm64
> 
> Changes since RFC:
> - change BCM2838 -> BCM2711 as discussed in RFC
> - update MAINTAINERS accordingly
> - drop "spi: bcm2835: enable shared interrupt support" from series
> - squash all pinctrl-bcm2835 changes into one patch
> - introduce SoC specific clock registration as suggested by Florian
> - fix watchdog probing for Raspberry Pi 4
> - convert brcm,bcm2835.txt to json-schema
> - move VC4 node to bcm2835-common.dtsi
> - fallback to legacy pull config for Raspberry Pi 4
> - revert unintended change of mailbox in bcm283x.dtsi
> - add reference for arm64
> 
> [1] - https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/rpi_DATA_2711_1p0_preliminary.pdf
> [2] - https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_4b_4p0_reduced.pdf
> 
> Stefan Wahren (8):
>   ARM: dts: bcm283x: Remove simple-bus from fixed clocks
>   ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
>   ARM: dts: bcm283x: Move BCM2835/6/7 specific to bcm2835-common.dtsi
>   dt-bindings: arm: Convert BCM2835 board/soc bindings to json-schema
>   dt-bindings: arm: bcm2835: Add Raspberry Pi 4 to DT schema
>   ARM: bcm: Add support for BCM2711 SoC
>   ARM: dts: Add minimal Raspberry Pi 4 support
>   MAINTAINERS: Add BCM2711 to BCM2835 ARCH
> 
>  .../devicetree/bindings/arm/bcm/bcm2835.yaml       |  54 ++
>  .../devicetree/bindings/arm/bcm/brcm,bcm2835.txt   |  67 --
>  MAINTAINERS                                        |   3 +-
>  arch/arm/boot/dts/Makefile                         |   1 +
>  arch/arm/boot/dts/bcm2711-rpi-4-b.dts              | 121 +++
>  arch/arm/boot/dts/bcm2711.dtsi                     | 838 +++++++++++++++++++++
>  arch/arm/boot/dts/bcm2835-common.dtsi              | 194 +++++
>  arch/arm/boot/dts/bcm2835-rpi.dtsi                 |   4 -
>  arch/arm/boot/dts/bcm2835.dtsi                     |   1 +
>  arch/arm/boot/dts/bcm2836.dtsi                     |   1 +
>  arch/arm/boot/dts/bcm2837.dtsi                     |   1 +
>  arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi  |   7 +
>  arch/arm/boot/dts/bcm283x.dtsi                     | 190 +----
>  arch/arm/mach-bcm/Kconfig                          |   3 +-
>  arch/arm/mach-bcm/Makefile                         |   3 +-
>  arch/arm/mach-bcm/bcm2711.c                        |  24 +
>  arch/arm64/Kconfig.platforms                       |   5 +-
>  17 files changed, 1257 insertions(+), 260 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
>  delete mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
>  create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b.dts
>  create mode 100644 arch/arm/boot/dts/bcm2711.dtsi
>  create mode 100644 arch/arm/boot/dts/bcm2835-common.dtsi
>  create mode 100644 arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi
>  create mode 100644 arch/arm/mach-bcm/bcm2711.c
> 
> --
> 2.7.4
> 

-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 6/8] ARM: bcm: Add support for BCM2711 SoC
  2019-09-28 19:16   ` Florian Fainelli
@ 2019-09-28 23:09     ` Stefan Wahren
  2019-09-30  8:21       ` Nicolas Saenz Julienne
  0 siblings, 1 reply; 25+ messages in thread
From: Stefan Wahren @ 2019-09-28 23:09 UTC (permalink / raw)
  To: Florian Fainelli, Rob Herring, Mark Rutland, Eric Anholt,
	Ray Jui, Scott Branden
  Cc: devicetree, Catalin Marinas, bcm-kernel-feedback-list,
	linux-arm-kernel, Will Deacon, Nicolas Saenz Julienne

Am 28.09.19 um 21:16 schrieb Florian Fainelli:
>
> On 9/28/2019 5:07 AM, Stefan Wahren wrote:
>> Add the BCM2711 to ARCH_BCM2835, but use new machine board code
>> because of the differences.
>>
>> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
>> Reviewed-by: Eric Anholt <eric@anholt.net>
>> ---
>>  arch/arm/mach-bcm/Kconfig    |  3 ++-
>>  arch/arm/mach-bcm/Makefile   |  3 ++-
>>  arch/arm/mach-bcm/bcm2711.c  | 24 ++++++++++++++++++++++++
>>  arch/arm64/Kconfig.platforms |  5 +++--
>>  4 files changed, 31 insertions(+), 4 deletions(-)
>>  create mode 100644 arch/arm/mach-bcm/bcm2711.c
>>
>> diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
>> index 5e5f1fa..39bcbea 100644
>> --- a/arch/arm/mach-bcm/Kconfig
>> +++ b/arch/arm/mach-bcm/Kconfig
>> @@ -161,6 +161,7 @@ config ARCH_BCM2835
>>  	select GPIOLIB
>>  	select ARM_AMBA
>>  	select ARM_ERRATA_411920 if ARCH_MULTI_V6
>> +	select ARM_GIC if ARCH_MULTI_V7
>>  	select ARM_TIMER_SP804
>>  	select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
>>  	select TIMER_OF
> Are not we missing a select ZONE_DMA here?
Yes. I think for arm and arm64.
>
>> @@ -169,7 +170,7 @@ config ARCH_BCM2835
>>  	select PINCTRL_BCM2835
>>  	select MFD_CORE
>>  	help
>> -	  This enables support for the Broadcom BCM2835 and BCM2836 SoCs.
>> +	  This enables support for the Broadcom BCM2711 and BCM283x SoCs.
>>  	  This SoC is used in the Raspberry Pi and Roku 2 devices.
>>
>>  config ARCH_BCM_53573
>> diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
>> index b59c813..7baa8c9 100644
>> --- a/arch/arm/mach-bcm/Makefile
>> +++ b/arch/arm/mach-bcm/Makefile
>> @@ -42,8 +42,9 @@ obj-$(CONFIG_ARCH_BCM_MOBILE_L2_CACHE) += kona_l2_cache.o
>>  obj-$(CONFIG_ARCH_BCM_MOBILE_SMC) += bcm_kona_smc.o
>>
>>  # BCM2835
>> -obj-$(CONFIG_ARCH_BCM2835)	+= board_bcm2835.o
>>  ifeq ($(CONFIG_ARCH_BCM2835),y)
>> +obj-y				+= board_bcm2835.o
>> +obj-y				+= bcm2711.o
>>  ifeq ($(CONFIG_ARM),y)
>>  obj-$(CONFIG_SMP)		+= platsmp.o
>>  endif
>> diff --git a/arch/arm/mach-bcm/bcm2711.c b/arch/arm/mach-bcm/bcm2711.c
>> new file mode 100644
>> index 0000000..dbe2967
>> --- /dev/null
>> +++ b/arch/arm/mach-bcm/bcm2711.c
>> @@ -0,0 +1,24 @@
>> +// SPDX-License-Identifier: GPL-2.0+
>> +/*
>> + * Copyright (C) 2019 Stefan Wahren
>> + */
>> +
>> +#include <linux/of_address.h>
>> +
>> +#include <asm/mach/arch.h>
>> +
>> +#include "platsmp.h"
>> +
>> +static const char * const bcm2711_compat[] = {
>> +#ifdef CONFIG_ARCH_MULTI_V7
>> +	"brcm,bcm2711",
>> +#endif
>> +};
>> +
>> +DT_MACHINE_START(BCM2711, "BCM2711")
>> +#ifdef CONFIG_ZONE_DMA
>> +	.dma_zone_size	= SZ_1G,
>> +#endif
>> +	.dt_compat = bcm2711_compat,
>> +	.smp = smp_ops(bcm2836_smp_ops),
>> +MACHINE_END
>> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
>> index 16d7614..b5d31dc 100644
>> --- a/arch/arm64/Kconfig.platforms
>> +++ b/arch/arm64/Kconfig.platforms
>> @@ -37,11 +37,12 @@ config ARCH_BCM2835
>>  	select PINCTRL
>>  	select PINCTRL_BCM2835
>>  	select ARM_AMBA
>> +	select ARM_GIC
>>  	select ARM_TIMER_SP804
>>  	select HAVE_ARM_ARCH_TIMER
>>  	help
>> -	  This enables support for the Broadcom BCM2837 SoC.
>> -	  This SoC is used in the Raspberry Pi 3 device.
>> +	  This enables support for the Broadcom BCM2837 and BCM2711 SoC.
>> +	  This SoC is used in the Raspberry Pi 3 and 4 device.
> Nit:
>
> These SoCs are used in the Raspberry Pi 3 and 4 devices.
>
> With that:
>
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support
  2019-09-28 12:07 ` [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support Stefan Wahren
  2019-09-28 19:58   ` Florian Fainelli
@ 2019-09-29 11:25   ` Marc Zyngier
  1 sibling, 0 replies; 25+ messages in thread
From: Marc Zyngier @ 2019-09-29 11:25 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Mark Rutland, devicetree, Florian Fainelli, Scott Branden,
	Ray Jui, Eric Anholt, Rob Herring, bcm-kernel-feedback-list,
	Catalin Marinas, Will Deacon, linux-arm-kernel

On 2019-09-28 13:07, Stefan Wahren wrote:
> This adds minimal support for the new Raspberry Pi 4 without the
> fancy stuff like GENET, PCIe, xHCI, 40 bit DMA and V3D. The RPi 4 is
> available in 3 different variants (1, 2 and 4 GB RAM), so leave the 
> memory
> size to zero and let the bootloader take care of it. The DWC2 is 
> still
> usable as peripheral via the USB-C port.
>
> Other differences to the Raspberry Pi 3:
> - additional GIC 400 Interrupt controller
> - new thermal IP and HWRNG
> - additional MMC interface (emmc2)
> - additional UART, I2C, SPI and PWM interfaces
> - clock stretching bug in I2C IP has been fixed
>
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> Acked-by: Eric Anholt <eric@anholt.net>

[...]

> +	timer {
> +		compatible = "arm,armv8-timer";
> +		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) |
> +					  IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(4) |
> +					  IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) |
> +					  IRQ_TYPE_LEVEL_LOW)>,
> +			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) |
> +					  IRQ_TYPE_LEVEL_LOW)>;
> +		/* This only applies to the ARMv7 stub */
> +		arm,cpu-registers-not-fw-configured;
> +
> +		/* The ARM cores doesn't enter deep enough states */
> +		always-on;

I already commented on this. The A72 not entering a deep enough sleep 
state to
lose its comparator seems dubious at best. The right way to do this is 
to have
a global timer, which you said the platform has.

Please drop this.

         M.
-- 
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 6/8] ARM: bcm: Add support for BCM2711 SoC
  2019-09-28 23:09     ` Stefan Wahren
@ 2019-09-30  8:21       ` Nicolas Saenz Julienne
  0 siblings, 0 replies; 25+ messages in thread
From: Nicolas Saenz Julienne @ 2019-09-30  8:21 UTC (permalink / raw)
  To: Stefan Wahren, Florian Fainelli, Rob Herring, Mark Rutland,
	Eric Anholt, Ray Jui, Scott Branden
  Cc: Catalin Marinas, devicetree, Will Deacon, linux-arm-kernel,
	bcm-kernel-feedback-list


[-- Attachment #1.1: Type: text/plain, Size: 4025 bytes --]

On Sun, 2019-09-29 at 01:09 +0200, Stefan Wahren wrote:
> Am 28.09.19 um 21:16 schrieb Florian Fainelli:
> > On 9/28/2019 5:07 AM, Stefan Wahren wrote:
> > > Add the BCM2711 to ARCH_BCM2835, but use new machine board code
> > > because of the differences.
> > > 
> > > Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> > > Reviewed-by: Eric Anholt <eric@anholt.net>
> > > ---
> > >  arch/arm/mach-bcm/Kconfig    |  3 ++-
> > >  arch/arm/mach-bcm/Makefile   |  3 ++-
> > >  arch/arm/mach-bcm/bcm2711.c  | 24 ++++++++++++++++++++++++
> > >  arch/arm64/Kconfig.platforms |  5 +++--
> > >  4 files changed, 31 insertions(+), 4 deletions(-)
> > >  create mode 100644 arch/arm/mach-bcm/bcm2711.c
> > > 
> > > diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
> > > index 5e5f1fa..39bcbea 100644
> > > --- a/arch/arm/mach-bcm/Kconfig
> > > +++ b/arch/arm/mach-bcm/Kconfig
> > > @@ -161,6 +161,7 @@ config ARCH_BCM2835
> > >  	select GPIOLIB
> > >  	select ARM_AMBA
> > >  	select ARM_ERRATA_411920 if ARCH_MULTI_V6
> > > +	select ARM_GIC if ARCH_MULTI_V7
> > >  	select ARM_TIMER_SP804
> > >  	select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
> > >  	select TIMER_OF
> > Are not we missing a select ZONE_DMA here?
> Yes. I think for arm and arm64.

No need in arm64, see arch/arm64/Kconfig:270.

> > > @@ -169,7 +170,7 @@ config ARCH_BCM2835
> > >  	select PINCTRL_BCM2835
> > >  	select MFD_CORE
> > >  	help
> > > -	  This enables support for the Broadcom BCM2835 and BCM2836 SoCs.
> > > +	  This enables support for the Broadcom BCM2711 and BCM283x SoCs.
> > >  	  This SoC is used in the Raspberry Pi and Roku 2 devices.
> > > 
> > >  config ARCH_BCM_53573
> > > diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
> > > index b59c813..7baa8c9 100644
> > > --- a/arch/arm/mach-bcm/Makefile
> > > +++ b/arch/arm/mach-bcm/Makefile
> > > @@ -42,8 +42,9 @@ obj-$(CONFIG_ARCH_BCM_MOBILE_L2_CACHE) +=
> > > kona_l2_cache.o
> > >  obj-$(CONFIG_ARCH_BCM_MOBILE_SMC) += bcm_kona_smc.o
> > > 
> > >  # BCM2835
> > > -obj-$(CONFIG_ARCH_BCM2835)	+= board_bcm2835.o
> > >  ifeq ($(CONFIG_ARCH_BCM2835),y)
> > > +obj-y				+= board_bcm2835.o
> > > +obj-y				+= bcm2711.o
> > >  ifeq ($(CONFIG_ARM),y)
> > >  obj-$(CONFIG_SMP)		+= platsmp.o
> > >  endif
> > > diff --git a/arch/arm/mach-bcm/bcm2711.c b/arch/arm/mach-bcm/bcm2711.c
> > > new file mode 100644
> > > index 0000000..dbe2967
> > > --- /dev/null
> > > +++ b/arch/arm/mach-bcm/bcm2711.c
> > > @@ -0,0 +1,24 @@
> > > +// SPDX-License-Identifier: GPL-2.0+
> > > +/*
> > > + * Copyright (C) 2019 Stefan Wahren
> > > + */
> > > +
> > > +#include <linux/of_address.h>
> > > +
> > > +#include <asm/mach/arch.h>
> > > +
> > > +#include "platsmp.h"
> > > +
> > > +static const char * const bcm2711_compat[] = {
> > > +#ifdef CONFIG_ARCH_MULTI_V7
> > > +	"brcm,bcm2711",
> > > +#endif
> > > +};
> > > +
> > > +DT_MACHINE_START(BCM2711, "BCM2711")
> > > +#ifdef CONFIG_ZONE_DMA
> > > +	.dma_zone_size	= SZ_1G,
> > > +#endif
> > > +	.dt_compat = bcm2711_compat,
> > > +	.smp = smp_ops(bcm2836_smp_ops),
> > > +MACHINE_END
> > > diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> > > index 16d7614..b5d31dc 100644
> > > --- a/arch/arm64/Kconfig.platforms
> > > +++ b/arch/arm64/Kconfig.platforms
> > > @@ -37,11 +37,12 @@ config ARCH_BCM2835
> > >  	select PINCTRL
> > >  	select PINCTRL_BCM2835
> > >  	select ARM_AMBA
> > > +	select ARM_GIC
> > >  	select ARM_TIMER_SP804
> > >  	select HAVE_ARM_ARCH_TIMER
> > >  	help
> > > -	  This enables support for the Broadcom BCM2837 SoC.
> > > -	  This SoC is used in the Raspberry Pi 3 device.
> > > +	  This enables support for the Broadcom BCM2837 and BCM2711 SoC.
> > > +	  This SoC is used in the Raspberry Pi 3 and 4 device.
> > Nit:
> > 
> > These SoCs are used in the Raspberry Pi 3 and 4 devices.
> > 
> > With that:
> > 
> > Acked-by: Florian Fainelli <f.fainelli@gmail.com>


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 4/8] dt-bindings: arm: Convert BCM2835 board/soc bindings to json-schema
  2019-09-28 12:07 ` [PATCH V3 4/8] dt-bindings: arm: Convert BCM2835 board/soc bindings to json-schema Stefan Wahren
@ 2019-10-01 13:46   ` Rob Herring
  0 siblings, 0 replies; 25+ messages in thread
From: Rob Herring @ 2019-10-01 13:46 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Mark Rutland, devicetree, Florian Fainelli, Scott Branden,
	Catalin Marinas, Eric Anholt, bcm-kernel-feedback-list,
	Stefan Wahren, Ray Jui, Will Deacon, linux-arm-kernel

On Sat, 28 Sep 2019 14:07:10 +0200, Stefan Wahren wrote:
> Convert the BCM2835/6/7 SoC bindings to DT schema format using json-schema.
> All the other Broadcom boards are maintained by Florian Fainelli.
>
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> Acked-by: Eric Anholt <eric@anholt.net>
> ---
>  .../devicetree/bindings/arm/bcm/bcm2835.yaml       | 48 ++++++++++++++++
>  .../devicetree/bindings/arm/bcm/brcm,bcm2835.txt   | 67 ----------------------
>  2 files changed, 48 insertions(+), 67 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
>  delete mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 5/8] dt-bindings: arm: bcm2835: Add Raspberry Pi 4 to DT schema
  2019-09-28 12:07 ` [PATCH V3 5/8] dt-bindings: arm: bcm2835: Add Raspberry Pi 4 to DT schema Stefan Wahren
@ 2019-10-01 13:46   ` Rob Herring
  0 siblings, 0 replies; 25+ messages in thread
From: Rob Herring @ 2019-10-01 13:46 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Mark Rutland, devicetree, Florian Fainelli, Scott Branden,
	Catalin Marinas, Eric Anholt, bcm-kernel-feedback-list,
	Stefan Wahren, Ray Jui, Will Deacon, linux-arm-kernel

On Sat, 28 Sep 2019 14:07:11 +0200, Stefan Wahren wrote:
> Add new Raspberry Pi 4 to DT schema.
>
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> Acked-by: Eric Anholt <eric@anholt.net>
> ---
>  Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support
  2019-09-28 19:58   ` Florian Fainelli
@ 2019-10-02 16:24     ` Stefan Wahren
  2019-10-02 16:43       ` Florian Fainelli
  0 siblings, 1 reply; 25+ messages in thread
From: Stefan Wahren @ 2019-10-02 16:24 UTC (permalink / raw)
  To: Florian Fainelli, Rob Herring, Mark Rutland, Eric Anholt,
	Ray Jui, Scott Branden
  Cc: Catalin Marinas, devicetree, Will Deacon, linux-arm-kernel,
	bcm-kernel-feedback-list

Hi Florian,

Am 28.09.19 um 21:58 schrieb Florian Fainelli:
>
> On 9/28/2019 5:07 AM, Stefan Wahren wrote:
>
>> +	memory@0 {
>> +		device_type = "memory";
>> +		reg = <0 0 0x00000000>;
>> +	};
>> +
> [snip]
>
>> +#include <dt-bindings/interrupt-controller/arm-gic.h>
>> +#include <dt-bindings/soc/bcm2835-pm.h>
>> +
>> +/ {
>> +	compatible = "brcm,bcm2711";
>> +
>> +	#address-cells = <2>;
>> +	#size-cells = <1>;
> Trying to see if we may need a #size-cells property value of 2 here, for
> the 4GB model, I would assume that we would have to, unless we are fine
> with supporting 4GB - 1byte of DRAM?
I will try unless this requires a lot of adjustments or break the
bootloader.
>
>> +
>> +	interrupt-parent = <&gicv2>;
>> +
>> +	soc {
>> +		ranges = <0x7e000000  0x0 0xfe000000  0x01800000>,
>> +			 <0x7c000000  0x0 0xfc000000  0x02000000>,
>> +			 <0x40000000  0x0 0xff800000  0x00800000>;
> Might be nice to get some comments about
ranges = <0x7e000000  0x0 0xfe000000  0x01800000>,  // Common BCM283x
peripherals
     <0x7c000000  0x0 0xfc000000  0x02000000>,  // BCM2711-specific
peripherals

     <0x40000000  0x0 0xff800000  0x00800000>;  // ARM-local peripherals

I will simply forward the answer from the RPi guys.

Is it what you had in mind? Otherwise please be more specific.

Regards
Stefan


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support
  2019-10-02 16:24     ` Stefan Wahren
@ 2019-10-02 16:43       ` Florian Fainelli
  2019-10-06 13:28         ` Stefan Wahren
  0 siblings, 1 reply; 25+ messages in thread
From: Florian Fainelli @ 2019-10-02 16:43 UTC (permalink / raw)
  To: Stefan Wahren, Florian Fainelli, Rob Herring, Mark Rutland,
	Eric Anholt, Ray Jui, Scott Branden
  Cc: Catalin Marinas, devicetree, Will Deacon, linux-arm-kernel,
	bcm-kernel-feedback-list

On 10/2/19 9:24 AM, Stefan Wahren wrote:
> Hi Florian,
> 
> Am 28.09.19 um 21:58 schrieb Florian Fainelli:
>>
>> On 9/28/2019 5:07 AM, Stefan Wahren wrote:
>>
>>> +	memory@0 {
>>> +		device_type = "memory";
>>> +		reg = <0 0 0x00000000>;
>>> +	};
>>> +
>> [snip]
>>
>>> +#include <dt-bindings/interrupt-controller/arm-gic.h>
>>> +#include <dt-bindings/soc/bcm2835-pm.h>
>>> +
>>> +/ {
>>> +	compatible = "brcm,bcm2711";
>>> +
>>> +	#address-cells = <2>;
>>> +	#size-cells = <1>;
>> Trying to see if we may need a #size-cells property value of 2 here, for
>> the 4GB model, I would assume that we would have to, unless we are fine
>> with supporting 4GB - 1byte of DRAM?
> I will try unless this requires a lot of adjustments or break the
> bootloader.

OK.

>>
>>> +
>>> +	interrupt-parent = <&gicv2>;
>>> +
>>> +	soc {
>>> +		ranges = <0x7e000000  0x0 0xfe000000  0x01800000>,
>>> +			 <0x7c000000  0x0 0xfc000000  0x02000000>,
>>> +			 <0x40000000  0x0 0xff800000  0x00800000>;
>> Might be nice to get some comments about
> ranges = <0x7e000000  0x0 0xfe000000  0x01800000>,  // Common BCM283x
> peripherals
>      <0x7c000000  0x0 0xfc000000  0x02000000>,  // BCM2711-specific
> peripherals
> 
>      <0x40000000  0x0 0xff800000  0x00800000>;  // ARM-local peripherals
> 
> I will simply forward the answer from the RPi guys.
> 
> Is it what you had in mind? Otherwise please be more specific.

Yes, that is what I wanted to see being added, thanks.
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support
  2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
                   ` (8 preceding siblings ...)
  2019-09-28 20:01 ` [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Florian Fainelli
@ 2019-10-03 17:09 ` Nicolas Saenz Julienne
  2019-10-03 17:24   ` Stefan Wahren
  9 siblings, 1 reply; 25+ messages in thread
From: Nicolas Saenz Julienne @ 2019-10-03 17:09 UTC (permalink / raw)
  To: Stefan Wahren, Rob Herring, Mark Rutland, Eric Anholt,
	Florian Fainelli, Ray Jui, Scott Branden, Matthias Brugger,
	Guillaume Gardet, Adrian Hunter
  Cc: devicetree, bcm-kernel-feedback-list, linux-arm-kernel,
	Will Deacon, Catalin Marinas


[-- Attachment #1.1: Type: text/plain, Size: 2833 bytes --]

On Sat, 2019-09-28 at 14:07 +0200, Stefan Wahren wrote:
> This series adds minimal support for the new Raspberry Pi 4, so we are able
> to login via debug UART.
> 
> Patch 1-2:   Fix some DT schema warnings
> Patch 3-4:   Prepare DTS for the new SoC BMC2711
> Patch 5-7:   Add Raspberry Pi 4 DTS support
> Patch 8:     Update MAINTAINERS
> 
> Unfortunately the Raspberry Pi Foundation didn't released a
> peripheral documentation for the new SoC yet. So we only have a preliminary
> datasheet [1] and reduced schematics [2].
> 
> Known issues:
> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
> i reverted the following patch to test this series:
> 
> 79a98672 "dma-mapping: remove dma_max_pfn"
> 7559d612 "mmc: core: let the dma map ops handle bouncing"

[ adding Matthias and Guillaume who first saw this ]
[ also adding Adrian Hunter just in case ]

Hi,
we stubled upon a bug in RPi's sdhci-iproc while testing this series.

It only shows-up on slow SD cards, the class 4 ones. On each SD operation we
get the following warning:

[    2.093328] mmc1: Got data interrupt 0x00000002 even though no data operation was in progress.
[    2.102072] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
[    2.108603] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
[    2.115134] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000000
[    2.121664] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000033
[    2.128195] mmc1: sdhci: Present:   0x1fff0000 | Host ctl: 0x00000017
[    2.134725] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
[    2.141255] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00000107
[    2.147785] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[    2.154314] mmc1: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
[    2.160843] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[    2.167373] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
[    2.173902] mmc1: sdhci: Cmd:       0x00000c1a | Max curr: 0x00080008
[    2.180432] mmc1: sdhci: Resp[0]:   0x00000b00 | Resp[1]:  0x00edc87f
[    2.186961] mmc1: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x00400e00
[    2.193490] mmc1: sdhci: Host ctl2: 0x00000001
[    2.197992] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xec040208
[    2.204521] mmc1: sdhci: ============================================

Aside from the serial console noise the RPi still boots alright. But as it's
printing one of these per SD operation which is a lot...

I've been able to reproduce this both with arm and arn64 on multiple SD cards.
Just copying the contents of a class 4 card into a class 10 one fixes the
issue.

Any ideas?

Regards,
Nicolas


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support
  2019-10-03 17:09 ` Nicolas Saenz Julienne
@ 2019-10-03 17:24   ` Stefan Wahren
  2019-10-03 22:42     ` Matthias Brugger
  0 siblings, 1 reply; 25+ messages in thread
From: Stefan Wahren @ 2019-10-03 17:24 UTC (permalink / raw)
  To: Nicolas Saenz Julienne, Rob Herring, Mark Rutland, Eric Anholt,
	Florian Fainelli, Ray Jui, Scott Branden, Matthias Brugger,
	Guillaume Gardet, Adrian Hunter
  Cc: devicetree, bcm-kernel-feedback-list, linux-arm-kernel,
	Will Deacon, Catalin Marinas

Hi Nicolas,

Am 03.10.19 um 19:09 schrieb Nicolas Saenz Julienne:
> On Sat, 2019-09-28 at 14:07 +0200, Stefan Wahren wrote:
>> This series adds minimal support for the new Raspberry Pi 4, so we are able
>> to login via debug UART.
>>
>> Patch 1-2:   Fix some DT schema warnings
>> Patch 3-4:   Prepare DTS for the new SoC BMC2711
>> Patch 5-7:   Add Raspberry Pi 4 DTS support
>> Patch 8:     Update MAINTAINERS
>>
>> Unfortunately the Raspberry Pi Foundation didn't released a
>> peripheral documentation for the new SoC yet. So we only have a preliminary
>> datasheet [1] and reduced schematics [2].
>>
>> Known issues:
>> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
>> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
>> i reverted the following patch to test this series:
>>
>> 79a98672 "dma-mapping: remove dma_max_pfn"
>> 7559d612 "mmc: core: let the dma map ops handle bouncing"
> [ adding Matthias and Guillaume who first saw this ]
> [ also adding Adrian Hunter just in case ]
>
> Hi,
> we stubled upon a bug in RPi's sdhci-iproc while testing this series.
>
> It only shows-up on slow SD cards, the class 4 ones. On each SD operation we
> get the following warning:
>
> [    2.093328] mmc1: Got data interrupt 0x00000002 even though no data operation was in progress.
> [    2.102072] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
> [    2.108603] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
> [    2.115134] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000000
> [    2.121664] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000033
> [    2.128195] mmc1: sdhci: Present:   0x1fff0000 | Host ctl: 0x00000017
> [    2.134725] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
> [    2.141255] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00000107
> [    2.147785] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
> [    2.154314] mmc1: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
> [    2.160843] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
> [    2.167373] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
> [    2.173902] mmc1: sdhci: Cmd:       0x00000c1a | Max curr: 0x00080008
> [    2.180432] mmc1: sdhci: Resp[0]:   0x00000b00 | Resp[1]:  0x00edc87f
> [    2.186961] mmc1: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x00400e00
> [    2.193490] mmc1: sdhci: Host ctl2: 0x00000001
> [    2.197992] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xec040208
> [    2.204521] mmc1: sdhci: ============================================
>
> Aside from the serial console noise the RPi still boots alright. But as it's
> printing one of these per SD operation which is a lot...
>
> I've been able to reproduce this both with arm and arn64 on multiple SD cards.
> Just copying the contents of a class 4 card into a class 10 one fixes the
> issue.
>
> Any ideas?
i saw this once during testing. AFAIR there has been some changes to
sdhci in the downstream tree, maybe they was related to this issue.
>
> Regards,
> Nicolas
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support
  2019-10-03 17:24   ` Stefan Wahren
@ 2019-10-03 22:42     ` Matthias Brugger
  2019-10-04  1:03       ` Stefan Wahren
  0 siblings, 1 reply; 25+ messages in thread
From: Matthias Brugger @ 2019-10-03 22:42 UTC (permalink / raw)
  To: Stefan Wahren, Eric Anholt, Guillaume Gardet, Mark Rutland,
	Ray Jui, Scott Branden, Florian Fainelli, Adrian Hunter,
	Rob Herring, Nicolas Saenz Julienne
  Cc: Catalin Marinas, bcm-kernel-feedback-list, linux-arm-kernel,
	Will Deacon, devicetree



On 03/10/2019 19:24, Stefan Wahren wrote:
> Hi Nicolas,
> 
> Am 03.10.19 um 19:09 schrieb Nicolas Saenz Julienne:
>> On Sat, 2019-09-28 at 14:07 +0200, Stefan Wahren wrote:
>>> This series adds minimal support for the new Raspberry Pi 4, so we are able
>>> to login via debug UART.
>>>
>>> Patch 1-2:   Fix some DT schema warnings
>>> Patch 3-4:   Prepare DTS for the new SoC BMC2711
>>> Patch 5-7:   Add Raspberry Pi 4 DTS support
>>> Patch 8:     Update MAINTAINERS
>>>
>>> Unfortunately the Raspberry Pi Foundation didn't released a
>>> peripheral documentation for the new SoC yet. So we only have a preliminary
>>> datasheet [1] and reduced schematics [2].
>>>
>>> Known issues:
>>> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
>>> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
>>> i reverted the following patch to test this series:
>>>
>>> 79a98672 "dma-mapping: remove dma_max_pfn"
>>> 7559d612 "mmc: core: let the dma map ops handle bouncing"
>> [ adding Matthias and Guillaume who first saw this ]
>> [ also adding Adrian Hunter just in case ]
>>
>> Hi,
>> we stubled upon a bug in RPi's sdhci-iproc while testing this series.
>>
>> It only shows-up on slow SD cards, the class 4 ones. On each SD operation we
>> get the following warning:
>>
>> [    2.093328] mmc1: Got data interrupt 0x00000002 even though no data operation was in progress.
>> [    2.102072] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
>> [    2.108603] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
>> [    2.115134] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000000
>> [    2.121664] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000033
>> [    2.128195] mmc1: sdhci: Present:   0x1fff0000 | Host ctl: 0x00000017
>> [    2.134725] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
>> [    2.141255] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00000107
>> [    2.147785] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
>> [    2.154314] mmc1: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
>> [    2.160843] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
>> [    2.167373] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
>> [    2.173902] mmc1: sdhci: Cmd:       0x00000c1a | Max curr: 0x00080008
>> [    2.180432] mmc1: sdhci: Resp[0]:   0x00000b00 | Resp[1]:  0x00edc87f
>> [    2.186961] mmc1: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x00400e00
>> [    2.193490] mmc1: sdhci: Host ctl2: 0x00000001
>> [    2.197992] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xec040208
>> [    2.204521] mmc1: sdhci: ============================================
>>
>> Aside from the serial console noise the RPi still boots alright. But as it's
>> printing one of these per SD operation which is a lot...
>>
>> I've been able to reproduce this both with arm and arn64 on multiple SD cards.
>> Just copying the contents of a class 4 card into a class 10 one fixes the
>> issue.
>>
>> Any ideas?
> i saw this once during testing. AFAIR there has been some changes to
> sdhci in the downstream tree, maybe they was related to this issue.

I did a diff against drivers/mmc/host/sdhci-iproc.c of v5.4-rc1 and haven't
found any significant changes:
- compatible in the upstream driver is only bcm2711-emmc2 and not bcm2838-sdhci,
but DTS uses the former one.
- Upstream driver support probing via ACPI.
- pltfm_host->clk gets only set if we probe via DTS
- get_max_clock() is set to sdhci_iproc_get_max_clock() but this checks if
pltfm_host->clk is set and in that case invokes sdhci_pltfm_clk_get_max_clock()
(same function as the downstream driver).

So AFAIKS nothing relevant here.

Regards,
Matthias

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support
  2019-10-03 22:42     ` Matthias Brugger
@ 2019-10-04  1:03       ` Stefan Wahren
  2019-10-04  5:11         ` Matthias Brugger
  0 siblings, 1 reply; 25+ messages in thread
From: Stefan Wahren @ 2019-10-04  1:03 UTC (permalink / raw)
  To: Matthias Brugger, Eric Anholt, Guillaume Gardet, Mark Rutland,
	Ray Jui, Scott Branden, Florian Fainelli, Adrian Hunter,
	Rob Herring, Nicolas Saenz Julienne
  Cc: Catalin Marinas, Will Deacon, bcm-kernel-feedback-list,
	linux-arm-kernel, devicetree

Hi,

Am 04.10.19 um 00:42 schrieb Matthias Brugger:
>
> On 03/10/2019 19:24, Stefan Wahren wrote:
>> Hi Nicolas,
>>
>> Am 03.10.19 um 19:09 schrieb Nicolas Saenz Julienne:
>>> On Sat, 2019-09-28 at 14:07 +0200, Stefan Wahren wrote:
>>>> This series adds minimal support for the new Raspberry Pi 4, so we are able
>>>> to login via debug UART.
>>>>
>>>> Patch 1-2:   Fix some DT schema warnings
>>>> Patch 3-4:   Prepare DTS for the new SoC BMC2711
>>>> Patch 5-7:   Add Raspberry Pi 4 DTS support
>>>> Patch 8:     Update MAINTAINERS
>>>>
>>>> Unfortunately the Raspberry Pi Foundation didn't released a
>>>> peripheral documentation for the new SoC yet. So we only have a preliminary
>>>> datasheet [1] and reduced schematics [2].
>>>>
>>>> Known issues:
>>>> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
>>>> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
>>>> i reverted the following patch to test this series:
>>>>
>>>> 79a98672 "dma-mapping: remove dma_max_pfn"
>>>> 7559d612 "mmc: core: let the dma map ops handle bouncing"
>>> [ adding Matthias and Guillaume who first saw this ]
>>> [ also adding Adrian Hunter just in case ]
>>>
>>> Hi,
>>> we stubled upon a bug in RPi's sdhci-iproc while testing this series.
>>>
>>> It only shows-up on slow SD cards, the class 4 ones. On each SD operation we
>>> get the following warning:
>>>
>>> [    2.093328] mmc1: Got data interrupt 0x00000002 even though no data operation was in progress.
>>> [    2.102072] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
>>> [    2.108603] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
>>> [    2.115134] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000000
>>> [    2.121664] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000033
>>> [    2.128195] mmc1: sdhci: Present:   0x1fff0000 | Host ctl: 0x00000017
>>> [    2.134725] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
>>> [    2.141255] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00000107
>>> [    2.147785] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
>>> [    2.154314] mmc1: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
>>> [    2.160843] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
>>> [    2.167373] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
>>> [    2.173902] mmc1: sdhci: Cmd:       0x00000c1a | Max curr: 0x00080008
>>> [    2.180432] mmc1: sdhci: Resp[0]:   0x00000b00 | Resp[1]:  0x00edc87f
>>> [    2.186961] mmc1: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x00400e00
>>> [    2.193490] mmc1: sdhci: Host ctl2: 0x00000001
>>> [    2.197992] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xec040208
>>> [    2.204521] mmc1: sdhci: ============================================
>>>
>>> Aside from the serial console noise the RPi still boots alright. But as it's
>>> printing one of these per SD operation which is a lot...
>>>
>>> I've been able to reproduce this both with arm and arn64 on multiple SD cards.
>>> Just copying the contents of a class 4 card into a class 10 one fixes the
>>> issue.
>>>
>>> Any ideas?
>> i saw this once during testing. AFAIR there has been some changes to
>> sdhci in the downstream tree, maybe they was related to this issue.
> I did a diff against drivers/mmc/host/sdhci-iproc.c of v5.4-rc1 and haven't
> found any significant changes:
> - compatible in the upstream driver is only bcm2711-emmc2 and not bcm2838-sdhci,
> but DTS uses the former one.
> - Upstream driver support probing via ACPI.
> - pltfm_host->clk gets only set if we probe via DTS
> - get_max_clock() is set to sdhci_iproc_get_max_clock() but this checks if
> pltfm_host->clk is set and in that case invokes sdhci_pltfm_clk_get_max_clock()
> (same function as the downstream driver).
>
> So AFAIKS nothing relevant here.

as i wrote about sdhci, i literally meant this driver [1]. But this
looks like a workaround only.

[1] -
https://github.com/raspberrypi/linux/commit/88b35d4338e238519bf4e6f73837b4ce44bfe4d6

>
> Regards,
> Matthias
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support
  2019-10-04  1:03       ` Stefan Wahren
@ 2019-10-04  5:11         ` Matthias Brugger
  0 siblings, 0 replies; 25+ messages in thread
From: Matthias Brugger @ 2019-10-04  5:11 UTC (permalink / raw)
  To: Stefan Wahren, Eric Anholt, Guillaume Gardet, Mark Rutland,
	Ray Jui, Scott Branden, Florian Fainelli, Adrian Hunter,
	Rob Herring, Nicolas Saenz Julienne
  Cc: Catalin Marinas, bcm-kernel-feedback-list, linux-arm-kernel,
	Will Deacon, devicetree

Hi Stefan,

On 04/10/2019 03:03, Stefan Wahren wrote:
> Hi,
> 
> Am 04.10.19 um 00:42 schrieb Matthias Brugger:
>>
>> On 03/10/2019 19:24, Stefan Wahren wrote:
>>> Hi Nicolas,
>>>
>>> Am 03.10.19 um 19:09 schrieb Nicolas Saenz Julienne:
>>>> On Sat, 2019-09-28 at 14:07 +0200, Stefan Wahren wrote:
>>>>> This series adds minimal support for the new Raspberry Pi 4, so we are able
>>>>> to login via debug UART.
>>>>>
>>>>> Patch 1-2:   Fix some DT schema warnings
>>>>> Patch 3-4:   Prepare DTS for the new SoC BMC2711
>>>>> Patch 5-7:   Add Raspberry Pi 4 DTS support
>>>>> Patch 8:     Update MAINTAINERS
>>>>>
>>>>> Unfortunately the Raspberry Pi Foundation didn't released a
>>>>> peripheral documentation for the new SoC yet. So we only have a preliminary
>>>>> datasheet [1] and reduced schematics [2].
>>>>>
>>>>> Known issues:
>>>>> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
>>>>> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
>>>>> i reverted the following patch to test this series:
>>>>>
>>>>> 79a98672 "dma-mapping: remove dma_max_pfn"
>>>>> 7559d612 "mmc: core: let the dma map ops handle bouncing"
>>>> [ adding Matthias and Guillaume who first saw this ]
>>>> [ also adding Adrian Hunter just in case ]
>>>>
>>>> Hi,
>>>> we stubled upon a bug in RPi's sdhci-iproc while testing this series.
>>>>
>>>> It only shows-up on slow SD cards, the class 4 ones. On each SD operation we
>>>> get the following warning:
>>>>
>>>> [    2.093328] mmc1: Got data interrupt 0x00000002 even though no data operation was in progress.
>>>> [    2.102072] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
>>>> [    2.108603] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
>>>> [    2.115134] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000000
>>>> [    2.121664] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000033
>>>> [    2.128195] mmc1: sdhci: Present:   0x1fff0000 | Host ctl: 0x00000017
>>>> [    2.134725] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
>>>> [    2.141255] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00000107
>>>> [    2.147785] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
>>>> [    2.154314] mmc1: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
>>>> [    2.160843] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
>>>> [    2.167373] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
>>>> [    2.173902] mmc1: sdhci: Cmd:       0x00000c1a | Max curr: 0x00080008
>>>> [    2.180432] mmc1: sdhci: Resp[0]:   0x00000b00 | Resp[1]:  0x00edc87f
>>>> [    2.186961] mmc1: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x00400e00
>>>> [    2.193490] mmc1: sdhci: Host ctl2: 0x00000001
>>>> [    2.197992] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xec040208
>>>> [    2.204521] mmc1: sdhci: ============================================
>>>>
>>>> Aside from the serial console noise the RPi still boots alright. But as it's
>>>> printing one of these per SD operation which is a lot...
>>>>
>>>> I've been able to reproduce this both with arm and arn64 on multiple SD cards.
>>>> Just copying the contents of a class 4 card into a class 10 one fixes the
>>>> issue.
>>>>
>>>> Any ideas?
>>> i saw this once during testing. AFAIR there has been some changes to
>>> sdhci in the downstream tree, maybe they was related to this issue.
>> I did a diff against drivers/mmc/host/sdhci-iproc.c of v5.4-rc1 and haven't
>> found any significant changes:
>> - compatible in the upstream driver is only bcm2711-emmc2 and not bcm2838-sdhci,
>> but DTS uses the former one.
>> - Upstream driver support probing via ACPI.
>> - pltfm_host->clk gets only set if we probe via DTS
>> - get_max_clock() is set to sdhci_iproc_get_max_clock() but this checks if
>> pltfm_host->clk is set and in that case invokes sdhci_pltfm_clk_get_max_clock()
>> (same function as the downstream driver).
>>
>> So AFAIKS nothing relevant here.
> 
> as i wrote about sdhci, i literally meant this driver [1]. But this
> looks like a workaround only.
> 
> [1] -
> https://github.com/raspberrypi/linux/commit/88b35d4338e238519bf4e6f73837b4ce44bfe4d6
> 

Yes I realized yesterday night already lying in bed, that I only inspected half
of the code. I just found this as well, which seems to fit exactly the behaviour
we are seeing. I'll have a look today.

Regards,
Matthias

>>
>> Regards,
>> Matthias
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support
  2019-10-02 16:43       ` Florian Fainelli
@ 2019-10-06 13:28         ` Stefan Wahren
  0 siblings, 0 replies; 25+ messages in thread
From: Stefan Wahren @ 2019-10-06 13:28 UTC (permalink / raw)
  To: Florian Fainelli, Rob Herring, Mark Rutland, Eric Anholt,
	Ray Jui, Scott Branden
  Cc: Catalin Marinas, devicetree, Will Deacon, linux-arm-kernel,
	bcm-kernel-feedback-list

Am 02.10.19 um 18:43 schrieb Florian Fainelli:
> On 10/2/19 9:24 AM, Stefan Wahren wrote:
>> Hi Florian,
>>
>> Am 28.09.19 um 21:58 schrieb Florian Fainelli:
>>> On 9/28/2019 5:07 AM, Stefan Wahren wrote:
>>>
>>>> +	memory@0 {
>>>> +		device_type = "memory";
>>>> +		reg = <0 0 0x00000000>;
>>>> +	};
>>>> +
>>> [snip]
>>>
>>>> +#include <dt-bindings/interrupt-controller/arm-gic.h>
>>>> +#include <dt-bindings/soc/bcm2835-pm.h>
>>>> +
>>>> +/ {
>>>> +	compatible = "brcm,bcm2711";
>>>> +
>>>> +	#address-cells = <2>;
>>>> +	#size-cells = <1>;
>>> Trying to see if we may need a #size-cells property value of 2 here, for
>>> the 4GB model, I would assume that we would have to, unless we are fine
>>> with supporting 4GB - 1byte of DRAM?
>> I will try unless this requires a lot of adjustments or break the
>> bootloader.
> OK.
Unfortunately this breaks bootloader or firmware. Since the BCM2711 is
able to address 16 GB RAM this should be fixed later. I will open an
issue and submit V4 without this suggested change.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-10-06 13:28 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-28 12:07 [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Stefan Wahren
2019-09-28 12:07 ` [PATCH V3 1/8] ARM: dts: bcm283x: Remove simple-bus from fixed clocks Stefan Wahren
2019-09-28 12:07 ` [PATCH V3 2/8] ARM: dts: bcm283x: Remove brcm, bcm2835-pl011 compatible Stefan Wahren
2019-09-28 12:07 ` [PATCH V3 3/8] ARM: dts: bcm283x: Move BCM2835/6/7 specific to bcm2835-common.dtsi Stefan Wahren
2019-09-28 12:07 ` [PATCH V3 4/8] dt-bindings: arm: Convert BCM2835 board/soc bindings to json-schema Stefan Wahren
2019-10-01 13:46   ` Rob Herring
2019-09-28 12:07 ` [PATCH V3 5/8] dt-bindings: arm: bcm2835: Add Raspberry Pi 4 to DT schema Stefan Wahren
2019-10-01 13:46   ` Rob Herring
2019-09-28 12:07 ` [PATCH V3 6/8] ARM: bcm: Add support for BCM2711 SoC Stefan Wahren
2019-09-28 19:16   ` Florian Fainelli
2019-09-28 23:09     ` Stefan Wahren
2019-09-30  8:21       ` Nicolas Saenz Julienne
2019-09-28 12:07 ` [PATCH V3 7/8] ARM: dts: Add minimal Raspberry Pi 4 support Stefan Wahren
2019-09-28 19:58   ` Florian Fainelli
2019-10-02 16:24     ` Stefan Wahren
2019-10-02 16:43       ` Florian Fainelli
2019-10-06 13:28         ` Stefan Wahren
2019-09-29 11:25   ` Marc Zyngier
2019-09-28 12:07 ` [PATCH V3 8/8] MAINTAINERS: Add BCM2711 to BCM2835 ARCH Stefan Wahren
2019-09-28 20:01 ` [PATCH V3 0/8] ARM: Add minimal Raspberry Pi 4 support Florian Fainelli
2019-10-03 17:09 ` Nicolas Saenz Julienne
2019-10-03 17:24   ` Stefan Wahren
2019-10-03 22:42     ` Matthias Brugger
2019-10-04  1:03       ` Stefan Wahren
2019-10-04  5:11         ` Matthias Brugger

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).