linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1
@ 2022-06-09 11:22 AngeloGioacchino Del Regno
  2022-06-09 11:22 ` [PATCH v2 01/10] arm64: dts: mediatek: mt6795: Create soc bus node and move mmio devices AngeloGioacchino Del Regno
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:22 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

In an effort to give some love to the apparently forgotten MT6795 SoC,
I am upstreaming more components that are necessary to support platforms
powered by this one apart from a simple boot to serial console.

This series modernizes the devicetree of the MT6795 SoC and adds a
couple of nodes that are supported by this SoC.

In my local tree I have much more than that (including the dts for
that Xperia M5 smartphone that I always mention...), but I decided
to push the devicetree commits in multiple parts, as to get these
in sooner than later because that reduces my delta, and this makes
upstreaming a bit easier, especially when having to rebase things
around, which happens a lot.

So, this series *does NOT* depends on any of the other series that
I've pushed and is mergeable in parallel.

Tested on a MT6795 Sony Xperia M5 (codename "Holly") smartphone.

Changes in v2:
 - Split fixed-clocks addition/removal patch for readability
 - Added patches for pinctrl controller node and vGIC interrupt

AngeloGioacchino Del Regno (10):
  arm64: dts: mediatek: mt6795: Create soc bus node and move mmio
    devices
  arm64: dts: mediatek: mt6795: Add cpu-map and L2 cache
  arm64: dts: mediatek: mt6795: Add Cortex A53 PMU nodes
  arm64: dts: mediatek: mt6795: Add watchdog node to avoid timeouts
  arm64: dts: mediatek: mt6795: Add fixed clocks for 32kHz and 26MHz XOs
  arm64: dts: mediatek: mt6795: Remove incorrect fixed-clocks
  arm64: dts: mediatek: mt6795: Add general purpose timer node
  arm64: dts: mediatek: mt6795: Add ARM CCI-400 node and assign to CPUs
  arm64: dts: mediatek: mt6795: Add pinctrl controller node
  arm64: dts: mediatek: mt6795: Specify interrupts for vGIC

 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 260 ++++++++++++++++++-----
 1 file changed, 205 insertions(+), 55 deletions(-)

-- 
2.35.1


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

* [PATCH v2 01/10] arm64: dts: mediatek: mt6795: Create soc bus node and move mmio devices
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
@ 2022-06-09 11:22 ` AngeloGioacchino Del Regno
  2022-06-09 11:22 ` [PATCH v2 02/10] arm64: dts: mediatek: mt6795: Add cpu-map and L2 cache AngeloGioacchino Del Regno
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:22 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

MMIO devices should be inside of a soc bus node, as it's done for the
vast majority of ARM64 devicetrees, and for almost all MTK devicetrees.
Create a simple-bus soc node and move all devices with a MMIO address
space in there.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 105 ++++++++++++-----------
 1 file changed, 56 insertions(+), 49 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index c85659d0ff5d..167f90bd991a 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -117,59 +117,66 @@ timer {
 			     (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
 	};
 
-	sysirq: intpol-controller@10200620 {
-		compatible = "mediatek,mt6795-sysirq",
-			     "mediatek,mt6577-sysirq";
-		interrupt-controller;
-		#interrupt-cells = <3>;
-		interrupt-parent = <&gic>;
-		reg = <0 0x10200620 0 0x20>;
-	};
+	soc {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		compatible = "simple-bus";
+		ranges;
+
+		sysirq: intpol-controller@10200620 {
+			compatible = "mediatek,mt6795-sysirq",
+				     "mediatek,mt6577-sysirq";
+			interrupt-controller;
+			#interrupt-cells = <3>;
+			interrupt-parent = <&gic>;
+			reg = <0 0x10200620 0 0x20>;
+		};
 
-	gic: interrupt-controller@10221000 {
-		compatible = "arm,gic-400";
-		#interrupt-cells = <3>;
-		interrupt-parent = <&gic>;
-		interrupt-controller;
-		reg = <0 0x10221000 0 0x1000>,
-		      <0 0x10222000 0 0x2000>,
-		      <0 0x10224000 0 0x2000>,
-		      <0 0x10226000 0 0x2000>;
-	};
+		gic: interrupt-controller@10221000 {
+			compatible = "arm,gic-400";
+			#interrupt-cells = <3>;
+			interrupt-parent = <&gic>;
+			interrupt-controller;
+			reg = <0 0x10221000 0 0x1000>,
+			      <0 0x10222000 0 0x2000>,
+			      <0 0x10224000 0 0x2000>,
+			      <0 0x10226000 0 0x2000>;
+		};
 
-	uart0: serial@11002000 {
-		compatible = "mediatek,mt6795-uart",
-			     "mediatek,mt6577-uart";
-		reg = <0 0x11002000 0 0x400>;
-		interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_LOW>;
-		clocks = <&uart_clk>;
-		status = "disabled";
-	};
+		uart0: serial@11002000 {
+			compatible = "mediatek,mt6795-uart",
+				     "mediatek,mt6577-uart";
+			reg = <0 0x11002000 0 0x400>;
+			interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&uart_clk>;
+			status = "disabled";
+		};
 
-	uart1: serial@11003000 {
-		compatible = "mediatek,mt6795-uart",
-			     "mediatek,mt6577-uart";
-		reg = <0 0x11003000 0 0x400>;
-		interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_LOW>;
-		clocks = <&uart_clk>;
-		status = "disabled";
-	};
+		uart1: serial@11003000 {
+			compatible = "mediatek,mt6795-uart",
+				     "mediatek,mt6577-uart";
+			reg = <0 0x11003000 0 0x400>;
+			interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&uart_clk>;
+			status = "disabled";
+		};
 
-	uart2: serial@11004000 {
-		compatible = "mediatek,mt6795-uart",
-			     "mediatek,mt6577-uart";
-		reg = <0 0x11004000 0 0x400>;
-		interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_LOW>;
-		clocks = <&uart_clk>;
-		status = "disabled";
-	};
+		uart2: serial@11004000 {
+			compatible = "mediatek,mt6795-uart",
+				     "mediatek,mt6577-uart";
+			reg = <0 0x11004000 0 0x400>;
+			interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&uart_clk>;
+			status = "disabled";
+		};
 
-	uart3: serial@11005000 {
-		compatible = "mediatek,mt6795-uart",
-			     "mediatek,mt6577-uart";
-		reg = <0 0x11005000 0 0x400>;
-		interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_LOW>;
-		clocks = <&uart_clk>;
-		status = "disabled";
+		uart3: serial@11005000 {
+			compatible = "mediatek,mt6795-uart",
+				     "mediatek,mt6577-uart";
+			reg = <0 0x11005000 0 0x400>;
+			interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&uart_clk>;
+			status = "disabled";
+		};
 	};
 };
-- 
2.35.1


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

* [PATCH v2 02/10] arm64: dts: mediatek: mt6795: Add cpu-map and L2 cache
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
  2022-06-09 11:22 ` [PATCH v2 01/10] arm64: dts: mediatek: mt6795: Create soc bus node and move mmio devices AngeloGioacchino Del Regno
