From patchwork Tue Dec 6 16:19:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Masney X-Patchwork-Id: 30428 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2924010wrr; Tue, 6 Dec 2022 08:36:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf6348nlkomttJLiT7hnR+MzSH5+8IbNwZPaPTvR/1Apgb1q0tPD0QcIJG6Mzkbpnt4w0M3i X-Received: by 2002:a05:6402:28ac:b0:46a:b8d0:a052 with SMTP id eg44-20020a05640228ac00b0046ab8d0a052mr45802715edb.399.1670344585347; Tue, 06 Dec 2022 08:36:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670344585; cv=none; d=google.com; s=arc-20160816; b=b6oWKLYc3oNr3TT4kg+EDwunVuTRZimJa6V6GXLc+StRMD3i0563qRjwF42QQGiwTr Jol//HLvlG2BGFpEiiLMbAtOyrZkcBA7FHu4kE42f9vbnhC4So/MnUiUOI9HuwHfvRvK 126PufSgRFZDXPDcz6Z186JC6YMM77EzXc16GUWgU6ZQhibEuYbYxZFd/ycna/WL1ee2 UvzZiZpiZu/cXiEU2wuTNT1oPN/lWk/AEMKLNhjDpalX5omh5BNZkU9kmLRqmY9v4QEM XcMGIKs7SgWvJJa7z0ubigcrxLZIQuU0zcl9suAOD/534DWCiT2ePKxja02M9RFO+Sy3 Djug== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=95B8jA1kUqCpFMTm4ShvxX3NFN/etc7ByfObmPR7SeM=; b=BUoWLrVi1/fICkzW6UP3z99egY5bNIW2vyakinJmkESbPem/U4p+RTgXGAh/cxuxI5 Oti2b81N+DaudVY/JgOkMClrfP3SfBzYsWDXuYHrUf5bVJDHh2QcVi4XW0lS8kdgo3sw VIt0vCHfZNUdsTQlPGBxpkOxQfetBiY2Yaiix90Tz9a9315pFfV3dqnj3MZ9sfMXgNHF 9LvavFD/l4xXzbaDMjy0x/IcklYVc6L7Rv9cb2g61xlBWhnzcliAxD94vWw9M9oyvyH3 9at6lssIbTK2VS7A76nHfA2qEIWoBd4dF3Y6J8dpKaAeMRcZI/CJZd/kFJkvWR3vvkRb JUGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iIxQVo1r; 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=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020a05640226d300b0046b5f810167si2698399edd.279.2022.12.06.08.35.45; Tue, 06 Dec 2022 08:36:25 -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=@redhat.com header.s=mimecast20190719 header.b=iIxQVo1r; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234794AbiLFQVz (ORCPT + 99 others); Tue, 6 Dec 2022 11:21:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233864AbiLFQV3 (ORCPT ); Tue, 6 Dec 2022 11:21:29 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 975DE6148 for ; Tue, 6 Dec 2022 08:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670343572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=95B8jA1kUqCpFMTm4ShvxX3NFN/etc7ByfObmPR7SeM=; b=iIxQVo1r1XWogUKDrK/TfdwBwPx8YZtx6gGPFCOIEhgHSa6iRpOhKgLe6AlGlgLPI/EJEd PRZWYMvPCxYAb8Urdnd4zL/AgR1jQvSMVtzw3WAK8ryprNGX3L/Slii6p1VolM1+1Iz83f 1duVCH0NeWhOGOzog5M2ZM/9qvFvVg4= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-633-k0-fIBQ4N_yeLf5JYKlCCg-1; Tue, 06 Dec 2022 11:19:31 -0500 X-MC-Unique: k0-fIBQ4N_yeLf5JYKlCCg-1 Received: by mail-qt1-f197.google.com with SMTP id cj6-20020a05622a258600b003a519d02f59so34740859qtb.5 for ; Tue, 06 Dec 2022 08:19:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=95B8jA1kUqCpFMTm4ShvxX3NFN/etc7ByfObmPR7SeM=; b=DVsNTZcqsnSwXYabD88q0MynSihJ8Pcc+NFt6aU6WEdSMn4SBoWcibhrQQGMI69U2T 1s4Ze7xgU9kFW+o6EAwSXyTN086KWtPh8cbzC2wouHe2w9lu9h2/QFe6RaGhtOa6IPCt wRIIQoWez7psJvpdQl/couCWaEqpucJ82anYSkWpELri3CVFN8qtv57LI1scnRrrGbXh xeXJqw6cieX+7seC3In6M6Lntn2XtCUYt63pX8QKoIxT0RGKDEfixxIbJzZbee6iDFfh PPd/cdYnmMtZx1RTVZozTqrK4OzgCdeXtvW78cas4Rx9SQqimnt2KNbB0to70Rf4V3RQ c3+g== X-Gm-Message-State: ANoB5pkbhcKElaExDs2Ryx6aSMswA6n+uJPBlNIzqWqLzRGy9cRd/1Em 8qz02g9z+CcmWZFOhaS/gwdm/4U5X3zNPPwuQyrbYjUr9eSaloik6A+ZRgf5H1pdGe3YngZmqM0 YmPOf5sSA1tOIGO6ffWsKb+XI X-Received: by 2002:ac8:7542:0:b0:3a5:c5c1:43ff with SMTP id b2-20020ac87542000000b003a5c5c143ffmr67114673qtr.312.1670343569301; Tue, 06 Dec 2022 08:19:29 -0800 (PST) X-Received: by 2002:ac8:7542:0:b0:3a5:c5c1:43ff with SMTP id b2-20020ac87542000000b003a5c5c143ffmr67114532qtr.312.1670343567557; Tue, 06 Dec 2022 08:19:27 -0800 (PST) Received: from x1.redhat.com (c-73-214-169-22.hsd1.pa.comcast.net. [73.214.169.22]) by smtp.gmail.com with ESMTPSA id d7-20020a05620a240700b006feba101f85sm5883529qkn.13.2022.12.06.08.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 08:19:27 -0800 (PST) From: Brian Masney To: andersson@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: agross@kernel.org, konrad.dybcio@linaro.org, robh+dt@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, quic_shazhuss@quicinc.com, psodagud@quicinc.com, ahalaney@redhat.com, echanude@redhat.com Subject: [PATCH v4] arm64: dts: qcom: sa8540p-ride: enable PCIe support Date: Tue, 6 Dec 2022 11:19:16 -0500 Message-Id: <20221206161916.315640-1-bmasney@redhat.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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?1751483244263935069?= X-GMAIL-MSGID: =?utf-8?q?1751483244263935069?= Add the vreg_l11a, pcie3a, pcie3a_phy, and tlmm nodes that are necessary in order to get PCIe working on the QDrive3. This patch also increases the width of the ranges property for the PCIe switch that's found on this platform. Note that this change requires the latest trustzone (TZ) firmware that's available from Qualcomm as of November 2022. If this is used against a board with the older firmware, then the board will go into ramdump mode when PCIe is probed on startup. The ranges property is overridden in this sa8540p-ride.dts file since this is what's used to describe the QDrive3 variant with dual SoCs. There's another variant of this board that only has a single SoC where this change is not applicable, and hence why this specific change was not done in sa8540p.dtsi. These changes were derived from various patches that Qualcomm delivered to Red Hat in a downstream kernel. Signed-off-by: Brian Masney Tested-by: Andrew Halaney Tested-by: Shazad Hussain --- Changes since v3: - Move tlmm node to bottom of file and add PINCTRL comment (Johan) - Collect Tested-by tags from Andrew and Shazad Changes since v2: - Dropped regulator-allow-set-load (Bjorn) - Updated first member of ranges property to match downstream: s/0x32200000/0x40200000/ (Andrew) Changes since v1: - Add -state and -pins suffixes to tlmm (Krzysztof) This patch depends on the following series that hasn't made it's way into linux-next yet: [PATCH v10 0/2] arm64: dts: qcom: add dts for sa8540p-ride board https://lore.kernel.org/lkml/20221118025158.16902-1-quic_ppareek@quicinc.com/ I can't find the specific TZ firmware version that we have so that's why I included the date instead. arch/arm64/boot/dts/qcom/sa8540p-ride.dts | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts index a5f87a8629d6..bb4afd3a9632 100644 --- a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts +++ b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts @@ -51,6 +51,13 @@ vreg_l7a: ldo7 { regulator-initial-mode = ; }; + vreg_l11a: ldo11 { + regulator-name = "vreg_l11a"; + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + regulator-initial-mode = ; + }; + vreg_l13a: ldo13 { regulator-name = "vreg_l13a"; regulator-min-microvolt = <3072000>; @@ -139,6 +146,27 @@ vreg_l8g: ldo8 { }; }; +&pcie3a { + ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>, + <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x20000000>, + <0x03000000 0x6 0x00000000 0x6 0x00000000 0x2 0x00000000>; + + perst-gpios = <&tlmm 151 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&pcie3a_default>; + + status = "okay"; +}; + +&pcie3a_phy { + vdda-phy-supply = <&vreg_l11a>; + vdda-pll-supply = <&vreg_l3a>; + + status = "okay"; +}; + &qup2 { status = "okay"; }; @@ -215,3 +243,30 @@ &usb_2_qmpphy0 { &xo_board_clk { clock-frequency = <38400000>; }; + +/* PINCTRL */ + +&tlmm { + pcie3a_default: pcie3a-default-state { + perst-pins { + pins = "gpio151"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + clkreq-pins { + pins = "gpio150"; + function = "pcie3a_clkreq"; + drive-strength = <2>; + bias-pull-up; + }; + + wake-pins { + pins = "gpio56"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; +};