linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato
@ 2022-06-30 15:33 AngeloGioacchino Del Regno
  2022-06-30 15:33 ` [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks AngeloGioacchino Del Regno
                   ` (10 more replies)
  0 siblings, 11 replies; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

This is the first part for upstreaming Google's Cherry Tomato
Chromebook (Acer Chromebook Spin 513): in this series, we introduce
the devicetrees for the four revisions of this Chromebook and enable
every controller and feature that can be added as per the current
state of the main SoC devicetrees (mt8195.dtsi) and its PMIC
devicetree (mt6359.dtsi).

More parts will come as soon as more support will be added by
MediaTek in the mt8195 devicetree.

Note: This series will introduce a dtbs_check warning about a failure
      to match compatible for 'mediatek,mt6359': that's expected, as
      this is defined in devicetree/bindings/mfd/mt6397.txt (so there
      is no schema, yet).


This series depends on the following fixes:
[1]: https://patchwork.kernel.org/project/linux-mediatek/patch/20220630110453.186526-1-angelogioacchino.delregno@collabora.com/
[2]: https://patchwork.kernel.org/project/linux-mediatek/patch/20220630122334.216903-1-angelogioacchino.delregno@collabora.com/
[3]: https://patchwork.kernel.org/project/linux-mediatek/patch/20220630131543.225554-1-angelogioacchino.delregno@collabora.com/

AngeloGioacchino Del Regno (11):
  dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks
  arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato
  arm64: dts: mediatek: cherry: Assign interrupt line to MT6359 PMIC
  arm64: dts: mediatek: cherry: Add platform regulators layout and
    config
  arm64: dts: mediatek: cherry: Add support for internal eMMC storage
  arm64: dts: mediatek: cherry: Document gpios and add default pin
    config
  arm64: dts: mediatek: cherry: Enable I2C and SPI controllers
  arm64: dts: mediatek: cherry: Enable T-PHYs and USB XHCI controllers
  arm64: dts: mediatek: cherry: Enable MT6360 sub-pmic on I2C7
  arm64: dts: mediatek: cherry: Enable support for the SPI NOR flash
  arm64: dts: mediatek: cherry: Add I2C-HID touchscreen on I2C4

 .../devicetree/bindings/arm/mediatek.yaml     |  13 +
 arch/arm64/boot/dts/mediatek/Makefile         |   3 +
 .../dts/mediatek/mt8195-cherry-tomato-r1.dts  |  15 +
 .../dts/mediatek/mt8195-cherry-tomato-r2.dts  |  35 +
 .../dts/mediatek/mt8195-cherry-tomato-r3.dts  |  36 +
 .../boot/dts/mediatek/mt8195-cherry.dtsi      | 715 ++++++++++++++++++
 6 files changed, 817 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi

-- 
2.35.1


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

