From patchwork Mon Apr 15 18:20:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 13630453 Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E19F013AA48; Mon, 15 Apr 2024 18:21:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205278; cv=none; b=S+gytQZ+kGSjylVIOv+y2YHAI21A2sykNQFPNx31AkmovAisOfS5VWSQ4JvjdHvJGuGgSq4IULvkaHQl/Bjeaa+7/N+/AXCKBTj+ikH42w+xvFaf2IHr4iOEs3caY/XMdbgvMGNtZvhfQEOaX2TqfMb5KvZ8Pt6HyCWyFwj8z4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205278; c=relaxed/simple; bh=/LW5UP24d3M9gnDJHKsZY3AjzrEnrgPIA21IZxGWV+o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MZGswg788GVVeb7juw3QqCoZEU0BnFTx8CRxaifYu3Cg1o5/UsOvrcS0X9u5UtZUVlGawz1JdcyymU0Lz4fSGjONnJjdEctarrkTsyVaPpXmB+O9VDT3tbmF4UC6z6m/IsFcBtIQXOpEVKj0zgSMKxS2/n7sihYM6dggJN9pby0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cQUZgONU; arc=none smtp.client-ip=209.85.161.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cQUZgONU" Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-5ac61cf3fffso2284092eaf.3; Mon, 15 Apr 2024 11:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713205276; x=1713810076; darn=vger.kernel.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=cQUZgONUIZKNDikttc5xQmO0+Gk0A1pWL+tq/nwS3EcTJa2boUAWi6yuOXCnwH0jBY B4pO/CiqVnrCPX0cdhFb9AibXPewSvZ4uQJu2XvO9SyXqjWUnBPqNPv/nZbUUgAz98YF XIYWgbTAWxRCI6+pr6cXlDNuT2ehukyQfsKMJpKJC8EDKWb3P3cCe9WCmie79dovs0qY ejB9REEI/43hdMG7B8pujqUQZPjpUFgKCW3HrYL+GH+SzfC7biRrcGtSgrjfx2R2jRTr juru5mDfvUqyUzqqKTwC3hpAnpBeem9JPprKUEiHco8uGKc7ftyJpB78/twqN+lqrxR7 PJvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713205276; x=1713810076; 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=mYeiL8nLVBdp7aza8zKR8W1IOQ05mviQC5H1in8JgOfy5yVsqt3BzxukGBzYixZ4TN WWoaw7pYklPW9kDUIBFakCuaSIXlPWrk5uNj5M8dNNfaVAdaNTfWJsTQu+j7QhuBjM8b HUqqWfn4vzgcBXjmDFxdr7E+qx4P29oj4ud9ULY2EXg5gah2aReM7L2Ndlvf/35fvZLB /75VCQKzSxU8WDCrtlAYiyDfakSD9f9ItH4fQ6Win+ICQtAgO/5shWwwMr8InTAvuoxv 1X5QmQ46cpP5p/IQvsuQFRLJcaFktMoVB/f2vpg9d+dnAtQSbOmg2DHZr6ZrMp+FmnkH py0w== X-Forwarded-Encrypted: i=1; AJvYcCV0AAQYGXF/IapV2E37Xu5Nqdda/+CUtHorqMZV/j6fjN10pAwHS3bzL5QENxJphwwT0ue2M12AR4ZRf+gKgsOqa/GkdWLr8ewatmbalaTx7Ah5eRTpS8SsZGTz4LS9BN+YhhvhNvKdA9Yej2Ahid7EMm0lYOb9yrRJUgVAmQWtDT8GhAX6iUdVZOr7PIrstzeHSFuu0jsZGyHvrg1FM20BM0RblxCaSo0eqprYdwnVTOvxbSSzpadSumUSags= X-Gm-Message-State: AOJu0Ywfi6kwHmfsMSOqrWi1eHjHZ2LIetGn810tfF3Pu36IL1eX2OHt RUoFiSNinbFcbNGTa8EZDuraSkyW92a+a2SU3tiGxPCcvNNmDZVk X-Google-Smtp-Source: AGHT+IEeVcvxHNezT/W5g+Igrx1FREJxZQPkhRmeduAzr31PwaRKeMNBmncsMYxNomC3jAJlTvCPaw== X-Received: by 2002:a05:6820:2715:b0:5aa:3b8a:b491 with SMTP id db21-20020a056820271500b005aa3b8ab491mr9969886oob.4.1713205275860; Mon, 15 Apr 2024 11:21:15 -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 x4-20020a056820104400b005a4dc7abc01sm2177494oot.11.2024.04.15.11.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:21:15 -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 v3 1/7] dt-bindings: clock: Add PCIe pipe related clocks for IPQ9574 Date: Mon, 15 Apr 2024 13:20:46 -0500 Message-Id: <20240415182052.374494-2-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240415182052.374494-1-mr.nuke.me@gmail.com> References: <20240415182052.374494-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Mon Apr 15 18:20:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 13630454 Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CEDF13AA5D; Mon, 15 Apr 2024 18:21:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205279; cv=none; b=cgJF0tJ1/fnedZFKqKdqrfqGk9mhOvpIk/ynu7/KQMJs5MS2aMKPfF6q8GGBteLkpnHCnzVjjjAJ8ffUxCOuRUp9cpgCAWmwWqAk8RmPCnyL6R8MBifP6umDgS77xwkqK+Jh/pUso6zBjZxGij4NAimvyLu2KFn/jIkeJx3BqwI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205279; c=relaxed/simple; bh=Jq1nxjulupvtILNZdopMfRaRrH9PRZyT5RG15O4/Fys=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MZJqgbXv/cdDMLTp4gMPBnh/sA/t649FLPGTMFBsiRgxxKhc1A9Y6GPKeOkfHl11T0WUm+C+xHdC/SURYWaRIDKrnU1R0d3aTI9bm80iVK6zD9MtZDbFtJVJ227Q69zj0+Fpeh0LmWgB2jc5nIs3HdNGlWudBuheJRTTSXqF1xM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TxQ5wXny; arc=none smtp.client-ip=209.85.161.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TxQ5wXny" Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-5ac5376c4b2so2257130eaf.2; Mon, 15 Apr 2024 11:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713205277; x=1713810077; darn=vger.kernel.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=LlnM+eqCNJTkFhy3dKbpBAVjG1mhxcSQlqhRDb9T8g0=; b=TxQ5wXnyZ+Glaqzr1ol1aKYowx5MEF15G6XcqRZgwQPWBA/lBQjKoW9jT0EX0faVln 2cG6zSI1C0BDln8Ss6xbFHWmf+zyqOyRNDL33Dlcpd/ysx8P3YGIYm4jmFoCPzyuqtI0 Bs+6MoLkd1/jd0/12kM1K7Rulq5yCuiKrtwm47CpeLCMu+oQFzgzCSNuhzWspeszMQkK JqP/+jpJooJtiUyk1KngVdoKzkRbyyV6vGxCql8izf3yWRFvdM/3dSg0GcdvlDfO+V49 6NsfzUMmAces5UW8FKOBVqyyCuyVWr7x6UEV2fGZD7HquMoj/7MK55fNY3Ftz5R7ZSwk wjaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713205277; x=1713810077; 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=LlnM+eqCNJTkFhy3dKbpBAVjG1mhxcSQlqhRDb9T8g0=; b=NKGSD1mTVuz/gw0PDwN+TRPZjoGRZyxMBvfYn9lZdPs/l4kz2X5alllTJRS+/2VuSS F06/kvs0ArxI/Ay3YsoAkrhUw8aHk7cTHbsqk47AE4gf3yAw9sMawBmUGDwEsJ0qCXRc WRMBD4DXsaDyf92LPnEMbwHPAd5/gdEhDzx6JiBAaHWQ9l9rCRg6UFJD9lhYNZhvNzPv wgWZ+MS73nqNX0vASKvfnXZLEWYYOLimrEvCL3OFwGY7AwDHM6zcoKZ42o68aoQTNm2U fPCPCM3q8yod/uz3d+Cg+i3YJifwOqjiM0FW6ve/JIHBhtEeSk4Gt1/aWo52xvr1TPzj k3ng== X-Forwarded-Encrypted: i=1; AJvYcCXmpVcuSbuJEyZQOL5HdsMWa67RIy/VRyrf6bU7MiHjI6afSLlS7XB5OB/WkgOxm86w01RUvmQZEkO2DrlIIAg/O4d6CsbZkAlfEMCBlCQXqZKLW2iy3LSsDmb0wJEtzaFwJr36me8jQxL1bsu6NhyC4VSrxLeTOj37kUEHscbKnPju+81OIbfWE6/8cROY9jlz4LaP574zp1HJmgTpDxcSbbgrglgHWIiF3D8Bo+1lxKDmPX4nM6wcWWawJhU= X-Gm-Message-State: AOJu0YzF3jmoV6hgaprBUVQ9EipqmhsBoPrkMj6BHRl86B8BRxT34UXY gSmKqIo9VZeY8h0xtBuUxIpwGPxzni8m498R1QSUoC+Ck/8Evy3K X-Google-Smtp-Source: AGHT+IEKOi45/kwRCjBQMTcYd8g4P0Ch4xB6GVM4qKQkrGxwditd/JeXRmD6IhThyApBzZsEqVNptQ== X-Received: by 2002:a05:6820:250b:b0:5ac:5c78:390e with SMTP id cr11-20020a056820250b00b005ac5c78390emr9027335oob.2.1713205277462; Mon, 15 Apr 2024 11:21:17 -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 x4-20020a056820104400b005a4dc7abc01sm2177494oot.11.2024.04.15.11.21.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:21:17 -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 v3 2/7] clk: qcom: gcc-ipq9574: Add PCIe pipe clocks Date: Mon, 15 Apr 2024 13:20:47 -0500 Message-Id: <20240415182052.374494-3-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240415182052.374494-1-mr.nuke.me@gmail.com> References: <20240415182052.374494-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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..c748d2f124f3 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 = &(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 = &(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 = &(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 = &(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 Mon Apr 15 18:20:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 13630455 X-Patchwork-Delegate: manivannanece23@gmail.com Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EE9C13B7A4; Mon, 15 Apr 2024 18:21:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205281; cv=none; b=cfbXVro7igVCoTsglgMStL7cWrnSVlO07z1Tgm7UeVPdZCMjeLzN1SI/c4qjyDxVD/EztD38b6SpW5KqNbQ89PCyGSJ2GCmVwFRskAcqFklHxkicRgwLjzM9pgAxm+VDC0cMs+65gFmNf2l8TZ0QLvaotr0C1SmyRTYV9JDK97A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205281; c=relaxed/simple; bh=k1JJ3fdr8iAG3mv1vRQYhmJ/tsONyAZSjPN0oIsaeNI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GDdUZfzkjhzVHTGG47xi1uV8JeSwvu5dxm/BBrRl24J7wHSXNOMJ7c+0/FL/WcYZQGxf8J70QuyGa3hgwHs0qxjBW8SIGdHYpsZF4058heWAU4IMwP2OFArtRulLl83+S/+M9aJWo+otK8RuIODh5FPDt88BtMlxcEENe+xUTIs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UsSyRz6M; arc=none smtp.client-ip=209.85.161.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UsSyRz6M" Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-5a9ec68784cso2100123eaf.2; Mon, 15 Apr 2024 11:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713205279; x=1713810079; darn=vger.kernel.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=VSUxhRAqtSpAkOo8bigYXpnuJtyRvKgYbnzdNf6wuKY=; b=UsSyRz6Mbj/nrM2NfjYTYQ7yzlJM0+fWsMHnnmPSx2QLu9j97YcVfEtqt2bj+3NIaM uihokkvnsZFdLBZTnDw1VQsZmgicx47s0x0BOJpjblZAxfjJKOT0aS+EhYqaI/0VUutU aCLn7VzRkQrltSGWb25rnzntSVV64z2jPNh2foZHnmOXIuJnt0j98ELjOnGWp0+LQKYz wOxWlKAderoHq3FVIe0+lNMH4KoVOwiiJCEu366iFsbt0UfLeLIqwW+kWbl7bQGmr4CW UBHFSX2jG3DWn8ZRKhvSLaNF1+TtIPtdx76LXPmZZAw7O7+wNklenclXJKH2/bnUfgfL vZbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713205279; x=1713810079; 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=VSUxhRAqtSpAkOo8bigYXpnuJtyRvKgYbnzdNf6wuKY=; b=mRh3jYTrMBgrT81r/Lf+3qRR5N4RxGEsbtRme/AtoDvBp4SBu/lv+ic+vhmvqE4vxw KmzAxplwuuHcKX6LVF2UyVb+XSQOAtYRRF/p/gMYmDWNvm26r9+c/dpcqZJW5OB/4kjF HFTFCIzBvi1hWvYmL050bJDMHJsG3VngQk7P1BrJF5N9u6PaY+KqTs9tzgwl58FeIS7F L5MydGZ/8wgTCFx9ys0Me+esJ3OKVJ40rydPpNiXT07ubNlg2t3xTFHgcqKFuoZF3cCO HltLKYGNRej/B7sNN9LhRzuo1JFRqmuFgqBAjP2e47dQun3v1pAjoTqpd0cW5vZFzbe5 daMA== X-Forwarded-Encrypted: i=1; AJvYcCX1dlvsIVBMvBXIeLkjgIX0sgx+2GkyduQtaKU2i3a4a3uSjXZr3Xk9LoxNoqS1y4hw2ksYehQOO+KP4TNhFx6mFDDGgKmCzhi8q1c6LDITDKtJP/TppsmWXjPNpMeNgZE7GyxX10e7QYLx2FwKT8u3K8FX53EG2yqe9CAQfyzyBqInawErVApqVeaM0Us+WyZnjGoMvLMonvq6pe/+egP8SQw8klF5fnn8FKFcIfU6YOJFb0mA0jyTSOKrmGw= X-Gm-Message-State: AOJu0Yzdjy2ZwX5vrrmvizsLEyg1x1A2zV/9C9vOuIpdJKMWKjUc/WcM XZRoygInCEqUSkuGyTkLezBWVHHPeZQSyciTfu8H7IoeHMHWqxKi X-Google-Smtp-Source: AGHT+IHWDOfDR262vpiTAuGOuGAJ+9982G4HI7/75giU8A9pOm9OGbS5vpH7wkRuMoZaxW+ulBWPpQ== X-Received: by 2002:a4a:b045:0:b0:5ac:9fec:c32e with SMTP id g5-20020a4ab045000000b005ac9fecc32emr4272840oon.8.1713205279255; Mon, 15 Apr 2024 11:21:19 -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 x4-20020a056820104400b005a4dc7abc01sm2177494oot.11.2024.04.15.11.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:21:18 -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 v3 3/7] dt-bindings: PCI: qcom: Add IPQ9574 PCIe controller Date: Mon, 15 Apr 2024 13:20:48 -0500 Message-Id: <20240415182052.374494-4-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240415182052.374494-1-mr.nuke.me@gmail.com> References: <20240415182052.374494-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 IPQ9574 has PCIe controllers which are almost identical to IPQ6018. The difference is that the "iface" clock is not required, and 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 | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie.yaml index cf9a6910b542..2d9bbcc95c31 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,37 @@ 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: 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 +540,7 @@ allOf: - qcom,pcie-ipq8064v2 - qcom,pcie-ipq8074 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 - qcom,pcie-qcs404 then: required: @@ -566,6 +600,7 @@ allOf: - qcom,pcie-ipq8064-v2 - qcom,pcie-ipq8074 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 - qcom,pcie-qcs404 then: properties: From patchwork Mon Apr 15 18:20:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 13630456 X-Patchwork-Delegate: manivannanece23@gmail.com Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F54613AA48; Mon, 15 Apr 2024 18:21:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205283; cv=none; b=EjmthONO9HnLgUPaBun8AUzyNzC6kuzZzMWZEjBiT4aqCOr0/DLL870qBFfMQCkwnm/RhzFFw+VGZHlWnPgfAfjrhAIrAItsUzwTQkp+3rCof4O1YoBjwlqW6Ga1xpZMpFBVSvAQUODhLtEGHHaBM+X0ZFE+vzECHhRkGCWMglo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205283; c=relaxed/simple; bh=Y3sQe52k1yICnNk6VsdMH27lecC3GY2DlpewVQmBUI0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lcrfwvrUcypGNagHDwmgjINQBBNiqxexaUCTUqerWpxWCWsLx6ZkwARRmg7kzAKrDUzhtKY6wzWc8PQy3RBpgGRs+OOxIWrnkN42W1Eo/wGKTGP0FqZoo+orYwmuldZnzobaPZjSI9xOkmIhfzS9cgwPeUrxPC7yQbJCo5Ee1fA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WVLu2y9P; arc=none smtp.client-ip=209.85.160.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WVLu2y9P" Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-22edbb5dd40so1375385fac.1; Mon, 15 Apr 2024 11:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713205281; x=1713810081; darn=vger.kernel.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=u509fpdTL3x8h0sKnxRrMd2Q/Sm/IRVlvPpLmK46sCY=; b=WVLu2y9PWr7IT5mHJ5TO6wVGVWXM+Mp52aYTMbd8s9FKg8R1hBLRAmkagCCbLM5zbm WDuoE09nRBtsRNoY2aO22MxpaxNysl6aZ52kO5vCzIrWLmbDOqN0aBY7WIV7RqfyUyEl 8sn5QQI+PoYY7YJbpzK3rDzuEp/Zj27p2vyAHGh47C6BDPU9j1hPUmsd5c3rkYBB60GV ipPXI/pYsEv4wgM842XCn80TGTe3LhEL8xZMASTHzAKiFJ3OI4epcDjPBQwgZSpTaXzt UCz/CnbA+nUvgIzzsviPPMHKs4awZ+PkhpT2jlQb4gXCs6tLevtZ6WfRhOUD7HwnhQMX qgeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713205281; x=1713810081; 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=u509fpdTL3x8h0sKnxRrMd2Q/Sm/IRVlvPpLmK46sCY=; b=WDr24KAUU0LsYvvdSHbziQ8bjzSpCD6hVaBIFr6ppvTPjx/Dln1Y5UYme7c1FMYnZ5 HjT9Pnj1ERlt9OKlkbyPkh0J/o68zjvfjcCs0apthAp9sKiWNzQRTZn72dG5ulHyvyS2 UpQGE47ekb1gMrvmA6J2isAj8eu1C/tlMi0ns6s7wiWGBL+5knIB3iykl9FEkWnjpRMu E184ITh70Mb9xnWHqcvfidxnqF/+e5io9ZvPxGQ01uvnZ1X8f8lndGptlqKmdc5Q8PxV i5K8ijixxYGybfZh7YjM8DF13KV2zx3bOrwJBO5NmQFD7mU82WbrDBIQLqOR1T61QEnA A4kQ== X-Forwarded-Encrypted: i=1; AJvYcCVoDC3U5ETV0zgsWbFQ7Uj7tQHOIuEBNnA5+kcOCunxljs6ce/ob8gXSXdJFB1V5aqYUaEohXoYKqSL+ZBKNkP0LLA782FazF+H2GhZMVfTZ70pNklmXlnam0WcuMBVKYJ4ma3yIm2HF/w2keNnVU34FMsi8rf6Bc2sKddWAe8mNblRfejhKKXh64/6sqSmS/ejTEpzFj70LrSq7xAkc37cngGflDJCCEJFn4OH2WpkN1YT5u5QFc6QrpvNAuU= X-Gm-Message-State: AOJu0YwdO5TRR9x2iTlMtzK9y8mpVkY63nQ+3P3QdLOEZOYGLP1LZdgw ycjX/Hf296TQfJDKD7yQ9NuSpYl42A8kYWn6kjqSlCXtoQqoaS6H X-Google-Smtp-Source: AGHT+IH/8B0e9NM5WliOP9w/PF1ZRgCApTZi+SCJC4O7CiUjYmCpNmOGWSyNpvTqihZDA+VKDZbWTg== X-Received: by 2002:a05:6870:f694:b0:233:6e01:69b8 with SMTP id el20-20020a056870f69400b002336e0169b8mr159816oab.3.1713205280834; Mon, 15 Apr 2024 11:21:20 -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 x4-20020a056820104400b005a4dc7abc01sm2177494oot.11.2024.04.15.11.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:21:20 -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 v3 4/7] PCI: qcom: Add support for IPQ9574 Date: Mon, 15 Apr 2024 13:20:49 -0500 Message-Id: <20240415182052.374494-5-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240415182052.374494-1-mr.nuke.me@gmail.com> References: <20240415182052.374494-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for the PCIe on IPQ9574. The main difference from ipq6018 is that the "iface" clock is not necessarry. Add a special case in qcom_pcie_get_resources_2_9_0() to handle this. Signed-off-by: Alexandru Gagniuc --- drivers/pci/controller/dwc/pcie-qcom.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 14772edcf0d3..10560d6d6336 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -1101,15 +1101,19 @@ 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; + int ret, num_clks = ARRAY_SIZE(res->clks) - 1; - res->clks[0].id = "iface"; + res->clks[0].id = "rchng"; 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 (!of_device_is_compatible(dev->of_node, "qcom,pcie-ipq9574")) { + res->clks[4].id = "iface"; + num_clks++; + } + + ret = devm_clk_bulk_get(dev, num_clks, res->clks); if (ret < 0) return ret; @@ -1664,6 +1668,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 Mon Apr 15 18:20:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 13630457 Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56DB413C3D4; Mon, 15 Apr 2024 18:21:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205284; cv=none; b=CBONvkaWX4PPKK2pbjBTbhustWGPCnkIXMQjGm2PjnzAGg1RIqBXv2OtrzjO0sIuTGl8Hu1iDRfIGvi0uw0A8L3QGRkY92fAexXOXLVMzKAFWDpJfEIr1Vdq+mcqx+NLWyZ09qY1krbyQ8Zejxa6x6KSyiHzLqOW4b069h4eYpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205284; c=relaxed/simple; bh=Bi/K2DoHrhLP69oUmfE7G8EDr42IWdwAMdYVVLQinQ0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cP11pKW0D1eaBqq2GV7DnS4UaqcxvkKMUB96/SWJyDVeZioQmCoXylIDlhkNyJlPbASsDCnk9/XIpS8a1VhICwiVQJnvlIJOCecvopp1YqeqZlgSwyos2/7PlxRqhPIS2MfwdU2EENc2TBkwKm3GxH9+i8nhsbcm6RvZ2meOlXU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fE2uEqRI; arc=none smtp.client-ip=209.85.161.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fE2uEqRI" Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-5a9ec68784cso2100159eaf.2; Mon, 15 Apr 2024 11:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713205282; x=1713810082; darn=vger.kernel.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=CTnP6eipSs1lQbgXBNYS3udbxY0JHas09pkOXVb4n1w=; b=fE2uEqRIHdvYvWf2qg1OII8T2eQ5VaXiWmv//NPWUWSYr2hLlJCjmF83YG/PV/ZEVH CTbdChqr10thcNnPPaj3q1ErMukXzaVX5P+Goua7dgeQtzSbYQ/37vYoF5mIBhtiTBxY TQNdtaaL0xKOvWKGfoDDfT3VZ37/dejAIxVU75CwfK/QaZDJHb7KQdPGtIalHstGbNOs sBjhf6OFYE/ghIiBtYahdrBDbSakU6xLbFi9vt5PRfGF7IfK0EuahfoSLYOLaxbm3cOH E1UPcV2MLa+WLSBCKv2w3utgBwMpf8LAPDvey1Ttde8j8ag2c9e/FquYsiLI+xfQ+AIU 5BRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713205282; x=1713810082; 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=CTnP6eipSs1lQbgXBNYS3udbxY0JHas09pkOXVb4n1w=; b=pWMZfZ1upI2upk+DULXJGujdaja4Ux9bhoy0vksxiHqhHRHhiHPYox7ZmFNSrfzxrV u6Ntr25D9hPsPvQX0GkH2tWN9xMFkbseoQuvdTyo3ygKeNfuW7PNImZ4m5hTDBfsQkoa Upa7aoiPjk6FZPm0+l+f9KZJUXGN3O18ly0Ll20yyp/KUgZXkt/1OZbyyG4n86N4Id+h +gakOcKvxVVA01oNA/e9K4YTzyqZNohLCjz+Jsl4720YxrdPtdYfHXue2GkIJmSgpKzA yGOcCF45a10zJNgHuVfAfoXk5xHhm0kB6VLRc1qnMAVz50zKHwQIZSUK1SBOXh8Hr4e7 gABQ== X-Forwarded-Encrypted: i=1; AJvYcCW15RxRrc7Nz2dmPsJOt2PkRTV92fONaUZ9GiitNs67w+Ev+Coj0lrN1+yPR/297BFGAkWQ7gxfcLvK3kQIeNqEd/ihYPFTqo5drkRLNIH8dupZ9kF/aBuuSj81C7Vwh19GdoJReacT3j57hQ46a/zYrnoRwRFBDkXCQA2OGdmDgmKrwLAXkdhPhO7Hi/MXroUuKkwOnUUQeozO0u5vlPK19oD23EMWyx0t79PfpyBvKqApECkt2k9XpyIVu4w= X-Gm-Message-State: AOJu0Yz8zktAFvxawW9kaOTMbfztdx1NJospZ5p1v1SDhjcZHRQBQ/d7 HxblcdreVRmRjM7qYwwqwpB+pxfd1Lgn4yvRRiYiK1iSRbC/BMYvgePOg3r1x4U= X-Google-Smtp-Source: AGHT+IHg5ugq1lohZEm0ehzMxEcdWVwoP8XQwZRTCLQ22SHdryJbt4bEX3o8wVWphYHKU7n0nCcShA== X-Received: by 2002:a4a:1482:0:b0:5ac:c39b:3a7a with SMTP id 124-20020a4a1482000000b005acc39b3a7amr1127677ood.1.1713205282432; Mon, 15 Apr 2024 11:21:22 -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 x4-20020a056820104400b005a4dc7abc01sm2177494oot.11.2024.04.15.11.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:21:22 -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 v3 5/7] dt-bindings: phy: qcom,ipq8074-qmp-pcie: add ipq9574 gen3x2 PHY Date: Mon, 15 Apr 2024 13:20:50 -0500 Message-Id: <20240415182052.374494-6-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240415182052.374494-1-mr.nuke.me@gmail.com> References: <20240415182052.374494-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The IPQ9574 gen3x2 PHY is very similar to IPQ6018. It requires two extra clocks named "anoc" and "snoc". Document this, and add a new compatible string for this PHY. Signed-off-by: Alexandru Gagniuc Acked-by: Rob Herring (Arm) --- .../phy/qcom,ipq8074-qmp-pcie-phy.yaml | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) 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..89949f4e89db 100644 --- a/Documentation/devicetree/bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml +++ b/Documentation/devicetree/bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml @@ -19,19 +19,24 @@ 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: - description: serdes clocks: - maxItems: 3 + minItems: 3 + maxItems: 5 clock-names: + minItems: 3 items: - const: aux - const: cfg_ahb - const: pipe + - const: anoc + - const: snoc resets: maxItems: 2 @@ -61,6 +66,35 @@ required: - clock-output-names - "#phy-cells" +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq6018-qmp-pcie-phy + - qcom,ipq8074-qmp-gen3-pcie-phy + - qcom,ipq8074-qmp-pcie-phy + then: + properties: + clocks: + maxItems: 3 + clock-names: + maxItems: 3 + + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq9574-qmp-gen3x2-pcie-phy + then: + properties: + clocks: + minItems: 5 + clock-names: + minItems: 5 + additionalProperties: false examples: From patchwork Mon Apr 15 18:20:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 13630458 Received: from mail-oo1-f49.google.com (mail-oo1-f49.google.com [209.85.161.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3856913C670; Mon, 15 Apr 2024 18:21:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205286; cv=none; b=hPHFP4GKoyr63jsJeg8MqAY3dIs9x4sP2l0M5D2pew4w2Srn7F81wMgnCXBp9smsR0xn4E5ghj/uWBxl9Ss269cqKIGp5Rtc4la7W7aa4ffuYabW3opuTYWW9tJ5IrsEVH94k9/Y1V1WD4BlwAKU/jAGgnGg3whc0ubEaoYAmWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205286; c=relaxed/simple; bh=9KQqLyTa5COPsq7zjGpg1mBHA7HE0+6NpvlsrtFBu3s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cOd4aaSgqsIvQbQQJKugroAslUQtP6D00n1BH5yLShLOB+7rfDoe3glO5Qhao708pAMOpTq/b5OHuFis4DuquPHS2rGx0geGEMkA9yNgqptDVtv53KqXbcteoOvXOlG5ofgz54OfYivzFff3mCFjQUdTsm2gXePR2VmN71AqTV8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nezxR4jw; arc=none smtp.client-ip=209.85.161.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nezxR4jw" Received: by mail-oo1-f49.google.com with SMTP id 006d021491bc7-5aa241232faso3407505eaf.0; Mon, 15 Apr 2024 11:21:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713205284; x=1713810084; darn=vger.kernel.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=xdbXKh+RNp4MnGM/FujpTCGmHI3sINIt3cug6zl8uss=; b=nezxR4jwYegI9kEmr4/q3WIAEkFnz1G2JZUxYKXPvAl+EC2Bi0Zm7ZP7XHH92t6izm HrZP+5Hj+sQ5g//lZR6/pYFdWSYxa9tzq1q6Y3WquBsdypJPzDpTCUkAJcHOBuFAWxsd dm35i1553x52e62XLLVy7F5Nz1LI74gcq9s1nSNQJi9A6Jx1JJbY09Y3qxyC4JHdjRS7 P/9JuIRgpEXsmk3heDdZBLfiyp7sWTjY3qexpESpd2RzwmxEYY8VfuE1LmorYo252elh ab8Ky6doz/fzA/y0Why2u2EWOTP0avBZ9Wv3pjKagokf7syFQLJZLX75pE6tN7f1dhfC cRaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713205284; x=1713810084; 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=xdbXKh+RNp4MnGM/FujpTCGmHI3sINIt3cug6zl8uss=; b=wGJ2FTIIDeULof7kLjP0sPNmOI1f7cpnC0VsFFE6btR+fNlO3AHsmn7Ned4JkuhQhM 4ds/doSauGKv6NTuJ9cFRh8j21MFdNtBkAq/xW6l3VYFS5IrTYqiIwkcJUu5NT82wCxa oRkVi9A+mV37P8aYNez0kDjHKd48n8JQz0rORo3OKmujQamPYdFkzFNtQMGapKsaXapx Mrxbvzo1/UM5st3AugBb7OOPECTBWZFIhyy1TCV/fY0pBQrm/wsXaIJu2BdXKtYq93XS oaFSXrmj4ieYjaXAgxsMfQ4M95Z8/22EShWrw5cQGA+GwoKA4aLGFSvxJ0KyemxNrXOR 2CqQ== X-Forwarded-Encrypted: i=1; AJvYcCUv0wcnIFXFcteNS3bPPBK+ksfetlTrXZDPVWbzpYQb2ojeh7ra6t+CSbJQVF0ko04F3k6aL2LUpPaRyfwDBcuBr5kzQ64P8ElZhoIwC800/+UVwXdoZH7Z4MgBICs/pA84sVM3/XiQid7JwW7qHvpdeUqbDoVCW7hYlxQVzlv4e/mC0zkc0vbbzm7nhGStUSe5wP9Rk0/g/jRekEhLjSTpOBtbWBFJkIoaPpapXxkOA98nzuHeWShXWLlvlPY= X-Gm-Message-State: AOJu0YxhWiajQbmEy4B1fl3sQ7jp5bLuC5yDGm7WHB9rAuq9lm+Z9U6b 77Fy+a9KqGyG6bM6Si7mjTA7TkHy/dHMMOzObzQlDDDxmGS/HJBYjz/BGUXxwEs= X-Google-Smtp-Source: AGHT+IGrnREYRFbxIcokeJIMps7f+ORY88lwVGB2OdkgvY9Hc11FJWognyVI1aZdKa+5Ltq2CjXHoQ== X-Received: by 2002:a05:6820:1e02:b0:5aa:4e19:39aa with SMTP id dh2-20020a0568201e0200b005aa4e1939aamr10177134oob.2.1713205284313; Mon, 15 Apr 2024 11:21:24 -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 x4-20020a056820104400b005a4dc7abc01sm2177494oot.11.2024.04.15.11.21.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:21:23 -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 v3 6/7] phy: qcom-qmp-pcie: add support for ipq9574 gen3x2 PHY Date: Mon, 15 Apr 2024 13:20:51 -0500 Message-Id: <20240415182052.374494-7-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240415182052.374494-1-mr.nuke.me@gmail.com> References: <20240415182052.374494-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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..a4a79ddf50a5 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 */ @@ -2499,6 +2593,16 @@ static const struct qmp_pcie_offsets qmp_pcie_offsets_v4x1 = { .rx = 0x0400, }; +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_v4x2 = { .serdes = 0, .pcs = 0x0a00, @@ -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_v4_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 Mon Apr 15 18:20:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 13630459 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1E9B13C68A; Mon, 15 Apr 2024 18:21:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205288; cv=none; b=pG+knBSqWIJxJPCfjKCbxlw65OCcKpzpw+6GT/GIzj7ET226ZzzLOfsU++OoozTOdVaxn1WojLdZDCPMlGRXGFUJ5wpt1R/2TcnQMDLJSXKIjfykLWgiQeZyJu/LWR9dB/A8tgSMS5t6D7PSce0rQt0n73tHyf8S62I8nsR+mIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713205288; c=relaxed/simple; bh=AQI/LvmjE4IEpy1RdNz2zpAKf1LZ2lytZtsviYqCPIQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LBsH+ECrGKCn9TMeuH+B6UXWnrB0cPDend9qgPzfAMJ2yvChvU3j8gXRG9Kqi45XDfLJOLUYiIS+9ALLDvz7VkowtPKqAe8EAJYKAbUPhTuJrAjmIuCE8tDm3a1aG4izpOL3JKguw+FOOw4IpYZwu3Ew8OgpGQB+g62hrbHtzVw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DasJJ/Su; arc=none smtp.client-ip=209.85.161.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DasJJ/Su" Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-5ac61cf3fffso2284216eaf.3; Mon, 15 Apr 2024 11:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713205286; x=1713810086; darn=vger.kernel.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=FzgGDQmklEWFrISIR4IcwxoAKiKCzk4r1Ppmvkj7XiQ=; b=DasJJ/SuEyk5U8eyV8CwJGBs+NiZSfuC6fyIHE+BiD3SIliH8KjNbLDA1z9e5WrEtQ iIFw/IEdJsK7F3Erl8VBEaWjVSnCqrP5+YVU9VihFGczyUYPWHWt1ddVZjj6XDwuC389 rjYc/xk0HSFY1s0ALNft4HE42KPV4moZF7GjJEoo3QTm2C2npM78spyaY4dVjGyKFp24 BPYg4eYi5drWcsMgaJpBRU5SQKvZ/3mqiRen5Ljq15Qi1Ixv6d0vAOdEq8aWabobd/Go QQOq1nmX+9CER7byveGH9YVW6V7zJAovCc/BR6tbNbIxh2rzRip3Q9FCAXcnv9MaoR+e rJBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713205286; x=1713810086; 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=FzgGDQmklEWFrISIR4IcwxoAKiKCzk4r1Ppmvkj7XiQ=; b=ATuwCKp/oUWegcQzwl3roIh4iDuj9Ghr1lNkOkoMrt91VMl6piIzZyyBjBWGAbVn+R Hz7nVyUYm4Wr0LkBvb/XcDTqaob7k+WlK1GUOumed2CQozTV5y+nQ8FyNi3ivToKYe3h 6qteAasedrvg8ovcMDQrI33eFXYiTCg2GMO273ek0+yfuX7MgkvgUJtqlhTSXtSXbZ/c wvmHR5CkLHjqoMQfl1lB9tifx8K+jWSPdL9HJGmdchlvQbgssUK8O5jTDv9+YOAqvTIX Vfjfqq18HHMbVQnnndajChnT84rbvG+F5SZSy84508XYx0nkJQqXPHrWEP0Qm3OCQoIB j8YQ== X-Forwarded-Encrypted: i=1; AJvYcCV4YiqlDfFAk2k8a9JVdJD6OaQ3MiNWJ5/U6pwfGfGuPxJz1vWTMmuEIv/YWJyTx7u8Tqan006a4B5vk5nkv0ACHWdbARpXzZ5yl1/YyBKfAPURhXhGloQj9bu45wnUwpR8gfis5DHEsjwWdYx+Fz+lpZNPv784JWvajZPD0BE6Idb4B+F270AMRw6RUV72UHn9mKxO84r4Vx8PRQAZrbswKb9ZIcPoqfBgV17vmbhnWotzR3DHaNI9SgtBzjM= X-Gm-Message-State: AOJu0YxwcGumhWy151CsnXPwcRP7jjNAmaz40kT2Z1zgHA+55Y7AkVLc 5Gr8crHTUVFNqBBXIeWDxlkK00cH70fWY/1hyY0dJDMtqCjxg8Iv X-Google-Smtp-Source: AGHT+IFzBspjAQ4rLg81eFZJL29bkc3W+mz4hD/gAWcReSsmqzSYHyKiD0HMSDTzbp14adcuHiezMg== X-Received: by 2002:a4a:1ac3:0:b0:5ac:9ff2:8ca4 with SMTP id 186-20020a4a1ac3000000b005ac9ff28ca4mr4669479oof.6.1713205285937; Mon, 15 Apr 2024 11:21:25 -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 x4-20020a056820104400b005a4dc7abc01sm2177494oot.11.2024.04.15.11.21.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:21:25 -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 v3 7/7] arm64: dts: qcom: ipq9574: add PCIe2 nodes Date: Mon, 15 Apr 2024 13:20:52 -0500 Message-Id: <20240415182052.374494-8-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240415182052.374494-1-mr.nuke.me@gmail.com> References: <20240415182052.374494-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On ipq9574, there are 4 PCIe controllers. Describe the pcie2 node, and its PHY in devicetree. Only pcie2 is described, because only hardware using that controller was available for testing. Signed-off-by: Alexandru Gagniuc --- arch/arm64/boot/dts/qcom/ipq9574.dtsi | 93 ++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi index 7f2e5cbf3bbb..f075e2715300 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi @@ -300,7 +300,7 @@ gcc: clock-controller@1800000 { <0>, <0>, <0>, - <0>, + <&pcie2_phy>, <0>, <0>; #clock-cells = <1>; @@ -745,6 +745,97 @@ 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>, + <&gcc GCC_ANOC_PCIE2_2LANE_M_CLK>, + <&gcc GCC_SNOC_PCIE2_2LANE_S_CLK>; + clock-names = "aux", + "cfg_ahb", + "pipe", + "anoc", + "snoc"; + + 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"; + }; + + 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>, /* I/O */ + <0x82000000 0x0 0x20300000 0x20300000 0x0 0x07d00000>; /* MEM */ + + 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>, /* int_a */ + <0 0 0 2 &intc 0 0 165 + IRQ_TYPE_LEVEL_HIGH>, /* int_b */ + <0 0 0 3 &intc 0 0 186 + IRQ_TYPE_LEVEL_HIGH>, /* int_c */ + <0 0 0 4 &intc 0 0 187 + IRQ_TYPE_LEVEL_HIGH>; /* int_d */ + + clocks = <&gcc GCC_PCIE2_AXI_M_CLK>, + <&gcc GCC_PCIE2_AXI_S_CLK>, + <&gcc GCC_PCIE2_AXI_S_BRIDGE_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"; + }; }; thermal-zones {