* [PATCH v2 1/3] dt-bindings: i2c: i2c-mt65xx: add binding for MT8365 SoC
2023-01-19 17:08 [PATCH v2 0/3] Add MediaTek MT8365 I2C support Alexandre Mergnat
@ 2023-01-19 17:08 ` Alexandre Mergnat
2023-01-19 17:27 ` Matthias Brugger
2023-01-20 8:42 ` Wolfram Sang
2023-01-19 17:08 ` [PATCH v2 2/3] arm64: dts: mediatek: add i2c support for mt8365 SoC Alexandre Mergnat
2023-01-19 17:08 ` [PATCH v2 3/3] arm64: dts: mediatek: enable i2c0 for mt8365-evk board Alexandre Mergnat
2 siblings, 2 replies; 6+ messages in thread
From: Alexandre Mergnat @ 2023-01-19 17:08 UTC (permalink / raw)
To: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
Cc: linux-mediatek, linux-arm-kernel, linux-kernel, Alexandre Mergnat,
Fabien Parent, Rob Herring, linux-i2c, AngeloGioacchino Del Regno,
devicetree
From: Fabien Parent <fparent@baylibre.com>
Add binding documentation for the MT8365 I2C controllers.
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml
index 421563bf576c..72ae2e01cf22 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml
+++ b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml
@@ -41,6 +41,10 @@ properties:
- mediatek,mt6797-i2c
- mediatek,mt7623-i2c
- const: mediatek,mt6577-i2c
+ - items:
+ - enum:
+ - mediatek,mt8365-i2c
+ - const: mediatek,mt8168-i2c
- items:
- enum:
- mediatek,mt8195-i2c
--
b4 0.10.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 2/3] arm64: dts: mediatek: add i2c support for mt8365 SoC
2023-01-19 17:08 [PATCH v2 0/3] Add MediaTek MT8365 I2C support Alexandre Mergnat
2023-01-19 17:08 ` [PATCH v2 1/3] dt-bindings: i2c: i2c-mt65xx: add binding for MT8365 SoC Alexandre Mergnat
@ 2023-01-19 17:08 ` Alexandre Mergnat
2023-01-19 17:08 ` [PATCH v2 3/3] arm64: dts: mediatek: enable i2c0 for mt8365-evk board Alexandre Mergnat
2 siblings, 0 replies; 6+ messages in thread
From: Alexandre Mergnat @ 2023-01-19 17:08 UTC (permalink / raw)
To: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
Cc: linux-mediatek, linux-arm-kernel, linux-kernel, Alexandre Mergnat,
Fabien Parent, Rob Herring, linux-i2c, AngeloGioacchino Del Regno,
devicetree
There are four I2C master channels in MT8365 with a same HW architecture.
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
arch/arm64/boot/dts/mediatek/mt8365.dtsi | 52 ++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index a32f2b7507be..013beb50b4aa 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -282,6 +282,58 @@ pwm: pwm@11006000 {
clock-names = "top", "main", "pwm1", "pwm2", "pwm3";
};
+ i2c0: i2c@11007000 {
+ compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+ reg = <0 0x11007000 0 0xa0>, <0 0x11000080 0 0x80>;
+ interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_LOW>;
+ clock-div = <1>;
+ clocks = <&infracfg CLK_IFR_I2C0_AXI>,
+ <&infracfg CLK_IFR_AP_DMA>;
+ clock-names = "main", "dma";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ i2c1: i2c@11008000 {
+ compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+ reg = <0 0x11008000 0 0xa0>, <0 0x11000100 0 0x80>;
+ interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_LOW>;
+ clock-div = <1>;
+ clocks = <&infracfg CLK_IFR_I2C1_AXI>,
+ <&infracfg CLK_IFR_AP_DMA>;
+ clock-names = "main", "dma";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ i2c2: i2c@11009000 {
+ compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+ reg = <0 0x11009000 0 0xa0>, <0 0x11000180 0 0x80>;
+ interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_LOW>;
+ clock-div = <1>;
+ clocks = <&infracfg CLK_IFR_I2C2_AXI>,
+ <&infracfg CLK_IFR_AP_DMA>;
+ clock-names = "main", "dma";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ i2c3: i2c@1100f000 {
+ compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+ reg = <0 0x1100f000 0 0xa0>, <0 0x11000200 0 0x80>;
+ interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_LOW>;
+ clock-div = <1>;
+ clocks = <&infracfg CLK_IFR_I2C3_AXI>,
+ <&infracfg CLK_IFR_AP_DMA>;
+ clock-names = "main", "dma";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
spi: spi@1100a000 {
compatible = "mediatek,mt8365-spi", "mediatek,mt7622-spi";
reg = <0 0x1100a000 0 0x100>;
--
b4 0.10.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 3/3] arm64: dts: mediatek: enable i2c0 for mt8365-evk board
2023-01-19 17:08 [PATCH v2 0/3] Add MediaTek MT8365 I2C support Alexandre Mergnat
2023-01-19 17:08 ` [PATCH v2 1/3] dt-bindings: i2c: i2c-mt65xx: add binding for MT8365 SoC Alexandre Mergnat
2023-01-19 17:08 ` [PATCH v2 2/3] arm64: dts: mediatek: add i2c support for mt8365 SoC Alexandre Mergnat
@ 2023-01-19 17:08 ` Alexandre Mergnat
2 siblings, 0 replies; 6+ messages in thread
From: Alexandre Mergnat @ 2023-01-19 17:08 UTC (permalink / raw)
To: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
Cc: linux-mediatek, linux-arm-kernel, linux-kernel, Alexandre Mergnat,
Fabien Parent, Rob Herring, linux-i2c, AngeloGioacchino Del Regno,
devicetree
Enable the I2C0 bus provides communication with:
- The integrated RT9466 Switching Battery Charger.
- The integrated MT6691 LP4X buck for VDDQ.
- The integrated MT6691 LP4X buck for VDD2.
- The pin header, to plug external I2C devices.
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index 275ea3a0e708..d5d76a7dbd82 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
@@ -88,6 +88,15 @@ optee_reserved: optee@43200000 {
};
};
+&i2c0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c0_pins>;
+ clock-frequency = <100000>;
+ status = "okay";
+ #address-cells = <1>;
+ #size-cells = <0>;
+};
+
&pio {
gpio_keys: gpio-keys-pins {
pins {
@@ -97,6 +106,16 @@ pins {
};
};
+ i2c0_pins: i2c0 {
+ pins_i2c {
+ pinmux = <MT8365_PIN_57_SDA0__FUNC_SDA0_0>,
+ <MT8365_PIN_58_SCL0__FUNC_SCL0_0>;
+ mediatek,pull-up-adv = <3>;
+ mediatek,drive-strength-adv = <00>;
+ bias-pull-up;
+ };
+ };
+
uart0_pins: uart0-pins {
pins {
pinmux = <MT8365_PIN_35_URXD0__FUNC_URXD0>,
--
b4 0.10.1
^ permalink raw reply related [flat|nested] 6+ messages in thread