From patchwork Fri Jun 21 08:22:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 13707097 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A06B1C27C4F for ; Fri, 21 Jun 2024 08:23:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gD0K+rKHC9nvt3FBlNwsUKlm6124JZRkW03w9B3DOYc=; b=lVCXqM60La8KnN kM6gpQ9ltOqROwv6PnxzeJIiRGeqtE8hrD3n35Et+otAlmxH3QNgao+U6opNAB6KiywlQ9wiNH6jq hVN2Nn2xdqlC2Y3kKuFkfQ+n6NVuZdpXx0mmjrXeteXskdByKb3gJGsShYClNjCk57miosuTrlZQK U6tx63JVD8C3AEiEbuqcSv5qOCfDDGC2PJJtZqIIZCv6e69E52renBF/zG0ovMECHm1FihpRfCUkA j0aRHo07oR8B8kmbMUVxPgyUtIsJvuw/eLWVAFhH1GcG/E0PnQd22/oYCJKD+L1LV7cC9eZovkl0A V0vq4Bd+JQwbW7KghPtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKZY2-00000008K5z-318u; Fri, 21 Jun 2024 08:23:06 +0000 Received: from mail-sh0chn02on20728.outbound.protection.partner.outlook.cn ([2406:e500:4420:2::728] helo=CHN02-SH0-obe.outbound.protection.partner.outlook.cn) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKZXz-00000008K26-2AGz for linux-riscv@lists.infradead.org; Fri, 21 Jun 2024 08:23:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y8kyhaHPlFMTQcrrmfFx4QcYJ4F5cHfky1JFnlUMDIABT8CqgkXh3/Ld2Azcao1aIOgN4aCut6H5vsw/TFSMSUxlir7CEoIDu58s56r9RHYxEIb0afQSZaVFd7rhPWhJGmH9w28ze6fW0xELScBOstB2QwiSJIeIWjVd1T/Xo6bv74BAE9y+deY+G4DsN3Vs7J69bZYtjGT439f1pDUAWqhnzG/sl4UWaqslvu5hfZPwLYspHW0fvflb8tjRMSLR+telMMts/zXmREHkiQZmDt6h8CSx/a6NOpUD7pSXLexeg47mOv37R3P8vzsjt988fReHDZ+a4bsp88CEqu1iXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tLN9PMi2bg1NnGytX7U+EEKBVgE6AzZaqyWzo2NyW6o=; b=LecaceDDnlg3JYtWrtNJp+Tvn0YhdlHcmiC+UF60CS3zquEE2zLAfDW9kM6HySERWwUDF27dSIYFvG/a0VJ2GwzlTnPHTQw3EueIMXuCQcN/SIPKsNr2j8lby9AL9uZ4j901Y03f+BSbTt1GQt13T1Y7WN31YPixDRouNGDIFCnzB4nYe9XDQ1OoLWAylLZv5MISbH7akw7hO2yvD9Hobx2QNBRdhgZN6ZPG6Htqax3vQeP26s5or1KJKd8uQ0u7Ry7TV0XPvQjbJSunrJ+wMdzsM8md4tUah++21frDISfFGtUyAfQrZWK17PIx4/ZnLZ1mVLZeMhqMrQKYqwYKjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) by SHXPR01MB0751.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:24::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.33; Fri, 21 Jun 2024 08:22:43 +0000 Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::358e:d57d:439f:4e8a]) by SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::358e:d57d:439f:4e8a%7]) with mapi id 15.20.7656.033; Fri, 21 Jun 2024 08:22:43 +0000 From: Minda Chen To: Conor Dooley , Rob Herring , Emil Renner Berthing , Krzysztof Kozlowski Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Minda Chen Subject: [PATCH v2 1/1] riscv: dts: starfive: add PCIe dts configuration for JH7110 Date: Fri, 21 Jun 2024 16:22:31 +0800 Message-Id: <20240621082231.92896-2-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240621082231.92896-1-minda.chen@starfivetech.com> References: <20240621082231.92896-1-minda.chen@starfivetech.com> X-ClientProxiedBy: BJSPR01CA0012.CHNPR01.prod.partner.outlook.cn (2406:e500:c211:c::24) To SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SHXPR01MB0863:EE_|SHXPR01MB0751:EE_ X-MS-Office365-Filtering-Correlation-Id: 200d668b-4206-4f19-f830-08dc91cb52ce X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0;ARA:13230037|1800799021|52116011|7416011|41320700010|366013|38350700011; X-Microsoft-Antispam-Message-Info: CmxWiZWb0xKPYM2cLEyeZWzpc9++RoG9NZpz+tw/qPRRjWkDRGAV1pVRiYMbOOQ1pOQPrzqopywIEpd6jJ3zNxJqjQu7qNk6GqVPX/UDZ+Q39+m3zjuDaNHI7cQEumDtoWcx+DU8YQgrcmeJF+a0jMp9mBWM3SvTuvc8M+PttVckbCz+hZLirTTIj5adXZYM3ZxSuii4O9C6XyCBoeHZwmggeRWnIMjfE7r6ef7xPySGvPQrRogSL17fQad+iPyzFuA9CB0fRbg9ma9lm82icwSnpAXbGN6AVDBpWFubv459nkMEXmPeh1aPwT7u7CVokxZNdUz6MFwyoDQ2pdqN3fDJTUjO1PDqD1Utxadj1TztKfbABxFra5mO3+hYvRls2WpoCzpDDUvfCoVJu90bjuVhyQzsGHXeVuf+acTd6/gTGEge3FEpKYTjtQZMUC1NCjss5HFTqrDiWn/550Oann/4ZLQRtz/QJ1q05ofgSQK7+KHn3ks3eHgCEmidOwzm1+POXN0EAKvz2qMhlMuwWBT7e4ag8YcxNuntLEl1rrnlX552PL1Phm79xNE7MlFtwP4ykz16jmvlYkJT3cwCAp2VzRTA4P917QQFQegKFImAtg09lNgBoOlQmGXwlIPJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230037)(1800799021)(52116011)(7416011)(41320700010)(366013)(38350700011);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hc6cS7C0h9W/CYF0ggOFHwIiV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P6rIUd+F1bPBYFo7+FAFciMk/9eCG/1a4JF7q5yvmXut9lqAXc7UzG34cnbMrQqaTXNwav4KovDKGofcpTUKYqWMeX4K4umoKY/fUpcYdZCAgSdjm4gqLX+qYPiML70qV/VvOORONsRBk7U4GH/xHc8g714Cndgxhxy2fCGWXpWHhR1uREGJvIS5cjsajNYWDVJnPgnTUpB9hLXv0WmYIlggAHYgsQq4KpH9mkM3zfQqpYh/kWxV19+wvci5f8th7cKND6aD+eHUvZLNmaR4n3/wlahxwUYtc93TKNkynKCa6Wv01UK1QGvNXOze9YTnfi7gcB1BW0fPaOjd+aQ8x7ZEQcookUQS07kN/xS/tokSdVG/FP69Kaa6xvi0QjL94cki8AQ7nq7JrxfPNRZPt7J2YvnxBH/itXVAFa2rAwxfQ+RzLWQvTu7ZfIHQ+jL9tmHxKh6po8hmPnGyWVWr8ZiwDYQaDsgL2yKXjpg40fzgDdMUSJaFcwdexWW6i/uqg== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 200d668b-4206-4f19-f830-08dc91cb52ce X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2024 08:22:43.4590 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zTUqBLOf3F2Gk54wwBEYDuMBHSIAy3PIk3Gaj2LGKdPDUjZG8gj01diVMqKtN6yyElhATrIBB2Ib52NPi+esoiG7IZLL3ldc7lOClFbc+kU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0751 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_012303_590511_9726A50B X-CRM114-Status: UNSURE ( 8.53 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add PCIe dts configuraion for JH7110 SoC platform. Signed-off-by: Minda Chen Reviewed-by: Hal Feng --- .../boot/dts/starfive/jh7110-common.dtsi | 62 +++++++++++++ .../boot/dts/starfive/jh7110-milkv-mars.dts | 7 ++ .../jh7110-starfive-visionfive-2.dtsi | 8 ++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 86 +++++++++++++++++++ 4 files changed, 163 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi index 8ff6ea64f048..f91abc660ae8 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi @@ -294,6 +294,20 @@ status = "okay"; }; +&pcie0 { + perst-gpios = <&sysgpio 26 GPIO_ACTIVE_LOW>; + phys = <&pciephy0>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_pins>; +}; + +&pcie1 { + perst-gpios = <&sysgpio 28 GPIO_ACTIVE_LOW>; + phys = <&pciephy1>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie1_pins>; +}; + &pwmdac { pinctrl-names = "default"; pinctrl-0 = <&pwmdac_pins>; @@ -476,6 +490,54 @@ }; }; + pcie0_pins: pcie0-0 { + clkreq-pins { + pinmux = ; + bias-pull-down; + drive-strength = <2>; + input-enable; + input-schmitt-disable; + slew-rate = <0>; + }; + + wake-pins { + pinmux = ; + bias-pull-up; + drive-strength = <2>; + input-enable; + input-schmitt-disable; + slew-rate = <0>; + }; + }; + + pcie1_pins: pcie1-0 { + clkreq-pins { + pinmux = ; + bias-pull-down; + drive-strength = <2>; + input-enable; + input-schmitt-disable; + slew-rate = <0>; + }; + + wake-pins { + pinmux = ; + bias-pull-up; + drive-strength = <2>; + input-enable; + input-schmitt-disable; + slew-rate = <0>; + }; + }; + pwmdac_pins: pwmdac-0 { pwmdac-pins { pinmux = ; }; +&pcie0 { + status = "okay"; +}; + +&pcie1 { + status = "okay"; +}; &phy0 { motorcomm,tx-clk-adj-enabled; diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi index 9d70f21c86fc..18f38fc790a4 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi @@ -32,3 +32,11 @@ &mmc0 { non-removable; }; + +&pcie0 { + status = "okay"; +}; + +&pcie1 { + status = "okay"; +}; diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi index 18047195c600..5ac70759e0ab 100644 --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi @@ -1214,5 +1214,91 @@ #reset-cells = <1>; power-domains = <&pwrc JH7110_PD_VOUT>; }; + + pcie0: pcie@940000000 { + compatible = "starfive,jh7110-pcie"; + reg = <0x9 0x40000000 0x0 0x1000000>, + <0x0 0x2b000000 0x0 0x100000>; + reg-names = "cfg", "apb"; + linux,pci-domain = <0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges = <0x82000000 0x0 0x30000000 0x0 0x30000000 0x0 0x08000000>, + <0xc3000000 0x9 0x00000000 0x9 0x00000000 0x0 0x40000000>; + interrupts = <56>; + interrupt-map-mask = <0x0 0x0 0x0 0x7>; + interrupt-map = <0x0 0x0 0x0 0x1 &pcie_intc0 0x1>, + <0x0 0x0 0x0 0x2 &pcie_intc0 0x2>, + <0x0 0x0 0x0 0x3 &pcie_intc0 0x3>, + <0x0 0x0 0x0 0x4 &pcie_intc0 0x4>; + msi-controller; + device_type = "pci"; + starfive,stg-syscon = <&stg_syscon>; + bus-range = <0x0 0xff>; + clocks = <&syscrg JH7110_SYSCLK_NOC_BUS_STG_AXI>, + <&stgcrg JH7110_STGCLK_PCIE0_TL>, + <&stgcrg JH7110_STGCLK_PCIE0_AXI_MST0>, + <&stgcrg JH7110_STGCLK_PCIE0_APB>; + clock-names = "noc", "tl", "axi_mst0", "apb"; + resets = <&stgcrg JH7110_STGRST_PCIE0_AXI_MST0>, + <&stgcrg JH7110_STGRST_PCIE0_AXI_SLV0>, + <&stgcrg JH7110_STGRST_PCIE0_AXI_SLV>, + <&stgcrg JH7110_STGRST_PCIE0_BRG>, + <&stgcrg JH7110_STGRST_PCIE0_CORE>, + <&stgcrg JH7110_STGRST_PCIE0_APB>; + reset-names = "mst0", "slv0", "slv", "brg", + "core", "apb"; + status = "disabled"; + + pcie_intc0: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; + + pcie1: pcie@9c0000000 { + compatible = "starfive,jh7110-pcie"; + reg = <0x9 0xc0000000 0x0 0x1000000>, + <0x0 0x2c000000 0x0 0x100000>; + reg-names = "cfg", "apb"; + linux,pci-domain = <1>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges = <0x82000000 0x0 0x38000000 0x0 0x38000000 0x0 0x08000000>, + <0xc3000000 0x9 0x80000000 0x9 0x80000000 0x0 0x40000000>; + interrupts = <57>; + interrupt-map-mask = <0x0 0x0 0x0 0x7>; + interrupt-map = <0x0 0x0 0x0 0x1 &pcie_intc1 0x1>, + <0x0 0x0 0x0 0x2 &pcie_intc1 0x2>, + <0x0 0x0 0x0 0x3 &pcie_intc1 0x3>, + <0x0 0x0 0x0 0x4 &pcie_intc1 0x4>; + msi-controller; + device_type = "pci"; + starfive,stg-syscon = <&stg_syscon>; + bus-range = <0x0 0xff>; + clocks = <&syscrg JH7110_SYSCLK_NOC_BUS_STG_AXI>, + <&stgcrg JH7110_STGCLK_PCIE1_TL>, + <&stgcrg JH7110_STGCLK_PCIE1_AXI_MST0>, + <&stgcrg JH7110_STGCLK_PCIE1_APB>; + clock-names = "noc", "tl", "axi_mst0", "apb"; + resets = <&stgcrg JH7110_STGRST_PCIE1_AXI_MST0>, + <&stgcrg JH7110_STGRST_PCIE1_AXI_SLV0>, + <&stgcrg JH7110_STGRST_PCIE1_AXI_SLV>, + <&stgcrg JH7110_STGRST_PCIE1_BRG>, + <&stgcrg JH7110_STGRST_PCIE1_CORE>, + <&stgcrg JH7110_STGRST_PCIE1_APB>; + reset-names = "mst0", "slv0", "slv", "brg", + "core", "apb"; + status = "disabled"; + + pcie_intc1: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + }; + }; }; };