linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND 0/6] Add IOMMU support to MT8365 SoC
@ 2023-03-29  9:52 Alexandre Mergnat
  2023-03-29  9:52 ` [PATCH RESEND 1/6] dt-bindings: memory-controllers: mediatek,smi-common: add mt8365 Alexandre Mergnat
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Alexandre Mergnat @ 2023-03-29  9:52 UTC (permalink / raw)
  To: Yong Wu, Krzysztof Kozlowski, Rob Herring, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel,
	Alexandre Mergnat

This commits are based on the Fabien Parent <fparent@baylibre.com> work.

The purpose of this series is to add the following HWs / IPs support for
the MT8365 SoC:
- System Power Manager
- MultiMedia Memory Management Unit "M4U" (IOMMU)
  - Smart Multimedia Interface "SMI"
    - Local arbiter "LARB"

This series depends to two others which add power support for MT8365 SoC
[1] [2].

Regards,
Alex

[1]: https://lore.kernel.org/all/20230203-evk-board-support-v2-0-6ec7cdb10ccf@baylibre.com/
[2]: https://lore.kernel.org/lkml/20230105170735.1637416-1-msp@baylibre.com/

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
Alexandre Mergnat (6):
      dt-bindings: memory-controllers: mediatek,smi-common: add mt8365
      dt-bindings: memory-controllers: mediatek,smi-larb: add mt8365
      arm64: dts: mediatek: add power domain support for mt8365 SoC
      arm64: dts: mediatek: add smi support for mt8365 SoC
      arm64: dts: mediatek: add larb support for mt8365 SoC
      arm64: dts: mediatek: add iommu support for mt8365 SoC

 .../memory-controllers/mediatek,smi-common.yaml    |   4 +
 .../memory-controllers/mediatek,smi-larb.yaml      |   4 +
 arch/arm64/boot/dts/mediatek/mt8365.dtsi           | 211 +++++++++++++++++++++
 3 files changed, 219 insertions(+)
---
base-commit: 1db7fc94e6e116f43f7bf3adb33407f21bc29fd9
change-id: 20230207-iommu-support-5e620926e42e

Best regards,
-- 
Alexandre Mergnat <amergnat@baylibre.com>


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

* [PATCH RESEND 1/6] dt-bindings: memory-controllers: mediatek,smi-common: add mt8365
  2023-03-29  9:52 [PATCH RESEND 0/6] Add IOMMU support to MT8365 SoC Alexandre Mergnat
@ 2023-03-29  9:52 ` Alexandre Mergnat
  2023-03-29 10:41   ` Matthias Brugger
  2023-03-30  1:53   ` Yong Wu (吴勇)
  2023-03-29  9:52 ` [PATCH RESEND 2/6] dt-bindings: memory-controllers: mediatek,smi-larb: " Alexandre Mergnat
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 15+ messages in thread
From: Alexandre Mergnat @ 2023-03-29  9:52 UTC (permalink / raw)
  To: Yong Wu, Krzysztof Kozlowski, Rob Herring, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel,
	Alexandre Mergnat

Add binding description for mediatek,mt8365-smi-common

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
 .../devicetree/bindings/memory-controllers/mediatek,smi-common.yaml   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml
index a8fda30cccbb..d599a190952f 100644
--- a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml
+++ b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml
@@ -49,6 +49,10 @@ properties:
           - const: mediatek,mt7623-smi-common
           - const: mediatek,mt2701-smi-common
 
+      - items:
+          - const: mediatek,mt8365-smi-common
+          - const: mediatek,mt8186-smi-common
+
   reg:
     maxItems: 1
 

-- 
2.25.1


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

* [PATCH RESEND 2/6] dt-bindings: memory-controllers: mediatek,smi-larb: add mt8365
  2023-03-29  9:52 [PATCH RESEND 0/6] Add IOMMU support to MT8365 SoC Alexandre Mergnat
  2023-03-29  9:52 ` [PATCH RESEND 1/6] dt-bindings: memory-controllers: mediatek,smi-common: add mt8365 Alexandre Mergnat
