arm64: dts: mt7986: add spi related device nodes
authorSam Shih <sam.shih@mediatek.com>
Fri, 18 Nov 2022 19:01:21 +0000 (20:01 +0100)
committerMatthias Brugger <matthias.bgg@gmail.com>
Mon, 21 Nov 2022 17:17:35 +0000 (18:17 +0100)
This patch adds spi support for MT7986.

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20221118190126.100895-7-linux@fw-web.de
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts
arch/arm64/boot/dts/mediatek/mt7986a.dtsi
arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts

index 1dd54e8..9b83925 100644 (file)
 };
 
 &pio {
+       spi_flash_pins: spi-flash-pins {
+               mux {
+                       function = "spi";
+                       groups = "spi0", "spi0_wp_hold";
+               };
+       };
+
+       spic_pins: spic-pins {
+               mux {
+                       function = "spi";
+                       groups = "spi1_2";
+               };
+       };
+
        uart1_pins: uart1-pins {
                mux {
                        function = "uart";
        };
 };
 
+&spi0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi_flash_pins>;
+       cs-gpios = <0>, <0>;
+       status = "okay";
+       spi_nand: spi_nand@0 {
+               compatible = "spi-nand";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+               spi-tx-buswidth = <4>;
+               spi-rx-buswidth = <4>;
+       };
+};
+
+&spi1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spic_pins>;
+       cs-gpios = <0>, <0>;
+       status = "okay";
+};
+
 &switch {
        ports {
                #address-cells = <1>;
index cf6c490..ed70302 100644 (file)
                        status = "disabled";
                };
 
+               spi0: spi@1100a000 {
+                       compatible = "mediatek,mt7986-spi-ipm", "mediatek,spi-ipm";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0 0x1100a000 0 0x100>;
+                       interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&topckgen CLK_TOP_MPLL_D2>,
+                                <&topckgen CLK_TOP_SPI_SEL>,
+                                <&infracfg CLK_INFRA_SPI0_CK>,
+                                <&infracfg CLK_INFRA_SPI0_HCK_CK>;
+                       clock-names = "parent-clk", "sel-clk", "spi-clk", "hclk";
+                       status = "disabled";
+               };
+
+               spi1: spi@1100b000 {
+                       compatible = "mediatek,mt7986-spi-ipm", "mediatek,spi-ipm";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0 0x1100b000 0 0x100>;
+                       interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&topckgen CLK_TOP_MPLL_D2>,
+                                <&topckgen CLK_TOP_SPIM_MST_SEL>,
+                                <&infracfg CLK_INFRA_SPI1_CK>,
+                                <&infracfg CLK_INFRA_SPI1_HCK_CK>;
+                       clock-names = "parent-clk", "sel-clk", "spi-clk", "hclk";
+                       status = "disabled";
+               };
+
                ethsys: syscon@15000000 {
                         #address-cells = <1>;
                         #size-cells = <1>;
index 7cfcbb9..243760c 100644 (file)
 };
 
 &pio {
+       spi_flash_pins: spi-flash-pins {
+               mux {
+                       function = "spi";
+                       groups = "spi0", "spi0_wp_hold";
+               };
+       };
+
+       spic_pins: spic-pins {
+               mux {
+                       function = "spi";
+                       groups = "spi1_2";
+               };
+       };
+
        wf_2g_5g_pins: wf-2g-5g-pins {
                mux {
                        function = "wifi";
        };
 };
 
+&spi0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi_flash_pins>;
+       cs-gpios = <0>, <0>;
+       status = "okay";
+       spi_nand: spi_nand@0 {
+               compatible = "spi-nand";
+               reg = <0>;
+               spi-max-frequency = <10000000>;
+               spi-tx-buswidth = <4>;
+               spi-rx-buswidth = <4>;
+       };
+};
+
+&spi1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spic_pins>;
+       cs-gpios = <0>, <0>;
+       status = "okay";
+};
+
 &uart0 {
        status = "okay";
 };