Skip to content

Commit d3c8429

Browse files
Mani-Sadhasivammbgg
authored andcommitted
arm64: dts: mediatek: Add I2C support for MT6797 SoC
Add I2C support for Mediatek MT6797 SoC. There are a total of 8 I2C controllers in this SoC (2 being shared) and they are same as the controllers present in MT6577 SoC. Hence, the driver support is added with DT fallback method. As per the datasheet, there are controllers with _imm prefix like i2c2_imm and i2c3_imm. These appears to be in different memory regions but sharing the same pins with i2c2 and i2c3 respectively. Since there is no clear evidence of what they really are, I've adapted the numbering/naming scheme from the downstream code by Mediatek. Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Matthias Brugger <[email protected]>
1 parent b253761 commit d3c8429

File tree

1 file changed

+220
-0
lines changed

1 file changed

+220
-0
lines changed

arch/arm64/boot/dts/mediatek/mt6797.dtsi

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,62 @@
155155
<MT6797_GPIO233__FUNC_UTXD1>;
156156
};
157157
};
158+
159+
i2c0_pins_a: i2c0 {
160+
pins0 {
161+
pinmux = <MT6797_GPIO37__FUNC_SCL0_0>,
162+
<MT6797_GPIO38__FUNC_SDA0_0>;
163+
};
164+
};
165+
166+
i2c1_pins_a: i2c1 {
167+
pins1 {
168+
pinmux = <MT6797_GPIO55__FUNC_SCL1_0>,
169+
<MT6797_GPIO56__FUNC_SDA1_0>;
170+
};
171+
};
172+
173+
i2c2_pins_a: i2c2 {
174+
pins2 {
175+
pinmux = <MT6797_GPIO96__FUNC_SCL2_0>,
176+
<MT6797_GPIO95__FUNC_SDA2_0>;
177+
};
178+
};
179+
180+
i2c3_pins_a: i2c3 {
181+
pins3 {
182+
pinmux = <MT6797_GPIO75__FUNC_SDA3_0>,
183+
<MT6797_GPIO74__FUNC_SCL3_0>;
184+
};
185+
};
186+
187+
i2c4_pins_a: i2c4 {
188+
pins4 {
189+
pinmux = <MT6797_GPIO238__FUNC_SDA4_0>,
190+
<MT6797_GPIO239__FUNC_SCL4_0>;
191+
};
192+
};
193+
194+
i2c5_pins_a: i2c5 {
195+
pins5 {
196+
pinmux = <MT6797_GPIO240__FUNC_SDA5_0>,
197+
<MT6797_GPIO241__FUNC_SCL5_0>;
198+
};
199+
};
200+
201+
i2c6_pins_a: i2c6 {
202+
pins6 {
203+
pinmux = <MT6797_GPIO152__FUNC_SDA6_0>,
204+
<MT6797_GPIO151__FUNC_SCL6_0>;
205+
};
206+
};
207+
208+
i2c7_pins_a: i2c7 {
209+
pins7 {
210+
pinmux = <MT6797_GPIO154__FUNC_SDA7_0>,
211+
<MT6797_GPIO153__FUNC_SCL7_0>;
212+
};
213+
};
158214
};
159215

160216
scpsys: power-controller@10006000 {
@@ -233,6 +289,170 @@
233289
status = "disabled";
234290
};
235291

