All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
@ 2023-08-25 11:46 ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-25 11:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, Macpaul Lin,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun, stable

The onboard dram of mt8195-demo board is 8GB.

Cc: stable@vger.kernel.org      # 6.1, 6.4
Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index b2485ddfd33b..ff363ab925e9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -48,7 +48,7 @@
 
 	memory@40000000 {
 		device_type = "memory";
-		reg = <0 0x40000000 0 0x80000000>;
+		reg = <0 0x40000000 0x2 0x00000000>;
 	};
 
 	reserved-memory {
-- 
2.18.0


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

* [PATCH 1/4] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
@ 2023-08-25 11:46 ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-25 11:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, Macpaul Lin,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun, stable

The onboard dram of mt8195-demo board is 8GB.

Cc: stable@vger.kernel.org      # 6.1, 6.4
Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index b2485ddfd33b..ff363ab925e9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -48,7 +48,7 @@
 
 	memory@40000000 {
 		device_type = "memory";
-		reg = <0 0x40000000 0 0x80000000>;
+		reg = <0 0x40000000 0x2 0x00000000>;
 	};
 
 	reserved-memory {
-- 
2.18.0


_______________________________________________
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] 44+ messages in thread

* [PATCH 2/4] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
  2023-08-25 11:46 ` Macpaul Lin
@ 2023-08-25 11:46   ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-25 11:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, Macpaul Lin,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun, stable

The dts file of the MediaTek MT8195 demo board has been updated to include
new reserved memory regions.
These reserved memory regions are:
 - SCP
 - VPU,
 - Sound DMA
 - APU.

These regions are defined with the "shared-dma-pool" compatible property.
In addition, the existing reserved memory regions have been reordered by
their addresses to improve readability and maintainability of the DTS
file.

Cc: stable@vger.kernel.org      # 6.1, 6.4
Fixes: e4a417520101 ("arm64: dts: mediatek: mt8195-demo: fix the memory size of node secmon")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 38 ++++++++++++++++----
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index ff363ab925e9..8aea6f5d72b3 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -56,12 +56,6 @@
 		#size-cells = <2>;
 		ranges;
 
-		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
-		bl31_secmon_reserved: secmon@54600000 {
-			no-map;
-			reg = <0 0x54600000 0x0 0x200000>;
-		};
-
 		/* 12 MiB reserved for OP-TEE (BL32)
 		 * +-----------------------+ 0x43e0_0000
 		 * |      SHMEM 2MiB       |
@@ -75,6 +69,38 @@
 			no-map;
 			reg = <0 0x43200000 0 0x00c00000>;
 		};
+
+		scp_mem: memory@50000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x50000000 0 0x2900000>;
+			no-map;
+		};
+
+		vpu_mem: memory@53000000 {
+			compatible = "shared-dma-pool";
+			size = <0 0x1400000>; /* 20 MB */
+			alignment = <0 0x10000>;
+			reg = <0 0x53000000 0 0x1400000>;
+		};
+
+		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
+		bl31_secmon_mem: memory@54600000 {
+			no-map;
+			reg = <0 0x54600000 0x0 0x200000>;
+		};
+
+		snd_dma_mem: memory@60000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x60000000 0 0x1100000>;
+			no-map;
+		};
+
+		apu_mem: memory@62000000 {
+			compatible = "shared-dma-pool";
+			size = <0 0x1400000>; /* 20 MB */
+			alignment = <0 0x10000>;
+			reg = <0 0x62000000 0 0x1400000>;
+		};
 	};
 };
 
-- 
2.18.0


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

* [PATCH 2/4] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
@ 2023-08-25 11:46   ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-25 11:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, Macpaul Lin,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun, stable

The dts file of the MediaTek MT8195 demo board has been updated to include
new reserved memory regions.
These reserved memory regions are:
 - SCP
 - VPU,
 - Sound DMA
 - APU.

These regions are defined with the "shared-dma-pool" compatible property.
In addition, the existing reserved memory regions have been reordered by
their addresses to improve readability and maintainability of the DTS
file.

Cc: stable@vger.kernel.org      # 6.1, 6.4
Fixes: e4a417520101 ("arm64: dts: mediatek: mt8195-demo: fix the memory size of node secmon")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 38 ++++++++++++++++----
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index ff363ab925e9..8aea6f5d72b3 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -56,12 +56,6 @@
 		#size-cells = <2>;
 		ranges;
 
-		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
-		bl31_secmon_reserved: secmon@54600000 {
-			no-map;
-			reg = <0 0x54600000 0x0 0x200000>;
-		};
-
 		/* 12 MiB reserved for OP-TEE (BL32)
 		 * +-----------------------+ 0x43e0_0000
 		 * |      SHMEM 2MiB       |
@@ -75,6 +69,38 @@
 			no-map;
 			reg = <0 0x43200000 0 0x00c00000>;
 		};
+
+		scp_mem: memory@50000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x50000000 0 0x2900000>;
+			no-map;
+		};
+
+		vpu_mem: memory@53000000 {
+			compatible = "shared-dma-pool";
+			size = <0 0x1400000>; /* 20 MB */
+			alignment = <0 0x10000>;
+			reg = <0 0x53000000 0 0x1400000>;
+		};
+
+		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
+		bl31_secmon_mem: memory@54600000 {
+			no-map;
+			reg = <0 0x54600000 0x0 0x200000>;
+		};
+
+		snd_dma_mem: memory@60000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x60000000 0 0x1100000>;
+			no-map;
+		};
+
+		apu_mem: memory@62000000 {
+			compatible = "shared-dma-pool";
+			size = <0 0x1400000>; /* 20 MB */
+			alignment = <0 0x10000>;
+			reg = <0 0x62000000 0 0x1400000>;
+		};
 	};
 };
 
-- 
2.18.0


_______________________________________________
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] 44+ messages in thread

* [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
  2023-08-25 11:46 ` Macpaul Lin
@ 2023-08-25 11:46   ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-25 11:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, Macpaul Lin,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

MT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
 - charger
 - ADC
 - LED
 - regulators

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++
 1 file changed, 112 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt6360.dtsi

diff --git a/arch/arm64/boot/dts/mediatek/mt6360.dtsi b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
new file mode 100644
index 000000000000..e841f4e5a54b
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
@@ -0,0 +1,112 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2023 MediaTek Inc.
+ */
+
+#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
+
+&mt6360 {
+	interrupt-controller;
+	interrupt-parent = <&pio>;
+	interrupt-names = "IRQB";
+
+	charger {
+		compatible = "mediatek,mt6360-chg";
+		richtek,vinovp-microvolt = <14500000>;
+
+		otg_vbus_regulator: usb-otg-vbus-regulator {
+			regulator-compatible = "usb-otg-vbus";
+			regulator-name = "usb-otg-vbus";
+			regulator-min-microvolt = <4425000>;
+			regulator-max-microvolt = <5825000>;
+		};
+	};
+
+	adc {
+		compatible = "mediatek,mt6360-adc";
+		#io-channel-cells = <1>;
+	};
+
+	led {
+		compatible = "mediatek,mt6360-led";
+	};
+
+	regulator {
+		compatible = "mediatek,mt6360-regulator";
+		LDO_VIN3-supply = <&mt6360_buck2>;
+
+		mt6360_buck1: buck1 {
+			regulator-compatible = "BUCK1";
+			regulator-name = "mt6360,buck1";
+			regulator-min-microvolt = <300000>;
+			regulator-max-microvolt = <1300000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP
+						   MT6360_OPMODE_ULP>;
+		};
+
+		mt6360_buck2: buck2 {
+			regulator-compatible = "BUCK2";
+			regulator-name = "mt6360,buck2";
+			regulator-min-microvolt = <300000>;
+			regulator-max-microvolt = <1300000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP
+						   MT6360_OPMODE_ULP>;
+		};
+
+		mt6360_ldo1: ldo1 {
+			regulator-compatible = "LDO1";
+			regulator-name = "mt6360,ldo1";
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <3600000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo2: ldo2 {
+			regulator-compatible = "LDO2";
+			regulator-name = "mt6360,ldo2";
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <3600000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo3: ldo3 {
+			regulator-compatible = "LDO3";
+			regulator-name = "mt6360,ldo3";
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <3600000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo5: ldo5 {
+			regulator-compatible = "LDO5";
+			regulator-name = "mt6360,ldo5";
+			regulator-min-microvolt = <2700000>;
+			regulator-max-microvolt = <3600000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo6: ldo6 {
+			regulator-compatible = "LDO6";
+			regulator-name = "mt6360,ldo6";
+			regulator-min-microvolt = <500000>;
+			regulator-max-microvolt = <2100000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo7: ldo7 {
+			regulator-compatible = "LDO7";
+			regulator-name = "mt6360,ldo7";
+			regulator-min-microvolt = <500000>;
+			regulator-max-microvolt = <2100000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+	};
+};
-- 
2.18.0


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

* [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
@ 2023-08-25 11:46   ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-25 11:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, Macpaul Lin,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

MT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
 - charger
 - ADC
 - LED
 - regulators

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++
 1 file changed, 112 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt6360.dtsi

diff --git a/arch/arm64/boot/dts/mediatek/mt6360.dtsi b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
new file mode 100644
index 000000000000..e841f4e5a54b
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
@@ -0,0 +1,112 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2023 MediaTek Inc.
+ */
+
+#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
+
+&mt6360 {
+	interrupt-controller;
+	interrupt-parent = <&pio>;
+	interrupt-names = "IRQB";
+
+	charger {
+		compatible = "mediatek,mt6360-chg";
+		richtek,vinovp-microvolt = <14500000>;
+
+		otg_vbus_regulator: usb-otg-vbus-regulator {
+			regulator-compatible = "usb-otg-vbus";
+			regulator-name = "usb-otg-vbus";
+			regulator-min-microvolt = <4425000>;
+			regulator-max-microvolt = <5825000>;
+		};
+	};
+
+	adc {
+		compatible = "mediatek,mt6360-adc";
+		#io-channel-cells = <1>;
+	};
+
+	led {
+		compatible = "mediatek,mt6360-led";
+	};
+
+	regulator {
+		compatible = "mediatek,mt6360-regulator";
+		LDO_VIN3-supply = <&mt6360_buck2>;
+
+		mt6360_buck1: buck1 {
+			regulator-compatible = "BUCK1";
+			regulator-name = "mt6360,buck1";
+			regulator-min-microvolt = <300000>;
+			regulator-max-microvolt = <1300000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP
+						   MT6360_OPMODE_ULP>;
+		};
+
+		mt6360_buck2: buck2 {
+			regulator-compatible = "BUCK2";
+			regulator-name = "mt6360,buck2";
+			regulator-min-microvolt = <300000>;
+			regulator-max-microvolt = <1300000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP
+						   MT6360_OPMODE_ULP>;
+		};
+
+		mt6360_ldo1: ldo1 {
+			regulator-compatible = "LDO1";
+			regulator-name = "mt6360,ldo1";
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <3600000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo2: ldo2 {
+			regulator-compatible = "LDO2";
+			regulator-name = "mt6360,ldo2";
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <3600000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo3: ldo3 {
+			regulator-compatible = "LDO3";
+			regulator-name = "mt6360,ldo3";
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <3600000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo5: ldo5 {
+			regulator-compatible = "LDO5";
+			regulator-name = "mt6360,ldo5";
+			regulator-min-microvolt = <2700000>;
+			regulator-max-microvolt = <3600000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo6: ldo6 {
+			regulator-compatible = "LDO6";
+			regulator-name = "mt6360,ldo6";
+			regulator-min-microvolt = <500000>;
+			regulator-max-microvolt = <2100000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo7: ldo7 {
+			regulator-compatible = "LDO7";
+			regulator-name = "mt6360,ldo7";
+			regulator-min-microvolt = <500000>;
+			regulator-max-microvolt = <2100000>;
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+	};
+};
-- 
2.18.0


_______________________________________________
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] 44+ messages in thread

* [PATCH 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
  2023-08-25 11:46 ` Macpaul Lin
@ 2023-08-25 11:46   ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-25 11:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, Macpaul Lin,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

The dts file for the MediaTek MT8195 demo board has been refactored
to improve the configuration of the MT6360 multi-function PMIC.

The changes include:
 - Addition of the mt6360.dtsi include file, which contains the common
   configuration of the MT6360 for all mt8195 boards.
 - Removal of the direct inclusion of the mt6360-regulator.h file.
 - Removal of the detailed configuration of the MT6360 PMIC since
   the included mt6360.dtsi is used.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 136 ++++++-------------
 1 file changed, 39 insertions(+), 97 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index 8aea6f5d72b3..da1c077c3d9e 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -11,7 +11,6 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
-#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
 
 / {
 	model = "MediaTek MT8195 demo board";
@@ -130,103 +129,9 @@
 	mt6360: pmic@34 {
 		compatible = "mediatek,mt6360";
 		reg = <0x34>;
-		interrupt-controller;
+		pinctrl-0 = <&mt6360_pins>;
+		pinctrl-names = "default";
 		interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>;
-		interrupt-names = "IRQB";
-
-		charger {
-			compatible = "mediatek,mt6360-chg";
-			richtek,vinovp-microvolt = <14500000>;
-
-			otg_vbus_regulator: usb-otg-vbus-regulator {
-				regulator-compatible = "usb-otg-vbus";
-				regulator-name = "usb-otg-vbus";
-				regulator-min-microvolt = <4425000>;
-				regulator-max-microvolt = <5825000>;
-			};
-		};
-
-		regulator {
-			compatible = "mediatek,mt6360-regulator";
-			LDO_VIN3-supply = <&mt6360_buck2>;
-
-			mt6360_buck1: buck1 {
-				regulator-compatible = "BUCK1";
-				regulator-name = "mt6360,buck1";
-				regulator-min-microvolt = <300000>;
-				regulator-max-microvolt = <1300000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP
-							   MT6360_OPMODE_ULP>;
-				regulator-always-on;
-			};
-
-			mt6360_buck2: buck2 {
-				regulator-compatible = "BUCK2";
-				regulator-name = "mt6360,buck2";
-				regulator-min-microvolt = <300000>;
-				regulator-max-microvolt = <1300000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP
-							   MT6360_OPMODE_ULP>;
-				regulator-always-on;
-			};
-
-			mt6360_ldo1: ldo1 {
-				regulator-compatible = "LDO1";
-				regulator-name = "mt6360,ldo1";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo2: ldo2 {
-				regulator-compatible = "LDO2";
-				regulator-name = "mt6360,ldo2";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo3: ldo3 {
-				regulator-compatible = "LDO3";
-				regulator-name = "mt6360,ldo3";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo5: ldo5 {
-				regulator-compatible = "LDO5";
-				regulator-name = "mt6360,ldo5";
-				regulator-min-microvolt = <2700000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo6: ldo6 {
-				regulator-compatible = "LDO6";
-				regulator-name = "mt6360,ldo6";
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <2100000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo7: ldo7 {
-				regulator-compatible = "LDO7";
-				regulator-name = "mt6360,ldo7";
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <2100000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-				regulator-always-on;
-			};
-		};
 	};
 };
 
@@ -300,6 +205,34 @@
 	regulator-always-on;
 };
 
+#include "mt6360.dtsi"
+
+/* For EMI_VDD2 */
+&mt6360_buck1 {
+	regulator-always-on;
+};
+
+/* For EMI_VDDQ */
+&mt6360_buck2 {
+	regulator-always-on;
+};
+
+&mt6360_ldo1 {
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-always-on;
+};
+
+&mt6360_ldo2 {
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+};
+
+/* For EMI_VMDDR_EN */
+&mt6360_ldo7 {
+	regulator-always-on;
+};
+
 &pio {
 	eth_default_pins: eth-default-pins {
 		pins-txd {
@@ -496,6 +429,15 @@
 				 <PINMUX_GPIO103__FUNC_URXD1>;
 		};
 	};
+
+	mt6360_pins: mt6360-pins {
+		pins {
+			pinmux = <PINMUX_GPIO100__FUNC_GPIO100>,
+				 <PINMUX_GPIO101__FUNC_GPIO101>;
+			input-enable;
+			bias-pull-up;
+		};
+	};
 };
 
 
-- 
2.18.0


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

* [PATCH 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
@ 2023-08-25 11:46   ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-25 11:46 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, Macpaul Lin,
	devicetree, linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

The dts file for the MediaTek MT8195 demo board has been refactored
to improve the configuration of the MT6360 multi-function PMIC.

The changes include:
 - Addition of the mt6360.dtsi include file, which contains the common
   configuration of the MT6360 for all mt8195 boards.
 - Removal of the direct inclusion of the mt6360-regulator.h file.
 - Removal of the detailed configuration of the MT6360 PMIC since
   the included mt6360.dtsi is used.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 136 ++++++-------------
 1 file changed, 39 insertions(+), 97 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index 8aea6f5d72b3..da1c077c3d9e 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -11,7 +11,6 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
-#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
 
 / {
 	model = "MediaTek MT8195 demo board";
@@ -130,103 +129,9 @@
 	mt6360: pmic@34 {
 		compatible = "mediatek,mt6360";
 		reg = <0x34>;
-		interrupt-controller;
+		pinctrl-0 = <&mt6360_pins>;
+		pinctrl-names = "default";
 		interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>;
-		interrupt-names = "IRQB";
-
-		charger {
-			compatible = "mediatek,mt6360-chg";
-			richtek,vinovp-microvolt = <14500000>;
-
-			otg_vbus_regulator: usb-otg-vbus-regulator {
-				regulator-compatible = "usb-otg-vbus";
-				regulator-name = "usb-otg-vbus";
-				regulator-min-microvolt = <4425000>;
-				regulator-max-microvolt = <5825000>;
-			};
-		};
-
-		regulator {
-			compatible = "mediatek,mt6360-regulator";
-			LDO_VIN3-supply = <&mt6360_buck2>;
-
-			mt6360_buck1: buck1 {
-				regulator-compatible = "BUCK1";
-				regulator-name = "mt6360,buck1";
-				regulator-min-microvolt = <300000>;
-				regulator-max-microvolt = <1300000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP
-							   MT6360_OPMODE_ULP>;
-				regulator-always-on;
-			};
-
-			mt6360_buck2: buck2 {
-				regulator-compatible = "BUCK2";
-				regulator-name = "mt6360,buck2";
-				regulator-min-microvolt = <300000>;
-				regulator-max-microvolt = <1300000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP
-							   MT6360_OPMODE_ULP>;
-				regulator-always-on;
-			};
-
-			mt6360_ldo1: ldo1 {
-				regulator-compatible = "LDO1";
-				regulator-name = "mt6360,ldo1";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo2: ldo2 {
-				regulator-compatible = "LDO2";
-				regulator-name = "mt6360,ldo2";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo3: ldo3 {
-				regulator-compatible = "LDO3";
-				regulator-name = "mt6360,ldo3";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo5: ldo5 {
-				regulator-compatible = "LDO5";
-				regulator-name = "mt6360,ldo5";
-				regulator-min-microvolt = <2700000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo6: ldo6 {
-				regulator-compatible = "LDO6";
-				regulator-name = "mt6360,ldo6";
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <2100000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo7: ldo7 {
-				regulator-compatible = "LDO7";
-				regulator-name = "mt6360,ldo7";
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <2100000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-				regulator-always-on;
-			};
-		};
 	};
 };
 
@@ -300,6 +205,34 @@
 	regulator-always-on;
 };
 
+#include "mt6360.dtsi"
+
+/* For EMI_VDD2 */
+&mt6360_buck1 {
+	regulator-always-on;
+};
+
+/* For EMI_VDDQ */
+&mt6360_buck2 {
+	regulator-always-on;
+};
+
+&mt6360_ldo1 {
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-always-on;
+};
+
+&mt6360_ldo2 {
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+};
+
+/* For EMI_VMDDR_EN */
+&mt6360_ldo7 {
+	regulator-always-on;
+};
+
 &pio {
 	eth_default_pins: eth-default-pins {
 		pins-txd {
@@ -496,6 +429,15 @@
 				 <PINMUX_GPIO103__FUNC_URXD1>;
 		};
 	};
+
+	mt6360_pins: mt6360-pins {
+		pins {
+			pinmux = <PINMUX_GPIO100__FUNC_GPIO100>,
+				 <PINMUX_GPIO101__FUNC_GPIO101>;
+			input-enable;
+			bias-pull-up;
+		};
+	};
 };
 
 
-- 
2.18.0


_______________________________________________
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] 44+ messages in thread

* Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
  2023-08-25 11:46   ` Macpaul Lin
@ 2023-08-28  4:36     ` Chen-Yu Tsai
  -1 siblings, 0 replies; 44+ messages in thread
From: Chen-Yu Tsai @ 2023-08-28  4:36 UTC (permalink / raw)
  To: Macpaul Lin
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Bear Wang,
	Pablo Sun, Macpaul Lin, Chunfeng Yun

On Fri, Aug 25, 2023 at 7:46 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
>
> MT6360 is the secondary PMIC for MT8195.
> It supports USB Type-C and PD functions.
> Add MT6360 related common nodes which is used for MT8195 platform, includes
>  - charger
>  - ADC
>  - LED
>  - regulators
>
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>  arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++
>  1 file changed, 112 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt6360.dtsi
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt6360.dtsi b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
> new file mode 100644
> index 000000000000..e841f4e5a54b
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
> @@ -0,0 +1,112 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright (C) 2023 MediaTek Inc.
> + */
> +
> +#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
> +
> +&mt6360 {
> +       interrupt-controller;
> +       interrupt-parent = <&pio>;
> +       interrupt-names = "IRQB";
> +
> +       charger {
> +               compatible = "mediatek,mt6360-chg";
> +               richtek,vinovp-microvolt = <14500000>;
> +
> +               otg_vbus_regulator: usb-otg-vbus-regulator {
> +                       regulator-compatible = "usb-otg-vbus";
> +                       regulator-name = "usb-otg-vbus";
> +                       regulator-min-microvolt = <4425000>;
> +                       regulator-max-microvolt = <5825000>;
> +               };
> +       };
> +
> +       adc {
> +               compatible = "mediatek,mt6360-adc";
> +               #io-channel-cells = <1>;
> +       };
> +
> +       led {
> +               compatible = "mediatek,mt6360-led";
> +       };
> +
> +       regulator {
> +               compatible = "mediatek,mt6360-regulator";
> +               LDO_VIN3-supply = <&mt6360_buck2>;
> +
> +               mt6360_buck1: buck1 {
> +                       regulator-compatible = "BUCK1";
> +                       regulator-name = "mt6360,buck1";

Normally there's no need to provide a default name. Any used regulator
should have been named to match the power rail name from the board's
schematics.

> +                       regulator-min-microvolt = <300000>;
> +                       regulator-max-microvolt = <1300000>;

These values correspond to the regulator's range. They make no sense as
regulator constraints. The min/max values are supposed to be the most
restrictive set of voltages of the regulator consumers. If what is fed
by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V
and 1.1V here. If the regulator is unused, then there are no constraints,
and these can be left out.

Just leave them out of the file.

Both comments apply to all the regulators.

ChenYu

> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP
> +                                                  MT6360_OPMODE_ULP>;
> +               };
> +
> +               mt6360_buck2: buck2 {
> +                       regulator-compatible = "BUCK2";
> +                       regulator-name = "mt6360,buck2";
> +                       regulator-min-microvolt = <300000>;
> +                       regulator-max-microvolt = <1300000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP
> +                                                  MT6360_OPMODE_ULP>;
> +               };
> +
> +               mt6360_ldo1: ldo1 {
> +                       regulator-compatible = "LDO1";
> +                       regulator-name = "mt6360,ldo1";
> +                       regulator-min-microvolt = <1200000>;
> +                       regulator-max-microvolt = <3600000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +
> +               mt6360_ldo2: ldo2 {
> +                       regulator-compatible = "LDO2";
> +                       regulator-name = "mt6360,ldo2";
> +                       regulator-min-microvolt = <1200000>;
> +                       regulator-max-microvolt = <3600000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +
> +               mt6360_ldo3: ldo3 {
> +                       regulator-compatible = "LDO3";
> +                       regulator-name = "mt6360,ldo3";
> +                       regulator-min-microvolt = <1200000>;
> +                       regulator-max-microvolt = <3600000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +
> +               mt6360_ldo5: ldo5 {
> +                       regulator-compatible = "LDO5";
> +                       regulator-name = "mt6360,ldo5";
> +                       regulator-min-microvolt = <2700000>;
> +                       regulator-max-microvolt = <3600000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +
> +               mt6360_ldo6: ldo6 {
> +                       regulator-compatible = "LDO6";
> +                       regulator-name = "mt6360,ldo6";
> +                       regulator-min-microvolt = <500000>;
> +                       regulator-max-microvolt = <2100000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +
> +               mt6360_ldo7: ldo7 {
> +                       regulator-compatible = "LDO7";
> +                       regulator-name = "mt6360,ldo7";
> +                       regulator-min-microvolt = <500000>;
> +                       regulator-max-microvolt = <2100000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +       };
> +};
> --
> 2.18.0
>
>

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

* Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
@ 2023-08-28  4:36     ` Chen-Yu Tsai
  0 siblings, 0 replies; 44+ messages in thread
From: Chen-Yu Tsai @ 2023-08-28  4:36 UTC (permalink / raw)
  To: Macpaul Lin
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Bear Wang,
	Pablo Sun, Macpaul Lin, Chunfeng Yun

On Fri, Aug 25, 2023 at 7:46 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
>
> MT6360 is the secondary PMIC for MT8195.
> It supports USB Type-C and PD functions.
> Add MT6360 related common nodes which is used for MT8195 platform, includes
>  - charger
>  - ADC
>  - LED
>  - regulators
>
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>  arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++
>  1 file changed, 112 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt6360.dtsi
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt6360.dtsi b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
> new file mode 100644
> index 000000000000..e841f4e5a54b
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
> @@ -0,0 +1,112 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright (C) 2023 MediaTek Inc.
> + */
> +
> +#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
> +
> +&mt6360 {
> +       interrupt-controller;
> +       interrupt-parent = <&pio>;
> +       interrupt-names = "IRQB";
> +
> +       charger {
> +               compatible = "mediatek,mt6360-chg";
> +               richtek,vinovp-microvolt = <14500000>;
> +
> +               otg_vbus_regulator: usb-otg-vbus-regulator {
> +                       regulator-compatible = "usb-otg-vbus";
> +                       regulator-name = "usb-otg-vbus";
> +                       regulator-min-microvolt = <4425000>;
> +                       regulator-max-microvolt = <5825000>;
> +               };
> +       };
> +
> +       adc {
> +               compatible = "mediatek,mt6360-adc";
> +               #io-channel-cells = <1>;
> +       };
> +
> +       led {
> +               compatible = "mediatek,mt6360-led";
> +       };
> +
> +       regulator {
> +               compatible = "mediatek,mt6360-regulator";
> +               LDO_VIN3-supply = <&mt6360_buck2>;
> +
> +               mt6360_buck1: buck1 {
> +                       regulator-compatible = "BUCK1";
> +                       regulator-name = "mt6360,buck1";

Normally there's no need to provide a default name. Any used regulator
should have been named to match the power rail name from the board's
schematics.

> +                       regulator-min-microvolt = <300000>;
> +                       regulator-max-microvolt = <1300000>;

These values correspond to the regulator's range. They make no sense as
regulator constraints. The min/max values are supposed to be the most
restrictive set of voltages of the regulator consumers. If what is fed
by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V
and 1.1V here. If the regulator is unused, then there are no constraints,
and these can be left out.

Just leave them out of the file.

Both comments apply to all the regulators.

ChenYu

> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP
> +                                                  MT6360_OPMODE_ULP>;
> +               };
> +
> +               mt6360_buck2: buck2 {
> +                       regulator-compatible = "BUCK2";
> +                       regulator-name = "mt6360,buck2";
> +                       regulator-min-microvolt = <300000>;
> +                       regulator-max-microvolt = <1300000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP
> +                                                  MT6360_OPMODE_ULP>;
> +               };
> +
> +               mt6360_ldo1: ldo1 {
> +                       regulator-compatible = "LDO1";
> +                       regulator-name = "mt6360,ldo1";
> +                       regulator-min-microvolt = <1200000>;
> +                       regulator-max-microvolt = <3600000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +
> +               mt6360_ldo2: ldo2 {
> +                       regulator-compatible = "LDO2";
> +                       regulator-name = "mt6360,ldo2";
> +                       regulator-min-microvolt = <1200000>;
> +                       regulator-max-microvolt = <3600000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +
> +               mt6360_ldo3: ldo3 {
> +                       regulator-compatible = "LDO3";
> +                       regulator-name = "mt6360,ldo3";
> +                       regulator-min-microvolt = <1200000>;
> +                       regulator-max-microvolt = <3600000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +
> +               mt6360_ldo5: ldo5 {
> +                       regulator-compatible = "LDO5";
> +                       regulator-name = "mt6360,ldo5";
> +                       regulator-min-microvolt = <2700000>;
> +                       regulator-max-microvolt = <3600000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +
> +               mt6360_ldo6: ldo6 {
> +                       regulator-compatible = "LDO6";
> +                       regulator-name = "mt6360,ldo6";
> +                       regulator-min-microvolt = <500000>;
> +                       regulator-max-microvolt = <2100000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +
> +               mt6360_ldo7: ldo7 {
> +                       regulator-compatible = "LDO7";
> +                       regulator-name = "mt6360,ldo7";
> +                       regulator-min-microvolt = <500000>;
> +                       regulator-max-microvolt = <2100000>;
> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> +                                                  MT6360_OPMODE_LP>;
> +               };
> +       };
> +};
> --
> 2.18.0
>
>

_______________________________________________
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] 44+ messages in thread

* Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
  2023-08-28  4:36     ` Chen-Yu Tsai
@ 2023-08-28  9:59       ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-28  9:59 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Bear Wang,
	Pablo Sun, Macpaul Lin, Chunfeng Yun


On 8/28/23 12:36, Chen-Yu Tsai wrote:
> 	
> 
> External email : Please do not click links or open attachments until you 
> have verified the sender or the content.
> 
> On Fri, Aug 25, 2023 at 7:46 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
>>
>> MT6360 is the secondary PMIC for MT8195.
>> It supports USB Type-C and PD functions.
>> Add MT6360 related common nodes which is used for MT8195 platform, includes
>>  - charger
>>  - ADC
>>  - LED
>>  - regulators
>>
>> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> ---
>>  arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++

[snip..]

>> +       regulator {
>> +               compatible = "mediatek,mt6360-regulator";
>> +               LDO_VIN3-supply = <&mt6360_buck2>;
>> +
>> +               mt6360_buck1: buck1 {
>> +                       regulator-compatible = "BUCK1";
>> +                       regulator-name = "mt6360,buck1";
> 
> Normally there's no need to provide a default name. Any used regulator
> should have been named to match the power rail name from the board's
> schematics.
> 

I have 2 schematics on hand. One is mt8195-demo board and the other is 
genio-1200-evk board. There are 2 PMIC used on these board
with "the same" sub power rail name for "BUCK1~BUCK4". One is mt6315, 
and the other is mt6360.

I've also inspected other dtsi of the regulators, such as mt6357 and 
mt6359. They have regulator nodes with named for their purpose. For the
schematics of mt8195-demo and genio-1200-evk boards, there are no 
explicit usage for "BUCK1~BUCK4" for both mt6135 and mt6360. In order to 
specify the sub power rail for mt6360, MediaTek chooses name like 
"mt6360,buck1" instead of simple name "buck1" for distinguish with 
"buck1" of mt6351.

>> +                       regulator-min-microvolt = <300000>;
>> +                       regulator-max-microvolt = <1300000>;
> 
> These values correspond to the regulator's range. They make no sense as
> regulator constraints. The min/max values are supposed to be the most
> restrictive set of voltages of the regulator consumers. If what is fed
> by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V
> and 1.1V here. If the regulator is unused, then there are no constraints,
> and these can be left out.
> 
> Just leave them out of the file.
> 
> Both comments apply to all the regulators.
> 
> ChenYu

There are some common circuit design for these regulators like mt6359, 
mt6360 and mt6315 used on many products. MediaTek put the most common 
and expected default values in their dtsi. However, some changes still 
need to be applied to derivative boards according to product's 
requirements. The actual value be used will be applied in board's dts 
file to override the default settings in dtsi.

The regulator node "mt6360,ldo6" is not used by mt8195-demo and 
genio-1200-evk. I'll remove it in the next version.
Thanks for the review.

>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP
>> +                                                  MT6360_OPMODE_ULP>;
>> +               };
>> +
>> +               mt6360_buck2: buck2 {
>> +                       regulator-compatible = "BUCK2";
>> +                       regulator-name = "mt6360,buck2";
>> +                       regulator-min-microvolt = <300000>;
>> +                       regulator-max-microvolt = <1300000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP
>> +                                                  MT6360_OPMODE_ULP>;
>> +               };
>> +
>> +               mt6360_ldo1: ldo1 {
>> +                       regulator-compatible = "LDO1";
>> +                       regulator-name = "mt6360,ldo1";
>> +                       regulator-min-microvolt = <1200000>;
>> +                       regulator-max-microvolt = <3600000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +
>> +               mt6360_ldo2: ldo2 {
>> +                       regulator-compatible = "LDO2";
>> +                       regulator-name = "mt6360,ldo2";
>> +                       regulator-min-microvolt = <1200000>;
>> +                       regulator-max-microvolt = <3600000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +
>> +               mt6360_ldo3: ldo3 {
>> +                       regulator-compatible = "LDO3";
>> +                       regulator-name = "mt6360,ldo3";
>> +                       regulator-min-microvolt = <1200000>;
>> +                       regulator-max-microvolt = <3600000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +
>> +               mt6360_ldo5: ldo5 {
>> +                       regulator-compatible = "LDO5";
>> +                       regulator-name = "mt6360,ldo5";
>> +                       regulator-min-microvolt = <2700000>;
>> +                       regulator-max-microvolt = <3600000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +
>> +               mt6360_ldo6: ldo6 {
>> +                       regulator-compatible = "LDO6";
>> +                       regulator-name = "mt6360,ldo6";
>> +                       regulator-min-microvolt = <500000>;
>> +                       regulator-max-microvolt = <2100000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +
>> +               mt6360_ldo7: ldo7 {
>> +                       regulator-compatible = "LDO7";
>> +                       regulator-name = "mt6360,ldo7";
>> +                       regulator-min-microvolt = <500000>;
>> +                       regulator-max-microvolt = <2100000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +       };
>> +};
>> --
>> 2.18.0
>>

Best regards,
Macpaul Lin.

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

* Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
@ 2023-08-28  9:59       ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-28  9:59 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Bear Wang,
	Pablo Sun, Macpaul Lin, Chunfeng Yun


On 8/28/23 12:36, Chen-Yu Tsai wrote:
> 	
> 
> External email : Please do not click links or open attachments until you 
> have verified the sender or the content.
> 
> On Fri, Aug 25, 2023 at 7:46 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
>>
>> MT6360 is the secondary PMIC for MT8195.
>> It supports USB Type-C and PD functions.
>> Add MT6360 related common nodes which is used for MT8195 platform, includes
>>  - charger
>>  - ADC
>>  - LED
>>  - regulators
>>
>> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> ---
>>  arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++

[snip..]

>> +       regulator {
>> +               compatible = "mediatek,mt6360-regulator";
>> +               LDO_VIN3-supply = <&mt6360_buck2>;
>> +
>> +               mt6360_buck1: buck1 {
>> +                       regulator-compatible = "BUCK1";
>> +                       regulator-name = "mt6360,buck1";
> 
> Normally there's no need to provide a default name. Any used regulator
> should have been named to match the power rail name from the board's
> schematics.
> 

I have 2 schematics on hand. One is mt8195-demo board and the other is 
genio-1200-evk board. There are 2 PMIC used on these board
with "the same" sub power rail name for "BUCK1~BUCK4". One is mt6315, 
and the other is mt6360.

I've also inspected other dtsi of the regulators, such as mt6357 and 
mt6359. They have regulator nodes with named for their purpose. For the
schematics of mt8195-demo and genio-1200-evk boards, there are no 
explicit usage for "BUCK1~BUCK4" for both mt6135 and mt6360. In order to 
specify the sub power rail for mt6360, MediaTek chooses name like 
"mt6360,buck1" instead of simple name "buck1" for distinguish with 
"buck1" of mt6351.

>> +                       regulator-min-microvolt = <300000>;
>> +                       regulator-max-microvolt = <1300000>;
> 
> These values correspond to the regulator's range. They make no sense as
> regulator constraints. The min/max values are supposed to be the most
> restrictive set of voltages of the regulator consumers. If what is fed
> by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V
> and 1.1V here. If the regulator is unused, then there are no constraints,
> and these can be left out.
> 
> Just leave them out of the file.
> 
> Both comments apply to all the regulators.
> 
> ChenYu

There are some common circuit design for these regulators like mt6359, 
mt6360 and mt6315 used on many products. MediaTek put the most common 
and expected default values in their dtsi. However, some changes still 
need to be applied to derivative boards according to product's 
requirements. The actual value be used will be applied in board's dts 
file to override the default settings in dtsi.

The regulator node "mt6360,ldo6" is not used by mt8195-demo and 
genio-1200-evk. I'll remove it in the next version.
Thanks for the review.

>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP
>> +                                                  MT6360_OPMODE_ULP>;
>> +               };
>> +
>> +               mt6360_buck2: buck2 {
>> +                       regulator-compatible = "BUCK2";
>> +                       regulator-name = "mt6360,buck2";
>> +                       regulator-min-microvolt = <300000>;
>> +                       regulator-max-microvolt = <1300000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP
>> +                                                  MT6360_OPMODE_ULP>;
>> +               };
>> +
>> +               mt6360_ldo1: ldo1 {
>> +                       regulator-compatible = "LDO1";
>> +                       regulator-name = "mt6360,ldo1";
>> +                       regulator-min-microvolt = <1200000>;
>> +                       regulator-max-microvolt = <3600000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +
>> +               mt6360_ldo2: ldo2 {
>> +                       regulator-compatible = "LDO2";
>> +                       regulator-name = "mt6360,ldo2";
>> +                       regulator-min-microvolt = <1200000>;
>> +                       regulator-max-microvolt = <3600000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +
>> +               mt6360_ldo3: ldo3 {
>> +                       regulator-compatible = "LDO3";
>> +                       regulator-name = "mt6360,ldo3";
>> +                       regulator-min-microvolt = <1200000>;
>> +                       regulator-max-microvolt = <3600000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +
>> +               mt6360_ldo5: ldo5 {
>> +                       regulator-compatible = "LDO5";
>> +                       regulator-name = "mt6360,ldo5";
>> +                       regulator-min-microvolt = <2700000>;
>> +                       regulator-max-microvolt = <3600000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +
>> +               mt6360_ldo6: ldo6 {
>> +                       regulator-compatible = "LDO6";
>> +                       regulator-name = "mt6360,ldo6";
>> +                       regulator-min-microvolt = <500000>;
>> +                       regulator-max-microvolt = <2100000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +
>> +               mt6360_ldo7: ldo7 {
>> +                       regulator-compatible = "LDO7";
>> +                       regulator-name = "mt6360,ldo7";
>> +                       regulator-min-microvolt = <500000>;
>> +                       regulator-max-microvolt = <2100000>;
>> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> +                                                  MT6360_OPMODE_LP>;
>> +               };
>> +       };
>> +};
>> --
>> 2.18.0
>>

Best regards,
Macpaul Lin.

_______________________________________________
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] 44+ messages in thread

* Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
  2023-08-28  9:59       ` Macpaul Lin
@ 2023-08-28 10:51         ` Chen-Yu Tsai
  -1 siblings, 0 replies; 44+ messages in thread
From: Chen-Yu Tsai @ 2023-08-28 10:51 UTC (permalink / raw)
  To: Macpaul Lin
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Bear Wang,
	Pablo Sun, Macpaul Lin, Chunfeng Yun

On Mon, Aug 28, 2023 at 5:59 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
>
>
> On 8/28/23 12:36, Chen-Yu Tsai wrote:
> >
> >
> > External email : Please do not click links or open attachments until you
> > have verified the sender or the content.
> >
> > On Fri, Aug 25, 2023 at 7:46 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
> >>
> >> MT6360 is the secondary PMIC for MT8195.
> >> It supports USB Type-C and PD functions.
> >> Add MT6360 related common nodes which is used for MT8195 platform, includes
> >>  - charger
> >>  - ADC
> >>  - LED
> >>  - regulators
> >>
> >> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> >> ---
> >>  arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++
>
> [snip..]
>
> >> +       regulator {
> >> +               compatible = "mediatek,mt6360-regulator";
> >> +               LDO_VIN3-supply = <&mt6360_buck2>;
> >> +
> >> +               mt6360_buck1: buck1 {
> >> +                       regulator-compatible = "BUCK1";
> >> +                       regulator-name = "mt6360,buck1";
> >
> > Normally there's no need to provide a default name. Any used regulator
> > should have been named to match the power rail name from the board's
> > schematics.
> >
>
> I have 2 schematics on hand. One is mt8195-demo board and the other is
> genio-1200-evk board. There are 2 PMIC used on these board
> with "the same" sub power rail name for "BUCK1~BUCK4". One is mt6315,
> and the other is mt6360.

This is more of an board level integration thing. Regulator names are
expected to be named after the actual power rail names. For example,
take a look at Rock Pi 4 schematics [1], the power rail from BUCK1 of
the RK808 PMIC is named "VDD_CENTER". And in the dts file [1] we can
see the regulator is named that as well (albeit with some style changes).

Now if a project really chooses meaningless names like BUCKx or LDOy
for their power rails, then so be it. However those are board level
decisions. The names are there to help with integration debugging, so
it makes sense to have names that match the power rail names in the
schematics. Default names rarely make sense.

[1] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf
[2] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi#L267

> I've also inspected other dtsi of the regulators, such as mt6357 and
> mt6359. They have regulator nodes with named for their purpose. For the
> schematics of mt8195-demo and genio-1200-evk boards, there are no
> explicit usage for "BUCK1~BUCK4" for both mt6135 and mt6360. In order to
> specify the sub power rail for mt6360, MediaTek chooses name like
> "mt6360,buck1" instead of simple name "buck1" for distinguish with
> "buck1" of mt6351.
>
> >> +                       regulator-min-microvolt = <300000>;
> >> +                       regulator-max-microvolt = <1300000>;
> >
> > These values correspond to the regulator's range. They make no sense as
> > regulator constraints. The min/max values are supposed to be the most
> > restrictive set of voltages of the regulator consumers. If what is fed
> > by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V
> > and 1.1V here. If the regulator is unused, then there are no constraints,
> > and these can be left out.
> >
> > Just leave them out of the file.
> >
> > Both comments apply to all the regulators.
> >
> > ChenYu
>
> There are some common circuit design for these regulators like mt6359,
> mt6360 and mt6315 used on many products. MediaTek put the most common
> and expected default values in their dtsi. However, some changes still
> need to be applied to derivative boards according to product's
> requirements. The actual value be used will be applied in board's dts
> file to override the default settings in dtsi.

The values here are definitely not some product's expected values.
They are the full range of output voltages supported, as seen in the
driver.

The regulator binding says:

    regulator-min-microvolt:
      description: smallest voltage consumers may set

    regulator-max-microvolt:
      description: largest voltage consumers may set

The constraints given in the regulator node are those of the consumers,
not the PMIC regulator itself. As you mentioned, a board may need to
adjust the range based on its design, i.e. what the board has connected
to the regulator.

So either something is connected, and the consumer's constraints are set
by overriding the default in the board .dts file; or, nothing is connected
and the constraints don't matter, as nothing is going to set the voltage
or enable the regulator. So there's no reason to give a default. For
unused regulator outputs, their device nodes don't even have to exist.

I'm trying to get people to _not_ write default values, as they don't
make any sense. The full voltage range is already implied by the
compatible string.

ChenYu

> The regulator node "mt6360,ldo6" is not used by mt8195-demo and
> genio-1200-evk. I'll remove it in the next version.
> Thanks for the review.
>
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP
> >> +                                                  MT6360_OPMODE_ULP>;
> >> +               };
> >> +
> >> +               mt6360_buck2: buck2 {
> >> +                       regulator-compatible = "BUCK2";
> >> +                       regulator-name = "mt6360,buck2";
> >> +                       regulator-min-microvolt = <300000>;
> >> +                       regulator-max-microvolt = <1300000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP
> >> +                                                  MT6360_OPMODE_ULP>;
> >> +               };
> >> +
> >> +               mt6360_ldo1: ldo1 {
> >> +                       regulator-compatible = "LDO1";
> >> +                       regulator-name = "mt6360,ldo1";
> >> +                       regulator-min-microvolt = <1200000>;
> >> +                       regulator-max-microvolt = <3600000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +
> >> +               mt6360_ldo2: ldo2 {
> >> +                       regulator-compatible = "LDO2";
> >> +                       regulator-name = "mt6360,ldo2";
> >> +                       regulator-min-microvolt = <1200000>;
> >> +                       regulator-max-microvolt = <3600000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +
> >> +               mt6360_ldo3: ldo3 {
> >> +                       regulator-compatible = "LDO3";
> >> +                       regulator-name = "mt6360,ldo3";
> >> +                       regulator-min-microvolt = <1200000>;
> >> +                       regulator-max-microvolt = <3600000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +
> >> +               mt6360_ldo5: ldo5 {
> >> +                       regulator-compatible = "LDO5";
> >> +                       regulator-name = "mt6360,ldo5";
> >> +                       regulator-min-microvolt = <2700000>;
> >> +                       regulator-max-microvolt = <3600000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +
> >> +               mt6360_ldo6: ldo6 {
> >> +                       regulator-compatible = "LDO6";
> >> +                       regulator-name = "mt6360,ldo6";
> >> +                       regulator-min-microvolt = <500000>;
> >> +                       regulator-max-microvolt = <2100000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +
> >> +               mt6360_ldo7: ldo7 {
> >> +                       regulator-compatible = "LDO7";
> >> +                       regulator-name = "mt6360,ldo7";
> >> +                       regulator-min-microvolt = <500000>;
> >> +                       regulator-max-microvolt = <2100000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +       };
> >> +};
> >> --
> >> 2.18.0
> >>
>
> Best regards,
> Macpaul Lin.

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

* Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
@ 2023-08-28 10:51         ` Chen-Yu Tsai
  0 siblings, 0 replies; 44+ messages in thread
From: Chen-Yu Tsai @ 2023-08-28 10:51 UTC (permalink / raw)
  To: Macpaul Lin
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Bear Wang,
	Pablo Sun, Macpaul Lin, Chunfeng Yun

On Mon, Aug 28, 2023 at 5:59 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
>
>
> On 8/28/23 12:36, Chen-Yu Tsai wrote:
> >
> >
> > External email : Please do not click links or open attachments until you
> > have verified the sender or the content.
> >
> > On Fri, Aug 25, 2023 at 7:46 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
> >>
> >> MT6360 is the secondary PMIC for MT8195.
> >> It supports USB Type-C and PD functions.
> >> Add MT6360 related common nodes which is used for MT8195 platform, includes
> >>  - charger
> >>  - ADC
> >>  - LED
> >>  - regulators
> >>
> >> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> >> ---
> >>  arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++
>
> [snip..]
>
> >> +       regulator {
> >> +               compatible = "mediatek,mt6360-regulator";
> >> +               LDO_VIN3-supply = <&mt6360_buck2>;
> >> +
> >> +               mt6360_buck1: buck1 {
> >> +                       regulator-compatible = "BUCK1";
> >> +                       regulator-name = "mt6360,buck1";
> >
> > Normally there's no need to provide a default name. Any used regulator
> > should have been named to match the power rail name from the board's
> > schematics.
> >
>
> I have 2 schematics on hand. One is mt8195-demo board and the other is
> genio-1200-evk board. There are 2 PMIC used on these board
> with "the same" sub power rail name for "BUCK1~BUCK4". One is mt6315,
> and the other is mt6360.

This is more of an board level integration thing. Regulator names are
expected to be named after the actual power rail names. For example,
take a look at Rock Pi 4 schematics [1], the power rail from BUCK1 of
the RK808 PMIC is named "VDD_CENTER". And in the dts file [1] we can
see the regulator is named that as well (albeit with some style changes).

Now if a project really chooses meaningless names like BUCKx or LDOy
for their power rails, then so be it. However those are board level
decisions. The names are there to help with integration debugging, so
it makes sense to have names that match the power rail names in the
schematics. Default names rarely make sense.

[1] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf
[2] https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi#L267

> I've also inspected other dtsi of the regulators, such as mt6357 and
> mt6359. They have regulator nodes with named for their purpose. For the
> schematics of mt8195-demo and genio-1200-evk boards, there are no
> explicit usage for "BUCK1~BUCK4" for both mt6135 and mt6360. In order to
> specify the sub power rail for mt6360, MediaTek chooses name like
> "mt6360,buck1" instead of simple name "buck1" for distinguish with
> "buck1" of mt6351.
>
> >> +                       regulator-min-microvolt = <300000>;
> >> +                       regulator-max-microvolt = <1300000>;
> >
> > These values correspond to the regulator's range. They make no sense as
> > regulator constraints. The min/max values are supposed to be the most
> > restrictive set of voltages of the regulator consumers. If what is fed
> > by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V
> > and 1.1V here. If the regulator is unused, then there are no constraints,
> > and these can be left out.
> >
> > Just leave them out of the file.
> >
> > Both comments apply to all the regulators.
> >
> > ChenYu
>
> There are some common circuit design for these regulators like mt6359,
> mt6360 and mt6315 used on many products. MediaTek put the most common
> and expected default values in their dtsi. However, some changes still
> need to be applied to derivative boards according to product's
> requirements. The actual value be used will be applied in board's dts
> file to override the default settings in dtsi.

The values here are definitely not some product's expected values.
They are the full range of output voltages supported, as seen in the
driver.

The regulator binding says:

    regulator-min-microvolt:
      description: smallest voltage consumers may set

    regulator-max-microvolt:
      description: largest voltage consumers may set

The constraints given in the regulator node are those of the consumers,
not the PMIC regulator itself. As you mentioned, a board may need to
adjust the range based on its design, i.e. what the board has connected
to the regulator.

So either something is connected, and the consumer's constraints are set
by overriding the default in the board .dts file; or, nothing is connected
and the constraints don't matter, as nothing is going to set the voltage
or enable the regulator. So there's no reason to give a default. For
unused regulator outputs, their device nodes don't even have to exist.

I'm trying to get people to _not_ write default values, as they don't
make any sense. The full voltage range is already implied by the
compatible string.

ChenYu

> The regulator node "mt6360,ldo6" is not used by mt8195-demo and
> genio-1200-evk. I'll remove it in the next version.
> Thanks for the review.
>
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP
> >> +                                                  MT6360_OPMODE_ULP>;
> >> +               };
> >> +
> >> +               mt6360_buck2: buck2 {
> >> +                       regulator-compatible = "BUCK2";
> >> +                       regulator-name = "mt6360,buck2";
> >> +                       regulator-min-microvolt = <300000>;
> >> +                       regulator-max-microvolt = <1300000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP
> >> +                                                  MT6360_OPMODE_ULP>;
> >> +               };
> >> +
> >> +               mt6360_ldo1: ldo1 {
> >> +                       regulator-compatible = "LDO1";
> >> +                       regulator-name = "mt6360,ldo1";
> >> +                       regulator-min-microvolt = <1200000>;
> >> +                       regulator-max-microvolt = <3600000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +
> >> +               mt6360_ldo2: ldo2 {
> >> +                       regulator-compatible = "LDO2";
> >> +                       regulator-name = "mt6360,ldo2";
> >> +                       regulator-min-microvolt = <1200000>;
> >> +                       regulator-max-microvolt = <3600000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +
> >> +               mt6360_ldo3: ldo3 {
> >> +                       regulator-compatible = "LDO3";
> >> +                       regulator-name = "mt6360,ldo3";
> >> +                       regulator-min-microvolt = <1200000>;
> >> +                       regulator-max-microvolt = <3600000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +
> >> +               mt6360_ldo5: ldo5 {
> >> +                       regulator-compatible = "LDO5";
> >> +                       regulator-name = "mt6360,ldo5";
> >> +                       regulator-min-microvolt = <2700000>;
> >> +                       regulator-max-microvolt = <3600000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +
> >> +               mt6360_ldo6: ldo6 {
> >> +                       regulator-compatible = "LDO6";
> >> +                       regulator-name = "mt6360,ldo6";
> >> +                       regulator-min-microvolt = <500000>;
> >> +                       regulator-max-microvolt = <2100000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +
> >> +               mt6360_ldo7: ldo7 {
> >> +                       regulator-compatible = "LDO7";
> >> +                       regulator-name = "mt6360,ldo7";
> >> +                       regulator-min-microvolt = <500000>;
> >> +                       regulator-max-microvolt = <2100000>;
> >> +                       regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> >> +                                                  MT6360_OPMODE_LP>;
> >> +               };
> >> +       };
> >> +};
> >> --
> >> 2.18.0
> >>
>
> Best regards,
> Macpaul Lin.

_______________________________________________
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] 44+ messages in thread

* Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
  2023-08-28 10:51         ` Chen-Yu Tsai
@ 2023-08-30 11:10           ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-30 11:10 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Bear Wang,
	Pablo Sun, Macpaul Lin, Chunfeng Yun, Alexandre Mergnat



On 8/28/23 18:51, Chen-Yu Tsai wrote:
> 	
> 
> External email : Please do not click links or open attachments until you 
> have verified the sender or the content.
> 
> On Mon, Aug 28, 2023 at 5:59 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
>>
>>
>> On 8/28/23 12:36, Chen-Yu Tsai wrote:
>> >
>> >
>> > External email : Please do not click links or open attachments until you
>> > have verified the sender or the content.
>> >
>> > On Fri, Aug 25, 2023 at 7:46 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
>> >>
>> >> MT6360 is the secondary PMIC for MT8195.
>> >> It supports USB Type-C and PD functions.
>> >> Add MT6360 related common nodes which is used for MT8195 platform, includes
>> >>  - charger
>> >>  - ADC
>> >>  - LED
>> >>  - regulators
>> >>
>> >> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> >> ---
>> >>  arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++
>>
>> [snip..]
>>
>> >> +       regulator {
>> >> +               compatible = "mediatek,mt6360-regulator";
>> >> +               LDO_VIN3-supply = <&mt6360_buck2>;
>> >> +
>> >> +               mt6360_buck1: buck1 {
>> >> +                       regulator-compatible = "BUCK1";
>> >> +                       regulator-name = "mt6360,buck1";
>> >
>> > Normally there's no need to provide a default name. Any used regulator
>> > should have been named to match the power rail name from the board's
>> > schematics.
>> >
>>
>> I have 2 schematics on hand. One is mt8195-demo board and the other is
>> genio-1200-evk board. There are 2 PMIC used on these board
>> with "the same" sub power rail name for "BUCK1~BUCK4". One is mt6315,
>> and the other is mt6360.
> 
> This is more of an board level integration thing. Regulator names are
> expected to be named after the actual power rail names. For example,
> take a look at Rock Pi 4 schematics [1], the power rail from BUCK1 of
> the RK808 PMIC is named "VDD_CENTER". And in the dts file [1] we can
> see the regulator is named that as well (albeit with some style changes).
> 
> Now if a project really chooses meaningless names like BUCKx or LDOy
> for their power rails, then so be it. However those are board level
> decisions. The names are there to help with integration debugging, so
> it makes sense to have names that match the power rail names in the
> schematics. Default names rarely make sense.
> 
> [1]https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf  <https://urldefense.com/v3/__https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf__;!!CTRNKA9wMg0ARbw!g4T6kWfnETA38Kc_yc6dx6gYi7zzW2m6YU0ybNN5vbTWjK5SfapEQEQMrtxg8E9xRNdpJm678Rj3uLrWHeM$>
> [2]https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi#L267  <https://urldefense.com/v3/__https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi*L267__;Iw!!CTRNKA9wMg0ARbw!g4T6kWfnETA38Kc_yc6dx6gYi7zzW2m6YU0ybNN5vbTWjK5SfapEQEQMrtxg8E9xRNdpJm678Rj3hdwm0VA$>
> 
>> I've also inspected other dtsi of the regulators, such as mt6357 and
>> mt6359. They have regulator nodes with named for their purpose. For the
>> schematics of mt8195-demo and genio-1200-evk boards, there are no
>> explicit usage for "BUCK1~BUCK4" for both mt6135 and mt6360. In order to
>> specify the sub power rail for mt6360, MediaTek chooses name like
>> "mt6360,buck1" instead of simple name "buck1" for distinguish with
>> "buck1" of mt6351.
>>
>> >> +                       regulator-min-microvolt = <300000>;
>> >> +                       regulator-max-microvolt = <1300000>;
>> >
>> > These values correspond to the regulator's range. They make no sense as
>> > regulator constraints. The min/max values are supposed to be the most
>> > restrictive set of voltages of the regulator consumers. If what is fed
>> > by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V
>> > and 1.1V here. If the regulator is unused, then there are no constraints,
>> > and these can be left out.
>> >
>> > Just leave them out of the file.
>> >Alexandre Mergnat <amergnat@baylibre.com>
>> > Both comments apply to all the regulators.
>> >
>> > ChenYu
>>
>> There are some common circuit design for these regulators like mt6359,
>> mt6360 and mt6315 used on many products. MediaTek put the most common
>> and expected default values in their dtsi. However, some changes still
>> need to be applied to derivative boards according to product's
>> requirements. The actual value be used will be applied in board's dts
>> file to override the default settings in dtsi.
> 
> The values here are definitely not some product's expected values.
> They are the full range of output voltages supported, as seen in the
> driver.
> 
> The regulator binding says:
> 
>      regulator-min-microvolt:
>        description: smallest voltage consumers may set
> 
>      regulator-max-microvolt:
>        description: largest voltage consumers may set
> 
> The constraints given in the regulator node are those of the consumers,
> not the PMIC regulator itself. As you mentioned, a board may need to
> adjust the range based on its design, i.e. what the board has connected
> to the regulator.
> 
> So either something is connected, and the consumer's constraints are set
> by overriding the default in the board .dts file; or, nothing is connected
> and the constraints don't matter, as nothing is going to set the voltage
> or enable the regulator. So there's no reason to give a default. For
> unused regulator outputs, their device nodes don't even have to exist.
> 
> I'm trying to get people to _not_ write default values, as they don't
> make any sense. The full voltage range is already implied by the
> compatible string.
> 
> ChenYu

Thanks for the explanation in detail.
I'll update the patch v2 for these modification.

Best regards,
Macpaul Lin

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

* Re: [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
@ 2023-08-30 11:10           ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-30 11:10 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Bear Wang,
	Pablo Sun, Macpaul Lin, Chunfeng Yun, Alexandre Mergnat



On 8/28/23 18:51, Chen-Yu Tsai wrote:
> 	
> 
> External email : Please do not click links or open attachments until you 
> have verified the sender or the content.
> 
> On Mon, Aug 28, 2023 at 5:59 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
>>
>>
>> On 8/28/23 12:36, Chen-Yu Tsai wrote:
>> >
>> >
>> > External email : Please do not click links or open attachments until you
>> > have verified the sender or the content.
>> >
>> > On Fri, Aug 25, 2023 at 7:46 PM Macpaul Lin <macpaul.lin@mediatek.com> wrote:
>> >>
>> >> MT6360 is the secondary PMIC for MT8195.
>> >> It supports USB Type-C and PD functions.
>> >> Add MT6360 related common nodes which is used for MT8195 platform, includes
>> >>  - charger
>> >>  - ADC
>> >>  - LED
>> >>  - regulators
>> >>
>> >> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> >> ---
>> >>  arch/arm64/boot/dts/mediatek/mt6360.dtsi | 112 +++++++++++++++++++++++
>>
>> [snip..]
>>
>> >> +       regulator {
>> >> +               compatible = "mediatek,mt6360-regulator";
>> >> +               LDO_VIN3-supply = <&mt6360_buck2>;
>> >> +
>> >> +               mt6360_buck1: buck1 {
>> >> +                       regulator-compatible = "BUCK1";
>> >> +                       regulator-name = "mt6360,buck1";
>> >
>> > Normally there's no need to provide a default name. Any used regulator
>> > should have been named to match the power rail name from the board's
>> > schematics.
>> >
>>
>> I have 2 schematics on hand. One is mt8195-demo board and the other is
>> genio-1200-evk board. There are 2 PMIC used on these board
>> with "the same" sub power rail name for "BUCK1~BUCK4". One is mt6315,
>> and the other is mt6360.
> 
> This is more of an board level integration thing. Regulator names are
> expected to be named after the actual power rail names. For example,
> take a look at Rock Pi 4 schematics [1], the power rail from BUCK1 of
> the RK808 PMIC is named "VDD_CENTER". And in the dts file [1] we can
> see the regulator is named that as well (albeit with some style changes).
> 
> Now if a project really chooses meaningless names like BUCKx or LDOy
> for their power rails, then so be it. However those are board level
> decisions. The names are there to help with integration debugging, so
> it makes sense to have names that match the power rail names in the
> schematics. Default names rarely make sense.
> 
> [1]https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf  <https://urldefense.com/v3/__https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf__;!!CTRNKA9wMg0ARbw!g4T6kWfnETA38Kc_yc6dx6gYi7zzW2m6YU0ybNN5vbTWjK5SfapEQEQMrtxg8E9xRNdpJm678Rj3uLrWHeM$>
> [2]https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi#L267  <https://urldefense.com/v3/__https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi*L267__;Iw!!CTRNKA9wMg0ARbw!g4T6kWfnETA38Kc_yc6dx6gYi7zzW2m6YU0ybNN5vbTWjK5SfapEQEQMrtxg8E9xRNdpJm678Rj3hdwm0VA$>
> 
>> I've also inspected other dtsi of the regulators, such as mt6357 and
>> mt6359. They have regulator nodes with named for their purpose. For the
>> schematics of mt8195-demo and genio-1200-evk boards, there are no
>> explicit usage for "BUCK1~BUCK4" for both mt6135 and mt6360. In order to
>> specify the sub power rail for mt6360, MediaTek chooses name like
>> "mt6360,buck1" instead of simple name "buck1" for distinguish with
>> "buck1" of mt6351.
>>
>> >> +                       regulator-min-microvolt = <300000>;
>> >> +                       regulator-max-microvolt = <1300000>;
>> >
>> > These values correspond to the regulator's range. They make no sense as
>> > regulator constraints. The min/max values are supposed to be the most
>> > restrictive set of voltages of the regulator consumers. If what is fed
>> > by this regulator can only take 0.7V ~ 1.1V, then it should save 0.7V
>> > and 1.1V here. If the regulator is unused, then there are no constraints,
>> > and these can be left out.
>> >
>> > Just leave them out of the file.
>> >Alexandre Mergnat <amergnat@baylibre.com>
>> > Both comments apply to all the regulators.
>> >
>> > ChenYu
>>
>> There are some common circuit design for these regulators like mt6359,
>> mt6360 and mt6315 used on many products. MediaTek put the most common
>> and expected default values in their dtsi. However, some changes still
>> need to be applied to derivative boards according to product's
>> requirements. The actual value be used will be applied in board's dts
>> file to override the default settings in dtsi.
> 
> The values here are definitely not some product's expected values.
> They are the full range of output voltages supported, as seen in the
> driver.
> 
> The regulator binding says:
> 
>      regulator-min-microvolt:
>        description: smallest voltage consumers may set
> 
>      regulator-max-microvolt:
>        description: largest voltage consumers may set
> 
> The constraints given in the regulator node are those of the consumers,
> not the PMIC regulator itself. As you mentioned, a board may need to
> adjust the range based on its design, i.e. what the board has connected
> to the regulator.
> 
> So either something is connected, and the consumer's constraints are set
> by overriding the default in the board .dts file; or, nothing is connected
> and the constraints don't matter, as nothing is going to set the voltage
> or enable the regulator. So there's no reason to give a default. For
> unused regulator outputs, their device nodes don't even have to exist.
> 
> I'm trying to get people to _not_ write default values, as they don't
> make any sense. The full voltage range is already implied by the
> compatible string.
> 
> ChenYu

Thanks for the explanation in detail.
I'll update the patch v2 for these modification.

Best regards,
Macpaul Lin

_______________________________________________
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] 44+ messages in thread

* [PATCH v2 1/4] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
  2023-08-25 11:46 ` Macpaul Lin
@ 2023-08-30 11:15   ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-30 11:15 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun, stable

The onboard dram of mt8195-demo board is 8GB.

Cc: stable@vger.kernel.org      # 6.1, 6.4
Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes for v2:
 - No change.

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index b2485ddfd33b..ff363ab925e9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -48,7 +48,7 @@
 
 	memory@40000000 {
 		device_type = "memory";
-		reg = <0 0x40000000 0 0x80000000>;
+		reg = <0 0x40000000 0x2 0x00000000>;
 	};
 
 	reserved-memory {
-- 
2.18.0


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

* [PATCH v2 1/4] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
@ 2023-08-30 11:15   ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-30 11:15 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun, stable

The onboard dram of mt8195-demo board is 8GB.

Cc: stable@vger.kernel.org      # 6.1, 6.4
Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes for v2:
 - No change.

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index b2485ddfd33b..ff363ab925e9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -48,7 +48,7 @@
 
 	memory@40000000 {
 		device_type = "memory";
-		reg = <0 0x40000000 0 0x80000000>;
+		reg = <0 0x40000000 0x2 0x00000000>;
 	};
 
 	reserved-memory {
-- 
2.18.0


_______________________________________________
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] 44+ messages in thread

* [PATCH v2 2/4] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
  2023-08-30 11:15   ` Macpaul Lin
@ 2023-08-30 11:15     ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-30 11:15 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun, stable

The dts file of the MediaTek MT8195 demo board has been updated to include
new reserved memory regions.
These reserved memory regions are:
 - SCP
 - VPU,
 - Sound DMA
 - APU.

These regions are defined with the "shared-dma-pool" compatible property.
In addition, the existing reserved memory regions have been reordered by
their addresses to improve readability and maintainability of the DTS
file.

Cc: stable@vger.kernel.org      # 6.1, 6.4
Fixes: e4a417520101 ("arm64: dts: mediatek: mt8195-demo: fix the memory size of node secmon")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 38 ++++++++++++++++----
 1 file changed, 32 insertions(+), 6 deletions(-)

Changes for v2:
 - No change.

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index ff363ab925e9..8aea6f5d72b3 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -56,12 +56,6 @@
 		#size-cells = <2>;
 		ranges;
 
-		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
-		bl31_secmon_reserved: secmon@54600000 {
-			no-map;
-			reg = <0 0x54600000 0x0 0x200000>;
-		};
-
 		/* 12 MiB reserved for OP-TEE (BL32)
 		 * +-----------------------+ 0x43e0_0000
 		 * |      SHMEM 2MiB       |
@@ -75,6 +69,38 @@
 			no-map;
 			reg = <0 0x43200000 0 0x00c00000>;
 		};
+
+		scp_mem: memory@50000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x50000000 0 0x2900000>;
+			no-map;
+		};
+
+		vpu_mem: memory@53000000 {
+			compatible = "shared-dma-pool";
+			size = <0 0x1400000>; /* 20 MB */
+			alignment = <0 0x10000>;
+			reg = <0 0x53000000 0 0x1400000>;
+		};
+
+		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
+		bl31_secmon_mem: memory@54600000 {
+			no-map;
+			reg = <0 0x54600000 0x0 0x200000>;
+		};
+
+		snd_dma_mem: memory@60000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x60000000 0 0x1100000>;
+			no-map;
+		};
+
+		apu_mem: memory@62000000 {
+			compatible = "shared-dma-pool";
+			size = <0 0x1400000>; /* 20 MB */
+			alignment = <0 0x10000>;
+			reg = <0 0x62000000 0 0x1400000>;
+		};
 	};
 };
 
-- 
2.18.0


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

* [PATCH v2 2/4] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
@ 2023-08-30 11:15     ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-30 11:15 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun, stable

The dts file of the MediaTek MT8195 demo board has been updated to include
new reserved memory regions.
These reserved memory regions are:
 - SCP
 - VPU,
 - Sound DMA
 - APU.

These regions are defined with the "shared-dma-pool" compatible property.
In addition, the existing reserved memory regions have been reordered by
their addresses to improve readability and maintainability of the DTS
file.

Cc: stable@vger.kernel.org      # 6.1, 6.4
Fixes: e4a417520101 ("arm64: dts: mediatek: mt8195-demo: fix the memory size of node secmon")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 38 ++++++++++++++++----
 1 file changed, 32 insertions(+), 6 deletions(-)

Changes for v2:
 - No change.

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index ff363ab925e9..8aea6f5d72b3 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -56,12 +56,6 @@
 		#size-cells = <2>;
 		ranges;
 
-		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
-		bl31_secmon_reserved: secmon@54600000 {
-			no-map;
-			reg = <0 0x54600000 0x0 0x200000>;
-		};
-
 		/* 12 MiB reserved for OP-TEE (BL32)
 		 * +-----------------------+ 0x43e0_0000
 		 * |      SHMEM 2MiB       |
@@ -75,6 +69,38 @@
 			no-map;
 			reg = <0 0x43200000 0 0x00c00000>;
 		};
+
+		scp_mem: memory@50000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x50000000 0 0x2900000>;
+			no-map;
+		};
+
+		vpu_mem: memory@53000000 {
+			compatible = "shared-dma-pool";
+			size = <0 0x1400000>; /* 20 MB */
+			alignment = <0 0x10000>;
+			reg = <0 0x53000000 0 0x1400000>;
+		};
+
+		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
+		bl31_secmon_mem: memory@54600000 {
+			no-map;
+			reg = <0 0x54600000 0x0 0x200000>;
+		};
+
+		snd_dma_mem: memory@60000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x60000000 0 0x1100000>;
+			no-map;
+		};
+
+		apu_mem: memory@62000000 {
+			compatible = "shared-dma-pool";
+			size = <0 0x1400000>; /* 20 MB */
+			alignment = <0 0x10000>;
+			reg = <0 0x62000000 0 0x1400000>;
+		};
 	};
 };
 
-- 
2.18.0


_______________________________________________
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] 44+ messages in thread

* [PATCH v2 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
  2023-08-30 11:15   ` Macpaul Lin
@ 2023-08-30 11:15     ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-30 11:15 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

MT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
 - charger
 - ADC
 - LED
 - regulators

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt6360.dtsi | 85 ++++++++++++++++++++++++
 1 file changed, 85 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt6360.dtsi

Change for v2:
 - Remove the following properties according to Chen-Yu Tsai's suggestion
  - regulator-name
  - regulator-min-microvolt
  - regulator-max-microvolt

diff --git a/arch/arm64/boot/dts/mediatek/mt6360.dtsi b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
new file mode 100644
index 000000000000..a89fd43d0f1f
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
@@ -0,0 +1,85 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2023 MediaTek Inc.
+ */
+
+#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
+
+&mt6360 {
+	interrupt-controller;
+	interrupt-parent = <&pio>;
+	interrupt-names = "IRQB";
+
+	charger {
+		compatible = "mediatek,mt6360-chg";
+		richtek,vinovp-microvolt = <14500000>;
+
+		otg_vbus_regulator: usb-otg-vbus-regulator {
+			regulator-compatible = "usb-otg-vbus";
+		};
+	};
+
+	adc {
+		compatible = "mediatek,mt6360-adc";
+		#io-channel-cells = <1>;
+	};
+
+	led {
+		compatible = "mediatek,mt6360-led";
+	};
+
+	regulator {
+		compatible = "mediatek,mt6360-regulator";
+		LDO_VIN3-supply = <&mt6360_emi_vddq_buck2_reg>;
+
+		mt6360_emi_vdd2_buck1_reg: buck1-emi-vdd2 {
+			regulator-compatible = "BUCK1";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP
+						   MT6360_OPMODE_ULP>;
+		};
+
+		mt6360_emi_vddq_buck2_reg: buck2-emi-vddq {
+			regulator-compatible = "BUCK2";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP
+						   MT6360_OPMODE_ULP>;
+		};
+
+		mt6360_tp1_p3v0_ldo1_reg: ldo1-tp1-p3v0 {
+			regulator-compatible = "LDO1";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_panel1_p1v8_ldo2_reg: ldo2-panel1-p1v8 {
+			regulator-compatible = "LDO2";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_vmc_pmu_ldo3_reg: ldo3-vmc-pmu {
+			regulator-compatible = "LDO3";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_vmch_pmu_ldo5_reg: ldo5-vmch-pmu {
+			regulator-compatible = "LDO5";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo6_reg: ldo6-mt6360 {
+			regulator-compatible = "LDO6";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_emi_vmddr_en_ldo7_reg: ldo7-emi-vmddr-en {
+			regulator-compatible = "LDO7";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+	};
+};
-- 
2.18.0


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

* [PATCH v2 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
@ 2023-08-30 11:15     ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-30 11:15 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

MT6360 is the secondary PMIC for MT8195.
It supports USB Type-C and PD functions.
Add MT6360 related common nodes which is used for MT8195 platform, includes
 - charger
 - ADC
 - LED
 - regulators

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt6360.dtsi | 85 ++++++++++++++++++++++++
 1 file changed, 85 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt6360.dtsi

Change for v2:
 - Remove the following properties according to Chen-Yu Tsai's suggestion
  - regulator-name
  - regulator-min-microvolt
  - regulator-max-microvolt

diff --git a/arch/arm64/boot/dts/mediatek/mt6360.dtsi b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
new file mode 100644
index 000000000000..a89fd43d0f1f
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt6360.dtsi
@@ -0,0 +1,85 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2023 MediaTek Inc.
+ */
+
+#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
+
+&mt6360 {
+	interrupt-controller;
+	interrupt-parent = <&pio>;
+	interrupt-names = "IRQB";
+
+	charger {
+		compatible = "mediatek,mt6360-chg";
+		richtek,vinovp-microvolt = <14500000>;
+
+		otg_vbus_regulator: usb-otg-vbus-regulator {
+			regulator-compatible = "usb-otg-vbus";
+		};
+	};
+
+	adc {
+		compatible = "mediatek,mt6360-adc";
+		#io-channel-cells = <1>;
+	};
+
+	led {
+		compatible = "mediatek,mt6360-led";
+	};
+
+	regulator {
+		compatible = "mediatek,mt6360-regulator";
+		LDO_VIN3-supply = <&mt6360_emi_vddq_buck2_reg>;
+
+		mt6360_emi_vdd2_buck1_reg: buck1-emi-vdd2 {
+			regulator-compatible = "BUCK1";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP
+						   MT6360_OPMODE_ULP>;
+		};
+
+		mt6360_emi_vddq_buck2_reg: buck2-emi-vddq {
+			regulator-compatible = "BUCK2";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP
+						   MT6360_OPMODE_ULP>;
+		};
+
+		mt6360_tp1_p3v0_ldo1_reg: ldo1-tp1-p3v0 {
+			regulator-compatible = "LDO1";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_panel1_p1v8_ldo2_reg: ldo2-panel1-p1v8 {
+			regulator-compatible = "LDO2";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_vmc_pmu_ldo3_reg: ldo3-vmc-pmu {
+			regulator-compatible = "LDO3";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_vmch_pmu_ldo5_reg: ldo5-vmch-pmu {
+			regulator-compatible = "LDO5";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_ldo6_reg: ldo6-mt6360 {
+			regulator-compatible = "LDO6";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+
+		mt6360_emi_vmddr_en_ldo7_reg: ldo7-emi-vmddr-en {
+			regulator-compatible = "LDO7";
+			regulator-allowed-modes = <MT6360_OPMODE_NORMAL
+						   MT6360_OPMODE_LP>;
+		};
+	};
+};
-- 
2.18.0


_______________________________________________
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] 44+ messages in thread

* [PATCH v2 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
  2023-08-30 11:15   ` Macpaul Lin
@ 2023-08-30 11:15     ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-30 11:15 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

The dts file for the MediaTek MT8195 demo board has been refactored
to improve the configuration of the MT6360 multi-function PMIC.

The changes include:
 - Addition of the mt6360.dtsi include file, which contains the common
   configuration of the MT6360 for all mt8195 boards.
 - Removal of the direct inclusion of the mt6360-regulator.h file.
 - Removal of the common configuration of the MT6360 PMIC since
   the included mt6360.dtsi is used.
 - Add names according to the schematic of mt8195-demo board for
   mt6360 nodes.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++-----------
 1 file changed, 74 insertions(+), 99 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index 8aea6f5d72b3..d082d679dbbe 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -11,7 +11,6 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
-#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
 
 / {
 	model = "MediaTek MT8195 demo board";
@@ -130,103 +129,9 @@
 	mt6360: pmic@34 {
 		compatible = "mediatek,mt6360";
 		reg = <0x34>;
-		interrupt-controller;
+		pinctrl-0 = <&mt6360_pins>;
+		pinctrl-names = "default";
 		interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>;
-		interrupt-names = "IRQB";
-
-		charger {
-			compatible = "mediatek,mt6360-chg";
-			richtek,vinovp-microvolt = <14500000>;
-
-			otg_vbus_regulator: usb-otg-vbus-regulator {
-				regulator-compatible = "usb-otg-vbus";
-				regulator-name = "usb-otg-vbus";
-				regulator-min-microvolt = <4425000>;
-				regulator-max-microvolt = <5825000>;
-			};
-		};
-
-		regulator {
-			compatible = "mediatek,mt6360-regulator";
-			LDO_VIN3-supply = <&mt6360_buck2>;
-
-			mt6360_buck1: buck1 {
-				regulator-compatible = "BUCK1";
-				regulator-name = "mt6360,buck1";
-				regulator-min-microvolt = <300000>;
-				regulator-max-microvolt = <1300000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP
-							   MT6360_OPMODE_ULP>;
-				regulator-always-on;
-			};
-
-			mt6360_buck2: buck2 {
-				regulator-compatible = "BUCK2";
-				regulator-name = "mt6360,buck2";
-				regulator-min-microvolt = <300000>;
-				regulator-max-microvolt = <1300000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP
-							   MT6360_OPMODE_ULP>;
-				regulator-always-on;
-			};
-
-			mt6360_ldo1: ldo1 {
-				regulator-compatible = "LDO1";
-				regulator-name = "mt6360,ldo1";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo2: ldo2 {
-				regulator-compatible = "LDO2";
-				regulator-name = "mt6360,ldo2";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo3: ldo3 {
-				regulator-compatible = "LDO3";
-				regulator-name = "mt6360,ldo3";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo5: ldo5 {
-				regulator-compatible = "LDO5";
-				regulator-name = "mt6360,ldo5";
-				regulator-min-microvolt = <2700000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo6: ldo6 {
-				regulator-compatible = "LDO6";
-				regulator-name = "mt6360,ldo6";
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <2100000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo7: ldo7 {
-				regulator-compatible = "LDO7";
-				regulator-name = "mt6360,ldo7";
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <2100000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-				regulator-always-on;
-			};
-		};
 	};
 };
 
@@ -259,8 +164,8 @@
 	cap-sd-highspeed;
 	sd-uhs-sdr50;
 	sd-uhs-sdr104;
-	vmmc-supply = <&mt6360_ldo5>;
-	vqmmc-supply = <&mt6360_ldo3>;
+	vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>;
+	vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>;
 	status = "okay";
 };
 
@@ -300,6 +205,67 @@
 	regulator-always-on;
 };
 
+#include "mt6360.dtsi"
+
+&otg_vbus_regulator {
+	regulator-name = "usb-otg-vbus";
+	regulator-min-microvolt = <4425000>;
+	regulator-max-microvolt = <5825000>;
+};
+
+&mt6360_emi_vdd2_buck1_reg {
+	regulator-name = "emi_vdd2";
+	regulator-min-microvolt = <300000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-always-on;
+};
+
+&mt6360_emi_vddq_buck2_reg {
+	regulator-name = "emi_vddq";
+	regulator-min-microvolt = <300000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-always-on;
+};
+
+&mt6360_tp1_p3v0_ldo1_reg {
+	regulator-name = "tp1_p3v0";
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-always-on;
+};
+
+&mt6360_panel1_p1v8_ldo2_reg {
+	regulator-name = "panel1_p1v8";
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+};
+
+&mt6360_vmc_pmu_ldo3_reg {
+	regulator-name = "vmc_pmu";
+	regulator-min-microvolt = <1200000>;
+	regulator-max-microvolt = <3600000>;
+};
+
+&mt6360_vmch_pmu_ldo5_reg {
+	regulator-name = "vmch_pmu";
+	regulator-min-microvolt = <2700000>;
+	regulator-max-microvolt = <3600000>;
+};
+
+/* measure point on board */
+&mt6360_ldo6_reg {
+	regulator-name = "mt6360_ldo6";
+	regulator-min-microvolt = <500000>;
+	regulator-max-microvolt = <2100000>;
+};
+
+&mt6360_emi_vmddr_en_ldo7_reg {
+	regulator-name = "emi_vmddr_en";
+	regulator-min-microvolt = <500000>;
+	regulator-max-microvolt = <2100000>;
+	regulator-always-on;
+};
+
 &pio {
 	eth_default_pins: eth-default-pins {
 		pins-txd {
@@ -496,6 +462,15 @@
 				 <PINMUX_GPIO103__FUNC_URXD1>;
 		};
 	};
+
+	mt6360_pins: mt6360-pins {
+		pins {
+			pinmux = <PINMUX_GPIO100__FUNC_GPIO100>,
+				 <PINMUX_GPIO101__FUNC_GPIO101>;
+			input-enable;
+			bias-pull-up;
+		};
+	};
 };
 
 
-- 
2.18.0


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

* [PATCH v2 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
@ 2023-08-30 11:15     ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-30 11:15 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

The dts file for the MediaTek MT8195 demo board has been refactored
to improve the configuration of the MT6360 multi-function PMIC.

The changes include:
 - Addition of the mt6360.dtsi include file, which contains the common
   configuration of the MT6360 for all mt8195 boards.
 - Removal of the direct inclusion of the mt6360-regulator.h file.
 - Removal of the common configuration of the MT6360 PMIC since
   the included mt6360.dtsi is used.
 - Add names according to the schematic of mt8195-demo board for
   mt6360 nodes.

Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++-----------
 1 file changed, 74 insertions(+), 99 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index 8aea6f5d72b3..d082d679dbbe 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -11,7 +11,6 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
-#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
 
 / {
 	model = "MediaTek MT8195 demo board";
@@ -130,103 +129,9 @@
 	mt6360: pmic@34 {
 		compatible = "mediatek,mt6360";
 		reg = <0x34>;
-		interrupt-controller;
+		pinctrl-0 = <&mt6360_pins>;
+		pinctrl-names = "default";
 		interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>;
-		interrupt-names = "IRQB";
-
-		charger {
-			compatible = "mediatek,mt6360-chg";
-			richtek,vinovp-microvolt = <14500000>;
-
-			otg_vbus_regulator: usb-otg-vbus-regulator {
-				regulator-compatible = "usb-otg-vbus";
-				regulator-name = "usb-otg-vbus";
-				regulator-min-microvolt = <4425000>;
-				regulator-max-microvolt = <5825000>;
-			};
-		};
-
-		regulator {
-			compatible = "mediatek,mt6360-regulator";
-			LDO_VIN3-supply = <&mt6360_buck2>;
-
-			mt6360_buck1: buck1 {
-				regulator-compatible = "BUCK1";
-				regulator-name = "mt6360,buck1";
-				regulator-min-microvolt = <300000>;
-				regulator-max-microvolt = <1300000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP
-							   MT6360_OPMODE_ULP>;
-				regulator-always-on;
-			};
-
-			mt6360_buck2: buck2 {
-				regulator-compatible = "BUCK2";
-				regulator-name = "mt6360,buck2";
-				regulator-min-microvolt = <300000>;
-				regulator-max-microvolt = <1300000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP
-							   MT6360_OPMODE_ULP>;
-				regulator-always-on;
-			};
-
-			mt6360_ldo1: ldo1 {
-				regulator-compatible = "LDO1";
-				regulator-name = "mt6360,ldo1";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo2: ldo2 {
-				regulator-compatible = "LDO2";
-				regulator-name = "mt6360,ldo2";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo3: ldo3 {
-				regulator-compatible = "LDO3";
-				regulator-name = "mt6360,ldo3";
-				regulator-min-microvolt = <1200000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo5: ldo5 {
-				regulator-compatible = "LDO5";
-				regulator-name = "mt6360,ldo5";
-				regulator-min-microvolt = <2700000>;
-				regulator-max-microvolt = <3600000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo6: ldo6 {
-				regulator-compatible = "LDO6";
-				regulator-name = "mt6360,ldo6";
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <2100000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-			};
-
-			mt6360_ldo7: ldo7 {
-				regulator-compatible = "LDO7";
-				regulator-name = "mt6360,ldo7";
-				regulator-min-microvolt = <500000>;
-				regulator-max-microvolt = <2100000>;
-				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
-							   MT6360_OPMODE_LP>;
-				regulator-always-on;
-			};
-		};
 	};
 };
 
@@ -259,8 +164,8 @@
 	cap-sd-highspeed;
 	sd-uhs-sdr50;
 	sd-uhs-sdr104;
-	vmmc-supply = <&mt6360_ldo5>;
-	vqmmc-supply = <&mt6360_ldo3>;
+	vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>;
+	vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>;
 	status = "okay";
 };
 
@@ -300,6 +205,67 @@
 	regulator-always-on;
 };
 
+#include "mt6360.dtsi"
+
+&otg_vbus_regulator {
+	regulator-name = "usb-otg-vbus";
+	regulator-min-microvolt = <4425000>;
+	regulator-max-microvolt = <5825000>;
+};
+
+&mt6360_emi_vdd2_buck1_reg {
+	regulator-name = "emi_vdd2";
+	regulator-min-microvolt = <300000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-always-on;
+};
+
+&mt6360_emi_vddq_buck2_reg {
+	regulator-name = "emi_vddq";
+	regulator-min-microvolt = <300000>;
+	regulator-max-microvolt = <1300000>;
+	regulator-always-on;
+};
+
+&mt6360_tp1_p3v0_ldo1_reg {
+	regulator-name = "tp1_p3v0";
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-always-on;
+};
+
+&mt6360_panel1_p1v8_ldo2_reg {
+	regulator-name = "panel1_p1v8";
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+};
+
+&mt6360_vmc_pmu_ldo3_reg {
+	regulator-name = "vmc_pmu";
+	regulator-min-microvolt = <1200000>;
+	regulator-max-microvolt = <3600000>;
+};
+
+&mt6360_vmch_pmu_ldo5_reg {
+	regulator-name = "vmch_pmu";
+	regulator-min-microvolt = <2700000>;
+	regulator-max-microvolt = <3600000>;
+};
+
+/* measure point on board */
+&mt6360_ldo6_reg {
+	regulator-name = "mt6360_ldo6";
+	regulator-min-microvolt = <500000>;
+	regulator-max-microvolt = <2100000>;
+};
+
+&mt6360_emi_vmddr_en_ldo7_reg {
+	regulator-name = "emi_vmddr_en";
+	regulator-min-microvolt = <500000>;
+	regulator-max-microvolt = <2100000>;
+	regulator-always-on;
+};
+
 &pio {
 	eth_default_pins: eth-default-pins {
 		pins-txd {
@@ -496,6 +462,15 @@
 				 <PINMUX_GPIO103__FUNC_URXD1>;
 		};
 	};
+
+	mt6360_pins: mt6360-pins {
+		pins {
+			pinmux = <PINMUX_GPIO100__FUNC_GPIO100>,
+				 <PINMUX_GPIO101__FUNC_GPIO101>;
+			input-enable;
+			bias-pull-up;
+		};
+	};
 };
 
 
-- 
2.18.0


_______________________________________________
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] 44+ messages in thread

* Re: [PATCH v2 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
  2023-08-30 11:15     ` Macpaul Lin
@ 2023-08-30 11:20       ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 44+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-30 11:20 UTC (permalink / raw)
  To: Macpaul Lin, Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

On 30/08/2023 13:15, Macpaul Lin wrote:
> +
> +	led {
> +		compatible = "mediatek,mt6360-led";
> +	};
> +
> +	regulator {
> +		compatible = "mediatek,mt6360-regulator";
> +		LDO_VIN3-supply = <&mt6360_emi_vddq_buck2_reg>;
> +
> +		mt6360_emi_vdd2_buck1_reg: buck1-emi-vdd2 {

It does not look like you tested the DTS against bindings. Please run
`make dtbs_check W=1` (see
Documentation/devicetree/bindings/writing-schema.rst or
https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/
for instructions).

Best regards,
Krzysztof


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

* Re: [PATCH v2 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
@ 2023-08-30 11:20       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 44+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-30 11:20 UTC (permalink / raw)
  To: Macpaul Lin, Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

On 30/08/2023 13:15, Macpaul Lin wrote:
> +
> +	led {
> +		compatible = "mediatek,mt6360-led";
> +	};
> +
> +	regulator {
> +		compatible = "mediatek,mt6360-regulator";
> +		LDO_VIN3-supply = <&mt6360_emi_vddq_buck2_reg>;
> +
> +		mt6360_emi_vdd2_buck1_reg: buck1-emi-vdd2 {

It does not look like you tested the DTS against bindings. Please run
`make dtbs_check W=1` (see
Documentation/devicetree/bindings/writing-schema.rst or
https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/
for instructions).

Best regards,
Krzysztof


_______________________________________________
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] 44+ messages in thread

* Re: [PATCH v2 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
  2023-08-30 11:15     ` Macpaul Lin
@ 2023-08-30 11:30       ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 44+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-30 11:30 UTC (permalink / raw)
  To: Macpaul Lin, Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

On 30/08/2023 13:15, Macpaul Lin wrote:
> The dts file for the MediaTek MT8195 demo board has been refactored
> to improve the configuration of the MT6360 multi-function PMIC.
> 
> The changes include:
>  - Addition of the mt6360.dtsi include file, which contains the common
>    configuration of the MT6360 for all mt8195 boards.
>  - Removal of the direct inclusion of the mt6360-regulator.h file.
>  - Removal of the common configuration of the MT6360 PMIC since
>    the included mt6360.dtsi is used.
>  - Add names according to the schematic of mt8195-demo board for
>    mt6360 nodes.
> 
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>  arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++-----------
>  1 file changed, 74 insertions(+), 99 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> index 8aea6f5d72b3..d082d679dbbe 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> @@ -11,7 +11,6 @@
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/input/input.h>
>  #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
> -#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
>  
>  / {
>  	model = "MediaTek MT8195 demo board";
> @@ -130,103 +129,9 @@
>  	mt6360: pmic@34 {
>  		compatible = "mediatek,mt6360";
>  		reg = <0x34>;
> -		interrupt-controller;
> +		pinctrl-0 = <&mt6360_pins>;
> +		pinctrl-names = "default";
>  		interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>;
> -		interrupt-names = "IRQB";
> -
> -		charger {
> -			compatible = "mediatek,mt6360-chg";
> -			richtek,vinovp-microvolt = <14500000>;
> -
> -			otg_vbus_regulator: usb-otg-vbus-regulator {
> -				regulator-compatible = "usb-otg-vbus";
> -				regulator-name = "usb-otg-vbus";
> -				regulator-min-microvolt = <4425000>;
> -				regulator-max-microvolt = <5825000>;
> -			};
> -		};
> -
> -		regulator {
> -			compatible = "mediatek,mt6360-regulator";
> -			LDO_VIN3-supply = <&mt6360_buck2>;
> -
> -			mt6360_buck1: buck1 {

Your patchset does not look bisectable. Does not look tested, either...
Why having duplicated regulators (?) and then removing correct
regulators and keeping wrong ones?

> -				regulator-compatible = "BUCK1";
> -				regulator-name = "mt6360,buck1";
> -				regulator-min-microvolt = <300000>;
> -				regulator-max-microvolt = <1300000>;
> -				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> -							   MT6360_OPMODE_LP
> -							   MT6360_OPMODE_ULP>;
> -				regulator-always-on;
> -			};

...

>  	};
>  };
>  
> @@ -259,8 +164,8 @@
>  	cap-sd-highspeed;
>  	sd-uhs-sdr50;
>  	sd-uhs-sdr104;
> -	vmmc-supply = <&mt6360_ldo5>;
> -	vqmmc-supply = <&mt6360_ldo3>;
> +	vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>;
> +	vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>;
>  	status = "okay";
>  };
>  
> @@ -300,6 +205,67 @@
>  	regulator-always-on;
>  };
>  
> +#include "mt6360.dtsi"

Includes are in the top part of the DTS. Sometimes bottom, but never in
the middle.


Best regards,
Krzysztof


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

* Re: [PATCH v2 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
@ 2023-08-30 11:30       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 44+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-30 11:30 UTC (permalink / raw)
  To: Macpaul Lin, Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

On 30/08/2023 13:15, Macpaul Lin wrote:
> The dts file for the MediaTek MT8195 demo board has been refactored
> to improve the configuration of the MT6360 multi-function PMIC.
> 
> The changes include:
>  - Addition of the mt6360.dtsi include file, which contains the common
>    configuration of the MT6360 for all mt8195 boards.
>  - Removal of the direct inclusion of the mt6360-regulator.h file.
>  - Removal of the common configuration of the MT6360 PMIC since
>    the included mt6360.dtsi is used.
>  - Add names according to the schematic of mt8195-demo board for
>    mt6360 nodes.
> 
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>  arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++-----------
>  1 file changed, 74 insertions(+), 99 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> index 8aea6f5d72b3..d082d679dbbe 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> @@ -11,7 +11,6 @@
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/input/input.h>
>  #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
> -#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
>  
>  / {
>  	model = "MediaTek MT8195 demo board";
> @@ -130,103 +129,9 @@
>  	mt6360: pmic@34 {
>  		compatible = "mediatek,mt6360";
>  		reg = <0x34>;
> -		interrupt-controller;
> +		pinctrl-0 = <&mt6360_pins>;
> +		pinctrl-names = "default";
>  		interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>;
> -		interrupt-names = "IRQB";
> -
> -		charger {
> -			compatible = "mediatek,mt6360-chg";
> -			richtek,vinovp-microvolt = <14500000>;
> -
> -			otg_vbus_regulator: usb-otg-vbus-regulator {
> -				regulator-compatible = "usb-otg-vbus";
> -				regulator-name = "usb-otg-vbus";
> -				regulator-min-microvolt = <4425000>;
> -				regulator-max-microvolt = <5825000>;
> -			};
> -		};
> -
> -		regulator {
> -			compatible = "mediatek,mt6360-regulator";
> -			LDO_VIN3-supply = <&mt6360_buck2>;
> -
> -			mt6360_buck1: buck1 {

Your patchset does not look bisectable. Does not look tested, either...
Why having duplicated regulators (?) and then removing correct
regulators and keeping wrong ones?

> -				regulator-compatible = "BUCK1";
> -				regulator-name = "mt6360,buck1";
> -				regulator-min-microvolt = <300000>;
> -				regulator-max-microvolt = <1300000>;
> -				regulator-allowed-modes = <MT6360_OPMODE_NORMAL
> -							   MT6360_OPMODE_LP
> -							   MT6360_OPMODE_ULP>;
> -				regulator-always-on;
> -			};

...

>  	};
>  };
>  
> @@ -259,8 +164,8 @@
>  	cap-sd-highspeed;
>  	sd-uhs-sdr50;
>  	sd-uhs-sdr104;
> -	vmmc-supply = <&mt6360_ldo5>;
> -	vqmmc-supply = <&mt6360_ldo3>;
> +	vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>;
> +	vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>;
>  	status = "okay";
>  };
>  
> @@ -300,6 +205,67 @@
>  	regulator-always-on;
>  };
>  
> +#include "mt6360.dtsi"

Includes are in the top part of the DTS. Sometimes bottom, but never in
the middle.


Best regards,
Krzysztof


_______________________________________________
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] 44+ messages in thread

* Re: [PATCH v2 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
  2023-08-30 11:30       ` Krzysztof Kozlowski
@ 2023-08-31  4:06         ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-31  4:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alexandre Mergnat, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

On 8/30/23 19:30, Krzysztof Kozlowski wrote:
> 	
> 
> External email : Please do not click links or open attachments until you 
> have verified the sender or the content.
> 
> On 30/08/2023 13:15, Macpaul Lin wrote:
>> The dts file for the MediaTek MT8195 demo board has been refactored
>> to improve the configuration of the MT6360 multi-function PMIC.
>> 
>> The changes include:
>>  - Addition of the mt6360.dtsi include file, which contains the common
>>    configuration of the MT6360 for all mt8195 boards.
>>  - Removal of the direct inclusion of the mt6360-regulator.h file.
>>  - Removal of the common configuration of the MT6360 PMIC since
>>    the included mt6360.dtsi is used.
>>  - Add names according to the schematic of mt8195-demo board for
>>    mt6360 nodes.
>> 
>> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> ---
>>  arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++-----------
>>  1 file changed, 74 insertions(+), 99 deletions(-)
>> 
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> index 8aea6f5d72b3..d082d679dbbe 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> @@ -11,7 +11,6 @@
>>  #include <dt-bindings/gpio/gpio.h>
>>  #include <dt-bindings/input/input.h>
>>  #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
>> -#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
>>  
>>  / {
>>  model = "MediaTek MT8195 demo board";
>> @@ -130,103 +129,9 @@
>>  mt6360: pmic@34 {
>>  compatible = "mediatek,mt6360";
>>  reg = <0x34>;
>> -interrupt-controller;
>> +pinctrl-0 = <&mt6360_pins>;
>> +pinctrl-names = "default";
>>  interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>;
>> -interrupt-names = "IRQB";
>> -
>> -charger {
>> -compatible = "mediatek,mt6360-chg";
>> -richtek,vinovp-microvolt = <14500000>;
>> -
>> -otg_vbus_regulator: usb-otg-vbus-regulator {
>> -regulator-compatible = "usb-otg-vbus";
>> -regulator-name = "usb-otg-vbus";
>> -regulator-min-microvolt = <4425000>;
>> -regulator-max-microvolt = <5825000>;
>> -};
>> -};
>> -
>> -regulator {
>> -compatible = "mediatek,mt6360-regulator";
>> -LDO_VIN3-supply = <&mt6360_buck2>;
>> -
>> -mt6360_buck1: buck1 {
> 
> Your patchset does not look bisectable. Does not look tested, either...
> Why having duplicated regulators (?) and then removing correct
> regulators and keeping wrong ones?
> 
>> -regulator-compatible = "BUCK1";
>> -regulator-name = "mt6360,buck1";
>> -regulator-min-microvolt = <300000>;
>> -regulator-max-microvolt = <1300000>;
>> -regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> -   MT6360_OPMODE_LP
>> -   MT6360_OPMODE_ULP>;
>> -regulator-always-on;
>> -};
> 
> ...
> 
>>  };
>>  };
>>  
>> @@ -259,8 +164,8 @@
>>  cap-sd-highspeed;
>>  sd-uhs-sdr50;
>>  sd-uhs-sdr104;
>> -vmmc-supply = <&mt6360_ldo5>;
>> -vqmmc-supply = <&mt6360_ldo3>;
>> +vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>;
>> +vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>;
>>  status = "okay";
>>  };
>>  
>> @@ -300,6 +205,67 @@
>>  regulator-always-on;
>>  };
>>  
>> +#include "mt6360.dtsi"
> 
> Includes are in the top part of the DTS. Sometimes bottom, but never in
> the middle.
> 
> 
> Best regards,
> Krzysztof
> 

MT6360 is an external component controlled by I2C.
On some mt8195 boards, it is connected to I2C6.
But on some smart phone boards, they are connected to I2C5.
I agree to put the includes in the top or in the bottom,
but it to include I2C node together in mt6360.dtsi will be necessary
to avoid build error. It might introduce mt6360-i2c5.dtsi
or mt6360-i2c6.dtsi in the future.

I think the better approach is to expand the common nodes in the board's 
dts, rather than organizing them into dtsi.

Please drop these 2 patches for adding mt6360.dtsi and modification for 
mt8195-demo.dts (patch 3/4 and 4/4) for the patch set.

Thanks for the review. :)
Macpaul Lin


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

* Re: [PATCH v2 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes
@ 2023-08-31  4:06         ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-31  4:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alexandre Mergnat, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun

On 8/30/23 19:30, Krzysztof Kozlowski wrote:
> 	
> 
> External email : Please do not click links or open attachments until you 
> have verified the sender or the content.
> 
> On 30/08/2023 13:15, Macpaul Lin wrote:
>> The dts file for the MediaTek MT8195 demo board has been refactored
>> to improve the configuration of the MT6360 multi-function PMIC.
>> 
>> The changes include:
>>  - Addition of the mt6360.dtsi include file, which contains the common
>>    configuration of the MT6360 for all mt8195 boards.
>>  - Removal of the direct inclusion of the mt6360-regulator.h file.
>>  - Removal of the common configuration of the MT6360 PMIC since
>>    the included mt6360.dtsi is used.
>>  - Add names according to the schematic of mt8195-demo board for
>>    mt6360 nodes.
>> 
>> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> ---
>>  arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 173 ++++++++-----------
>>  1 file changed, 74 insertions(+), 99 deletions(-)
>> 
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> index 8aea6f5d72b3..d082d679dbbe 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> @@ -11,7 +11,6 @@
>>  #include <dt-bindings/gpio/gpio.h>
>>  #include <dt-bindings/input/input.h>
>>  #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
>> -#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
>>  
>>  / {
>>  model = "MediaTek MT8195 demo board";
>> @@ -130,103 +129,9 @@
>>  mt6360: pmic@34 {
>>  compatible = "mediatek,mt6360";
>>  reg = <0x34>;
>> -interrupt-controller;
>> +pinctrl-0 = <&mt6360_pins>;
>> +pinctrl-names = "default";
>>  interrupts-extended = <&pio 101 IRQ_TYPE_EDGE_FALLING>;
>> -interrupt-names = "IRQB";
>> -
>> -charger {
>> -compatible = "mediatek,mt6360-chg";
>> -richtek,vinovp-microvolt = <14500000>;
>> -
>> -otg_vbus_regulator: usb-otg-vbus-regulator {
>> -regulator-compatible = "usb-otg-vbus";
>> -regulator-name = "usb-otg-vbus";
>> -regulator-min-microvolt = <4425000>;
>> -regulator-max-microvolt = <5825000>;
>> -};
>> -};
>> -
>> -regulator {
>> -compatible = "mediatek,mt6360-regulator";
>> -LDO_VIN3-supply = <&mt6360_buck2>;
>> -
>> -mt6360_buck1: buck1 {
> 
> Your patchset does not look bisectable. Does not look tested, either...
> Why having duplicated regulators (?) and then removing correct
> regulators and keeping wrong ones?
> 
>> -regulator-compatible = "BUCK1";
>> -regulator-name = "mt6360,buck1";
>> -regulator-min-microvolt = <300000>;
>> -regulator-max-microvolt = <1300000>;
>> -regulator-allowed-modes = <MT6360_OPMODE_NORMAL
>> -   MT6360_OPMODE_LP
>> -   MT6360_OPMODE_ULP>;
>> -regulator-always-on;
>> -};
> 
> ...
> 
>>  };
>>  };
>>  
>> @@ -259,8 +164,8 @@
>>  cap-sd-highspeed;
>>  sd-uhs-sdr50;
>>  sd-uhs-sdr104;
>> -vmmc-supply = <&mt6360_ldo5>;
>> -vqmmc-supply = <&mt6360_ldo3>;
>> +vmmc-supply = <&mt6360_vmch_pmu_ldo5_reg>;
>> +vqmmc-supply = <&mt6360_vmc_pmu_ldo3_reg>;
>>  status = "okay";
>>  };
>>  
>> @@ -300,6 +205,67 @@
>>  regulator-always-on;
>>  };
>>  
>> +#include "mt6360.dtsi"
> 
> Includes are in the top part of the DTS. Sometimes bottom, but never in
> the middle.
> 
> 
> Best regards,
> Krzysztof
> 

MT6360 is an external component controlled by I2C.
On some mt8195 boards, it is connected to I2C6.
But on some smart phone boards, they are connected to I2C5.
I agree to put the includes in the top or in the bottom,
but it to include I2C node together in mt6360.dtsi will be necessary
to avoid build error. It might introduce mt6360-i2c5.dtsi
or mt6360-i2c6.dtsi in the future.

I think the better approach is to expand the common nodes in the board's 
dts, rather than organizing them into dtsi.

Please drop these 2 patches for adding mt6360.dtsi and modification for 
mt8195-demo.dts (patch 3/4 and 4/4) for the patch set.

Thanks for the review. :)
Macpaul Lin


_______________________________________________
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] 44+ messages in thread

* Re: [PATCH v2 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
  2023-08-30 11:20       ` Krzysztof Kozlowski
@ 2023-08-31  5:32         ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-31  5:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alexandre Mergnat, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun



On 8/30/23 19:20, Krzysztof Kozlowski wrote:
> 	
> 
> External email : Please do not click links or open attachments until you 
> have verified the sender or the content.
> 
> On 30/08/2023 13:15, Macpaul Lin wrote:
>> +
>> +led {
>> +compatible = "mediatek,mt6360-led";
>> +};
>> +
>> +regulator {
>> +compatible = "mediatek,mt6360-regulator";
>> +LDO_VIN3-supply = <&mt6360_emi_vddq_buck2_reg>;
>> +
>> +mt6360_emi_vdd2_buck1_reg: buck1-emi-vdd2 {
> 
> It does not look like you tested the DTS against bindings. Please run
> `make dtbs_check W=1` (see
> Documentation/devicetree/bindings/writing-schema.rst or
> https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/  <https://urldefense.com/v3/__https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/__;!!CTRNKA9wMg0ARbw!nP-6nVffZXG2NCdjcl06my5g9HAohnT-GF-EIGrMWpegsBvwmqgOjfVQba5Ub13z_AWAJwGOlsQ3DSIWGo0ojHlPvDZ74WE$>
> for instructions).
> 
> Best regards,
> Krzysztof
> 
> 

Thanks for the review.
Since next patch 4/4 of the patch set to modify mt6360 nodes in
mt8195-demo.dts is no longer required, please drop this patch, too.

Thanks
Macpaul Lin

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

* Re: [PATCH v2 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes
@ 2023-08-31  5:32         ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-08-31  5:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alexandre Mergnat, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, Chunfeng Yun



On 8/30/23 19:20, Krzysztof Kozlowski wrote:
> 	
> 
> External email : Please do not click links or open attachments until you 
> have verified the sender or the content.
> 
> On 30/08/2023 13:15, Macpaul Lin wrote:
>> +
>> +led {
>> +compatible = "mediatek,mt6360-led";
>> +};
>> +
>> +regulator {
>> +compatible = "mediatek,mt6360-regulator";
>> +LDO_VIN3-supply = <&mt6360_emi_vddq_buck2_reg>;
>> +
>> +mt6360_emi_vdd2_buck1_reg: buck1-emi-vdd2 {
> 
> It does not look like you tested the DTS against bindings. Please run
> `make dtbs_check W=1` (see
> Documentation/devicetree/bindings/writing-schema.rst or
> https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/  <https://urldefense.com/v3/__https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/__;!!CTRNKA9wMg0ARbw!nP-6nVffZXG2NCdjcl06my5g9HAohnT-GF-EIGrMWpegsBvwmqgOjfVQba5Ub13z_AWAJwGOlsQ3DSIWGo0ojHlPvDZ74WE$>
> for instructions).
> 
> Best regards,
> Krzysztof
> 
> 

Thanks for the review.
Since next patch 4/4 of the patch set to modify mt6360 nodes in
mt8195-demo.dts is no longer required, please drop this patch, too.

Thanks
Macpaul Lin

_______________________________________________
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] 44+ messages in thread

* [PATCH v3 1/2] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
  2023-08-25 11:46 ` Macpaul Lin
@ 2023-09-05  3:45   ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-09-05  3:45 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable

The onboard dram of mt8195-demo board is 8GB.

Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes for v2:
Changes for v3:
 - No change.

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index b2485ddfd33b..ff363ab925e9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -48,7 +48,7 @@
 
 	memory@40000000 {
 		device_type = "memory";
-		reg = <0 0x40000000 0 0x80000000>;
+		reg = <0 0x40000000 0x2 0x00000000>;
 	};
 
 	reserved-memory {
-- 
2.18.0


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

* [PATCH v3 1/2] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
@ 2023-09-05  3:45   ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-09-05  3:45 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable

The onboard dram of mt8195-demo board is 8GB.

Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Changes for v2:
Changes for v3:
 - No change.

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index b2485ddfd33b..ff363ab925e9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -48,7 +48,7 @@
 
 	memory@40000000 {
 		device_type = "memory";
-		reg = <0 0x40000000 0 0x80000000>;
+		reg = <0 0x40000000 0x2 0x00000000>;
 	};
 
 	reserved-memory {
-- 
2.18.0


_______________________________________________
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] 44+ messages in thread

* [PATCH v3 2/2] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
  2023-09-05  3:45   ` Macpaul Lin
@ 2023-09-05  3:45     ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-09-05  3:45 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable

The dts file of the MediaTek MT8195 demo board has been updated to include
new reserved memory regions.
These reserved memory regions are:
 - SCP
 - VPU,
 - Sound DMA
 - APU.

These regions are defined with the "shared-dma-pool" compatible property.
In addition, the existing reserved memory regions have been reordered by
their addresses to improve readability and maintainability of the DTS
file.

Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
Fixes: e4a417520101 ("arm64: dts: mediatek: mt8195-demo: fix the memory size of node secmon")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 37 ++++++++++++++++----
 1 file changed, 30 insertions(+), 7 deletions(-)

Changes for v2:
 - No change.

Changes for v3:
 - Fix vpu_mem and apu_mem node according to the result of "make dtbs_check W=1"
 - Fix comment style to Linux for optee node.

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index ff363ab925e9..5d635085fe3f 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -56,13 +56,8 @@
 		#size-cells = <2>;
 		ranges;
 
-		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
-		bl31_secmon_reserved: secmon@54600000 {
-			no-map;
-			reg = <0 0x54600000 0x0 0x200000>;
-		};
-
-		/* 12 MiB reserved for OP-TEE (BL32)
+		/*
+		 * 12 MiB reserved for OP-TEE (BL32)
 		 * +-----------------------+ 0x43e0_0000
 		 * |      SHMEM 2MiB       |
 		 * +-----------------------+ 0x43c0_0000
@@ -75,6 +70,34 @@
 			no-map;
 			reg = <0 0x43200000 0 0x00c00000>;
 		};
+
+		scp_mem: memory@50000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x50000000 0 0x2900000>;
+			no-map;
+		};
+
+		vpu_mem: memory@53000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x53000000 0 0x1400000>; /* 20 MB */
+		};
+
+		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
+		bl31_secmon_mem: memory@54600000 {
+			no-map;
+			reg = <0 0x54600000 0x0 0x200000>;
+		};
+
+		snd_dma_mem: memory@60000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x60000000 0 0x1100000>;
+			no-map;
+		};
+
+		apu_mem: memory@62000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x62000000 0 0x1400000>; /* 20 MB */
+		};
 	};
 };
 
-- 
2.18.0


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

* [PATCH v3 2/2] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
@ 2023-09-05  3:45     ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-09-05  3:45 UTC (permalink / raw)
  To: Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno,
	Fabien Parent, Macpaul Lin, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable

The dts file of the MediaTek MT8195 demo board has been updated to include
new reserved memory regions.
These reserved memory regions are:
 - SCP
 - VPU,
 - Sound DMA
 - APU.

These regions are defined with the "shared-dma-pool" compatible property.
In addition, the existing reserved memory regions have been reordered by
their addresses to improve readability and maintainability of the DTS
file.

Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
Fixes: e4a417520101 ("arm64: dts: mediatek: mt8195-demo: fix the memory size of node secmon")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 37 ++++++++++++++++----
 1 file changed, 30 insertions(+), 7 deletions(-)

Changes for v2:
 - No change.

Changes for v3:
 - Fix vpu_mem and apu_mem node according to the result of "make dtbs_check W=1"
 - Fix comment style to Linux for optee node.

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
index ff363ab925e9..5d635085fe3f 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
@@ -56,13 +56,8 @@
 		#size-cells = <2>;
 		ranges;
 
-		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
-		bl31_secmon_reserved: secmon@54600000 {
-			no-map;
-			reg = <0 0x54600000 0x0 0x200000>;
-		};
-
-		/* 12 MiB reserved for OP-TEE (BL32)
+		/*
+		 * 12 MiB reserved for OP-TEE (BL32)
 		 * +-----------------------+ 0x43e0_0000
 		 * |      SHMEM 2MiB       |
 		 * +-----------------------+ 0x43c0_0000
@@ -75,6 +70,34 @@
 			no-map;
 			reg = <0 0x43200000 0 0x00c00000>;
 		};
+
+		scp_mem: memory@50000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x50000000 0 0x2900000>;
+			no-map;
+		};
+
+		vpu_mem: memory@53000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x53000000 0 0x1400000>; /* 20 MB */
+		};
+
+		/* 2 MiB reserved for ARM Trusted Firmware (BL31) */
+		bl31_secmon_mem: memory@54600000 {
+			no-map;
+			reg = <0 0x54600000 0x0 0x200000>;
+		};
+
+		snd_dma_mem: memory@60000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x60000000 0 0x1100000>;
+			no-map;
+		};
+
+		apu_mem: memory@62000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x62000000 0 0x1400000>; /* 20 MB */
+		};
 	};
 };
 
-- 
2.18.0


_______________________________________________
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] 44+ messages in thread

* Re: [PATCH v3 1/2] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
  2023-09-05  3:45   ` Macpaul Lin
@ 2023-09-05  8:00     ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 44+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-05  8:00 UTC (permalink / raw)
  To: Macpaul Lin, Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable

Il 05/09/23 05:45, Macpaul Lin ha scritto:
> The onboard dram of mt8195-demo board is 8GB.
> 
> Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
> Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>   arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Changes for v2:
> Changes for v3:
>   - No change.
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> index b2485ddfd33b..ff363ab925e9 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> @@ -48,7 +48,7 @@
>   
>   	memory@40000000 {
>   		device_type = "memory";
> -		reg = <0 0x40000000 0 0x80000000>;
> +		reg = <0 0x40000000 0x2 0x00000000>;

Shouldn't this get automatically filled in by the bootloader?
Usually, that's the case: if it is, then the right thing to do here
is to change this property to

		/* The bootloader will fill in the size */
		reg = <0x0 0x40000000 0x0 0x0>;

Regards,
Angelo

>   	};
>   
>   	reserved-memory {



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

* Re: [PATCH v3 1/2] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
@ 2023-09-05  8:00     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 44+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-05  8:00 UTC (permalink / raw)
  To: Macpaul Lin, Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable

Il 05/09/23 05:45, Macpaul Lin ha scritto:
> The onboard dram of mt8195-demo board is 8GB.
> 
> Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
> Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
>   arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Changes for v2:
> Changes for v3:
>   - No change.
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> index b2485ddfd33b..ff363ab925e9 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> @@ -48,7 +48,7 @@
>   
>   	memory@40000000 {
>   		device_type = "memory";
> -		reg = <0 0x40000000 0 0x80000000>;
> +		reg = <0 0x40000000 0x2 0x00000000>;

Shouldn't this get automatically filled in by the bootloader?
Usually, that's the case: if it is, then the right thing to do here
is to change this property to

		/* The bootloader will fill in the size */
		reg = <0x0 0x40000000 0x0 0x0>;

Regards,
Angelo

>   	};
>   
>   	reserved-memory {



_______________________________________________
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] 44+ messages in thread

* Re: [PATCH v3 2/2] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
  2023-09-05  3:45     ` Macpaul Lin
@ 2023-09-05  8:01       ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 44+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-05  8:01 UTC (permalink / raw)
  To: Macpaul Lin, Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable

Il 05/09/23 05:45, Macpaul Lin ha scritto:
> The dts file of the MediaTek MT8195 demo board has been updated to include
> new reserved memory regions.
> These reserved memory regions are:
>   - SCP
>   - VPU,
>   - Sound DMA
>   - APU.
> 
> These regions are defined with the "shared-dma-pool" compatible property.
> In addition, the existing reserved memory regions have been reordered by
> their addresses to improve readability and maintainability of the DTS
> file.
> 
> Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
> Fixes: e4a417520101 ("arm64: dts: mediatek: mt8195-demo: fix the memory size of node secmon")
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>


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



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

* Re: [PATCH v3 2/2] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
@ 2023-09-05  8:01       ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 44+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-05  8:01 UTC (permalink / raw)
  To: Macpaul Lin, Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable

Il 05/09/23 05:45, Macpaul Lin ha scritto:
> The dts file of the MediaTek MT8195 demo board has been updated to include
> new reserved memory regions.
> These reserved memory regions are:
>   - SCP
>   - VPU,
>   - Sound DMA
>   - APU.
> 
> These regions are defined with the "shared-dma-pool" compatible property.
> In addition, the existing reserved memory regions have been reordered by
> their addresses to improve readability and maintainability of the DTS
> file.
> 
> Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
> Fixes: e4a417520101 ("arm64: dts: mediatek: mt8195-demo: fix the memory size of node secmon")
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>


Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.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] 44+ messages in thread

* Re: [PATCH v3 1/2] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
  2023-09-05  8:00     ` AngeloGioacchino Del Regno
@ 2023-09-05  8:15       ` Macpaul Lin
  -1 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-09-05  8:15 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, Alexandre Mergnat, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Fabien Parent, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable



On 9/5/23 16:00, AngeloGioacchino Del Regno wrote:
> Il 05/09/23 05:45, Macpaul Lin ha scritto:
>> The onboard dram of mt8195-demo board is 8GB.
>>
>> Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
>> Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 
>> Demo board")
>> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> ---
>>   arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Changes for v2:
>> Changes for v3:
>>   - No change.
>>
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts 
>> b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> index b2485ddfd33b..ff363ab925e9 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> @@ -48,7 +48,7 @@
>>       memory@40000000 {
>>           device_type = "memory";
>> -        reg = <0 0x40000000 0 0x80000000>;
>> +        reg = <0 0x40000000 0x2 0x00000000>;
> 
> Shouldn't this get automatically filled in by the bootloader?
> Usually, that's the case: if it is, then the right thing to do here
> is to change this property to
> 
>          /* The bootloader will fill in the size */
>          reg = <0x0 0x40000000 0x0 0x0>;
> 
> Regards,
> Angelo
> 

Thanks for the review. However, this value seems depends on the boot 
method. Take u-boot as the example, the total memory size which Linux 
kernel get will be different via EBBR boot or fitImage boot.

It the system is booted through EBBR, the memory size should be filled 
by u-boot's UEFI variables, which is from u-boot's dts file. If the 
system is booted from fitImage, the memory size should be filled by 
kernel's dts file which is usually packed with fitImage. That's why we 
still need this fix.

>>       };
>>       reserved-memory {
> 
> 

Thanks.
Macpaul Lin

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

* Re: [PATCH v3 1/2] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
@ 2023-09-05  8:15       ` Macpaul Lin
  0 siblings, 0 replies; 44+ messages in thread
From: Macpaul Lin @ 2023-09-05  8:15 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, Alexandre Mergnat, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Fabien Parent, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable



On 9/5/23 16:00, AngeloGioacchino Del Regno wrote:
> Il 05/09/23 05:45, Macpaul Lin ha scritto:
>> The onboard dram of mt8195-demo board is 8GB.
>>
>> Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
>> Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 
>> Demo board")
>> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
>> ---
>>   arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Changes for v2:
>> Changes for v3:
>>   - No change.
>>
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts 
>> b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> index b2485ddfd33b..ff363ab925e9 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
>> @@ -48,7 +48,7 @@
>>       memory@40000000 {
>>           device_type = "memory";
>> -        reg = <0 0x40000000 0 0x80000000>;
>> +        reg = <0 0x40000000 0x2 0x00000000>;
> 
> Shouldn't this get automatically filled in by the bootloader?
> Usually, that's the case: if it is, then the right thing to do here
> is to change this property to
> 
>          /* The bootloader will fill in the size */
>          reg = <0x0 0x40000000 0x0 0x0>;
> 
> Regards,
> Angelo
> 

Thanks for the review. However, this value seems depends on the boot 
method. Take u-boot as the example, the total memory size which Linux 
kernel get will be different via EBBR boot or fitImage boot.

It the system is booted through EBBR, the memory size should be filled 
by u-boot's UEFI variables, which is from u-boot's dts file. If the 
system is booted from fitImage, the memory size should be filled by 
kernel's dts file which is usually packed with fitImage. That's why we 
still need this fix.

>>       };
>>       reserved-memory {
> 
> 

Thanks.
Macpaul Lin

_______________________________________________
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] 44+ messages in thread

* Re: [PATCH v3 1/2] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
  2023-09-05  3:45   ` Macpaul Lin
@ 2023-09-07  9:15     ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 44+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-07  9:15 UTC (permalink / raw)
  To: Macpaul Lin, Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable

Il 05/09/23 05:45, Macpaul Lin ha scritto:
> The onboard dram of mt8195-demo board is 8GB.
> 
> Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
> Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>

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

> ---
>   arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Changes for v2:
> Changes for v3:
>   - No change.
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> index b2485ddfd33b..ff363ab925e9 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> @@ -48,7 +48,7 @@
>   
>   	memory@40000000 {
>   		device_type = "memory";
> -		reg = <0 0x40000000 0 0x80000000>;
> +		reg = <0 0x40000000 0x2 0x00000000>;
>   	};
>   
>   	reserved-memory {


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

* Re: [PATCH v3 1/2] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
@ 2023-09-07  9:15     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 44+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-07  9:15 UTC (permalink / raw)
  To: Macpaul Lin, Alexandre Mergnat, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, Fabien Parent, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek
  Cc: Bear Wang, Pablo Sun, Macpaul Lin, stable

Il 05/09/23 05:45, Macpaul Lin ha scritto:
> The onboard dram of mt8195-demo board is 8GB.
> 
> Cc: stable@vger.kernel.org      # 6.1, 6.4, 6.5
> Fixes: 6147314aeedc ("arm64: dts: mediatek: Add device-tree for MT8195 Demo board")
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>

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

> ---
>   arch/arm64/boot/dts/mediatek/mt8195-demo.dts | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Changes for v2:
> Changes for v3:
>   - No change.
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> index b2485ddfd33b..ff363ab925e9 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-demo.dts
> @@ -48,7 +48,7 @@
>   
>   	memory@40000000 {
>   		device_type = "memory";
> -		reg = <0 0x40000000 0 0x80000000>;
> +		reg = <0 0x40000000 0x2 0x00000000>;
>   	};
>   
>   	reserved-memory {


_______________________________________________
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] 44+ messages in thread

end of thread, other threads:[~2023-09-07 16:01 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-25 11:46 [PATCH 1/4] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB Macpaul Lin
2023-08-25 11:46 ` Macpaul Lin
2023-08-25 11:46 ` [PATCH 2/4] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions Macpaul Lin
2023-08-25 11:46   ` Macpaul Lin
2023-08-25 11:46 ` [PATCH 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes Macpaul Lin
2023-08-25 11:46   ` Macpaul Lin
2023-08-28  4:36   ` Chen-Yu Tsai
2023-08-28  4:36     ` Chen-Yu Tsai
2023-08-28  9:59     ` Macpaul Lin
2023-08-28  9:59       ` Macpaul Lin
2023-08-28 10:51       ` Chen-Yu Tsai
2023-08-28 10:51         ` Chen-Yu Tsai
2023-08-30 11:10         ` Macpaul Lin
2023-08-30 11:10           ` Macpaul Lin
2023-08-25 11:46 ` [PATCH 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes Macpaul Lin
2023-08-25 11:46   ` Macpaul Lin
2023-08-30 11:15 ` [PATCH v2 1/4] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB Macpaul Lin
2023-08-30 11:15   ` Macpaul Lin
2023-08-30 11:15   ` [PATCH v2 2/4] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions Macpaul Lin
2023-08-30 11:15     ` Macpaul Lin
2023-08-30 11:15   ` [PATCH v2 3/4] arm64: dts: mediatek: mt6360: add PMIC MT6360 related nodes Macpaul Lin
2023-08-30 11:15     ` Macpaul Lin
2023-08-30 11:20     ` Krzysztof Kozlowski
2023-08-30 11:20       ` Krzysztof Kozlowski
2023-08-31  5:32       ` Macpaul Lin
2023-08-31  5:32         ` Macpaul Lin
2023-08-30 11:15   ` [PATCH v2 4/4] arm64: dts: mediatek: mt8195-demo: simplify mt6360 nodes Macpaul Lin
2023-08-30 11:15     ` Macpaul Lin
2023-08-30 11:30     ` Krzysztof Kozlowski
2023-08-30 11:30       ` Krzysztof Kozlowski
2023-08-31  4:06       ` Macpaul Lin
2023-08-31  4:06         ` Macpaul Lin
2023-09-05  3:45 ` [PATCH v3 1/2] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB Macpaul Lin
2023-09-05  3:45   ` Macpaul Lin
2023-09-05  3:45   ` [PATCH v3 2/2] arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions Macpaul Lin
2023-09-05  3:45     ` Macpaul Lin
2023-09-05  8:01     ` AngeloGioacchino Del Regno
2023-09-05  8:01       ` AngeloGioacchino Del Regno
2023-09-05  8:00   ` [PATCH v3 1/2] arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB AngeloGioacchino Del Regno
2023-09-05  8:00     ` AngeloGioacchino Del Regno
2023-09-05  8:15     ` Macpaul Lin
2023-09-05  8:15       ` Macpaul Lin
2023-09-07  9:15   ` AngeloGioacchino Del Regno
2023-09-07  9:15     ` AngeloGioacchino Del Regno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.