Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp250141lqm; Tue, 30 Apr 2024 21:29:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUkbuz93Lz/7V14xBQTV6DAx6tqgRHoifL4AV95fHLRfXNqtpsNXqBiyfbnHVo5y9TGxhclbWSeqi0McVEG4aUuv0A0iGv2f2lTogLJvQ== X-Google-Smtp-Source: AGHT+IFk04GyrfIQ/xCcHfWI6fM7Ugl++aZYueL69OJJ2/biN6lzML1JM8gF0BcOdVims1w0J+IK X-Received: by 2002:ad4:4eac:0:b0:6a0:c929:7905 with SMTP id ed12-20020ad44eac000000b006a0c9297905mr1553604qvb.27.1714537783769; Tue, 30 Apr 2024 21:29:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714537783; cv=pass; d=google.com; s=arc-20160816; b=Byuln/z2PUEXLxGMZEvQWUd72lolXQCqFbFJGODxeI/x4izZnx1IFIoxxs4cqfbJkw Pwd1AdMI3oNY9F8WCpOa3GcSz0+JXHRQAGoYorsrhRnQrym4v3FMIaHRPJUWuqPJerfE uuH0JLWnLZ+lNScGbHiS1+Lne7bGAg4jxbOVy16Oay9K9YfmlxZYXKtdAWw3SUY/Vg6B Iaf+MY+/KeEuKVt/igwqs5WjqLEWkaqTGfOfIJqXDsLIK4Vi66NjLTWINr6bz2epDn7Q fyvOsleMi8h2wWsDDRs6m68DM5TX8EF5q4Mm/xlO1IZDPf2I4Lk98hlqk27r+z+QcNRQ 52fA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xzHEIPYot6c8NAo7TIBriZfyyuOfBQrBEKWQMBGEIB8=; fh=rAeF6VcsMB5QhCO6hf0UxtSl3kqGBW69UpFkH8dbKEc=; b=fIi3gSPrNgEMsBNXHnVP/Z6cCG4Aqu25iYXA+nMBi/VWGpTa+EErSJbf9BCZC+Abf6 qn7NYNsKsahTTFZh4H27m11NQlPbU20ISA/tZQJEXybNzdJLl2+COEf0wSkfBpljaviE 9kuvZcj+hqMB9iLjisi0g8rAMHcvGU7KX88yc35MuH7fIWRhSMvEHLKAUcfRS659Uv+0 3M06kNiaYXiIc7uxlXW8V5FnotaWimMyN6al3xLQmPNxbQAWt+FbyPVbggF7L+0L9fGr MAAIXxXOVcPEiFhNYTxujdzLkKjEyAAyP5ufs69vbnWziWhp/8Mx8Ae8+CY90WrwxGaz nctQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Chz92+50; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-164918-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164918-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jn9-20020ad45de9000000b006a0c99a9260si7226232qvb.104.2024.04.30.21.29.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 21:29:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164918-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Chz92+50; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-164918-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164918-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 702CA1C22A66 for ; Wed, 1 May 2024 04:29:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B078546426; Wed, 1 May 2024 04:29:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Chz92+50" Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (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 45F0A433D5; Wed, 1 May 2024 04:29:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714537741; cv=none; b=fnu7+3ooJnAjKmrG4YcEkGLqxzeYKiyMzpYPv+fnX91Yno/P7cVNfBw24+4l4ureQYgGXyRrEKjtc/QlkPRqSrwQPA14vWmqo0lpItWyfCzovze3lShwa8KbvYgSzAOzTT/5bN1gjTPjA98txvDCNgCvEdWbjlNAAispXAtUNXk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714537741; c=relaxed/simple; bh=hXqcsPpRih55X6qbkKifrC4azWi5ZS32nt4esjIky/M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ag0SGP+Xk4rLGXimtUNB9b/5+DTDdvIs+J+4A9sbAGbnXI//UQgdPSDd4MBYTqdSzpcqlpnV1AJvmQpYPjGyQgIRlH/abfkvn2JNnvRovCXHROX7lh/jsZP8YeGIsvOajKyw8PgPs9r2/s5qA582Qcdq268khCT7nZOVywzeC/A= 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=Chz92+50; arc=none smtp.client-ip=209.85.210.48 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 Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-6ee1b203f30so2105666a34.0; 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=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=xzHEIPYot6c8NAo7TIBriZfyyuOfBQrBEKWQMBGEIB8=; b=Chz92+50j4fQJgkZDEcnJpRmG1ni086OYTTWpXA95EEJQf+jp3jzOMKyAA/wcBLgfo nHXQvhKG8LFFnYMPLrEEEl3T+lNYuZ7Cr++OXUw7yzC4YQ4xvH50W0/wdj+ZZc+2x0jt +UIxGkmFOJtcsBISaLtQjHQ+xVrMh8VYYoN/cFvrWiCColepv3TQaHKYEuBNcVc0krJj XIuaYEygmQBBQqeE7vputb0qGLRGu10FYElZ6m6I0eb9Bc5QA9ih+UR3cJB9ogJnc6BZ hO0KCxHeu0CDc6rKAe6GwEXspMiWc5pVpG5aoOpV38bWgCpYKVAEWPCyKG7BvGzamuEk aADA== 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=AkTfVd0ldgg1d367bCcKmdFS3yebR7nLQWDaMezg8TNYCg9gX89STx4oIyPLMcLZAW Il1DX/3umnnnC9YCqCy0/WPT+PhDEOd7O9/YKxoT96VpLOPErCnxMtUGfxEqB6gcZwhV IxrRoZKja4ULGpHcCJPC7WGn/UDXWKKfVNOs8+gGC8dxlW+oi69fx6QpXxqmlhK0E5zw mIdejJfM0MfoI0Dd/l9Xz9OGBLSWIOkH8PxIuXBOQGcq6ozaJbXkKZaqWLqG3hYz0gK2 50gSUFqyuWefzc2g/QBBtQoA+xRLS0NOrh2Ppppayc8Z4iU9XDUt88h5gk1SEMFN1vT1 23xg== X-Forwarded-Encrypted: i=1; AJvYcCUDaNL9gxVayNHvXniw2gEfybA1IYUBhRG186AMcEJEw2fPpMFU36c5NODarb70ZuKmroOFGPArNRoJiidGxIpOFoY3gSMSk2Hu7VVt8SKEmt8db2Efi1mvF5JS7qaVeLpqdHuLaKRHYP3FLHKiNAj0G2xfgdxH9za72ICZUS+D/Thxb0Rj29ce+o1gIgZrrTx4WLN7DHZ1FW6nmlodZj06WTWwU7Uy5lrLzG+LNDlKoDksBv0wCfC4wy/DKVQ= X-Gm-Message-State: AOJu0YxoFU/IVIeEF9o8NvFUi8SmxwaPCr2kTtXg/6IHQ2Mghr4XWohw QItzzXtIlUGicV6QnrpON9P4wZff1kfCXuIgVFnTpxXmasG0xyyt 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=20Wilczy=C5=84ski?= , 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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[] = { -- 2.40.1