From patchwork Tue Apr 2 19:25: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: 13614495 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 0DBE315B572; Tue, 2 Apr 2024 19:25:59 +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=1712085961; cv=none; b=P+vb+e+qwKtaSD7DXMlYJ32jzLQgUd8btUvEDiykmyyhbu21anuihVD5p1Ot05ZthU++DS40LMIkssIw19z8sV09lTDwnecAhAO/fGBVQ4I56aljv0yxT0luBqVtdQ6DlUyVGewPmLl8RVXkivXhakx3EWT3TKmUWjZtuKiZYCM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085961; c=relaxed/simple; bh=VAM/iIbG6sd0Vm+9c5LNdjtskIH9H5a/W1Fyy4k5ba4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=IQDsKQ3ALSRFMQben0IY3oxFWgp8D5NmebXRlYnhI3aWTxKXPFG+fisjmh13TtuwCdza8SiAwazcEe7qO/BdQUztj3FrJW6OgXNVaSLCsjocslyV4HORJNDhpUJfeD6LPSXkwMnzKx0e3h8h2hC1CtBvrRk9FZIA+GG3Q/IlDAI= 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=GkN7uyow; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GkN7uyow" Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-6e6d063e88bso4052058a34.3; Tue, 02 Apr 2024 12:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712085959; x=1712690759; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Z7rhLLUMHrwedBH2pvRBxfgtMkIBfb1Wwm96WdNqdmI=; b=GkN7uyowaDLZix+CkSyIoPeSHFu4zIjw+yamkUNh0I6Xj6ftCfnkfa8OoS1jUWnsju 2Jr30n5fmIrAizYTBO0aAW29uJBX0dd6PAHv0hrFQeuwLtJCYQdzbePxMWhn44Gbpjxd Rw4o7Kd50IE3xmtOA3jodyX8eprupfLpwJQBIciJg8qOOiWhf9G+jOZgE7oQ22ojlfIf SuQZ16OhFgVdoSvrQPC/ALQoGSzaEHDG/5WgMrJAKwjRKmNW4cjyQVyFthHH9K6d8hVl keqBbvWDQ3mKxj8prLvd/GPtqkZgQsfkpGOrbWbxSmo+c6Fe5Rgc8ZjrBYkqsK0WUNjG 61lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712085959; x=1712690759; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Z7rhLLUMHrwedBH2pvRBxfgtMkIBfb1Wwm96WdNqdmI=; b=wbyJWRN3RUsGot3LvdTYGs5d9wciPtItYHvXDLSbpHM0zDBZrydauNOV0YAgS2KIz9 GJkVQAEQY51RwxqV3yk2BFz8fUTG9niPP8ZpwS+Lb6HIoDC6lw6fyJ5eHW0+X4wd6ziY FyT8IDY2CwoGlr56ST04xYk/SrWAHX1opDZzB41QzFCOrtzfN2MXM1D0hBYvZH9lVItE aLD016tIr1LIjRAsXFbbcwwHYw9gDDZBXE2sQU5qpT3th0T4DFvTzy0+ir3UF+l/mqo0 1i/sBmGOhc/nILxSNM0unEn4PAtO9MaVUnV2wA5gT6NXSJzPgUhmMPATB236h+n+PMg8 wlkQ== X-Forwarded-Encrypted: i=1; AJvYcCViUfC8ZOB0BJCyODuZFIPgZGXpDnLc5yD8M7LpzL2FtD2GbfpORS5nsZ3ZyCqQxDDEx7QsxdDIS1fMnxYTU33wNn1V9+KEdSvR72jdUQte8acq8tGZkS9z8jwiGESiADhgG6Zpf0PNVHthnyUEnS5vHVG6gwxroD+dsMgCLwfWvmAkF0LqJPTM4p8jnqlrF52Dyu/IfaSvRS4tkCKABK2iZ7w= X-Gm-Message-State: AOJu0Yy0sqTCGd40iIqWNhLakCBZIzgDYPQ7kLyTckAFrRW0qUtW/HkA lRfwseccT9xdzgqf4yT2O6uENo74Gp9KTHAL3MK0TSWQY6x5+v0t X-Google-Smtp-Source: AGHT+IEYE+r10McvEe1VUzjmFZOvDyoNfheZXGqnaJ8aS0qLvbp8v9xO8DDJgW+wgkaDNqWfMepAIw== X-Received: by 2002:a05:6870:fe8f:b0:21e:e6d1:616c with SMTP id qm15-20020a056870fe8f00b0021ee6d1616cmr15659554oab.31.1712085959028; Tue, 02 Apr 2024 12:25: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 ld22-20020a0568702b1600b0022e8f9fa89bsm75622oab.57.2024.04.02.12.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 12:25:58 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ansuelsmth@gmail.com, robimarko@gmail.com, Alexandru Gagniuc , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/7] dt-bindings: clock: Add PCIe pipe related clocks for IPQ9574 Date: Tue, 2 Apr 2024 14:25:49 -0500 Message-Id: <20240402192555.1955204-1-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-arm-msm@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 Tue Apr 2 19:25: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: 13614496 Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (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 9181515B962; Tue, 2 Apr 2024 19:26:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085963; cv=none; b=j26c0ElQx5n4l4YIVuNbRzt7lxLiojM/oLLp9JwmfHyCuj+DMKNw4m3J/Ngj+oQKQXtAOa8wCIzVHyd6awOTlojGg+CU091VgqQ5YGhgBgcMZEre5ceWgAyM/B70jdoL/JS+/DuRPG6fMRRB5KmazQhUXogEX8YDDCQ0JrwdSq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085963; c=relaxed/simple; bh=rqIqY8Pohnzmuqk3e+iotC9acyr1TG4rYOT2z0aVar8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fLUNbB5hJh9KqL2IqmLKxxQUrX4UrgOpdXXuiiEvUQglLTGwB2OsKWRjhUH2OBrN8RBrzCwShDLGcevu1xwc5GJyOfrEEu69W6BAUvywZ7B41dItrpTAzuJyRj9SLWLxbX0kK2MMvY5PEhRmOL6eFK60DwKb5tYAirKo10m1i4U= 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=kNfmZUSL; arc=none smtp.client-ip=209.85.167.174 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="kNfmZUSL" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3c3d2d0e86dso2642662b6e.2; Tue, 02 Apr 2024 12:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712085960; x=1712690760; 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=pom75eUhi37RZhKWTh9yAvX/1ryA6862dvJ+xgfIpYg=; b=kNfmZUSLVPj5YBv4azog+2ySS7FRJEBCRTE7V4P/dfK1Og74pvNxKEFupzCb77Qeaz +LGZc97ytUseudVV0yntQX9+fZiwTroo0hwe89mlLC2C3WnbFrm5BtsOUcesukCGxoTN 5/N90cOXbPPz8FDyb0JbCt3Sc0HuLp9gGhMFGixUfjOyxJL+IEnyamqufEqY2JzaPasu Nzecw8tgfPij54KcXumkqtpIJ5pU9jeF4fGGGmOa9351X5w/bCv75jfGFvpyUjkPwb8c O21jlsonle4cNoUd4i2W0AH9BOyG93+Rs0EfD1uOMCKf/GKpkbydMkbeI2Z4Q9vb9U6Q iJTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712085960; x=1712690760; 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=pom75eUhi37RZhKWTh9yAvX/1ryA6862dvJ+xgfIpYg=; b=jYpU+8RAa3tfmMo9XwCf4W8UBrPYz1ZmrwoZFU+Cse7a0r0YqR0N2YJNUBRqbYpGqz rxgUWsBOvbeSPTP+lC3iJPBg/tvj5az9k8zR3GsToMYGk+W6ssWx4viMroDCxYdracPf GCu7Gf5vU4kknevQeTQxPITksbVim5pQbLrPQtHish6W+aifF7mUkkxedmC2Js2BfEKr ZLOFN7r+2vS+yCR/KAmz5fjS4QIfUABEMGslAAcYIG+oZ9Us4dTZuL2OLxV5p+PMQyXG G568YhWHoAq6lpDc1Wl+lal/RZHHTW8ySecQyRpioP83Q3BBlOLQRLOAjqcaZ2YiLg23 gjjw== X-Forwarded-Encrypted: i=1; AJvYcCV7EHjWw/3A0VR9gOUF0uL41dwVPqEpEHoVUz6adO9xYt7D+zCoCMQ2/n8KCHQwM0jjdA/z+ZcxRFW5NuJpaPju9jmjp/gLINCpWdBf68zKdFwjoUmCx8WTQHd1aNPLfAE0UAO13fu/5+Ug3rsgf/QHCYM2HveY7nL1QmZaXKptIztnPY084A== X-Gm-Message-State: AOJu0YylzIxyJwFNktRqgCfuP/2At88PBWcIBxbmSVHBy8EIi6E/O0bd gWH177Z1oqM4XplFPjNvI7qH4+w6UdeFPqvmKcXc8+rdE+Fhmk4bNowSziOGi406hQ== X-Google-Smtp-Source: AGHT+IHYnfPF54gy8f3Y/NUMbU723oorzfi9/LFy5Vo6sH81HJBz6iySqGML4RJHoZG2VquGkcsCvA== X-Received: by 2002:a05:6870:a552:b0:22e:87db:b6ae with SMTP id p18-20020a056870a55200b0022e87dbb6aemr1645488oal.54.1712085960469; Tue, 02 Apr 2024 12:26:00 -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 ld22-20020a0568702b1600b0022e8f9fa89bsm75622oab.57.2024.04.02.12.25.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 12:26:00 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Michael Turquette , Stephen Boyd Cc: ansuelsmth@gmail.com, robimarko@gmail.com, Alexandru Gagniuc , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/7] clk: qcom: gcc-ipq9574: Add PCIe pipe clocks Date: Tue, 2 Apr 2024 14:25:50 -0500 Message-Id: <20240402192555.1955204-2-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240402192555.1955204-1-mr.nuke.me@gmail.com> References: <20240402192555.1955204-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@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 kernel. Signed-off-by: Alexandru Gagniuc --- 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 Tue Apr 2 19:25: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: 13614498 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (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 61E0D15B987; Tue, 2 Apr 2024 19:26:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085967; cv=none; b=U6OSJAOE1pcitCb92zVTovLL4h0/jC42nmWOWhBUPS22eh810SvIb3wLV2Wbgx4G5e3yUaSFcCxBH9xMzcqYvGNGFnbxKA1uKWO9pzwuYst2d949Sj9y2e1H9uVclDimnxYkS9htC0ySlPNKAlAImf8MBxQw1TEG/dBkF1XpzKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085967; c=relaxed/simple; bh=GmSN0myd4xbipdydgTiAn4GDoy3OMepStdn8UQkbyAs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tpQQi3XCFngMtj7F5OPA1z/7JAVOhX+59WrhWg8l8vnuHrH5s/+79TRcCO3TbrW+RNzarYF2UDtgfruzlHc/0X8jk1bZhOILGpDnaTrAECl4+BoQjXgqZAzU5IG2GHXPTxckFb+YXrroOXYHgXpkf9nAG3gHq5xWvUv6mLTXTs0= 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=Z/NwwL2e; arc=none smtp.client-ip=209.85.160.46 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="Z/NwwL2e" Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-22e8676c670so240104fac.1; Tue, 02 Apr 2024 12:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712085962; x=1712690762; 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=BhP+v60iBJxMjaZsBicLjvrTnnhoRviR8rTJgE76tf0=; b=Z/NwwL2e/mg+48wbMkI0RgKp7rnGaA6quYTZCt99SU+lhap3VtVY+sgog+FhoVdNRr Shhbar4BUnMQ/nOvIPE/M95P6g5uHSauUZ+AOF/R/2Jm6RcNkwvmooTOFvyi57ZGcheW tJfKCCkv3W9uljMPvlk4lFzNWEwOP0Y0FZMHEz9tf/F4zU3V3QKybxYBj6+H6NGOZCja r3kYNM7J74MPaEnmZ2P+oGSBrQqwLwOteLNiyCEhR+v8GFt45WYOcKb5j/VuX8iiYZhQ Q6azRNRHl2+/v8oV/mXQYfuGm6Bgmib5zLxMKmog4kQL/NNvqd/4tQQmrqRMwvUOIh5b MyVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712085962; x=1712690762; 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=BhP+v60iBJxMjaZsBicLjvrTnnhoRviR8rTJgE76tf0=; b=xVNL7D/omDET0+ADMKI2Ln5h+TwwZ1omzODspaHTwvBqas6oGEWNisDcB6DkuppI0j rxbrrpRojd5O+xNER5KeJaHmYpk8v6z/szWYbbM8o51bQQ0qxTQGmF0TDs/fPT/N/3ro m9Rbl3E933w00Ii+ClS0D/n55CFVoXDe470u3jp6x+sGtai7WpjqVCrELAiFh3uSof9x qM+W1LRcBo1LZ+QIQbWPHHZr+/uPvJGhdOFRdC3uUAPKwpcph3aZBlgjcVqqdVqEw6HV LFnUInquXqZ4ch0IQO3vlbY94w6svvcRU0Rz/r+oqMeyLs/XXJQ8ASahpXXBMQTab4VO u5lA== X-Forwarded-Encrypted: i=1; AJvYcCUtMGKugo5iviFuzbTKfizHFqwbiLKjWLRcKLBd7SGSDg3BzAHImVZfBdFI9xPTnIbvkAlrTKbd3bxwBGWU3WuE+VwG33uiNzC8l29hYQ7u8cxgQS+YiCHSZGZz0JfZxa+f5B/fS/l3pKesI9e923VxZZGPFf4afB46hTH/Ni9zejyk4BJ6T6EzyRjdvXB83U0QnATMQvs03fHAGOuIEeiBb4M= X-Gm-Message-State: AOJu0YzvxeyQAJjKVXVKcrUremWsld5NbOtiozdorC/ExC811rPiwQQf +v+iikTaVocH8oAMLCqLpMLDmeHSc1N4qYKi086Ep6ziDs/Sgr/d X-Google-Smtp-Source: AGHT+IHW9Et9K2oXjGb440sE7RzwCVYx05x8qvURyKd8DxZ2LaYz61fAik2owFUjpokxq5K33U6IEw== X-Received: by 2002:a05:6870:b6a6:b0:22a:7b20:410d with SMTP id cy38-20020a056870b6a600b0022a7b20410dmr14833598oab.33.1712085962264; Tue, 02 Apr 2024 12:26:02 -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 ld22-20020a0568702b1600b0022e8f9fa89bsm75622oab.57.2024.04.02.12.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 12:26:01 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam Cc: ansuelsmth@gmail.com, robimarko@gmail.com, Alexandru Gagniuc , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] dt-bindings: PCI: qcom: Add IPQ9574 PCIe controller Date: Tue, 2 Apr 2024 14:25:51 -0500 Message-Id: <20240402192555.1955204-3-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240402192555.1955204-1-mr.nuke.me@gmail.com> References: <20240402192555.1955204-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 IPQ9574 has PCIe controllers which are almost identical to IPQ6018. The only difference is that the "iface" clock is not required. Document this difference along with the compatible string. Signed-off-by: Alexandru Gagniuc --- .../devicetree/bindings/pci/qcom,pcie.yaml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie.yaml index cf9a6910b542..6eb29547c18e 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 @@ -383,6 +384,35 @@ allOf: - const: axi_s # AXI Slave clock - const: axi_bridge # AXI bridge clock - const: rchng + + - 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 + + - if: + properties: + compatible: + contains: + enum: + - qcom,pcie-ipq6018 + - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 + then: + properties: resets: minItems: 8 maxItems: 8 @@ -507,6 +537,7 @@ allOf: - qcom,pcie-ipq8064v2 - qcom,pcie-ipq8074 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 - qcom,pcie-qcs404 then: required: @@ -566,6 +597,7 @@ allOf: - qcom,pcie-ipq8064-v2 - qcom,pcie-ipq8074 - qcom,pcie-ipq8074-gen3 + - qcom,pcie-ipq9574 - qcom,pcie-qcs404 then: properties: From patchwork Tue Apr 2 19:25: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: 13614497 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.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 32BF115CD56; Tue, 2 Apr 2024 19:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085966; cv=none; b=SEu12x4IkgTcaIWNLyo6NyodxTGXDS0mNt00oaARjYCfaXQQF8Jur8P3THTjHNZMXtvIaw6pw28TdFodyJlQJKlUW2IH48pu52OyKEAajMAo8FW+7Z+euVFj7T84CjxbfLtCZuzhbJWGb7+6ZFlpHYmThB8kitz4LA14gCVcpAc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085966; c=relaxed/simple; bh=Y3sQe52k1yICnNk6VsdMH27lecC3GY2DlpewVQmBUI0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KfJOjZ7ew6uC6EON7yevdJCEP2dAhtOC3hZFwEHRZMTevSqnGizaGTVpQGLzJh63gz65h2J2h3Xxm8b47q4/QJhYbYVqh8W2dkKXBn13ejmVKFqddIbX+JePDTTvgKSrU7do3vggDDvdgqwwjzvDT5V7iOSBrmwUjZcdXJ7ngW4= 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=Tr18FGWj; arc=none smtp.client-ip=209.85.160.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="Tr18FGWj" Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-221a9e5484aso3768413fac.0; Tue, 02 Apr 2024 12:26:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712085964; x=1712690764; 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=Tr18FGWjEOEZS6x+L5oiytweebci5kfquabcQS/5Lrl7kK8s8OHbQ/5p6XFor88Tzv u/JLvY//oCZ0uASc7bSdWzf76QIx8gxlEO67r/bJGOWpDNOu3d1p91sSYW3KtZCobnVC 7RqtPOd2wGMJy960XutmRNy7ak4aIH5U6w1K5JpCQacU4rpxX1TIdYdijYd/qbEh0h0z prZ/2JTqF3kXlB/iyzTZxlQtPYJ+rWybzNMKUeUQmcbd0TYVyXmbb5sZfDMngcdiqbp0 9YS9u0QUTaT6/RRlYM+Z7cCP+GHAK0pZTrDugX0hGe/atdJb9lQbNaWdPuaAw63VPuEb wNVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712085964; x=1712690764; 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=hOe41AOo16w79Z+TVYhR2XPvVRyXb7jsiV5NaZB8bjtJED/g7/jx1dqPY5xg4xzQ7Q rzuB2pFw8WrkBhISEOIrknkPcWXIvbPZ39WyydaWZUFZyeOzNSlacpAN5LoZ39Iyp4AL 7WO4rtV2OZHoGKZtOIGYsyKWH9COHPkGmzlYjS6O9XWl+e3ZfXNTwnsGM5AEOUqZp4bH Os7ucodUp8r29lFRnHGTE8Moi0qhNjpFaJLJJRetMTJ0OO/5riK+82Z4+9tKsE4kaLhP 4tV/Py9Ni16q3Er/oaWUVDmJxJTTd+uBBsGgvhrUsWWTh8nThi44l7o4zGRnsPRuK6Ao n9WQ== X-Forwarded-Encrypted: i=1; AJvYcCUiGy/KRyylaooJEc7OXAPzNQKSdf7PHSZ3/ds8NGIQOIiC/baamZl4K0dJ202JCjgZqyOn9LD8L6tonU8JOxhf8cZMfDuED2ax4EEznOJZOL5PM3U8eKbsmDU2x37J/tvp1hz3l0GS8lCy2qO14RoDTxNMYlLhgNCvh5HQS1Psn2gFxQGISA== X-Gm-Message-State: AOJu0Yz5WdmPEYMXXS9ZhFjCYqoS6LI4gyfZslgPN/77C46sk9tWGAut 1azDgCgnXYrlT+hWhzh2L0EBHyIelmqcBKgJslpp+41tz9NLuJRo X-Google-Smtp-Source: AGHT+IGXiX0R+pjBUbuLZzc0JHffXaS4BXKCPOLEoUc822a2Ltjo0ljUMsaoACrgDM5sNkY1dTpe7w== X-Received: by 2002:a05:6871:1d5:b0:22e:7de8:c745 with SMTP id q21-20020a05687101d500b0022e7de8c745mr791919oad.56.1712085964262; Tue, 02 Apr 2024 12:26: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 ld22-20020a0568702b1600b0022e8f9fa89bsm75622oab.57.2024.04.02.12.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 12:26:03 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas Cc: ansuelsmth@gmail.com, robimarko@gmail.com, Alexandru Gagniuc , linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] PCI: qcom: Add support for IPQ9574 Date: Tue, 2 Apr 2024 14:25:52 -0500 Message-Id: <20240402192555.1955204-4-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240402192555.1955204-1-mr.nuke.me@gmail.com> References: <20240402192555.1955204-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@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 Tue Apr 2 19:25:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 13614499 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (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 B52CA15CD62; Tue, 2 Apr 2024 19:26:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085970; cv=none; b=nSp5LkSYIxrOVOJmP0kS9LEfLb82XWoUUjVritnDK+IFpZNM8ThHEZYH4TUjLegZXJfQYpwo5YzrDVVHK0xESAL+dKm9KKveGHR5zKUdRxzgSdFo0nW5A+fQ2hsKvenfUY4tJmDm2leiZPhOKPKhtf6ntCCBoW7nyrR8piCFY8g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085970; c=relaxed/simple; bh=5ucQylLBmNZMdQ2th8/CwEafp/XtJqR0xlhv3q0n810=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q25ebGv/b9iSb6EWil0Y5oR4tM7bt24cth6LWAWo1jsC5ZiEFaozbEhpf4Zdm5WvqtM9rLjGpzMqSFYv9eLVlYPqUgry4ge8y53NuZ5yx2bLGiRFHrj23q4HzBZ4rcoyya10YwJpKUulj+PC2WnwLsDNX7oUVuF9DE+U68T1wbY= 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=AjZ98rGd; arc=none smtp.client-ip=209.85.160.53 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="AjZ98rGd" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-221a9e5484aso3768425fac.0; Tue, 02 Apr 2024 12:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712085966; x=1712690766; 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=ksI6IPEsjFKiejyXpxCVyS77n8b3/e3zALrEpFbnmzw=; b=AjZ98rGd7MzFtmbI+Fwx0fBcGmR50eshJMdyXr6MYU1qTCwq792PJ70MNoFgTeeezU Lr9Xg7k2HJotLLj7Av9aHzing/OL2p+0mKjAiylmgrCrdr66PMksrG8Vb5klAEGji0v9 vb1aqYVO6sRDYvg8S/RkFR4ZFen7W5eMJ3D/eZgiQLt9eWlZ2IsAavisTkeuMAGJh5Uv DXQsOx/St607l1JDbGnV2taiB8FQzvRLF31Nd2G+R7ePhmT2yyBiTCFnNnGrs1B4pdtl /zipr+vThXSvIuoKMKBIJvvhK/5o3SiUktVLjXQ6OHb3kfOVSlWUzPViwjGQX8ULydLM 8GvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712085966; x=1712690766; 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=ksI6IPEsjFKiejyXpxCVyS77n8b3/e3zALrEpFbnmzw=; b=nv8KH7qZlaN8MKIMitilaUXtdhVLWmiKQ08vFyoqbZpSxpgEHXhifPVLSD9WbfLRA3 a4myJJgxJMHfqV9ylxqXYC+aGXjnuKjGFDdVlCcEMTzc0eZZfic0xE8VKRvtTQPdm5us RGIiDHbhmZ63QFpiZ5pmu+fXUHNUxNHV4t+7yXRSTpxX9fKR98Hnj8HkUBMRuU5hHFXf fJ0j4Ds82US46OHFW3Ryy5m4p8hVdSmialUgT6gWzWRcMN1wxYy8Ug/o82DiUoguIRkU kvweP+2ZOWCrWbuPeXDwOnfpunSEatIi+4qJNCsb3u4PzsCJvRXa6cIgOtW+sNDAvGI8 O+Cg== X-Forwarded-Encrypted: i=1; AJvYcCU9CKOLbOTsZTllusS3H6L6+RQEIZxbJwNGHch+YinsC5XtJroAdvsTJaAvxnvmshp9LDWoLKuZ0bNKG982FgAIKhNYCPwLCdtlh/OVR0n/Hb+93k4Kmtx356KQD40UE3auR6T41lc5Qz6JVKiE9jQrbNntn6MMJgbJNt+krsCt2YmX1xN+rkc= X-Gm-Message-State: AOJu0Yw9gOZonSpD3UkPKUYC6EaOybh2EHut4W0FX/bUu/Qa3AHyzof+ /2PvgbxLoz1Z2ly7AGF1juSEEPz3vGmDaXSYL+C8gHmWyQsC8j0H X-Google-Smtp-Source: AGHT+IHrnf/GQi55EqJXprDYr6y2oDDZ5H+PyWbIk86tp5RFeDkWom5A/9nkQ0o1HZf4XwVgi/HBcg== X-Received: by 2002:a05:6871:5813:b0:22e:15fd:e247 with SMTP id oj19-20020a056871581300b0022e15fde247mr840978oac.5.1712085965864; Tue, 02 Apr 2024 12:26:05 -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 ld22-20020a0568702b1600b0022e8f9fa89bsm75622oab.57.2024.04.02.12.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 12:26:05 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ansuelsmth@gmail.com, robimarko@gmail.com, Alexandru Gagniuc , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] dt-bindings: phy: qcom,ipq8074-qmp-pcie: add ipq9574 gen3x2 PHY Date: Tue, 2 Apr 2024 14:25:53 -0500 Message-Id: <20240402192555.1955204-5-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240402192555.1955204-1-mr.nuke.me@gmail.com> References: <20240402192555.1955204-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@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 --- .../phy/qcom,ipq8074-qmp-pcie-phy.yaml | 47 +++++++++++++++++-- 1 file changed, 42 insertions(+), 5 deletions(-) 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..b0dbd2726acd 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,19 @@ 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: - items: - - const: aux - - const: cfg_ahb - - const: pipe + minItems: 3 + maxItems: 5 resets: maxItems: 2 @@ -61,6 +61,43 @@ 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: + items: + - const: aux + - const: cfg_ahb + - const: pipe + + - if: + properties: + compatible: + contains: + enum: + - qcom,ipq9574-qmp-gen3x2-pcie-phy + then: + properties: + clocks: + maxItems: 5 + clock-names: + items: + - const: aux + - const: cfg_ahb + - const: pipe + - const: anoc + - const: snoc + additionalProperties: false examples: From patchwork Tue Apr 2 19:25:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 13614500 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 A1C8615B969; Tue, 2 Apr 2024 19:26:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085970; cv=none; b=iKhMwu3SFNVNvoU6Z5b651PMZTrMqo42mPzZXMJLs1BDc1P+2tU4jDigdHP+bJA7IS8XGwqeQZIRE+IibnBpjw917L3Hgr1KOHlw/WXBByAmYOT7yY7pmMR3t5PiuD2dNbv1pNo6lpjwtRbF8URaMFzuogbchN1n70UOMbeFleE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085970; c=relaxed/simple; bh=gCU6B3uvdLUaczU4ELIoBYD38r6aQ3Up/zp6OFGe7aI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HgjNK2e7GdRKMNzCqwEs45lgW0qq6oSROoKZLN6ZLLzyreFQiuVGxypUu0pcqp/CIhrqMIQEuQTBPmuVOTcnIgsk9uu9YDqD5E5KYXzhQWIRYvvA5QxAaMS7a6FgpISs4ssnksLkx3bN6dxoPCLverBYy48fiIHSNeKWmQYUfSA= 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=QaZRQxQE; arc=none smtp.client-ip=209.85.167.175 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="QaZRQxQE" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3c397193878so3223633b6e.3; Tue, 02 Apr 2024 12:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712085968; x=1712690768; 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=9CmVP5Hh8dG59TCd7TW8prCA1zfAlBRMGYtvVfG9JuE=; b=QaZRQxQEnGKynEharScSbB9/Hmv8pef2fSBhIibwLo7sAzudSAhTF+rI4ozvNUHrSy Dc89Gg6TjUpgHFl6jS0itXPdgQ+TP4SOnNyXfjKn3CcLjuRu0p6Z/oilb+N0e3Jc4jaL fozpo6aSu+G3PXiH3U+iViWN/vQJfcDUqQc4CKRRODlTdRxVWiFOm0lW8D4cR3wUFnHa NBSRQNa3+0WSGOg7kveLZ5+89tK9TxCHv2voT45P4SKjyE6Jnzr3GFbAQFdNaglIbAB6 xowtwNfh0j3GJriu75HmZI1EMouEJIX14bIvokX0CK7z8bauS7jGpNlOzB/i+T6k7F0C rB2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712085968; x=1712690768; 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=9CmVP5Hh8dG59TCd7TW8prCA1zfAlBRMGYtvVfG9JuE=; b=MKa2y0LpXR37r9sVCO7AVQ+jlnidd3HyVeUKyZilHSV5QjK2IXNFjB9tV9/G+l/TRv xqVUH4rUhVcsHxRhmO5DwUGsJkeuuN3tUUcBJwd3uhhvLNPe9wytqeK+NN7jNM4Fk5B3 XqVezVjWCK5dTrgTkX1Kh64gYHGYYwQi39+pdCeNZbwMLjm137u+uvfFUzqNu8flZBwH N1ipTov9ykUJM/EFGMLPrurGBFIlvRoTBMr8h2QOLvmq5Fht8plLCLazm15Q58yjJzTr awo2bCja7ZYBhZEBNX22pqc1jyNeayAazD0EK2sWCu+owLJJj7cGYzW7sjDcJQQkEUmt ZY7Q== X-Forwarded-Encrypted: i=1; AJvYcCUpBI6F9q0kfZF0fNdlLpeWID+xmn1YA4e266j1cj1u/Eqnw0yL2cq+ylqysIMEzbFnOUgNIEgmkMtbOJHBlEWla0QTWpilaq2a4d83XgGcRhcpneQHLfqvdmNJHQsMpT4wuta7BdhLoU7kyg== X-Gm-Message-State: AOJu0Yy3ZvylhddpXy+WbqFk7wuygbZDbuyDw76l9em7E4d0zu+qQCGe BggS+yH78u/yzDwcGComC8FoidYMpYAlpw9wOgOHpHOxc1XEsyjY X-Google-Smtp-Source: AGHT+IE3kr/SC20NEau5gLGXlfmOBkhKLVlWBm5YHfo38q0NpAX2e8zZNh613rHeLmubA/8m9uDsFw== X-Received: by 2002:a05:6870:2411:b0:229:7b8e:6b82 with SMTP id n17-20020a056870241100b002297b8e6b82mr15595305oap.1.1712085967457; Tue, 02 Apr 2024 12:26:07 -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 ld22-20020a0568702b1600b0022e8f9fa89bsm75622oab.57.2024.04.02.12.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 12:26:07 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Vinod Koul , Kishon Vijay Abraham I Cc: ansuelsmth@gmail.com, robimarko@gmail.com, Alexandru Gagniuc , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] phy: qcom-qmp-pcie: add support for ipq9574 gen3x2 PHY Date: Tue, 2 Apr 2024 14:25:54 -0500 Message-Id: <20240402192555.1955204-6-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240402192555.1955204-1-mr.nuke.me@gmail.com> References: <20240402192555.1955204-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@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..f07bd27e3b7a 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 Tue Apr 2 19:25:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Alex G." X-Patchwork-Id: 13614501 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (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 7CD4B15D5D7; Tue, 2 Apr 2024 19:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085972; cv=none; b=chfkIEhQrDCQ87oHuZCEQOeHaNZjzsIWCSwUTj2IobHvdIXY3VoR+JqUrLIiA39FPDTJ7bjc0xpFMVWXC6nl0hPvzN0eij+lYWroC+1cAJa5u8JaRHq3XqaNlQyBPLjUTNZdXIs1KisfyiemDHVqL7zHY64EOJIW6K911T8+IXQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712085972; c=relaxed/simple; bh=/VSl3wZKyIwuEwY7TgsCPPeb3wNORKpIKGdAAYrcDYs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XKuos/t9p10o6Ijv065QULEQPUy2StXFA3C5fr+KV0aJIbCSnBCh7Prkjuxpqev1lf53mp2lR8G+fQ6adEkq2iUAohecNeRB1MdDkg7bPCKrWdo8mAS0wW17ZZzEIDMYbealvJE4p3/GgRb9oc30HGLPk3M+LCcsy3bJfLZvt14= 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=mIdXGCQK; arc=none smtp.client-ip=209.85.160.53 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="mIdXGCQK" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-229a90b7aa9so3121560fac.1; Tue, 02 Apr 2024 12:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712085969; x=1712690769; 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=TeP+ZiPVK2O/B/xHr47tR3SibDp7prxbvZDTXMdKMlc=; b=mIdXGCQKbH+LMwPbi5guwxKuQRMhKS5vUv+wHvfJY3ZqD2VByL7HVjcC6HLa5zX1/L xky7WNrqbJdUYNAGctjIyGnsx9QvPnrGj/bmCCHufMggqEXR+05wiSD8kCe0pAlUJBuV GiIqiertIsTjMkTIvLsi1M+px+4h+dgvlsHnZO5kWBZeUrIayDfGtGjQ9P1gu1qAQHER 8s4WlL0YGUGq+grM6goieQ95Z0H/7+/wC+V8JrSh2gywPCkgYBSIkRo7X8/Jge7qZYOT +hEGY9mgyJ2VCYt2fA8+P5axcDCAhzmKOicfYZPimMTqBnc71qVZTuj2Kr+hwP1D+AaM Fw4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712085969; x=1712690769; 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=TeP+ZiPVK2O/B/xHr47tR3SibDp7prxbvZDTXMdKMlc=; b=iHizMeyryQ95kGKug2AoBp3NPbTfmadRmFZl2ase7eWescByOPp2AG1MIXxR1wZeZP tFIh22Q5OVRoPuM1ONs3df513i6FlNwETtzgjHuxT7vRn+NR+mLI/qk8rehbrwHJg44D K3le4sM3aOG+9pYg0TOIZ0p7DXtqt3sxr6A+itk1P+xX9lDe64+4INDhQs+1Plf/qTpq IkUcrN4GPTVc6A27OsoL+aenopcMfYID1hzd/4Ouiyjw7VwOrW4z3HFqfkVgKa0LG0xM wqUA4udQ2wKJ6N7QXFPuIk7ALXSc4849rqjhi3sOWXDDiX1NT4qu97zf6tKfoUTPamFq YsHg== X-Forwarded-Encrypted: i=1; AJvYcCUvDEo0fM+dlnnp66nT1zwOGXf/Ug61Fjvmh7aUJfb8H3gtOpHFLZ0EoWBPSxJPFIKbnnaJQEXi4Fo5o0bW4taMFF/3hFSJoA6M0nmtoP5FKZcoJamPD45ysWF9Dw24Kg9jxaViWlX5953sLhJ7AAKeEWsfNAkiZRpci6aBEoFUGmRRsEZfkl8= X-Gm-Message-State: AOJu0YzPJc29L1RTrmAMfFgl5/AgHAgLIIZBCctpBh03Gp0GUy1DKMN5 oXbx9YeqvCPHMLmAtlN8j6plXvYApSG4osGmij+5Q4189I7km9F9fuqfcxhj19QxXQ== X-Google-Smtp-Source: AGHT+IFa4mE5kxX2rXYN7XcRV4dgfkxt8MAA+EuMndpCe65Wpc1gLseE1+DBs9qgMTbW+D25156b4g== X-Received: by 2002:a05:6871:7981:b0:221:bd93:2940 with SMTP id pb1-20020a056871798100b00221bd932940mr13675521oac.27.1712085969453; Tue, 02 Apr 2024 12:26:09 -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 ld22-20020a0568702b1600b0022e8f9fa89bsm75622oab.57.2024.04.02.12.26.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 12:26:08 -0700 (PDT) From: Alexandru Gagniuc To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ansuelsmth@gmail.com, robimarko@gmail.com, Alexandru Gagniuc , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/7] arm64: dts: qcom: ipq9574: add PCIe2 nodes Date: Tue, 2 Apr 2024 14:25:55 -0500 Message-Id: <20240402192555.1955204-7-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240402192555.1955204-1-mr.nuke.me@gmail.com> References: <20240402192555.1955204-1-mr.nuke.me@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@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..626d6359d750 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_qmp_phy>, <0>, <0>; #clock-cells = <1>; @@ -745,6 +745,97 @@ frame@b128000 { status = "disabled"; }; }; + + pcie2_qmp_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"; + 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_qmp_phy>; + phy-names = "pciephy"; + + ranges = <0x81000000 0x0 0x20200000 0x20200000 0x0 0x00100000>, /* I/O */ + <0x82000000 0x0 0x20300000 0x20300000 0x0 0x07d00000>; /* MEM */ + + interrupts = ; + interrupt-names = "msi"; + msi-parent = <&v2m0>; + + #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_CORE_STICKY_ARES>, + <&gcc GCC_PCIE2_AXI_S_STICKY_ARES>, + <&gcc GCC_PCIE2_AXI_S_ARES>, + <&gcc GCC_PCIE2_AXI_M_STICKY_ARES>, + <&gcc GCC_PCIE2_AXI_M_ARES>, + <&gcc GCC_PCIE2_AUX_ARES>, + <&gcc GCC_PCIE2_AHB_ARES>; + reset-names = "pipe", + "sticky", + "axi_s_sticky", + "axi_s", + "axi_m_sticky", + "axi_m", + "aux", + "ahb"; + status = "disabled"; + }; }; thermal-zones {