292+
i2c0: i2c@11007000 {
293+
compatible = "mediatek,mt6797-i2c",
294+
"mediatek,mt6577-i2c";
295+
id = <0>;
296+
reg = <0 0x11007000 0 0x1000>,
297+
<0 0x11000100 0 0x80>;
298+
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_LOW>;
299+
clocks = <&infrasys CLK_INFRA_I2C0>,
300+
<&infrasys CLK_INFRA_AP_DMA>;
301+
clock-names = "main", "dma";
302+
clock-div = <10>;
303+
#address-cells = <1>;
304+
#size-cells = <0>;
305+
status = "disabled";
306+
};
307+
308+
i2c1: i2c@11008000 {
309+
compatible = "mediatek,mt6797-i2c",
310+
"mediatek,mt6577-i2c";
311+
id = <1>;
312+
reg = <0 0x11008000 0 0x1000>,
313+
<0 0x11000180 0 0x80>;
314+
interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_LOW>;
315+
clocks = <&infrasys CLK_INFRA_I2C1>,
316+
<&infrasys CLK_INFRA_AP_DMA>;
317+
clock-names = "main", "dma";
318+
clock-div = <10>;
319+
#address-cells = <1>;
320+
#size-cells = <0>;
321+
status = "disabled";
322+
};
323+
324+
i2c8: i2c@11009000 {
325+
compatible = "mediatek,mt6797-i2c",
326+
"mediatek,mt6577-i2c";
327+
id = <8>;
328+
reg = <0 0x11009000 0 0x1000>,
329+
<0 0x11000200 0 0x80>;
330+
interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_LOW>;
331+
clocks = <&infrasys CLK_INFRA_I2C2>,
332+
<&infrasys CLK_INFRA_AP_DMA>,
333+
<&infrasys CLK_INFRA_I2C2_ARB>;
334+
clock-names = "main", "dma", "arb";
335+
clock-div = <10>;
336+
#address-cells = <1>;
337+
#size-cells = <0>;
338+
status = "disabled";
339+
};
340+
341+
i2c9: i2c@1100d000 {
342+
compatible = "mediatek,mt6797-i2c",
343+
"mediatek,mt6577-i2c";
344+
id = <9>;
345+
reg = <0 0x1100d000 0 0x1000>,
346+
<0 0x11000280 0 0x80>;
347+
interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_LOW>;
348+
clocks = <&infrasys CLK_INFRA_I2C3>,
349+
<&infrasys CLK_INFRA_AP_DMA>,
350+
<&infrasys CLK_INFRA_I2C3_ARB>;
351+
clock-names = "main", "dma", "arb";
352+
clock-div = <10>;
353+
#address-cells = <1>;
354+
#size-cells = <0>;
355+
status = "disabled";
356+
};
357+
358+
i2c6: i2c@1100e000 {
359+
compatible = "mediatek,mt6797-i2c",
360+
"mediatek,mt6577-i2c";
361+
id = <6>;
362+
reg = <0 0x1100e000 0 0x1000>,
363+
<0 0x11000500 0 0x80>;
364+
interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_LOW>;
365+
clocks = <&infrasys CLK_INFRA_I2C_APPM>,
366+
<&infrasys CLK_INFRA_AP_DMA>;
367+
clock-names = "main", "dma";
368+
clock-div = <10>;
369+
#address-cells = <1>;
370+
#size-cells = <0>;
371+
status = "disabled";
372+
};
373+
374+
i2c7: i2c@11010000 {
375+
compatible = "mediatek,mt6797-i2c",
376+
"mediatek,mt6577-i2c";
377+
id = <7>;
378+
reg = <0 0x11010000 0 0x1000>,
379+
<0 0x11000580 0 0x80>;
380+
interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_LOW>;
381+
clocks = <&infrasys CLK_INFRA_I2C_GPUPM>,
382+
<&infrasys CLK_INFRA_AP_DMA>;
383+
clock-names = "main", "dma";
384+
clock-div = <10>;
385+
#address-cells = <1>;
386+
#size-cells = <0>;
387+
status = "disabled";
388+
};
389+
390+
i2c4: i2c@11011000 {
391+
compatible = "mediatek,mt6797-i2c",
392+
"mediatek,mt6577-i2c";
393+
id = <4>;
394+
reg = <0 0x11011000 0 0x1000>,
395+
<0 0x11000300 0 0x80>;
396+
interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_LOW>;
397+
clocks = <&infrasys CLK_INFRA_I2C4>,
398+
<&infrasys CLK_INFRA_AP_DMA>;
399+
clock-names = "main", "dma";
400+
clock-div = <10>;
401+
#address-cells = <1>;
402+
#size-cells = <0>;
403+
status = "disabled";
404+
};
405+
406+
i2c2: i2c@11013000 {
407+
compatible = "mediatek,mt6797-i2c",
408+
"mediatek,mt6577-i2c";
409+
id = <2>;
410+
reg = <0 0x11013000 0 0x1000>,
411+
<0 0x11000400 0 0x80>;
412+
interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_LOW>;
413+
clocks = <&infrasys CLK_INFRA_I2C2_IMM>,
414+
<&infrasys CLK_INFRA_AP_DMA>,
415+
<&infrasys CLK_INFRA_I2C2_ARB>;
416+
clock-names = "main", "dma", "arb";
417+
clock-div = <10>;
418+
#address-cells = <1>;
419+
#size-cells = <0>;
420+
status = "disabled";
421+
};
422+
423+
i2c3: i2c@11014000 {
424+
compatible = "mediatek,mt6797-i2c",
425+
"mediatek,mt6577-i2c";
426+
id = <3>;
427+
reg = <0 0x11014000 0 0x1000>,
428+
<0 0x11000480 0 0x80>;
429+
interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
430+
clocks = <&infrasys CLK_INFRA_I2C3_IMM>,
431+
<&infrasys CLK_INFRA_AP_DMA>,
432+
<&infrasys CLK_INFRA_I2C3_ARB>;
433+
clock-names = "main", "dma", "arb";
434+
clock-div = <10>;
435+
#address-cells = <1>;
436+
#size-cells = <0>;
437+
status = "disabled";
438+
};
439+
440+
i2c5: i2c@1101c000 {
441+
compatible = "mediatek,mt6797-i2c",
442+
"mediatek,mt6577-i2c";
443+
id = <5>;
444+
reg = <0 0x1101c000 0 0x1000>,
445+
<0 0x11000380 0 0x80>;
446+
interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_LOW>;
447+
clocks = <&infrasys CLK_INFRA_I2C5>,
448+
<&infrasys CLK_INFRA_AP_DMA>;
449+
clock-names = "main", "dma";
450+
clock-div = <10>;
451+
#address-cells = <1>;
452+
#size-cells = <0>;
453+
status = "disabled";
454+
};
455+
236456
mmsys: mmsys_config@14000000 {
237457
compatible = "mediatek,mt6797-mmsys", "syscon";
238458
reg = <0 0x14000000 0 0x1000>;

0 commit comments

Comments
 (0)