From patchwork Thu Dec 1 17:19:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Masney X-Patchwork-Id: 28461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp391620wrr; Thu, 1 Dec 2022 09:32:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf4E3Fy6Stm6ZHb57FsMh/knjQRkoPlSZdgGmncO+sEHDOCZuAsZYTx52sGzUxV+4HCMphU5 X-Received: by 2002:a62:ed03:0:b0:558:99cc:8b40 with SMTP id u3-20020a62ed03000000b0055899cc8b40mr47423774pfh.25.1669915955842; Thu, 01 Dec 2022 09:32:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669915955; cv=none; d=google.com; s=arc-20160816; b=eqn/Em6cag1rnKV57VfzLLo83kHHpjYOQeUklqTP+aq51JQWZf+xOlM/UTnwPsCyVK 4R4hrOJsrrkbbx1e55AvJKdCMMY4rd1B6DRbB04wSijOViaoNlKzNe3qRYmQMZNejgNG CaXmP9SNCShOoeHP0v7TQnZaqmSg5GNG5oKvBl5pWr3/N2fpHU4DpBAmJUBicEflzKad AvAKP2+DPiX+CYKslcnySeS2inoe5hFdTaQICLrMoHYobJ1TlRudRMNHiU5W+WKW/Oko iR4vfEtDpnt3zvhdRlnuDfgxCvuA7BMruAGdL/GseZuLuywIOw2DJxkefH17i7fVqhO0 Q/vA== 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=Qx4tJBDDVJQuTwv5HZkZkSep7aBO8Jt6heDUOx7SfSo=; b=kSHMTn0sT9bnR50PkZWzMmSbdKWrcxZr+b+SbtgaL1eTvjleMl5HoXrpqxwpdN45G4 VSI2GR1RZF48pJbHhFpuzt8pkl5yLd8pLYX0vOn9z40Ht8Vna/iNJYImqIrV50Q84205 c5I6ZU8QzQ4I2KnG/NFm4/D5ZyJBMwQ5BisKmFad5hrjIzkK0LDRgFCsQg6AblbN59n2 bbb4WamH2jdimZUbWr4VgD1th41J2RZtlRi8EqZUgi7di/L/KqSEq5ds229cGtorVO9D x4AIJT96i6KinyFe1Uhn5kyy1LYjKtsmoW0lF2XOBFUlr75fuAJbtCkWcyvUgJNgoImq vEBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XC2L7m8k; 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 h9-20020a17090acf0900b001f31f339134si7924822pju.152.2022.12.01.09.32.22; Thu, 01 Dec 2022 09:32:35 -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=XC2L7m8k; 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 S229650AbiLARUt (ORCPT + 99 others); Thu, 1 Dec 2022 12:20:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230080AbiLARUk (ORCPT ); Thu, 1 Dec 2022 12:20:40 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FF6EAE4C9 for ; Thu, 1 Dec 2022 09:19:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669915182; 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=Qx4tJBDDVJQuTwv5HZkZkSep7aBO8Jt6heDUOx7SfSo=; b=XC2L7m8k6niby6m1dZiF1rYq1gSJSQ5I1p6EuCGNS18L5alQRzVwFQs4Dv3CVvYb+0qEGL x7PmMwqOn4cjyinBfdnwtyU62GxTrlqoLxFQqKAPKO99t25GirOSZIgbVW0h7iHXi904d2 uPZzuu4FSGLBbEBIYQEI2oGsuofsjVs= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-52-ais3_D_1PjmpfNyH57XBNA-1; Thu, 01 Dec 2022 12:19:41 -0500 X-MC-Unique: ais3_D_1PjmpfNyH57XBNA-1 Received: by mail-qv1-f72.google.com with SMTP id 71-20020a0c804d000000b004b2fb260447so6284102qva.10 for ; Thu, 01 Dec 2022 09:19:41 -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=Qx4tJBDDVJQuTwv5HZkZkSep7aBO8Jt6heDUOx7SfSo=; b=X5u7msXXAl2HGZKcPDRpjo+KSFIv79CO7wkFidOx9AQQQKSpxq35myS9pf4J+99SW4 HePJLEgl4FMhgIc89pkE0MAvQr5PJekl+dr1H/ZwZ7t0MwH/aEfPUeMlZFoVksEOV37C wNKnRBS7pbC5wMMrFdU/Mq44SzjI372J3+enLWXB6q9zEwTqYxfP+gUDTqirH3ptUREc 8yFDCSs0WpANhZICBHCZZGUXXsxdXsHRqg4tV4H/qZzO7RacQF8QbOdyWjk7oplALHTU vhFAUR8NXwBGVLvXuZJu4kHl0d67mpn5HdIGM7YSto0kpjRz1Q5kB1ow8c+QFi5b7XhL djqw== X-Gm-Message-State: ANoB5pmsNBDH5D7VtKYZ1iZLD7SilhWaeUSvE/2qx2g+1MTDGh9TBXHs kBHSrBigbzuovXEbIZ0fhehkrXVFvfjNnktbcTUa8xiJwxkREBdIOp+EG/aCGMdDO/Ye6nVU0Ta 4L1gr4uwkrFZG3RZYLYxRoB2w X-Received: by 2002:ac8:6886:0:b0:3a5:f507:8ed4 with SMTP id m6-20020ac86886000000b003a5f5078ed4mr61853831qtq.450.1669915180757; Thu, 01 Dec 2022 09:19:40 -0800 (PST) X-Received: by 2002:ac8:6886:0:b0:3a5:f507:8ed4 with SMTP id m6-20020ac86886000000b003a5f5078ed4mr61853805qtq.450.1669915180485; Thu, 01 Dec 2022 09:19:40 -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 g8-20020a05620a40c800b006f3e6933bacsm545421qko.113.2022.12.01.09.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 09:19:40 -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 v2] arm64: dts: qcom: sa8540p-ride: enable PCIe support Date: Thu, 1 Dec 2022 12:19:31 -0500 Message-Id: <20221201171931.1919961-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=unavailable 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?1751033793325377118?= X-GMAIL-MSGID: =?utf-8?q?1751033793325377118?= 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 --- 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 | 54 +++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts index a5f87a8629d6..e953165f3b73 100644 --- a/arch/arm64/boot/dts/qcom/sa8540p-ride.dts +++ b/arch/arm64/boot/dts/qcom/sa8540p-ride.dts @@ -51,6 +51,14 @@ vreg_l7a: ldo7 { regulator-initial-mode = ; }; + vreg_l11a: ldo11 { + regulator-name = "vreg_l11a"; + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + regulator-initial-mode = ; + regulator-allow-set-load; + }; + vreg_l13a: ldo13 { regulator-name = "vreg_l13a"; regulator-min-microvolt = <3072000>; @@ -139,6 +147,27 @@ vreg_l8g: ldo8 { }; }; +&pcie3a { + ranges = <0x01000000 0x0 0x32200000 0x0 0x32200000 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"; }; @@ -158,6 +187,31 @@ &remoteproc_nsp1 { status = "okay"; }; +&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; + }; + }; +}; + &ufs_mem_hc { reset-gpios = <&tlmm 228 GPIO_ACTIVE_LOW>;