0903551
From 41135d2ce60509e53306e5b76afab98ddc15951b Mon Sep 17 00:00:00 2001
0903551
From: Eric Anholt <eric@anholt.net>
0903551
Date: Mon, 2 Mar 2015 14:36:16 -0800
0903551
Subject: [PATCH 26/36] ARM: bcm2835: Add VC4 to the device tree.
0903551
0903551
VC4 is the GPU (display and 3D) present on the 283x.
0903551
0903551
v2: Sort by register address, mark HDMI as disabled by default in the
0903551
    SoC file and enable it from -rpi.
0903551
v3: Add references to the pixel/HSM clocks for HDMI.  Rename
0903551
    compatibility strings and clean up node names.
0903551
v4: Fix comment marking pv0's interrupt as pwa2 instead of pwa0.
0903551
    Rename hpd-gpio to hpd-gpios.
0903551
v5: Rebase on bcm283x.dtsi change, add v3d.
0903551
v6: Make HDMI reference the power domain.
0903551
v7: Fix the HDMI HPD gpios active value and HDMI enable for each RPI
0903551
    board.  Change V3D compatible string to 2835.
0903551
0903551
Signed-off-by: Eric Anholt <eric@anholt.net>
0903551
---
0903551
 arch/arm/boot/dts/bcm2835-rpi-a-plus.dts |  4 +++
0903551
 arch/arm/boot/dts/bcm2835-rpi-a.dts      |  4 +++
0903551
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts |  4 +++
0903551
 arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts |  4 +++
0903551
 arch/arm/boot/dts/bcm2835-rpi-b.dts      |  4 +++
0903551
 arch/arm/boot/dts/bcm2835-rpi.dtsi       |  9 ++++++
0903551
 arch/arm/boot/dts/bcm2836-rpi-2-b.dts    |  4 +++
0903551
 arch/arm/boot/dts/bcm283x.dtsi           | 47 ++++++++++++++++++++++++++++++++
0903551
 8 files changed, 80 insertions(+)
0903551
0903551
diff --git a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts
0903551
index 228614f..35ff4e7a 100644
0903551
--- a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts
0903551
+++ b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts
0903551
@@ -29,3 +29,7 @@
0903551
 		brcm,function = <BCM2835_FSEL_ALT0>;
0903551
 	};
0903551
 };
0903551
+
0903551
+&hdmi {
0903551
+	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
0903551
+};
0903551
diff --git a/arch/arm/boot/dts/bcm2835-rpi-a.dts b/arch/arm/boot/dts/bcm2835-rpi-a.dts
0903551
index ddbbbbd..306a84e 100644
0903551
--- a/arch/arm/boot/dts/bcm2835-rpi-a.dts
0903551
+++ b/arch/arm/boot/dts/bcm2835-rpi-a.dts
0903551
@@ -22,3 +22,7 @@
0903551
 		brcm,function = <BCM2835_FSEL_ALT2>;
0903551
 	};
0903551
 };
0903551
+
0903551
+&hdmi {
0903551
+	hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
0903551
+};
0903551
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
0903551
index ef54050..57d313b 100644
0903551
--- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
0903551
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
0903551
@@ -29,3 +29,7 @@
0903551
 		brcm,function = <BCM2835_FSEL_ALT0>;
0903551
 	};
0903551
 };
0903551
+
0903551
+&hdmi {
0903551
+	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
0903551
+};
0903551
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
0903551
index 86f1f2f..cf2774e 100644
0903551
--- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
0903551
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
0903551
@@ -22,3 +22,7 @@
0903551
 		brcm,function = <BCM2835_FSEL_ALT2>;
0903551
 	};
0903551
 };
0903551
+
0903551
+&hdmi {
0903551
+	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
0903551
+};
0903551
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts
0903551
index 4859e9d..8b15f9c 100644
0903551
--- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
0903551
+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
0903551
@@ -16,3 +16,7 @@
0903551
 &gpio {
0903551
 	pinctrl-0 = <&gpioout &alt0 &alt3>;
0903551
 };
0903551
+
0903551
+&hdmi {
0903551
+	hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
0903551
+};
0903551
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
0903551
index 76bdbca..caf2707 100644
0903551
--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
0903551
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
0903551
@@ -74,3 +74,12 @@
0903551
 &usb {
0903551
 	power-domains = <&power RPI_POWER_DOMAIN_USB>;
0903551
 };
