OSDN Git Service

arm64: dts: mediatek: cherry: Enable I2C and SPI controllers
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 4 Jul 2022 10:13:17 +0000 (12:13 +0200)
committerMatthias Brugger <matthias.bgg@gmail.com>
Thu, 7 Jul 2022 14:41:19 +0000 (16:41 +0200)
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>
Reviewed-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20220704101321.44835-8-angelogioacchino.delregno@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi

index f005654..20a4a3a 100644 (file)
@@ -9,6 +9,13 @@
 
 / {
        aliases {
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+               i2c2 = &i2c2;
+               i2c3 = &i2c3;
+               i2c4 = &i2c4;
+               i2c5 = &i2c5;
+               i2c7 = &i2c7;
                mmc0 = &mmc0;
                serial0 = &uart0;
        };
        };
 };
 
+&i2c0 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins>;
+};
+
+&i2c1 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       i2c-scl-internal-delay-ns = <12500>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins>;
+};
+
+&i2c2 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins>;
+};
+
+&i2c3 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c3_pins>;
+};
+
+&i2c4 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c4_pins>;
+};
+
+&i2c5 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c5_pins>;
+};
+
+&i2c7 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c7_pins>;
+};
+
 &mmc0 {
        status = "okay";
 
                "AP_SPI_FLASH_MOSI",
                "AP_SPI_FLASH_MISO";
 
+       i2c0_pins: i2c0-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO8__FUNC_SDA0>,
+                                <PINMUX_GPIO9__FUNC_SCL0>;
+                       bias-disable;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c1_pins: i2c1-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO10__FUNC_SDA1>,
+                                <PINMUX_GPIO11__FUNC_SCL1>;
+                       bias-pull-up = <1000>;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c2_pins: i2c2-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO12__FUNC_SDA2>,
+                                <PINMUX_GPIO13__FUNC_SCL2>;
+                       bias-disable;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c3_pins: i2c3-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO14__FUNC_SDA3>,
+                                <PINMUX_GPIO15__FUNC_SCL3>;
+                       bias-pull-up = <1000>;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c4_pins: i2c4-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO16__FUNC_SDA4>,
+                                <PINMUX_GPIO17__FUNC_SCL4>;
+                       bias-pull-up = <1000>;
+                       drive-strength = <4>;
+               };
+       };
+
+       i2c5_pins: i2c5-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO29__FUNC_SCL5>,
+                                <PINMUX_GPIO30__FUNC_SDA5>;
+                       bias-disable;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c7_pins: 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>,
                        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";
 };