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[] = {