From nobody Sat Sep 21 14:50:43 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90B76C4332F for ; Mon, 17 Oct 2022 10:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230406AbiJQKmV (ORCPT ); Mon, 17 Oct 2022 06:42:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229802AbiJQKmB (ORCPT ); Mon, 17 Oct 2022 06:42:01 -0400 Received: from mxout3.routing.net (mxout3.routing.net [IPv6:2a03:2900:1:a::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4AB311473; Mon, 17 Oct 2022 03:41:59 -0700 (PDT) Received: from mxbox1.masterlogin.de (unknown [192.168.10.88]) by mxout3.routing.net (Postfix) with ESMTP id 52CF5604DC; Mon, 17 Oct 2022 10:41:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1666003318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3ggDf9E6tRFHOQZwK2t3qWUHLUNVf2vXaoGwnTj5wDA=; b=wlPbJKL5hP40YjkKptcHu0NRqc603zECspr0JiFiyp/VtDhE/yYbDaCqTsM6ESB0yVRyNN B/+NNGEPcdYvmQK/RzvwibvnFojZTUhXiDrAULBHWzBgUbFtDYHxulVab2XAMyIecsfseZ iKnlrBjMjVwoqAkRrY/U9CcQ6PNJHCU= Received: from frank-G5.. (fttx-pool-217.61.154.127.bambit.de [217.61.154.127]) by mxbox1.masterlogin.de (Postfix) with ESMTPSA id 9A2C5403ED; Mon, 17 Oct 2022 10:41:57 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sam Shih Subject: [RFC v1 06/12] arm64: dts: mt7986: add spi related device nodes Date: Mon, 17 Oct 2022 12:41:35 +0200 Message-Id: <20221017104141.7338-7-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221017104141.7338-1-linux@fw-web.de> References: <20221017104141.7338-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mail-ID: c84a6eef-5dae-47a4-a8cc-3b24383d43a8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sam Shih This patch adds spi support for MT7986. Signed-off-by: Sam Shih Signed-off-by: Frank Wunderlich --- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 35 ++++++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 28 ++++++++++++++++ arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 35 ++++++++++++++++++++ 3 files changed, 98 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts b/arch/arm64/boot= /dts/mediatek/mt7986a-rfb.dts index 6189436fe31d..58f7e6b169bf 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts @@ -55,6 +55,20 @@ switch: switch@0 { }; =20 &pio { + spi_flash_pins: spi-flash-pins { + mux { + function =3D "spi"; + groups =3D "spi0", "spi0_wp_hold"; + }; + }; + + spic_pins: spic-pins { + mux { + function =3D "spi"; + groups =3D "spi1_2"; + }; + }; + uart1_pins: uart1-pins { mux { function =3D "uart"; @@ -101,6 +115,27 @@ conf { }; }; =20 +&spi0 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&spi_flash_pins>; + cs-gpios =3D <0>, <0>; + status =3D "okay"; + spi_nand: spi_nand@0 { + compatible =3D "spi-nand"; + reg =3D <0>; + spi-max-frequency =3D <10000000>; + spi-tx-buswidth =3D <4>; + spi-rx-buswidth =3D <4>; + }; +}; + +&spi1 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&spic_pins>; + cs-gpios =3D <0>, <0>; + status =3D "okay"; +}; + &switch { ports { #address-cells =3D <1>; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dt= s/mediatek/mt7986a.dtsi index 72e0d9722e07..e77e8deec4b0 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -112,6 +112,34 @@ infracfg: infracfg@10001000 { #clock-cells =3D <1>; }; =20 + spi0: spi@1100a000 { + compatible =3D "mediatek,mt7986-spi-ipm", "mediatek,spi-ipm"; + #address-cells =3D <1>; + #size-cells =3D <0>; + reg =3D <0 0x1100a000 0 0x100>; + interrupts =3D ; + clocks =3D <&topckgen CLK_TOP_MPLL_D2>, + <&topckgen CLK_TOP_SPI_SEL>, + <&infracfg CLK_INFRA_SPI0_CK>, + <&infracfg CLK_INFRA_SPI0_HCK_CK>; + clock-names =3D "parent-clk", "sel-clk", "spi-clk", "hclk"; + status =3D "disabled"; + }; + + spi1: spi@1100b000 { + compatible =3D "mediatek,mt7986-spi-ipm", "mediatek,spi-ipm"; + #address-cells =3D <1>; + #size-cells =3D <0>; + reg =3D <0 0x1100b000 0 0x100>; + interrupts =3D ; + clocks =3D <&topckgen CLK_TOP_MPLL_D2>, + <&topckgen CLK_TOP_SPIM_MST_SEL>, + <&infracfg CLK_INFRA_SPI1_CK>, + <&infracfg CLK_INFRA_SPI1_HCK_CK>; + clock-names =3D "parent-clk", "sel-clk", "spi-clk", "hclk"; + status =3D "disabled"; + }; + topckgen: topckgen@1001b000 { compatible =3D "mediatek,mt7986-topckgen", "syscon"; reg =3D <0 0x1001B000 0 0x1000>; diff --git a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts b/arch/arm64/boot= /dts/mediatek/mt7986b-rfb.dts index 7459ddb6b6f0..7673aa3fa6ae 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts @@ -96,6 +96,20 @@ fixed-link { }; =20 &pio { + spi_flash_pins: spi-flash-pins { + mux { + function =3D "spi"; + groups =3D "spi0", "spi0_wp_hold"; + }; + }; + + spic_pins: spic-pins { + mux { + function =3D "spi"; + groups =3D "spi1_2"; + }; + }; + wf_2g_5g_pins: wf-2g-5g-pins { mux { function =3D "wifi"; @@ -128,6 +142,27 @@ conf { }; }; =20 +&spi0 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&spi_flash_pins>; + cs-gpios =3D <0>, <0>; + status =3D "okay"; + spi_nand: spi_nand@0 { + compatible =3D "spi-nand"; + reg =3D <0>; + spi-max-frequency =3D <10000000>; + spi-tx-buswidth =3D <4>; + spi-rx-buswidth =3D <4>; + }; +}; + +&spi1 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&spic_pins>; + cs-gpios =3D <0>, <0>; + status =3D "okay"; +}; + &uart0 { status =3D "okay"; }; --=20 2.34.1