Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3238888rwb; Sat, 12 Nov 2022 01:42:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7nlhVy5soiGeHOePCBIAIvj8CUkcfT7joK2eYMKpDi9PKBgZe7pEqbp8WO68FxAz8jPcKX X-Received: by 2002:a17:906:b102:b0:7ae:129b:2ce7 with SMTP id u2-20020a170906b10200b007ae129b2ce7mr4568305ejy.92.1668246165543; Sat, 12 Nov 2022 01:42:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668246165; cv=none; d=google.com; s=arc-20160816; b=vnWD6csPhZEiwDvgO2yxsX3bbqQ1ViD8djuzsAzOysj7zKGdgiyU67PDfPStg9637E 93RC0+5lWwU2b5V23F2wrsfmDB/d13LosPhrhHLJ9cZmicV5W9HN25qsaPwEa7Wkz8Rc WEPL+67LEvqZ6vS/0yz7ZcmZD2E6Jhnz/BOlvLsGpIpA7LBObTvXGEIspBWtDjo6c832 f29vMKnyqZQQ4ac0ufAQdiH2cM4k8GECyr72zSU4NYh+EbZX9rw5wJfufTsWnPItYVhj u6ejdWVHJshBtDqC6yfaRGVsywE4MJmlAa2+CiG4mYB3/iaxT2wLfwlgfCUVV2pHG/K1 eXXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Hhz5DrTKctks3KvN5KO0thlve9/vTdccHH42iaqWOCg=; b=S3a/L+40KHsv5dWhzoRNNQ/yDqrMp5yfOpHZGAohM6n9U60wFQ70WQLQyFQFQzFEeW LNS2P0k4/XR4NHrviSxrBGwfTjU9rlDpYsRBpIgmyK5IsE6gvneAnE7tDfEm26B7srhw dyG6cJFS5ckFT1OXRWNzlcKD81Om08YthjkQ3d/7+pgH141Rc5JKMS0vs6HOi7kLIWio kcry2lNLyQUugy4YSRD4ZGaVG/CIcBAStparjTSRNheN5z3mBiXXm2QGApO3kNg1FR2Y oy3ZtPofFF8TKrz5AbC0ZI83SPu102qr3pqDasr4FIuZO6kwv5UyVUB0F1Fmpgt7kFPx Q2gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=tsUT+Oha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by12-20020a0564021b0c00b0046125ddf5easi3750373edb.185.2022.11.12.01.42.22; Sat, 12 Nov 2022 01:42:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=tsUT+Oha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234850AbiKLJQK (ORCPT + 90 others); Sat, 12 Nov 2022 04:16:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234717AbiKLJPp (ORCPT ); Sat, 12 Nov 2022 04:15:45 -0500 Received: from mxout3.routing.net (mxout3.routing.net [IPv6:2a03:2900:1:a::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10BB81582F; Sat, 12 Nov 2022 01:15:44 -0800 (PST) Received: from mxbox3.masterlogin.de (unknown [192.168.10.78]) by mxout3.routing.net (Postfix) with ESMTP id 07F1D62174; Sat, 12 Nov 2022 09:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1668244540; 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=Hhz5DrTKctks3KvN5KO0thlve9/vTdccHH42iaqWOCg=; b=tsUT+OhaNq6Npr22yl2Tjmt/2tO2uYbIjYhgswlhT0wYh5zENKREWxBG3yGPLerBQd2XM9 l3k1Sa0hOcxih1Q/POupBMS6RzllonrqSSPH4d+DGY7aaD3piENtMiCtT1xTFwjg3oHBvt VDy1eOegDB8zM9d39VkX+/O13RY1JqA= Received: from frank-G5.. (fttx-pool-157.180.227.41.bambit.de [157.180.227.41]) by mxbox3.masterlogin.de (Postfix) with ESMTPSA id D86AA360217; Sat, 12 Nov 2022 09:15:38 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Ryder Lee , Jianjun Wang , Bjorn Helgaas , Rob Herring , Krzysztof Kozlowski , Chunfeng Yun , Kishon Vijay Abraham I , Vinod Koul , Greg Kroah-Hartman , Matthias Brugger , Paolo Abeni , Lorenzo Bianconi , Bo Jiao , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-usb@vger.kernel.org, Sam Shih Subject: [PATCH v4 06/11] arm64: dts: mt7986: add spi related device nodes Date: Sat, 12 Nov 2022 10:15:13 +0100 Message-Id: <20221112091518.7846-7-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221112091518.7846-1-linux@fw-web.de> References: <20221112091518.7846-1-linux@fw-web.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mail-ID: 0626c3b5-d8fa-4ee7-9e4f-24689acac770 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 2f48cc3d3ddb..006878e3f2b2 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts @@ -59,6 +59,20 @@ switch: switch@0 { }; &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"; @@ -105,6 +119,27 @@ conf { }; }; +&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>; diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index afc01abfa99c..29da9b8ed753 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -253,6 +253,34 @@ i2c0: i2c@11008000 { 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 = ; + 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 = ; + 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>; diff --git a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts index 79c5c78f7a14..2c7f1d4fb352 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts @@ -100,6 +100,20 @@ fixed-link { }; &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"; @@ -132,6 +146,27 @@ conf { }; }; +&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"; }; -- 2.34.1