da8efd5
From cdb86691df26e0962f081981f4bfa97ee43bd391 Mon Sep 17 00:00:00 2001
2c530ad
From: Peter Robinson <pbrobinson@gmail.com>
2c530ad
Date: Mon, 29 Aug 2016 09:14:15 +0100
2c530ad
Subject: [PATCH] ARM: bcm283x: Add devicetree for the Raspberry Pi 3.
df68cbf
df68cbf
For now this doesn't support the new hardware present on the Pi 3 (BT,
2c530ad
wifi, GPIO expander).
df68cbf
2c530ad
Rebased to the patch that went upstream for ARM64
2c530ad
2c530ad
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
df68cbf
---
da8efd5
 arch/arm/boot/dts/Makefile            |  3 +-
2c530ad
 arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 30 ++++++++++++++
2c530ad
 arch/arm/boot/dts/bcm2837.dtsi        | 76 +++++++++++++++++++++++++++++++++++
da8efd5
 3 files changed, 108 insertions(+), 1 deletion(-)
df68cbf
 create mode 100644 arch/arm/boot/dts/bcm2837-rpi-3-b.dts
df68cbf
 create mode 100644 arch/arm/boot/dts/bcm2837.dtsi
df68cbf
df68cbf
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
da8efd5
index befcd26..c96fb38 100644
df68cbf
--- a/arch/arm/boot/dts/Makefile
df68cbf
+++ b/arch/arm/boot/dts/Makefile
da8efd5
@@ -70,7 +70,8 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
da8efd5
 	bcm2835-rpi-b-plus.dtb \
df68cbf
 	bcm2835-rpi-a-plus.dtb \
9ed1be9
 	bcm2836-rpi-2-b.dtb \
da8efd5
-	bcm2835-rpi-zero.dtb
da8efd5
+	bcm2835-rpi-zero.dtb \
df68cbf
+	bcm2837-rpi-3-b.dtb
df68cbf
 dtb-$(CONFIG_ARCH_BCM_5301X) += \
df68cbf
 	bcm4708-asus-rt-ac56u.dtb \
df68cbf
 	bcm4708-asus-rt-ac68u.dtb \
df68cbf
diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
df68cbf
new file mode 100644
2c530ad
index 0000000..7841b72
df68cbf
--- /dev/null
df68cbf
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
2c530ad
@@ -0,0 +1,30 @@
df68cbf
+/dts-v1/;
df68cbf
+#include "bcm2837.dtsi"
df68cbf
+#include "bcm2835-rpi.dtsi"
2c530ad
+#include "bcm283x-rpi-smsc9514.dtsi"
df68cbf
+
df68cbf
+/ {
df68cbf
+	compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
df68cbf
+	model = "Raspberry Pi 3 Model B";
df68cbf
+
df68cbf
+	memory {
df68cbf
+		reg = <0 0x40000000>;
df68cbf
+	};
df68cbf
+
2c530ad
+	leds {
2c530ad
+		act {
2c530ad
+			gpios = <&gpio 47 0>;
2c530ad
+		};
df68cbf
+
2c530ad
+		pwr {
2c530ad
+			label = "PWR";
2c530ad
+			gpios = <&gpio 35 0>;
2c530ad
+			default-state = "keep";
2c530ad
+			linux,default-trigger = "default-on";
2c530ad
+		};
df68cbf
+	};
df68cbf
+};
2c530ad
+
2c530ad
+&uart1 {
2c530ad
+	status = "okay";
2c530ad
+};
df68cbf
diff --git a/arch/arm/boot/dts/bcm2837.dtsi b/arch/arm/boot/dts/bcm2837.dtsi
df68cbf
new file mode 100644
2c530ad
index 0000000..8216bbb
df68cbf
--- /dev/null
df68cbf
+++ b/arch/arm/boot/dts/bcm2837.dtsi
2c530ad
@@ -0,0 +1,76 @@
df68cbf
+#include "bcm283x.dtsi"
df68cbf
+
df68cbf
+/ {
df68cbf
+	compatible = "brcm,bcm2836";
df68cbf
+
df68cbf
+	soc {
df68cbf
+		ranges = <0x7e000000 0x3f000000 0x1000000>,
df68cbf
+			 <0x40000000 0x40000000 0x00001000>;
df68cbf
+		dma-ranges = <0xc0000000 0x00000000 0x3f000000>;
df68cbf
+
df68cbf
+		local_intc: local_intc {
df68cbf
+			compatible = "brcm,bcm2836-l1-intc";
df68cbf
+			reg = <0x40000000 0x100>;
df68cbf
+			interrupt-controller;
df68cbf
+			#interrupt-cells = <1>;
df68cbf
+			interrupt-parent = <&local_intc>;
df68cbf
+		};
df68cbf
+	};
df68cbf
+
df68cbf
+	timer {
df68cbf
+		compatible = "arm,armv7-timer";
df68cbf
+		interrupt-parent = <&local_intc>;
df68cbf
+		interrupts = <0>, // PHYS_SECURE_PPI
df68cbf
+			     <1>, // PHYS_NONSECURE_PPI
df68cbf
+			     <3>, // VIRT_PPI
df68cbf
+			     <2>; // HYP_PPI
df68cbf
+		always-on;
df68cbf
+	};
df68cbf
+
df68cbf
+	cpus: cpus {
df68cbf
+		#address-cells = <1>;
df68cbf
+		#size-cells = <0>;
df68cbf
+
df68cbf
+		cpu0: cpu@0 {
df68cbf
+			device_type = "cpu";
df68cbf
+			compatible = "arm,cortex-a53";
df68cbf
+			reg = <0>;
2c530ad
+			enable-method = "spin-table";
2c530ad
+			cpu-release-addr = <0x0 0x000000d8>;
df68cbf
+		};
df68cbf
+
df68cbf
+		cpu1: cpu@1 {
df68cbf
+			device_type = "cpu";
df68cbf
+			compatible = "arm,cortex-a53";
df68cbf
+			reg = <1>;
2c530ad
+			enable-method = "spin-table";
2c530ad
+			cpu-release-addr = <0x0 0x000000e0>;
df68cbf
+		};
df68cbf
+
df68cbf
+		cpu2: cpu@2 {
df68cbf
+			device_type = "cpu";
df68cbf
+			compatible = "arm,cortex-a53";
df68cbf
+			reg = <2>;
2c530ad
+			enable-method = "spin-table";
2c530ad
+			cpu-release-addr = <0x0 0x000000e8>;
df68cbf
+		};
df68cbf
+
df68cbf
+		cpu3: cpu@3 {
df68cbf
+			device_type = "cpu";
df68cbf
+			compatible = "arm,cortex-a53";
df68cbf
+			reg = <3>;
2c530ad
+			enable-method = "spin-table";
2c530ad
+			cpu-release-addr = <0x0 0x000000f0>;
df68cbf
+		};
df68cbf
+	};
df68cbf
+};
df68cbf
+
df68cbf
+/* Make the BCM2835-style global interrupt controller be a child of the
df68cbf
+ * CPU-local interrupt controller.
df68cbf
+ */
df68cbf
+&intc {
df68cbf
+	compatible = "brcm,bcm2836-armctrl-ic";
df68cbf
+	reg = <0x7e00b200 0x200>;
df68cbf
+	interrupt-parent = <&local_intc>;
df68cbf
+	interrupts = <8>;
df68cbf
+};
df68cbf
-- 
9ed1be9
2.7.4
9ed1be9
a99c794
From 345863374ebec9aa11ea97b99f5adbf97f99bbdf Mon Sep 17 00:00:00 2001
a99c794
From: Peter Robinson <pbrobinson@gmail.com>
a99c794
Date: Mon, 16 Jan 2017 06:38:08 +0000
a99c794
Subject: [PATCH] add upstream RPi3 fixes from arm64 DT
a99c794
a99c794
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
a99c794
---
a99c794
 arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 8 +-------
