2023-04-07 13:00:43

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 00/12] Improve the MT8365 SoC and EVK board support

This commits are based on the Fabien Parent <[email protected]> work.

The purpose of this series is to add the following HWs / IPs support for
the mt8365-evk board:
- Watchdog
- Power Management Integrated Circuit "PMIC" wrapper
- MT6357 PMIC
- MultiMediaCard "MMC" & Secure Digital "SD" controller
- USB controller
- Ethernet MAC controller

Add CPU Freq & IDLE support for this board.

This series depends to anothers which add support for MT8365 EVK board
[1], add the MT8365 I2C support [2] (both are currently applied) and
finally the pinctrl binding cleanup [3].

=== Build:

To test this serie, cherry-pick patches from the dependent series ([1],[2],[3])
and the applied patches from this serie (documented in the "Changes" below).
Be carefull, the pinctrl serie [3] is rebased to linusw/linux-pinctrl,
cherry-pick will not be straightforward.
Finally, cherry-pick this serie.

You can also take my branch [4] which have all the needed patches
retrieved from the instructions above.

Use the arm64 defconfig to make the build.

Regards,
Alex

[1]: https://lore.kernel.org/all/[email protected]/
[2]: https://lore.kernel.org/all/[email protected]/
[3]: https://lore.kernel.org/all/[email protected]/
[4]: https://gitlab.baylibre.com/baylibre/mediatek/bsp/linux/-/commits/amergnat/i350-evk-board-support

Signed-off-by: Alexandre Mergnat <[email protected]>
---
Changes in v5:
- Add patches to build the MT6357 regulator driver and MTK PMIC keys by default
- Remove "dt-bindings: pinctrl: mediatek,mt8365-pinctrl: add drive strength property"
patch from this serie and add it to the pinctrl serie [3]
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Remove v3 applied patch from the serie:
- arm64: dts: mediatek: add ethernet support for mt8365 SoC
- arm64: dts: mediatek: add mmc support for mt8365 SoC
- arm64: dts: mediatek: add mt6357 device-tree
- arm64: dts: mediatek: add pwrap support to mt8365 SoC
- arm64: dts: mediatek: Increase the size BL31 reserved memory
- Drop "arm64: dts: mediatek: fix systimer properties" which is done [1]
- Fix style, typo and re-order properties.
- Use interrupts-extended for the PMIC node.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Remove v2 applied patch from the serie:
- dt-bindings: mmc: mediatek,mtk-sd: add mt8365
- Add trailers and simply resend.
- Link to v2: https://lore.kernel.org/r/[email protected]

---
Alexandre Mergnat (10):
arm64: defconfig: enable MT6357 regulator
arm64: defconfig: enable Mediatek PMIC key
dt-bindings: watchdog: mediatek,mtk-wdt: add mt8365
arm64: dts: mediatek: add watchdog support for mt8365 SoC
arm64: dts: mediatek: add mt6357 PMIC support for mt8365-evk
arm64: dts: mediatek: add mmc support for mt8365-evk
arm64: dts: mediatek: add usb controller support for mt8365-evk
arm64: dts: mediatek: add ethernet support for mt8365-evk
arm64: dts: mediatek: add OPP support for mt8365 SoC
arm64: dts: mediatek: add cpufreq support for mt8365-evk

Amjad Ouled-Ameur (1):
arm64: dts: mediatek: Add CPU Idle support

Fabien Parent (1):
arm64: dts: mediatek: set vmc regulator as always on

.../bindings/watchdog/mediatek,mtk-wdt.yaml | 1 +
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 249 +++++++++++++++++++++
arch/arm64/boot/dts/mediatek/mt8365.dtsi | 142 ++++++++++++
arch/arm64/configs/defconfig | 3 +
4 files changed, 395 insertions(+)
---
base-commit: 4f2a499a344b36ebb325e610265452ea88541116
change-id: 20230203-evk-board-support-d5b7a839ed7b

Best regards,
--
Alexandre Mergnat <[email protected]>


2023-04-07 13:00:53

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 01/12] arm64: defconfig: enable MT6357 regulator

Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/configs/defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 7790ee42c68a..e4cb65889ae6 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -685,6 +685,7 @@ CONFIG_REGULATOR_MAX77620=y
CONFIG_REGULATOR_MAX8973=y
CONFIG_REGULATOR_MP8859=y
CONFIG_REGULATOR_MT6315=m
+CONFIG_REGULATOR_MT6357=y
CONFIG_REGULATOR_MT6358=y
CONFIG_REGULATOR_MT6359=y
CONFIG_REGULATOR_MT6360=y

--
2.25.1

2023-04-07 13:01:42

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 04/12] arm64: dts: mediatek: add watchdog support for mt8365 SoC

Add watchdog support.

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8365.dtsi | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index 1f6b48359115..bb45aab2e6a9 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -162,6 +162,12 @@ syscfg_pctl: syscfg-pctl@10005000 {
reg = <0 0x10005000 0 0x1000>;
};

+ watchdog: watchdog@10007000 {
+ compatible = "mediatek,mt8365-wdt", "mediatek,mt6589-wdt";
+ reg = <0 0x10007000 0 0x100>;
+ #reset-cells = <1>;
+ };
+
pio: pinctrl@1000b000 {
compatible = "mediatek,mt8365-pinctrl";
reg = <0 0x1000b000 0 0x1000>;

--
2.25.1

2023-04-07 13:01:43

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 03/12] dt-bindings: watchdog: mediatek,mtk-wdt: add mt8365

Add binding description for mediatek,mt8365-wdt

Acked-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Matthias Brugger <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Alexandre Mergnat <[email protected]>
---
Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
index 55b34461df1b..66cacea8e47f 100644
--- a/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
+++ b/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
@@ -38,6 +38,7 @@ properties:
- mediatek,mt7623-wdt
- mediatek,mt7629-wdt
- mediatek,mt8173-wdt
+ - mediatek,mt8365-wdt
- mediatek,mt8516-wdt
- const: mediatek,mt6589-wdt


--
2.25.1

2023-04-07 13:01:44

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 05/12] arm64: dts: mediatek: add mt6357 PMIC support for mt8365-evk

This power management system chip integration helps to manage regulators
and keys.

Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index dd7da86420cf..a238bd0092d2 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
@@ -12,6 +12,7 @@
#include <dt-bindings/input/input.h>
#include <dt-bindings/pinctrl/mt8365-pinfunc.h>
#include "mt8365.dtsi"
+#include "mt6357.dtsi"

