Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] MT8195 Acer Tomato - devicetrees Part 3
@ 2023-04-20  9:44 AngeloGioacchino Del Regno
  2023-04-20  9:44 ` [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration AngeloGioacchino Del Regno
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-20  9:44 UTC (permalink / raw)
  To: matthias.bgg
  Cc: robh+dt, krzysztof.kozlowski+dt, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel,
	AngeloGioacchino Del Regno

This series adds support for the WiFi card on PCI-Express,
eDP (internal) and DP (external) displays and adds thermal
configuration for the "extra" thermistors present on Cherry boards.

All Cherry Chromebooks now have working display and wireless
connectivity!

At this point, the only missing component is vcodec decoders, but
that's to be done in mt8195.dtsi, globally, not machine specific.
Please note that in this series the eDP panel was put on aux-bus,
hence this depends on the series introducing support for it [1]
in the mtk-dp driver.

[1]: https://lore.kernel.org/lkml/20230404104800.301150-1-angelogioacchino.delregno@collabora.com/

AngeloGioacchino Del Regno (5):
  arm64: dts: mediatek: cherry: Add platform thermal configuration
  arm64: dts: mediatek: cherry: Assign dp-intf aliases
  arm64: dts: mediatek: cherry: Configure eDP and internal display
  arm64: dts: mediatek: cherry: Enable PCI-Express ports for WiFi
  arm64: dts: mediatek: cherry-tomato-r1: Enable NVMe PCI-Express port

 .../dts/mediatek/mt8195-cherry-tomato-r1.dts  |   7 +
 .../boot/dts/mediatek/mt8195-cherry.dtsi      | 164 ++++++++++++++++++
 2 files changed, 171 insertions(+)

-- 
2.40.0



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

* [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration
  2023-04-20  9:44 [PATCH 0/5] MT8195 Acer Tomato - devicetrees Part 3 AngeloGioacchino Del Regno
@ 2023-04-20  9:44 ` AngeloGioacchino Del Regno
  2023-04-21  7:37   ` Chen-Yu Tsai
  2023-04-20  9:44 ` [PATCH 2/5] arm64: dts: mediatek: cherry: Assign dp-intf aliases AngeloGioacchino Del Regno
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-20  9:44 UTC (permalink / raw)
  To: matthias.bgg
  Cc: robh+dt, krzysztof.kozlowski+dt, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel,
	AngeloGioacchino Del Regno

This platform has three auxiliary NTC thermistors, connected to the
SoC's ADC pins. Enable the auxadc in order to be able to read the
ADC values, add a generic-adc-thermal LUT for each and finally assign
them to the SoC's thermal zones.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 8ac80a136c37..0820e9ba3829 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -114,6 +114,77 @@ ppvar_sys: regulator-ppvar-sys {
 		regulator-boot-on;
 	};
 
