From patchwork Wed May 1 04:28:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 13650210 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 D4DB2C19F53 for ; Wed, 1 May 2024 04:29:02 +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=0xPP4o7knwHrx/cp+IiiJ8990Jkf1+iWaTU+kw6JgPs=; b=TW8VZeQhSlrSuC msYeBT4vzR9PDlf/jK3+OWGnMnwrnDBnChUBPKp9rm1OpgPeyEztHzjhsH/Vr552VhuZKzJuIQw86 Nfvq3FZUfmuRew/zOIIzqofezaaXwB5mzy0TBe6jYYU9qu+JwazbRrAVp2eiNEu9tbdVll64hAO7f d/NxC2AWi/6azhzITrxnur5wxmcktrjj13lZZ5XwlkZwADCMD0fFJrtU+7LHNeQ60JPhlmRqxIdZy EnsEVgyJ4Aa6iBJh4w53Wawefx2oPKF0La35c3CuvGVkqD5393YnZsEfPwha7GXfqYc198uNvY+2K KZb3dVgxPxmiq3kG3wCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21aY-00000008XQi-2DYQ; Wed, 01 May 2024 04:29:02 +0000 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21aW-00000008XPQ-0AoO for linux-phy@lists.infradead.org; Wed, 01 May 2024 04:29:01 +0000 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-23d513ea22eso420537fac.0 for ; Tue, 30 Apr 2024 21:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714537737; x=1715142537; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eQII4bd5vU3iEBUOJRNxIf3Y2tkmIxs3qzEGZCMfEv8=; b=lVlrjh5F+8V5+DethMj8nMA56kfYNFR38PYK5LKE4mjpMR4vZxKbU95KMkOgBlceja RQTshkhqAZrPwT23PTJ7Urqf2XpdGku6sIahuEMdXNOcnTCOsXIlRY/KhPMMB+KSSneD rSG7qwSHztUSYJsKA12WagjuC3qyGJGDwPMd8Ez8pKXRiUT6iCJ2FPva4/c4LOdqDP/U FS6H0L51q5xGtuzjKITFZ7W0CCdAZvYPa1lEiRH8aTFe4PPtOpl60IqdwtVj8Sq8Afvy 8k2oMFn6hFIalmf59duTlHEBw+lyGxNqDBYR1/WTXAUo08A4ux20yaR35FiassnY1cy+ lBzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714537737; x=1715142537; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eQII4bd5vU3iEBUOJRNxIf3Y2tkmIxs3qzEGZCMfEv8=; b=XwSe+7bzRf5qKxbmGSwXhhc/l/wpK5WNFUdSIQZal2zfNLKgdmqHxNzgy2YT1o7OMR PG8gj5AG8Um7Bbk2nSTCVgNYvBO91drKzl8Adv2nlM3UjIFbvfpTRwy6WRkoVZ7CfHV0 s+yWF3TqfVq8j/DXIdJCD2jZCaX/as5wbfduES+AkMjmSC4S3/XAD1m9Xx61fWLjtKl5 YBnBPjTiOgNP4E/o0f+OosD9/cZMRMNdlSxuiU4X8c//6Ym0zTO7z7gouRZERsXKybsm 5SiOTOq/0pbQBbCQyXNLQS733cpw5e1u9Mj1FmQ2syH0CbQ5DR5dTU6sZdCSZpGsezgP Dnvw== X-Forwarded-Encrypted: i=1; AJvYcCXRGqesp+SzwNCMQ1QMt+2ypVmrvom202znuf1WeUr5xxTr6oXR8HE+yV8fYPh/yxr4CmrTc66vCRoOE/6AaaqwUBEQJum3DzCbCmYydQ== X-Gm-Message-State: AOJu0Yz5iyMzj4kt8IB5HA9sgghjKP/l+2j001ceR+/1ur46+pGHdHHr wwgVPy+xcotAzxqGUKHLQiBsbnH/CxoN5iJpUo6FwOiOiN44FrD4 X-Google-Smtp-Source: AGHT+IF0dxKW/JwgcvWoMmwvXBPtDjQ9wZTIqZg0eca+QzYjkqbSejIEdI6TQZ632LMaz009pBLE0g== X-Received: by 2002:a05:6870:ec90:b0:22e:8fe3:a9f3 with SMTP id eo16-20020a056870ec9000b0022e8fe3a9f3mr1560608oab.17.1714537737603; Tue, 30 Apr 2024 21:28:57 -0700 (PDT) Received: from nukework.lan (c-98-197-58-203.hsd1.tx.comcast.net. [98.197.58.203]) by smtp.gmail.com with ESMTPSA id do26-20020a0568300e1a00b006ed6dc9fd54sm2719058otb.25.2024.04.30.21.28.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 21:28:57 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org Cc: Alexandru Gagniuc , Krzysztof Kozlowski Subject: [PATCH v4 RESEND 1/8] dt-bindings: clock: Add PCIe pipe related clocks for IPQ9574 Date: Tue, 30 Apr 2024 23:28:40 -0500 Message-Id: <20240501042847.1545145-2-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240501042847.1545145-1-mr.nuke.me@gmail.com> References: <20240501042847.1545145-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_212900_086890_738A91A5 X-CRM114-Status: UNSURE ( 8.23 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add defines for the missing PCIe PIPE clocks. Signed-off-by: Alexandru Gagniuc Acked-by: Krzysztof Kozlowski --- include/dt-bindings/clock/qcom,ipq9574-gcc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/dt-bindings/clock/qcom,ipq9574-gcc.h b/include/dt-bindings/clock/qcom,ipq9574-gcc.h index 08fd3a37acaa..52123c5a09fa 100644 --- a/include/dt-bindings/clock/qcom,ipq9574-gcc.h +++ b/include/dt-bindings/clock/qcom,ipq9574-gcc.h @@ -216,4 +216,8 @@ #define GCC_CRYPTO_AHB_CLK 207 #define GCC_USB0_PIPE_CLK 208 #define GCC_USB0_SLEEP_CLK 209 +#define GCC_PCIE0_PIPE_CLK 210 +#define GCC_PCIE1_PIPE_CLK 211 +#define GCC_PCIE2_PIPE_CLK 212 +#define GCC_PCIE3_PIPE_CLK 213 #endif From patchwork Wed May 1 04:28:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 13650211 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 81458C4345F for ; Wed, 1 May 2024 04:29:04 +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=zc3dBR8XFNiooiAawaG2BppQY+2IE+XEHAGE+zWGrUM=; b=p9o6vBc3mJEvcC z6Qs2wTCqaqFJgPquM1pCryP3sleDzB/WtSg+a0HVNMiGU6owiFQD49aCcJwjsqz9wMQuSIqTGB/M +Ksm9PKIBQFHdLA8/iz1eXIPV/T0lC3hrnrF6aaqHaxOhZ5NS9oS9wOhJT/IEKhxdpLm+lMepOxpR +oc/+Er3qB0dOdU31M1SnJ4gkGAUYB3fkQ+LEnBZQvAJKJBrdW+mJTj1mN1+1CoDgIA4IOzNZXxfJ cV2VppiPJdpXcp38gbRnbPKp0AY9r9No+StnUegeHe20unuMiLsBGmsZ+WFQf8N9jiXrNTagPTvCG 3nuzsvsOkvwqRUt8AjLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21aZ-00000008XRI-3uJq; Wed, 01 May 2024 04:29:03 +0000 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21aW-00000008XPk-4241 for linux-phy@lists.infradead.org; Wed, 01 May 2024 04:29:02 +0000 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6ea2436de79so3386505a34.1 for ; Tue, 30 Apr 2024 21:29:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714537739; x=1715142539; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xzHEIPYot6c8NAo7TIBriZfyyuOfBQrBEKWQMBGEIB8=; b=hBoHQLYozCi9tr2HmtiiwI4jCyzKHykNgjuTd3DRr8cxYFyu0nxzJhPSDGnbJXfd17 nTxHt2YhAnn4kO00B7yVy31wNDp+2Cu77kVCOFfhuSs1xA8MG+Z7kzDHMjhooiwllNoI dy6QoeKRGQ329wUmY2sddNQmtHvodn5vxlVCSRhr3FbMJW+52So2Ldyh5wpEtM+xjmzM NltMWITQkIS1trS2YRUf3oF5hqDBS3RNn1Rk9ZgjAZdMPtcSQIRBem+qLaLOPvyd42ZE vcgLhJkQ65ZWDcr/Io7QCy0BseDXQvLxHDywsLc4QRAQcI9m0jRG1ze31J7VLhIECG4K 2QtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714537739; x=1715142539; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xzHEIPYot6c8NAo7TIBriZfyyuOfBQrBEKWQMBGEIB8=; b=cnjAHIfRizAbItRwwUiqsifAwTRcj5tHBxMYBntGeCIfXFy4fVtzougHgznpRPaovR l5/QyvUshhRtLBeTBJXzg7cC37jATLOVpBF/UYOoNU1504GzpsqHOF73KKoRpZmL7DIK G1sQquzGCDGFC4nencQS5X92auASfypwr8skpVQbHs/uDgeS/L8i6HjGnkgC51sZ1h1Y QJxsAdZl775nTFm9TncDqCR9tZJWRXj4kXZv0KCHjI5rMQsjgAAk+owqEJ1kfTvn6Ht6 zkQvKHbdM2px+HpKptX3AxrYtIbLCFix/unmId/YOWcxyYgWfjQ4nhYIUNDdDnvisdbh QXdg== X-Forwarded-Encrypted: i=1; AJvYcCW9AoDVV4F6T2ZeO7TdfUaWitW74NrliBOkyHC8pgrHjaZgFZjHXfGiXUgU7eeoqwhRov4PeCF2vIukJ4DO/SocO+WzEE6E4Z9PFJpkcQ== X-Gm-Message-State: AOJu0Yztm8GDp/7yy5uLun7xuHt15JCpThBN2FXie9FzgyPbqwU9zngs lsQ6Bk7I+Wwwp0HDHIO8DbdtoWrRBFho45Z+ZWCaUE39U+kvVazU X-Google-Smtp-Source: AGHT+IEmyJf7Jwh5D7YCDTLEYHtmkrkYz3klIOpR6Wwg/J4Mm0QRdxvlC9SkbzpsjHk0Akh0G0kQ3Q== X-Received: by 2002:a05:6871:7409:b0:23c:ed7f:d9d5 with SMTP id nw9-20020a056871740900b0023ced7fd9d5mr1565796oac.35.1714537739302; Tue, 30 Apr 2024 21:28:59 -0700 (PDT) Received: from nukework.lan (c-98-197-58-203.hsd1.tx.comcast.net. [98.197.58.203]) by smtp.gmail.com with ESMTPSA id do26-20020a0568300e1a00b006ed6dc9fd54sm2719058otb.25.2024.04.30.21.28.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 21:28:58 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org Cc: Alexandru Gagniuc , Dmitry Baryshkov Subject: [PATCH v4 RESEND 2/8] clk: qcom: gcc-ipq9574: Add PCIe pipe clocks Date: Tue, 30 Apr 2024 23:28:41 -0500 Message-Id: <20240501042847.1545145-3-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240501042847.1545145-1-mr.nuke.me@gmail.com> References: <20240501042847.1545145-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_212901_015855_029FD4A3 X-CRM114-Status: GOOD ( 10.15 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org The IPQ9574 has four PCIe "pipe" clocks. These clocks are required by PCIe PHYs. Port the pipe clocks from the downstream 5.4 kernel. Signed-off-by: Alexandru Gagniuc Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/gcc-ipq9574.c | 76 ++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/drivers/clk/qcom/gcc-ipq9574.c b/drivers/clk/qcom/gcc-ipq9574.c index 0a3f846695b8..bc3e17f34295 100644 --- a/drivers/clk/qcom/gcc-ipq9574.c +++ b/drivers/clk/qcom/gcc-ipq9574.c @@ -1569,6 +1569,24 @@ static struct clk_regmap_phy_mux pcie0_pipe_clk_src = { }, }; +static struct clk_branch gcc_pcie0_pipe_clk = { + .halt_reg = 0x28044, + .halt_check = BRANCH_HALT_DELAY, + .clkr = { + .enable_reg = 0x28044, + .enable_mask = BIT(0), + .hw.init = &(const struct clk_init_data) { + .name = "gcc_pcie0_pipe_clk", + .parent_hws = (const struct clk_hw *[]) { + &pcie0_pipe_clk_src.clkr.hw + }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + .ops = &clk_branch2_ops, + }, + }, +}; + static struct clk_regmap_phy_mux pcie1_pipe_clk_src = { .reg = 0x29064, .clkr = { @@ -1583,6 +1601,24 @@ static struct clk_regmap_phy_mux pcie1_pipe_clk_src = { }, }; +static struct clk_branch gcc_pcie1_pipe_clk = { + .halt_reg = 0x29044, + .halt_check = BRANCH_HALT_DELAY, + .clkr = { + .enable_reg = 0x29044, + .enable_mask = BIT(0), + .hw.init = &(const struct clk_init_data) { + .name = "gcc_pcie1_pipe_clk", + .parent_hws = (const struct clk_hw *[]) { + &pcie1_pipe_clk_src.clkr.hw + }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + .ops = &clk_branch2_ops, + }, + }, +}; + static struct clk_regmap_phy_mux pcie2_pipe_clk_src = { .reg = 0x2a064, .clkr = { @@ -1597,6 +1633,24 @@ static struct clk_regmap_phy_mux pcie2_pipe_clk_src = { }, }; +static struct clk_branch gcc_pcie2_pipe_clk = { + .halt_reg = 0x2a044, + .halt_check = BRANCH_HALT_DELAY, + .clkr = { + .enable_reg = 0x2a044, + .enable_mask = BIT(0), + .hw.init = &(const struct clk_init_data) { + .name = "gcc_pcie2_pipe_clk", + .parent_hws = (const struct clk_hw *[]) { + &pcie2_pipe_clk_src.clkr.hw + }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + .ops = &clk_branch2_ops, + }, + }, +}; + static struct clk_regmap_phy_mux pcie3_pipe_clk_src = { .reg = 0x2b064, .clkr = { @@ -1611,6 +1665,24 @@ static struct clk_regmap_phy_mux pcie3_pipe_clk_src = { }, }; +static struct clk_branch gcc_pcie3_pipe_clk = { + .halt_reg = 0x2b044, + .halt_check = BRANCH_HALT_DELAY, + .clkr = { + .enable_reg = 0x2b044, + .enable_mask = BIT(0), + .hw.init = &(const struct clk_init_data) { + .name = "gcc_pcie3_pipe_clk", + .parent_hws = (const struct clk_hw *[]) { + &pcie3_pipe_clk_src.clkr.hw + }, + .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, + .ops = &clk_branch2_ops, + }, + }, +}; + static const struct freq_tbl ftbl_pcie_rchng_clk_src[] = { F(24000000, P_XO, 1, 0, 0), F(100000000, P_GPLL0, 8, 0, 0), @@ -4141,6 +4213,10 @@ static struct clk_regmap *gcc_ipq9574_clks[] = { [GCC_SNOC_PCIE1_1LANE_S_CLK] = &gcc_snoc_pcie1_1lane_s_clk.clkr, [GCC_SNOC_PCIE2_2LANE_S_CLK] = &gcc_snoc_pcie2_2lane_s_clk.clkr, [GCC_SNOC_PCIE3_2LANE_S_CLK] = &gcc_snoc_pcie3_2lane_s_clk.clkr, + [GCC_PCIE0_PIPE_CLK] = &gcc_pcie0_pipe_clk.clkr, + [GCC_PCIE1_PIPE_CLK] = &gcc_pcie1_pipe_clk.clkr, + [GCC_PCIE2_PIPE_CLK] = &gcc_pcie2_pipe_clk.clkr, + [GCC_PCIE3_PIPE_CLK] = &gcc_pcie3_pipe_clk.clkr, }; static const struct qcom_reset_map gcc_ipq9574_resets[] = { From patchwork Wed May 1 04:28:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 13650212 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 B22BBC10F1A for ; Wed, 1 May 2024 04:29:06 +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=wP7Vknw9VCc1arShUWqeRY0DLZCyEajhwyooR/ODAjk=; b=0WG/nmA/8+tXBO IWCd4UmfaURTD6B8BUoO4LOjeqZKsK54YivhBegCDLTw22pFP6Dt3ux9a4xgTV2ryW40jaCCJ5eO8 3Mfoxks3Hd/1qygfQzVrQSM0K7gASy8MkDXC0eUjNRUoIcxx2BreAnLbJaQ3TJHLNggWsGYqkhgGV uuZkpMGRcnuPz8pa9lPHACBSm0cpKNwF7D95DDwSCYkfuOX8/aSfYLj8wAUESJeKDzzyOfvHu9WTv Ydutay7OTtScWlvCBO+4fPW/qj6tzD6vpAGMJDpLz1nF3Go9l4OGZQ6e7T7eE51VWgU8sRClMZ/tW qpXW5vICH8DRQEzIsjEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21ac-00000008XSj-1Sk2; Wed, 01 May 2024 04:29:06 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21aY-00000008XQX-2MF5 for linux-phy@lists.infradead.org; Wed, 01 May 2024 04:29:04 +0000 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6ee3231d95eso261787a34.0 for ; Tue, 30 Apr 2024 21:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714537741; x=1715142541; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=53QnHnVF7bqkRAf/NYE3eZQ50tFTHOIRODlZaYfoSVE=; b=NTiHyHk+CFgidi1QpBC6Ky3Siw9hCiQuE78T2pa7Y9xK9Cv5URW2Hy/F53PS0rDg1Z 8yLJz8YZQWby4TkT4Qaa0niyys4YlijF4UZicCl85+ymwuG3Yd0LzjYjGC9g2IrGgTtp lDgiV0E6Mh+kAyW7U/ygp0chUDZyxmACtRM7XAtpuZDaS1GDPwXnrR3czvJrnjzbM92o GIpWp9XoVjRJqDIerKQvtQoTF+J35pj4QL4kfyQYtKRQDTFrWt1reU9uYvS68iE3fLPY f9VdmNvw9vSfjR5qI04PFsBoH3g55twpX/yGN7qFoRFm+jwskiYG0HOkxBSazvVDvk7V MagA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714537741; x=1715142541; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=53QnHnVF7bqkRAf/NYE3eZQ50tFTHOIRODlZaYfoSVE=; b=ZNdZQj3/ZF3GK88tNJ7+EYHgaNYhhtjgD1ZsISpTujmQoTf1Jbq4iKdKTH74WqIcz7 uxQYfAWdV3SWI/bGy7XZ0e6z/z81KsaL02+DTSLg81RJ+MSN2Sx4+ebNYUpkCNh3PLjT CF4DiMpn4nyHnc5jpYL1L57QfpOT7MdKnViXICXFIrpkEnLJPB4mkEFldmtw7Gjic5/E FHYyIuA421uDuOBy4lTLEcHgeMywkjSPF/jHaiKGODiSadmmmfzi0IvuZvRaSSLMhI2h kpFjgwCVj1iGNDMrg+2dktYUDCRq4NXsZscWHCleyVpeqBq8KchUebiB6NX5XVfaonUK zrSw== X-Forwarded-Encrypted: i=1; AJvYcCUdjl7rYdEMVrW/xLjV8el71O8dBh9ZnD1eUgEliOk1wRo2KNThTOUxkpMAxmVguEnCI3WO42hyuIY2eUo2BS6oeB7BrwFO8776RY5Cyg== X-Gm-Message-State: AOJu0YykpAW6gU5QvrulMnKzAVVis/ZRrHQFHZYbGtneb2QZVxaYtoEa KS0RDO7j5pq3AQF30L0G9reumGFvaMaU2IGO89ujKxXoIS/hKi4GvdWh7DscGY0= X-Google-Smtp-Source: AGHT+IGZ6Bq0eAhG/carm/csp8ApgnvJNQUPq/GxvHn40hwIEdBr56IsFv4ZyhDbwV1GMjYFEXYYaQ== X-Received: by 2002:a9d:6e12:0:b0:6ee:1654:c391 with SMTP id e18-20020a9d6e12000000b006ee1654c391mr2064810otr.7.1714537741133; Tue, 30 Apr 2024 21:29:01 -0700 (PDT) Received: from nukework.lan (c-98-197-58-203.hsd1.tx.comcast.net. [98.197.58.203]) by smtp.gmail.com with ESMTPSA id do26-20020a0568300e1a00b006ed6dc9fd54sm2719058otb.25.2024.04.30.21.29.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 21:29:00 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org Cc: Alexandru Gagniuc Subject: [PATCH v4 RESEND 3/8] dt-bindings: PCI: qcom: Add IPQ9574 PCIe controller Date: Tue, 30 Apr 2024 23:28:42 -0500 Message-Id: <20240501042847.1545145-4-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240501042847.1545145-1-mr.nuke.me@gmail.com> References: <20240501042847.1545145-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_212902_632846_57222A75 X-CRM114-Status: UNSURE ( 8.63 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org IPQ9574 has PCIe controllers which are almost identical to IPQ6018. The difference is that the "iface" clock is replaced by the "snoc", and "anoc". The "sleep" reset is replaced by an "aux" reset. Document these differences along with the compatible string. Signed-off-by: Alexandru Gagniuc Acked-by: Rob Herring (Arm) --- .../devicetree/bindings/pci/qcom,pcie.yaml | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie.yaml index cf9a6910b542..ac6d2b1b8702 100644 --- a/Documentation/devicetree/bindings/pci/qcom,pcie.yaml +++ b/Documentation/devicetree/bindings/pci/qcom,pcie.yaml @@ -26,6 +26,7 @@ properties: - qcom,pcie-ipq8064-v2 - qcom,pcie-ipq8074 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 - qcom,pcie-msm8996 - qcom,pcie-qcs404 - qcom,pcie-sdm845 @@ -161,6 +162,7 @@ allOf: enum: - qcom,pcie-ipq6018 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 then: properties: reg: @@ -397,6 +399,39 @@ allOf: - const: axi_m_sticky # AXI Master Sticky reset - const: axi_s_sticky # AXI Slave Sticky reset + - if: + properties: + compatible: + contains: + enum: + - qcom,pcie-ipq9574 + then: + properties: + clocks: + minItems: 4 + maxItems: 4 + clock-names: + items: + - const: axi_m # AXI Master clock + - const: axi_s # AXI Slave clock + - const: axi_bridge # AXI bridge clock + - const: anoc + - const: snoc + - const: rchng + resets: + minItems: 8 + maxItems: 8 + reset-names: + items: + - const: pipe # PIPE reset + - const: aux # AUX reset + - const: sticky # Core Sticky reset + - const: axi_m # AXI Master reset + - const: axi_s # AXI Slave reset + - const: axi_s_sticky # AXI Slave Sticky reset + - const: axi_m_sticky # AXI Master Sticky reset + - const: ahb # AHB Reset + - if: properties: compatible: @@ -507,6 +542,7 @@ allOf: - qcom,pcie-ipq8064v2 - qcom,pcie-ipq8074 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 - qcom,pcie-qcs404 then: required: @@ -566,6 +602,7 @@ allOf: - qcom,pcie-ipq8064-v2 - qcom,pcie-ipq8074 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 - qcom,pcie-qcs404 then: properties: From patchwork Wed May 1 04:28:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 13650213 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 56542C4345F for ; Wed, 1 May 2024 04:29:08 +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=aRmCpdKSemozTexLsj3a9YYluj/2yFSJHUI1Z5Xv/dU=; b=QIY+97Xo0jI/GA b4+nqvVnUxYl4EGDQ6Upwku5jpkK8nBMQCg1GYL/CHe5mkXbTSkdjfwTgZxs2cH31IFtAqOyZGXYk pwLf+uOvxIhH7f1B0phiAuRFibV5kSLC+zXailghMwas1/dwA3nQzjTeysPcC+41CbhRLgHAFveCz klkH/c0FYUnsJZ21Quful7tB56DUNzTVzv5agy3lHZWBCebU6NFdnLaj9wFY6Uo5eY6epHTVzrhxt /TYfpzBrfBhOeBKZUNipIkyHf35BASRsUD4Wh9dfZomCrAVoioCCzUyHOMShd07PhDB0J4kkZmqDi HlL0Wc7IQkRP6/RaINtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21ad-00000008XTU-3mZS; Wed, 01 May 2024 04:29:07 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21ab-00000008XRH-0JZ8 for linux-phy@lists.infradead.org; Wed, 01 May 2024 04:29:06 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6ee575da779so1214988a34.2 for ; Tue, 30 Apr 2024 21:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714537743; x=1715142543; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rKfzhKYKdzfcfGJdATuhwe4qCNYS9PL4DLkhaYC5y3s=; b=TE1da+2eC0u6TlYM+fm8bU9fQmUirPHekCbWG66PSWKNde3AWq0JBnMzHpHvJCPxWg Fsw9DklKf2+1AN3eFn7FeLmWyGt/TGKr6oVsgal9L4csx7h5vpOz2DdSi5JMekf9e27n LSIlJnMT813uFyhtlMyCnzHWTkTseOxm09TORxqbOJiItACwVPLVojq/qfhinR0+EK+R wU6acnVsFbgeNvVvv9G1PYGWO6NAQzcUjZ3iU1BCFNsJ7QQ9kKcPiRUkT+xNQeMaGKnB c4hBE7l3IZXocG4xG78t6OvY1rGgSy4iQRbrsMzTlh3DZobhFMiDT82fHD7Yo2n2oVOw RRHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714537743; x=1715142543; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rKfzhKYKdzfcfGJdATuhwe4qCNYS9PL4DLkhaYC5y3s=; b=U61Ocp1hjZNYAoJ7ztDWOzPYVcDosfcwr/SWnHepwTgkx935IY37Sl0bQ9zCyT3bwW H58yGDGHb+1QoKr3WiJr/8ZMrpuCeuSqG3V2ZrMeg+GevX319U5L+M/sCY4kKgaJx5gv 7eipPb4CtFJdx75gokCF/IzAmwZ28CibbQuBe5WAabzW74wMgU2LChZaaEA6IFPwwdHe OsfT/2qv1imXRPs7476ijrzqlLlx/N/dGlhiUoosDUpB5B22FylLi8lGwrb2lMmpEXxV fALacJCE8DOKIBuqP5fsaciDi6WomY+EwuuIBl3+zfADDORALLL8ZfUrCkOsvc5mdJ6p XuLg== X-Forwarded-Encrypted: i=1; AJvYcCVoiiFxAXMbpSto4ACdabiHGQtyOQpo2LaLSjAu4CeliH3ESgGrVYvFMZQ5TePZyMrBz/i+ObFgY6av8q+Fl0YPoIRW2r5ToO3Ww7tYAg== X-Gm-Message-State: AOJu0YwVEjZuIIZhAQZbaHefnXxB6VxP4Fp7HcmpMMG24PNG4VlFIQoA KOAgIWcT8MGUdIqCzOPpeROCNo9/7vP7+8YROEXTpcMCU57+In+j X-Google-Smtp-Source: AGHT+IHFrczqlpCVGGQpIxs3o+EQjBK5qfRb76vNvMWCRqog+pDH+KQ7V8q7hfV2QawSTqaoyhMbiw== X-Received: by 2002:a05:6830:e89:b0:6ee:627e:dd93 with SMTP id dp9-20020a0568300e8900b006ee627edd93mr1432775otb.16.1714537743115; Tue, 30 Apr 2024 21:29:03 -0700 (PDT) Received: from nukework.lan (c-98-197-58-203.hsd1.tx.comcast.net. [98.197.58.203]) by smtp.gmail.com with ESMTPSA id do26-20020a0568300e1a00b006ed6dc9fd54sm2719058otb.25.2024.04.30.21.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 21:29:02 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org Cc: Alexandru Gagniuc Subject: [PATCH v4 RESEND 4/8] PCI: qcom: Switch to devm_clk_bulk_get_all() API to get the clocks from Devicetree Date: Tue, 30 Apr 2024 23:28:43 -0500 Message-Id: <20240501042847.1545145-5-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240501042847.1545145-1-mr.nuke.me@gmail.com> References: <20240501042847.1545145-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_212905_127182_4EADDF2C X-CRM114-Status: GOOD ( 18.34 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Manivannan Sadhasivam There is no need for the device drivers to validate the clocks defined in Devicetree. The validation should be performed by the DT schema and the drivers should just get all the clocks from DT. Right now the driver hardcodes the clock info and validates them against DT which is redundant. So use devm_clk_bulk_get_all() that just gets all the clocks defined in DT and get rid of all static clocks info from the driver. This simplifies the driver. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Alexandru Gagniuc [moved clks to struct qcom_pcie to reduce code duplication] --- drivers/pci/controller/dwc/pcie-qcom.c | 163 ++++--------------------- 1 file changed, 25 insertions(+), 138 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 14772edcf0d3..ea81ff68d433 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -154,58 +154,42 @@ #define QCOM_PCIE_LINK_SPEED_TO_BW(speed) \ Mbps_to_icc(PCIE_SPEED2MBS_ENC(pcie_link_speed[speed])) -#define QCOM_PCIE_1_0_0_MAX_CLOCKS 4 struct qcom_pcie_resources_1_0_0 { - struct clk_bulk_data clks[QCOM_PCIE_1_0_0_MAX_CLOCKS]; struct reset_control *core; struct regulator *vdda; }; -#define QCOM_PCIE_2_1_0_MAX_CLOCKS 5 #define QCOM_PCIE_2_1_0_MAX_RESETS 6 #define QCOM_PCIE_2_1_0_MAX_SUPPLY 3 struct qcom_pcie_resources_2_1_0 { - struct clk_bulk_data clks[QCOM_PCIE_2_1_0_MAX_CLOCKS]; struct reset_control_bulk_data resets[QCOM_PCIE_2_1_0_MAX_RESETS]; int num_resets; struct regulator_bulk_data supplies[QCOM_PCIE_2_1_0_MAX_SUPPLY]; }; -#define QCOM_PCIE_2_3_2_MAX_CLOCKS 4 #define QCOM_PCIE_2_3_2_MAX_SUPPLY 2 struct qcom_pcie_resources_2_3_2 { - struct clk_bulk_data clks[QCOM_PCIE_2_3_2_MAX_CLOCKS]; struct regulator_bulk_data supplies[QCOM_PCIE_2_3_2_MAX_SUPPLY]; }; -#define QCOM_PCIE_2_3_3_MAX_CLOCKS 5 #define QCOM_PCIE_2_3_3_MAX_RESETS 7 struct qcom_pcie_resources_2_3_3 { - struct clk_bulk_data clks[QCOM_PCIE_2_3_3_MAX_CLOCKS]; struct reset_control_bulk_data rst[QCOM_PCIE_2_3_3_MAX_RESETS]; }; -#define QCOM_PCIE_2_4_0_MAX_CLOCKS 4 #define QCOM_PCIE_2_4_0_MAX_RESETS 12 struct qcom_pcie_resources_2_4_0 { - struct clk_bulk_data clks[QCOM_PCIE_2_4_0_MAX_CLOCKS]; - int num_clks; struct reset_control_bulk_data resets[QCOM_PCIE_2_4_0_MAX_RESETS]; int num_resets; }; -#define QCOM_PCIE_2_7_0_MAX_CLOCKS 15 #define QCOM_PCIE_2_7_0_MAX_SUPPLIES 2 struct qcom_pcie_resources_2_7_0 { - struct clk_bulk_data clks[QCOM_PCIE_2_7_0_MAX_CLOCKS]; - int num_clks; struct regulator_bulk_data supplies[QCOM_PCIE_2_7_0_MAX_SUPPLIES]; struct reset_control *rst; }; -#define QCOM_PCIE_2_9_0_MAX_CLOCKS 5 struct qcom_pcie_resources_2_9_0 { - struct clk_bulk_data clks[QCOM_PCIE_2_9_0_MAX_CLOCKS]; struct reset_control *rst; }; @@ -247,6 +231,8 @@ struct qcom_pcie { struct icc_path *icc_mem; const struct qcom_pcie_cfg *cfg; struct dentry *debugfs; + struct clk_bulk_data *clks; + int num_clks; bool suspended; }; @@ -337,22 +323,6 @@ static int qcom_pcie_get_resources_2_1_0(struct qcom_pcie *pcie) if (ret) return ret; - res->clks[0].id = "iface"; - res->clks[1].id = "core"; - res->clks[2].id = "phy"; - res->clks[3].id = "aux"; - res->clks[4].id = "ref"; - - /* iface, core, phy are required */ - ret = devm_clk_bulk_get(dev, 3, res->clks); - if (ret < 0) - return ret; - - /* aux, ref are optional */ - ret = devm_clk_bulk_get_optional(dev, 2, res->clks + 3); - if (ret < 0) - return ret; - res->resets[0].id = "pci"; res->resets[1].id = "axi"; res->resets[2].id = "ahb"; @@ -373,7 +343,7 @@ static void qcom_pcie_deinit_2_1_0(struct qcom_pcie *pcie) { struct qcom_pcie_resources_2_1_0 *res = &pcie->res.v2_1_0; - clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); + clk_bulk_disable_unprepare(pcie->num_clks, pcie->clks); reset_control_bulk_assert(res->num_resets, res->resets); writel(1, pcie->parf + PARF_PHY_CTRL); @@ -413,7 +383,6 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie) static int qcom_pcie_post_init_2_1_0(struct qcom_pcie *pcie) { - struct qcom_pcie_resources_2_1_0 *res = &pcie->res.v2_1_0; struct dw_pcie *pci = pcie->pci; struct device *dev = pci->dev; struct device_node *node = dev->of_node; @@ -425,7 +394,7 @@ static int qcom_pcie_post_init_2_1_0(struct qcom_pcie *pcie) val &= ~PHY_TEST_PWR_DOWN; writel(val, pcie->parf + PARF_PHY_CTRL); - ret = clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); + ret = clk_bulk_prepare_enable(pcie->num_clks, pcie->clks); if (ret) return ret; @@ -476,21 +445,11 @@ static int qcom_pcie_get_resources_1_0_0(struct qcom_pcie *pcie) struct qcom_pcie_resources_1_0_0 *res = &pcie->res.v1_0_0; struct dw_pcie *pci = pcie->pci; struct device *dev = pci->dev; - int ret; res->vdda = devm_regulator_get(dev, "vdda"); if (IS_ERR(res->vdda)) return PTR_ERR(res->vdda); - res->clks[0].id = "iface"; - res->clks[1].id = "aux"; - res->clks[2].id = "master_bus"; - res->clks[3].id = "slave_bus"; - - ret = devm_clk_bulk_get(dev, ARRAY_SIZE(res->clks), res->clks); - if (ret < 0) - return ret; - res->core = devm_reset_control_get_exclusive(dev, "core"); return PTR_ERR_OR_ZERO(res->core); } @@ -500,7 +459,7 @@ static void qcom_pcie_deinit_1_0_0(struct qcom_pcie *pcie) struct qcom_pcie_resources_1_0_0 *res = &pcie->res.v1_0_0; reset_control_assert(res->core); - clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); + clk_bulk_disable_unprepare(pcie->num_clks, pcie->clks); regulator_disable(res->vdda); } @@ -517,7 +476,7 @@ static int qcom_pcie_init_1_0_0(struct qcom_pcie *pcie) return ret; } - ret = clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); + ret = clk_bulk_prepare_enable(pcie->num_clks, pcie->clks); if (ret) { dev_err(dev, "cannot prepare/enable clocks\n"); goto err_assert_reset; @@ -532,7 +491,7 @@ static int qcom_pcie_init_1_0_0(struct qcom_pcie *pcie) return 0; err_disable_clks: - clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); + clk_bulk_disable_unprepare(pcie->num_clks, pcie->clks); err_assert_reset: reset_control_assert(res->core); @@ -580,15 +539,6 @@ static int qcom_pcie_get_resources_2_3_2(struct qcom_pcie *pcie) if (ret) return ret; - res->clks[0].id = "aux"; - res->clks[1].id = "cfg"; - res->clks[2].id = "bus_master"; - res->clks[3].id = "bus_slave"; - - ret = devm_clk_bulk_get(dev, ARRAY_SIZE(res->clks), res->clks); - if (ret < 0) - return ret; - return 0; } @@ -596,7 +546,7 @@ static void qcom_pcie_deinit_2_3_2(struct qcom_pcie *pcie) { struct qcom_pcie_resources_2_3_2 *res = &pcie->res.v2_3_2; - clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); + clk_bulk_disable_unprepare(pcie->num_clks, pcie->clks); regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); } @@ -613,7 +563,7 @@ static int qcom_pcie_init_2_3_2(struct qcom_pcie *pcie) return ret; } - ret = clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); + ret = clk_bulk_prepare_enable(pcie->num_clks, pcie->clks); if (ret) { dev_err(dev, "cannot prepare/enable clocks\n"); regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); @@ -661,18 +611,6 @@ static int qcom_pcie_get_resources_2_4_0(struct qcom_pcie *pcie) bool is_ipq = of_device_is_compatible(dev->of_node, "qcom,pcie-ipq4019"); int ret; - res->clks[0].id = "aux"; - res->clks[1].id = "master_bus"; - res->clks[2].id = "slave_bus"; - res->clks[3].id = "iface"; - - /* qcom,pcie-ipq4019 is defined without "iface" */ - res->num_clks = is_ipq ? 3 : 4; - - ret = devm_clk_bulk_get(dev, res->num_clks, res->clks); - if (ret < 0) - return ret; - res->resets[0].id = "axi_m"; res->resets[1].id = "axi_s"; res->resets[2].id = "axi_m_sticky"; @@ -700,7 +638,7 @@ static void qcom_pcie_deinit_2_4_0(struct qcom_pcie *pcie) struct qcom_pcie_resources_2_4_0 *res = &pcie->res.v2_4_0; reset_control_bulk_assert(res->num_resets, res->resets); - clk_bulk_disable_unprepare(res->num_clks, res->clks); + clk_bulk_disable_unprepare(pcie->num_clks, pcie->clks); } static int qcom_pcie_init_2_4_0(struct qcom_pcie *pcie) @@ -726,7 +664,7 @@ static int qcom_pcie_init_2_4_0(struct qcom_pcie *pcie) usleep_range(10000, 12000); - ret = clk_bulk_prepare_enable(res->num_clks, res->clks); + ret = clk_bulk_prepare_enable(pcie->num_clks, pcie->clks); if (ret) { reset_control_bulk_assert(res->num_resets, res->resets); return ret; @@ -742,16 +680,6 @@ static int qcom_pcie_get_resources_2_3_3(struct qcom_pcie *pcie) struct device *dev = pci->dev; int ret; - res->clks[0].id = "iface"; - res->clks[1].id = "axi_m"; - res->clks[2].id = "axi_s"; - res->clks[3].id = "ahb"; - res->clks[4].id = "aux"; - - ret = devm_clk_bulk_get(dev, ARRAY_SIZE(res->clks), res->clks); - if (ret < 0) - return ret; - res->rst[0].id = "axi_m"; res->rst[1].id = "axi_s"; res->rst[2].id = "pipe"; @@ -769,9 +697,7 @@ static int qcom_pcie_get_resources_2_3_3(struct qcom_pcie *pcie) static void qcom_pcie_deinit_2_3_3(struct qcom_pcie *pcie) { - struct qcom_pcie_resources_2_3_3 *res = &pcie->res.v2_3_3; - - clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); + clk_bulk_disable_unprepare(pcie->num_clks, pcie->clks); } static int qcom_pcie_init_2_3_3(struct qcom_pcie *pcie) @@ -801,7 +727,7 @@ static int qcom_pcie_init_2_3_3(struct qcom_pcie *pcie) */ usleep_range(2000, 2500); - ret = clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); + ret = clk_bulk_prepare_enable(pcie->num_clks, pcie->clks); if (ret) { dev_err(dev, "cannot prepare/enable clocks\n"); goto err_assert_resets; @@ -862,8 +788,6 @@ static int qcom_pcie_get_resources_2_7_0(struct qcom_pcie *pcie) struct qcom_pcie_resources_2_7_0 *res = &pcie->res.v2_7_0; struct dw_pcie *pci = pcie->pci; struct device *dev = pci->dev; - unsigned int num_clks, num_opt_clks; - unsigned int idx; int ret; res->rst = devm_reset_control_array_get_exclusive(dev); @@ -877,37 +801,6 @@ static int qcom_pcie_get_resources_2_7_0(struct qcom_pcie *pcie) if (ret) return ret; - idx = 0; - res->clks[idx++].id = "aux"; - res->clks[idx++].id = "cfg"; - res->clks[idx++].id = "bus_master"; - res->clks[idx++].id = "bus_slave"; - res->clks[idx++].id = "slave_q2a"; - - num_clks = idx; - - ret = devm_clk_bulk_get(dev, num_clks, res->clks); - if (ret < 0) - return ret; - - res->clks[idx++].id = "tbu"; - res->clks[idx++].id = "ddrss_sf_tbu"; - res->clks[idx++].id = "aggre0"; - res->clks[idx++].id = "aggre1"; - res->clks[idx++].id = "noc_aggr"; - res->clks[idx++].id = "noc_aggr_4"; - res->clks[idx++].id = "noc_aggr_south_sf"; - res->clks[idx++].id = "cnoc_qx"; - res->clks[idx++].id = "sleep"; - res->clks[idx++].id = "cnoc_sf_axi"; - - num_opt_clks = idx - num_clks; - res->num_clks = idx; - - ret = devm_clk_bulk_get_optional(dev, num_opt_clks, res->clks + num_clks); - if (ret < 0) - return ret; - return 0; } @@ -925,7 +818,7 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie) return ret; } - ret = clk_bulk_prepare_enable(res->num_clks, res->clks); + ret = clk_bulk_prepare_enable(pcie->num_clks, pcie->clks); if (ret < 0) goto err_disable_regulators; @@ -977,7 +870,7 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie) return 0; err_disable_clocks: - clk_bulk_disable_unprepare(res->num_clks, res->clks); + clk_bulk_disable_unprepare(pcie->num_clks, pcie->clks); err_disable_regulators: regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); @@ -1015,7 +908,7 @@ static void qcom_pcie_deinit_2_7_0(struct qcom_pcie *pcie) { struct qcom_pcie_resources_2_7_0 *res = &pcie->res.v2_7_0; - clk_bulk_disable_unprepare(res->num_clks, res->clks); + clk_bulk_disable_unprepare(pcie->num_clks, pcie->clks); regulator_bulk_disable(ARRAY_SIZE(res->supplies), res->supplies); } @@ -1101,17 +994,6 @@ static int qcom_pcie_get_resources_2_9_0(struct qcom_pcie *pcie) struct qcom_pcie_resources_2_9_0 *res = &pcie->res.v2_9_0; struct dw_pcie *pci = pcie->pci; struct device *dev = pci->dev; - int ret; - - res->clks[0].id = "iface"; - res->clks[1].id = "axi_m"; - res->clks[2].id = "axi_s"; - res->clks[3].id = "axi_bridge"; - res->clks[4].id = "rchng"; - - ret = devm_clk_bulk_get(dev, ARRAY_SIZE(res->clks), res->clks); - if (ret < 0) - return ret; res->rst = devm_reset_control_array_get_exclusive(dev); if (IS_ERR(res->rst)) @@ -1122,9 +1004,7 @@ static int qcom_pcie_get_resources_2_9_0(struct qcom_pcie *pcie) static void qcom_pcie_deinit_2_9_0(struct qcom_pcie *pcie) { - struct qcom_pcie_resources_2_9_0 *res = &pcie->res.v2_9_0; - - clk_bulk_disable_unprepare(ARRAY_SIZE(res->clks), res->clks); + clk_bulk_disable_unprepare(pcie->num_clks, pcie->clks); } static int qcom_pcie_init_2_9_0(struct qcom_pcie *pcie) @@ -1153,7 +1033,7 @@ static int qcom_pcie_init_2_9_0(struct qcom_pcie *pcie) usleep_range(2000, 2500); - return clk_bulk_prepare_enable(ARRAY_SIZE(res->clks), res->clks); + return clk_bulk_prepare_enable(pcie->num_clks, pcie->clks); } static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) @@ -1561,6 +1441,13 @@ static int qcom_pcie_probe(struct platform_device *pdev) goto err_pm_runtime_put; } + pcie->num_clks = devm_clk_bulk_get_all(dev, &pcie->clks); + if (pcie->num_clks < 0) { + ret = pcie->num_clks; + dev_err(dev, "Failed to get clocks\n"); + goto err_pm_runtime_put; + } + ret = qcom_pcie_icc_init(pcie); if (ret) goto err_pm_runtime_put; From patchwork Wed May 1 04:28:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 13650214 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 B69A8C10F1A for ; Wed, 1 May 2024 04:29:10 +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=phAb1vlIE+cAsoC5/Bn4ez+5nU30KkrvtIhYkayJ4pY=; b=TnXOeT7Ho0WJY8 R3JBAXm760HUFpfEOlxtADO9K2D2lADylPFrMZQOKMhj4FZfDJ+UL5eR5Hlz5HJT++EEQ4+HG1ddT l18LXRTSZUPS5uVoycwrAvkWe8YqYjlLQqjmt1VLks9niA59cJNkXajd/g4M6zqkL0XKoHvsDX08A kRspDjz2/gsOZj8ZrxzXNG/cXxqxlv+RVuNTfmUa9XWWcJD/S1DrHguv4rVQNeOiXI1aOB1pppvE4 usMqUm3iUk2NOQgTFuv3e90am3b1LDrZ98psV/gDalgEDO1NmoLlwp0MKP8WPvyZ6pNvuDt53xynE dq6++4JgO0XkVcGd5Xnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21ag-00000008XUc-1iYG; Wed, 01 May 2024 04:29:10 +0000 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21ab-00000008XRx-26VC for linux-phy@lists.infradead.org; Wed, 01 May 2024 04:29:07 +0000 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6ea2ac4607aso3346189a34.3 for ; Tue, 30 Apr 2024 21:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714537745; x=1715142545; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SI71NoupknAET1jl5DuELYiP8ivpPOCBg6fYut4RUIg=; b=Hz0ZhI8QGs4tciE7aQVEHHGkuTu8jSF1wMiytQaEEnQcpt6UDRNh4pfXpAGQ9FePrs H5fQ1JPB3ET/YxfE5Wl6dFBUFnBYoiwCyKzmvvn0Y+k1pekECVqRO5/UkIzjBj8CsTux p2XiuK4ZjmzJ/nxV6GgPn1B8ztZnLR9LGQVbVPprd4yl+ST8GFGJFybc6MojybhkGWtG L88LLNqPLZ/t5bpRs2mA62vsoDSco+oWYA4XL7eqDuq9x4yA5RzXcQ/ZovQb2g6kkrxh nJZSrflrsgseN+C/JLdaOQX/Z1kpA3kj8/QxjkCvWEdmcgaQDo3W2+Yk3bxWnADDdn9d prKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714537745; x=1715142545; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SI71NoupknAET1jl5DuELYiP8ivpPOCBg6fYut4RUIg=; b=TOsUiqIwFgb7LzNBVjbC927hZWI9ymGFk+UpALSbG9iPkJUMUi/htVhaqzdCxgbxsk dMBwJrdNHXsoNaZanTy3k0a8/ZWG+AGRi++up3+qEml1vZuXuT4eDzdBYf/Z/XaOuJo3 I+pD4eaGlLgU2jk4KwCiBkNjya2CyObrmdzCakgitIU51cN8Hs5U24brBcbQlDr4tVOS dyfiHuPLfUnz3UDR4hJJsFMrqkTca20+bwJuhWE67c4jvqU+nsd5oMCzMypwZh52hRLQ 09Q9p650iaFQRkT4fNYJmfIHn4Y9G9t0Dwix+Bge9LRK0woazJcDweUEE3ubNtsA1v2d FAJA== X-Forwarded-Encrypted: i=1; AJvYcCVVhcjxeo5TRZ0tQDWAL39OAVkR+mpVlAs91FyyIX1SBy9fcdtaGtHJfvP4wkqXSgoBXLF0DgnpFOzDEcf6GEVZq4sYAu9lAdWzt8MuuQ== X-Gm-Message-State: AOJu0YwMf1lhmoyeblOqr6IjNZFAwiEDyLp+3pcRGyHjjVBLCeyYqbEN 2mRd3v3ZgdDyuwSKGgu97YuoTPOhaJjPwgDi6L8KTgUGNwFNVL6z X-Google-Smtp-Source: AGHT+IEW5WaGUfL+JvzpQNeZs7pi6YqdiUbKAaXYvweRc4MKw+/bkLFotYWyiDTa1oMgCa3JbZcsBQ== X-Received: by 2002:a05:6830:12da:b0:6eb:e1ba:6645 with SMTP id a26-20020a05683012da00b006ebe1ba6645mr1695409otq.3.1714537744803; Tue, 30 Apr 2024 21:29:04 -0700 (PDT) Received: from nukework.lan (c-98-197-58-203.hsd1.tx.comcast.net. [98.197.58.203]) by smtp.gmail.com with ESMTPSA id do26-20020a0568300e1a00b006ed6dc9fd54sm2719058otb.25.2024.04.30.21.29.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 21:29:04 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org Cc: Alexandru Gagniuc Subject: [PATCH v4 RESEND 5/8] PCI: qcom: Add support for IPQ9574 Date: Tue, 30 Apr 2024 23:28:44 -0500 Message-Id: <20240501042847.1545145-6-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240501042847.1545145-1-mr.nuke.me@gmail.com> References: <20240501042847.1545145-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_212905_564004_C2330503 X-CRM114-Status: GOOD ( 11.09 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org IPQ9574 has four PCIe controllers: two single-lane Gen3, and two dual-lane Gen3. The controllers are identical from a software perspective, with the differences appearing in the PHYs. Add a compatible for the PCIe on IPQ9574. Signed-off-by: Alexandru Gagniuc Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pcie-qcom.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index ea81ff68d433..e61888e6c63d 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -1551,6 +1551,7 @@ static const struct of_device_id qcom_pcie_match[] = { { .compatible = "qcom,pcie-ipq8064-v2", .data = &cfg_2_1_0 }, { .compatible = "qcom,pcie-ipq8074", .data = &cfg_2_3_3 }, { .compatible = "qcom,pcie-ipq8074-gen3", .data = &cfg_2_9_0 }, + { .compatible = "qcom,pcie-ipq9574", .data = &cfg_2_9_0 }, { .compatible = "qcom,pcie-msm8996", .data = &cfg_2_3_2 }, { .compatible = "qcom,pcie-qcs404", .data = &cfg_2_4_0 }, { .compatible = "qcom,pcie-sa8540p", .data = &cfg_sc8280xp }, From patchwork Wed May 1 04:28:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 13650215 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 3B09CC4345F for ; Wed, 1 May 2024 04:29:11 +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=UilHA5x8l6aAZH7kqACMsAi2u9Zubi0T6Ohp7M4Xjtc=; b=cOK6gn8oshbcz4 l3knfX+C2lqiJ33Hn8BYyq+LW7Zo5k3DORrfQHy8vHn/WFOJhBWcOuWK1vDUBXeLHmOTrMbFcVXOt 0g0YFWtjSnww3d82NIRQNXFPaA4ob+1+g3UoOag1RxE40tUbrEN+D5IBgc077AFlR7JFGzirU5U12 k2h9XdVSIY9KmERgrGHByRtfhxp5SQqFpBDcOBNW9YGLNr2XC+ajFcG6ubzSU5nUg9uWgXP8n0Pts CJPZOECh6l+MwPpX62oBKP98Dr0EW4FszyaqLsdAmD6o43RGKLENs8AXPnqlyK4I4cuu874AK21Uw DLJoJmcVV3o4x0t9mPZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21ag-00000008XUx-3E0b; Wed, 01 May 2024 04:29:10 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21ad-00000008XT9-3Pv5 for linux-phy@lists.infradead.org; Wed, 01 May 2024 04:29:09 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-23d41245bd9so488600fac.2 for ; Tue, 30 Apr 2024 21:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714537746; x=1715142546; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ghcu5svxDDMwf9Ya6V/1d6nG/9vm8dM7H011zLAoFaA=; b=QzscovOG5hnlqy7WCu/0V3+docnjhkgdjRaLllwFyKA1qf1njg0rhbWcC+p/JqaZT7 wuzdR5kDB8EJjAgcBS8KiYwWke5vXwm7hqcQ58KiUdbK+N7GoOmieJBq77mjuEMjjYiv b0afJJg+nMGcmfVMXBHqDWgBWKb+/X6eFRh/JVfMtsiXEeQabcOqyLfRQqIk6HYWVI0v r96N/D5TC3PwrW02Zo3MPGoAYZHrew7QyR1lR588hXLJ6+rYfpNjHjP7AQb5uAdbefdd tw0aSPZS7Gd34UcTSYAZyvWuSApspELlqFpzgi75ldtcY8OP2X5XaEItBI9ov/iRo4cT M/hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714537746; x=1715142546; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ghcu5svxDDMwf9Ya6V/1d6nG/9vm8dM7H011zLAoFaA=; b=QwzCS7ZaB8Zcq8tXF26E5MkKNXNSUHHdgbFaXSt0nj15ibhrEF3PAMAqTHyNEpoYYy AptcqS8z8fUg3ILGFr7EqMRS909bXI+5QrnW3tdwNHczJFvr1p2WCS0c2oHn/xALHUGA Z8U68BgePb9Zeh3RV9rMIKOTsOA8YJDyQbIeum0WBilwZNHrgtZWICUVM2QutoLwXZZ4 s/tO8GktS9cfnH8C4v5gCTcJr3MYaoPv6g/jQY37wX0gywngNVkSWlnEeQdpxsaSb7F2 ki+MkMtDCfn0YJ6u08onR5LrcQieJ8uMkDC610R/noFFTIwTj4IvPoTT2PkQnnHm17qv YYtA== X-Forwarded-Encrypted: i=1; AJvYcCX7zN0gSrnovNvEaHvqoj6DZqXLEV1K2zHLp93QqU8WGiX/ynvIKgvCOHBbMunZu4R+jErI+rHBm8kqnGI2d+UwqOx133hOlx2QqGA8BQ== X-Gm-Message-State: AOJu0YwV3M6JVTrVN3ZfnLD7AgHrp2DjFdciWMOfkS+DS0HDaDIhkYtn wkOb/CwVigwINwSEIHyS1PDrMGljjP4KiACPNCjgjddciyEZxWtK X-Google-Smtp-Source: AGHT+IGuOws9D5HywIMomsEHBpmwNMBHOiAd1WrLlD8IpVNqouORPEssFMM4SDAMdkQm51ay6SbDEg== X-Received: by 2002:a05:6870:1f08:b0:22e:d541:7eb5 with SMTP id pd8-20020a0568701f0800b0022ed5417eb5mr1667093oab.38.1714537746449; Tue, 30 Apr 2024 21:29:06 -0700 (PDT) Received: from nukework.lan (c-98-197-58-203.hsd1.tx.comcast.net. [98.197.58.203]) by smtp.gmail.com with ESMTPSA id do26-20020a0568300e1a00b006ed6dc9fd54sm2719058otb.25.2024.04.30.21.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 21:29:05 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org Cc: Alexandru Gagniuc Subject: [PATCH v4 RESEND 6/8] dt-bindings: phy: qcom,ipq8074-qmp-pcie: add ipq9574 gen3x2 PHY Date: Tue, 30 Apr 2024 23:28:45 -0500 Message-Id: <20240501042847.1545145-7-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240501042847.1545145-1-mr.nuke.me@gmail.com> References: <20240501042847.1545145-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_212907_881609_2FDA208E X-CRM114-Status: UNSURE ( 8.53 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org The IPQ9574 gen3x2 PHY is very similar to IPQ6018. It requires the same parameters as IPQ6018. Add a new compatible string for this PHY. Signed-off-by: Alexandru Gagniuc --- .../devicetree/bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml index 634cec5d57ea..8a8e23282d1c 100644 --- a/Documentation/devicetree/bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml @@ -19,6 +19,7 @@ properties: - qcom,ipq6018-qmp-pcie-phy - qcom,ipq8074-qmp-gen3-pcie-phy - qcom,ipq8074-qmp-pcie-phy + - qcom,ipq9574-qmp-gen3x2-pcie-phy reg: items: From patchwork Wed May 1 04:28:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 13650216 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 2AEBCC4345F for ; Wed, 1 May 2024 04:29:14 +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=hzc7ikdHx0nOBplFKEBFFvF2PVS+vewmmeQfXEju60s=; b=vT+aqTzqOODlCI 6SJrQTvUhJdGYCmsPbmYBAmYeBQ4hbcPXLlU4KeJ3uGEqRPQR5HDrFCxaCjHBfFydH2VliUL1SC// u27q1ztwZT008k2/s5laOQQZZbr5sJfpyYf3RAIDqLpO6q4Cl1vR1nKdaWeEhPTsipagssrI7kt+j Ij04jSZb/UyaIpQskRSC3WoSy3u8C5w3c10JuH6PhQg9sCQTr/+lkNx5OuRGrlnlsyY62bPiN/qND +o+ZWLWoDjlECih5t5aLQU8UFwhhGlbURZboryN1eReID0kPS6ahSQgme8NrClnJg+169LQes/gEw kwdjnKti7Hobasyc5dGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21aj-00000008XWi-1PP4; Wed, 01 May 2024 04:29:13 +0000 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21ag-00000008XU5-04yN for linux-phy@lists.infradead.org; Wed, 01 May 2024 04:29:11 +0000 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6ee1c0ecfa5so2064306a34.0 for ; Tue, 30 Apr 2024 21:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714537748; x=1715142548; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VmjrDrgf8IhRX/sC5LhfboQGEOFKZ/tJGIYEXDMm4jU=; b=KRl8vrTAuAgUWCWgJl66cSHTrvjKgjDyLiKB5tEw1pcBkKrp4yxmnwIxfMAuoIc3Hf 01owgpFJAKh1lk/SsC8i4dW3cjNEP0jqerLAblwOhOD7JueJXqtcMs44JgWIoM77IRnP uyI3C7HS6/FeDRzcNqEzPtNcQZkKgCB53Vr0Ei1SWDcA/xC0iJzAndN/boKuEHIfJPpa YW6x/BVZrAC0XDOvEC9R2+XXCntUcPz45nWoA8UBdn2glyWPFDDhHnIdfa7WbOByD5jR FJLFPURaYAsaMaba9W1kkle3T6J/n0T0vDpbOtfUOz7n/Eo94y4MnBZO289ISX8p/RcY G34w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714537748; x=1715142548; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VmjrDrgf8IhRX/sC5LhfboQGEOFKZ/tJGIYEXDMm4jU=; b=jlqYGawjjw7HvQNiCW/n7qbLbVh5jFfcIba4a7Hk6sxx7epbFcx/vqxV5gMDZ9KcbF TnskkaUWzSknXuJVk5R02QO21WlmaujcNsyg4GFl17uLUqt4wIs/o20rJZnVvbw0T7so tWJMiW0VK0D7k5A0JuM4/4Sqyi2rq6zFTsgYHBkyDfZKsrOY2rL5DpxijXveW4RqVbMI TSAEsaMI5DJVSNgBPPDzMz6kuZ7NTzl+OSCEgafQdVdp3bvRgqjFg29p815gRyd18mu4 dvkjNbcCpiGtCl7KmjTcxpUl25TYOA/5Ns56DIYE0LWNWFcGU/9eCBUaranIUmcy1qWz nCWA== X-Forwarded-Encrypted: i=1; AJvYcCUARIoMKA857S/TqGfzOHLFRmGp/9RquTU0bUbpz+85yEFrAjc/bepT18MRiRA632zpFHZ24gHG1G+HC2pxCbmmhWGc0tNjFofyLls7vA== X-Gm-Message-State: AOJu0Yy8VbdkoAwkFYnLmi2VU9tXhW1U7XRyQfPx++yf3uUruJHKsBw6 ubwGJP3jiRAKj09cQjIeCfrJ2uoOU7AYV1j9TnnfCq2eO+bHEvz74BP2i3Lscf4= X-Google-Smtp-Source: AGHT+IGcWs7RwYTFqYddbfOryY8YmDnYBvvID7ou8GxP/me4JO+fs2AM9u/cVwWC+LJMOkgOCbEvRQ== X-Received: by 2002:a05:6830:1609:b0:6ee:4ecc:3c35 with SMTP id g9-20020a056830160900b006ee4ecc3c35mr1573257otr.18.1714537748340; Tue, 30 Apr 2024 21:29:08 -0700 (PDT) Received: from nukework.lan (c-98-197-58-203.hsd1.tx.comcast.net. [98.197.58.203]) by smtp.gmail.com with ESMTPSA id do26-20020a0568300e1a00b006ed6dc9fd54sm2719058otb.25.2024.04.30.21.29.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 21:29:07 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org Cc: Alexandru Gagniuc Subject: [PATCH v4 RESEND 7/8] phy: qcom-qmp-pcie: add support for ipq9574 gen3x2 PHY Date: Tue, 30 Apr 2024 23:28:46 -0500 Message-Id: <20240501042847.1545145-8-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240501042847.1545145-1-mr.nuke.me@gmail.com> References: <20240501042847.1545145-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_212910_072734_AE20258E X-CRM114-Status: GOOD ( 12.91 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add support for the gen3x2 PCIe PHY on IPQ9574, ported form downstream 5.4 kernel. Only the serdes and pcs_misc tables are new, the others being reused from IPQ8074 and IPQ6018 PHYs. Signed-off-by: Alexandru Gagniuc --- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 136 +++++++++++++++++- .../phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h | 14 ++ 2 files changed, 149 insertions(+), 1 deletion(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c index 8836bb1ff0cc..055d04d0c9b6 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c @@ -487,6 +487,100 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_gen3_pcs_misc_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_ENDPOINT_REFCLK_DRIVE, 0xc1), }; +static const struct qmp_phy_init_tbl ipq9574_gen3x2_pcie_serdes_tbl[] = { + QMP_PHY_INIT_CFG(QSERDES_PLL_BIAS_EN_CLKBUFLR_EN, 0x18), + QMP_PHY_INIT_CFG(QSERDES_PLL_BIAS_EN_CTRL_BY_PSM, 0x01), + QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_SELECT, 0x31), + QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_IVCO, 0x0f), + QMP_PHY_INIT_CFG(QSERDES_PLL_BG_TRIM, 0x0f), + QMP_PHY_INIT_CFG(QSERDES_PLL_CMN_CONFIG, 0x06), + QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP_EN, 0x42), + QMP_PHY_INIT_CFG(QSERDES_PLL_RESETSM_CNTRL, 0x20), + QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x01), + QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE_MAP, 0x04), + QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x05), + QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE_TIMER1, 0xff), + QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE_TIMER2, 0x3f), + QMP_PHY_INIT_CFG(QSERDES_PLL_CORE_CLK_EN, 0x30), + QMP_PHY_INIT_CFG(QSERDES_PLL_HSCLK_SEL, 0x21), + QMP_PHY_INIT_CFG(QSERDES_PLL_DEC_START_MODE0, 0x68), + QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START3_MODE0, 0x02), + QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START2_MODE0, 0xaa), + QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START1_MODE0, 0xab), + QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP2_MODE0, 0x14), + QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP1_MODE0, 0xd4), + QMP_PHY_INIT_CFG(QSERDES_PLL_CP_CTRL_MODE0, 0x09), + QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_RCTRL_MODE0, 0x16), + QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_CCTRL_MODE0, 0x28), + QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN1_MODE0, 0x00), + QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN0_MODE0, 0xa0), + QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE2_MODE0, 0x02), + QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE1_MODE0, 0x24), + QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x05), + QMP_PHY_INIT_CFG(QSERDES_PLL_CORE_CLK_EN, 0x00), + QMP_PHY_INIT_CFG(QSERDES_PLL_CORECLK_DIV, 0x0a), + QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_SELECT, 0x32), + QMP_PHY_INIT_CFG(QSERDES_PLL_SYS_CLK_CTRL, 0x02), + QMP_PHY_INIT_CFG(QSERDES_PLL_SYSCLK_BUF_ENABLE, 0x07), + QMP_PHY_INIT_CFG(QSERDES_PLL_SYSCLK_EN_SEL, 0x08), + QMP_PHY_INIT_CFG(QSERDES_PLL_BG_TIMER, 0x0a), + QMP_PHY_INIT_CFG(QSERDES_PLL_HSCLK_SEL, 0x01), + QMP_PHY_INIT_CFG(QSERDES_PLL_DEC_START_MODE1, 0x53), + QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START3_MODE1, 0x05), + QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START2_MODE1, 0x55), + QMP_PHY_INIT_CFG(QSERDES_PLL_DIV_FRAC_START1_MODE1, 0x55), + QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP2_MODE1, 0x29), + QMP_PHY_INIT_CFG(QSERDES_PLL_LOCK_CMP1_MODE1, 0xaa), + QMP_PHY_INIT_CFG(QSERDES_PLL_CP_CTRL_MODE1, 0x09), + QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_RCTRL_MODE1, 0x16), + QMP_PHY_INIT_CFG(QSERDES_PLL_PLL_CCTRL_MODE1, 0x28), + QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN1_MODE1, 0x00), + QMP_PHY_INIT_CFG(QSERDES_PLL_INTEGLOOP_GAIN0_MODE1, 0xa0), + QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE2_MODE1, 0x03), + QMP_PHY_INIT_CFG(QSERDES_PLL_VCO_TUNE1_MODE1, 0xb4), + QMP_PHY_INIT_CFG(QSERDES_PLL_SVS_MODE_CLK_SEL, 0x05), + QMP_PHY_INIT_CFG(QSERDES_PLL_CORE_CLK_EN, 0x00), + QMP_PHY_INIT_CFG(QSERDES_PLL_CORECLK_DIV_MODE1, 0x08), + QMP_PHY_INIT_CFG(QSERDES_COM_SSC_EN_CENTER, 0x01), + QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_PER1, 0x7d), + QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_PER2, 0x01), + QMP_PHY_INIT_CFG(QSERDES_COM_SSC_ADJ_PER1, 0x00), + QMP_PHY_INIT_CFG(QSERDES_COM_SSC_ADJ_PER2, 0x00), + QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE1_MODE0, 0x0a), + QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE2_MODE0, 0x05), + QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE1_MODE1, 0x08), + QMP_PHY_INIT_CFG(QSERDES_PLL_SSC_STEP_SIZE2_MODE1, 0x04), + QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_EP_DIV_MODE0, 0x19), + QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_EP_DIV_MODE1, 0x28), + QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_ENABLE1, 0x90), + QMP_PHY_INIT_CFG(QSERDES_PLL_HSCLK_SEL, 0x89), + QMP_PHY_INIT_CFG(QSERDES_PLL_CLK_ENABLE1, 0x10), +}; + +static const struct qmp_phy_init_tbl ipq9574_gen3x2_pcie_pcs_misc_tbl[] = { + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_ACTIONS, 0x00), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG2, 0x1d), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_H, 0x00), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_L, 0x01), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_H, 0x00), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_L, 0x01), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_EQ_CONFIG1, 0x14), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_EQ_CONFIG1, 0x10), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_EQ_CONFIG2, 0x0b), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_PRESET_P10_PRE, 0x00), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_PRESET_P10_POST, 0x58), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG4, 0x07), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG1, 0x00), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG2, 0x52), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG4, 0x19), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_INT_AUX_CLK_CONFIG1, 0x00), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG2, 0x49), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG4, 0x2a), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG5, 0x02), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG6, 0x03), + QMP_PHY_INIT_CFG(QPHY_V5_PCS_PCIE_ENDPOINT_REFCLK_DRIVE, 0xc1), +}; + static const struct qmp_phy_init_tbl sdm845_qmp_pcie_serdes_tbl[] = { QMP_PHY_INIT_CFG(QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN, 0x14), QMP_PHY_INIT_CFG(QSERDES_V3_COM_CLK_SELECT, 0x30), @@ -2448,7 +2542,7 @@ static inline void qphy_clrbits(void __iomem *base, u32 offset, u32 val) /* list of clocks required by phy */ static const char * const qmp_pciephy_clk_l[] = { - "aux", "cfg_ahb", "ref", "refgen", "rchng", "phy_aux", + "aux", "cfg_ahb", "ref", "refgen", "rchng", "phy_aux", "anoc", "snoc" }; /* list of regulators */ @@ -2519,6 +2613,16 @@ static const struct qmp_pcie_offsets qmp_pcie_offsets_v4_20 = { .rx2 = 0x0a00, }; +static const struct qmp_pcie_offsets qmp_pcie_offsets_ipq9574 = { + .serdes = 0, + .pcs = 0x1000, + .pcs_misc = 0x1400, + .tx = 0x0200, + .rx = 0x0400, + .tx2 = 0x0600, + .rx2 = 0x0800, +}; + static const struct qmp_pcie_offsets qmp_pcie_offsets_v5 = { .serdes = 0, .pcs = 0x0200, @@ -2728,6 +2832,33 @@ static const struct qmp_phy_cfg sm8250_qmp_gen3x1_pciephy_cfg = { .phy_status = PHYSTATUS, }; +static const struct qmp_phy_cfg ipq9574_pciephy_gen3x2_cfg = { + .lanes = 2, + + .offsets = &qmp_pcie_offsets_ipq9574, + + .tbls = { + .serdes = ipq9574_gen3x2_pcie_serdes_tbl, + .serdes_num = ARRAY_SIZE(ipq9574_gen3x2_pcie_serdes_tbl), + .tx = ipq8074_pcie_gen3_tx_tbl, + .tx_num = ARRAY_SIZE(ipq8074_pcie_gen3_tx_tbl), + .rx = ipq6018_pcie_rx_tbl, + .rx_num = ARRAY_SIZE(ipq6018_pcie_rx_tbl), + .pcs = ipq6018_pcie_pcs_tbl, + .pcs_num = ARRAY_SIZE(ipq6018_pcie_pcs_tbl), + .pcs_misc = ipq9574_gen3x2_pcie_pcs_misc_tbl, + .pcs_misc_num = ARRAY_SIZE(ipq9574_gen3x2_pcie_pcs_misc_tbl), + }, + .reset_list = ipq8074_pciephy_reset_l, + .num_resets = ARRAY_SIZE(ipq8074_pciephy_reset_l), + .vreg_list = NULL, + .num_vregs = 0, + .regs = pciephy_v5_regs_layout, + + .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, + .phy_status = PHYSTATUS, +}; + static const struct qmp_phy_cfg sm8250_qmp_gen3x2_pciephy_cfg = { .lanes = 2, @@ -3935,6 +4066,9 @@ static const struct of_device_id qmp_pcie_of_match_table[] = { }, { .compatible = "qcom,ipq8074-qmp-pcie-phy", .data = &ipq8074_pciephy_cfg, + }, { + .compatible = "qcom,ipq9574-qmp-gen3x2-pcie-phy", + .data = &ipq9574_pciephy_gen3x2_cfg, }, { .compatible = "qcom,msm8998-qmp-pcie-phy", .data = &msm8998_pciephy_cfg, diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h index a469ae2a10a1..fa15a03055de 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h +++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h @@ -11,8 +11,22 @@ #define QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG2 0x0c #define QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG4 0x14 #define QPHY_V5_PCS_PCIE_ENDPOINT_REFCLK_DRIVE 0x20 +#define QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_L 0x44 +#define QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_H 0x48 +#define QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_L 0x4c +#define QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_H 0x50 #define QPHY_V5_PCS_PCIE_INT_AUX_CLK_CONFIG1 0x54 +#define QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG1 0x5c +#define QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG2 0x60 +#define QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG4 0x68 +#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG2 0x7c +#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG4 0x84 +#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG5 0x88 +#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG6 0x8c #define QPHY_V5_PCS_PCIE_OSC_DTCT_ACTIONS 0x94 +#define QPHY_V5_PCS_PCIE_EQ_CONFIG1 0xa4 #define QPHY_V5_PCS_PCIE_EQ_CONFIG2 0xa8 +#define QPHY_V5_PCS_PCIE_PRESET_P10_PRE 0xc0 +#define QPHY_V5_PCS_PCIE_PRESET_P10_POST 0xe4 #endif From patchwork Wed May 1 04:28:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Gagniuc X-Patchwork-Id: 13650217 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 49E85C19F53 for ; Wed, 1 May 2024 04:29:15 +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=DwS4dRdNHKg7e7Sh4e/QhkncP75duV8fnT3bj8KbLpc=; b=N4iaaLri64TIGF btMlgLx3y9fcE7FIOIHNvosl3AObpdHPvjETDkl0834XbFvkakBchjuOyy2aGsTsnv1rKeTaDOPdD HOv1aZo0m8QsDBV7pUkops+nQ3G21zAQUrHSPtSQm/VnD7wMr3Og8YPPnYLBNu1wXecdypxRxgaEi vzCP2wQxzWTzycvz70XafQ+6qJdtbeBwR9vc6c2oNrqxeGTwLi5hfhwFW/JLbhhxzlz2ZPHTAYxVI toCCoXS+g030pNlAeqsJuw5Um6RtAOcUsXrYp0NrlrB18t8snPjeeWta0m2GCPJ2WcRE9LlobvgYH VbQu+6gLg6DUuCRISgeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21ak-00000008XXH-3ZgE; Wed, 01 May 2024 04:29:14 +0000 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s21ah-00000008XUj-22gw for linux-phy@lists.infradead.org; Wed, 01 May 2024 04:29:12 +0000 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6ee575da779so1215015a34.2 for ; Tue, 30 Apr 2024 21:29:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714537750; x=1715142550; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lS+64DkLIQ8nbNaGoMXOJ1Gbc+Q4ngs9pfz0WhHIiSc=; b=P2S/JCyGuNorb5e/En7Kjnz9lhc9R9ViqoK/3CJKL6zPlsN3eDQwO+sbgqAKPLPpSa QToWjdmGm3Cnn6kVla1DS0lp0Weo86E4qLEah4YrapA4a6BcJi0Rlt9OSMWr+DSfX+q7 0kkA5MJDy6Ammle/HFayyI0/YGxYm2K3tIWHF3+CPMUcaQJfiXJD1IkWeGeNKVgp0KLF TRPYuvA/ChH5SlpAZSOtb/cJiFnuLU0Jfuv8bN1c2HAWbMnRC5EmrO6wRxv294vXtq7+ 5fFVCUJGVg42s6I8AoHz8niRMKeiNtI80HF9TOe2kqvvlZsX1a5bzqWp7KJi5Ow7BI9D OXOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714537750; x=1715142550; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lS+64DkLIQ8nbNaGoMXOJ1Gbc+Q4ngs9pfz0WhHIiSc=; b=BjGLTjnkcsAq+scRQZHKSq84mRoWCpKW8GEIcEFucRtMCUB+nuUZ2sfI8L33UO5zqz 6J+UWMp/kz6Z6sGU89sgYRyVI0Uxh2Z6SnXCFx324ebz2PHyM2eL6+0cyWFXFNM+5Z75 SV5hCDCh8fgKGzaUEPT72/Im9v7bU/S0dOPTVLIv6Ihloaivb6iNJFi/1c/TWxti8S0k H4IpJoHdYxzvUKYGLaZJGzHiBSSjYxaFlz0NucgsOMjehtGtDXr/VRS1fnLgETGSEXq4 +n3RN7jYhn+WaQcKIt/u3bmrP4b3ZFURDPaVkwxNhjjAXIAielWBgYnSilTRCjlmhALK KoTw== X-Forwarded-Encrypted: i=1; AJvYcCWmPX9cj0cq1a3qbfltFVGCvjjgjo2UedPbQlJlru5h+4EcWGh0DywMMRTJpPTiL3Huqy4Riju3LoMeeUIhdsLuQUkDKZgmU1XAR5aBbQ== X-Gm-Message-State: AOJu0YwJEimoiAGy9bf23xNi5CsyA/QsqawruILXkw1fxC+DNGcGV76l OJfd9gyEXzeZPD+VJSyViTnNvmjN/L6g483sqBbT+0gTkW3fZcoJ X-Google-Smtp-Source: AGHT+IGIrAKyP/bGpH/Jtpq/owhHBsB2H5z0Uq8LIuVBmhtjxaoJpsLgICttbWudaLL6KNIRsTBjMw== X-Received: by 2002:a05:6830:100f:b0:6ee:575b:8dd5 with SMTP id a15-20020a056830100f00b006ee575b8dd5mr1499213otp.20.1714537750061; Tue, 30 Apr 2024 21:29:10 -0700 (PDT) Received: from nukework.lan (c-98-197-58-203.hsd1.tx.comcast.net. [98.197.58.203]) by smtp.gmail.com with ESMTPSA id do26-20020a0568300e1a00b006ed6dc9fd54sm2719058otb.25.2024.04.30.21.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 21:29:09 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org Cc: Alexandru Gagniuc Subject: [PATCH v4 RESEND 8/8] arm64: dts: qcom: ipq9574: add PCIe2 and PCIe3 nodes Date: Tue, 30 Apr 2024 23:28:47 -0500 Message-Id: <20240501042847.1545145-9-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240501042847.1545145-1-mr.nuke.me@gmail.com> References: <20240501042847.1545145-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_212911_601098_AE7CCAC5 X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On ipq9574, there are 4 PCIe controllers. Describe the pcie2 and pcie3 nodes, and their PHYs in devicetree. The pcie0 and pcie1 controllers use a gen3x1 PHY, which is not currently supported. Hence, only pcie2 and pcie3 are described. Only pcie2 was tested because my devboard only has conenctions to pcie2. Signed-off-by: Alexandru Gagniuc --- arch/arm64/boot/dts/qcom/ipq9574.dtsi | 178 +++++++++++++++++++++++++- 1 file changed, 176 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi index 7f2e5cbf3bbb..c391886cf9ab 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi @@ -300,8 +300,8 @@ gcc: clock-controller@1800000 { <0>, <0>, <0>, - <0>, - <0>, + <&pcie2_phy>, + <&pcie3_phy>, <0>; #clock-cells = <1>; #reset-cells = <1>; @@ -745,6 +745,180 @@ frame@b128000 { status = "disabled"; }; }; + + pcie2_phy: phy@8c000 { + compatible = "qcom,ipq9574-qmp-gen3x2-pcie-phy"; + reg = <0x0008c000 0x14f4>; + + clocks = <&gcc GCC_PCIE2_AUX_CLK>, + <&gcc GCC_PCIE2_AHB_CLK>, + <&gcc GCC_PCIE2_PIPE_CLK>; + clock-names = "aux", + "cfg_ahb", + "pipe"; + + clock-output-names = "pcie_phy2_pipe_clk"; + #clock-cells = <0>; + #phy-cells = <0>; + + resets = <&gcc GCC_PCIE2_PHY_BCR>, + <&gcc GCC_PCIE2PHY_PHY_BCR>; + reset-names = "phy", + "common"; + status = "disabled"; + }; + + pcie3_phy: phy@f4000 { + compatible = "qcom,ipq9574-qmp-gen3x2-pcie-phy"; + reg = <0x000f4000 0x14f4>; + + clocks = <&gcc GCC_PCIE3_AUX_CLK>, + <&gcc GCC_PCIE3_AHB_CLK>, + <&gcc GCC_PCIE3_PIPE_CLK>; + clock-names = "aux", + "cfg_ahb", + "pipe"; + + clock-output-names = "pcie_phy3_pipe_clk"; + #clock-cells = <0>; + #phy-cells = <0>; + + resets = <&gcc GCC_PCIE3_PHY_BCR>, + <&gcc GCC_PCIE3PHY_PHY_BCR>; + reset-names = "phy", + "common"; + status = "disabled"; + }; + + /* TODO: Populate pcie0/pcie1 when gen3x1 phy support is added. */ + + pcie2: pcie@20000000 { + compatible = "qcom,pcie-ipq9574"; + reg = <0x20000000 0xf1d>, + <0x20000f20 0xa8>, + <0x20001000 0x1000>, + <0x00088000 0x4000>, + <0x20100000 0x1000>; + reg-names = "dbi", "elbi", "atu", "parf", "config"; + + ranges = <0x81000000 0x0 0x20200000 0x20200000 0x0 0x00100000>, + <0x82000000 0x0 0x20300000 0x20300000 0x0 0x07d00000>; + + device_type = "pci"; + linux,pci-domain = <3>; + bus-range = <0x00 0xff>; + num-lanes = <2>; + max-link-speed = <3>; + #address-cells = <3>; + #size-cells = <2>; + + phys = <&pcie2_phy>; + phy-names = "pciephy"; + + interrupts = ; + interrupt-names = "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0x7>; + interrupt-map = <0 0 0 1 &intc 0 0 164 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 2 &intc 0 0 165 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 3 &intc 0 0 186 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 4 &intc 0 0 187 IRQ_TYPE_LEVEL_HIGH>; + + clocks = <&gcc GCC_PCIE2_AXI_M_CLK>, + <&gcc GCC_PCIE2_AXI_S_CLK>, + <&gcc GCC_PCIE2_AXI_S_BRIDGE_CLK>, + <&gcc GCC_ANOC_PCIE2_2LANE_M_CLK>, + <&gcc GCC_SNOC_PCIE2_2LANE_S_CLK>, + <&gcc GCC_PCIE2_RCHNG_CLK>; + clock-names = "axi_m", + "axi_s", + "axi_bridge", + "rchng"; + + resets = <&gcc GCC_PCIE2_PIPE_ARES>, + <&gcc GCC_PCIE2_AUX_ARES>, + <&gcc GCC_PCIE2_CORE_STICKY_ARES>, + <&gcc GCC_PCIE2_AXI_M_ARES>, + <&gcc GCC_PCIE2_AXI_S_ARES>, + <&gcc GCC_PCIE2_AXI_S_STICKY_ARES>, + <&gcc GCC_PCIE2_AXI_M_STICKY_ARES>, + <&gcc GCC_PCIE2_AHB_ARES>; + reset-names = "pipe", + "aux", + "sticky", + "axi_m", + "axi_s", + "axi_s_sticky", + "axi_m_sticky", + "ahb"; + status = "disabled"; + }; + + pcie3: pcie@18000000 { + compatible = "qcom,pcie-ipq9574"; + reg = <0x18000000 0xf1d>, + <0x18000f20 0xa8>, + <0x18001000 0x1000>, + <0x000f0000 0x4000>, + <0x18100000 0x1000>; + reg-names = "dbi", "elbi", "atu", "parf", "config"; + + ranges = <0x81000000 0x0 0x18200000 0x18200000 0x0 0x00100000>, + <0x82000000 0x0 0x18300000 0x18300000 0x0 0x07d00000>; + + device_type = "pci"; + linux,pci-domain = <4>; + bus-range = <0x00 0xff>; + num-lanes = <2>; + max-link-speed = <3>; + #address-cells = <3>; + #size-cells = <2>; + + phys = <&pcie3_phy>; + phy-names = "pciephy"; + + interrupts = ; + interrupt-names = "msi"; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0x7>; + interrupt-map = <0 0 0 1 &intc 0 0 189 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 2 &intc 0 0 190 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 3 &intc 0 0 192 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 4 &intc 0 0 192 IRQ_TYPE_LEVEL_HIGH>; + + clocks = <&gcc GCC_PCIE3_AXI_M_CLK>, + <&gcc GCC_PCIE3_AXI_S_CLK>, + <&gcc GCC_PCIE3_AXI_S_BRIDGE_CLK>, + <&gcc GCC_ANOC_PCIE3_2LANE_M_CLK>, + <&gcc GCC_SNOC_PCIE3_2LANE_S_CLK>, + <&gcc GCC_PCIE3_RCHNG_CLK>; + clock-names = "axi_m", + "axi_s", + "axi_bridge", + "anoc", + "snoc", + "rchng"; + + resets = <&gcc GCC_PCIE3_PIPE_ARES>, + <&gcc GCC_PCIE3_AUX_ARES>, + <&gcc GCC_PCIE3_CORE_STICKY_ARES>, + <&gcc GCC_PCIE3_AXI_M_ARES>, + <&gcc GCC_PCIE3_AXI_S_ARES>, + <&gcc GCC_PCIE3_AXI_S_STICKY_ARES>, + <&gcc GCC_PCIE3_AXI_M_STICKY_ARES>, + <&gcc GCC_PCIE3_AHB_ARES>; + reset-names = "pipe", + "aux", + "sticky", + "axi_m", + "axi_s", + "axi_s_sticky", + "axi_m_sticky", + "ahb"; + status = "disabled"; + }; }; thermal-zones {