0903551
+
0903551
+&v3d {
0903551
+	power-domains = <&power RPI_POWER_DOMAIN_V3D>;
0903551
+};
0903551
+
0903551
+&hdmi {
0903551
+	power-domains = <&power RPI_POWER_DOMAIN_HDMI>;
0903551
+	status = "okay";
0903551
+};
0903551
diff --git a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
0903551
index ff94666..c4743f4 100644
0903551
--- a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
0903551
+++ b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
0903551
@@ -33,3 +33,7 @@
0903551
 		brcm,function = <BCM2835_FSEL_ALT0>;
0903551
 	};
0903551
 };
0903551
+
0903551
+&hdmi {
0903551
+	hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
0903551
+};
0903551
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
0903551
index fc67964..bbe4eab 100644
0903551
--- a/arch/arm/boot/dts/bcm283x.dtsi
0903551
+++ b/arch/arm/boot/dts/bcm283x.dtsi
0903551
@@ -1,6 +1,7 @@
0903551
 #include <dt-bindings/pinctrl/bcm2835.h>
0903551
 #include <dt-bindings/clock/bcm2835.h>
0903551
 #include <dt-bindings/clock/bcm2835-aux.h>
0903551
+#include <dt-bindings/gpio/gpio.h>
0903551
 #include "skeleton.dtsi"
0903551
 
0903551
 /* This include file covers the common peripherals and configuration between
0903551
@@ -153,6 +154,18 @@
0903551
 			status = "disabled";
0903551
 		};
0903551
 
0903551
+		pixelvalve@7e206000 {
0903551
+			compatible = "brcm,bcm2835-pixelvalve0";
0903551
+			reg = <0x7e206000 0x100>;
0903551
+			interrupts = <2 13>; /* pwa0 */
0903551
+		};
0903551
+
0903551
+		pixelvalve@7e207000 {
0903551
+			compatible = "brcm,bcm2835-pixelvalve1";
0903551
+			reg = <0x7e207000 0x100>;
0903551
+			interrupts = <2 14>; /* pwa1 */
0903551
+		};
0903551
+
0903551
 		aux: aux@0x7e215000 {
0903551
 			compatible = "brcm,bcm2835-aux";
0903551
 			#clock-cells = <1>;
0903551
@@ -206,6 +219,12 @@
0903551
 			status = "disabled";
0903551
 		};
0903551
 
0903551
+		hvs@7e400000 {
0903551
+			compatible = "brcm,bcm2835-hvs";
0903551
+			reg = <0x7e400000 0x6000>;
0903551
+			interrupts = <2 1>;
0903551
+		};
0903551
+
0903551
 		i2c1: i2c@7e804000 {
0903551
 			compatible = "brcm,bcm2835-i2c";
0903551
 			reg = <0x7e804000 0x1000>;
0903551
@@ -226,11 +245,39 @@
0903551
 			status = "disabled";
0903551
 		};
0903551
 
0903551
+		pixelvalve@7e807000 {
0903551
+			compatible = "brcm,bcm2835-pixelvalve2";
0903551
+			reg = <0x7e807000 0x100>;
0903551
+			interrupts = <2 10>; /* pixelvalve */
0903551
+		};
0903551
+
0903551
+		hdmi: hdmi@7e902000 {
0903551
+			compatible = "brcm,bcm2835-hdmi";
0903551
+			reg = <0x7e902000 0x600>,
0903551
+			      <0x7e808000 0x100>;
0903551
+			interrupts = <2 8>, <2 9>;
0903551
+			ddc = <&i2c2>;
0903551
+			clocks = <&clocks BCM2835_PLLH_PIX>,
0903551
+				 <&clocks BCM2835_CLOCK_HSM>;
0903551
+			clock-names = "pixel", "hdmi";
0903551
+			status = "disabled";
0903551
+		};
0903551
+
0903551
 		usb: usb@7e980000 {
0903551
 			compatible = "brcm,bcm2835-usb";
0903551
 			reg = <0x7e980000 0x10000>;
0903551
 			interrupts = <1 9>;
0903551
 		};
0903551
+
0903551
+		v3d: v3d@7ec00000 {
0903551
+			compatible = "brcm,bcm2835-v3d";
0903551
+			reg = <0x7ec00000 0x1000>;
0903551
+			interrupts = <1 10>;
0903551
+		};
0903551
+
0903551
+		vc4: gpu {
0903551
+			compatible = "brcm,bcm2835-vc4";
0903551
+		};
0903551
 	};
0903551
 
0903551
 	clocks {
0903551
-- 
0903551
2.7.3
0903551
0903551
From da77f737f9f5a487f3a1f80f8546585ee18cd7b9 Mon Sep 17 00:00:00 2001
0903551
From: Eric Anholt <eric@anholt.net>
0903551
Date: Fri, 4 Mar 2016 10:39:28 -0800
0903551
Subject: [PATCH 27/36] dt-bindings: Add root properties for Raspberry Pi 3
0903551
0903551
Signed-off-by: Eric Anholt <eric@anholt.net>
0903551
Acked-by: Rob Herring <robh@kernel.org>
0903551
---
0903551
 Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt | 4 ++++
0903551
 1 file changed, 4 insertions(+)
0903551
0903551
diff --git a/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt b/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
0903551
index 11d3056..6ffe087 100644
0903551
--- a/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
0903551
+++ b/Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
0903551
@@ -30,6 +30,10 @@ Raspberry Pi 2 Model B
0903551
 Required root node properties:
0903551
 compatible = "raspberrypi,2-model-b", "brcm,bcm2836";
0903551
 
0903551
+Raspberry Pi 3 Model B
0903551
+Required root node properties:
0903551
+compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
0903551
+
0903551
 Raspberry Pi Compute Module
0903551
 Required root node properties:
0903551
 compatible = "raspberrypi,compute-module", "brcm,bcm2835";
0903551
-- 
0903551
2.7.3
0903551
0903551
From b76b1cdf2e569cceab41dcf3b3f6a90965d0a02c Mon Sep 17 00:00:00 2001
0903551
From: Eric Anholt <eric@anholt.net>
0903551
Date: Fri, 4 Mar 2016 10:39:29 -0800
0903551
Subject: [PATCH 28/36] ARM: bcm2835: Add devicetree for the Raspberry Pi 3.
0903551
0903551
For now this doesn't support the new hardware present on the Pi 3 (BT,
0903551
wifi, GPIO expander).  Since the GPIO expander isn't supported, we
0903551
also don't have the LEDs like the other board files do.
0903551
0903551
Signed-off-by: Eric Anholt <eric@anholt.net>
0903551
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
0903551
---
0903551
 arch/arm/boot/dts/Makefile            |  3 +-
0903551
 arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 22 ++++++++++++
0903551
 arch/arm/boot/dts/bcm2837.dtsi        | 68 +++++++++++++++++++++++++++++++++++
0903551
 3 files changed, 92 insertions(+), 1 deletion(-)
0903551
 create mode 100644 arch/arm/boot/dts/bcm2837-rpi-3-b.dts
0903551
 create mode 100644 arch/arm/boot/dts/bcm2837.dtsi
0903551
0903551
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
0903551
index d000814..a8a0767 100644
0903551
--- a/arch/arm/boot/dts/Makefile
0903551
+++ b/arch/arm/boot/dts/Makefile
0903551
@@ -64,7 +64,8 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
0903551
 	bcm2835-rpi-b-rev2.dtb \
0903551
 	bcm2835-rpi-b-plus.dtb \
0903551
 	bcm2835-rpi-a-plus.dtb \
0903551
-	bcm2836-rpi-2-b.dtb
0903551
+	bcm2836-rpi-2-b.dtb \
0903551
+	bcm2837-rpi-3-b.dtb
0903551
 dtb-$(CONFIG_ARCH_BCM_5301X) += \
0903551
 	bcm4708-asus-rt-ac56u.dtb \
0903551
 	bcm4708-asus-rt-ac68u.dtb \