* [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-06-30 18:26   ` Krzysztof Kozlowski
                     ` (2 more replies)
  2022-06-30 15:33 ` [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato AngeloGioacchino Del Regno
                   ` (9 subsequent siblings)
  10 siblings, 3 replies; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

Document board compatibles for the MT8195 Cherry platform's
Tomato Chromebooks, at the time of writing composed of four
revisions (r0, r1, r2, r3-r4).

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 Documentation/devicetree/bindings/arm/mediatek.yaml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/mediatek.yaml b/Documentation/devicetree/bindings/arm/mediatek.yaml
index dd6c6e8011f9..3e0afa17ed2e 100644
--- a/Documentation/devicetree/bindings/arm/mediatek.yaml
+++ b/Documentation/devicetree/bindings/arm/mediatek.yaml
@@ -144,6 +144,19 @@ properties:
           - const: google,spherion-rev0
           - const: google,spherion
           - const: mediatek,mt8192
+      - description: Google Tomato (Acer Chromebook Spin 513)
+        items:
+          - enum:
+              - google,tomato-rev2
+              - google,tomato-rev1
+          - const: google,tomato
+          - const: mediatek,mt8195
+      - description: Google Tomato (rev3 - 4)
+        items:
+          - const: google,tomato-rev4
+          - const: google,tomato-rev3
+          - const: google,tomato
+          - const: mediatek,mt8195
       - items:
           - enum:
               - mediatek,mt8186-evb
-- 
2.35.1


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

* [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
  2022-06-30 15:33 ` [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-07-01 22:11   ` Nícolas F. R. A. Prado
  2022-06-30 15:33 ` [PATCH 03/11] arm64: dts: mediatek: cherry: Assign interrupt line to MT6359 PMIC AngeloGioacchino Del Regno
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

Introduce the MT8195 Cherry Chromebook platform, including three
revisions of Cherry Tomato boards.

This basic configuration allows to boot Linux on all board revisions
and get a serial console from a ramdisk.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 arch/arm64/boot/dts/mediatek/Makefile         |  3 +++
 .../dts/mediatek/mt8195-cherry-tomato-r1.dts  | 11 ++++++++
 .../dts/mediatek/mt8195-cherry-tomato-r2.dts  | 11 ++++++++
 .../dts/mediatek/mt8195-cherry-tomato-r3.dts  | 12 +++++++++
 .../boot/dts/mediatek/mt8195-cherry.dtsi      | 26 +++++++++++++++++++
 5 files changed, 63 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi

diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
index 50a2c58c5f56..0b12035a4f08 100644
--- a/arch/arm64/boot/dts/mediatek/Makefile
+++ b/arch/arm64/boot/dts/mediatek/Makefile
@@ -39,6 +39,9 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku176.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-pumpkin.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8186-evb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-evb.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-cherry-tomato-r1.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-cherry-tomato-r2.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-cherry-tomato-r3.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-demo.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-evb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
new file mode 100644
index 000000000000..17e9e4d6f6ab
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ */
+/dts-v1/;
+#include "mt8195-cherry.dtsi"
+
+/ {
+	model = "MediaTek Tomato (rev1) board";
+	compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
new file mode 100644
index 000000000000..b915fba311e9
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ */
+/dts-v1/;
+#include "mt8195-cherry.dtsi"
+
+/ {
+	model = "MediaTek Tomato (rev2) board";
+	compatible = "google,tomato-rev2", "google,tomato", "mediatek,mt8195";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
new file mode 100644
index 000000000000..2ead9eca2ec9
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ */
+/dts-v1/;
+#include "mt8195-cherry.dtsi"
+
+/ {
+	model = "MediaTek Tomato (rev3 - 4) board";
+	compatible = "google,tomato-rev4", "google,tomato-rev3",
+		     "google,tomato", "mediatek,mt8195";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
new file mode 100644
index 000000000000..7406d7bbf725
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include "mt8195.dtsi"
+
+/ {
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory@40000000 {
+		device_type = "memory";
+		reg = <0 0x40000000 0 0x80000000>;
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
-- 
2.35.1


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

* [PATCH 03/11] arm64: dts: mediatek: cherry: Assign interrupt line to MT6359 PMIC
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
  2022-06-30 15:33 ` [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks AngeloGioacchino Del Regno
  2022-06-30 15:33 ` [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-07-01 22:20   ` Nícolas F. R. A. Prado
  2022-06-30 15:33 ` [PATCH 04/11] arm64: dts: mediatek: cherry: Add platform regulators layout and config AngeloGioacchino Del Regno
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

To allow MT6359 peripherals to trigger interrupts and the driver to
safely handle them, assign the right interrupt line for the Cherry
platform to the MT6359 PMIC node.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 7406d7bbf725..14f8f30b1eb3 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -21,6 +21,10 @@ memory@40000000 {
 	};
 };
 
+&pmic {
+	interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
+};
+
 &uart0 {
 	status = "okay";
 };
-- 
2.35.1


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

* [PATCH 04/11] arm64: dts: mediatek: cherry: Add platform regulators layout and config
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
                   ` (2 preceding siblings ...)
  2022-06-30 15:33 ` [PATCH 03/11] arm64: dts: mediatek: cherry: Assign interrupt line to MT6359 PMIC AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-07-01 22:26   ` Nícolas F. R. A. Prado
  2022-06-30 15:33 ` [PATCH 05/11] arm64: dts: mediatek: cherry: Add support for internal eMMC storage AngeloGioacchino Del Regno
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

Add the regulators layout for this platform, including the basic power
rails controlled by the EC (and/or always on).
Moreover, include the MT6359 PMIC devicetree and add some configuration
for its regulators, essential to keep the machine alive after booting.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 14f8f30b1eb3..091338f7d5ff 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -5,6 +5,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include "mt8195.dtsi"
+#include "mt6359.dtsi"
 
 / {
 	aliases {
@@ -19,6 +20,107 @@ memory@40000000 {
 		device_type = "memory";
 		reg = <0 0x40000000 0 0x80000000>;
 	};
+
+	/* system wide LDO 3.3V power rail */
+	pp3300_z5: regulator-3v3-pp3300-ldo-z5 {
+		compatible = "regulator-fixed";
+		regulator-name = "pp3300_ldo_z5";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&ppvar_sys>;
+	};
+
+	/* separately switched 3.3V power rail */
+	pp3300_s3: regulator-3v3-pp3300-s3 {
+		compatible = "regulator-fixed";
+		regulator-name = "pp3300_s3";
+		/* automatically sequenced by PMIC EXT_PMIC_EN2 */
+		regulator-always-on;
+		regulator-boot-on;
+		vin-supply = <&pp3300_z2>;
+	};
+
+	/* system wide 3.3V power rail */
+	pp3300_z2: regulator-3v3-pp3300-z2 {
+		compatible = "regulator-fixed";
+		regulator-name = "pp3300_z2";
+		/* EN pin tied to pp4200_z2, which is controlled by EC */
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&ppvar_sys>;
+	};
+
+	/* system wide 4.2V power rail */
+	pp4200_z2: regulator-4v2-pp4200-z2 {
+		compatible = "regulator-fixed";
+		regulator-name = "pp4200_z2";
+		/* controlled by EC */
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <4200000>;
+		regulator-max-microvolt = <4200000>;
+		vin-supply = <&ppvar_sys>;
+	};
+
+	/* system wide switching 5.0V power rail */
+	pp5000_s5: regulator-5v0-pp5000-s5 {
+		compatible = "regulator-fixed";
+		regulator-name = "pp5000_s5";
+		/* controlled by EC */
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&ppvar_sys>;
+	};
+
+	/* system wide semi-regulated power rail from battery or USB */
+	ppvar_sys: regulator-ppvar-sys {
+		compatible = "regulator-fixed";
+		regulator-name = "ppvar_sys";
+		regulator-always-on;
+		regulator-boot-on;
+	};
+};
+
+/* for CPU-L */
+&mt6359_vcore_buck_reg {
+	regulator-always-on;
+};
+
+/* for CORE */
+&mt6359_vgpu11_buck_reg {
+	regulator-always-on;
+};
+
+&mt6359_vgpu11_sshub_buck_reg {
+	regulator-always-on;
+	regulator-min-microvolt = <550000>;
+	regulator-max-microvolt = <550000>;
+};
+
+/* for CORE SRAM */
+&mt6359_vpu_buck_reg {
+	regulator-always-on;
+};
+
+&mt6359_vrf12_ldo_reg {
+	regulator-always-on;
+};
+
+/* for GPU SRAM */
+&mt6359_vsram_others_ldo_reg {
+	regulator-always-on;
+	regulator-min-microvolt = <750000>;
+	regulator-max-microvolt = <750000>;
+};
+
+&mt6359_vufs_ldo_reg {
+	regulator-always-on;
 };
 
 &pmic {
-- 
2.35.1


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

* [PATCH 05/11] arm64: dts: mediatek: cherry: Add support for internal eMMC storage
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
                   ` (3 preceding siblings ...)
  2022-06-30 15:33 ` [PATCH 04/11] arm64: dts: mediatek: cherry: Add platform regulators layout and config AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-07-01 22:36   ` Nícolas F. R. A. Prado
  2022-06-30 15:33 ` [PATCH 06/11] arm64: dts: mediatek: cherry: Document gpios and add default pin config AngeloGioacchino Del Regno
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

Add mtk-sd controller and pin configuration to enable the internal
eMMC storage: now it is possible to mount a rootfs located at the
internal storage.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 091338f7d5ff..8c4b492f774f 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -9,6 +9,7 @@
 
 / {
 	aliases {
+		mmc0 = &mmc0;
 		serial0 = &uart0;
 	};
 
@@ -87,6 +88,26 @@ ppvar_sys: regulator-ppvar-sys {
 	};
 };
 
+&mmc0 {
+	status = "okay";
+
+	bus-width = <8>;
+	cap-mmc-highspeed;
+	cap-mmc-hw-reset;
+	hs400-ds-delay = <0x14c11>;
+	max-frequency = <200000000>;
+	mmc-hs200-1_8v;
+	mmc-hs400-1_8v;
+	no-sdio;
+	no-sd;
+	non-removable;
+	pinctrl-names = "default", "state_uhs";
+	pinctrl-0 = <&mmc0_pins_default>;
+	pinctrl-1 = <&mmc0_pins_uhs>;
+	vmmc-supply = <&mt6359_vemc_1_ldo_reg>;
+	vqmmc-supply = <&mt6359_vufs_ldo_reg>;
+};
+
 /* for CPU-L */
 &mt6359_vcore_buck_reg {
 	regulator-always-on;
@@ -123,6 +144,72 @@ &mt6359_vufs_ldo_reg {
 	regulator-always-on;
 };
 
+&pio {
+	mmc0_pins_default: mmc0-default-pins {
+		pins-cmd-dat {
+			pinmux = <PINMUX_GPIO126__FUNC_MSDC0_DAT0>,
+				 <PINMUX_GPIO125__FUNC_MSDC0_DAT1>,
+				 <PINMUX_GPIO124__FUNC_MSDC0_DAT2>,
+				 <PINMUX_GPIO123__FUNC_MSDC0_DAT3>,
+				 <PINMUX_GPIO119__FUNC_MSDC0_DAT4>,
+				 <PINMUX_GPIO118__FUNC_MSDC0_DAT5>,
+				 <PINMUX_GPIO117__FUNC_MSDC0_DAT6>,
+				 <PINMUX_GPIO116__FUNC_MSDC0_DAT7>,
+				 <PINMUX_GPIO121__FUNC_MSDC0_CMD>;
+			input-enable;
+			drive-strength = <MTK_DRIVE_6mA>;
+			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+		};
+
+		pins-clk {
+			pinmux = <PINMUX_GPIO122__FUNC_MSDC0_CLK>;
+			drive-strength = <MTK_DRIVE_6mA>;
+			bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+		};
+
+		pins-rst {
+			pinmux = <PINMUX_GPIO120__FUNC_MSDC0_RSTB>;
+			drive-strength = <MTK_DRIVE_6mA>;
+			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+		};
+	};
+
+	mmc0_pins_uhs: mmc0-uhs-pins {
+		pins-cmd-dat {
+			pinmux = <PINMUX_GPIO126__FUNC_MSDC0_DAT0>,
+				 <PINMUX_GPIO125__FUNC_MSDC0_DAT1>,
+				 <PINMUX_GPIO124__FUNC_MSDC0_DAT2>,
+				 <PINMUX_GPIO123__FUNC_MSDC0_DAT3>,
+				 <PINMUX_GPIO119__FUNC_MSDC0_DAT4>,
+				 <PINMUX_GPIO118__FUNC_MSDC0_DAT5>,
+				 <PINMUX_GPIO117__FUNC_MSDC0_DAT6>,
+				 <PINMUX_GPIO116__FUNC_MSDC0_DAT7>,
+				 <PINMUX_GPIO121__FUNC_MSDC0_CMD>;
+			input-enable;
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+		};
+
+		pins-clk {
+			pinmux = <PINMUX_GPIO122__FUNC_MSDC0_CLK>;
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+		};
+
+		pins-ds {
+			pinmux = <PINMUX_GPIO127__FUNC_MSDC0_DSL>;
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+		};
+
+		pins-rst {
+			pinmux = <PINMUX_GPIO120__FUNC_MSDC0_RSTB>;
+			drive-strength = <MTK_DRIVE_8mA>;
+			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+		};
+	};
+};
+
 &pmic {
 	interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
 };
-- 
2.35.1


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

* [PATCH 06/11] arm64: dts: mediatek: cherry: Document gpios and add default pin config
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
                   ` (4 preceding siblings ...)
  2022-06-30 15:33 ` [PATCH 05/11] arm64: dts: mediatek: cherry: Add support for internal eMMC storage AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-07-01 22:39   ` Nícolas F. R. A. Prado
  2022-06-30 15:33 ` [PATCH 07/11] arm64: dts: mediatek: cherry: Enable I2C and SPI controllers AngeloGioacchino Del Regno
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

Add gpio-line-names to document GPIO names and add the default basic
pin configuration to allow lower power operation by setting appropriate
state on the unused pins.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../dts/mediatek/mt8195-cherry-tomato-r2.dts  |  20 ++
 .../dts/mediatek/mt8195-cherry-tomato-r3.dts  |  20 ++
 .../boot/dts/mediatek/mt8195-cherry.dtsi      | 199 ++++++++++++++++++
 3 files changed, 239 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
index b915fba311e9..ee5fd07ad573 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
@@ -9,3 +9,23 @@ / {
 	model = "MediaTek Tomato (rev2) board";
 	compatible = "google,tomato-rev2", "google,tomato", "mediatek,mt8195";
 };
+
+&pio_default {
+	pins-low-power-hdmi-disable {
+		pinmux = <PINMUX_GPIO31__FUNC_GPIO31>,
+			 <PINMUX_GPIO32__FUNC_GPIO32>,
+			 <PINMUX_GPIO33__FUNC_GPIO33>,
+			 <PINMUX_GPIO34__FUNC_GPIO34>,
+			 <PINMUX_GPIO35__FUNC_GPIO35>;
+		input-enable;
+		bias-pull-down;
+	};
+
+	pins-low-power-pcie0-disable {
+		pinmux = <PINMUX_GPIO19__FUNC_GPIO19>,
+			 <PINMUX_GPIO20__FUNC_GPIO20>,
+			 <PINMUX_GPIO21__FUNC_GPIO21>;
+		input-enable;
+		bias-pull-down;
+	};
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
index 2ead9eca2ec9..792f6c83e88b 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
@@ -10,3 +10,23 @@ / {
 	compatible = "google,tomato-rev4", "google,tomato-rev3",
 		     "google,tomato", "mediatek,mt8195";
 };
+
+&pio_default {
+	pins-low-power-hdmi-disable {
+		pinmux = <PINMUX_GPIO31__FUNC_GPIO31>,
+			 <PINMUX_GPIO32__FUNC_GPIO32>,
+			 <PINMUX_GPIO33__FUNC_GPIO33>,
+			 <PINMUX_GPIO34__FUNC_GPIO34>,
+			 <PINMUX_GPIO35__FUNC_GPIO35>;
+		input-enable;
+		bias-pull-down;
+	};
+
+	pins-low-power-pcie0-disable {
+		pinmux = <PINMUX_GPIO19__FUNC_GPIO19>,
+			 <PINMUX_GPIO20__FUNC_GPIO20>,
+			 <PINMUX_GPIO21__FUNC_GPIO21>;
+		input-enable;
+		bias-pull-down;
+	};
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 8c4b492f774f..2f70341bba91 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -145,6 +145,161 @@ &mt6359_vufs_ldo_reg {
 };
 
 &pio {
+	mediatek,rsel-resistance-in-si-unit;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pio_default>;
+
+	/* 144 lines */
+	gpio-line-names =
+		"I2S_SPKR_MCLK",
+		"I2S_SPKR_DATAIN",
+		"I2S_SPKR_LRCK",
+		"I2S_SPKR_BCLK",
+		"EC_AP_INT_ODL",
+		/*
+		 * AP_FLASH_WP_L is crossystem ABI. Schematics
+		 * call it AP_FLASH_WP_ODL.
+		 */
+		"AP_FLASH_WP_L",
+		"TCHPAD_INT_ODL",
+		"EDP_HPD_1V8",
+		"AP_I2C_CAM_SDA",
+		"AP_I2C_CAM_SCL",
+		"AP_I2C_TCHPAD_SDA_1V8",
+		"AP_I2C_TCHPAD_SCL_1V8",
+		"AP_I2C_AUD_SDA",
+		"AP_I2C_AUD_SCL",
+		"AP_I2C_TPM_SDA_1V8",
+		"AP_I2C_TPM_SCL_1V8",
+		"AP_I2C_TCHSCR_SDA_1V8",
+		"AP_I2C_TCHSCR_SCL_1V8",
+		"EC_AP_HPD_OD",
+		"",
+		"PCIE_NVME_RST_L",
+		"PCIE_NVME_CLKREQ_ODL",
+		"PCIE_RST_1V8_L",
+		"PCIE_CLKREQ_1V8_ODL",
+		"PCIE_WAKE_1V8_ODL",
+		"CLK_24M_CAM0",
+		"CAM1_SEN_EN",
+		"AP_I2C_PWR_SCL_1V8",
+		"AP_I2C_PWR_SDA_1V8",
+		"AP_I2C_MISC_SCL",
+		"AP_I2C_MISC_SDA",
+		"EN_PP5000_HDMI_X",
+		"AP_HDMITX_HTPLG",
+		"",
+		"AP_HDMITX_SCL_1V8",
+		"AP_HDMITX_SDA_1V8",
+		"AP_RTC_CLK32K",
+		"AP_EC_WATCHDOG_L",
+		"SRCLKENA0",
+		"SRCLKENA1",
+		"PWRAP_SPI0_CS_L",
+		"PWRAP_SPI0_CK",
+		"PWRAP_SPI0_MOSI",
+		"PWRAP_SPI0_MISO",
+		"SPMI_SCL",
+		"SPMI_SDA",
+		"",
+		"",
+		"",
+		"I2S_HP_DATAIN",
+		"I2S_HP_MCLK",
+		"I2S_HP_BCK",
+		"I2S_HP_LRCK",
+		"I2S_HP_DATAOUT",
+		"SD_CD_ODL",
+		"EN_PP3300_DISP_X",
+		"TCHSCR_RST_1V8_L",
+		"TCHSCR_REPORT_DISABLE",
+		"EN_PP3300_WLAN_X",
+		"BT_KILL_1V8_L",
+		"I2S_SPKR_DATAOUT",
+		"WIFI_KILL_1V8_L",
+		"BEEP_ON",
+		"SCP_I2C_SENSOR_SCL_1V8",
+		"SCP_I2C_SENSOR_SDA_1V8",
+		"",
+		"",
+		"",
+		"",
+		"AUD_CLK_MOSI",
+		"AUD_SYNC_MOSI",
+		"AUD_DAT_MOSI0",
+		"AUD_DAT_MOSI1",
+		"AUD_DAT_MISO0",
+		"AUD_DAT_MISO1",
+		"AUD_DAT_MISO2",
+		"SCP_VREQ_VAO",
+		"AP_SPI_GSC_TPM_CLK",
+		"AP_SPI_GSC_TPM_MOSI",
+		"AP_SPI_GSC_TPM_CS_L",
+		"AP_SPI_GSC_TPM_MISO",
+		"EN_PP1000_CAM_X",
+		"AP_EDP_BKLTEN",
+		"",
+		"USB3_HUB_RST_L",
+		"",
+		"WLAN_ALERT_ODL",
+		"EC_IN_RW_ODL",
+		"GSC_AP_INT_ODL",
+		"HP_INT_ODL",
+		"CAM0_RST_L",
+		"CAM1_RST_L",
+		"TCHSCR_INT_1V8_L",
+		"CAM1_DET_L",
+		"RST_ALC1011_L",
+		"",
+		"",
+		"BL_PWM_1V8",
+		"UART_AP_TX_DBG_RX",
+		"UART_DBG_TX_AP_RX",
+		"EN_SPKR",
+		"AP_EC_WARM_RST_REQ",
+		"UART_SCP_TX_DBGCON_RX",
+		"UART_DBGCON_TX_SCP_RX",
+		"",
+		"",
+		"KPCOL0",
+		"",
+		"MT6315_GPU_INT",
+		"MT6315_PROC_BC_INT",
+		"SD_CMD",
+		"SD_CLK",
+		"SD_DAT0",
+		"SD_DAT1",
+		"SD_DAT2",
+		"SD_DAT3",
+		"EMMC_DAT7",
+		"EMMC_DAT6",
+		"EMMC_DAT5",
+		"EMMC_DAT4",
+		"EMMC_RSTB",
+		"EMMC_CMD",
+		"EMMC_CLK",
+		"EMMC_DAT3",
+		"EMMC_DAT2",
+		"EMMC_DAT1",
+		"EMMC_DAT0",
+		"EMMC_DSL",
+		"",
+		"",
+		"MT6360_INT_ODL",
+		"SCP_JTAG0_TRSTN",
+		"AP_SPI_EC_CS_L",
+		"AP_SPI_EC_CLK",
+		"AP_SPI_EC_MOSI",
+		"AP_SPI_EC_MISO",
+		"SCP_JTAG0_TMS",
+		"SCP_JTAG0_TCK",
+		"SCP_JTAG0_TDO",
+		"SCP_JTAG0_TDI",
+		"AP_SPI_FLASH_CS_L",
+		"AP_SPI_FLASH_CLK",
+		"AP_SPI_FLASH_MOSI",
+		"AP_SPI_FLASH_MISO";
+
 	mmc0_pins_default: mmc0-default-pins {
 		pins-cmd-dat {
 			pinmux = <PINMUX_GPIO126__FUNC_MSDC0_DAT0>,
@@ -208,6 +363,50 @@ pins-rst {
 			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
 		};
 	};
+
+	pio_default: pio-default-pins {
+		pins-wifi-enable {
+			pinmux = <PINMUX_GPIO58__FUNC_GPIO58>;
+			output-high;
+			drive-strength = <MTK_DRIVE_14mA>;
+		};
+
+		pins-low-power-pd {
+			pinmux = <PINMUX_GPIO25__FUNC_GPIO25>,
+				 <PINMUX_GPIO26__FUNC_GPIO26>,
+				 <PINMUX_GPIO46__FUNC_GPIO46>,
+				 <PINMUX_GPIO47__FUNC_GPIO47>,
+				 <PINMUX_GPIO48__FUNC_GPIO48>,
+				 <PINMUX_GPIO65__FUNC_GPIO65>,
+				 <PINMUX_GPIO66__FUNC_GPIO66>,
+				 <PINMUX_GPIO67__FUNC_GPIO67>,
+				 <PINMUX_GPIO68__FUNC_GPIO68>,
+				 <PINMUX_GPIO128__FUNC_GPIO128>,
+				 <PINMUX_GPIO129__FUNC_GPIO129>;
+			input-enable;
+			bias-pull-down;
+		};
+
+		pins-low-power-pupd {
+			pinmux = <PINMUX_GPIO77__FUNC_GPIO77>,
+				 <PINMUX_GPIO78__FUNC_GPIO78>,
+				 <PINMUX_GPIO79__FUNC_GPIO79>,
+				 <PINMUX_GPIO80__FUNC_GPIO80>,
+				 <PINMUX_GPIO83__FUNC_GPIO83>,
+				 <PINMUX_GPIO85__FUNC_GPIO85>,
+				 <PINMUX_GPIO90__FUNC_GPIO90>,
+				 <PINMUX_GPIO91__FUNC_GPIO91>,
+				 <PINMUX_GPIO93__FUNC_GPIO93>,
+				 <PINMUX_GPIO94__FUNC_GPIO94>,
+				 <PINMUX_GPIO95__FUNC_GPIO95>,
+				 <PINMUX_GPIO96__FUNC_GPIO96>,
+				 <PINMUX_GPIO104__FUNC_GPIO104>,
+				 <PINMUX_GPIO105__FUNC_GPIO105>,
+				 <PINMUX_GPIO107__FUNC_GPIO107>;
+			input-enable;
+			bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
+		};
+	};
 };
 
 &pmic {
-- 
2.35.1


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

* [PATCH 07/11] arm64: dts: mediatek: cherry: Enable I2C and SPI controllers
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
                   ` (5 preceding siblings ...)
  2022-06-30 15:33 ` [PATCH 06/11] arm64: dts: mediatek: cherry: Document gpios and add default pin config AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-07-01 22:42   ` Nícolas F. R. A. Prado
  2022-06-30 15:33 ` [PATCH 08/11] arm64: dts: mediatek: cherry: Enable T-PHYs and USB XHCI controllers AngeloGioacchino Del Regno
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

This platform uses eight I2C controllers and one SPI controller:
in preparation for enabling devices attached to these controllers,
add basic configuration to enable the busses.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 2f70341bba91..23a86d07274c 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -9,6 +9,13 @@
 
 / {
 	aliases {
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		i2c3 = &i2c3;
+		i2c4 = &i2c4;
+		i2c5 = &i2c5;
+		i2c7 = &i2c7;
 		mmc0 = &mmc0;
 		serial0 = &uart0;
 	};
@@ -88,6 +95,65 @@ ppvar_sys: regulator-ppvar-sys {
 	};
 };
 
+&i2c0 {
+	status = "okay";
+
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pin>;
+};
+
+&i2c1 {
+	status = "okay";
+
+	clock-frequency = <400000>;
+	i2c-scl-internal-delay-ns = <12500>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c1_pin>;
+};
+
+&i2c2 {
+	status = "okay";
+
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_pin>;
+};
+
+&i2c3 {
+	status = "okay";
+
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c3_pin>;
+};
+
+&i2c4 {
+	status = "okay";
+
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c4_pin>;
+};
+
+&i2c5 {
+	status = "okay";
+
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c5_pin>;
+};
+
+&i2c7 {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c7_pin>;
+};
+
 &mmc0 {
 	status = "okay";
 
@@ -300,6 +366,68 @@ &pio {
 		"AP_SPI_FLASH_MOSI",
 		"AP_SPI_FLASH_MISO";
 
+	i2c0_pin: i2c0-default-pins {
+		pins-bus {
+			pinmux = <PINMUX_GPIO8__FUNC_SDA0>,
+				 <PINMUX_GPIO9__FUNC_SCL0>;
+			bias-disable;
+			drive-strength-microamp = <1000>;
+		};
+	};
+
+	i2c1_pin: i2c1-default-pins {
+		pins-bus {
+			pinmux = <PINMUX_GPIO10__FUNC_SDA1>,
+				 <PINMUX_GPIO11__FUNC_SCL1>;
+			bias-pull-up = <1000>;
+			drive-strength-microamp = <1000>;
+		};
+	};
+
+	i2c2_pin: i2c2-default-pins {
+		pins-bus {
+			pinmux = <PINMUX_GPIO12__FUNC_SDA2>,
+				 <PINMUX_GPIO13__FUNC_SCL2>;
+			bias-disable;
+			drive-strength-microamp = <1000>;
+		};
+	};
+
+	i2c3_pin: i2c3-default-pins {
+		pins-bus {
+			pinmux = <PINMUX_GPIO14__FUNC_SDA3>,
+				 <PINMUX_GPIO15__FUNC_SCL3>;
+			bias-pull-up = <1000>;
+			drive-strength-microamp = <1000>;
+		};
+	};
+
+	i2c4_pin: i2c4-default-pins {
+		pins-bus {
+			pinmux = <PINMUX_GPIO16__FUNC_SDA4>,
+				 <PINMUX_GPIO17__FUNC_SCL4>;
+			bias-pull-up = <1000>;
+			drive-strength = <MTK_DRIVE_4mA>;
+		};
+	};
+
+	i2c5_pin: i2c5-default-pins {
+		pins-bus {
+			pinmux = <PINMUX_GPIO29__FUNC_SCL5>,
+				 <PINMUX_GPIO30__FUNC_SDA5>;
+			bias-disable;
+			drive-strength-microamp = <1000>;
+		};
+	};
+
+	i2c7_pin: i2c7-default-pins {
+		pins-bus {
+			pinmux = <PINMUX_GPIO27__FUNC_SCL7>,
+				 <PINMUX_GPIO28__FUNC_SDA7>;
+			bias-disable;
+		};
+	};
+
 	mmc0_pins_default: mmc0-default-pins {
 		pins-cmd-dat {
 			pinmux = <PINMUX_GPIO126__FUNC_MSDC0_DAT0>,
@@ -407,12 +535,34 @@ pins-low-power-pupd {
 			bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
 		};
 	};
+
+	spi0_pins: spi0-default-pins {
+		pins-cs-mosi-clk {
+			pinmux = <PINMUX_GPIO132__FUNC_SPIM0_CSB>,
+				 <PINMUX_GPIO134__FUNC_SPIM0_MO>,
+				 <PINMUX_GPIO133__FUNC_SPIM0_CLK>;
+			bias-disable;
+		};
+
+		pins-miso {
+			pinmux = <PINMUX_GPIO135__FUNC_SPIM0_MI>;
+			bias-pull-down;
+		};
+	};
 };
 
 &pmic {
 	interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
 };
 
+&spi0 {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_pins>;
+	mediatek,pad-select = <0>;
+};
+
 &uart0 {
 	status = "okay";
 };
-- 
2.35.1


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

* [PATCH 08/11] arm64: dts: mediatek: cherry: Enable T-PHYs and USB XHCI controllers
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
                   ` (6 preceding siblings ...)
  2022-06-30 15:33 ` [PATCH 07/11] arm64: dts: mediatek: cherry: Enable I2C and SPI controllers AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-07-01 22:43   ` Nícolas F. R. A. Prado
  2022-06-30 15:33 ` [PATCH 09/11] arm64: dts: mediatek: cherry: Enable MT6360 sub-pmic on I2C7 AngeloGioacchino Del Regno
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

Add USB functionality by enabling the required PHYs and the XHCI
controllers.
This enables all of the supported USB ports on the Cherry boards.

Please note that u3phy1 also enables u3port1, which is configured
to be a PCI-Express PHY for the second PCIe controller that is
found on the MT8195 SoC, which will be enabled in a later commit.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 23a86d07274c..379d0e5c4055 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -93,6 +93,15 @@ ppvar_sys: regulator-ppvar-sys {
 		regulator-always-on;
 		regulator-boot-on;
 	};
+
+	usb_vbus: regulator-5v0-usb-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb-vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+		regulator-always-on;
+	};
 };
 
 &i2c0 {
@@ -563,6 +572,52 @@ &spi0 {
 	mediatek,pad-select = <0>;
 };
 
+&u3phy0 {
+	status = "okay";
+};
+
+&u3phy1 {
+	status = "okay";
+};
+
+&u3phy2 {
+	status = "okay";
+};
+
+&u3phy3 {
+	status = "okay";
+};
+
 &uart0 {
 	status = "okay";
 };
+
+&xhci0 {
+	status = "okay";
+
+	vusb33-supply = <&mt6359_vusb_ldo_reg>;
+	vbus-supply = <&usb_vbus>;
+};
+
+&xhci1 {
+	status = "okay";
+
+	vusb33-supply = <&mt6359_vusb_ldo_reg>;
+	vbus-supply = <&usb_vbus>;
+};
+
+&xhci2 {
+	status = "okay";
+
+	vusb33-supply = <&mt6359_vusb_ldo_reg>;
+	vbus-supply = <&usb_vbus>;
+};
+
+&xhci3 {
+	status = "okay";
+
+	/* MT7921's USB Bluetooth has issues with USB2 LPM */
+	usb2-lpm-disable;
+	vusb33-supply = <&mt6359_vusb_ldo_reg>;
+	vbus-supply = <&usb_vbus>;
+};
-- 
2.35.1


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

* [PATCH 09/11] arm64: dts: mediatek: cherry: Enable MT6360 sub-pmic on I2C7
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
                   ` (7 preceding siblings ...)
  2022-06-30 15:33 ` [PATCH 08/11] arm64: dts: mediatek: cherry: Enable T-PHYs and USB XHCI controllers AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-07-01 22:45   ` Nícolas F. R. A. Prado
  2022-06-30 15:33 ` [PATCH 10/11] arm64: dts: mediatek: cherry: Enable support for the SPI NOR flash AngeloGioacchino Del Regno
  2022-06-30 15:33 ` [PATCH 11/11] arm64: dts: mediatek: cherry: Add I2C-HID touchscreen on I2C4 AngeloGioacchino Del Regno
  10 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

All devices of the Cherry platform have a MT6360 sub-pmic,
providing two LDOs. Add the required node to enable the PMIC
but without regulators yet, as these will be added in a
later commit.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 379d0e5c4055..1668aa1be373 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -161,6 +161,18 @@ &i2c7 {
 	clock-frequency = <400000>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c7_pin>;
+
+	pmic@34 {
+		#interrupt-cells = <2>;
+		compatible = "mediatek,mt6360";
+		reg = <0x34>;
+		interrupt-controller;
+		interrupts-extended = <&pio 130 IRQ_TYPE_EDGE_FALLING>;
+		interrupt-names = "IRQB";
+		pinctrl-names = "default";
+		pinctrl-0 = <&subpmic_default>;
+		wakeup-source;
+	};
 };
 
 &mmc0 {
@@ -558,6 +570,14 @@ pins-miso {
 			bias-pull-down;
 		};
 	};
+
+	subpmic_default: subpmic-default-pins {
+		subpmic_pin_irq: pins-subpmic-int-n {
+			pinmux = <PINMUX_GPIO130__FUNC_GPIO130>;
+			input-enable;
+			bias-pull-up;
+		};
+	};
 };
 
 &pmic {
-- 
2.35.1


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

* [PATCH 10/11] arm64: dts: mediatek: cherry: Enable support for the SPI NOR flash
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
                   ` (8 preceding siblings ...)
  2022-06-30 15:33 ` [PATCH 09/11] arm64: dts: mediatek: cherry: Enable MT6360 sub-pmic on I2C7 AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-07-01 22:47   ` Nícolas F. R. A. Prado
  2022-06-30 15:33 ` [PATCH 11/11] arm64: dts: mediatek: cherry: Add I2C-HID touchscreen on I2C4 AngeloGioacchino Del Regno
  10 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

This platform has a SPI NOR: enable support for it, completing the
storage compartment enablement for the entire platform.

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

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 1668aa1be373..2687c6d40ac1 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -231,6 +231,21 @@ &mt6359_vufs_ldo_reg {
 	regulator-always-on;
 };
 
+&nor_flash {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&nor_pins_default>;
+
+	flash@0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <52000000>;
+		spi-rx-bus-width = <2>;
+		spi-tx-bus-width = <2>;
+	};
+};
+
 &pio {
 	mediatek,rsel-resistance-in-si-unit;
 	pinctrl-names = "default";
@@ -513,6 +528,22 @@ pins-rst {
 		};
 	};
 
+	nor_pins_default: nor-default-pins {
+		pins-ck-io {
+			pinmux = <PINMUX_GPIO142__FUNC_SPINOR_IO0>,
+				 <PINMUX_GPIO141__FUNC_SPINOR_CK>,
+				 <PINMUX_GPIO143__FUNC_SPINOR_IO1>;
+			drive-strength = <MTK_DRIVE_6mA>;
+			bias-pull-down;
+		};
+
+		pins-cs {
+			pinmux = <PINMUX_GPIO140__FUNC_SPINOR_CS>;
+			drive-strength = <MTK_DRIVE_6mA>;
+			bias-pull-up;
+		};
+	};
+
 	pio_default: pio-default-pins {
 		pins-wifi-enable {
 			pinmux = <PINMUX_GPIO58__FUNC_GPIO58>;
-- 
2.35.1


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

* [PATCH 11/11] arm64: dts: mediatek: cherry: Add I2C-HID touchscreen on I2C4
  2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
                   ` (9 preceding siblings ...)
  2022-06-30 15:33 ` [PATCH 10/11] arm64: dts: mediatek: cherry: Enable support for the SPI NOR flash AngeloGioacchino Del Regno
@ 2022-06-30 15:33 ` AngeloGioacchino Del Regno
  2022-07-01 22:49   ` Nícolas F. R. A. Prado
  10 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-30 15:33 UTC (permalink / raw)
  To: robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, angelogioacchino.delregno,
	hsinyi, nfraprado, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek, wenst

This platform carries a HID compatible I2C touchscreen on the i2c4 bus,
but it may either be at 0x10, or at 0x15, depending on the board model:
declare both as disabled in the common Cherry device-tree and enable
the required touchscreen node on a per-board basis.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../dts/mediatek/mt8195-cherry-tomato-r1.dts  |  4 ++
 .../dts/mediatek/mt8195-cherry-tomato-r2.dts  |  4 ++
 .../dts/mediatek/mt8195-cherry-tomato-r3.dts  |  4 ++
 .../boot/dts/mediatek/mt8195-cherry.dtsi      | 41 +++++++++++++++++++
 4 files changed, 53 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 17e9e4d6f6ab..2837fb24c84c 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
@@ -9,3 +9,7 @@ / {
 	model = "MediaTek Tomato (rev1) board";
 	compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195";
 };
+
+&ts_10 {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
index ee5fd07ad573..4e1d1a1887c7 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
@@ -29,3 +29,7 @@ pins-low-power-pcie0-disable {
 		bias-pull-down;
 	};
 };
+
+&ts_10 {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
index 792f6c83e88b..4a45884203ea 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
@@ -30,3 +30,7 @@ pins-low-power-pcie0-disable {
 		bias-pull-down;
 	};
 };
+
+&ts_10 {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 2687c6d40ac1..7a32c7006a5a 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -143,6 +143,31 @@ &i2c4 {
 	clock-frequency = <400000>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c4_pin>;
+
+	/* Depending on the machine, the TS may be at 0x10 or at 0x15 */
+	ts_10: touchscreen@10 {
+		compatible = "hid-over-i2c";
+		reg = <0x10>;
+		hid-descr-addr = <0x0001>;
+		interrupts-extended = <&pio 92 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&touchscreen_pins>;
+		post-power-on-delay-ms = <10>;
+		vdd-supply = <&pp3300_s3>;
+		status = "disabled";
+	};
+
+	ts_15: touchscreen@15 {
+		compatible = "hid-over-i2c";
+		reg = <0x15>;
+		hid-descr-addr = <0x0001>;
+		interrupts-extended = <&pio 92 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&touchscreen_pins>;
+		post-power-on-delay-ms = <10>;
+		vdd-supply = <&pp3300_s3>;
+		status = "disabled";
+	};
 };
 
 &i2c5 {
@@ -609,6 +634,22 @@ subpmic_pin_irq: pins-subpmic-int-n {
 			bias-pull-up;
 		};
 	};
+
+	touchscreen_pins: touchscreen-default-pins {
+		pins-int-n {
+			pinmux = <PINMUX_GPIO92__FUNC_GPIO92>;
+			input-enable;
+			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+		};
+		pins-rst {
+			pinmux = <PINMUX_GPIO56__FUNC_GPIO56>;
+			output-high;
+		};
+		pins-report-sw {
+			pinmux = <PINMUX_GPIO57__FUNC_GPIO57>;
+			output-low;
+		};
+	};
 };
 
 &pmic {
-- 
2.35.1


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

* Re: [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks
  2022-06-30 15:33 ` [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks AngeloGioacchino Del Regno
@ 2022-06-30 18:26   ` Krzysztof Kozlowski
  2022-07-01 15:31   ` Nícolas F. R. A. Prado
  2022-07-01 22:04   ` Nícolas F. R. A. Prado
  2 siblings, 0 replies; 31+ messages in thread
From: Krzysztof Kozlowski @ 2022-06-30 18:26 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, robh+dt
  Cc: krzysztof.kozlowski+dt, matthias.bgg, hsinyi, nfraprado,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On 30/06/2022 17:33, AngeloGioacchino Del Regno wrote:
> Document board compatibles for the MT8195 Cherry platform's
> Tomato Chromebooks, at the time of writing composed of four
> revisions (r0, r1, r2, r3-r4).
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

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

* Re: [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks
  2022-06-30 15:33 ` [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks AngeloGioacchino Del Regno
  2022-06-30 18:26   ` Krzysztof Kozlowski
@ 2022-07-01 15:31   ` Nícolas F. R. A. Prado
  2022-07-04  8:51     ` AngeloGioacchino Del Regno
  2022-07-01 22:04   ` Nícolas F. R. A. Prado
  2 siblings, 1 reply; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 15:31 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:06PM +0200, AngeloGioacchino Del Regno wrote:
> Document board compatibles for the MT8195 Cherry platform's
> Tomato Chromebooks, at the time of writing composed of four
> revisions (r0, r1, r2, r3-r4).
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  Documentation/devicetree/bindings/arm/mediatek.yaml | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/mediatek.yaml b/Documentation/devicetree/bindings/arm/mediatek.yaml
> index dd6c6e8011f9..3e0afa17ed2e 100644
> --- a/Documentation/devicetree/bindings/arm/mediatek.yaml
> +++ b/Documentation/devicetree/bindings/arm/mediatek.yaml
> @@ -144,6 +144,19 @@ properties:
>            - const: google,spherion-rev0
>            - const: google,spherion
>            - const: mediatek,mt8192
> +      - description: Google Tomato (Acer Chromebook Spin 513)

Hi Angelo,

searching for "Acer Chromebook Spin 513" I found that there are two different
chromebooks:

https://www.acer.com/ac/en/US/content/series/acerchromebookspin513
https://www.acer.com/ac/en/GB/content/series/acerchromebookspin513cp5132h

The first one is a Qualcomm based one, while the second is mt8195-based, so I
assume that's Tomato.

They can be telled apart by the model name though: the Qualcomm one is
"CP513-1H", while Tomato is "CP513-2H". So I suggest to add the "CP513-2H" here
in the description, as well as in the cover letter, to avoid confusion between
the two.

Thanks,
Nícolas

> +        items:
> +          - enum:
> +              - google,tomato-rev2
> +              - google,tomato-rev1
> +          - const: google,tomato
> +          - const: mediatek,mt8195
> +      - description: Google Tomato (rev3 - 4)
> +        items:
> +          - const: google,tomato-rev4
> +          - const: google,tomato-rev3
> +          - const: google,tomato
> +          - const: mediatek,mt8195
>        - items:
>            - enum:
>                - mediatek,mt8186-evb
> -- 
> 2.35.1
> 

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

* Re: [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks
  2022-06-30 15:33 ` [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks AngeloGioacchino Del Regno
  2022-06-30 18:26   ` Krzysztof Kozlowski
  2022-07-01 15:31   ` Nícolas F. R. A. Prado
@ 2022-07-01 22:04   ` Nícolas F. R. A. Prado
  2022-07-04  8:56     ` AngeloGioacchino Del Regno
  2 siblings, 1 reply; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:04 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:06PM +0200, AngeloGioacchino Del Regno wrote:
> Document board compatibles for the MT8195 Cherry platform's
> Tomato Chromebooks, at the time of writing composed of four
> revisions (r0, r1, r2, r3-r4).

Though r0 is not added in this series?

> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  Documentation/devicetree/bindings/arm/mediatek.yaml | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/mediatek.yaml b/Documentation/devicetree/bindings/arm/mediatek.yaml
> index dd6c6e8011f9..3e0afa17ed2e 100644
> --- a/Documentation/devicetree/bindings/arm/mediatek.yaml
> +++ b/Documentation/devicetree/bindings/arm/mediatek.yaml
> @@ -144,6 +144,19 @@ properties:
>            - const: google,spherion-rev0
>            - const: google,spherion
>            - const: mediatek,mt8192

Angelo, this patch is depending on the patch from the asurada-spherion series
[1] to apply. Since this isn't the case for patch 2 as well, I assume this was
a mistake. And it does seem better to keep them independent.

[1] https://lore.kernel.org/all/20220629155956.1138955-2-nfraprado@collabora.com/

Thanks,
Nícolas

> +      - description: Google Tomato (Acer Chromebook Spin 513)
> +        items:
> +          - enum:
> +              - google,tomato-rev2
> +              - google,tomato-rev1
> +          - const: google,tomato
> +          - const: mediatek,mt8195
> +      - description: Google Tomato (rev3 - 4)
> +        items:
> +          - const: google,tomato-rev4
> +          - const: google,tomato-rev3
> +          - const: google,tomato
> +          - const: mediatek,mt8195
>        - items:
>            - enum:
>                - mediatek,mt8186-evb
> -- 
> 2.35.1
> 

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

* Re: [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato
  2022-06-30 15:33 ` [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato AngeloGioacchino Del Regno
@ 2022-07-01 22:11   ` Nícolas F. R. A. Prado
  2022-07-04  4:17     ` Chen-Yu Tsai
  0 siblings, 1 reply; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:11 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:07PM +0200, AngeloGioacchino Del Regno wrote:
> Introduce the MT8195 Cherry Chromebook platform, including three
> revisions of Cherry Tomato boards.
> 
> This basic configuration allows to boot Linux on all board revisions
> and get a serial console from a ramdisk.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  arch/arm64/boot/dts/mediatek/Makefile         |  3 +++
>  .../dts/mediatek/mt8195-cherry-tomato-r1.dts  | 11 ++++++++
>  .../dts/mediatek/mt8195-cherry-tomato-r2.dts  | 11 ++++++++
>  .../dts/mediatek/mt8195-cherry-tomato-r3.dts  | 12 +++++++++
>  .../boot/dts/mediatek/mt8195-cherry.dtsi      | 26 +++++++++++++++++++
>  5 files changed, 63 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
[..]
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> new file mode 100644
> index 000000000000..17e9e4d6f6ab
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> @@ -0,0 +1,11 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright (C) 2021 MediaTek Inc.
> + */
> +/dts-v1/;
> +#include "mt8195-cherry.dtsi"
> +
> +/ {
> +	model = "MediaTek Tomato (rev1) board";

Given that the compatible is "google," I believe we'll want to rename the model
to "Google Tomato", much like was commented on the Asurada series [1], but
better to have confirmation from someone from Google. Chen-Yu? :)

Otherwise,

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

[1] https://lore.kernel.org/all/CAGXv+5Gv2pjPXynz6HCdgux+giPDC5qRk+KW1aFduVz82rM=+g@mail.gmail.com/

> +	compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195";
> +};
[..]
> -- 
> 2.35.1
> 

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

* Re: [PATCH 03/11] arm64: dts: mediatek: cherry: Assign interrupt line to MT6359 PMIC
  2022-06-30 15:33 ` [PATCH 03/11] arm64: dts: mediatek: cherry: Assign interrupt line to MT6359 PMIC AngeloGioacchino Del Regno
@ 2022-07-01 22:20   ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:20 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:08PM +0200, AngeloGioacchino Del Regno wrote:
> To allow MT6359 peripherals to trigger interrupts and the driver to
> safely handle them, assign the right interrupt line for the Cherry
> platform to the MT6359 PMIC node.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> index 7406d7bbf725..14f8f30b1eb3 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> @@ -21,6 +21,10 @@ memory@40000000 {
>  	};
>  };
>  
> +&pmic {

This label references a node in mt6359.dtsi and you're missing the include here.
I noticed it does show up in the following patch, so either move this commit
after the next one or squash them.

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

> +	interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
> +};
> +
>  &uart0 {
>  	status = "okay";
>  };
> -- 
> 2.35.1
> 

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

* Re: [PATCH 04/11] arm64: dts: mediatek: cherry: Add platform regulators layout and config
  2022-06-30 15:33 ` [PATCH 04/11] arm64: dts: mediatek: cherry: Add platform regulators layout and config AngeloGioacchino Del Regno
@ 2022-07-01 22:26   ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:26 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:09PM +0200, AngeloGioacchino Del Regno wrote:
> Add the regulators layout for this platform, including the basic power
> rails controlled by the EC (and/or always on).
> Moreover, include the MT6359 PMIC devicetree and add some configuration
> for its regulators, essential to keep the machine alive after booting.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../boot/dts/mediatek/mt8195-cherry.dtsi      | 102 ++++++++++++++++++
>  1 file changed, 102 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> index 14f8f30b1eb3..091338f7d5ff 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> @@ -5,6 +5,7 @@
>  
>  #include <dt-bindings/gpio/gpio.h>
>  #include "mt8195.dtsi"
> +#include "mt6359.dtsi"
>  
>  / {
>  	aliases {
> @@ -19,6 +20,107 @@ memory@40000000 {
>  		device_type = "memory";
>  		reg = <0 0x40000000 0 0x80000000>;
>  	};
> +
> +	/* system wide LDO 3.3V power rail */
> +	pp3300_z5: regulator-3v3-pp3300-ldo-z5 {

I wouldn't have both "3v3" and "pp3300" in the node name since they mean the
same thing, but feel free to ignore this comment :).

> +		compatible = "regulator-fixed";
> +		regulator-name = "pp3300_ldo_z5";
> +		regulator-always-on;
> +		regulator-boot-on;
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +		vin-supply = <&ppvar_sys>;
> +	};
> +
> +	/* separately switched 3.3V power rail */
> +	pp3300_s3: regulator-3v3-pp3300-s3 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "pp3300_s3";
> +		/* automatically sequenced by PMIC EXT_PMIC_EN2 */
> +		regulator-always-on;
> +		regulator-boot-on;

Missing regulator-min/max-microvolt?

> +		vin-supply = <&pp3300_z2>;
> +	};
[..]
> -- 
> 2.35.1
> 

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

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

* Re: [PATCH 05/11] arm64: dts: mediatek: cherry: Add support for internal eMMC storage
  2022-06-30 15:33 ` [PATCH 05/11] arm64: dts: mediatek: cherry: Add support for internal eMMC storage AngeloGioacchino Del Regno
@ 2022-07-01 22:36   ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:36 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:10PM +0200, AngeloGioacchino Del Regno wrote:
> Add mtk-sd controller and pin configuration to enable the internal
> eMMC storage: now it is possible to mount a rootfs located at the
> internal storage.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../boot/dts/mediatek/mt8195-cherry.dtsi      | 87 +++++++++++++++++++
>  1 file changed, 87 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> index 091338f7d5ff..8c4b492f774f 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> @@ -9,6 +9,7 @@
>  
>  / {
>  	aliases {
> +		mmc0 = &mmc0;

There was this discussion about adding aliases on dtsi's or not [1]. The
case in favor of adding them in the dtsi seemed stronger, but it wasn't
conclusive... Anyway, I guess it's fine.

[1] https://lore.kernel.org/all/CAD=FV=Wi9xTnWTPbakSnf9rKkiT+4AT=3db-uwhww1bdLKjv9g@mail.gmail.com/

>  		serial0 = &uart0;
>  	};
[..]
> +&pio {
> +	mmc0_pins_default: mmc0-default-pins {
> +		pins-cmd-dat {
> +			pinmux = <PINMUX_GPIO126__FUNC_MSDC0_DAT0>,
> +				 <PINMUX_GPIO125__FUNC_MSDC0_DAT1>,
> +				 <PINMUX_GPIO124__FUNC_MSDC0_DAT2>,
> +				 <PINMUX_GPIO123__FUNC_MSDC0_DAT3>,
> +				 <PINMUX_GPIO119__FUNC_MSDC0_DAT4>,
> +				 <PINMUX_GPIO118__FUNC_MSDC0_DAT5>,
> +				 <PINMUX_GPIO117__FUNC_MSDC0_DAT6>,
> +				 <PINMUX_GPIO116__FUNC_MSDC0_DAT7>,
> +				 <PINMUX_GPIO121__FUNC_MSDC0_CMD>;
> +			input-enable;
> +			drive-strength = <MTK_DRIVE_6mA>;

These MTK_DRIVE_*mA macros map directly to the values, and the drive-strength
property is already standard and defined to take values in mA, so it's better to
use the value directly:

	drive-strength = <6>;

(Likewise below and in some other patches)

Otherwise,

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

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

* Re: [PATCH 06/11] arm64: dts: mediatek: cherry: Document gpios and add default pin config
  2022-06-30 15:33 ` [PATCH 06/11] arm64: dts: mediatek: cherry: Document gpios and add default pin config AngeloGioacchino Del Regno
@ 2022-07-01 22:39   ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:39 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:11PM +0200, AngeloGioacchino Del Regno wrote:
> Add gpio-line-names to document GPIO names and add the default basic
> pin configuration to allow lower power operation by setting appropriate
> state on the unused pins.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

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

* Re: [PATCH 07/11] arm64: dts: mediatek: cherry: Enable I2C and SPI controllers
  2022-06-30 15:33 ` [PATCH 07/11] arm64: dts: mediatek: cherry: Enable I2C and SPI controllers AngeloGioacchino Del Regno
@ 2022-07-01 22:42   ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:42 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:12PM +0200, AngeloGioacchino Del Regno wrote:
> This platform uses eight I2C controllers and one SPI controller:
> in preparation for enabling devices attached to these controllers,
> add basic configuration to enable the busses.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../boot/dts/mediatek/mt8195-cherry.dtsi      | 150 ++++++++++++++++++
>  1 file changed, 150 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> index 2f70341bba91..23a86d07274c 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> @@ -9,6 +9,13 @@
>  
>  / {
>  	aliases {
> +		i2c0 = &i2c0;
> +		i2c1 = &i2c1;
> +		i2c2 = &i2c2;
> +		i2c3 = &i2c3;
> +		i2c4 = &i2c4;
> +		i2c5 = &i2c5;
> +		i2c7 = &i2c7;
>  		mmc0 = &mmc0;
>  		serial0 = &uart0;
>  	};
> @@ -88,6 +95,65 @@ ppvar_sys: regulator-ppvar-sys {
>  	};
>  };
>  
> +&i2c0 {
> +	status = "okay";
> +
> +	clock-frequency = <400000>;
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&i2c0_pin>;

Very nitpicky: you could name it "i2c0_pins" to be consistent with the others
(including SPI on this patch).

> +};
[..]
> +&i2c7 {
> +	#address-cells = <1>;
> +	#size-cells = <0>;

These *-cells are already defined in the parent dtsi, so drop.

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

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

* Re: [PATCH 08/11] arm64: dts: mediatek: cherry: Enable T-PHYs and USB XHCI controllers
  2022-06-30 15:33 ` [PATCH 08/11] arm64: dts: mediatek: cherry: Enable T-PHYs and USB XHCI controllers AngeloGioacchino Del Regno
@ 2022-07-01 22:43   ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:43 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:13PM +0200, AngeloGioacchino Del Regno wrote:
> Add USB functionality by enabling the required PHYs and the XHCI
> controllers.
> This enables all of the supported USB ports on the Cherry boards.
> 
> Please note that u3phy1 also enables u3port1, which is configured
> to be a PCI-Express PHY for the second PCIe controller that is
> found on the MT8195 SoC, which will be enabled in a later commit.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

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

* Re: [PATCH 09/11] arm64: dts: mediatek: cherry: Enable MT6360 sub-pmic on I2C7
  2022-06-30 15:33 ` [PATCH 09/11] arm64: dts: mediatek: cherry: Enable MT6360 sub-pmic on I2C7 AngeloGioacchino Del Regno
@ 2022-07-01 22:45   ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:45 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:14PM +0200, AngeloGioacchino Del Regno wrote:
> All devices of the Cherry platform have a MT6360 sub-pmic,
> providing two LDOs. Add the required node to enable the PMIC
> but without regulators yet, as these will be added in a
> later commit.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../boot/dts/mediatek/mt8195-cherry.dtsi      | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> index 379d0e5c4055..1668aa1be373 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> @@ -161,6 +161,18 @@ &i2c7 {
>  	clock-frequency = <400000>;
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&i2c7_pin>;
> +
> +	pmic@34 {
> +		#interrupt-cells = <2>;

The binding says this should be 1.

Otherwise,

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

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

* Re: [PATCH 10/11] arm64: dts: mediatek: cherry: Enable support for the SPI NOR flash
  2022-06-30 15:33 ` [PATCH 10/11] arm64: dts: mediatek: cherry: Enable support for the SPI NOR flash AngeloGioacchino Del Regno
@ 2022-07-01 22:47   ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:47 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:15PM +0200, AngeloGioacchino Del Regno wrote:
> This platform has a SPI NOR: enable support for it, completing the
> storage compartment enablement for the entire platform.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Thanks,
Nícolas

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

* Re: [PATCH 11/11] arm64: dts: mediatek: cherry: Add I2C-HID touchscreen on I2C4
  2022-06-30 15:33 ` [PATCH 11/11] arm64: dts: mediatek: cherry: Add I2C-HID touchscreen on I2C4 AngeloGioacchino Del Regno
@ 2022-07-01 22:49   ` Nícolas F. R. A. Prado
  0 siblings, 0 replies; 31+ messages in thread
From: Nícolas F. R. A. Prado @ 2022-07-01 22:49 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

On Thu, Jun 30, 2022 at 05:33:16PM +0200, AngeloGioacchino Del Regno wrote:
> This platform carries a HID compatible I2C touchscreen on the i2c4 bus,
> but it may either be at 0x10, or at 0x15, depending on the board model:
> declare both as disabled in the common Cherry device-tree and enable
> the required touchscreen node on a per-board basis.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../dts/mediatek/mt8195-cherry-tomato-r1.dts  |  4 ++
>  .../dts/mediatek/mt8195-cherry-tomato-r2.dts  |  4 ++
>  .../dts/mediatek/mt8195-cherry-tomato-r3.dts  |  4 ++
>  .../boot/dts/mediatek/mt8195-cherry.dtsi      | 41 +++++++++++++++++++
>  4 files changed, 53 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 17e9e4d6f6ab..2837fb24c84c 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> @@ -9,3 +9,7 @@ / {
>  	model = "MediaTek Tomato (rev1) board";
>  	compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195";
>  };
> +
> +&ts_10 {
> +	status = "okay";
> +};
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
> index ee5fd07ad573..4e1d1a1887c7 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
> @@ -29,3 +29,7 @@ pins-low-power-pcie0-disable {
>  		bias-pull-down;
>  	};
>  };
> +
> +&ts_10 {
> +	status = "okay";
> +};
> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
> index 792f6c83e88b..4a45884203ea 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
> @@ -30,3 +30,7 @@ pins-low-power-pcie0-disable {
>  		bias-pull-down;
>  	};
>  };
> +
> +&ts_10 {
> +	status = "okay";
> +};

But no board currently uses the one on 0x15?

Thanks,
Nícolas

> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> index 2687c6d40ac1..7a32c7006a5a 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> @@ -143,6 +143,31 @@ &i2c4 {
>  	clock-frequency = <400000>;
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&i2c4_pin>;
> +
> +	/* Depending on the machine, the TS may be at 0x10 or at 0x15 */
> +	ts_10: touchscreen@10 {
> +		compatible = "hid-over-i2c";
> +		reg = <0x10>;
> +		hid-descr-addr = <0x0001>;
> +		interrupts-extended = <&pio 92 IRQ_TYPE_LEVEL_LOW>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&touchscreen_pins>;
> +		post-power-on-delay-ms = <10>;
> +		vdd-supply = <&pp3300_s3>;
> +		status = "disabled";
> +	};
> +
> +	ts_15: touchscreen@15 {
> +		compatible = "hid-over-i2c";
> +		reg = <0x15>;
> +		hid-descr-addr = <0x0001>;
> +		interrupts-extended = <&pio 92 IRQ_TYPE_LEVEL_LOW>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&touchscreen_pins>;
> +		post-power-on-delay-ms = <10>;
> +		vdd-supply = <&pp3300_s3>;
> +		status = "disabled";
> +	};
>  };
>  
>  &i2c5 {
> @@ -609,6 +634,22 @@ subpmic_pin_irq: pins-subpmic-int-n {
>  			bias-pull-up;
>  		};
>  	};
> +
> +	touchscreen_pins: touchscreen-default-pins {
> +		pins-int-n {
> +			pinmux = <PINMUX_GPIO92__FUNC_GPIO92>;
> +			input-enable;
> +			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
> +		};
> +		pins-rst {
> +			pinmux = <PINMUX_GPIO56__FUNC_GPIO56>;
> +			output-high;
> +		};
> +		pins-report-sw {
> +			pinmux = <PINMUX_GPIO57__FUNC_GPIO57>;
> +			output-low;
> +		};
> +	};
>  };
>  
>  &pmic {
> -- 
> 2.35.1
> 

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

* Re: [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato
  2022-07-01 22:11   ` Nícolas F. R. A. Prado
@ 2022-07-04  4:17     ` Chen-Yu Tsai
  2022-07-04  8:59       ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 31+ messages in thread
From: Chen-Yu Tsai @ 2022-07-04  4:17 UTC (permalink / raw)
  To: Nícolas F. R. A. Prado
  Cc: AngeloGioacchino Del Regno, robh+dt, krzysztof.kozlowski+dt,
	matthias.bgg, hsinyi, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek

On Sat, Jul 2, 2022 at 6:12 AM Nícolas F. R. A. Prado
<nfraprado@collabora.com> wrote:
>
> On Thu, Jun 30, 2022 at 05:33:07PM +0200, AngeloGioacchino Del Regno wrote:
> > Introduce the MT8195 Cherry Chromebook platform, including three
> > revisions of Cherry Tomato boards.
> >
> > This basic configuration allows to boot Linux on all board revisions
> > and get a serial console from a ramdisk.
> >
> > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > ---
> >  arch/arm64/boot/dts/mediatek/Makefile         |  3 +++
> >  .../dts/mediatek/mt8195-cherry-tomato-r1.dts  | 11 ++++++++
> >  .../dts/mediatek/mt8195-cherry-tomato-r2.dts  | 11 ++++++++
> >  .../dts/mediatek/mt8195-cherry-tomato-r3.dts  | 12 +++++++++
> >  .../boot/dts/mediatek/mt8195-cherry.dtsi      | 26 +++++++++++++++++++
> >  5 files changed, 63 insertions(+)
> >  create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> >  create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
> >  create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
> >  create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> [..]
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> > new file mode 100644
> > index 000000000000..17e9e4d6f6ab
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> > @@ -0,0 +1,11 @@
> > +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> > +/*
> > + * Copyright (C) 2021 MediaTek Inc.
> > + */
> > +/dts-v1/;
> > +#include "mt8195-cherry.dtsi"
> > +
> > +/ {
> > +     model = "MediaTek Tomato (rev1) board";
>
> Given that the compatible is "google," I believe we'll want to rename the model
> to "Google Tomato", much like was commented on the Asurada series [1], but
> better to have confirmation from someone from Google. Chen-Yu? :)

I asked for clarification internally and it turns out we didn't get the
Asurada series quite right either.

Google only owns the reference design, that is Asurada for MT8192 and
Cherry for MT8195. The vendor own the end product design that is based
off of Google's reference design.

So for Tomato, the vendor is Acer. Note that "Tomato" and the other
codenames seen in ChromeOS are public codenames that Google uses.

The compatible string will likely stay "google,XXX", since this is set
in firmware, and updating it after the product has shipped poses both
a significant hurdle and risk.


Regards
ChenYu

> Otherwise,
>
> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
>
> Thanks,
> Nícolas
>
> [1] https://lore.kernel.org/all/CAGXv+5Gv2pjPXynz6HCdgux+giPDC5qRk+KW1aFduVz82rM=+g@mail.gmail.com/
>
> > +     compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195";
> > +};
> [..]
> > --
> > 2.35.1
> >

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

* Re: [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks
  2022-07-01 15:31   ` Nícolas F. R. A. Prado
@ 2022-07-04  8:51     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-07-04  8:51 UTC (permalink / raw)
  To: Nícolas F. R. A. Prado
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

Il 01/07/22 17:31, Nícolas F. R. A. Prado ha scritto:
> On Thu, Jun 30, 2022 at 05:33:06PM +0200, AngeloGioacchino Del Regno wrote:
>> Document board compatibles for the MT8195 Cherry platform's
>> Tomato Chromebooks, at the time of writing composed of four
>> revisions (r0, r1, r2, r3-r4).
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>>   Documentation/devicetree/bindings/arm/mediatek.yaml | 13 +++++++++++++
>>   1 file changed, 13 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/mediatek.yaml b/Documentation/devicetree/bindings/arm/mediatek.yaml
>> index dd6c6e8011f9..3e0afa17ed2e 100644
>> --- a/Documentation/devicetree/bindings/arm/mediatek.yaml
>> +++ b/Documentation/devicetree/bindings/arm/mediatek.yaml
>> @@ -144,6 +144,19 @@ properties:
>>             - const: google,spherion-rev0
>>             - const: google,spherion
>>             - const: mediatek,mt8192
>> +      - description: Google Tomato (Acer Chromebook Spin 513)
> 
> Hi Angelo,
> 
> searching for "Acer Chromebook Spin 513" I found that there are two different
> chromebooks:
> 
> https://www.acer.com/ac/en/US/content/series/acerchromebookspin513
> https://www.acer.com/ac/en/GB/content/series/acerchromebookspin513cp5132h
> 
> The first one is a Qualcomm based one, while the second is mt8195-based, so I
> assume that's Tomato.
> 
> They can be telled apart by the model name though: the Qualcomm one is
> "CP513-1H", while Tomato is "CP513-2H". So I suggest to add the "CP513-2H" here
> in the description, as well as in the cover letter, to avoid confusion between
> the two.
> 

Hey Nicolas,
nice catch!

Even though it would be odd for someone to think that we refer to a Qualcomm
powered Chromebook while checking 'mediatek.yaml'... I agree with you, let's
specify the model clearly as 'CP513-2H': it fits, so why not!

I'll send a v2 soon.

Cheers!

> Thanks,
> Nícolas
> 

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

* Re: [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks
  2022-07-01 22:04   ` Nícolas F. R. A. Prado
@ 2022-07-04  8:56     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-07-04  8:56 UTC (permalink / raw)
  To: Nícolas F. R. A. Prado
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, wenst

Il 02/07/22 00:04, Nícolas F. R. A. Prado ha scritto:
> On Thu, Jun 30, 2022 at 05:33:06PM +0200, AngeloGioacchino Del Regno wrote:
>> Document board compatibles for the MT8195 Cherry platform's
>> Tomato Chromebooks, at the time of writing composed of four
>> revisions (r0, r1, r2, r3-r4).
> 
> Though r0 is not added in this series?
> 
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>>   Documentation/devicetree/bindings/arm/mediatek.yaml | 13 +++++++++++++
>>   1 file changed, 13 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/mediatek.yaml b/Documentation/devicetree/bindings/arm/mediatek.yaml
>> index dd6c6e8011f9..3e0afa17ed2e 100644
>> --- a/Documentation/devicetree/bindings/arm/mediatek.yaml
>> +++ b/Documentation/devicetree/bindings/arm/mediatek.yaml
>> @@ -144,6 +144,19 @@ properties:
>>             - const: google,spherion-rev0
>>             - const: google,spherion
>>             - const: mediatek,mt8192
> 
> Angelo, this patch is depending on the patch from the asurada-spherion series
> [1] to apply. Since this isn't the case for patch 2 as well, I assume this was
> a mistake. And it does seem better to keep them independent.

Yes, thanks for pointing that out - I forgot to advertise the dependency in the
cover letter.

Though, making this one independent from yours isn't really possible, as doing
that would ruin the ordering in mediatek.yaml.

I will advertise the dependency in v2.

Cheers,
Angelo

> 
> [1] https://lore.kernel.org/all/20220629155956.1138955-2-nfraprado@collabora.com/
> 
> Thanks,
> Nícolas
> 
>> +      - description: Google Tomato (Acer Chromebook Spin 513)
>> +        items:
>> +          - enum:
>> +              - google,tomato-rev2
>> +              - google,tomato-rev1
>> +          - const: google,tomato
>> +          - const: mediatek,mt8195
>> +      - description: Google Tomato (rev3 - 4)
>> +        items:
>> +          - const: google,tomato-rev4
>> +          - const: google,tomato-rev3
>> +          - const: google,tomato
>> +          - const: mediatek,mt8195
>>         - items:
>>             - enum:
>>                 - mediatek,mt8186-evb
>> -- 
>> 2.35.1
>>




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

* Re: [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato
  2022-07-04  4:17     ` Chen-Yu Tsai
@ 2022-07-04  8:59       ` AngeloGioacchino Del Regno
  2022-07-04  9:05         ` Chen-Yu Tsai
  0 siblings, 1 reply; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-07-04  8:59 UTC (permalink / raw)
  To: Chen-Yu Tsai, Nícolas F. R. A. Prado
  Cc: robh+dt, krzysztof.kozlowski+dt, matthias.bgg, hsinyi,
	allen-kh.cheng, gtk3, luca, sam.shih, sean.wang, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek

Il 04/07/22 06:17, Chen-Yu Tsai ha scritto:
> On Sat, Jul 2, 2022 at 6:12 AM Nícolas F. R. A. Prado
> <nfraprado@collabora.com> wrote:
>>
>> On Thu, Jun 30, 2022 at 05:33:07PM +0200, AngeloGioacchino Del Regno wrote:
>>> Introduce the MT8195 Cherry Chromebook platform, including three
>>> revisions of Cherry Tomato boards.
>>>
>>> This basic configuration allows to boot Linux on all board revisions
>>> and get a serial console from a ramdisk.
>>>
>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>> ---
>>>   arch/arm64/boot/dts/mediatek/Makefile         |  3 +++
>>>   .../dts/mediatek/mt8195-cherry-tomato-r1.dts  | 11 ++++++++
>>>   .../dts/mediatek/mt8195-cherry-tomato-r2.dts  | 11 ++++++++
>>>   .../dts/mediatek/mt8195-cherry-tomato-r3.dts  | 12 +++++++++
>>>   .../boot/dts/mediatek/mt8195-cherry.dtsi      | 26 +++++++++++++++++++
>>>   5 files changed, 63 insertions(+)
>>>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>>>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
>>>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
>>>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>> [..]
>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>>> new file mode 100644
>>> index 000000000000..17e9e4d6f6ab
>>> --- /dev/null
>>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>>> @@ -0,0 +1,11 @@
>>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
>>> +/*
>>> + * Copyright (C) 2021 MediaTek Inc.
>>> + */
>>> +/dts-v1/;
>>> +#include "mt8195-cherry.dtsi"
>>> +
>>> +/ {
>>> +     model = "MediaTek Tomato (rev1) board";
>>
>> Given that the compatible is "google," I believe we'll want to rename the model
>> to "Google Tomato", much like was commented on the Asurada series [1], but
>> better to have confirmation from someone from Google. Chen-Yu? :)
> 
> I asked for clarification internally and it turns out we didn't get the
> Asurada series quite right either.
> 
> Google only owns the reference design, that is Asurada for MT8192 and
> Cherry for MT8195. The vendor own the end product design that is based
> off of Google's reference design.
> 
> So for Tomato, the vendor is Acer. Note that "Tomato" and the other
> codenames seen in ChromeOS are public codenames that Google uses.
> 
> The compatible string will likely stay "google,XXX", since this is set
> in firmware, and updating it after the product has shipped poses both
> a significant hurdle and risk.
> 

Yeah, makes sense. Should we call this "Acer Tomato (revX) board" then?
...if we do that, though, we need to know if the other revisions of Tomato
are also from Acer, or we would be getting one right and all the others wrong.

Cheers,
Angelo

> 
> Regards
> ChenYu
> 
>> Otherwise,
>>
>> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
>>
>> Thanks,
>> Nícolas
>>
>> [1] https://lore.kernel.org/all/CAGXv+5Gv2pjPXynz6HCdgux+giPDC5qRk+KW1aFduVz82rM=+g@mail.gmail.com/
>>
>>> +     compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195";
>>> +};
>> [..]
>>> --
>>> 2.35.1
>>>


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

* Re: [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato
  2022-07-04  8:59       ` AngeloGioacchino Del Regno
@ 2022-07-04  9:05         ` Chen-Yu Tsai
  2022-07-04  9:06           ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 31+ messages in thread
From: Chen-Yu Tsai @ 2022-07-04  9:05 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Nícolas F. R. A. Prado, robh+dt, krzysztof.kozlowski+dt,
	matthias.bgg, hsinyi, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek

On Mon, Jul 4, 2022 at 4:59 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 04/07/22 06:17, Chen-Yu Tsai ha scritto:
> > On Sat, Jul 2, 2022 at 6:12 AM Nícolas F. R. A. Prado
> > <nfraprado@collabora.com> wrote:
> >>
> >> On Thu, Jun 30, 2022 at 05:33:07PM +0200, AngeloGioacchino Del Regno wrote:
> >>> Introduce the MT8195 Cherry Chromebook platform, including three
> >>> revisions of Cherry Tomato boards.
> >>>
> >>> This basic configuration allows to boot Linux on all board revisions
> >>> and get a serial console from a ramdisk.
> >>>
> >>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> >>> ---
> >>>   arch/arm64/boot/dts/mediatek/Makefile         |  3 +++
> >>>   .../dts/mediatek/mt8195-cherry-tomato-r1.dts  | 11 ++++++++
> >>>   .../dts/mediatek/mt8195-cherry-tomato-r2.dts  | 11 ++++++++
> >>>   .../dts/mediatek/mt8195-cherry-tomato-r3.dts  | 12 +++++++++
> >>>   .../boot/dts/mediatek/mt8195-cherry.dtsi      | 26 +++++++++++++++++++
> >>>   5 files changed, 63 insertions(+)
> >>>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> >>>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
> >>>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
> >>>   create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
> >> [..]
> >>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> >>> new file mode 100644
> >>> index 000000000000..17e9e4d6f6ab
> >>> --- /dev/null
> >>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
> >>> @@ -0,0 +1,11 @@
> >>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> >>> +/*
> >>> + * Copyright (C) 2021 MediaTek Inc.
> >>> + */
> >>> +/dts-v1/;
> >>> +#include "mt8195-cherry.dtsi"
> >>> +
> >>> +/ {
> >>> +     model = "MediaTek Tomato (rev1) board";
> >>
> >> Given that the compatible is "google," I believe we'll want to rename the model
> >> to "Google Tomato", much like was commented on the Asurada series [1], but
> >> better to have confirmation from someone from Google. Chen-Yu? :)
> >
> > I asked for clarification internally and it turns out we didn't get the
> > Asurada series quite right either.
> >
> > Google only owns the reference design, that is Asurada for MT8192 and
> > Cherry for MT8195. The vendor own the end product design that is based
> > off of Google's reference design.
> >
> > So for Tomato, the vendor is Acer. Note that "Tomato" and the other
> > codenames seen in ChromeOS are public codenames that Google uses.
> >
> > The compatible string will likely stay "google,XXX", since this is set
> > in firmware, and updating it after the product has shipped poses both
> > a significant hurdle and risk.
> >
>
> Yeah, makes sense. Should we call this "Acer Tomato (revX) board" then?
> ...if we do that, though, we need to know if the other revisions of Tomato
> are also from Acer, or we would be getting one right and all the others wrong.

AFAIK each "device build" is its own project and gets its own codename,
otherwise it would get real confusing for us internally really fast.

ChenYu

> Cheers,
> Angelo
>
> >
> > Regards
> > ChenYu
> >
> >> Otherwise,
> >>
> >> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
> >>
> >> Thanks,
> >> Nícolas
> >>
> >> [1] https://lore.kernel.org/all/CAGXv+5Gv2pjPXynz6HCdgux+giPDC5qRk+KW1aFduVz82rM=+g@mail.gmail.com/
> >>
> >>> +     compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195";
> >>> +};
> >> [..]
> >>> --
> >>> 2.35.1
> >>>
>

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

* Re: [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato
  2022-07-04  9:05         ` Chen-Yu Tsai
@ 2022-07-04  9:06           ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 31+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-07-04  9:06 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Nícolas F. R. A. Prado, robh+dt, krzysztof.kozlowski+dt,
	matthias.bgg, hsinyi, allen-kh.cheng, gtk3, luca, sam.shih,
	sean.wang, devicetree, linux-kernel, linux-arm-kernel,
	linux-mediatek

Il 04/07/22 11:05, Chen-Yu Tsai ha scritto:
> On Mon, Jul 4, 2022 at 4:59 PM AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com> wrote:
>>
>> Il 04/07/22 06:17, Chen-Yu Tsai ha scritto:
>>> On Sat, Jul 2, 2022 at 6:12 AM Nícolas F. R. A. Prado
>>> <nfraprado@collabora.com> wrote:
>>>>
>>>> On Thu, Jun 30, 2022 at 05:33:07PM +0200, AngeloGioacchino Del Regno wrote:
>>>>> Introduce the MT8195 Cherry Chromebook platform, including three
>>>>> revisions of Cherry Tomato boards.
>>>>>
>>>>> This basic configuration allows to boot Linux on all board revisions
>>>>> and get a serial console from a ramdisk.
>>>>>
>>>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>>>> ---
>>>>>    arch/arm64/boot/dts/mediatek/Makefile         |  3 +++
>>>>>    .../dts/mediatek/mt8195-cherry-tomato-r1.dts  | 11 ++++++++
>>>>>    .../dts/mediatek/mt8195-cherry-tomato-r2.dts  | 11 ++++++++
>>>>>    .../dts/mediatek/mt8195-cherry-tomato-r3.dts  | 12 +++++++++
>>>>>    .../boot/dts/mediatek/mt8195-cherry.dtsi      | 26 +++++++++++++++++++
>>>>>    5 files changed, 63 insertions(+)
>>>>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>>>>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
>>>>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
>>>>>    create mode 100644 arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
>>>> [..]
>>>>> diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>>>>> new file mode 100644
>>>>> index 000000000000..17e9e4d6f6ab
>>>>> --- /dev/null
>>>>> +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
>>>>> @@ -0,0 +1,11 @@
>>>>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
>>>>> +/*
>>>>> + * Copyright (C) 2021 MediaTek Inc.
>>>>> + */
>>>>> +/dts-v1/;
>>>>> +#include "mt8195-cherry.dtsi"
>>>>> +
>>>>> +/ {
>>>>> +     model = "MediaTek Tomato (rev1) board";
>>>>
>>>> Given that the compatible is "google," I believe we'll want to rename the model
>>>> to "Google Tomato", much like was commented on the Asurada series [1], but
>>>> better to have confirmation from someone from Google. Chen-Yu? :)
>>>
>>> I asked for clarification internally and it turns out we didn't get the
>>> Asurada series quite right either.
>>>
>>> Google only owns the reference design, that is Asurada for MT8192 and
>>> Cherry for MT8195. The vendor own the end product design that is based
>>> off of Google's reference design.
>>>
>>> So for Tomato, the vendor is Acer. Note that "Tomato" and the other
>>> codenames seen in ChromeOS are public codenames that Google uses.
>>>
>>> The compatible string will likely stay "google,XXX", since this is set
>>> in firmware, and updating it after the product has shipped poses both
>>> a significant hurdle and risk.
>>>
>>
>> Yeah, makes sense. Should we call this "Acer Tomato (revX) board" then?
>> ...if we do that, though, we need to know if the other revisions of Tomato
>> are also from Acer, or we would be getting one right and all the others wrong.
> 
> AFAIK each "device build" is its own project and gets its own codename,
> otherwise it would get real confusing for us internally really fast.

All clear.

Thanks,
Angelo

> 
> ChenYu
> 
>> Cheers,
>> Angelo
>>
>>>
>>> Regards
>>> ChenYu
>>>
>>>> Otherwise,
>>>>
>>>> Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
>>>>
>>>> Thanks,
>>>> Nícolas
>>>>
>>>> [1] https://lore.kernel.org/all/CAGXv+5Gv2pjPXynz6HCdgux+giPDC5qRk+KW1aFduVz82rM=+g@mail.gmail.com/
>>>>
>>>>> +     compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195";
>>>>> +};
>>>> [..]
>>>>> --
>>>>> 2.35.1
>>>>>
>>


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

end of thread, other threads:[~2022-07-04  9:06 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
2022-06-30 15:33 ` [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks AngeloGioacchino Del Regno
2022-06-30 18:26   ` Krzysztof Kozlowski
2022-07-01 15:31   ` Nícolas F. R. A. Prado
2022-07-04  8:51     ` AngeloGioacchino Del Regno
2022-07-01 22:04   ` Nícolas F. R. A. Prado
2022-07-04  8:56     ` AngeloGioacchino Del Regno
2022-06-30 15:33 ` [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato AngeloGioacchino Del Regno
2022-07-01 22:11   ` Nícolas F. R. A. Prado
2022-07-04  4:17     ` Chen-Yu Tsai
2022-07-04  8:59       ` AngeloGioacchino Del Regno
2022-07-04  9:05         ` Chen-Yu Tsai
2022-07-04  9:06           ` AngeloGioacchino Del Regno
2022-06-30 15:33 ` [PATCH 03/11] arm64: dts: mediatek: cherry: Assign interrupt line to MT6359 PMIC AngeloGioacchino Del Regno
2022-07-01 22:20   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 04/11] arm64: dts: mediatek: cherry: Add platform regulators layout and config AngeloGioacchino Del Regno
2022-07-01 22:26   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 05/11] arm64: dts: mediatek: cherry: Add support for internal eMMC storage AngeloGioacchino Del Regno
2022-07-01 22:36   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 06/11] arm64: dts: mediatek: cherry: Document gpios and add default pin config AngeloGioacchino Del Regno
2022-07-01 22:39   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 07/11] arm64: dts: mediatek: cherry: Enable I2C and SPI controllers AngeloGioacchino Del Regno
2022-07-01 22:42   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 08/11] arm64: dts: mediatek: cherry: Enable T-PHYs and USB XHCI controllers AngeloGioacchino Del Regno
2022-07-01 22:43   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 09/11] arm64: dts: mediatek: cherry: Enable MT6360 sub-pmic on I2C7 AngeloGioacchino Del Regno
2022-07-01 22:45   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 10/11] arm64: dts: mediatek: cherry: Enable support for the SPI NOR flash AngeloGioacchino Del Regno
2022-07-01 22:47   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 11/11] arm64: dts: mediatek: cherry: Add I2C-HID touchscreen on I2C4 AngeloGioacchino Del Regno
2022-07-01 22:49   ` Nícolas F. R. A. Prado

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).