@ 2022-06-09 11:22 ` AngeloGioacchino Del Regno
  2022-06-09 11:22 ` [PATCH v2 03/10] arm64: dts: mediatek: mt6795: Add Cortex A53 PMU nodes AngeloGioacchino Del Regno
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:22 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

This SoC is HMP and has two clusters with four Cortex-A53 cores each:
declare a cpu map and, while at it, also add the next-level-cache
properties.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 56 ++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index 167f90bd991a..1456b9035336 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -34,6 +34,7 @@ cpu0: cpu@0 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x000>;
+			next-level-cache = <&l2_0>;
 		};
 
 		cpu1: cpu@1 {
@@ -41,6 +42,7 @@ cpu1: cpu@1 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x001>;
+			next-level-cache = <&l2_0>;
 		};
 
 		cpu2: cpu@2 {
@@ -48,6 +50,7 @@ cpu2: cpu@2 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x002>;
+			next-level-cache = <&l2_0>;
 		};
 
 		cpu3: cpu@3 {
@@ -55,6 +58,7 @@ cpu3: cpu@3 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x003>;
+			next-level-cache = <&l2_0>;
 		};
 
 		cpu4: cpu@100 {
@@ -62,6 +66,7 @@ cpu4: cpu@100 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x100>;
+			next-level-cache = <&l2_1>;
 		};
 
 		cpu5: cpu@101 {
@@ -69,6 +74,7 @@ cpu5: cpu@101 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x101>;
+			next-level-cache = <&l2_1>;
 		};
 
 		cpu6: cpu@102 {
@@ -76,6 +82,7 @@ cpu6: cpu@102 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x102>;
+			next-level-cache = <&l2_1>;
 		};
 
 		cpu7: cpu@103 {
@@ -83,6 +90,55 @@ cpu7: cpu@103 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x103>;
+			next-level-cache = <&l2_1>;
+		};
+
+		cpu-map {
+			cluster0 {
+				core0 {
+					cpu = <&cpu0>;
+				};
+
+				core1 {
+					cpu = <&cpu1>;
+				};
+
+				core2 {
+					cpu = <&cpu2>;
+				};
+
+				core3 {
+					cpu = <&cpu3>;
+				};
+			};
+
+			cluster1 {
+				core0 {
+					cpu = <&cpu4>;
+				};
+
+				core1 {
+					cpu = <&cpu5>;
+				};
+
+				core2 {
+					cpu = <&cpu6>;
+				};
+
+				core3 {
+					cpu = <&cpu7>;
+				};
+			};
+		};
+
+		l2_0: l2-cache0 {
+			compatible = "cache";
+			cache-level = <2>;
+		};
+
+		l2_1: l2-cache1 {
+			compatible = "cache";
+			cache-level = <2>;
 		};
 	};
 
-- 
2.35.1


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

* [PATCH v2 03/10] arm64: dts: mediatek: mt6795: Add Cortex A53 PMU nodes
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
  2022-06-09 11:22 ` [PATCH v2 01/10] arm64: dts: mediatek: mt6795: Create soc bus node and move mmio devices AngeloGioacchino Del Regno
  2022-06-09 11:22 ` [PATCH v2 02/10] arm64: dts: mediatek: mt6795: Add cpu-map and L2 cache AngeloGioacchino Del Regno
@ 2022-06-09 11:22 ` AngeloGioacchino Del Regno
  2022-06-09 11:22 ` [PATCH v2 04/10] arm64: dts: mediatek: mt6795: Add watchdog node to avoid timeouts AngeloGioacchino Del Regno
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:22 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

Add the required nodes to enable the PMU on this SoC.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index 1456b9035336..639104b3f693 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -160,6 +160,15 @@ uart_clk: dummy26m {
 		#clock-cells = <0>;
 	};
 
+	pmu {
+		compatible = "arm,cortex-a53-pmu";
+		interrupts = <GIC_SPI  8 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_SPI  9 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_SPI 10 IRQ_TYPE_LEVEL_LOW>,
+			     <GIC_SPI 11 IRQ_TYPE_LEVEL_LOW>;
+		interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupt-parent = <&gic>;
-- 
2.35.1


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

* [PATCH v2 04/10] arm64: dts: mediatek: mt6795: Add watchdog node to avoid timeouts
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
                   ` (2 preceding siblings ...)
  2022-06-09 11:22 ` [PATCH v2 03/10] arm64: dts: mediatek: mt6795: Add Cortex A53 PMU nodes AngeloGioacchino Del Regno
@ 2022-06-09 11:22 ` AngeloGioacchino Del Regno
  2022-06-09 11:22 ` [PATCH v2 05/10] arm64: dts: mediatek: mt6795: Add fixed clocks for 32kHz and 26MHz XOs AngeloGioacchino Del Regno
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:22 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

At least on commercial devices like some smartphones, the bootloader
will initialize the SoC watchdog and set it to reboot the board when
it times out. The last pet that this watchdog is getting is right
before booting the kernel and left it enabled as a protection against
boot failure: this means that Linux is expected to initialize this
device and pet as soon as possible, or it will bark and reset the AP.

In order to prevent that, add the required watchdog node as default
enabled: this will have no side effects on boards that are not
performing the aforementioned watchdog setup before booting Linux.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index 639104b3f693..363fa25b4edc 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -188,6 +188,14 @@ soc {
 		compatible = "simple-bus";
 		ranges;
 
+		watchdog: watchdog@10007000 {
+			compatible = "mediatek,mt6795-wdt";
+			reg = <0 0x10007000 0 0x100>;
+			interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_LOW>;
+			#reset-cells = <1>;
+			timeout-sec = <20>;
+		};
+
 		sysirq: intpol-controller@10200620 {
 			compatible = "mediatek,mt6795-sysirq",
 				     "mediatek,mt6577-sysirq";
-- 
2.35.1


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

* [PATCH v2 05/10] arm64: dts: mediatek: mt6795: Add fixed clocks for 32kHz and 26MHz XOs
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
                   ` (3 preceding siblings ...)
  2022-06-09 11:22 ` [PATCH v2 04/10] arm64: dts: mediatek: mt6795: Add watchdog node to avoid timeouts AngeloGioacchino Del Regno
@ 2022-06-09 11:22 ` AngeloGioacchino Del Regno
  2022-06-09 11:22 ` [PATCH v2 06/10] arm64: dts: mediatek: mt6795: Remove incorrect fixed-clocks AngeloGioacchino Del Regno
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:22 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

Add the 32kHz and 26MHz oscillators as fixed clocks in devicetree to
provide a good initial clock spec, since this SoC features two always
on oscillators running at the aforementioned frequencies.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index 363fa25b4edc..7123c1bf8d9e 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -142,6 +142,20 @@ l2_1: l2-cache1 {
 		};
 	};
 
+	clk26m: oscillator-26m {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <26000000>;
+		clock-output-names = "clk26m";
+	};
+
+	clk32k: oscillator-32k {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <32000>;
+		clock-output-names = "clk32k";
+	};
+
 	system_clk: dummy13m {
 		compatible = "fixed-clock";
 		clock-frequency = <13000000>;
-- 
2.35.1


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

* [PATCH v2 06/10] arm64: dts: mediatek: mt6795: Remove incorrect fixed-clocks
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
                   ` (4 preceding siblings ...)
  2022-06-09 11:22 ` [PATCH v2 05/10] arm64: dts: mediatek: mt6795: Add fixed clocks for 32kHz and 26MHz XOs AngeloGioacchino Del Regno
@ 2022-06-09 11:22 ` AngeloGioacchino Del Regno
  2022-06-09 11:23 ` [PATCH v2 07/10] arm64: dts: mediatek: mt6795: Add general purpose timer node AngeloGioacchino Del Regno
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:22 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

Remove the RTC and UART fixed clocks, as these were introduced to
temporarily provide a dummy clock to devices: since the two 26M/32K
fixed oscillators clocks (which do really exist in the SoC) have
been added, there's no reason to keep the aforementioned (and now
redundant) dummies in this devicetree.

In order to remove the uart dummy clock, it was necessary to also
reassign the clock of all UART nodes to clk26m.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index 7123c1bf8d9e..b6f7681cc151 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -162,18 +162,6 @@ system_clk: dummy13m {
 		#clock-cells = <0>;
 	};
 
-	rtc_clk: dummy32k {
-		compatible = "fixed-clock";
-		clock-frequency = <32000>;
-		#clock-cells = <0>;
-	};
-
-	uart_clk: dummy26m {
-		compatible = "fixed-clock";
-		clock-frequency = <26000000>;
-		#clock-cells = <0>;
-	};
-
 	pmu {
 		compatible = "arm,cortex-a53-pmu";
 		interrupts = <GIC_SPI  8 IRQ_TYPE_LEVEL_LOW>,
@@ -235,7 +223,7 @@ uart0: serial@11002000 {
 				     "mediatek,mt6577-uart";
 			reg = <0 0x11002000 0 0x400>;
 			interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_LOW>;
-			clocks = <&uart_clk>;
+			clocks = <&clk26m>;
 			status = "disabled";
 		};
 
@@ -244,7 +232,7 @@ uart1: serial@11003000 {
 				     "mediatek,mt6577-uart";
 			reg = <0 0x11003000 0 0x400>;
 			interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_LOW>;
-			clocks = <&uart_clk>;
+			clocks = <&clk26m>;
 			status = "disabled";
 		};
 
@@ -253,7 +241,7 @@ uart2: serial@11004000 {
 				     "mediatek,mt6577-uart";
 			reg = <0 0x11004000 0 0x400>;
 			interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_LOW>;
-			clocks = <&uart_clk>;
+			clocks = <&clk26m>;
 			status = "disabled";
 		};
 
@@ -262,7 +250,7 @@ uart3: serial@11005000 {
 				     "mediatek,mt6577-uart";
 			reg = <0 0x11005000 0 0x400>;
 			interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_LOW>;
-			clocks = <&uart_clk>;
+			clocks = <&clk26m>;
 			status = "disabled";
 		};
 	};
-- 
2.35.1


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

* [PATCH v2 07/10] arm64: dts: mediatek: mt6795: Add general purpose timer node
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
                   ` (5 preceding siblings ...)
  2022-06-09 11:22 ` [PATCH v2 06/10] arm64: dts: mediatek: mt6795: Remove incorrect fixed-clocks AngeloGioacchino Del Regno
@ 2022-06-09 11:23 ` AngeloGioacchino Del Regno
  2022-06-09 11:23 ` [PATCH v2 08/10] arm64: dts: mediatek: mt6795: Add ARM CCI-400 node and assign to CPUs AngeloGioacchino Del Regno
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:23 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

Add the timer node, enabling two GPTs, of which one will be used as
sched_clock.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index b6f7681cc151..217d99621558 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -198,6 +198,14 @@ watchdog: watchdog@10007000 {
 			timeout-sec = <20>;
 		};
 
+		timer: timer@10008000 {
+			compatible = "mediatek,mt6795-timer",
+				     "mediatek,mt6577-timer";
+			reg = <0 0x10008000 0 0x1000>;
+			interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_LOW>;
+			clocks = <&system_clk>, <&clk32k>;
+		};
+
 		sysirq: intpol-controller@10200620 {
 			compatible = "mediatek,mt6795-sysirq",
 				     "mediatek,mt6577-sysirq";
-- 
2.35.1


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

* [PATCH v2 08/10] arm64: dts: mediatek: mt6795: Add ARM CCI-400 node and assign to CPUs
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
                   ` (6 preceding siblings ...)
  2022-06-09 11:23 ` [PATCH v2 07/10] arm64: dts: mediatek: mt6795: Add general purpose timer node AngeloGioacchino Del Regno
@ 2022-06-09 11:23 ` AngeloGioacchino Del Regno
  2022-06-09 11:23 ` [PATCH v2 09/10] arm64: dts: mediatek: mt6795: Add pinctrl controller node AngeloGioacchino Del Regno
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:23 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

This SoC features an ARM CCI-400 IP: add the required node and
assign the cci control ports to the CPU cores.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 44 ++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index 217d99621558..db1f24b3b9a9 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -34,6 +34,7 @@ cpu0: cpu@0 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x000>;
+			cci-control-port = <&cci_control2>;
 			next-level-cache = <&l2_0>;
 		};
 
@@ -42,6 +43,7 @@ cpu1: cpu@1 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x001>;
+			cci-control-port = <&cci_control2>;
 			next-level-cache = <&l2_0>;
 		};
 
@@ -50,6 +52,7 @@ cpu2: cpu@2 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x002>;
+			cci-control-port = <&cci_control2>;
 			next-level-cache = <&l2_0>;
 		};
 
@@ -58,6 +61,7 @@ cpu3: cpu@3 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x003>;
+			cci-control-port = <&cci_control2>;
 			next-level-cache = <&l2_0>;
 		};
 
@@ -66,6 +70,7 @@ cpu4: cpu@100 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x100>;
+			cci-control-port = <&cci_control1>;
 			next-level-cache = <&l2_1>;
 		};
 
@@ -74,6 +79,7 @@ cpu5: cpu@101 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x101>;
+			cci-control-port = <&cci_control1>;
 			next-level-cache = <&l2_1>;
 		};
 
@@ -82,6 +88,7 @@ cpu6: cpu@102 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x102>;
+			cci-control-port = <&cci_control1>;
 			next-level-cache = <&l2_1>;
 		};
 
@@ -90,6 +97,7 @@ cpu7: cpu@103 {
 			compatible = "arm,cortex-a53";
 			enable-method = "psci";
 			reg = <0x103>;
+			cci-control-port = <&cci_control1>;
 			next-level-cache = <&l2_1>;
 		};
 
@@ -226,6 +234,42 @@ gic: interrupt-controller@10221000 {
 			      <0 0x10226000 0 0x2000>;
 		};
 
+		cci: cci@10390000 {
+			compatible = "arm,cci-400";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			reg = <0 0x10390000 0 0x1000>;
+			ranges = <0 0 0x10390000 0x10000>;
+
+			cci_control0: slave-if@1000 {
+				compatible = "arm,cci-400-ctrl-if";
+				interface-type = "ace-lite";
+				reg = <0x1000 0x1000>;
+			};
+
+			cci_control1: slave-if@4000 {
+				compatible = "arm,cci-400-ctrl-if";
+				interface-type = "ace";
+				reg = <0x4000 0x1000>;
+			};
+
+			cci_control2: slave-if@5000 {
+				compatible = "arm,cci-400-ctrl-if";
+				interface-type = "ace";
+				reg = <0x5000 0x1000>;
+			};
+
+			pmu@9000 {
+				compatible = "arm,cci-400-pmu,r1";
+				reg = <0x9000 0x5000>;
+				interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
+					     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
+					     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>,
+					     <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>,
+					     <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+			};
+		};
+
 		uart0: serial@11002000 {
 			compatible = "mediatek,mt6795-uart",
 				     "mediatek,mt6577-uart";
-- 
2.35.1


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

* [PATCH v2 09/10] arm64: dts: mediatek: mt6795: Add pinctrl controller node
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
                   ` (7 preceding siblings ...)
  2022-06-09 11:23 ` [PATCH v2 08/10] arm64: dts: mediatek: mt6795: Add ARM CCI-400 node and assign to CPUs AngeloGioacchino Del Regno
@ 2022-06-09 11:23 ` AngeloGioacchino Del Regno
  2022-06-09 11:23 ` [PATCH v2 10/10] arm64: dts: mediatek: mt6795: Specify interrupts for vGIC AngeloGioacchino Del Regno
  2022-06-22 15:26 ` [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 Matthias Brugger
  10 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:23 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

Add a node for the pinctrl controller found on MT6795 but without
configuration for any pin, as that's expected to be done in the
machine-specific devicetrees.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index db1f24b3b9a9..f52800e287ab 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -13,6 +13,7 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/pinctrl/mt6795-pinfunc.h>
 
 / {
 	compatible = "mediatek,mt6795";
@@ -198,6 +199,19 @@ soc {
 		compatible = "simple-bus";
 		ranges;
 
+		pio: pinctrl@10005000 {
+			compatible = "mediatek,mt6795-pinctrl";
+			reg = <0 0x10005000 0 0x1000>, <0 0x1000b000 0 0x1000>;
+			reg-names = "base", "eint";
+			interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&pio 0 0 196>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+		};
+
 		watchdog: watchdog@10007000 {
 			compatible = "mediatek,mt6795-wdt";
 			reg = <0 0x10007000 0 0x100>;
-- 
2.35.1


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

* [PATCH v2 10/10] arm64: dts: mediatek: mt6795: Specify interrupts for vGIC
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
                   ` (8 preceding siblings ...)
  2022-06-09 11:23 ` [PATCH v2 09/10] arm64: dts: mediatek: mt6795: Add pinctrl controller node AngeloGioacchino Del Regno
@ 2022-06-09 11:23 ` AngeloGioacchino Del Regno
  2022-06-22 15:26 ` [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 Matthias Brugger
  10 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-09 11:23 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, devicetree,
	linux-arm-kernel, linux-mediatek, linux-kernel, konrad.dybcio,
	marijn.suijten, martin.botka, ~postmarketos/upstreaming,
	phone-devel, paul.bouchara, kernel, AngeloGioacchino Del Regno

Add the maintenance interrupt for GIC-400.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt6795.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt6795.dtsi b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
index f52800e287ab..d3bce9429e9b 100644
--- a/arch/arm64/boot/dts/mediatek/mt6795.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt6795.dtsi
@@ -246,6 +246,8 @@ gic: interrupt-controller@10221000 {
 			      <0 0x10222000 0 0x2000>,
 			      <0 0x10224000 0 0x2000>,
 			      <0 0x10226000 0 0x2000>;
+			interrupts = <GIC_PPI 9
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
 		};
 
 		cci: cci@10390000 {
-- 
2.35.1


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

* Re: [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1
  2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
                   ` (9 preceding siblings ...)
  2022-06-09 11:23 ` [PATCH v2 10/10] arm64: dts: mediatek: mt6795: Specify interrupts for vGIC AngeloGioacchino Del Regno
@ 2022-06-22 15:26 ` Matthias Brugger
  10 siblings, 0 replies; 12+ messages in thread
From: Matthias Brugger @ 2022-06-22 15:26 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, robh+dt
  Cc: krzysztof.kozlowski+dt, devicetree, linux-arm-kernel,
	linux-mediatek, linux-kernel, konrad.dybcio, marijn.suijten,
	martin.botka, ~postmarketos/upstreaming, phone-devel,
	paul.bouchara, kernel



On 09/06/2022 13:22, AngeloGioacchino Del Regno wrote:
> In an effort to give some love to the apparently forgotten MT6795 SoC,
> I am upstreaming more components that are necessary to support platforms
> powered by this one apart from a simple boot to serial console.
> 
> This series modernizes the devicetree of the MT6795 SoC and adds a
> couple of nodes that are supported by this SoC.
> 
> In my local tree I have much more than that (including the dts for
> that Xperia M5 smartphone that I always mention...), but I decided
> to push the devicetree commits in multiple parts, as to get these
> in sooner than later because that reduces my delta, and this makes
> upstreaming a bit easier, especially when having to rebase things
> around, which happens a lot.
> 
> So, this series *does NOT* depends on any of the other series that
> I've pushed and is mergeable in parallel.

Applied, thanks!

> 
> Tested on a MT6795 Sony Xperia M5 (codename "Holly") smartphone.
> 
> Changes in v2:
>   - Split fixed-clocks addition/removal patch for readability
>   - Added patches for pinctrl controller node and vGIC interrupt
> 
> AngeloGioacchino Del Regno (10):
>    arm64: dts: mediatek: mt6795: Create soc bus node and move mmio
>      devices
>    arm64: dts: mediatek: mt6795: Add cpu-map and L2 cache
>    arm64: dts: mediatek: mt6795: Add Cortex A53 PMU nodes
>    arm64: dts: mediatek: mt6795: Add watchdog node to avoid timeouts
>    arm64: dts: mediatek: mt6795: Add fixed clocks for 32kHz and 26MHz XOs
>    arm64: dts: mediatek: mt6795: Remove incorrect fixed-clocks
>    arm64: dts: mediatek: mt6795: Add general purpose timer node
>    arm64: dts: mediatek: mt6795: Add ARM CCI-400 node and assign to CPUs
>    arm64: dts: mediatek: mt6795: Add pinctrl controller node
>    arm64: dts: mediatek: mt6795: Specify interrupts for vGIC
> 
>   arch/arm64/boot/dts/mediatek/mt6795.dtsi | 260 ++++++++++++++++++-----
>   1 file changed, 205 insertions(+), 55 deletions(-)
> 

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

end of thread, other threads:[~2022-06-22 15:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 11:22 [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 AngeloGioacchino Del Regno
2022-06-09 11:22 ` [PATCH v2 01/10] arm64: dts: mediatek: mt6795: Create soc bus node and move mmio devices AngeloGioacchino Del Regno
2022-06-09 11:22 ` [PATCH v2 02/10] arm64: dts: mediatek: mt6795: Add cpu-map and L2 cache AngeloGioacchino Del Regno
2022-06-09 11:22 ` [PATCH v2 03/10] arm64: dts: mediatek: mt6795: Add Cortex A53 PMU nodes AngeloGioacchino Del Regno
2022-06-09 11:22 ` [PATCH v2 04/10] arm64: dts: mediatek: mt6795: Add watchdog node to avoid timeouts AngeloGioacchino Del Regno
2022-06-09 11:22 ` [PATCH v2 05/10] arm64: dts: mediatek: mt6795: Add fixed clocks for 32kHz and 26MHz XOs AngeloGioacchino Del Regno
2022-06-09 11:22 ` [PATCH v2 06/10] arm64: dts: mediatek: mt6795: Remove incorrect fixed-clocks AngeloGioacchino Del Regno
2022-06-09 11:23 ` [PATCH v2 07/10] arm64: dts: mediatek: mt6795: Add general purpose timer node AngeloGioacchino Del Regno
2022-06-09 11:23 ` [PATCH v2 08/10] arm64: dts: mediatek: mt6795: Add ARM CCI-400 node and assign to CPUs AngeloGioacchino Del Regno
2022-06-09 11:23 ` [PATCH v2 09/10] arm64: dts: mediatek: mt6795: Add pinctrl controller node AngeloGioacchino Del Regno
2022-06-09 11:23 ` [PATCH v2 10/10] arm64: dts: mediatek: mt6795: Specify interrupts for vGIC AngeloGioacchino Del Regno
2022-06-22 15:26 ` [PATCH v2 00/10] MediaTek Helio X10 MT6795 - Devicetree, part 1 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).