From patchwork Thu Aug 8 14:03:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Luo X-Patchwork-Id: 13757519 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C44A218E751; Thu, 8 Aug 2024 14:04:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723125856; cv=none; b=Dwvs8lPaAM5Gm7ww+RQFLxYHho8YE6A9vmuwBUJVrVw9cyhYUQGBEbRqgXQ5Asl45EYmRoe8iqwlr5R8dTAVo461+7aidivds6ImYz/fQF75iHF/q4KnJEa1bwR4j7rm/1Aj3hbI8Kox+gYIWLdYZo7/vf/FUsvy0XdR3SHyeGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723125856; c=relaxed/simple; bh=bqymaGN7lV2NoCv9XT3InR9+WQfCR0oVo66v/yxIWRI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=D34rbVnEychO6TwBkORDgr+J5WMHGf8rYU5U/9sD1Tsc2bAqR3/RQAufIOAGlEcwutVlrpAvXndYbVofWmKOtND1sKT2QReoqFeaIETyylpJuLrMPDhvSqpAGTH66i/Ely8E464YDH82SQSNmJFkJtzbHM4Q1Jh2+Z7Iw9fjE9s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=fpqbtqo0; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="fpqbtqo0" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47890bsc000996; Thu, 8 Aug 2024 14:04:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= p2YUPwwXAfbcS25kXOW1+pIM9WQ4zb8c2WzP5UzMuWA=; b=fpqbtqo0rombt/0W cgU4A2UaARFInfDHVvWGpJnFS1PtL3dvbq6i51WwRnz531I3abUPkfw71Q+kINit rTnYVMG/QrqDzIDM7KYN8Y24lagDgnGtbE1J8L4BnaEGB+Grhka3gE4oq20+ofHC XgdMZQG+U/Wt/oXxkIkHAgEEdr+F1lXAzWTbZNMkZ1DOQKeraLqYc+lQbcRjOr+c VsqHDpwFabdIoQp4E/eLMGZiQpK1I5MdePaIHVx2W8GreF1bWz60qHlx97+iavy/ EboVOyE9OEK6aGhYoDLwOE/Xh61dqkFvxasHCbZh+KsmqsOvBkpSDSFbLPXHRLJq /2qsrQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40vfav2ba4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Aug 2024 14:04:05 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 478E44bB020893 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Aug 2024 14:04:04 GMT Received: from nsssdc-sh01-lnx.ap.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 8 Aug 2024 07:03:59 -0700 From: Luo Jie Date: Thu, 8 Aug 2024 22:03:12 +0800 Subject: [PATCH 1/4] dt-bindings: clock: qcom: Add common PLL clock controller for IPQ SoC Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240808-qcom_ipq_cmnpll-v1-1-b0631dcbf785@quicinc.com> References: <20240808-qcom_ipq_cmnpll-v1-0-b0631dcbf785@quicinc.com> In-Reply-To: <20240808-qcom_ipq_cmnpll-v1-0-b0631dcbf785@quicinc.com> To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Konrad Dybcio CC: , , , , , , , , , , Luo Jie X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1723125835; l=3457; i=quic_luoj@quicinc.com; s=20240808; h=from:subject:message-id; bh=bqymaGN7lV2NoCv9XT3InR9+WQfCR0oVo66v/yxIWRI=; b=Nk7Wez3VXXPKqrcKEJNmQZcnuf0h0fDNO7KboC9aiMoFLsAgatw7B2lrHrIKzwk0sPfBSIvfi 5+Scdq024P5D3cNhbQo83hA4MNuAiEuK6VQDd5LgRXPhESu14oRsXc7 X-Developer-Key: i=quic_luoj@quicinc.com; a=ed25519; pk=P81jeEL23FcOkZtXZXeDDiPwIwgAHVZFASJV12w3U6w= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: StMIi3mr6pk-Rfde23clEiARM9B7MHkk X-Proofpoint-GUID: StMIi3mr6pk-Rfde23clEiARM9B7MHkk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-08_14,2024-08-07_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 phishscore=0 suspectscore=0 impostorscore=0 clxscore=1011 spamscore=0 priorityscore=1501 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408080099 The common PLL controller provides clocks to networking hardware blocks on Qualcomm IPQ SoC. It receives input clock from the on-chip Wi-Fi, and produces output clocks at fixed rates. These output rates are predetermined, and are unrelated to the input clock rate. The output clocks are supplied to the Ethernet hardware such as PPE (packet process engine) and the externally connected switch or PHY device. The common PLL driver is initially being supported for IPQ9574 SoC. Signed-off-by: Luo Jie --- .../bindings/clock/qcom,ipq-cmn-pll.yaml | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/qcom,ipq-cmn-pll.yaml b/Documentation/devicetree/bindings/clock/qcom,ipq-cmn-pll.yaml new file mode 100644 index 000000000000..c45b3a201751 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/qcom,ipq-cmn-pll.yaml @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/qcom,ipq-cmn-pll.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Common PLL Clock Controller on IPQ SoC + +maintainers: + - Bjorn Andersson + - Luo Jie + +description: + The common PLL clock controller expects a reference input clock. + This reference clock is from the on-board Wi-Fi. The CMN PLL + supplies a number of fixed rate output clocks to the Ethernet + devices including PPE (packet process engine) and the connected + switch or PHY device. + +properties: + compatible: + enum: + - qcom,ipq9574-cmn-pll + + reg: + maxItems: 1 + + clocks: + items: + - description: The reference clock, the supported clock rates include + 25000000, 31250000, 40000000, 48000000, 50000000 and 96000000 HZ. + - description: The AHB clock + - description: The SYS clock + description: + The reference clock is the source clock of CMN PLL, which is from the + Wi-Fi. The AHB and SYS clocks must be enabled to access common PLL + clock registers. + + clock-names: + items: + - const: ref + - const: ahb + - const: sys + + clock-output-names: + items: + - const: ppe-353mhz + - const: eth0-50mhz + - const: eth1-50mhz + - const: eth2-50mhz + - const: eth-25mhz + description: + The output clocks are given to Ethernet blocks that includes PPE and + the connected switch or PHY device. + + "#clock-cells": + const: 1 + +required: + - compatible + - reg + - clocks + - clock-names + - clock-output-names + - "#clock-cells" + +additionalProperties: false + +examples: + - | + #include + + clock-controller@9b000 { + compatible = "qcom,ipq9574-cmn-pll"; + reg = <0x0009b000 0x800>; + clocks = <&cmn_pll_ref_clk>, + <&gcc GCC_CMN_12GPLL_AHB_CLK>, + <&gcc GCC_CMN_12GPLL_SYS_CLK>; + clock-names = "ref", "ahb", "sys"; + clock-output-names = "ppe-353mhz", + "eth0-50mhz", + "eth1-50mhz", + "eth2-50mhz", + "eth-25mhz"; + #clock-cells = <1>; + }; +... From patchwork Thu Aug 8 14:03:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Luo X-Patchwork-Id: 13757520 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B924918EFC9; Thu, 8 Aug 2024 14:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723125860; cv=none; b=d4NoLDLwzUw5M8rA6eoqsymXW7OUXnlHJ8aS+UWAbEq2Ocntbfg4VgZ1kp/T8pRvNVnedf4yPP793kiUOoMoN6HCOcxW5HfsIrzNWEcNRuC7CZjjBc+s2x5IQtEhP4gY2OWMoDYDWOKhRobEmtRSxqrpKmEcyGDfGC0FT+b6TGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723125860; c=relaxed/simple; bh=zx5SghnMnnNJKI++0+Ng96Jv8/fUXJm6EqOTHdQBdTA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=vGn2Hr0Pb4OAo7kSKOUicz4ufvgHrBssFo5wLEh6e54c8uj6mT7Ns6B6QXzQg5x7+AmwdS4YZk9yVMFrcgZeN/duhySQkzEpHv7Sn/uw4e9aQHscVQiWbTZhiO4QrbUxfJxjIXKR/rOYbpLmO52x7yN8tGYYdr4tIenH2qTjhwk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=p44ZvgS4; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="p44ZvgS4" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4784H0YJ010740; Thu, 8 Aug 2024 14:04:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= CpS+0CYyaBimguTedamF2HosUC4UuyAAIMydMjqpbJM=; b=p44ZvgS4cxQFfIVI /sROryTzOGx30ZVJQ2lDCjdLay1Bwrp4xOMn8W50jKkSH15WS5111SONLj8ZKCRz cttd2HzkmBfEiUzOS/9OMuNNHnWcv71iIHTfmYPqPOsnCgpt/rbViGDqYxqx7xIf qyxMc+N8kTVoLVAvMAPcJJt3D8ec3s+LQ21qiu3D3Z5jT2bszkdWD3SClXzozoj0 1CfUsqD/BIYWhfFokTE2lBdnTqp0Rs782iA3wPOAbxj4otZOyh3m6bkpCLcyDNMX NDtmeBCt0CCGnC4e1U3wZzAfjibhe60aJt7BP8hCwj5rffWrMarn5R0nUQxO6niC +9eRcA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40vpuvhech-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Aug 2024 14:04:09 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 478E48rs020519 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Aug 2024 14:04:08 GMT Received: from nsssdc-sh01-lnx.ap.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 8 Aug 2024 07:04:04 -0700 From: Luo Jie Date: Thu, 8 Aug 2024 22:03:13 +0800 Subject: [PATCH 2/4] clk: qcom: Add common PLL clock controller driver for IPQ SoC Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240808-qcom_ipq_cmnpll-v1-2-b0631dcbf785@quicinc.com> References: <20240808-qcom_ipq_cmnpll-v1-0-b0631dcbf785@quicinc.com> In-Reply-To: <20240808-qcom_ipq_cmnpll-v1-0-b0631dcbf785@quicinc.com> To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Konrad Dybcio CC: , , , , , , , , , , Luo Jie X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1723125835; l=9424; i=quic_luoj@quicinc.com; s=20240808; h=from:subject:message-id; bh=zx5SghnMnnNJKI++0+Ng96Jv8/fUXJm6EqOTHdQBdTA=; b=s7kY42Ycm78zTZ+79sjwaEtmucniIK1FRjWp7boQoi3p8QHhOtJsgOZdmwaJT/EIZgnUUIljw jCqM8AmIVU1AQkpp3AeiNSW2CUiaEsAOVOnGEURXLj3+uCumTKr10a9 X-Developer-Key: i=quic_luoj@quicinc.com; a=ed25519; pk=P81jeEL23FcOkZtXZXeDDiPwIwgAHVZFASJV12w3U6w= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: lNI8hMuHTtR4O50QBVWYejLIIOlw-F4B X-Proofpoint-GUID: lNI8hMuHTtR4O50QBVWYejLIIOlw-F4B X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-08_14,2024-08-07_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408080099 The common PLL clock controller driver supplies clocks to the hardware blocks that together make up the Ethernet function on Qualcomm IPQ SoCs. The driver is initially supported for IPQ9574 SoC. The common PLL clock controller expects a reference input clock from the on-board Wi-Fi block acting as clock source. The input reference clock needs to be configured to one of the supported clock rates. The controller supplies a number of fixed-rate output clocks. For the IPQ9574, there is one output clock of 353 MHZ to PPE (Packet Process Engine) hardware block, three 50 MHZ output clocks and an additional 25 MHZ output clock supplied to the connected Ethernet devices. Signed-off-by: Luo Jie --- drivers/clk/qcom/Kconfig | 10 ++ drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/clk-ipq-cmn-pll.c | 233 +++++++++++++++++++++++++++++++++++++ 3 files changed, 244 insertions(+) diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig index cf6ad908327f..8e36cde64134 100644 --- a/drivers/clk/qcom/Kconfig +++ b/drivers/clk/qcom/Kconfig @@ -190,6 +190,16 @@ config IPQ_APSS_6018 Say Y if you want to support CPU frequency scaling on ipq based devices. +config IPQ_CMN_PLL + tristate "IPQ Common PLL Clock Controller" + depends on IPQ_GCC_9574 + help + Support for common PLL clock controller on IPQ platform. The + common PLL feeds the reference clocks to the Ethernet devices + based on IPQ SoC. + Say Y or M if you want to support common PLL clock on the IPQ + based devices. + config IPQ_GCC_4019 tristate "IPQ4019 Global Clock Controller" help diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile index 8a6f0dabd02f..35f656146de7 100644 --- a/drivers/clk/qcom/Makefile +++ b/drivers/clk/qcom/Makefile @@ -29,6 +29,7 @@ obj-$(CONFIG_CLK_X1E80100_TCSRCC) += tcsrcc-x1e80100.o obj-$(CONFIG_CLK_QCM2290_GPUCC) += gpucc-qcm2290.o obj-$(CONFIG_IPQ_APSS_PLL) += apss-ipq-pll.o obj-$(CONFIG_IPQ_APSS_6018) += apss-ipq6018.o +obj-$(CONFIG_IPQ_CMN_PLL) += clk-ipq-cmn-pll.o obj-$(CONFIG_IPQ_GCC_4019) += gcc-ipq4019.o obj-$(CONFIG_IPQ_GCC_5018) += gcc-ipq5018.o obj-$(CONFIG_IPQ_GCC_5332) += gcc-ipq5332.o diff --git a/drivers/clk/qcom/clk-ipq-cmn-pll.c b/drivers/clk/qcom/clk-ipq-cmn-pll.c new file mode 100644 index 000000000000..c10c6a7e82e6 --- /dev/null +++ b/drivers/clk/qcom/clk-ipq-cmn-pll.c @@ -0,0 +1,233 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +/* + * Common PLL block expects the reference clock from on-board Wi-Fi block, + * and supplies the fixed rate clocks as output to the Ethernet hardware + * blocks. The Ethernet related blocks include PPE (packet process engine) + * and the external connected PHY (or switch) chip receiving clocks from + * the common PLL. + * + * On the IPQ9574 SoC, There are three clocks with 50 MHZ, one clock with + * 25 MHZ which are output from the common PLL to Ethernet PHY (or switch), + * and one clock with 353 MHZ to PPE. + * + * +---------+ + * | GCC | + * +--+---+--+ + * AHB CLK| |SYS CLK + * V V + * +-------+---+------+ + * | +-------------> eth0-50mhz + * REF CLK | IPQ9574 | + * -------->+ +-------------> eth1-50mhz + * | CMN PLL block | + * | +-------------> eth2-50mhz + * | | + * +---------+--------+-------------> eth-25mhz + * | + * V + * ppe-353mhz + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define CMN_PLL_REFCLK_SRC_SELECTION 0x28 +#define CMN_PLL_REFCLK_SRC_DIV GENMASK(9, 8) + +#define CMN_PLL_REFCLK_CONFIG 0x784 +#define CMN_PLL_REFCLK_EXTERNAL BIT(9) +#define CMN_PLL_REFCLK_DIV GENMASK(8, 4) +#define CMN_PLL_REFCLK_INDEX GENMASK(3, 0) + +#define CMN_PLL_POWER_ON_AND_RESET 0x780 +#define CMN_ANA_EN_SW_RSTN BIT(6) + +/** + * struct cmn_pll_fixed_clk - Common PLL output clocks information + * @nrates: Number of elements in rates + * @rates: Array of clock rates supplied by common PLL + */ +struct cmn_pll_fixed_clk { + int nrates; + const unsigned long *rates; +}; + +/* + * The clock rates are for the output clock ppe-353mhz, eth0-50mhz + * eth1-50mhz, eth2-50mhz and eth-25mhz. + */ +static const unsigned long ipq9574_rates[] = { + 353000000UL, 50000000UL, 50000000UL, 50000000UL, 25000000UL, +}; + +static const struct cmn_pll_fixed_clk ipq9574_fixed_clk = { + .nrates = ARRAY_SIZE(ipq9574_rates), + .rates = ipq9574_rates, +}; + +static int ipq_cmn_pll_config(struct device *dev, unsigned long parent_rate) +{ + void __iomem *base; + u32 val; + + base = devm_of_iomap(dev, dev->of_node, 0, NULL); + if (IS_ERR(base)) + return PTR_ERR(base); + + val = readl(base + CMN_PLL_REFCLK_CONFIG); + val &= ~(CMN_PLL_REFCLK_EXTERNAL | CMN_PLL_REFCLK_INDEX); + + /* + * Configure the reference input clock selection as per the given rate. + * The output clock rates are always of fixed value. + */ + switch (parent_rate) { + case 25000000: + val |= FIELD_PREP(CMN_PLL_REFCLK_INDEX, 3); + break; + case 31250000: + val |= FIELD_PREP(CMN_PLL_REFCLK_INDEX, 4); + break; + case 40000000: + val |= FIELD_PREP(CMN_PLL_REFCLK_INDEX, 6); + break; + case 48000000: + val |= FIELD_PREP(CMN_PLL_REFCLK_INDEX, 7); + break; + case 50000000: + val |= FIELD_PREP(CMN_PLL_REFCLK_INDEX, 8); + break; + case 96000000: + val |= FIELD_PREP(CMN_PLL_REFCLK_INDEX, 7); + val &= ~CMN_PLL_REFCLK_DIV; + val |= FIELD_PREP(CMN_PLL_REFCLK_DIV, 2); + break; + default: + return -EINVAL; + } + + writel(val, base + CMN_PLL_REFCLK_CONFIG); + + /* Update the source clock rate selection. Only 96 MHZ uses 0. */ + val = readl(base + CMN_PLL_REFCLK_SRC_SELECTION); + val &= ~CMN_PLL_REFCLK_SRC_DIV; + if (parent_rate != 96000000) + val |= FIELD_PREP(CMN_PLL_REFCLK_SRC_DIV, 1); + + writel(val, base + CMN_PLL_REFCLK_SRC_SELECTION); + + /* + * Reset the common PLL block by asserting/de-asserting for 100 ms + * each, to ensure the updated configurations take effect. + */ + val = readl(base + CMN_PLL_POWER_ON_AND_RESET); + val &= ~CMN_ANA_EN_SW_RSTN; + writel(val, base); + msleep(100); + + val |= CMN_ANA_EN_SW_RSTN; + writel(val, base + CMN_PLL_POWER_ON_AND_RESET); + msleep(100); + + return 0; +} + +static int ipq_cmn_pll_clk_register(struct device *dev, const char *parent) +{ + const struct cmn_pll_fixed_clk *fixed_clk; + struct clk_hw_onecell_data *data; + const char *clk_name; + struct clk_hw *hw; + int index; + + fixed_clk = of_device_get_match_data(dev); + if (!fixed_clk) + return -ENODEV; + + data = devm_kzalloc(dev, struct_size(data, hws, fixed_clk->nrates), + GFP_KERNEL); + if (!data) + return -ENOMEM; + + /* + * Register the fixed rate output clocks with the correct clock names, + * the number of clocks and clock names are guaranteed by DTS. + */ + for (index = 0; index < fixed_clk->nrates; index++) { + if (of_property_read_string_index(dev->of_node, + "clock-output-names", + index, &clk_name)) + return -ENODEV; + + hw = devm_clk_hw_register_fixed_rate(dev, clk_name, parent, 0, + fixed_clk->rates[index]); + if (IS_ERR(hw)) + return PTR_ERR(hw); + + data->hws[index] = hw; + } + data->num = fixed_clk->nrates; + + return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, data); +} + +static int ipq_cmn_pll_clk_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct clk *clk; + int ret; + + /* + * To access the common PLL registers, the GCC AHB & SYSY clocks + * for common PLL block need to be enabled. + */ + clk = devm_clk_get_enabled(dev, "ahb"); + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), + "Enable AHB clock failed\n"); + + clk = devm_clk_get_enabled(dev, "sys"); + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), + "Enable SYS clock failed\n"); + + clk = devm_clk_get(dev, "ref"); + if (IS_ERR(clk)) + return dev_err_probe(dev, PTR_ERR(clk), + "Get reference clock failed\n"); + + /* Configure common PLL to apply the reference clock. */ + ret = ipq_cmn_pll_config(dev, clk_get_rate(clk)); + if (ret) + return dev_err_probe(dev, ret, "Configure common PLL failed\n"); + + return ipq_cmn_pll_clk_register(dev, __clk_get_name(clk)); +} + +static const struct of_device_id ipq_cmn_pll_clk_ids[] = { + { .compatible = "qcom,ipq9574-cmn-pll", .data = &ipq9574_fixed_clk }, + { } +}; + +static struct platform_driver ipq_cmn_pll_clk_driver = { + .probe = ipq_cmn_pll_clk_probe, + .driver = { + .name = "ipq_cmn_pll", + .of_match_table = ipq_cmn_pll_clk_ids, + }, +}; + +module_platform_driver(ipq_cmn_pll_clk_driver); + +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. IPQ Common PLL Driver"); +MODULE_LICENSE("GPL"); From patchwork Thu Aug 8 14:03:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Luo X-Patchwork-Id: 13757521 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4413518EFC9; Thu, 8 Aug 2024 14:04:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723125867; cv=none; b=q6zqQMC3Gqp68SLywcHom9byfg4Z38IDe1IMbb36e2KsoZFFZAJFboOVyC1oQcFq5ALk+YaeKl1yDcm/Ub9rWx20DbRrJh79AUKvUEwIfwB+525uECH8XEfvJcNRVtYPy0QHNwMCx4ce2J3iaxJ9bRcKOpUSvmTu43lVW1gWfp0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723125867; c=relaxed/simple; bh=3WH0aRycawtTd+hwuDHZymvMm+tSFS7uVvav4SszNxo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=gIYeYOTtN+IVporTBx7sGPOofPRNDyoIaYpkN1TCxwfACtshVDxQbPn9eY/NjNCDiYT9+wO3+mkkOJkrefUqJtJ6cgsv1/VX4Q2NiJpNM77bKlE/Zv9MG72cS5nsjnr3f+2TaPIWnwYrWn52Ek/o+1HEfuxcEghDjdqH6LwLPbw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=mBYaE+Ll; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="mBYaE+Ll" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 478A1PGt006866; Thu, 8 Aug 2024 14:04:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= nJ8vsy1F4vyNtasevygBxd3nGUZUhHi+Dut76YwdACM=; b=mBYaE+Ll+bLZ4XrS dgK3yXP5DiERaueEBUnJU5WENJ40AknF3yB1Ms+tX2fYoitj1DwnG5J+gvlNYlvx 3i0RcMAMpO971Ine/OcUROFaF4jlTcVnaKo5xmnl2n87boV1S/3eirp8D/E7ShLz ZlTXVEmFH+Q67kLb+7bH4mKDY47Bvs/2xSciVNbo22JVOXtvAEIWqYiNaRjvlcmx rZEkiNTu/FwDdC5A/M8rCV+msdJFMFO3pxB3CYGfJhy4/q2vmOM7SHlcv3eDxtgu QnlHdD7zcZMw1Xj86PHR/r44HZkCUfFHUXTa4kRqDNNtvfxVudnmF+3Q5SDjb/ND bLi/yQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40vuwarm82-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Aug 2024 14:04:15 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 478E4D2f023745 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Aug 2024 14:04:13 GMT Received: from nsssdc-sh01-lnx.ap.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 8 Aug 2024 07:04:09 -0700 From: Luo Jie Date: Thu, 8 Aug 2024 22:03:14 +0800 Subject: [PATCH 3/4] arm64: defconfig: Enable Qualcomm IPQ common PLL clock controller Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240808-qcom_ipq_cmnpll-v1-3-b0631dcbf785@quicinc.com> References: <20240808-qcom_ipq_cmnpll-v1-0-b0631dcbf785@quicinc.com> In-Reply-To: <20240808-qcom_ipq_cmnpll-v1-0-b0631dcbf785@quicinc.com> To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Konrad Dybcio CC: , , , , , , , , , , Luo Jie X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1723125835; l=686; i=quic_luoj@quicinc.com; s=20240808; h=from:subject:message-id; bh=3WH0aRycawtTd+hwuDHZymvMm+tSFS7uVvav4SszNxo=; b=kGcKVI1IIqlsnIpJUVp4Wvp5JBSjUnrEDMg00b6augQQQ9OmZ2xKK9W4mBQ3NA8gQJuUhKD4L 3jgYTdjvUF2AafjRuQptnHOG4RIldlCY8I+GJIm2jv2WVymj7tazHrv X-Developer-Key: i=quic_luoj@quicinc.com; a=ed25519; pk=P81jeEL23FcOkZtXZXeDDiPwIwgAHVZFASJV12w3U6w= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: GXmzUaUR0WRy_t2u9KTmYF4K_Tt7r2ir X-Proofpoint-GUID: GXmzUaUR0WRy_t2u9KTmYF4K_Tt7r2ir X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-08_14,2024-08-07_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 mlxscore=0 phishscore=0 adultscore=0 bulkscore=0 impostorscore=0 mlxlogscore=730 suspectscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408080099 The common PLL clock controller provides fixed rate output clocks to the hardware blocks that enable ethernet function on IPQ platform. Signed-off-by: Luo Jie --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 01dd286ba7ef..1bc7bd86e589 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1300,6 +1300,7 @@ CONFIG_QCOM_CLK_SMD_RPM=y CONFIG_QCOM_CLK_RPMH=y CONFIG_IPQ_APSS_6018=y CONFIG_IPQ_APSS_5018=y +CONFIG_IPQ_CMN_PLL=m CONFIG_IPQ_GCC_5018=y CONFIG_IPQ_GCC_5332=y CONFIG_IPQ_GCC_6018=y From patchwork Thu Aug 8 14:03:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jie Luo X-Patchwork-Id: 13757522 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EA9D18E768; Thu, 8 Aug 2024 14:04:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723125879; cv=none; b=qBGp6ThF8Rn317LrwQMxu7LiI5wpam4+kNLO8JcoK43No7nOWDETzIaAEkhCOj9ucrj7eKltQcJiAHnjIecu3TdK6/xLbHtYc8JdzUqvstKS6sYEZxMfl7UJ6rewM+gqlIlyYiUVZAz/cE3BuYCtzX9K3j6hMRWyA9Q9pB64qqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723125879; c=relaxed/simple; bh=6oUq/Dzs0hO7kZwOks3HUIxjCjlf6sj6hTn2ghPIYtI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=NMa0v0sOPQVbUAb9wrQvyugC5fKzPc+v5mOY2WafRL30kHMUYBd+519oCD/UckO5XHe4aw2QQgh8vCwgtGAqFB1BSrJgx5OIh8m8I+2uGFaD7YL1h0ubQqatAch6brlnSh2bYB/bppP+ntqDumUIOfJqxqxcSlK71DsJuj+ViIA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=lkT/FPDx; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="lkT/FPDx" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47882eRh015930; Thu, 8 Aug 2024 14:04:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= J/lMlXA8r/d43ifs0PdwoQ8yyRuKy5017gxJ94fZy4o=; b=lkT/FPDx1Kp9Asus wsnpR9bBvYMFznM1mzQyqWO91rWazAHi7ZsSeDQbVpnGv+g+SWPjKx8ff7llauEw SFEIXfMKkhLh+nENPqybtlwaWd/ZT7qS72f30FJcjqF93jQS+9iJZ319QHZkAP4E I3/6hsVfi3KrMnAn7K839Q5HlUwTDIax/lnSqbYLn8k2dL/uXddBPfuBdHUT6T3S oTOlOWWleu0uhzr+cGC9zhJTcK4JaS5U9J07jhmWFbITJt81WOUQ7zXvhRmF+zBA P8h2IgajlE2QxhcUPDmOcfvnVfBAjpXRrzF4tLY6jtyRbO1+JlHlg+BbB0Bw+Lnt 6LnOJw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40vdupjj09-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Aug 2024 14:04:19 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 478E4Iic021443 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Aug 2024 14:04:18 GMT Received: from nsssdc-sh01-lnx.ap.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 8 Aug 2024 07:04:13 -0700 From: Luo Jie Date: Thu, 8 Aug 2024 22:03:15 +0800 Subject: [PATCH 4/4] arm64: dts: qcom: Add common PLL node for IPQ9574 SoC Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240808-qcom_ipq_cmnpll-v1-4-b0631dcbf785@quicinc.com> References: <20240808-qcom_ipq_cmnpll-v1-0-b0631dcbf785@quicinc.com> In-Reply-To: <20240808-qcom_ipq_cmnpll-v1-0-b0631dcbf785@quicinc.com> To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Catalin Marinas , Will Deacon , Konrad Dybcio CC: , , , , , , , , , , Luo Jie X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1723125835; l=2716; i=quic_luoj@quicinc.com; s=20240808; h=from:subject:message-id; bh=6oUq/Dzs0hO7kZwOks3HUIxjCjlf6sj6hTn2ghPIYtI=; b=lAJMcgS6Z6cKh/npSDbrdnekoDcIdADOLJXTKGiJGyh1/eMoqGuvc0e9z40rz+p5E3NZktyEH hln2N4J1e4nCDLuSMjzD6/OIoe9fxWmCSI+pP/BnjQHBR1KQuz5ExFy X-Developer-Key: i=quic_luoj@quicinc.com; a=ed25519; pk=P81jeEL23FcOkZtXZXeDDiPwIwgAHVZFASJV12w3U6w= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 2asR_xadCZBUOqdhFpQvLYRZ1oYI21Yv X-Proofpoint-GUID: 2asR_xadCZBUOqdhFpQvLYRZ1oYI21Yv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-08_14,2024-08-07_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 priorityscore=1501 suspectscore=0 phishscore=0 impostorscore=0 mlxscore=0 clxscore=1015 mlxlogscore=945 spamscore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408080099 The common PLL clock controller allows selection of an input clock rate from a defined set of input clock rates. It in-turn supplies fixed rate output clocks to the hardware blocks that provide ethernet functions, such as PPE (Packet Process Engine) and connected switch or PHY. Signed-off-by: Luo Jie --- arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi | 6 +++++- arch/arm64/boot/dts/qcom/ipq9574.dtsi | 22 +++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi index 91e104b0f865..26bc2de7f99a 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574-rdp-common.dtsi @@ -3,7 +3,7 @@ * IPQ9574 RDP board common device tree source * * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved. */ /dts-v1/; @@ -167,3 +167,7 @@ &usb3 { &xo_board_clk { clock-frequency = <24000000>; }; + +&cmn_pll_ref_clk { + clock-frequency = <48000000>; +}; diff --git a/arch/arm64/boot/dts/qcom/ipq9574.dtsi b/arch/arm64/boot/dts/qcom/ipq9574.dtsi index 48dfafea46a7..ad7789dc686e 100644 --- a/arch/arm64/boot/dts/qcom/ipq9574.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq9574.dtsi @@ -3,7 +3,7 @@ * IPQ9574 SoC device tree source * * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2023-2024, Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -28,6 +28,11 @@ xo_board_clk: xo-board-clk { compatible = "fixed-clock"; #clock-cells = <0>; }; + + cmn_pll_ref_clk: cmn-pll-ref-clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; }; cpus { @@ -226,6 +231,21 @@ rpm_msg_ram: sram@60000 { reg = <0x00060000 0x6000>; }; + clock-controller@9b000 { + compatible = "qcom,ipq9574-cmn-pll"; + reg = <0x0009b000 0x800>; + clocks = <&cmn_pll_ref_clk>, + <&gcc GCC_CMN_12GPLL_AHB_CLK>, + <&gcc GCC_CMN_12GPLL_SYS_CLK>; + clock-names = "ref", "ahb", "sys"; + clock-output-names = "ppe-353mhz", + "eth0-50mhz", + "eth1-50mhz", + "eth2-50mhz", + "eth-25mhz"; + #clock-cells = <1>; + }; + rng: rng@e3000 { compatible = "qcom,prng-ee"; reg = <0x000e3000 0x1000>;