/ {
model = "MediaTek MT8365 Open Platform EVK";
@@ -94,6 +95,12 @@ &i2c0 {
status = "okay";
};

+&mt6357_pmic {
+ interrupts-extended = <&pio 145 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+};
+
&pio {
gpio_keys: gpio-keys-pins {
pins {

--
2.25.1

2023-04-07 13:01:51

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 06/12] arm64: dts: mediatek: add mmc support for mt8365-evk

- Add EMMC support on mmc0 (internal memory)
- Add SD-UHS support on mmc1 (external memory)

Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 138 ++++++++++++++++++++++++++++
1 file changed, 138 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index a238bd0092d2..cd920d09c3fe 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
@@ -95,6 +95,42 @@ &i2c0 {
status = "okay";
};

+&mmc0 {
+ assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL>;
+ assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>;
+ bus-width = <8>;
+ cap-mmc-highspeed;
+ cap-mmc-hw-reset;
+ hs400-ds-delay = <0x12012>;
+ max-frequency = <200000000>;
+ mmc-hs200-1_8v;
+ mmc-hs400-1_8v;
+ no-sd;
+ no-sdio;
+ non-removable;
+ pinctrl-0 = <&mmc0_default_pins>;
+ pinctrl-1 = <&mmc0_uhs_pins>;
+ pinctrl-names = "default", "state_uhs";
+ vmmc-supply = <&mt6357_vemc_reg>;
+ vqmmc-supply = <&mt6357_vio18_reg>;
+ status = "okay";
+};
+
+&mmc1 {
+ bus-width = <4>;
+ cap-sd-highspeed;
+ cd-gpios = <&pio 76 GPIO_ACTIVE_LOW>;
+ max-frequency = <200000000>;
+ pinctrl-0 = <&mmc1_default_pins>;
+ pinctrl-1 = <&mmc1_uhs_pins>;
+ pinctrl-names = "default", "state_uhs";
+ sd-uhs-sdr104;
+ sd-uhs-sdr50;
+ vmmc-supply = <&mt6357_vmch_reg>;
+ vqmmc-supply = <&mt6357_vio18_reg>;
+ status = "okay";
+};
+
&mt6357_pmic {
interrupts-extended = <&pio 145 IRQ_TYPE_LEVEL_HIGH>;
interrupt-controller;
@@ -118,6 +154,108 @@ pins {
};
};

+ mmc0_default_pins: mmc0-default-pins {
+ clk-pins {
+ pinmux = <MT8365_PIN_99_MSDC0_CLK__FUNC_MSDC0_CLK>;
+ bias-pull-down;
+ };
+
+ cmd-dat-pins {
+ pinmux = <MT8365_PIN_103_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
+ <MT8365_PIN_102_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
+ <MT8365_PIN_101_MSDC0_DAT2__FUNC_MSDC0_DAT2>,
+ <MT8365_PIN_100_MSDC0_DAT3__FUNC_MSDC0_DAT3>,
+ <MT8365_PIN_96_MSDC0_DAT4__FUNC_MSDC0_DAT4>,
+ <MT8365_PIN_95_MSDC0_DAT5__FUNC_MSDC0_DAT5>,
+ <MT8365_PIN_94_MSDC0_DAT6__FUNC_MSDC0_DAT6>,
+ <MT8365_PIN_93_MSDC0_DAT7__FUNC_MSDC0_DAT7>,
+ <MT8365_PIN_98_MSDC0_CMD__FUNC_MSDC0_CMD>;
+ input-enable;
+ bias-pull-up;
+ };
+
+ rst-pins {
+ pinmux = <MT8365_PIN_97_MSDC0_RSTB__FUNC_MSDC0_RSTB>;
+ bias-pull-up;
+ };
+ };
+
+ mmc0_uhs_pins: mmc0-uhs-pins {
+ clk-pins {
+ pinmux = <MT8365_PIN_99_MSDC0_CLK__FUNC_MSDC0_CLK>;
+ drive-strength = <MTK_DRIVE_10mA>;
+ bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+ };
+
+ cmd-dat-pins {
+ pinmux = <MT8365_PIN_103_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
+ <MT8365_PIN_102_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
+ <MT8365_PIN_101_MSDC0_DAT2__FUNC_MSDC0_DAT2>,
+ <MT8365_PIN_100_MSDC0_DAT3__FUNC_MSDC0_DAT3>,
+ <MT8365_PIN_96_MSDC0_DAT4__FUNC_MSDC0_DAT4>,
+ <MT8365_PIN_95_MSDC0_DAT5__FUNC_MSDC0_DAT5>,
+ <MT8365_PIN_94_MSDC0_DAT6__FUNC_MSDC0_DAT6>,
+ <MT8365_PIN_93_MSDC0_DAT7__FUNC_MSDC0_DAT7>,
+ <MT8365_PIN_98_MSDC0_CMD__FUNC_MSDC0_CMD>;
+ input-enable;
+ drive-strength = <MTK_DRIVE_10mA>;
+ bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+ };
+
+ ds-pins {
+ pinmux = <MT8365_PIN_104_MSDC0_DSL__FUNC_MSDC0_DSL>;
+ drive-strength = <MTK_DRIVE_10mA>;
+ bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+ };
+
+ rst-pins {
+ pinmux = <MT8365_PIN_97_MSDC0_RSTB__FUNC_MSDC0_RSTB>;
+ drive-strength = <MTK_DRIVE_10mA>;
+ bias-pull-up;
+ };
+ };
+
+ mmc1_default_pins: mmc1-default-pins {
+ cd-pins {
+ pinmux = <MT8365_PIN_76_CMDAT8__FUNC_GPIO76>;
+ bias-pull-up;
+ };
+
+ clk-pins {
+ pinmux = <MT8365_PIN_88_MSDC1_CLK__FUNC_MSDC1_CLK>;
+ bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+ };
+
+ cmd-dat-pins {
+ pinmux = <MT8365_PIN_89_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
+ <MT8365_PIN_90_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
+ <MT8365_PIN_91_MSDC1_DAT2__FUNC_MSDC1_DAT2>,
+ <MT8365_PIN_92_MSDC1_DAT3__FUNC_MSDC1_DAT3>,
+ <MT8365_PIN_87_MSDC1_CMD__FUNC_MSDC1_CMD>;
+ input-enable;
+ bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+ };
+ };
+
+ mmc1_uhs_pins: mmc1-uhs-pins {
+ clk-pins {
+ pinmux = <MT8365_PIN_88_MSDC1_CLK__FUNC_MSDC1_CLK>;
+ drive-strength = <MTK_DRIVE_8mA>;
+ bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+ };
+
+ cmd-dat-pins {
+ pinmux = <MT8365_PIN_89_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
+ <MT8365_PIN_90_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
+ <MT8365_PIN_91_MSDC1_DAT2__FUNC_MSDC1_DAT2>,
+ <MT8365_PIN_92_MSDC1_DAT3__FUNC_MSDC1_DAT3>,
+ <MT8365_PIN_87_MSDC1_CMD__FUNC_MSDC1_CMD>;
+ input-enable;
+ drive-strength = <MTK_DRIVE_6mA>;
+ bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+ };
+ };
+
uart0_pins: uart0-pins {
pins {
pinmux = <MT8365_PIN_35_URXD0__FUNC_URXD0>,

--
2.25.1

2023-04-07 13:01:52

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 02/12] arm64: defconfig: enable Mediatek PMIC key

Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/configs/defconfig | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index e4cb65889ae6..91fad635e565 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -406,9 +406,11 @@ CONFIG_MHI_WWAN_MBIM=m
CONFIG_INPUT_EVDEV=y
CONFIG_KEYBOARD_ADC=m
CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_GPIO_POLLED=m
CONFIG_KEYBOARD_SNVS_PWRKEY=m
CONFIG_KEYBOARD_IMX_SC_KEY=m
CONFIG_KEYBOARD_CROS_EC=y
+CONFIG_KEYBOARD_MTK_PMIC=m
CONFIG_MOUSE_ELAN_I2C=m
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ATMEL_MXT=m

--
2.25.1

2023-04-07 13:02:12

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 07/12] arm64: dts: mediatek: set vmc regulator as always on

From: Fabien Parent <[email protected]>

MSDC1 IP block is powered by VMC. Make sure it is always on.

Signed-off-by: Fabien Parent <[email protected]>
Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index cd920d09c3fe..1c36d8f19525 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
@@ -137,6 +137,11 @@ &mt6357_pmic {
#interrupt-cells = <2>;
};

+/* Needed by MSDC1 */
+&mt6357_vmc_reg {
+ regulator-always-on;
+};
+
&pio {
gpio_keys: gpio-keys-pins {
pins {

--
2.25.1

2023-04-07 13:02:17

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 09/12] arm64: dts: mediatek: add ethernet support for mt8365-evk

- Enable "vibr" and "vsim2" regulators to power the ethernet chip.

Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 57 +++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index 9760f181eb34..431078f8670e 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
@@ -88,6 +88,28 @@ optee_reserved: optee@43200000 {
};
};

+&ethernet {
+ pinctrl-0 = <&ethernet_pins>;
+ pinctrl-names = "default";
+ phy-handle = <&eth_phy>;
+ phy-mode = "rmii";
+ /*
+ * Ethernet and HDMI (DSI0) are sharing pins.
+ * Only one can be enabled at a time and require the physical switch
+ * SW2101 to be set on LAN position
+ */
+ status = "disabled";
+
+ mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ eth_phy: ethernet-phy@0 {
+ reg = <0>;
+ };
+ };
+};
+
&i2c0 {
clock-frequency = <100000>;
pinctrl-0 = <&i2c0_pins>;
@@ -137,12 +159,47 @@ &mt6357_pmic {
#interrupt-cells = <2>;
};

+/* Needed by analog switch (multiplexer), HDMI and ethernet */
+&mt6357_vibr_reg {
+ regulator-always-on;
+};
+
/* Needed by MSDC1 */
&mt6357_vmc_reg {
regulator-always-on;
};

+/* Needed by ethernet */
+&mt6357_vsim2_reg {
+ regulator-always-on;
+};
+
&pio {
+ ethernet_pins: ethernet-pins {
+ phy_reset_pins {
+ pinmux = <MT8365_PIN_133_TDM_TX_DATA1__FUNC_GPIO133>;
+ };
+
+ rmii_pins {
+ pinmux = <MT8365_PIN_0_GPIO0__FUNC_EXT_TXD0>,
+ <MT8365_PIN_1_GPIO1__FUNC_EXT_TXD1>,
+ <MT8365_PIN_2_GPIO2__FUNC_EXT_TXD2>,
+ <MT8365_PIN_3_GPIO3__FUNC_EXT_TXD3>,
+ <MT8365_PIN_4_GPIO4__FUNC_EXT_TXC>,
+ <MT8365_PIN_5_GPIO5__FUNC_EXT_RXER>,
+ <MT8365_PIN_6_GPIO6__FUNC_EXT_RXC>,
+ <MT8365_PIN_7_GPIO7__FUNC_EXT_RXDV>,
+ <MT8365_PIN_8_GPIO8__FUNC_EXT_RXD0>,
+ <MT8365_PIN_9_GPIO9__FUNC_EXT_RXD1>,
+ <MT8365_PIN_10_GPIO10__FUNC_EXT_RXD2>,
+ <MT8365_PIN_11_GPIO11__FUNC_EXT_RXD3>,
+ <MT8365_PIN_12_GPIO12__FUNC_EXT_TXEN>,
+ <MT8365_PIN_13_GPIO13__FUNC_EXT_COL>,
+ <MT8365_PIN_14_GPIO14__FUNC_EXT_MDIO>,
+ <MT8365_PIN_15_GPIO15__FUNC_EXT_MDC>;
+ };
+ };
+
gpio_keys: gpio-keys-pins {
pins {
pinmux = <MT8365_PIN_24_KPCOL0__FUNC_KPCOL0>;

--
2.25.1

2023-04-07 13:02:24

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 11/12] arm64: dts: mediatek: add cpufreq support for mt8365-evk

In order to have cpufreq support, this patch adds proc-supply and
sram-supply for each CPU.

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index 431078f8670e..d723838ed49b 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
@@ -88,6 +88,26 @@ optee_reserved: optee@43200000 {
};
};

+&cpu0 {
+ proc-supply = <&mt6357_vproc_reg>;
+ sram-supply = <&mt6357_vsram_proc_reg>;
+};
+
+&cpu1 {
+ proc-supply = <&mt6357_vproc_reg>;
+ sram-supply = <&mt6357_vsram_proc_reg>;
+};
+
+&cpu2 {
+ proc-supply = <&mt6357_vproc_reg>;
+ sram-supply = <&mt6357_vsram_proc_reg>;
+};
+
+&cpu3 {
+ proc-supply = <&mt6357_vproc_reg>;
+ sram-supply = <&mt6357_vsram_proc_reg>;
+};
+
&ethernet {
pinctrl-0 = <&ethernet_pins>;
pinctrl-names = "default";

--
2.25.1

2023-04-07 13:02:31

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 10/12] arm64: dts: mediatek: add OPP support for mt8365 SoC

In order to have cpufreq support, this patch adds generic Operating
Performance Points support.

Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8365.dtsi | 101 +++++++++++++++++++++++++++++++
1 file changed, 101 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index bb45aab2e6a9..cfe0c67ad61f 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -20,6 +20,91 @@ cpus {
#address-cells = <1>;
#size-cells = <0>;

+ cluster0_opp: opp-table-0 {
+ compatible = "operating-points-v2";
+ opp-shared;
+
+ opp-850000000 {
+ opp-hz = /bits/ 64 <850000000>;
+ opp-microvolt = <650000>;
+ };
+
+ opp-918000000 {
+ opp-hz = /bits/ 64 <918000000>;
+ opp-microvolt = <668750>;
+ };
+
+ opp-987000000 {
+ opp-hz = /bits/ 64 <987000000>;
+ opp-microvolt = <687500>;
+ };
+
+ opp-1056000000 {
+ opp-hz = /bits/ 64 <1056000000>;
+ opp-microvolt = <706250>;
+ };
+
+ opp-1125000000 {
+ opp-hz = /bits/ 64 <1125000000>;
+ opp-microvolt = <725000>;
+ };
+
+ opp-1216000000 {
+ opp-hz = /bits/ 64 <1216000000>;
+ opp-microvolt = <750000>;
+ };
+
+ opp-1308000000 {
+ opp-hz = /bits/ 64 <1308000000>;
+ opp-microvolt = <775000>;
+ };
+
+ opp-1400000000 {
+ opp-hz = /bits/ 64 <1400000000>;
+ opp-microvolt = <800000>;
+ };
+
+ opp-1466000000 {
+ opp-hz = /bits/ 64 <1466000000>;
+ opp-microvolt = <825000>;
+ };
+
+ opp-1533000000 {
+ opp-hz = /bits/ 64 <1533000000>;
+ opp-microvolt = <850000>;
+ };
+
+ opp-1633000000 {
+ opp-hz = /bits/ 64 <1633000000>;
+ opp-microvolt = <887500>;
+ };
+
+ opp-1700000000 {
+ opp-hz = /bits/ 64 <1700000000>;
+ opp-microvolt = <912500>;
+ };
+
+ opp-1767000000 {
+ opp-hz = /bits/ 64 <1767000000>;
+ opp-microvolt = <937500>;
+ };
+
+ opp-1834000000 {
+ opp-hz = /bits/ 64 <1834000000>;
+ opp-microvolt = <962500>;
+ };
+
+ opp-1917000000 {
+ opp-hz = /bits/ 64 <1917000000>;
+ opp-microvolt = <993750>;
+ };
+
+ opp-2001000000 {
+ opp-hz = /bits/ 64 <2001000000>;
+ opp-microvolt = <1025000>;
+ };
+ };
+
cpu-map {
cluster0 {
core0 {
@@ -50,6 +135,10 @@ cpu0: cpu@0 {
d-cache-line-size = <64>;
d-cache-sets = <256>;
next-level-cache = <&l2>;
+ clocks = <&mcucfg CLK_MCU_BUS_SEL>,
+ <&apmixedsys CLK_APMIXED_MAINPLL>;
+ clock-names = "cpu", "intermediate";
+ operating-points-v2 = <&cluster0_opp>;
};

cpu1: cpu@1 {
@@ -65,6 +154,10 @@ cpu1: cpu@1 {
d-cache-line-size = <64>;
d-cache-sets = <256>;
next-level-cache = <&l2>;
+ clocks = <&mcucfg CLK_MCU_BUS_SEL>,
+ <&apmixedsys CLK_APMIXED_MAINPLL>;
+ clock-names = "cpu", "intermediate", "armpll";
+ operating-points-v2 = <&cluster0_opp>;
};

cpu2: cpu@2 {
@@ -80,6 +173,10 @@ cpu2: cpu@2 {
d-cache-line-size = <64>;
d-cache-sets = <256>;
next-level-cache = <&l2>;
+ clocks = <&mcucfg CLK_MCU_BUS_SEL>,
+ <&apmixedsys CLK_APMIXED_MAINPLL>;
+ clock-names = "cpu", "intermediate", "armpll";
+ operating-points-v2 = <&cluster0_opp>;
};

cpu3: cpu@3 {
@@ -95,6 +192,10 @@ cpu3: cpu@3 {
d-cache-line-size = <64>;
d-cache-sets = <256>;
next-level-cache = <&l2>;
+ clocks = <&mcucfg CLK_MCU_BUS_SEL>,
+ <&apmixedsys CLK_APMIXED_MAINPLL>;
+ clock-names = "cpu", "intermediate", "armpll";
+ operating-points-v2 = <&cluster0_opp>;
};

l2: l2-cache {

--
2.25.1

2023-04-07 13:02:44

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 12/12] arm64: dts: mediatek: Add CPU Idle support

From: Amjad Ouled-Ameur <[email protected]>

MT8365 has 3 CPU Idle states:
- MCDI_CPU. (Multi-Core-Deep-Idle)
- MCDI_CLUSTER.
- DPIDLE. (Deep-Idle)

Signed-off-by: Amjad Ouled-Ameur <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8365.dtsi | 35 ++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index cfe0c67ad61f..413496c92069 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -128,6 +128,7 @@ cpu0: cpu@0 {
reg = <0x0>;
#cooling-cells = <2>;
enable-method = "psci";
+ cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>;
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>;
@@ -147,6 +148,7 @@ cpu1: cpu@1 {
reg = <0x1>;
#cooling-cells = <2>;
enable-method = "psci";
+ cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>;
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>;
@@ -166,6 +168,7 @@ cpu2: cpu@2 {
reg = <0x2>;
#cooling-cells = <2>;
enable-method = "psci";
+ cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>;
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>;
@@ -185,6 +188,7 @@ cpu3: cpu@3 {
reg = <0x3>;
#cooling-cells = <2>;
enable-method = "psci";
+ cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>;
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>;
@@ -198,6 +202,37 @@ cpu3: cpu@3 {
operating-points-v2 = <&cluster0_opp>;
};

+ idle-states {
+ entry-method = "psci";
+
+ CPU_MCDI: cpu-mcdi {
+ compatible = "arm,idle-state";
+ local-timer-stop;
+ arm,psci-suspend-param = <0x00010001>;
+ entry-latency-us = <300>;
+ exit-latency-us = <200>;
+ min-residency-us = <1000>;
+ };
+
+ CLUSTER_MCDI: cluster-mcdi {
+ compatible = "arm,idle-state";
+ local-timer-stop;
+ arm,psci-suspend-param = <0x01010001>;
+ entry-latency-us = <350>;
+ exit-latency-us = <250>;
+ min-residency-us = <1200>;
+ };
+
+ CLUSTER_DPIDLE: cluster-dpidle {
+ compatible = "arm,idle-state";
+ local-timer-stop;
+ arm,psci-suspend-param = <0x01010004>;
+ entry-latency-us = <300>;
+ exit-latency-us = <800>;
+ min-residency-us = <3300>;
+ };
+ };
+
l2: l2-cache {
compatible = "cache";
cache-level = <2>;

--
2.25.1

2023-04-07 13:03:06

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v5 08/12] arm64: dts: mediatek: add usb controller support for mt8365-evk

This patch add support for SuperSpeed USB, in OTG mode, on micro connector.
It also add support for the Extensible Host Controller Interface USB.

Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index 1c36d8f19525..9760f181eb34 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
@@ -314,6 +314,28 @@ &pwm {
status = "okay";
};

+&ssusb {
+ dr_mode = "otg";
+ maximum-speed = "high-speed";
+ pinctrl-0 = <&usb_pins>;
+ pinctrl-names = "default";
+ usb-role-switch;
+ vusb33-supply = <&mt6357_vusb33_reg>;
+ status = "okay";
+
+ connector {
+ compatible = "gpio-usb-b-connector", "usb-b-connector";
+ id-gpios = <&pio 17 GPIO_ACTIVE_HIGH>;
+ type = "micro";
+ vbus-supply = <&usb_otg_vbus>;
+ };
+};
+
+&usb_host {
+ vusb33-supply = <&mt6357_vusb33_reg>;
+ status = "okay";
+};
+
&uart0 {
pinctrl-0 = <&uart0_pins>;
pinctrl-names = "default";

--
2.25.1

2023-04-07 13:12:21

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 00/12] Improve the MT8365 SoC and EVK board support

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> This commits are based on the Fabien Parent <[email protected]> work.
>
> The purpose of this series is to add the following HWs / IPs support for
> the mt8365-evk board:
> - Watchdog
> - Power Management Integrated Circuit "PMIC" wrapper
> - MT6357 PMIC
> - MultiMediaCard "MMC" & Secure Digital "SD" controller
> - USB controller
> - Ethernet MAC controller
>
> Add CPU Freq & IDLE support for this board.
>
> This series depends to anothers which add support for MT8365 EVK board
> [1], add the MT8365 I2C support [2] (both are currently applied) and
> finally the pinctrl binding cleanup [3].
>
> === Build:
>
> To test this serie, cherry-pick patches from the dependent series ([1],[2],[3])
> and the applied patches from this serie (documented in the "Changes" below).
> Be carefull, the pinctrl serie [3] is rebased to linusw/linux-pinctrl,
> cherry-pick will not be straightforward.
> Finally, cherry-pick this serie.
>
> You can also take my branch [4] which have all the needed patches
> retrieved from the instructions above.
>
> Use the arm64 defconfig to make the build.
>
> Regards,
> Alex
>
> [1]: https://lore.kernel.org/all/[email protected]/
> [2]: https://lore.kernel.org/all/[email protected]/
> [3]: https://lore.kernel.org/all/[email protected]/
> [4]: https://gitlab.baylibre.com/baylibre/mediatek/bsp/linux/-/commits/amergnat/i350-evk-board-support
>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> Changes in v5:
> - Add patches to build the MT6357 regulator driver and MTK PMIC keys by default
> - Remove "dt-bindings: pinctrl: mediatek,mt8365-pinctrl: add drive strength property"
> patch from this serie and add it to the pinctrl serie [3]
> - Link to v4: https://lore.kernel.org/r/[email protected]
>
> Changes in v4:
> - Remove v3 applied patch from the serie:
> - arm64: dts: mediatek: add ethernet support for mt8365 SoC
> - arm64: dts: mediatek: add mmc support for mt8365 SoC
> - arm64: dts: mediatek: add mt6357 device-tree
> - arm64: dts: mediatek: add pwrap support to mt8365 SoC
> - arm64: dts: mediatek: Increase the size BL31 reserved memory
> - Drop "arm64: dts: mediatek: fix systimer properties" which is done [1]
> - Fix style, typo and re-order properties.
> - Use interrupts-extended for the PMIC node.
> - Link to v3: https://lore.kernel.org/r/[email protected]
>
> Changes in v3:
> - Remove v2 applied patch from the serie:
> - dt-bindings: mmc: mediatek,mtk-sd: add mt8365
> - Add trailers and simply resend.
> - Link to v2: https://lore.kernel.org/r/[email protected]
>
> ---
> Alexandre Mergnat (10):
> arm64: defconfig: enable MT6357 regulator
> arm64: defconfig: enable Mediatek PMIC key
> dt-bindings: watchdog: mediatek,mtk-wdt: add mt8365
> arm64: dts: mediatek: add watchdog support for mt8365 SoC
> arm64: dts: mediatek: add mt6357 PMIC support for mt8365-evk
> arm64: dts: mediatek: add mmc support for mt8365-evk
> arm64: dts: mediatek: add usb controller support for mt8365-evk
> arm64: dts: mediatek: add ethernet support for mt8365-evk
> arm64: dts: mediatek: add OPP support for mt8365 SoC
> arm64: dts: mediatek: add cpufreq support for mt8365-evk
>
> Amjad Ouled-Ameur (1):
> arm64: dts: mediatek: Add CPU Idle support
>
> Fabien Parent (1):
> arm64: dts: mediatek: set vmc regulator as always on
>
> .../bindings/watchdog/mediatek,mtk-wdt.yaml | 1 +
> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 249 +++++++++++++++++++++
> arch/arm64/boot/dts/mediatek/mt8365.dtsi | 142 ++++++++++++
> arch/arm64/configs/defconfig | 3 +
> 4 files changed, 395 insertions(+)
> ---
> base-commit: 4f2a499a344b36ebb325e610265452ea88541116
> change-id: 20230203-evk-board-support-d5b7a839ed7b
>
> Best regards,
> --
> Alexandre Mergnat <[email protected]>
>

2023-04-07 13:12:41

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 01/12] arm64: defconfig: enable MT6357 regulator

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/configs/defconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
> index 7790ee42c68a..e4cb65889ae6 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -685,6 +685,7 @@ CONFIG_REGULATOR_MAX77620=y
> CONFIG_REGULATOR_MAX8973=y
> CONFIG_REGULATOR_MP8859=y
> CONFIG_REGULATOR_MT6315=m
> +CONFIG_REGULATOR_MT6357=y
> CONFIG_REGULATOR_MT6358=y
> CONFIG_REGULATOR_MT6359=y
> CONFIG_REGULATOR_MT6360=y
>
> --
> 2.25.1
>

2023-04-07 13:12:47

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 03/12] dt-bindings: watchdog: mediatek,mtk-wdt: add mt8365

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> Add binding description for mediatek,mt8365-wdt
>
> Acked-by: Krzysztof Kozlowski <[email protected]>
> Reviewed-by: Matthias Brugger <[email protected]>
> Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
> index 55b34461df1b..66cacea8e47f 100644
> --- a/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
> @@ -38,6 +38,7 @@ properties:
> - mediatek,mt7623-wdt
> - mediatek,mt7629-wdt
> - mediatek,mt8173-wdt
> + - mediatek,mt8365-wdt
> - mediatek,mt8516-wdt
> - const: mediatek,mt6589-wdt
>
>
> --
> 2.25.1
>

2023-04-07 13:12:53

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 02/12] arm64: defconfig: enable Mediatek PMIC key

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/configs/defconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
> index e4cb65889ae6..91fad635e565 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -406,9 +406,11 @@ CONFIG_MHI_WWAN_MBIM=m
> CONFIG_INPUT_EVDEV=y
> CONFIG_KEYBOARD_ADC=m
> CONFIG_KEYBOARD_GPIO=y
> +CONFIG_KEYBOARD_GPIO_POLLED=m
> CONFIG_KEYBOARD_SNVS_PWRKEY=m
> CONFIG_KEYBOARD_IMX_SC_KEY=m
> CONFIG_KEYBOARD_CROS_EC=y
> +CONFIG_KEYBOARD_MTK_PMIC=m
> CONFIG_MOUSE_ELAN_I2C=m
> CONFIG_INPUT_TOUCHSCREEN=y
> CONFIG_TOUCHSCREEN_ATMEL_MXT=m
>
> --
> 2.25.1
>

2023-04-07 13:13:11

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 05/12] arm64: dts: mediatek: add mt6357 PMIC support for mt8365-evk

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> This power management system chip integration helps to manage regulators
> and keys.
>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> index dd7da86420cf..a238bd0092d2 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> @@ -12,6 +12,7 @@
> #include <dt-bindings/input/input.h>
> #include <dt-bindings/pinctrl/mt8365-pinfunc.h>
> #include "mt8365.dtsi"
> +#include "mt6357.dtsi"
>
> / {
> model = "MediaTek MT8365 Open Platform EVK";
> @@ -94,6 +95,12 @@ &i2c0 {
> status = "okay";
> };
>
> +&mt6357_pmic {
> + interrupts-extended = <&pio 145 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-controller;
> + #interrupt-cells = <2>;
> +};
> +
> &pio {
> gpio_keys: gpio-keys-pins {
> pins {
>
> --
> 2.25.1
>

2023-04-07 13:13:13

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 04/12] arm64: dts: mediatek: add watchdog support for mt8365 SoC

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> Add watchdog support.
>
> Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365.dtsi | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> index 1f6b48359115..bb45aab2e6a9 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> @@ -162,6 +162,12 @@ syscfg_pctl: syscfg-pctl@10005000 {
> reg = <0 0x10005000 0 0x1000>;
> };
>
> + watchdog: watchdog@10007000 {
> + compatible = "mediatek,mt8365-wdt", "mediatek,mt6589-wdt";
> + reg = <0 0x10007000 0 0x100>;
> + #reset-cells = <1>;
> + };
> +
> pio: pinctrl@1000b000 {
> compatible = "mediatek,mt8365-pinctrl";
> reg = <0 0x1000b000 0 0x1000>;
>
> --
> 2.25.1
>

2023-04-07 13:13:36

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 06/12] arm64: dts: mediatek: add mmc support for mt8365-evk

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> - Add EMMC support on mmc0 (internal memory)
> - Add SD-UHS support on mmc1 (external memory)
>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 138 ++++++++++++++++++++++++++++
> 1 file changed, 138 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> index a238bd0092d2..cd920d09c3fe 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> @@ -95,6 +95,42 @@ &i2c0 {
> status = "okay";
> };
>
> +&mmc0 {
> + assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL>;
> + assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>;
> + bus-width = <8>;
> + cap-mmc-highspeed;
> + cap-mmc-hw-reset;
> + hs400-ds-delay = <0x12012>;
> + max-frequency = <200000000>;
> + mmc-hs200-1_8v;
> + mmc-hs400-1_8v;
> + no-sd;
> + no-sdio;
> + non-removable;
> + pinctrl-0 = <&mmc0_default_pins>;
> + pinctrl-1 = <&mmc0_uhs_pins>;
> + pinctrl-names = "default", "state_uhs";
> + vmmc-supply = <&mt6357_vemc_reg>;
> + vqmmc-supply = <&mt6357_vio18_reg>;
> + status = "okay";
> +};
> +
> +&mmc1 {
> + bus-width = <4>;
> + cap-sd-highspeed;
> + cd-gpios = <&pio 76 GPIO_ACTIVE_LOW>;
> + max-frequency = <200000000>;
> + pinctrl-0 = <&mmc1_default_pins>;
> + pinctrl-1 = <&mmc1_uhs_pins>;
> + pinctrl-names = "default", "state_uhs";
> + sd-uhs-sdr104;
> + sd-uhs-sdr50;
> + vmmc-supply = <&mt6357_vmch_reg>;
> + vqmmc-supply = <&mt6357_vio18_reg>;
> + status = "okay";
> +};
> +
> &mt6357_pmic {
> interrupts-extended = <&pio 145 IRQ_TYPE_LEVEL_HIGH>;
> interrupt-controller;
> @@ -118,6 +154,108 @@ pins {
> };
> };
>
> + mmc0_default_pins: mmc0-default-pins {
> + clk-pins {
> + pinmux = <MT8365_PIN_99_MSDC0_CLK__FUNC_MSDC0_CLK>;
> + bias-pull-down;
> + };
> +
> + cmd-dat-pins {
> + pinmux = <MT8365_PIN_103_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
> + <MT8365_PIN_102_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
> + <MT8365_PIN_101_MSDC0_DAT2__FUNC_MSDC0_DAT2>,
> + <MT8365_PIN_100_MSDC0_DAT3__FUNC_MSDC0_DAT3>,
> + <MT8365_PIN_96_MSDC0_DAT4__FUNC_MSDC0_DAT4>,
> + <MT8365_PIN_95_MSDC0_DAT5__FUNC_MSDC0_DAT5>,
> + <MT8365_PIN_94_MSDC0_DAT6__FUNC_MSDC0_DAT6>,
> + <MT8365_PIN_93_MSDC0_DAT7__FUNC_MSDC0_DAT7>,
> + <MT8365_PIN_98_MSDC0_CMD__FUNC_MSDC0_CMD>;
> + input-enable;
> + bias-pull-up;
> + };
> +
> + rst-pins {
> + pinmux = <MT8365_PIN_97_MSDC0_RSTB__FUNC_MSDC0_RSTB>;
> + bias-pull-up;
> + };
> + };
> +
> + mmc0_uhs_pins: mmc0-uhs-pins {
> + clk-pins {
> + pinmux = <MT8365_PIN_99_MSDC0_CLK__FUNC_MSDC0_CLK>;
> + drive-strength = <MTK_DRIVE_10mA>;
> + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
> + };
> +
> + cmd-dat-pins {
> + pinmux = <MT8365_PIN_103_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
> + <MT8365_PIN_102_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
> + <MT8365_PIN_101_MSDC0_DAT2__FUNC_MSDC0_DAT2>,
> + <MT8365_PIN_100_MSDC0_DAT3__FUNC_MSDC0_DAT3>,
> + <MT8365_PIN_96_MSDC0_DAT4__FUNC_MSDC0_DAT4>,
> + <MT8365_PIN_95_MSDC0_DAT5__FUNC_MSDC0_DAT5>,
> + <MT8365_PIN_94_MSDC0_DAT6__FUNC_MSDC0_DAT6>,
> + <MT8365_PIN_93_MSDC0_DAT7__FUNC_MSDC0_DAT7>,
> + <MT8365_PIN_98_MSDC0_CMD__FUNC_MSDC0_CMD>;
> + input-enable;
> + drive-strength = <MTK_DRIVE_10mA>;
> + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
> + };
> +
> + ds-pins {
> + pinmux = <MT8365_PIN_104_MSDC0_DSL__FUNC_MSDC0_DSL>;
> + drive-strength = <MTK_DRIVE_10mA>;
> + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
> + };
> +
> + rst-pins {
> + pinmux = <MT8365_PIN_97_MSDC0_RSTB__FUNC_MSDC0_RSTB>;
> + drive-strength = <MTK_DRIVE_10mA>;
> + bias-pull-up;
> + };
> + };
> +
> + mmc1_default_pins: mmc1-default-pins {
> + cd-pins {
> + pinmux = <MT8365_PIN_76_CMDAT8__FUNC_GPIO76>;
> + bias-pull-up;
> + };
> +
> + clk-pins {
> + pinmux = <MT8365_PIN_88_MSDC1_CLK__FUNC_MSDC1_CLK>;
> + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
> + };
> +
> + cmd-dat-pins {
> + pinmux = <MT8365_PIN_89_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
> + <MT8365_PIN_90_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
> + <MT8365_PIN_91_MSDC1_DAT2__FUNC_MSDC1_DAT2>,
> + <MT8365_PIN_92_MSDC1_DAT3__FUNC_MSDC1_DAT3>,
> + <MT8365_PIN_87_MSDC1_CMD__FUNC_MSDC1_CMD>;
> + input-enable;
> + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
> + };
> + };
> +
> + mmc1_uhs_pins: mmc1-uhs-pins {
> + clk-pins {
> + pinmux = <MT8365_PIN_88_MSDC1_CLK__FUNC_MSDC1_CLK>;
> + drive-strength = <MTK_DRIVE_8mA>;
> + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
> + };
> +
> + cmd-dat-pins {
> + pinmux = <MT8365_PIN_89_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
> + <MT8365_PIN_90_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
> + <MT8365_PIN_91_MSDC1_DAT2__FUNC_MSDC1_DAT2>,
> + <MT8365_PIN_92_MSDC1_DAT3__FUNC_MSDC1_DAT3>,
> + <MT8365_PIN_87_MSDC1_CMD__FUNC_MSDC1_CMD>;
> + input-enable;
> + drive-strength = <MTK_DRIVE_6mA>;
> + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
> + };
> + };
> +
> uart0_pins: uart0-pins {
> pins {
> pinmux = <MT8365_PIN_35_URXD0__FUNC_URXD0>,
>
> --
> 2.25.1
>

2023-04-07 13:13:54

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 07/12] arm64: dts: mediatek: set vmc regulator as always on

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, <[email protected]> a écrit :
>
> From: Fabien Parent <[email protected]>
>
> MSDC1 IP block is powered by VMC. Make sure it is always on.
>
> Signed-off-by: Fabien Parent <[email protected]>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> index cd920d09c3fe..1c36d8f19525 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> @@ -137,6 +137,11 @@ &mt6357_pmic {
> #interrupt-cells = <2>;
> };
>
> +/* Needed by MSDC1 */
> +&mt6357_vmc_reg {
> + regulator-always-on;
> +};
> +
> &pio {
> gpio_keys: gpio-keys-pins {
> pins {
>
> --
> 2.25.1
>

2023-04-07 13:14:20

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 08/12] arm64: dts: mediatek: add usb controller support for mt8365-evk

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> This patch add support for SuperSpeed USB, in OTG mode, on micro connector.
> It also add support for the Extensible Host Controller Interface USB.
>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> index 1c36d8f19525..9760f181eb34 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> @@ -314,6 +314,28 @@ &pwm {
> status = "okay";
> };
>
> +&ssusb {
> + dr_mode = "otg";
> + maximum-speed = "high-speed";
> + pinctrl-0 = <&usb_pins>;
> + pinctrl-names = "default";
> + usb-role-switch;
> + vusb33-supply = <&mt6357_vusb33_reg>;
> + status = "okay";
> +
> + connector {
> + compatible = "gpio-usb-b-connector", "usb-b-connector";
> + id-gpios = <&pio 17 GPIO_ACTIVE_HIGH>;
> + type = "micro";
> + vbus-supply = <&usb_otg_vbus>;
> + };
> +};
> +
> +&usb_host {
> + vusb33-supply = <&mt6357_vusb33_reg>;
> + status = "okay";
> +};
> +
> &uart0 {
> pinctrl-0 = <&uart0_pins>;
> pinctrl-names = "default";
>
> --
> 2.25.1
>

2023-04-07 13:14:42

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 09/12] arm64: dts: mediatek: add ethernet support for mt8365-evk

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> - Enable "vibr" and "vsim2" regulators to power the ethernet chip.
>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 57 +++++++++++++++++++++++++++++
> 1 file changed, 57 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> index 9760f181eb34..431078f8670e 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> @@ -88,6 +88,28 @@ optee_reserved: optee@43200000 {
> };
> };
>
> +&ethernet {
> + pinctrl-0 = <&ethernet_pins>;
> + pinctrl-names = "default";
> + phy-handle = <&eth_phy>;
> + phy-mode = "rmii";
> + /*
> + * Ethernet and HDMI (DSI0) are sharing pins.
> + * Only one can be enabled at a time and require the physical switch
> + * SW2101 to be set on LAN position
> + */
> + status = "disabled";
> +
> + mdio {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + eth_phy: ethernet-phy@0 {
> + reg = <0>;
> + };
> + };
> +};
> +
> &i2c0 {
> clock-frequency = <100000>;
> pinctrl-0 = <&i2c0_pins>;
> @@ -137,12 +159,47 @@ &mt6357_pmic {
> #interrupt-cells = <2>;
> };
>
> +/* Needed by analog switch (multiplexer), HDMI and ethernet */
> +&mt6357_vibr_reg {
> + regulator-always-on;
> +};
> +
> /* Needed by MSDC1 */
> &mt6357_vmc_reg {
> regulator-always-on;
> };
>
> +/* Needed by ethernet */
> +&mt6357_vsim2_reg {
> + regulator-always-on;
> +};
> +
> &pio {
> + ethernet_pins: ethernet-pins {
> + phy_reset_pins {
> + pinmux = <MT8365_PIN_133_TDM_TX_DATA1__FUNC_GPIO133>;
> + };
> +
> + rmii_pins {
> + pinmux = <MT8365_PIN_0_GPIO0__FUNC_EXT_TXD0>,
> + <MT8365_PIN_1_GPIO1__FUNC_EXT_TXD1>,
> + <MT8365_PIN_2_GPIO2__FUNC_EXT_TXD2>,
> + <MT8365_PIN_3_GPIO3__FUNC_EXT_TXD3>,
> + <MT8365_PIN_4_GPIO4__FUNC_EXT_TXC>,
> + <MT8365_PIN_5_GPIO5__FUNC_EXT_RXER>,
> + <MT8365_PIN_6_GPIO6__FUNC_EXT_RXC>,
> + <MT8365_PIN_7_GPIO7__FUNC_EXT_RXDV>,
> + <MT8365_PIN_8_GPIO8__FUNC_EXT_RXD0>,
> + <MT8365_PIN_9_GPIO9__FUNC_EXT_RXD1>,
> + <MT8365_PIN_10_GPIO10__FUNC_EXT_RXD2>,
> + <MT8365_PIN_11_GPIO11__FUNC_EXT_RXD3>,
> + <MT8365_PIN_12_GPIO12__FUNC_EXT_TXEN>,
> + <MT8365_PIN_13_GPIO13__FUNC_EXT_COL>,
> + <MT8365_PIN_14_GPIO14__FUNC_EXT_MDIO>,
> + <MT8365_PIN_15_GPIO15__FUNC_EXT_MDC>;
> + };
> + };
> +
> gpio_keys: gpio-keys-pins {
> pins {
> pinmux = <MT8365_PIN_24_KPCOL0__FUNC_KPCOL0>;
>
> --
> 2.25.1
>

2023-04-07 13:15:03

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 10/12] arm64: dts: mediatek: add OPP support for mt8365 SoC

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> In order to have cpufreq support, this patch adds generic Operating
> Performance Points support.
>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365.dtsi | 101 +++++++++++++++++++++++++++++++
> 1 file changed, 101 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> index bb45aab2e6a9..cfe0c67ad61f 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> @@ -20,6 +20,91 @@ cpus {
> #address-cells = <1>;
> #size-cells = <0>;
>
> + cluster0_opp: opp-table-0 {
> + compatible = "operating-points-v2";
> + opp-shared;
> +
> + opp-850000000 {
> + opp-hz = /bits/ 64 <850000000>;
> + opp-microvolt = <650000>;
> + };
> +
> + opp-918000000 {
> + opp-hz = /bits/ 64 <918000000>;
> + opp-microvolt = <668750>;
> + };
> +
> + opp-987000000 {
> + opp-hz = /bits/ 64 <987000000>;
> + opp-microvolt = <687500>;
> + };
> +
> + opp-1056000000 {
> + opp-hz = /bits/ 64 <1056000000>;
> + opp-microvolt = <706250>;
> + };
> +
> + opp-1125000000 {
> + opp-hz = /bits/ 64 <1125000000>;
> + opp-microvolt = <725000>;
> + };
> +
> + opp-1216000000 {
> + opp-hz = /bits/ 64 <1216000000>;
> + opp-microvolt = <750000>;
> + };
> +
> + opp-1308000000 {
> + opp-hz = /bits/ 64 <1308000000>;
> + opp-microvolt = <775000>;
> + };
> +
> + opp-1400000000 {
> + opp-hz = /bits/ 64 <1400000000>;
> + opp-microvolt = <800000>;
> + };
> +
> + opp-1466000000 {
> + opp-hz = /bits/ 64 <1466000000>;
> + opp-microvolt = <825000>;
> + };
> +
> + opp-1533000000 {
> + opp-hz = /bits/ 64 <1533000000>;
> + opp-microvolt = <850000>;
> + };
> +
> + opp-1633000000 {
> + opp-hz = /bits/ 64 <1633000000>;
> + opp-microvolt = <887500>;
> + };
> +
> + opp-1700000000 {
> + opp-hz = /bits/ 64 <1700000000>;
> + opp-microvolt = <912500>;
> + };
> +
> + opp-1767000000 {
> + opp-hz = /bits/ 64 <1767000000>;
> + opp-microvolt = <937500>;
> + };
> +
> + opp-1834000000 {
> + opp-hz = /bits/ 64 <1834000000>;
> + opp-microvolt = <962500>;
> + };
> +
> + opp-1917000000 {
> + opp-hz = /bits/ 64 <1917000000>;
> + opp-microvolt = <993750>;
> + };
> +
> + opp-2001000000 {
> + opp-hz = /bits/ 64 <2001000000>;
> + opp-microvolt = <1025000>;
> + };
> + };
> +
> cpu-map {
> cluster0 {
> core0 {
> @@ -50,6 +135,10 @@ cpu0: cpu@0 {
> d-cache-line-size = <64>;
> d-cache-sets = <256>;
> next-level-cache = <&l2>;
> + clocks = <&mcucfg CLK_MCU_BUS_SEL>,
> + <&apmixedsys CLK_APMIXED_MAINPLL>;
> + clock-names = "cpu", "intermediate";
> + operating-points-v2 = <&cluster0_opp>;
> };
>
> cpu1: cpu@1 {
> @@ -65,6 +154,10 @@ cpu1: cpu@1 {
> d-cache-line-size = <64>;
> d-cache-sets = <256>;
> next-level-cache = <&l2>;
> + clocks = <&mcucfg CLK_MCU_BUS_SEL>,
> + <&apmixedsys CLK_APMIXED_MAINPLL>;
> + clock-names = "cpu", "intermediate", "armpll";
> + operating-points-v2 = <&cluster0_opp>;
> };
>
> cpu2: cpu@2 {
> @@ -80,6 +173,10 @@ cpu2: cpu@2 {
> d-cache-line-size = <64>;
> d-cache-sets = <256>;
> next-level-cache = <&l2>;
> + clocks = <&mcucfg CLK_MCU_BUS_SEL>,
> + <&apmixedsys CLK_APMIXED_MAINPLL>;
> + clock-names = "cpu", "intermediate", "armpll";
> + operating-points-v2 = <&cluster0_opp>;
> };
>
> cpu3: cpu@3 {
> @@ -95,6 +192,10 @@ cpu3: cpu@3 {
> d-cache-line-size = <64>;
> d-cache-sets = <256>;
> next-level-cache = <&l2>;
> + clocks = <&mcucfg CLK_MCU_BUS_SEL>,
> + <&apmixedsys CLK_APMIXED_MAINPLL>;
> + clock-names = "cpu", "intermediate", "armpll";
> + operating-points-v2 = <&cluster0_opp>;
> };
>
> l2: l2-cache {
>
> --
> 2.25.1
>

2023-04-07 13:15:14

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 11/12] arm64: dts: mediatek: add cpufreq support for mt8365-evk

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, Alexandre Mergnat <[email protected]> a écrit :
>
> In order to have cpufreq support, this patch adds proc-supply and
> sram-supply for each CPU.
>
> Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> index 431078f8670e..d723838ed49b 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> @@ -88,6 +88,26 @@ optee_reserved: optee@43200000 {
> };
> };
>
> +&cpu0 {
> + proc-supply = <&mt6357_vproc_reg>;
> + sram-supply = <&mt6357_vsram_proc_reg>;
> +};
> +
> +&cpu1 {
> + proc-supply = <&mt6357_vproc_reg>;
> + sram-supply = <&mt6357_vsram_proc_reg>;
> +};
> +
> +&cpu2 {
> + proc-supply = <&mt6357_vproc_reg>;
> + sram-supply = <&mt6357_vsram_proc_reg>;
> +};
> +
> +&cpu3 {
> + proc-supply = <&mt6357_vproc_reg>;
> + sram-supply = <&mt6357_vsram_proc_reg>;
> +};
> +
> &ethernet {
> pinctrl-0 = <&ethernet_pins>;
> pinctrl-names = "default";
>
> --
> 2.25.1
>

2023-04-07 13:28:31

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 12/12] arm64: dts: mediatek: Add CPU Idle support

+ To: Catalin Marinas <[email protected]>
+ To: Will Deacon <[email protected]>

Sorry for the noise.

Regards,
Alexandre

Le ven. 7 avr. 2023 à 14:59, <[email protected]> a écrit :
>
> From: Amjad Ouled-Ameur <[email protected]>
>
> MT8365 has 3 CPU Idle states:
> - MCDI_CPU. (Multi-Core-Deep-Idle)
> - MCDI_CLUSTER.
> - DPIDLE. (Deep-Idle)
>
> Signed-off-by: Amjad Ouled-Ameur <[email protected]>
> Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365.dtsi | 35 ++++++++++++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> index cfe0c67ad61f..413496c92069 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
> @@ -128,6 +128,7 @@ cpu0: cpu@0 {
> reg = <0x0>;
> #cooling-cells = <2>;
> enable-method = "psci";
> + cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>;
> i-cache-size = <0x8000>;
> i-cache-line-size = <64>;
> i-cache-sets = <256>;
> @@ -147,6 +148,7 @@ cpu1: cpu@1 {
> reg = <0x1>;
> #cooling-cells = <2>;
> enable-method = "psci";
> + cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>;
> i-cache-size = <0x8000>;
> i-cache-line-size = <64>;
> i-cache-sets = <256>;
> @@ -166,6 +168,7 @@ cpu2: cpu@2 {
> reg = <0x2>;
> #cooling-cells = <2>;
> enable-method = "psci";
> + cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>;
> i-cache-size = <0x8000>;
> i-cache-line-size = <64>;
> i-cache-sets = <256>;
> @@ -185,6 +188,7 @@ cpu3: cpu@3 {
> reg = <0x3>;
> #cooling-cells = <2>;
> enable-method = "psci";
> + cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>;
> i-cache-size = <0x8000>;
> i-cache-line-size = <64>;
> i-cache-sets = <256>;
> @@ -198,6 +202,37 @@ cpu3: cpu@3 {
> operating-points-v2 = <&cluster0_opp>;
> };
>
> + idle-states {
> + entry-method = "psci";
> +
> + CPU_MCDI: cpu-mcdi {
> + compatible = "arm,idle-state";
> + local-timer-stop;
> + arm,psci-suspend-param = <0x00010001>;
> + entry-latency-us = <300>;
> + exit-latency-us = <200>;
> + min-residency-us = <1000>;
> + };
> +
> + CLUSTER_MCDI: cluster-mcdi {
> + compatible = "arm,idle-state";
> + local-timer-stop;
> + arm,psci-suspend-param = <0x01010001>;
> + entry-latency-us = <350>;
> + exit-latency-us = <250>;
> + min-residency-us = <1200>;
> + };
> +
> + CLUSTER_DPIDLE: cluster-dpidle {
> + compatible = "arm,idle-state";
> + local-timer-stop;
> + arm,psci-suspend-param = <0x01010004>;
> + entry-latency-us = <300>;
> + exit-latency-us = <800>;
> + min-residency-us = <3300>;
> + };
> + };
> +
> l2: l2-cache {
> compatible = "cache";
> cache-level = <2>;
>
> --
> 2.25.1
>

2023-04-07 17:58:37

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH v5 00/12] Improve the MT8365 SoC and EVK board support

Alexandre Mergnat <[email protected]> writes:

> This commits are based on the Fabien Parent <[email protected]> work.
>
> The purpose of this series is to add the following HWs / IPs support for
> the mt8365-evk board:
> - Watchdog
> - Power Management Integrated Circuit "PMIC" wrapper
> - MT6357 PMIC
> - MultiMediaCard "MMC" & Secure Digital "SD" controller
> - USB controller
> - Ethernet MAC controller
>
> Add CPU Freq & IDLE support for this board.

Tested-by: Kevin Hilman <[email protected]>

Thanks for providing the branch with the dependencies. With that, I
tested basic build & boot on mt8365-evk, and things are working as
expected.

I also enabled `CONFIG_USB_ETH=y` to test with USB ethernet gadget, and
was able use NFSroot, so that's working well also.

Kevin

Subject: Re: [PATCH v5 01/12] arm64: defconfig: enable MT6357 regulator

Il 07/04/23 14:59, Alexandre Mergnat ha scritto:
> Signed-off-by: Alexandre Mergnat <[email protected]>


Commit description please.

Regards,
Angelo

Subject: Re: [PATCH v5 05/12] arm64: dts: mediatek: add mt6357 PMIC support for mt8365-evk

Il 07/04/23 14:59, Alexandre Mergnat ha scritto:
> This power management system chip integration helps to manage regulators
> and keys.
>
> Signed-off-by: Alexandre Mergnat <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>


Subject: Re: [PATCH v5 02/12] arm64: defconfig: enable Mediatek PMIC key

Il 07/04/23 14:59, Alexandre Mergnat ha scritto:
> Signed-off-by: Alexandre Mergnat <[email protected]>

There's no commit description. Please add one, saying why this is needed.

I know why, but there's people who don't.

Regards,
Angelo

Subject: Re: [PATCH v5 06/12] arm64: dts: mediatek: add mmc support for mt8365-evk

Il 07/04/23 14:59, Alexandre Mergnat ha scritto:
> - Add EMMC support on mmc0 (internal memory)
> - Add SD-UHS support on mmc1 (external memory)
>
> Signed-off-by: Alexandre Mergnat <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>


Subject: Re: [PATCH v5 08/12] arm64: dts: mediatek: add usb controller support for mt8365-evk

Il 07/04/23 14:59, Alexandre Mergnat ha scritto:
> This patch add support for SuperSpeed USB, in OTG mode, on micro connector.
> It also add support for the Extensible Host Controller Interface USB.
>
> Signed-off-by: Alexandre Mergnat <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>


Subject: Re: [PATCH v5 07/12] arm64: dts: mediatek: set vmc regulator as always on

Il 07/04/23 14:59, [email protected] ha scritto:
> From: Fabien Parent <[email protected]>
>
> MSDC1 IP block is powered by VMC. Make sure it is always on.
>

Can't we set vmc as parent of vemc?

> Signed-off-by: Fabien Parent <[email protected]>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> index cd920d09c3fe..1c36d8f19525 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> @@ -137,6 +137,11 @@ &mt6357_pmic {
> #interrupt-cells = <2>;
> };
>
> +/* Needed by MSDC1 */
> +&mt6357_vmc_reg {
> + regulator-always-on;
> +};
> +
> &pio {
> gpio_keys: gpio-keys-pins {
> pins {
>

Subject: Re: [PATCH v5 10/12] arm64: dts: mediatek: add OPP support for mt8365 SoC

Il 07/04/23 14:59, Alexandre Mergnat ha scritto:
> In order to have cpufreq support, this patch adds generic Operating
> Performance Points support.
>
> Signed-off-by: Alexandre Mergnat <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>


2023-04-11 11:18:59

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v5 07/12] arm64: dts: mediatek: set vmc regulator as always on


On 11/04/2023 10:23, AngeloGioacchino Del Regno wrote:
> Il 07/04/23 14:59, [email protected] ha scritto:
>> From: Fabien Parent <[email protected]>
>>
>> MSDC1 IP block is powered by VMC. Make sure it is always on.
>>
>
> Can't we set vmc as parent of vemc?

I don't find parent property for regulators. AFAIK, vin-supply is used in other DTS to do that but is it supported by fixed-regulator and gpio-regulator, which is not the case here.
Based on this, I don't think so, but I'm probably missing something.

Regards,
Alexandre

2023-04-11 13:41:33

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v5 03/12] dt-bindings: watchdog: mediatek,mtk-wdt: add mt8365

On Fri, Apr 07, 2023 at 03:11:18PM +0200, Alexandre Mergnat wrote:
> + To: Catalin Marinas <[email protected]>
> + To: Will Deacon <[email protected]>

Why? They don't take bindings or dts files. Those go thru the subsystem
(watchdog (for bindings) or Mediatek sub-arch tree.

Second, if they did pick this up, they likely need the original mail
sent to them, not a reply.

Rob

>
> Sorry for the noise.
>
> Regards,
> Alexandre
>
> Le ven. 7 avr. 2023 ? 14:59, Alexandre Mergnat <[email protected]> a ?crit :
> >
> > Add binding description for mediatek,mt8365-wdt
> >
> > Acked-by: Krzysztof Kozlowski <[email protected]>
> > Reviewed-by: Matthias Brugger <[email protected]>
> > Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
> > Signed-off-by: Alexandre Mergnat <[email protected]>
> > ---
> > Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
> > index 55b34461df1b..66cacea8e47f 100644
> > --- a/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
> > +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
> > @@ -38,6 +38,7 @@ properties:
> > - mediatek,mt7623-wdt
> > - mediatek,mt7629-wdt
> > - mediatek,mt8173-wdt
> > + - mediatek,mt8365-wdt
> > - mediatek,mt8516-wdt
> > - const: mediatek,mt6589-wdt
> >
> >
> > --
> > 2.25.1
> >

2023-04-16 15:59:01

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v5 03/12] dt-bindings: watchdog: mediatek,mtk-wdt: add mt8365

On Fri, Apr 07, 2023 at 02:59:22PM +0200, Alexandre Mergnat wrote:
> Add binding description for mediatek,mt8365-wdt
>
> Acked-by: Krzysztof Kozlowski <[email protected]>
> Reviewed-by: Matthias Brugger <[email protected]>
> Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
> Signed-off-by: Alexandre Mergnat <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
> index 55b34461df1b..66cacea8e47f 100644
> --- a/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
> +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
> @@ -38,6 +38,7 @@ properties:
> - mediatek,mt7623-wdt
> - mediatek,mt7629-wdt
> - mediatek,mt8173-wdt
> + - mediatek,mt8365-wdt
> - mediatek,mt8516-wdt
> - const: mediatek,mt6589-wdt
>