@ 2023-03-29  9:52 ` Alexandre Mergnat
  2023-03-29 10:41   ` Matthias Brugger
  2023-03-29  9:52 ` [PATCH RESEND 3/6] arm64: dts: mediatek: add power domain support for mt8365 SoC Alexandre Mergnat
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Alexandre Mergnat @ 2023-03-29  9:52 UTC (permalink / raw)
  To: Yong Wu, Krzysztof Kozlowski, Rob Herring, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel,
	Alexandre Mergnat

Add binding description for mediatek,mt8365-smi-larb

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
 .../devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml     | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
index 5f4ac3609887..aee7f6cf1300 100644
--- a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
+++ b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
@@ -34,6 +34,10 @@ properties:
           - const: mediatek,mt7623-smi-larb
           - const: mediatek,mt2701-smi-larb
 
+      - items:
+          - const: mediatek,mt8365-smi-larb
+          - const: mediatek,mt8186-smi-larb
+
   reg:
     maxItems: 1
 

-- 
2.25.1


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

* [PATCH RESEND 3/6] arm64: dts: mediatek: add power domain support for mt8365 SoC
  2023-03-29  9:52 [PATCH RESEND 0/6] Add IOMMU support to MT8365 SoC Alexandre Mergnat
  2023-03-29  9:52 ` [PATCH RESEND 1/6] dt-bindings: memory-controllers: mediatek,smi-common: add mt8365 Alexandre Mergnat
  2023-03-29  9:52 ` [PATCH RESEND 2/6] dt-bindings: memory-controllers: mediatek,smi-larb: " Alexandre Mergnat
@ 2023-03-29  9:52 ` Alexandre Mergnat
  2023-03-29 13:36   ` AngeloGioacchino Del Regno
  2023-03-29  9:52 ` [PATCH RESEND 4/6] arm64: dts: mediatek: add smi " Alexandre Mergnat
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Alexandre Mergnat @ 2023-03-29  9:52 UTC (permalink / raw)
  To: Yong Wu, Krzysztof Kozlowski, Rob Herring, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel,
	Alexandre Mergnat

The following power domain are added to the SoC dts:
- MM (MultiMedia)
- CONN (Connectivity)
- MFG (MFlexGraphics)
- Audio
- Cam (Camera)
- DSP (Digital Signal Processor)
- Vdec (Video decoder)
- Venc (Video encoder)
- APU (AI Processor Unit)

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
 arch/arm64/boot/dts/mediatek/mt8365.dtsi | 129 +++++++++++++++++++++++++++++++
 1 file changed, 129 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index b5f5c77f7f84..67b375fe2020 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -9,6 +9,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/phy/phy.h>
+#include <dt-bindings/power/mediatek,mt8365-power.h>
 
 / {
 	compatible = "mediatek,mt8365";
@@ -282,6 +283,115 @@ syscfg_pctl: syscfg-pctl@10005000 {
 			reg = <0 0x10005000 0 0x1000>;
 		};
 
+		scpsys: syscon@10006000 {
+			compatible = "mediatek,mt8365-syscfg", "syscon", "simple-mfd";
+			reg = <0 0x10006000 0 0x1000>;
+			#power-domain-cells = <1>;
+
+			/* System Power Manager */
+			spm: power-controller {
+				compatible = "mediatek,mt8365-power-controller";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				#power-domain-cells = <1>;
+
+				/* power domains of the SoC */
+				power-domain@MT8365_POWER_DOMAIN_MM {
+					reg = <MT8365_POWER_DOMAIN_MM>;
+					clocks = <&topckgen CLK_TOP_MM_SEL>,
+						 <&mmsys CLK_MM_MM_SMI_COMMON>,
+						 <&mmsys CLK_MM_MM_SMI_COMM0>,
+						 <&mmsys CLK_MM_MM_SMI_COMM1>,
+						 <&mmsys CLK_MM_MM_SMI_LARB0>;
+					clock-names = "mm", "mm-0", "mm-1",
+						      "mm-2", "mm-3";
+					#power-domain-cells = <0>;
+					mediatek,infracfg = <&infracfg>;
+					mediatek,infracfg-nao = <&infracfg_nao>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					power-domain@MT8365_POWER_DOMAIN_CAM {
+						reg = <MT8365_POWER_DOMAIN_CAM>;
+						clocks = <&camsys CLK_CAM_LARB2>,
+							 <&camsys CLK_CAM_SENIF>,
+							 <&camsys CLK_CAMSV0>,
+							 <&camsys CLK_CAMSV1>,
+							 <&camsys CLK_CAM_FDVT>,
+							 <&camsys CLK_CAM_WPE>;
+						clock-names = "cam-0", "cam-1",
+							      "cam-2", "cam-3",
+							      "cam-4", "cam-5";
+						#power-domain-cells = <0>;
+						mediatek,infracfg = <&infracfg>;
+					};
+
+					power-domain@MT8365_POWER_DOMAIN_VDEC {
+						reg = <MT8365_POWER_DOMAIN_VDEC>;
+						#power-domain-cells = <0>;
+					};
+
+					power-domain@MT8365_POWER_DOMAIN_VENC {
+						reg = <MT8365_POWER_DOMAIN_VENC>;
+						#power-domain-cells = <0>;
+					};
+
+					power-domain@MT8365_POWER_DOMAIN_APU {
+						reg = <MT8365_POWER_DOMAIN_APU>;
+						clocks = <&infracfg CLK_IFR_APU_AXI>,
+							 <&apu CLK_APU_IPU_CK>,
+							 <&apu CLK_APU_AXI>,
+							 <&apu CLK_APU_JTAG>,
+							 <&apu CLK_APU_IF_CK>,
+							 <&apu CLK_APU_EDMA>,
+							 <&apu CLK_APU_AHB>;
+						clock-names = "apu", "apu-0",
+							      "apu-1", "apu-2",
+							      "apu-3", "apu-4",
+							      "apu-5";
+						#power-domain-cells = <0>;
+						mediatek,infracfg = <&infracfg>;
+					};
+				};
+
+				power-domain@MT8365_POWER_DOMAIN_CONN {
+					reg = <MT8365_POWER_DOMAIN_CONN>;
+					clocks = <&topckgen CLK_TOP_CONN_32K>,
+						 <&topckgen CLK_TOP_CONN_26M>;
+					clock-names = "conn", "conn1";
+					#power-domain-cells = <0>;
+					mediatek,infracfg = <&infracfg>;
+				};
+
+				power-domain@MT8365_POWER_DOMAIN_MFG {
+					reg = <MT8365_POWER_DOMAIN_MFG>;
+					clocks = <&topckgen CLK_TOP_MFG_SEL>;
+					clock-names = "mfg";
+					#power-domain-cells = <0>;
+					mediatek,infracfg = <&infracfg>;
+				};
+
+				power-domain@MT8365_POWER_DOMAIN_AUDIO {
+					reg = <MT8365_POWER_DOMAIN_AUDIO>;
+					clocks = <&topckgen CLK_TOP_AUD_INTBUS_SEL>,
+						 <&infracfg CLK_IFR_AUDIO>,
+						 <&infracfg CLK_IFR_AUD_26M_BK>;
+					clock-names = "audio", "audio1", "audio2";
+					#power-domain-cells = <0>;
+					mediatek,infracfg = <&infracfg>;
+				};
+
+				power-domain@MT8365_POWER_DOMAIN_DSP {
+					reg = <MT8365_POWER_DOMAIN_DSP>;
+					clocks = <&topckgen CLK_TOP_DSP_SEL>,
+						 <&topckgen CLK_TOP_DSP_26M>;
+					clock-names = "dsp", "dsp1";
+					#power-domain-cells = <0>;
+					mediatek,infracfg = <&infracfg>;
+				};
+			};
+		};
+
 		watchdog: watchdog@10007000 {
 			compatible = "mediatek,mt8365-wdt",
 				     "mediatek,mt6589-wdt";
@@ -592,6 +702,25 @@ u2port1: usb-phy@1000 {
 				#phy-cells = <1>;
 			};
 		};
+
+		mmsys: syscon@14000000 {
+			compatible = "mediatek,mt8365-mmsys", "syscon";
+			reg = <0 0x14000000 0 0x1000>;
+			#clock-cells = <1>;
+		};
+
+		camsys: syscon@15000000 {
+			compatible = "mediatek,mt8365-imgsys", "syscon";
+			reg = <0 0x15000000 0 0x1000>;
+			#clock-cells = <1>;
+		};
+
+		apu: syscon@19020000 {
+			compatible = "mediatek,mt8365-apu", "syscon";
+			reg = <0 0x19020000 0 0x1000>;
+			#clock-cells = <1>;
+		};
+
 	};
 
 	timer {

-- 
2.25.1


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

* [PATCH RESEND 4/6] arm64: dts: mediatek: add smi support for mt8365 SoC
  2023-03-29  9:52 [PATCH RESEND 0/6] Add IOMMU support to MT8365 SoC Alexandre Mergnat
                   ` (2 preceding siblings ...)
  2023-03-29  9:52 ` [PATCH RESEND 3/6] arm64: dts: mediatek: add power domain support for mt8365 SoC Alexandre Mergnat
@ 2023-03-29  9:52 ` Alexandre Mergnat
  2023-03-29 13:36   ` AngeloGioacchino Del Regno
  2023-03-29  9:52 ` [PATCH RESEND 5/6] arm64: dts: mediatek: add larb " Alexandre Mergnat
  2023-03-29  9:52 ` [PATCH RESEND 6/6] arm64: dts: mediatek: add iommu " Alexandre Mergnat
  5 siblings, 1 reply; 15+ messages in thread
From: Alexandre Mergnat @ 2023-03-29  9:52 UTC (permalink / raw)
  To: Yong Wu, Krzysztof Kozlowski, Rob Herring, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel,
	Alexandre Mergnat

Smart Multimedia Interface (SMI) local arbiter does the arbitration for
memory requests from multi-media engines. Add SMI in the MT8365 DTS will allow
to add local ARBiter (LARB), use by IOMMU.

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
 arch/arm64/boot/dts/mediatek/mt8365.dtsi | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index 67b375fe2020..61333800ff4a 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -324,16 +324,19 @@ power-domain@MT8365_POWER_DOMAIN_CAM {
 							      "cam-4", "cam-5";
 						#power-domain-cells = <0>;
 						mediatek,infracfg = <&infracfg>;
+						mediatek,smi = <&smi_common>;
 					};
 
 					power-domain@MT8365_POWER_DOMAIN_VDEC {
 						reg = <MT8365_POWER_DOMAIN_VDEC>;
 						#power-domain-cells = <0>;
+						mediatek,smi = <&smi_common>;
 					};
 
 					power-domain@MT8365_POWER_DOMAIN_VENC {
 						reg = <MT8365_POWER_DOMAIN_VENC>;
 						#power-domain-cells = <0>;
+						mediatek,smi = <&smi_common>;
 					};
 
 					power-domain@MT8365_POWER_DOMAIN_APU {
@@ -351,6 +354,7 @@ power-domain@MT8365_POWER_DOMAIN_APU {
 							      "apu-5";
 						#power-domain-cells = <0>;
 						mediatek,infracfg = <&infracfg>;
+						mediatek,smi = <&smi_common>;
 					};
 				};
 
@@ -709,6 +713,18 @@ mmsys: syscon@14000000 {
 			#clock-cells = <1>;
 		};
 
+		smi_common: smi@14002000 {
+			compatible = "mediatek,mt8365-smi-common",
+				     "mediatek,mt8186-smi-common";
+			reg = <0 0x14002000 0 0x1000>;
+			clocks = <&mmsys CLK_MM_MM_SMI_COMMON>,
+				 <&mmsys CLK_MM_MM_SMI_COMMON>,
+				 <&mmsys CLK_MM_MM_SMI_COMM0>,
+				 <&mmsys CLK_MM_MM_SMI_COMM1>;
+			clock-names = "apb", "smi", "gals0", "gals1";
+			power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+		};
+
 		camsys: syscon@15000000 {
 			compatible = "mediatek,mt8365-imgsys", "syscon";
 			reg = <0 0x15000000 0 0x1000>;
@@ -720,7 +736,6 @@ apu: syscon@19020000 {
 			reg = <0 0x19020000 0 0x1000>;
 			#clock-cells = <1>;
 		};
-
 	};
 
 	timer {

-- 
2.25.1


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

* [PATCH RESEND 5/6] arm64: dts: mediatek: add larb support for mt8365 SoC
  2023-03-29  9:52 [PATCH RESEND 0/6] Add IOMMU support to MT8365 SoC Alexandre Mergnat
                   ` (3 preceding siblings ...)
  2023-03-29  9:52 ` [PATCH RESEND 4/6] arm64: dts: mediatek: add smi " Alexandre Mergnat
@ 2023-03-29  9:52 ` Alexandre Mergnat
  2023-03-29 13:37   ` AngeloGioacchino Del Regno
  2023-03-29  9:52 ` [PATCH RESEND 6/6] arm64: dts: mediatek: add iommu " Alexandre Mergnat
  5 siblings, 1 reply; 15+ messages in thread
From: Alexandre Mergnat @ 2023-03-29  9:52 UTC (permalink / raw)
  To: Yong Wu, Krzysztof Kozlowski, Rob Herring, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel,
	Alexandre Mergnat

Local arbiter (LARB) is a component of Smart Multimedia Interface (SMI),
used to help the memory management (IOMMU).
This patch add 4 LARBs and 2 clocks for the larb1 and larb3 support.

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
 arch/arm64/boot/dts/mediatek/mt8365.dtsi | 59 ++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index 61333800ff4a..db0b897f58bb 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -725,12 +725,71 @@ smi_common: smi@14002000 {
 			power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
 		};
 
+		larb0: larb@14003000 {
+			compatible = "mediatek,mt8365-smi-larb",
+				     "mediatek,mt8186-smi-larb";
+			reg = <0 0x14003000 0 0x1000>;
+			mediatek,smi = <&smi_common>;
+			clocks = <&mmsys CLK_MM_MM_SMI_LARB0>,
+				 <&mmsys CLK_MM_MM_SMI_LARB0>;
+			clock-names = "apb", "smi";
+			power-domains = <&spm MT8365_POWER_DOMAIN_MM>;
+			mediatek,larb-id = <0>;
+		};
+
 		camsys: syscon@15000000 {
 			compatible = "mediatek,mt8365-imgsys", "syscon";
 			reg = <0 0x15000000 0 0x1000>;
 			#clock-cells = <1>;
 		};
 
+		larb2: larb@15001000 {
+			compatible = "mediatek,mt8365-smi-larb",
+				     "mediatek,mt8186-smi-larb";
+			reg = <0 0x15001000 0 0x1000>;
+			mediatek,smi = <&smi_common>;
+			clocks = <&mmsys CLK_MM_MM_SMI_IMG>,
+				 <&camsys CLK_CAM_LARB2>;
+			clock-names = "apb", "smi";
+			power-domains = <&spm MT8365_POWER_DOMAIN_CAM>;
+			mediatek,larb-id = <2>;
+		};
+
+		vdecsys: syscon@16000000 {
+			compatible = "mediatek,mt8365-vdecsys", "syscon";
+			reg = <0 0x16000000 0 0x1000>;
+			#clock-cells = <1>;
+		};
+
+		larb3: larb@16010000 {
+			compatible = "mediatek,mt8365-smi-larb",
+				     "mediatek,mt8186-smi-larb";
+			reg = <0 0x16010000 0 0x1000>;
+			mediatek,smi = <&smi_common>;
+			clocks = <&vdecsys CLK_VDEC_LARB1>,
+				 <&vdecsys CLK_VDEC_LARB1>;
+			clock-names = "apb", "smi";
+			power-domains = <&spm MT8365_POWER_DOMAIN_VDEC>;
+			mediatek,larb-id = <3>;
+		};
+
+		vencsys: syscon@17000000 {
+			compatible = "mediatek,mt8365-vencsys", "syscon";
+			reg = <0 0x17000000 0 0x1000>;
+			#clock-cells = <1>;
+		};
+
+		larb1: larb@17010000 {
+			compatible = "mediatek,mt8365-smi-larb",
+				     "mediatek,mt8186-smi-larb";
+			reg = <0 0x17010000 0 0x1000>;
+			mediatek,smi = <&smi_common>;
+			clocks = <&vencsys CLK_VENC>, <&vencsys CLK_VENC>;
+			clock-names = "apb", "smi";
+			power-domains = <&spm MT8365_POWER_DOMAIN_VENC>;
+			mediatek,larb-id = <1>;
+		};
+
 		apu: syscon@19020000 {
 			compatible = "mediatek,mt8365-apu", "syscon";
 			reg = <0 0x19020000 0 0x1000>;

-- 
2.25.1


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

* [PATCH RESEND 6/6] arm64: dts: mediatek: add iommu support for mt8365 SoC
  2023-03-29  9:52 [PATCH RESEND 0/6] Add IOMMU support to MT8365 SoC Alexandre Mergnat
                   ` (4 preceding siblings ...)
  2023-03-29  9:52 ` [PATCH RESEND 5/6] arm64: dts: mediatek: add larb " Alexandre Mergnat
@ 2023-03-29  9:52 ` Alexandre Mergnat
  2023-03-29 13:37   ` AngeloGioacchino Del Regno
  2023-03-30  1:52   ` Yong Wu (吴勇)
  5 siblings, 2 replies; 15+ messages in thread
From: Alexandre Mergnat @ 2023-03-29  9:52 UTC (permalink / raw)
  To: Yong Wu, Krzysztof Kozlowski, Rob Herring, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel,
	Alexandre Mergnat

Add iommu support in the SoC DTS using the 4 local arbiters (LARBs)

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
 arch/arm64/boot/dts/mediatek/mt8365.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index db0b897f58bb..c713471c59dc 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -456,6 +456,14 @@ sysirq: interrupt-controller@10200a80 {
 			reg = <0 0x10200a80 0 0x20>;
 		};
 
+		iommu: iommu@10205000 {
+			compatible = "mediatek,mt8365-m4u";
+			reg = <0 0x10205000 0 0x1000>;
+			interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_LOW>;
+			mediatek,larbs = <&larb0>, <&larb1>, <&larb2>, <&larb3>;
+			#iommu-cells = <1>;
+		};
+
 		infracfg_nao: infracfg@1020e000 {
 			compatible = "mediatek,mt8365-infracfg", "syscon";
 			reg = <0 0x1020e000 0 0x1000>;

-- 
2.25.1


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

* Re: [PATCH RESEND 1/6] dt-bindings: memory-controllers: mediatek,smi-common: add mt8365
  2023-03-29  9:52 ` [PATCH RESEND 1/6] dt-bindings: memory-controllers: mediatek,smi-common: add mt8365 Alexandre Mergnat
@ 2023-03-29 10:41   ` Matthias Brugger
  2023-03-30  1:53   ` Yong Wu (吴勇)
  1 sibling, 0 replies; 15+ messages in thread
From: Matthias Brugger @ 2023-03-29 10:41 UTC (permalink / raw)
  To: Alexandre Mergnat, Yong Wu, Krzysztof Kozlowski, Rob Herring,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel



On 3/29/23 11:52, Alexandre Mergnat wrote:
> Add binding description for mediatek,mt8365-smi-common
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   .../devicetree/bindings/memory-controllers/mediatek,smi-common.yaml   | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml
> index a8fda30cccbb..d599a190952f 100644
> --- a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml
> +++ b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml
> @@ -49,6 +49,10 @@ properties:
>             - const: mediatek,mt7623-smi-common
>             - const: mediatek,mt2701-smi-common
>   
> +      - items:
> +          - const: mediatek,mt8365-smi-common
> +          - const: mediatek,mt8186-smi-common
> +
>     reg:
>       maxItems: 1
>   
> 

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

* Re: [PATCH RESEND 2/6] dt-bindings: memory-controllers: mediatek,smi-larb: add mt8365
  2023-03-29  9:52 ` [PATCH RESEND 2/6] dt-bindings: memory-controllers: mediatek,smi-larb: " Alexandre Mergnat
@ 2023-03-29 10:41   ` Matthias Brugger
  0 siblings, 0 replies; 15+ messages in thread
From: Matthias Brugger @ 2023-03-29 10:41 UTC (permalink / raw)
  To: Alexandre Mergnat, Yong Wu, Krzysztof Kozlowski, Rob Herring,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel



On 3/29/23 11:52, Alexandre Mergnat wrote:
> Add binding description for mediatek,mt8365-smi-larb
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>

Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

> ---
>   .../devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml     | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
> index 5f4ac3609887..aee7f6cf1300 100644
> --- a/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
> +++ b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
> @@ -34,6 +34,10 @@ properties:
>             - const: mediatek,mt7623-smi-larb
>             - const: mediatek,mt2701-smi-larb
>   
> +      - items:
> +          - const: mediatek,mt8365-smi-larb
> +          - const: mediatek,mt8186-smi-larb
> +
>     reg:
>       maxItems: 1
>   
> 

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

* Re: [PATCH RESEND 3/6] arm64: dts: mediatek: add power domain support for mt8365 SoC
  2023-03-29  9:52 ` [PATCH RESEND 3/6] arm64: dts: mediatek: add power domain support for mt8365 SoC Alexandre Mergnat
@ 2023-03-29 13:36   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 15+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-03-29 13:36 UTC (permalink / raw)
  To: Alexandre Mergnat, Yong Wu, Krzysztof Kozlowski, Rob Herring,
	Matthias Brugger, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel

Il 29/03/23 11:52, Alexandre Mergnat ha scritto:
> The following power domain are added to the SoC dts:
> - MM (MultiMedia)
> - CONN (Connectivity)
> - MFG (MFlexGraphics)
> - Audio
> - Cam (Camera)
> - DSP (Digital Signal Processor)
> - Vdec (Video decoder)
> - Venc (Video encoder)
> - APU (AI Processor Unit)
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
>   arch/arm64/boot/dts/mediatek/mt8365.dtsi | 129 +++++++++++++++++++++++++++++++
>   1 file changed, 129 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> index b5f5c77f7f84..67b375fe2020 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> @@ -9,6 +9,7 @@

..snip..

> +
>   		watchdog: watchdog@10007000 {
>   			compatible = "mediatek,mt8365-wdt",
>   				     "mediatek,mt6589-wdt";
> @@ -592,6 +702,25 @@ u2port1: usb-phy@1000 {
>   				#phy-cells = <1>;
>   			};
>   		};
> +
> +		mmsys: syscon@14000000 {

These are not power domains... either introduce them in a different commit
or at least please mention the addition in the commit title/description.

Personally, I would split that addition in a different commit, explaining
what mmsys, camsys and apu clocks are ;-)

Regards,
Angelo


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

* Re: [PATCH RESEND 4/6] arm64: dts: mediatek: add smi support for mt8365 SoC
  2023-03-29  9:52 ` [PATCH RESEND 4/6] arm64: dts: mediatek: add smi " Alexandre Mergnat
@ 2023-03-29 13:36   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 15+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-03-29 13:36 UTC (permalink / raw)
  To: Alexandre Mergnat, Yong Wu, Krzysztof Kozlowski, Rob Herring,
	Matthias Brugger, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel

Il 29/03/23 11:52, Alexandre Mergnat ha scritto:
> Smart Multimedia Interface (SMI) local arbiter does the arbitration for
> memory requests from multi-media engines. Add SMI in the MT8365 DTS will allow
> to add local ARBiter (LARB), use by IOMMU.
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



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

* Re: [PATCH RESEND 5/6] arm64: dts: mediatek: add larb support for mt8365 SoC
  2023-03-29  9:52 ` [PATCH RESEND 5/6] arm64: dts: mediatek: add larb " Alexandre Mergnat
@ 2023-03-29 13:37   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 15+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-03-29 13:37 UTC (permalink / raw)
  To: Alexandre Mergnat, Yong Wu, Krzysztof Kozlowski, Rob Herring,
	Matthias Brugger, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel

Il 29/03/23 11:52, Alexandre Mergnat ha scritto:
> Local arbiter (LARB) is a component of Smart Multimedia Interface (SMI),
> used to help the memory management (IOMMU).
> This patch add 4 LARBs and 2 clocks for the larb1 and larb3 support.
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


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

* Re: [PATCH RESEND 6/6] arm64: dts: mediatek: add iommu support for mt8365 SoC
  2023-03-29  9:52 ` [PATCH RESEND 6/6] arm64: dts: mediatek: add iommu " Alexandre Mergnat
@ 2023-03-29 13:37   ` AngeloGioacchino Del Regno
  2023-03-30  1:52   ` Yong Wu (吴勇)
  1 sibling, 0 replies; 15+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-03-29 13:37 UTC (permalink / raw)
  To: Alexandre Mergnat, Yong Wu, Krzysztof Kozlowski, Rob Herring,
	Matthias Brugger, Krzysztof Kozlowski
  Cc: linux-mediatek, linux-kernel, devicetree, linux-arm-kernel

Il 29/03/23 11:52, Alexandre Mergnat ha scritto:
> Add iommu support in the SoC DTS using the 4 local arbiters (LARBs)
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>




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

* Re: [PATCH RESEND 6/6] arm64: dts: mediatek: add iommu support for mt8365 SoC
  2023-03-29  9:52 ` [PATCH RESEND 6/6] arm64: dts: mediatek: add iommu " Alexandre Mergnat
  2023-03-29 13:37   ` AngeloGioacchino Del Regno
@ 2023-03-30  1:52   ` Yong Wu (吴勇)
  1 sibling, 0 replies; 15+ messages in thread
From: Yong Wu (吴勇) @ 2023-03-30  1:52 UTC (permalink / raw)
  To: amergnat, matthias.bgg, krzysztof.kozlowski,
	angelogioacchino.delregno, robh+dt, krzysztof.kozlowski+dt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, devicetree

On Wed, 2023-03-29 at 11:52 +0200, Alexandre Mergnat wrote:
> 
> Add iommu support in the SoC DTS using the 4 local arbiters (LARBs)
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>

Reviewed-by: Yong Wu <yong.wu@mediatek.com>

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

* Re: [PATCH RESEND 1/6] dt-bindings: memory-controllers: mediatek,smi-common: add mt8365
  2023-03-29  9:52 ` [PATCH RESEND 1/6] dt-bindings: memory-controllers: mediatek,smi-common: add mt8365 Alexandre Mergnat
  2023-03-29 10:41   ` Matthias Brugger
@ 2023-03-30  1:53   ` Yong Wu (吴勇)
  1 sibling, 0 replies; 15+ messages in thread
From: Yong Wu (吴勇) @ 2023-03-30  1:53 UTC (permalink / raw)
  To: amergnat, matthias.bgg, krzysztof.kozlowski,
	angelogioacchino.delregno, robh+dt, krzysztof.kozlowski+dt
  Cc: linux-arm-kernel, linux-kernel, linux-mediatek, devicetree

On Wed, 2023-03-29 at 11:52 +0200, Alexandre Mergnat wrote:
> 
> Add binding description for mediatek,mt8365-smi-common
> 
> Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
> ---
>  .../devicetree/bindings/memory-controllers/mediatek,smi-
> common.yaml   | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/memory-
> controllers/mediatek,smi-common.yaml
> b/Documentation/devicetree/bindings/memory-controllers/mediatek,smi-
> common.yaml
> index a8fda30cccbb..d599a190952f 100644
> --- a/Documentation/devicetree/bindings/memory-
> controllers/mediatek,smi-common.yaml
> +++ b/Documentation/devicetree/bindings/memory-
> controllers/mediatek,smi-common.yaml
> @@ -49,6 +49,10 @@ properties:
>            - const: mediatek,mt7623-smi-common
>            - const: mediatek,mt2701-smi-common
> 
> +      - items:
> +          - const: mediatek,mt8365-smi-common
> +          - const: mediatek,mt8186-smi-common
> +

mt8365 is not same with mt8186.

From the code, the bus_sel for mt8186 is:
.bus_sel  = F_MMU1_LARB(1) | F_MMU1_LARB(4) | F_MMU1_LARB(7),

the bus_sel for mt8365 is:
.bus_sel  = F_MMU1_LARB(2) | F_MMU1_LARB(4),

I guess we should add a independent "mediatek,mt8365-smi-common".

>    reg:
>      maxItems: 1
> 
> 
> --
> 2.25.1
> 

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

end of thread, other threads:[~2023-03-30  1:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29  9:52 [PATCH RESEND 0/6] Add IOMMU support to MT8365 SoC Alexandre Mergnat
2023-03-29  9:52 ` [PATCH RESEND 1/6] dt-bindings: memory-controllers: mediatek,smi-common: add mt8365 Alexandre Mergnat
2023-03-29 10:41   ` Matthias Brugger
2023-03-30  1:53   ` Yong Wu (吴勇)
2023-03-29  9:52 ` [PATCH RESEND 2/6] dt-bindings: memory-controllers: mediatek,smi-larb: " Alexandre Mergnat
2023-03-29 10:41   ` Matthias Brugger
2023-03-29  9:52 ` [PATCH RESEND 3/6] arm64: dts: mediatek: add power domain support for mt8365 SoC Alexandre Mergnat
2023-03-29 13:36   ` AngeloGioacchino Del Regno
2023-03-29  9:52 ` [PATCH RESEND 4/6] arm64: dts: mediatek: add smi " Alexandre Mergnat
2023-03-29 13:36   ` AngeloGioacchino Del Regno
2023-03-29  9:52 ` [PATCH RESEND 5/6] arm64: dts: mediatek: add larb " Alexandre Mergnat
2023-03-29 13:37   ` AngeloGioacchino Del Regno
2023-03-29  9:52 ` [PATCH RESEND 6/6] arm64: dts: mediatek: add iommu " Alexandre Mergnat
2023-03-29 13:37   ` AngeloGioacchino Del Regno
2023-03-30  1:52   ` Yong Wu (吴勇)

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