+	/* Murata NCP03WF104F05RL */
+	tboard_thermistor1: thermal-sensor-t1 {
+		compatible = "generic-adc-thermal";
+		#thermal-sensor-cells = <0>;
+		io-channels = <&auxadc 0>;
+		io-channel-names = "sensor-channel";
+		temperature-lookup-table = <	(-10000) 1553
+						(-5000) 1485
+						0 1406
+						5000 1317
+						10000 1219
+						15000 1115
+						20000 1007
+						25000 900
+						30000 796
+						35000 697
+						40000 605
+						45000 523
+						50000 449
+						55000 384
+						60000 327
+						65000 279
+						70000 237
+						75000 202
+						80000 172
+						85000 147
+						90000 125
+						95000 107
+						100000 92
+						105000 79
+						110000 68
+						115000 59
+						120000 51
+						125000 44>;
+	};
+
+	tboard_thermistor2: thermal-sensor-t2 {
+		compatible = "generic-adc-thermal";
+		#thermal-sensor-cells = <0>;
+		io-channels = <&auxadc 1>;
+		io-channel-names = "sensor-channel";
+		temperature-lookup-table = <	(-10000) 1553
+						(-5000) 1485
+						0 1406
+						5000 1317
+						10000 1219
+						15000 1115
+						20000 1007
+						25000 900
+						30000 796
+						35000 697
+						40000 605
+						45000 523
+						50000 449
+						55000 384
+						60000 327
+						65000 279
+						70000 237
+						75000 202
+						80000 172
+						85000 147
+						90000 125
+						95000 107
+						100000 92
+						105000 79
+						110000 68
+						115000 59
+						120000 51
+						125000 44>;
+	};
+
 	usb_vbus: regulator-5v0-usb-vbus {
 		compatible = "regulator-fixed";
 		regulator-name = "usb-vbus";
@@ -260,6 +331,10 @@ &gpu {
 	mali-supply = <&mt6315_7_vbuck1>;
 };
 
+&auxadc {
+	status = "okay";
+};
+
 &i2c0 {
 	status = "okay";
 
@@ -1098,6 +1173,36 @@ mt6315_7_vbuck1: vbuck1 {
 	};
 };
 
+&thermal_zones {
+	soc_area_ntc {
+		polling-delay = <1000>;
+		polling-delay-passive = <250>;
+		thermal-sensors = <&tboard_thermistor1>;
+
+		trips {
+			trip-crit {
+				temperature = <95000>;
+				hysteresis = <2000>;
+				type = "critical";
+			};
+		};
+	};
+
+	pmic_area_ntc {
+		polling-delay = <1000>;
+		polling-delay-passive = <0>;
+		thermal-sensors = <&tboard_thermistor2>;
+
+		trips {
+			trip-crit {
+				temperature = <95000>;
+				hysteresis = <2000>;
+				type = "critical";
+			};
+		};
+	};
+};
+
 &u3phy0 {
 	status = "okay";
 };
-- 
2.40.0



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

* [PATCH 2/5] arm64: dts: mediatek: cherry: Assign dp-intf aliases
  2023-04-20  9:44 [PATCH 0/5] MT8195 Acer Tomato - devicetrees Part 3 AngeloGioacchino Del Regno
  2023-04-20  9:44 ` [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration AngeloGioacchino Del Regno
@ 2023-04-20  9:44 ` AngeloGioacchino Del Regno
  2023-04-21  6:46   ` Chen-Yu Tsai
  2023-04-20  9:44 ` [PATCH 3/5] arm64: dts: mediatek: cherry: Configure eDP and internal display AngeloGioacchino Del Regno
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-20  9:44 UTC (permalink / raw)
  To: matthias.bgg
  Cc: robh+dt, krzysztof.kozlowski+dt, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel,
	AngeloGioacchino Del Regno

On Cherry boards, the IP at 0x1c015000 (dp_intf0) is used as primary
dp-intf, while the other at 0x1c113000 (dp_intf1) is used as secondary:
assign them to dp-intf{0,1} aliases respectively.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 0820e9ba3829..918380697a9a 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -10,6 +10,8 @@
 
 / {
 	aliases {
+		dp-intf0 = &dp_intf0;
+		dp-intf1 = &dp_intf1;
 		i2c0 = &i2c0;
 		i2c1 = &i2c1;
 		i2c2 = &i2c2;
-- 
2.40.0



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

* [PATCH 3/5] arm64: dts: mediatek: cherry: Configure eDP and internal display
  2023-04-20  9:44 [PATCH 0/5] MT8195 Acer Tomato - devicetrees Part 3 AngeloGioacchino Del Regno
  2023-04-20  9:44 ` [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration AngeloGioacchino Del Regno
  2023-04-20  9:44 ` [PATCH 2/5] arm64: dts: mediatek: cherry: Assign dp-intf aliases AngeloGioacchino Del Regno
@ 2023-04-20  9:44 ` AngeloGioacchino Del Regno
  2023-04-21  6:57   ` Chen-Yu Tsai
  2023-04-20  9:44 ` [PATCH 4/5] arm64: dts: mediatek: cherry: Enable PCI-Express ports for WiFi AngeloGioacchino Del Regno
  2023-04-20  9:44 ` [PATCH 5/5] arm64: dts: mediatek: cherry-tomato-r1: Enable NVMe PCI-Express port AngeloGioacchino Del Regno
  4 siblings, 1 reply; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-20  9:44 UTC (permalink / raw)
  To: matthias.bgg
  Cc: robh+dt, krzysztof.kozlowski+dt, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel,
	AngeloGioacchino Del Regno

Add the required nodes to enable the DisplayPort interface, connected
to the Embedded DisplayPort port, where we have an internal display.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 918380697a9a..46f1c8091498 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -49,6 +49,18 @@ memory@40000000 {
 		reg = <0 0x40000000 0 0x80000000>;
 	};
 
+	pp3300_disp_x: regulator-pp3300-disp-x {
+		compatible = "regulator-fixed";
+		regulator-name = "pp3300_disp_x";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		enable-active-high;
+		gpio = <&pio 55 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&panel_fixed_pins>;
+		regulator-always-on;
+	};
+
 	/* system wide LDO 3.3V power rail */
 	pp3300_z5: regulator-pp3300-ldo-z5 {
 		compatible = "regulator-fixed";
@@ -290,6 +302,20 @@ port@1 {
 			reg = <1>;
 			edp_out: endpoint {
 				data-lanes = <0 1 2 3>;
+				remote-endpoint = <&panel_in>;
+			};
+		};
+	};
+
+	aux-bus {
+		panel {
+			compatible = "edp-panel";
+			power-supply = <&pp3300_disp_x>;
+			backlight = <&backlight_lcd0>;
+			port {
+				panel_in: endpoint {
+					remote-endpoint = <&edp_out>;
+				};
 			};
 		};
 	};
@@ -929,6 +955,12 @@ pins-cs {
 		};
 	};
 
+	panel_fixed_pins: panel-pwr-default-pins {
+		pins-vreg-en {
+			pinmux = <PINMUX_GPIO55__FUNC_GPIO55>;
+		};
+	};
+
 	pio_default: pio-default-pins {
 		pins-wifi-enable {
 			pinmux = <PINMUX_GPIO58__FUNC_GPIO58>;
-- 
2.40.0



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

* [PATCH 4/5] arm64: dts: mediatek: cherry: Enable PCI-Express ports for WiFi
  2023-04-20  9:44 [PATCH 0/5] MT8195 Acer Tomato - devicetrees Part 3 AngeloGioacchino Del Regno
                   ` (2 preceding siblings ...)
  2023-04-20  9:44 ` [PATCH 3/5] arm64: dts: mediatek: cherry: Configure eDP and internal display AngeloGioacchino Del Regno
@ 2023-04-20  9:44 ` AngeloGioacchino Del Regno
  2023-04-21  7:07   ` Chen-Yu Tsai
  2023-04-20  9:44 ` [PATCH 5/5] arm64: dts: mediatek: cherry-tomato-r1: Enable NVMe PCI-Express port AngeloGioacchino Del Regno
  4 siblings, 1 reply; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-20  9:44 UTC (permalink / raw)
  To: matthias.bgg
  Cc: robh+dt, krzysztof.kozlowski+dt, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel,
	AngeloGioacchino Del Regno

On the Cherry platform, a MT7621 WiFi+Bluetooth combo is connected
over PCI-Express (for WiFi) and USB (for BT): enable the PCIe ports
to enable enumerating this chip.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 46f1c8091498..9e2bc363c9cd 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -567,6 +567,13 @@ flash@0 {
 	};
 };
 
+&pcie1 {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie1_pins_default>;
+};
+
 &pio {
 	mediatek,rsel-resistance-in-si-unit;
 	pinctrl-names = "default";
@@ -961,6 +968,24 @@ pins-vreg-en {
 		};
 	};
 
+	pcie0_pins_default: pcie0-default-pins {
+		pins-bus {
+			pinmux = <PINMUX_GPIO19__FUNC_WAKEN>,
+				 <PINMUX_GPIO20__FUNC_PERSTN>,
+				 <PINMUX_GPIO21__FUNC_CLKREQN>;
+				 bias-pull-up;
+		};
+	};
+
+	pcie1_pins_default: pcie1-default-pins {
+		pins-bus {
+			pinmux = <PINMUX_GPIO22__FUNC_PERSTN_1>,
+				 <PINMUX_GPIO23__FUNC_CLKREQN_1>,
+				 <PINMUX_GPIO24__FUNC_WAKEN_1>;
+				 bias-pull-up;
+		};
+	};
+
 	pio_default: pio-default-pins {
 		pins-wifi-enable {
 			pinmux = <PINMUX_GPIO58__FUNC_GPIO58>;
-- 
2.40.0



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

* [PATCH 5/5] arm64: dts: mediatek: cherry-tomato-r1: Enable NVMe PCI-Express port
  2023-04-20  9:44 [PATCH 0/5] MT8195 Acer Tomato - devicetrees Part 3 AngeloGioacchino Del Regno
                   ` (3 preceding siblings ...)
  2023-04-20  9:44 ` [PATCH 4/5] arm64: dts: mediatek: cherry: Enable PCI-Express ports for WiFi AngeloGioacchino Del Regno
@ 2023-04-20  9:44 ` AngeloGioacchino Del Regno
  2023-04-21  7:59   ` Chen-Yu Tsai
  4 siblings, 1 reply; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-20  9:44 UTC (permalink / raw)
  To: matthias.bgg
  Cc: robh+dt, krzysztof.kozlowski+dt, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel,
	AngeloGioacchino Del Regno

On Tomato rev1 the PCIe0 controller is used for NVMe storage.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
index 2d5e8f371b6d..11fc83ddf236 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
@@ -20,6 +20,13 @@ &sound {
 	model = "mt8195_r1019_5682";
 };
 
+&pcie0 {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie0_pins_default>;
+};
+
 &ts_10 {
 	status = "okay";
 };
-- 
2.40.0



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

* Re: [PATCH 2/5] arm64: dts: mediatek: cherry: Assign dp-intf aliases
  2023-04-20  9:44 ` [PATCH 2/5] arm64: dts: mediatek: cherry: Assign dp-intf aliases AngeloGioacchino Del Regno
@ 2023-04-21  6:46   ` Chen-Yu Tsai
  2023-04-24  7:03     ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2023-04-21  6:46 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> On Cherry boards, the IP at 0x1c015000 (dp_intf0) is used as primary
> dp-intf, while the other at 0x1c113000 (dp_intf1) is used as secondary:
> assign them to dp-intf{0,1} aliases respectively.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 2 ++

This should be applied at the SoC level. The display pipeline is fixed in
MMSYS, so it applies to all MT8195 devices.

>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> index 0820e9ba3829..918380697a9a 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> @@ -10,6 +10,8 @@
>
>  / {
>         aliases {
> +               dp-intf0 = &dp_intf0;
> +               dp-intf1 = &dp_intf1;
>                 i2c0 = &i2c0;
>                 i2c1 = &i2c1;
>                 i2c2 = &i2c2;
> --
> 2.40.0
>
>


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

* Re: [PATCH 3/5] arm64: dts: mediatek: cherry: Configure eDP and internal display
  2023-04-20  9:44 ` [PATCH 3/5] arm64: dts: mediatek: cherry: Configure eDP and internal display AngeloGioacchino Del Regno
@ 2023-04-21  6:57   ` Chen-Yu Tsai
  0 siblings, 0 replies; 21+ messages in thread
From: Chen-Yu Tsai @ 2023-04-21  6:57 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Add the required nodes to enable the DisplayPort interface, connected
> to the Embedded DisplayPort port, where we have an internal display.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../boot/dts/mediatek/mt8195-cherry.dtsi      | 32 +++++++++++++++++++
>  1 file changed, 32 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> index 918380697a9a..46f1c8091498 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> @@ -49,6 +49,18 @@ memory@40000000 {
>                 reg = <0 0x40000000 0 0x80000000>;
>         };
>
> +       pp3300_disp_x: regulator-pp3300-disp-x {
> +               compatible = "regulator-fixed";
> +               regulator-name = "pp3300_disp_x";
> +               regulator-min-microvolt = <3300000>;
> +               regulator-max-microvolt = <3300000>;

From the schematics:
                  vin-supply = <&pp3300_z2>;

Also, this is an RT9742. The datasheet says the typical enable time is
2.1ms. For a bit of margin, I'd say we could model it as 2.5ms? So:

                  regulator-enable-ramp-delay = <2500>;

ChenYu

> +               enable-active-high;
> +               gpio = <&pio 55 GPIO_ACTIVE_HIGH>;
> +               pinctrl-names = "default";
> +               pinctrl-0 = <&panel_fixed_pins>;
> +               regulator-always-on;
> +       };
> +
>         /* system wide LDO 3.3V power rail */
>         pp3300_z5: regulator-pp3300-ldo-z5 {
>                 compatible = "regulator-fixed";
> @@ -290,6 +302,20 @@ port@1 {
>                         reg = <1>;
>                         edp_out: endpoint {
>                                 data-lanes = <0 1 2 3>;
> +                               remote-endpoint = <&panel_in>;
> +                       };
> +               };
> +       };
> +
> +       aux-bus {
> +               panel {
> +                       compatible = "edp-panel";
> +                       power-supply = <&pp3300_disp_x>;
> +                       backlight = <&backlight_lcd0>;
> +                       port {
> +                               panel_in: endpoint {
> +                                       remote-endpoint = <&edp_out>;
> +                               };
>                         };
>                 };
>         };
> @@ -929,6 +955,12 @@ pins-cs {
>                 };
>         };
>
> +       panel_fixed_pins: panel-pwr-default-pins {
> +               pins-vreg-en {
> +                       pinmux = <PINMUX_GPIO55__FUNC_GPIO55>;
> +               };
> +       };
> +
>         pio_default: pio-default-pins {
>                 pins-wifi-enable {
>                         pinmux = <PINMUX_GPIO58__FUNC_GPIO58>;
> --
> 2.40.0
>
>


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

* Re: [PATCH 4/5] arm64: dts: mediatek: cherry: Enable PCI-Express ports for WiFi
  2023-04-20  9:44 ` [PATCH 4/5] arm64: dts: mediatek: cherry: Enable PCI-Express ports for WiFi AngeloGioacchino Del Regno
@ 2023-04-21  7:07   ` Chen-Yu Tsai
  0 siblings, 0 replies; 21+ messages in thread
From: Chen-Yu Tsai @ 2023-04-21  7:07 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> On the Cherry platform, a MT7621 WiFi+Bluetooth combo is connected
> over PCI-Express (for WiFi) and USB (for BT): enable the PCIe ports
> to enable enumerating this chip.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Tested-by: Chen-Yu Tsai <wenst@chromium.org>


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

* Re: [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration
  2023-04-20  9:44 ` [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration AngeloGioacchino Del Regno
@ 2023-04-21  7:37   ` Chen-Yu Tsai
  2023-04-21 20:53     ` Nícolas F. R. A. Prado
  0 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2023-04-21  7:37 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> This platform has three auxiliary NTC thermistors, connected to the
> SoC's ADC pins. Enable the auxadc in order to be able to read the
> ADC values, add a generic-adc-thermal LUT for each and finally assign
> them to the SoC's thermal zones.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../boot/dts/mediatek/mt8195-cherry.dtsi      | 105 ++++++++++++++++++
>  1 file changed, 105 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> index 8ac80a136c37..0820e9ba3829 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> @@ -114,6 +114,77 @@ ppvar_sys: regulator-ppvar-sys {
>                 regulator-boot-on;
>         };
>
> +       /* Murata NCP03WF104F05RL */
> +       tboard_thermistor1: thermal-sensor-t1 {
> +               compatible = "generic-adc-thermal";
> +               #thermal-sensor-cells = <0>;
> +               io-channels = <&auxadc 0>;
> +               io-channel-names = "sensor-channel";
> +               temperature-lookup-table = <    (-10000) 1553
> +                                               (-5000) 1485
> +                                               0 1406
> +                                               5000 1317
> +                                               10000 1219
> +                                               15000 1115
> +                                               20000 1007
> +                                               25000 900
> +                                               30000 796
> +                                               35000 697
> +                                               40000 605
> +                                               45000 523
> +                                               50000 449
> +                                               55000 384
> +                                               60000 327
> +                                               65000 279
> +                                               70000 237
> +                                               75000 202
> +                                               80000 172
> +                                               85000 147
> +                                               90000 125
> +                                               95000 107
> +                                               100000 92
> +                                               105000 79
> +                                               110000 68
> +                                               115000 59
> +                                               120000 51
> +                                               125000 44>;
> +       };
> +
> +       tboard_thermistor2: thermal-sensor-t2 {
> +               compatible = "generic-adc-thermal";
> +               #thermal-sensor-cells = <0>;
> +               io-channels = <&auxadc 1>;
> +               io-channel-names = "sensor-channel";
> +               temperature-lookup-table = <    (-10000) 1553
> +                                               (-5000) 1485
> +                                               0 1406
> +                                               5000 1317
> +                                               10000 1219
> +                                               15000 1115
> +                                               20000 1007
> +                                               25000 900
> +                                               30000 796
> +                                               35000 697
> +                                               40000 605
> +                                               45000 523
> +                                               50000 449
> +                                               55000 384
> +                                               60000 327
> +                                               65000 279
> +                                               70000 237
> +                                               75000 202
> +                                               80000 172
> +                                               85000 147
> +                                               90000 125
> +                                               95000 107
> +                                               100000 92
> +                                               105000 79
> +                                               110000 68
> +                                               115000 59
> +                                               120000 51
> +                                               125000 44>;
> +       };
> +
>         usb_vbus: regulator-5v0-usb-vbus {
>                 compatible = "regulator-fixed";
>                 regulator-name = "usb-vbus";
> @@ -260,6 +331,10 @@ &gpu {
>         mali-supply = <&mt6315_7_vbuck1>;
>  };
>
> +&auxadc {
> +       status = "okay";
> +};
> +
>  &i2c0 {
>         status = "okay";
>
> @@ -1098,6 +1173,36 @@ mt6315_7_vbuck1: vbuck1 {
>         };
>  };
>
> +&thermal_zones {
> +       soc_area_ntc {
> +               polling-delay = <1000>;
> +               polling-delay-passive = <250>;
> +               thermal-sensors = <&tboard_thermistor1>;
> +
> +               trips {
> +                       trip-crit {
> +                               temperature = <95000>;
> +                               hysteresis = <2000>;
> +                               type = "critical";
> +                       };
> +               };
> +       };
> +
> +       pmic_area_ntc {
> +               polling-delay = <1000>;
> +               polling-delay-passive = <0>;
> +               thermal-sensors = <&tboard_thermistor2>;
> +
> +               trips {
> +                       trip-crit {
> +                               temperature = <95000>;
> +                               hysteresis = <2000>;
> +                               type = "critical";
> +                       };
> +               };
> +       };

I'm still getting:

thermal_sys: Failed to find 'trips' node
thermal_sys: Failed to find trip points for thermal-sensor-t1 id=0
generic-adc-thermal thermal-sensor-t1: Thermal zone sensor register failed: -22
generic-adc-thermal: probe of thermal-sensor-t1 failed with error -22
thermal_sys: Failed to find 'trips' node
thermal_sys: Failed to find trip points for thermal-sensor-t2 id=0
generic-adc-thermal thermal-sensor-t2: Thermal zone sensor register failed: -22
generic-adc-thermal: probe of thermal-sensor-t2 failed with error -22
thermal_sys: Failed to find 'trips' node
thermal_sys: Failed to find trip points for thermal-sensor-t3 id=0
generic-adc-thermal thermal-sensor-t3: Thermal zone sensor register failed: -22
generic-adc-thermal: probe of thermal-sensor-t3 failed with error -22



> +};
> +
>  &u3phy0 {
>         status = "okay";
>  };
> --
> 2.40.0
>
>


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

* Re: [PATCH 5/5] arm64: dts: mediatek: cherry-tomato-r1: Enable NVMe PCI-Express port
  2023-04-20  9:44 ` [PATCH 5/5] arm64: dts: mediatek: cherry-tomato-r1: Enable NVMe PCI-Express port AngeloGioacchino Del Regno
@ 2023-04-21  7:59   ` Chen-Yu Tsai
  2023-04-24  8:13     ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2023-04-21  7:59 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> On Tomato rev1 the PCIe0 controller is used for NVMe storage.

This was slightly confusing for me. AFAIK rev1 is not an actual Tomato
device. It should be the prototype board, which is the original Cherry
reference design by Google [1].

There is an actual Cherry derived device that has NVMe, though it's under
another brand and another name.

ChenYu

[1] Much like Kukui & Jacuzzi (MT8183), and Asurada (MT8192) are the
    reference designs.  I don't think we ever upstream the reference
    boards because they don't really end up in the hands of people
    outside of the project, and the ones we do have tend to be quite
    beaten up or no longer working due to extensive testing.

> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> index 2d5e8f371b6d..11fc83ddf236 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> @@ -20,6 +20,13 @@ &sound {
>         model = "mt8195_r1019_5682";
>  };
>
> +&pcie0 {
> +       status = "okay";
> +
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&pcie0_pins_default>;
> +};
> +
>  &ts_10 {
>         status = "okay";
>  };
> --
> 2.40.0
>
>


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

* Re: [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration
  2023-04-21  7:37   ` Chen-Yu Tsai
@ 2023-04-21 20:53     ` Nícolas F. R. A. Prado
  2023-04-24  6:31       ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 21+ messages in thread
From: Nícolas F. R. A. Prado @ 2023-04-21 20:53 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: AngeloGioacchino Del Regno, matthias.bgg, robh+dt,
	krzysztof.kozlowski+dt, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel

On Fri, Apr 21, 2023 at 03:37:52PM +0800, Chen-Yu Tsai wrote:
> On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
> >
> > This platform has three auxiliary NTC thermistors, connected to the
> > SoC's ADC pins. Enable the auxadc in order to be able to read the
> > ADC values, add a generic-adc-thermal LUT for each and finally assign
> > them to the SoC's thermal zones.
> >
> > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > ---
> >  .../boot/dts/mediatek/mt8195-cherry.dtsi      | 105 ++++++++++++++++++
> >  1 file changed, 105 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> > index 8ac80a136c37..0820e9ba3829 100644
> > --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> > +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> > @@ -114,6 +114,77 @@ ppvar_sys: regulator-ppvar-sys {
> >                 regulator-boot-on;
> >         };
> >
> > +       /* Murata NCP03WF104F05RL */
> > +       tboard_thermistor1: thermal-sensor-t1 {
> > +               compatible = "generic-adc-thermal";
> > +               #thermal-sensor-cells = <0>;
> > +               io-channels = <&auxadc 0>;
> > +               io-channel-names = "sensor-channel";
> > +               temperature-lookup-table = <    (-10000) 1553
> > +                                               (-5000) 1485
> > +                                               0 1406
> > +                                               5000 1317
> > +                                               10000 1219
> > +                                               15000 1115
> > +                                               20000 1007
> > +                                               25000 900
> > +                                               30000 796
> > +                                               35000 697
> > +                                               40000 605
> > +                                               45000 523
> > +                                               50000 449
> > +                                               55000 384
> > +                                               60000 327
> > +                                               65000 279
> > +                                               70000 237
> > +                                               75000 202
> > +                                               80000 172
> > +                                               85000 147
> > +                                               90000 125
> > +                                               95000 107
> > +                                               100000 92
> > +                                               105000 79
> > +                                               110000 68
> > +                                               115000 59
> > +                                               120000 51
> > +                                               125000 44>;
> > +       };
> > +
> > +       tboard_thermistor2: thermal-sensor-t2 {
> > +               compatible = "generic-adc-thermal";
> > +               #thermal-sensor-cells = <0>;
> > +               io-channels = <&auxadc 1>;
> > +               io-channel-names = "sensor-channel";
> > +               temperature-lookup-table = <    (-10000) 1553
> > +                                               (-5000) 1485
> > +                                               0 1406
> > +                                               5000 1317
> > +                                               10000 1219
> > +                                               15000 1115
> > +                                               20000 1007
> > +                                               25000 900
> > +                                               30000 796
> > +                                               35000 697
> > +                                               40000 605
> > +                                               45000 523
> > +                                               50000 449
> > +                                               55000 384
> > +                                               60000 327
> > +                                               65000 279
> > +                                               70000 237
> > +                                               75000 202
> > +                                               80000 172
> > +                                               85000 147
> > +                                               90000 125
> > +                                               95000 107
> > +                                               100000 92
> > +                                               105000 79
> > +                                               110000 68
> > +                                               115000 59
> > +                                               120000 51
> > +                                               125000 44>;
> > +       };
> > +
> >         usb_vbus: regulator-5v0-usb-vbus {
> >                 compatible = "regulator-fixed";
> >                 regulator-name = "usb-vbus";
> > @@ -260,6 +331,10 @@ &gpu {
> >         mali-supply = <&mt6315_7_vbuck1>;
> >  };
> >
> > +&auxadc {
> > +       status = "okay";
> > +};
> > +
> >  &i2c0 {
> >         status = "okay";
> >
> > @@ -1098,6 +1173,36 @@ mt6315_7_vbuck1: vbuck1 {
> >         };
> >  };
> >
> > +&thermal_zones {
> > +       soc_area_ntc {

Not sure if that's what's causing the issue, but the thermal zone name should
end with -thermal as per the binding. Also note that it needs to be under 20
characters otherwise it will fail to be registered with -22 like below.
(Also, node names shouldn't contain underscore)

Thanks,
Nícolas

> > +               polling-delay = <1000>;
> > +               polling-delay-passive = <250>;
> > +               thermal-sensors = <&tboard_thermistor1>;
> > +
> > +               trips {
> > +                       trip-crit {
> > +                               temperature = <95000>;
> > +                               hysteresis = <2000>;
> > +                               type = "critical";
> > +                       };
> > +               };
> > +       };
> > +
> > +       pmic_area_ntc {
> > +               polling-delay = <1000>;
> > +               polling-delay-passive = <0>;
> > +               thermal-sensors = <&tboard_thermistor2>;
> > +
> > +               trips {
> > +                       trip-crit {
> > +                               temperature = <95000>;
> > +                               hysteresis = <2000>;
> > +                               type = "critical";
> > +                       };
> > +               };
> > +       };
> 
> I'm still getting:
> 
> thermal_sys: Failed to find 'trips' node
> thermal_sys: Failed to find trip points for thermal-sensor-t1 id=0
> generic-adc-thermal thermal-sensor-t1: Thermal zone sensor register failed: -22
> generic-adc-thermal: probe of thermal-sensor-t1 failed with error -22
> thermal_sys: Failed to find 'trips' node
> thermal_sys: Failed to find trip points for thermal-sensor-t2 id=0
> generic-adc-thermal thermal-sensor-t2: Thermal zone sensor register failed: -22
> generic-adc-thermal: probe of thermal-sensor-t2 failed with error -22
> thermal_sys: Failed to find 'trips' node
> thermal_sys: Failed to find trip points for thermal-sensor-t3 id=0
> generic-adc-thermal thermal-sensor-t3: Thermal zone sensor register failed: -22
> generic-adc-thermal: probe of thermal-sensor-t3 failed with error -22
> 
> 
> 
> > +};
> > +
> >  &u3phy0 {
> >         status = "okay";
> >  };
> > --
> > 2.40.0
> >
> >


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

* Re: [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration
  2023-04-21 20:53     ` Nícolas F. R. A. Prado
@ 2023-04-24  6:31       ` AngeloGioacchino Del Regno
  2023-04-24  7:38         ` Chen-Yu Tsai
  0 siblings, 1 reply; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-24  6:31 UTC (permalink / raw)
  To: Nícolas F. R. A. Prado, Chen-Yu Tsai
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

Il 21/04/23 22:53, Nícolas F. R. A. Prado ha scritto:
> On Fri, Apr 21, 2023 at 03:37:52PM +0800, Chen-Yu Tsai wrote:
>> On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
>> <angelogioacchino.delregno@collabora.com> wrote:
>>>
>>> This platform has three auxiliary NTC thermistors, connected to the
>>> SoC's ADC pins. Enable the auxadc in order to be able to read the
>>> ADC values, add a generic-adc-thermal LUT for each and finally assign
>>> them to the SoC's thermal zones.
>>>
>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>> ---
>>>   .../boot/dts/mediatek/mt8195-cherry.dtsi      | 105 ++++++++++++++++++
>>>   1 file changed, 105 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>>> index 8ac80a136c37..0820e9ba3829 100644
>>> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>>> @@ -114,6 +114,77 @@ ppvar_sys: regulator-ppvar-sys {
>>>                  regulator-boot-on;
>>>          };
>>>
>>> +       /* Murata NCP03WF104F05RL */
>>> +       tboard_thermistor1: thermal-sensor-t1 {
>>> +               compatible = "generic-adc-thermal";
>>> +               #thermal-sensor-cells = <0>;
>>> +               io-channels = <&auxadc 0>;
>>> +               io-channel-names = "sensor-channel";
>>> +               temperature-lookup-table = <    (-10000) 1553
>>> +                                               (-5000) 1485
>>> +                                               0 1406
>>> +                                               5000 1317
>>> +                                               10000 1219
>>> +                                               15000 1115
>>> +                                               20000 1007
>>> +                                               25000 900
>>> +                                               30000 796
>>> +                                               35000 697
>>> +                                               40000 605
>>> +                                               45000 523
>>> +                                               50000 449
>>> +                                               55000 384
>>> +                                               60000 327
>>> +                                               65000 279
>>> +                                               70000 237
>>> +                                               75000 202
>>> +                                               80000 172
>>> +                                               85000 147
>>> +                                               90000 125
>>> +                                               95000 107
>>> +                                               100000 92
>>> +                                               105000 79
>>> +                                               110000 68
>>> +                                               115000 59
>>> +                                               120000 51
>>> +                                               125000 44>;
>>> +       };
>>> +
>>> +       tboard_thermistor2: thermal-sensor-t2 {
>>> +               compatible = "generic-adc-thermal";
>>> +               #thermal-sensor-cells = <0>;
>>> +               io-channels = <&auxadc 1>;
>>> +               io-channel-names = "sensor-channel";
>>> +               temperature-lookup-table = <    (-10000) 1553
>>> +                                               (-5000) 1485
>>> +                                               0 1406
>>> +                                               5000 1317
>>> +                                               10000 1219
>>> +                                               15000 1115
>>> +                                               20000 1007
>>> +                                               25000 900
>>> +                                               30000 796
>>> +                                               35000 697
>>> +                                               40000 605
>>> +                                               45000 523
>>> +                                               50000 449
>>> +                                               55000 384
>>> +                                               60000 327
>>> +                                               65000 279
>>> +                                               70000 237
>>> +                                               75000 202
>>> +                                               80000 172
>>> +                                               85000 147
>>> +                                               90000 125
>>> +                                               95000 107
>>> +                                               100000 92
>>> +                                               105000 79
>>> +                                               110000 68
>>> +                                               115000 59
>>> +                                               120000 51
>>> +                                               125000 44>;
>>> +       };
>>> +
>>>          usb_vbus: regulator-5v0-usb-vbus {
>>>                  compatible = "regulator-fixed";
>>>                  regulator-name = "usb-vbus";
>>> @@ -260,6 +331,10 @@ &gpu {
>>>          mali-supply = <&mt6315_7_vbuck1>;
>>>   };
>>>
>>> +&auxadc {
>>> +       status = "okay";
>>> +};
>>> +
>>>   &i2c0 {
>>>          status = "okay";
>>>
>>> @@ -1098,6 +1173,36 @@ mt6315_7_vbuck1: vbuck1 {
>>>          };
>>>   };
>>>
>>> +&thermal_zones {
>>> +       soc_area_ntc {
> 
> Not sure if that's what's causing the issue, but the thermal zone name should
> end with -thermal as per the binding. Also note that it needs to be under 20
> characters otherwise it will fail to be registered with -22 like below.
> (Also, node names shouldn't contain underscore)
> 
> Thanks,
> Nícolas
> 
>>> +               polling-delay = <1000>;
>>> +               polling-delay-passive = <250>;
>>> +               thermal-sensors = <&tboard_thermistor1>;
>>> +
>>> +               trips {
>>> +                       trip-crit {
>>> +                               temperature = <95000>;
>>> +                               hysteresis = <2000>;
>>> +                               type = "critical";
>>> +                       };
>>> +               };
>>> +       };
>>> +
>>> +       pmic_area_ntc {
>>> +               polling-delay = <1000>;
>>> +               polling-delay-passive = <0>;
>>> +               thermal-sensors = <&tboard_thermistor2>;
>>> +
>>> +               trips {
>>> +                       trip-crit {
>>> +                               temperature = <95000>;
>>> +                               hysteresis = <2000>;
>>> +                               type = "critical";
>>> +                       };
>>> +               };
>>> +       };
>>
>> I'm still getting:
>>
>> thermal_sys: Failed to find 'trips' node
>> thermal_sys: Failed to find trip points for thermal-sensor-t1 id=0
>> generic-adc-thermal thermal-sensor-t1: Thermal zone sensor register failed: -22
>> generic-adc-thermal: probe of thermal-sensor-t1 failed with error -22
>> thermal_sys: Failed to find 'trips' node
>> thermal_sys: Failed to find trip points for thermal-sensor-t2 id=0
>> generic-adc-thermal thermal-sensor-t2: Thermal zone sensor register failed: -22
>> generic-adc-thermal: probe of thermal-sensor-t2 failed with error -22
>> thermal_sys: Failed to find 'trips' node
>> thermal_sys: Failed to find trip points for thermal-sensor-t3 id=0
>> generic-adc-thermal thermal-sensor-t3: Thermal zone sensor register failed: -22
>> generic-adc-thermal: probe of thermal-sensor-t3 failed with error -22
>>

I think you have something wrong locally - there's no thermal-sensor-t3 in this
devicetree...

Cheers,
Angelo



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

* Re: [PATCH 2/5] arm64: dts: mediatek: cherry: Assign dp-intf aliases
  2023-04-21  6:46   ` Chen-Yu Tsai
@ 2023-04-24  7:03     ` AngeloGioacchino Del Regno
  2023-04-24  7:17       ` Chen-Yu Tsai
  0 siblings, 1 reply; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-24  7:03 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

Il 21/04/23 08:46, Chen-Yu Tsai ha scritto:
> On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> On Cherry boards, the IP at 0x1c015000 (dp_intf0) is used as primary
>> dp-intf, while the other at 0x1c113000 (dp_intf1) is used as secondary:
>> assign them to dp-intf{0,1} aliases respectively.
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>>   arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 2 ++
> 
> This should be applied at the SoC level. The display pipeline is fixed in
> MMSYS, so it applies to all MT8195 devices.
> 

It's fixed in the MMSYS configuration/driver but - as far as I remember (I can
recheck on the datasheets) - the dp_intfX function can be inverted meaning that
the MMSYS paths can be configured such that DP_INTF0 becomes secondary and the
other becomes primary: this is why I am putting that into mt8195-cherry and not
mt8195.dtsi.

Regards,
Angelo

>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>> index 0820e9ba3829..918380697a9a 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>> @@ -10,6 +10,8 @@
>>
>>   / {
>>          aliases {
>> +               dp-intf0 = &dp_intf0;
>> +               dp-intf1 = &dp_intf1;
>>                  i2c0 = &i2c0;
>>                  i2c1 = &i2c1;
>>                  i2c2 = &i2c2;
>> --
>> 2.40.0
>>
>>
> 



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

* Re: [PATCH 2/5] arm64: dts: mediatek: cherry: Assign dp-intf aliases
  2023-04-24  7:03     ` AngeloGioacchino Del Regno
@ 2023-04-24  7:17       ` Chen-Yu Tsai
  2023-04-24  7:19         ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2023-04-24  7:17 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

On Mon, Apr 24, 2023 at 3:03 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 21/04/23 08:46, Chen-Yu Tsai ha scritto:
> > On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com> wrote:
> >>
> >> On Cherry boards, the IP at 0x1c015000 (dp_intf0) is used as primary
> >> dp-intf, while the other at 0x1c113000 (dp_intf1) is used as secondary:
> >> assign them to dp-intf{0,1} aliases respectively.
> >>
> >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> >> ---
> >>   arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 2 ++
> >
> > This should be applied at the SoC level. The display pipeline is fixed in
> > MMSYS, so it applies to all MT8195 devices.
> >
>
> It's fixed in the MMSYS configuration/driver but - as far as I remember (I can
> recheck on the datasheets) - the dp_intfX function can be inverted meaning that
> the MMSYS paths can be configured such that DP_INTF0 becomes secondary and the
> other becomes primary: this is why I am putting that into mt8195-cherry and not
> mt8195.dtsi.

Maybe that's possible, but the diagram in the datasheet suggests a fixed path.

Either way, it's not actually the problem. My original reply is probably
inaccurate. AFAIK the aliases are used to identify the individual hardware
blocks, which otherwise have the same compatible string. So the numbering
should be the same regardless of the design and/or routing.

Ideally this should be described with a proper graph though.

ChenYu

>
> Regards,
> Angelo
>
> >>   1 file changed, 2 insertions(+)
> >>
> >> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> >> index 0820e9ba3829..918380697a9a 100644
> >> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> >> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> >> @@ -10,6 +10,8 @@
> >>
> >>   / {
> >>          aliases {
> >> +               dp-intf0 = &dp_intf0;
> >> +               dp-intf1 = &dp_intf1;
> >>                  i2c0 = &i2c0;
> >>                  i2c1 = &i2c1;
> >>                  i2c2 = &i2c2;
> >> --
> >> 2.40.0
> >>
> >>
> >
>


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

* Re: [PATCH 2/5] arm64: dts: mediatek: cherry: Assign dp-intf aliases
  2023-04-24  7:17       ` Chen-Yu Tsai
@ 2023-04-24  7:19         ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-24  7:19 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

Il 24/04/23 09:17, Chen-Yu Tsai ha scritto:
> On Mon, Apr 24, 2023 at 3:03 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> Il 21/04/23 08:46, Chen-Yu Tsai ha scritto:
>>> On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
>>> <angelogioacchino.delregno@collabora.com> wrote:
>>>>
>>>> On Cherry boards, the IP at 0x1c015000 (dp_intf0) is used as primary
>>>> dp-intf, while the other at 0x1c113000 (dp_intf1) is used as secondary:
>>>> assign them to dp-intf{0,1} aliases respectively.
>>>>
>>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>>> ---
>>>>    arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 2 ++
>>>
>>> This should be applied at the SoC level. The display pipeline is fixed in
>>> MMSYS, so it applies to all MT8195 devices.
>>>
>>
>> It's fixed in the MMSYS configuration/driver but - as far as I remember (I can
>> recheck on the datasheets) - the dp_intfX function can be inverted meaning that
>> the MMSYS paths can be configured such that DP_INTF0 becomes secondary and the
>> other becomes primary: this is why I am putting that into mt8195-cherry and not
>> mt8195.dtsi.
> 
> Maybe that's possible, but the diagram in the datasheet suggests a fixed path.
> 
> Either way, it's not actually the problem. My original reply is probably
> inaccurate. AFAIK the aliases are used to identify the individual hardware
> blocks, which otherwise have the same compatible string. So the numbering
> should be the same regardless of the design and/or routing.

Ack. Will move to mt8195.dtsi!

> 
> Ideally this should be described with a proper graph though.
> 
> ChenYu
> 
>>
>> Regards,
>> Angelo
>>
>>>>    1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>>>> index 0820e9ba3829..918380697a9a 100644
>>>> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>>>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>>>> @@ -10,6 +10,8 @@
>>>>
>>>>    / {
>>>>           aliases {
>>>> +               dp-intf0 = &dp_intf0;
>>>> +               dp-intf1 = &dp_intf1;
>>>>                   i2c0 = &i2c0;
>>>>                   i2c1 = &i2c1;
>>>>                   i2c2 = &i2c2;
>>>> --
>>>> 2.40.0
>>>>
>>>>
>>>
>>




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

* Re: [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration
  2023-04-24  6:31       ` AngeloGioacchino Del Regno
@ 2023-04-24  7:38         ` Chen-Yu Tsai
  2023-04-24  7:40           ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2023-04-24  7:38 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Nícolas F. R. A. Prado, matthias.bgg, robh+dt,
	krzysztof.kozlowski+dt, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel

On Mon, Apr 24, 2023 at 2:31 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 21/04/23 22:53, Nícolas F. R. A. Prado ha scritto:
> > On Fri, Apr 21, 2023 at 03:37:52PM +0800, Chen-Yu Tsai wrote:
> >> On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
> >> <angelogioacchino.delregno@collabora.com> wrote:
> >>>
> >>> This platform has three auxiliary NTC thermistors, connected to the
> >>> SoC's ADC pins. Enable the auxadc in order to be able to read the
> >>> ADC values, add a generic-adc-thermal LUT for each and finally assign
> >>> them to the SoC's thermal zones.
> >>>
> >>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> >>> ---
> >>>   .../boot/dts/mediatek/mt8195-cherry.dtsi      | 105 ++++++++++++++++++
> >>>   1 file changed, 105 insertions(+)
> >>>
> >>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> >>> index 8ac80a136c37..0820e9ba3829 100644
> >>> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> >>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> >>> @@ -114,6 +114,77 @@ ppvar_sys: regulator-ppvar-sys {
> >>>                  regulator-boot-on;
> >>>          };
> >>>
> >>> +       /* Murata NCP03WF104F05RL */
> >>> +       tboard_thermistor1: thermal-sensor-t1 {
> >>> +               compatible = "generic-adc-thermal";
> >>> +               #thermal-sensor-cells = <0>;
> >>> +               io-channels = <&auxadc 0>;
> >>> +               io-channel-names = "sensor-channel";
> >>> +               temperature-lookup-table = <    (-10000) 1553
> >>> +                                               (-5000) 1485
> >>> +                                               0 1406
> >>> +                                               5000 1317
> >>> +                                               10000 1219
> >>> +                                               15000 1115
> >>> +                                               20000 1007
> >>> +                                               25000 900
> >>> +                                               30000 796
> >>> +                                               35000 697
> >>> +                                               40000 605
> >>> +                                               45000 523
> >>> +                                               50000 449
> >>> +                                               55000 384
> >>> +                                               60000 327
> >>> +                                               65000 279
> >>> +                                               70000 237
> >>> +                                               75000 202
> >>> +                                               80000 172
> >>> +                                               85000 147
> >>> +                                               90000 125
> >>> +                                               95000 107
> >>> +                                               100000 92
> >>> +                                               105000 79
> >>> +                                               110000 68
> >>> +                                               115000 59
> >>> +                                               120000 51
> >>> +                                               125000 44>;
> >>> +       };
> >>> +
> >>> +       tboard_thermistor2: thermal-sensor-t2 {
> >>> +               compatible = "generic-adc-thermal";
> >>> +               #thermal-sensor-cells = <0>;
> >>> +               io-channels = <&auxadc 1>;
> >>> +               io-channel-names = "sensor-channel";
> >>> +               temperature-lookup-table = <    (-10000) 1553
> >>> +                                               (-5000) 1485
> >>> +                                               0 1406
> >>> +                                               5000 1317
> >>> +                                               10000 1219
> >>> +                                               15000 1115
> >>> +                                               20000 1007
> >>> +                                               25000 900
> >>> +                                               30000 796
> >>> +                                               35000 697
> >>> +                                               40000 605
> >>> +                                               45000 523
> >>> +                                               50000 449
> >>> +                                               55000 384
> >>> +                                               60000 327
> >>> +                                               65000 279
> >>> +                                               70000 237
> >>> +                                               75000 202
> >>> +                                               80000 172
> >>> +                                               85000 147
> >>> +                                               90000 125
> >>> +                                               95000 107
> >>> +                                               100000 92
> >>> +                                               105000 79
> >>> +                                               110000 68
> >>> +                                               115000 59
> >>> +                                               120000 51
> >>> +                                               125000 44>;
> >>> +       };
> >>> +
> >>>          usb_vbus: regulator-5v0-usb-vbus {
> >>>                  compatible = "regulator-fixed";
> >>>                  regulator-name = "usb-vbus";
> >>> @@ -260,6 +331,10 @@ &gpu {
> >>>          mali-supply = <&mt6315_7_vbuck1>;
> >>>   };
> >>>
> >>> +&auxadc {
> >>> +       status = "okay";
> >>> +};
> >>> +
> >>>   &i2c0 {
> >>>          status = "okay";
> >>>
> >>> @@ -1098,6 +1173,36 @@ mt6315_7_vbuck1: vbuck1 {
> >>>          };
> >>>   };
> >>>
> >>> +&thermal_zones {
> >>> +       soc_area_ntc {
> >
> > Not sure if that's what's causing the issue, but the thermal zone name should
> > end with -thermal as per the binding. Also note that it needs to be under 20
> > characters otherwise it will fail to be registered with -22 like below.
> > (Also, node names shouldn't contain underscore)
> >
> > Thanks,
> > Nícolas
> >
> >>> +               polling-delay = <1000>;
> >>> +               polling-delay-passive = <250>;
> >>> +               thermal-sensors = <&tboard_thermistor1>;
> >>> +
> >>> +               trips {
> >>> +                       trip-crit {
> >>> +                               temperature = <95000>;
> >>> +                               hysteresis = <2000>;
> >>> +                               type = "critical";
> >>> +                       };
> >>> +               };
> >>> +       };
> >>> +
> >>> +       pmic_area_ntc {
> >>> +               polling-delay = <1000>;
> >>> +               polling-delay-passive = <0>;
> >>> +               thermal-sensors = <&tboard_thermistor2>;
> >>> +
> >>> +               trips {
> >>> +                       trip-crit {
> >>> +                               temperature = <95000>;
> >>> +                               hysteresis = <2000>;
> >>> +                               type = "critical";
> >>> +                       };
> >>> +               };
> >>> +       };
> >>
> >> I'm still getting:
> >>
> >> thermal_sys: Failed to find 'trips' node
> >> thermal_sys: Failed to find trip points for thermal-sensor-t1 id=0
> >> generic-adc-thermal thermal-sensor-t1: Thermal zone sensor register failed: -22
> >> generic-adc-thermal: probe of thermal-sensor-t1 failed with error -22
> >> thermal_sys: Failed to find 'trips' node
> >> thermal_sys: Failed to find trip points for thermal-sensor-t2 id=0
> >> generic-adc-thermal thermal-sensor-t2: Thermal zone sensor register failed: -22
> >> generic-adc-thermal: probe of thermal-sensor-t2 failed with error -22
> >> thermal_sys: Failed to find 'trips' node
> >> thermal_sys: Failed to find trip points for thermal-sensor-t3 id=0
> >> generic-adc-thermal thermal-sensor-t3: Thermal zone sensor register failed: -22
> >> generic-adc-thermal: probe of thermal-sensor-t3 failed with error -22
> >>
>
> I think you have something wrong locally - there's no thermal-sensor-t3 in this
> devicetree...

I seem to have run a stale kernel image. Rebuilt the kernel and everything
seems to work OK now.

BTW, I think the design went for a lower trip point. At least the hardware
thermal protection IC on the Acer device trips at 85 degrees C, instead of
95 degrees C. Maybe that's accounting for the fact that these are external
thermal sensors and have some latency and temperature difference. The PMIC
specifies 85 degrees C maximum ambient air temperature. The SoC doesn't
specify.

Either way this is

Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>


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

* Re: [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration
  2023-04-24  7:38         ` Chen-Yu Tsai
@ 2023-04-24  7:40           ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-24  7:40 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Nícolas F. R. A. Prado, matthias.bgg, robh+dt,
	krzysztof.kozlowski+dt, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel

Il 24/04/23 09:38, Chen-Yu Tsai ha scritto:
> On Mon, Apr 24, 2023 at 2:31 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> Il 21/04/23 22:53, Nícolas F. R. A. Prado ha scritto:
>>> On Fri, Apr 21, 2023 at 03:37:52PM +0800, Chen-Yu Tsai wrote:
>>>> On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
>>>> <angelogioacchino.delregno@collabora.com> wrote:
>>>>>
>>>>> This platform has three auxiliary NTC thermistors, connected to the
>>>>> SoC's ADC pins. Enable the auxadc in order to be able to read the
>>>>> ADC values, add a generic-adc-thermal LUT for each and finally assign
>>>>> them to the SoC's thermal zones.
>>>>>
>>>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>>>> ---
>>>>>    .../boot/dts/mediatek/mt8195-cherry.dtsi      | 105 ++++++++++++++++++
>>>>>    1 file changed, 105 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>>>>> index 8ac80a136c37..0820e9ba3829 100644
>>>>> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>>>>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>>>>> @@ -114,6 +114,77 @@ ppvar_sys: regulator-ppvar-sys {
>>>>>                   regulator-boot-on;
>>>>>           };
>>>>>
>>>>> +       /* Murata NCP03WF104F05RL */
>>>>> +       tboard_thermistor1: thermal-sensor-t1 {
>>>>> +               compatible = "generic-adc-thermal";
>>>>> +               #thermal-sensor-cells = <0>;
>>>>> +               io-channels = <&auxadc 0>;
>>>>> +               io-channel-names = "sensor-channel";
>>>>> +               temperature-lookup-table = <    (-10000) 1553
>>>>> +                                               (-5000) 1485
>>>>> +                                               0 1406
>>>>> +                                               5000 1317
>>>>> +                                               10000 1219
>>>>> +                                               15000 1115
>>>>> +                                               20000 1007
>>>>> +                                               25000 900
>>>>> +                                               30000 796
>>>>> +                                               35000 697
>>>>> +                                               40000 605
>>>>> +                                               45000 523
>>>>> +                                               50000 449
>>>>> +                                               55000 384
>>>>> +                                               60000 327
>>>>> +                                               65000 279
>>>>> +                                               70000 237
>>>>> +                                               75000 202
>>>>> +                                               80000 172
>>>>> +                                               85000 147
>>>>> +                                               90000 125
>>>>> +                                               95000 107
>>>>> +                                               100000 92
>>>>> +                                               105000 79
>>>>> +                                               110000 68
>>>>> +                                               115000 59
>>>>> +                                               120000 51
>>>>> +                                               125000 44>;
>>>>> +       };
>>>>> +
>>>>> +       tboard_thermistor2: thermal-sensor-t2 {
>>>>> +               compatible = "generic-adc-thermal";
>>>>> +               #thermal-sensor-cells = <0>;
>>>>> +               io-channels = <&auxadc 1>;
>>>>> +               io-channel-names = "sensor-channel";
>>>>> +               temperature-lookup-table = <    (-10000) 1553
>>>>> +                                               (-5000) 1485
>>>>> +                                               0 1406
>>>>> +                                               5000 1317
>>>>> +                                               10000 1219
>>>>> +                                               15000 1115
>>>>> +                                               20000 1007
>>>>> +                                               25000 900
>>>>> +                                               30000 796
>>>>> +                                               35000 697
>>>>> +                                               40000 605
>>>>> +                                               45000 523
>>>>> +                                               50000 449
>>>>> +                                               55000 384
>>>>> +                                               60000 327
>>>>> +                                               65000 279
>>>>> +                                               70000 237
>>>>> +                                               75000 202
>>>>> +                                               80000 172
>>>>> +                                               85000 147
>>>>> +                                               90000 125
>>>>> +                                               95000 107
>>>>> +                                               100000 92
>>>>> +                                               105000 79
>>>>> +                                               110000 68
>>>>> +                                               115000 59
>>>>> +                                               120000 51
>>>>> +                                               125000 44>;
>>>>> +       };
>>>>> +
>>>>>           usb_vbus: regulator-5v0-usb-vbus {
>>>>>                   compatible = "regulator-fixed";
>>>>>                   regulator-name = "usb-vbus";
>>>>> @@ -260,6 +331,10 @@ &gpu {
>>>>>           mali-supply = <&mt6315_7_vbuck1>;
>>>>>    };
>>>>>
>>>>> +&auxadc {
>>>>> +       status = "okay";
>>>>> +};
>>>>> +
>>>>>    &i2c0 {
>>>>>           status = "okay";
>>>>>
>>>>> @@ -1098,6 +1173,36 @@ mt6315_7_vbuck1: vbuck1 {
>>>>>           };
>>>>>    };
>>>>>
>>>>> +&thermal_zones {
>>>>> +       soc_area_ntc {
>>>
>>> Not sure if that's what's causing the issue, but the thermal zone name should
>>> end with -thermal as per the binding. Also note that it needs to be under 20
>>> characters otherwise it will fail to be registered with -22 like below.
>>> (Also, node names shouldn't contain underscore)
>>>
>>> Thanks,
>>> Nícolas
>>>
>>>>> +               polling-delay = <1000>;
>>>>> +               polling-delay-passive = <250>;
>>>>> +               thermal-sensors = <&tboard_thermistor1>;
>>>>> +
>>>>> +               trips {
>>>>> +                       trip-crit {
>>>>> +                               temperature = <95000>;
>>>>> +                               hysteresis = <2000>;
>>>>> +                               type = "critical";
>>>>> +                       };
>>>>> +               };
>>>>> +       };
>>>>> +
>>>>> +       pmic_area_ntc {
>>>>> +               polling-delay = <1000>;
>>>>> +               polling-delay-passive = <0>;
>>>>> +               thermal-sensors = <&tboard_thermistor2>;
>>>>> +
>>>>> +               trips {
>>>>> +                       trip-crit {
>>>>> +                               temperature = <95000>;
>>>>> +                               hysteresis = <2000>;
>>>>> +                               type = "critical";
>>>>> +                       };
>>>>> +               };
>>>>> +       };
>>>>
>>>> I'm still getting:
>>>>
>>>> thermal_sys: Failed to find 'trips' node
>>>> thermal_sys: Failed to find trip points for thermal-sensor-t1 id=0
>>>> generic-adc-thermal thermal-sensor-t1: Thermal zone sensor register failed: -22
>>>> generic-adc-thermal: probe of thermal-sensor-t1 failed with error -22
>>>> thermal_sys: Failed to find 'trips' node
>>>> thermal_sys: Failed to find trip points for thermal-sensor-t2 id=0
>>>> generic-adc-thermal thermal-sensor-t2: Thermal zone sensor register failed: -22
>>>> generic-adc-thermal: probe of thermal-sensor-t2 failed with error -22
>>>> thermal_sys: Failed to find 'trips' node
>>>> thermal_sys: Failed to find trip points for thermal-sensor-t3 id=0
>>>> generic-adc-thermal thermal-sensor-t3: Thermal zone sensor register failed: -22
>>>> generic-adc-thermal: probe of thermal-sensor-t3 failed with error -22
>>>>
>>
>> I think you have something wrong locally - there's no thermal-sensor-t3 in this
>> devicetree...
> 
> I seem to have run a stale kernel image. Rebuilt the kernel and everything
> seems to work OK now.
> 
> BTW, I think the design went for a lower trip point. At least the hardware
> thermal protection IC on the Acer device trips at 85 degrees C, instead of
> 95 degrees C. Maybe that's accounting for the fact that these are external
> thermal sensors and have some latency and temperature difference. The PMIC
> specifies 85 degrees C maximum ambient air temperature. The SoC doesn't
> specify.
> 

Let's play safe then, I'll change that to 85 for the next version.

> Either way this is
> 
> Tested-by: Chen-Yu Tsai <wenst@chromium.org>
> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>

Thanks!



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

* Re: [PATCH 5/5] arm64: dts: mediatek: cherry-tomato-r1: Enable NVMe PCI-Express port
  2023-04-21  7:59   ` Chen-Yu Tsai
@ 2023-04-24  8:13     ` AngeloGioacchino Del Regno
  2023-04-24  9:40       ` Chen-Yu Tsai
  0 siblings, 1 reply; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-24  8:13 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

Il 21/04/23 09:59, Chen-Yu Tsai ha scritto:
> On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> On Tomato rev1 the PCIe0 controller is used for NVMe storage.
> 
> This was slightly confusing for me. AFAIK rev1 is not an actual Tomato
> device. It should be the prototype board, which is the original Cherry
> reference design by Google [1].
> 
> There is an actual Cherry derived device that has NVMe, though it's under
> another brand and another name.
> 

If revision 1 is not an actual Tomato device, and you can confirm that it is
the prototype board... I can send a commit to entirely drop R1 as having it
upstream would be of no use at all.

Cheers,
Angelo

> ChenYu
> 
> [1] Much like Kukui & Jacuzzi (MT8183), and Asurada (MT8192) are the
>      reference designs.  I don't think we ever upstream the reference
>      boards because they don't really end up in the hands of people
>      outside of the project, and the ones we do have tend to be quite
>      beaten up or no longer working due to extensive testing.
> 
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>>   arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>> index 2d5e8f371b6d..11fc83ddf236 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>> @@ -20,6 +20,13 @@ &sound {
>>          model = "mt8195_r1019_5682";
>>   };
>>
>> +&pcie0 {
>> +       status = "okay";
>> +
>> +       pinctrl-names = "default";
>> +       pinctrl-0 = <&pcie0_pins_default>;
>> +};
>> +
>>   &ts_10 {
>>          status = "okay";
>>   };
>> --
>> 2.40.0
>>
>>



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

* Re: [PATCH 5/5] arm64: dts: mediatek: cherry-tomato-r1: Enable NVMe PCI-Express port
  2023-04-24  8:13     ` AngeloGioacchino Del Regno
@ 2023-04-24  9:40       ` Chen-Yu Tsai
  2023-04-24  9:59         ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 21+ messages in thread
From: Chen-Yu Tsai @ 2023-04-24  9:40 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

On Mon, Apr 24, 2023 at 4:13 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 21/04/23 09:59, Chen-Yu Tsai ha scritto:
> > On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com> wrote:
> >>
> >> On Tomato rev1 the PCIe0 controller is used for NVMe storage.
> >
> > This was slightly confusing for me. AFAIK rev1 is not an actual Tomato
> > device. It should be the prototype board, which is the original Cherry
> > reference design by Google [1].
> >
> > There is an actual Cherry derived device that has NVMe, though it's under
> > another brand and another name.
> >
>
> If revision 1 is not an actual Tomato device, and you can confirm that it is
> the prototype board... I can send a commit to entirely drop R1 as having it
> upstream would be of no use at all.

From what I gathered from my colleagues, revision 1 was a Tomato prototype,
and also the second Cherry prototype board. There shouldn't be any of these
out in the wild.

FTR, the production version of Tomato is revision 4. Rev 2 and rev 3
engineering samples are available to partners, but otherwise limited.

ChenYu

> Cheers,
> Angelo
>
> > ChenYu
> >
> > [1] Much like Kukui & Jacuzzi (MT8183), and Asurada (MT8192) are the
> >      reference designs.  I don't think we ever upstream the reference
> >      boards because they don't really end up in the hands of people
> >      outside of the project, and the ones we do have tend to be quite
> >      beaten up or no longer working due to extensive testing.
> >
> >> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> >> ---
> >>   arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts | 7 +++++++
> >>   1 file changed, 7 insertions(+)
> >>
> >> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> >> index 2d5e8f371b6d..11fc83ddf236 100644
> >> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> >> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> >> @@ -20,6 +20,13 @@ &sound {
> >>          model = "mt8195_r1019_5682";
> >>   };
> >>
> >> +&pcie0 {
> >> +       status = "okay";
> >> +
> >> +       pinctrl-names = "default";
> >> +       pinctrl-0 = <&pcie0_pins_default>;
> >> +};
> >> +
> >>   &ts_10 {
> >>          status = "okay";
> >>   };
> >> --
> >> 2.40.0
> >>
> >>
>


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

* Re: [PATCH 5/5] arm64: dts: mediatek: cherry-tomato-r1: Enable NVMe PCI-Express port
  2023-04-24  9:40       ` Chen-Yu Tsai
@ 2023-04-24  9:59         ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 21+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-04-24  9:59 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: matthias.bgg, robh+dt, krzysztof.kozlowski+dt, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, kernel

Il 24/04/23 11:40, Chen-Yu Tsai ha scritto:
> On Mon, Apr 24, 2023 at 4:13 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> Il 21/04/23 09:59, Chen-Yu Tsai ha scritto:
>>> On Thu, Apr 20, 2023 at 5:45 PM AngeloGioacchino Del Regno
>>> <angelogioacchino.delregno@collabora.com> wrote:
>>>>
>>>> On Tomato rev1 the PCIe0 controller is used for NVMe storage.
>>>
>>> This was slightly confusing for me. AFAIK rev1 is not an actual Tomato
>>> device. It should be the prototype board, which is the original Cherry
>>> reference design by Google [1].
>>>
>>> There is an actual Cherry derived device that has NVMe, though it's under
>>> another brand and another name.
>>>
>>
>> If revision 1 is not an actual Tomato device, and you can confirm that it is
>> the prototype board... I can send a commit to entirely drop R1 as having it
>> upstream would be of no use at all.
> 
>  From what I gathered from my colleagues, revision 1 was a Tomato prototype,
> and also the second Cherry prototype board. There shouldn't be any of these
> out in the wild.
> 
> FTR, the production version of Tomato is revision 4. Rev 2 and rev 3
> engineering samples are available to partners, but otherwise limited.
> 

Good! Thanks for the information.

> ChenYu
> 
>> Cheers,
>> Angelo
>>
>>> ChenYu
>>>
>>> [1] Much like Kukui & Jacuzzi (MT8183), and Asurada (MT8192) are the
>>>       reference designs.  I don't think we ever upstream the reference
>>>       boards because they don't really end up in the hands of people
>>>       outside of the project, and the ones we do have tend to be quite
>>>       beaten up or no longer working due to extensive testing.
>>>
>>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>>> ---
>>>>    arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts | 7 +++++++
>>>>    1 file changed, 7 insertions(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>>>> index 2d5e8f371b6d..11fc83ddf236 100644
>>>> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>>>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>>>> @@ -20,6 +20,13 @@ &sound {
>>>>           model = "mt8195_r1019_5682";
>>>>    };
>>>>
>>>> +&pcie0 {
>>>> +       status = "okay";
>>>> +
>>>> +       pinctrl-names = "default";
>>>> +       pinctrl-0 = <&pcie0_pins_default>;
>>>> +};
>>>> +
>>>>    &ts_10 {
>>>>           status = "okay";
>>>>    };
>>>> --
>>>> 2.40.0
>>>>
>>>>
>>

-- 
AngeloGioacchino Del Regno
Software Engineer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718



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

end of thread, other threads:[~2023-04-24  9:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-20  9:44 [PATCH 0/5] MT8195 Acer Tomato - devicetrees Part 3 AngeloGioacchino Del Regno
2023-04-20  9:44 ` [PATCH 1/5] arm64: dts: mediatek: cherry: Add platform thermal configuration AngeloGioacchino Del Regno
2023-04-21  7:37   ` Chen-Yu Tsai
2023-04-21 20:53     ` Nícolas F. R. A. Prado
2023-04-24  6:31       ` AngeloGioacchino Del Regno
2023-04-24  7:38         ` Chen-Yu Tsai
2023-04-24  7:40           ` AngeloGioacchino Del Regno
2023-04-20  9:44 ` [PATCH 2/5] arm64: dts: mediatek: cherry: Assign dp-intf aliases AngeloGioacchino Del Regno
2023-04-21  6:46   ` Chen-Yu Tsai
2023-04-24  7:03     ` AngeloGioacchino Del Regno
2023-04-24  7:17       ` Chen-Yu Tsai
2023-04-24  7:19         ` AngeloGioacchino Del Regno
2023-04-20  9:44 ` [PATCH 3/5] arm64: dts: mediatek: cherry: Configure eDP and internal display AngeloGioacchino Del Regno
2023-04-21  6:57   ` Chen-Yu Tsai
2023-04-20  9:44 ` [PATCH 4/5] arm64: dts: mediatek: cherry: Enable PCI-Express ports for WiFi AngeloGioacchino Del Regno
2023-04-21  7:07   ` Chen-Yu Tsai
2023-04-20  9:44 ` [PATCH 5/5] arm64: dts: mediatek: cherry-tomato-r1: Enable NVMe PCI-Express port AngeloGioacchino Del Regno
2023-04-21  7:59   ` Chen-Yu Tsai
2023-04-24  8:13     ` AngeloGioacchino Del Regno
2023-04-24  9:40       ` Chen-Yu Tsai
2023-04-24  9:59         ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox