From patchwork Thu Nov 10 10:35:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 18063 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp67273wru; Thu, 10 Nov 2022 02:41:15 -0800 (PST) X-Google-Smtp-Source: AMsMyM5VAXB4wbOrDlNba09iJqEu2U4mWJkBhkrwtOfEk4GmcI+p2UXqeXeUNoBY/Z2jWFeaIshv X-Received: by 2002:a63:1f5c:0:b0:469:d0e6:dac0 with SMTP id q28-20020a631f5c000000b00469d0e6dac0mr53322273pgm.427.1668076875221; Thu, 10 Nov 2022 02:41:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668076875; cv=none; d=google.com; s=arc-20160816; b=argRM++jywrDgM4rvexp3zOd9cKFh587SQkGU+xL0J57jVfW45JXUQm5iutXWqEUrG 4RJM+C0Qp72wRPYuTvlxTwN9+XgK0IQJox6CX9F0QBY2MP7c1jUk2domKgYxVs3x/jWo yoBVd7WcLtXgBxkh+dl3ed0IQCtrybsfhwxbkYaYvUov6EJDghkguTgMQcpzycs8iUN4 xtSVubaGXL3LJhdkjeccVAnN+J5AxJAvLcyM1D6ptz7U6fyYXXFjp8K26fXWFuWKB1eh 5hY/uCprLwFgNSt5tCc4QaOmcZ0cg/FK8IVnQH5g7LVW2+9xVKMCr3NCRec7etIPmkoA u3nQ== 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=brbZM78MLIkdw5SywJmxg6iweEd7JQAbqtd0gWswQn0=; b=OgxQI21YdXX/uP/50WqNBu8BqjTstieofmG/zI1oIpvV/5C+8bpEqC4qfbQVg16fat eAa9f7bA/ehPsRb5z2CEMdjA9Z3w57V4sqHe3eOQw8xxnZ9K4lUeV1rFQ524fSq6hJ99 vHr6wjYGcfjgqROr4QPaHMzFymPAgNClQ3iAyBXmUnTBevQ4Dow0XOgUIlubFrcssPLX y0BUkkqzzm2hAuiXIkNg7raTsltR62LMtkc90n3pr3jfqofyQPsDhB5sbbNyx8q3B/HN 0UZWHoYzs/3EpMSh8ruTEpA7Yvfc6nVB5cvY3XxW0McVn4be6vhm90S1t2DMOCoPfy4T XtuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="R+fp/y+T"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mi14-20020a17090b4b4e00b00205f6ca05d2si4204890pjb.122.2022.11.10.02.41.00; Thu, 10 Nov 2022 02:41:15 -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=@kernel.org header.s=k20201202 header.b="R+fp/y+T"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229463AbiKJKia (ORCPT + 99 others); Thu, 10 Nov 2022 05:38:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbiKJKiU (ORCPT ); Thu, 10 Nov 2022 05:38:20 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47BC96BDF3; Thu, 10 Nov 2022 02:38:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D57A061245; Thu, 10 Nov 2022 10:38:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0810AC433C1; Thu, 10 Nov 2022 10:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668076698; bh=C6bz8MsErrbu5LEsJFh50cm7/xn/bK8GTPg/1NmRjts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R+fp/y+T7/yvc03bT1G0FoDKYQKv+2e3I0urMj7AyulDiz4N22nWHzb5jr8UTVG9T yWkfHCuGIjF9hKuupFf6z6+7A6YHj4C7ymeWw5C/yV7HhPHmZeI8V4I7vd0smFYZJG hnQAaY7tEWx+GDtivCq2ClVB6YEAJXs9XEuElNoi/cDxtlVmoAvH7yrD/t3QEhFhE1 8DEkPnXH+2bvAlBE3LPcrNfCnme6Xq311fJ7OfjCovDWrz+cCno1tNhI3QyregsqTs zpBkX/we97LTq0spgr/Wyvjpsf9MPf9Roa6cRaTst/Cio71ANfjrcK+6kn+qcukY1z FGxX0b9uX71sg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ot4wQ-0003LR-SM; Thu, 10 Nov 2022 11:37:50 +0100 From: Johan Hovold To: Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 2/9] arm64: dts: qcom: sa8295p-adp: enable PCIe Date: Thu, 10 Nov 2022 11:35:51 +0100 Message-Id: <20221110103558.12690-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221110103558.12690-1-johan+linaro@kernel.org> References: <20221110103558.12690-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749105377554177006?= X-GMAIL-MSGID: =?utf-8?q?1749105377554177006?= The SA8295P-ADP has up to four PCIe interfaces implemented by three or four controllers: PCIe2A, PCIe3A/PCIe3B and PCIe4. PCIe2 is used in x4 mode, while PCIe3 can be used in either x2 or x4 mode. Enable both PCIe3A and PCI3B in x2 mode for now. Signed-off-by: Johan Hovold Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 171 +++++++++++++++++++++++ 1 file changed, 171 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts index b608b82dff03..ff1e6a674913 100644 --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts @@ -57,6 +57,13 @@ vreg_l13a: ldo13 { regulator-max-microvolt = <3072000>; regulator-initial-mode = ; }; + + vreg_l11a: ldo11 { + regulator-name = "vreg_l11a"; + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + regulator-initial-mode = ; + }; }; pmm8540-c-regulators { @@ -151,6 +158,76 @@ vreg_l8g: ldo8 { }; }; +&pcie2a { + perst-gpios = <&tlmm 143 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 145 GPIO_ACTIVE_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&pcie2a_default>; + + status = "okay"; +}; + +&pcie2a_phy { + vdda-phy-supply = <&vreg_l11a>; + vdda-pll-supply = <&vreg_l3a>; + + status = "okay"; +}; + +&pcie3a { + num-lanes = <2>; + + perst-gpios = <&tlmm 151 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 56 GPIO_ACTIVE_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&pcie3a_default>; + + status = "okay"; +}; + +&pcie3a_phy { + vdda-phy-supply = <&vreg_l11a>; + vdda-pll-supply = <&vreg_l3a>; + + status = "okay"; +}; + +&pcie3b { + perst-gpios = <&tlmm 153 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 130 GPIO_ACTIVE_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&pcie3b_default>; + + status = "okay"; +}; + +&pcie3b_phy { + vdda-phy-supply = <&vreg_l11a>; + vdda-pll-supply = <&vreg_l3a>; + + status = "okay"; +}; + +&pcie4 { + perst-gpios = <&tlmm 141 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 139 GPIO_ACTIVE_LOW>; + + pinctrl-names = "default"; + pinctrl-0 = <&pcie4_default>; + + status = "okay"; +}; + +&pcie4_phy { + vdda-phy-supply = <&vreg_l11a>; + vdda-pll-supply = <&vreg_l3a>; + + status = "okay"; +}; + &qup2 { status = "okay"; }; @@ -380,3 +457,97 @@ &xo_board_clk { }; /* PINCTRL */ + +&tlmm { + pcie2a_default: pcie2a-default-state { + clkreq-n-pins { + pins = "gpio142"; + function = "pcie2a_clkreq"; + drive-strength = <2>; + bias-pull-up; + }; + + perst-n-pins { + pins = "gpio143"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + wake-n-pins { + pins = "gpio145"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + pcie3a_default: pcie3a-default-state { + clkreq-n-pins { + pins = "gpio150"; + function = "pcie3a_clkreq"; + drive-strength = <2>; + bias-pull-up; + }; + + perst-n-pins { + pins = "gpio151"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + wake-n-pins { + pins = "gpio56"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + pcie3b_default: pcie3b-default-state { + clkreq-n-pins { + pins = "gpio152"; + function = "pcie3b_clkreq"; + drive-strength = <2>; + bias-pull-up; + }; + + perst-n-pins { + pins = "gpio153"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + wake-n-pins { + pins = "gpio130"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + pcie4_default: pcie4-default-state { + clkreq-n-pins { + pins = "gpio140"; + function = "pcie4_clkreq"; + drive-strength = <2>; + bias-pull-up; + }; + + perst-n-pins { + pins = "gpio141"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + wake-n-pins { + pins = "gpio139"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; +};