a99c794
 arch/arm/boot/dts/bcm2837.dtsi        | 8 +++++++-
a99c794
 2 files changed, 8 insertions(+), 8 deletions(-)
a99c794
a99c794
diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
a99c794
index 7841b72..c309633 100644
a99c794
--- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
a99c794
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
a99c794
@@ -2,6 +2,7 @@
a99c794
 #include "bcm2837.dtsi"
a99c794
 #include "bcm2835-rpi.dtsi"
a99c794
 #include "bcm283x-rpi-smsc9514.dtsi"
a99c794
+#include "bcm283x-rpi-usb-host.dtsi"
a99c794
 
a99c794
 / {
a99c794
 	compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
a99c794
@@ -15,13 +16,6 @@
a99c794
 		act {
a99c794
 			gpios = <&gpio 47 0>;
a99c794
 		};
a99c794
-
a99c794
-		pwr {
a99c794
-			label = "PWR";
a99c794
-			gpios = <&gpio 35 0>;
a99c794
-			default-state = "keep";
a99c794
-			linux,default-trigger = "default-on";
a99c794
-		};
a99c794
 	};
a99c794
 };
a99c794
 
a99c794
diff --git a/arch/arm/boot/dts/bcm2837.dtsi b/arch/arm/boot/dts/bcm2837.dtsi
a99c794
index 8216bbb..19f2fe6 100644
a99c794
--- a/arch/arm/boot/dts/bcm2837.dtsi
a99c794
+++ b/arch/arm/boot/dts/bcm2837.dtsi
a99c794
@@ -1,7 +1,7 @@
a99c794
 #include "bcm283x.dtsi"
a99c794
 
a99c794
 / {
a99c794
-	compatible = "brcm,bcm2836";
a99c794
+	compatible = "brcm,bcm2837";
a99c794
 
a99c794
 	soc {
a99c794
 		ranges = <0x7e000000 0x3f000000 0x1000000>,
a99c794
@@ -74,3 +74,9 @@
a99c794
 	interrupt-parent = <&local_intc>;
a99c794
 	interrupts = <8>;
a99c794
 };
a99c794
+
a99c794
+/* enable thermal sensor with the correct compatible property set */
a99c794
+&thermal {
a99c794
+	compatible = "brcm,bcm2837-thermal";
a99c794
+	status = "okay";
a99c794
+};
a99c794
-- 
a99c794
2.9.3
a99c794