0903551
diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
0903551
new file mode 100644
0903551
index 0000000..5e8eafd
0903551
--- /dev/null
0903551
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
0903551
@@ -0,0 +1,22 @@
0903551
+/dts-v1/;
0903551
+#include "bcm2837.dtsi"
0903551
+#include "bcm2835-rpi.dtsi"
0903551
+
0903551
+/ {
0903551
+	compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
0903551
+	model = "Raspberry Pi 3 Model B";
0903551
+
0903551
+	memory {
0903551
+		reg = <0 0x40000000>;
0903551
+	};
0903551
+};
0903551
+
0903551
+&gpio {
0903551
+	pinctrl-0 = <&gpioout &alt0 &i2s_alt0 &alt3>;
0903551
+
0903551
+	/* I2S interface */
0903551
+	i2s_alt0: i2s_alt0 {
0903551
+		brcm,pins = <28 29 30 31>;
0903551
+		brcm,function = <BCM2835_FSEL_ALT2>;
0903551
+	};
0903551
+};
0903551
diff --git a/arch/arm/boot/dts/bcm2837.dtsi b/arch/arm/boot/dts/bcm2837.dtsi
0903551
new file mode 100644
0903551
index 0000000..2f36722
0903551
--- /dev/null
0903551
+++ b/arch/arm/boot/dts/bcm2837.dtsi
0903551
@@ -0,0 +1,68 @@
0903551
+#include "bcm283x.dtsi"
0903551
+
0903551
+/ {
0903551
+	compatible = "brcm,bcm2836";
0903551
+
0903551
+	soc {
0903551
+		ranges = <0x7e000000 0x3f000000 0x1000000>,
0903551
+			 <0x40000000 0x40000000 0x00001000>;
0903551
+		dma-ranges = <0xc0000000 0x00000000 0x3f000000>;
0903551
+
0903551
+		local_intc: local_intc {
0903551
+			compatible = "brcm,bcm2836-l1-intc";
0903551
+			reg = <0x40000000 0x100>;
0903551
+			interrupt-controller;
0903551
+			#interrupt-cells = <1>;
0903551
+			interrupt-parent = <&local_intc>;
0903551
+		};
0903551
+	};
0903551
+
0903551
+	timer {
0903551
+		compatible = "arm,armv7-timer";
0903551
+		interrupt-parent = <&local_intc>;
0903551
+		interrupts = <0>, // PHYS_SECURE_PPI
0903551
+			     <1>, // PHYS_NONSECURE_PPI
0903551
+			     <3>, // VIRT_PPI
0903551
+			     <2>; // HYP_PPI
0903551
+		always-on;
0903551
+	};
0903551
+
0903551
+	cpus: cpus {
0903551
+		#address-cells = <1>;
0903551
+		#size-cells = <0>;
0903551
+
0903551
+		cpu0: cpu@0 {
0903551
+			device_type = "cpu";
0903551
+			compatible = "arm,cortex-a53";
0903551
+			reg = <0>;
0903551
+		};
0903551
+
0903551
+		cpu1: cpu@1 {
0903551
+			device_type = "cpu";
0903551
+			compatible = "arm,cortex-a53";
0903551
+			reg = <1>;
0903551
+		};
0903551
+
0903551
+		cpu2: cpu@2 {
0903551
+			device_type = "cpu";
0903551
+			compatible = "arm,cortex-a53";
0903551
+			reg = <2>;
0903551
+		};
0903551
+
0903551
+		cpu3: cpu@3 {
0903551
+			device_type = "cpu";
0903551
+			compatible = "arm,cortex-a53";
0903551
+			reg = <3>;
0903551
+		};
0903551
+	};
0903551
+};
0903551
+
0903551
+/* Make the BCM2835-style global interrupt controller be a child of the
0903551
+ * CPU-local interrupt controller.
0903551
+ */
0903551
+&intc {
0903551
+	compatible = "brcm,bcm2836-armctrl-ic";
0903551
+	reg = <0x7e00b200 0x200>;
0903551
+	interrupt-parent = <&local_intc>;
0903551
+	interrupts = <8>;
0903551
+};
0903551
-- 
0903551
2.7.3
0903551
0903551
From 528285e99c25249456023d28f521689bf9e9eb8b Mon Sep 17 00:00:00 2001
0903551
From: Peter Robinson <pbrobinson@gmail.com>
0903551
Date: Wed, 30 Mar 2016 09:35:13 +0100
0903551
Subject: [PATCH 32/36] drop usb power domain support for the moment, kills usb
0903551
0903551
---
0903551
 arch/arm/boot/dts/bcm2835-rpi.dtsi | 4 ----
0903551
 1 file changed, 4 deletions(-)
0903551
0903551
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
0903551
index caf2707..b1e8145 100644
0903551
--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
0903551
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
0903551
@@ -71,10 +71,6 @@
0903551
 	status = "okay";
0903551
 };
0903551
 
0903551
-&usb {
0903551
-	power-domains = <&power RPI_POWER_DOMAIN_USB>;
0903551
-};
0903551
-
0903551
 &v3d {
0903551
 	power-domains = <&power RPI_POWER_DOMAIN_V3D>;
0903551
 };
0903551
-- 
0903551
2.7.3
0903551