Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp505282lqh; Tue, 7 May 2024 06:10:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVviCbfQNdwXc61ghFWSKPxndQ3sjPu2MCgy9iOzJgz/AXTvUxhRi/IlC59saj+c3fxzivhrgNX6duzVQB77WCeWqaaBuqRSVlNqQhUA== X-Google-Smtp-Source: AGHT+IFG46rxrT6vIqxOyftQnYjD6480jo5dkmG8I2+/CgiDBCd3iXL2N4FqG6M4UfpXnd5fNiWn X-Received: by 2002:a05:6870:84c5:b0:233:378c:a06a with SMTP id l5-20020a05687084c500b00233378ca06amr15764268oak.22.1715087404167; Tue, 07 May 2024 06:10:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715087404; cv=pass; d=google.com; s=arc-20160816; b=zo1DbbdpbcfiubP7wyoDZLg2ufV90e/UtMtfMIWgXVtoB52nC82hXm3co1lk6RF+vf 9TsMzwvPHmfl6L4DJNI+r5lTeJ5u3T0JOBN9pZEdJeblibcFJ4+oUbbgdKDYzGiQC6zK 4o5LyBsBHZZzMln24IK5rMNNmy6YaPcg8Ajm9XgfzHEPtDVNSZWVNXpE2G2io3n0b5JN joOpOWej+W1lFWkaqy7rv33QGwxzBf/66dKwuEHxUMn6zCYYFPaRb236Y4iad4gFY0F8 ABJ7RZyd1VjYk4Q7lrSpTVmv9WB85jWruXLf7xM/cK9zGlIgvCntrxvtS/kVs/yPdbm3 74wg== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=BqRtXEvF6VtiHp6gyVNo45urmekxuVoCB2rTuoEjS5w=; fh=pZr6MZM5KYOIXjEdaDZFhqcAknzCCzjS05j4eIEmwvs=; b=lBdLq4OvycO8b1Q4utkNW7ykel4tWDrrRFCTNMDA33vsVI0OSHt2+BoYVdB1A5CrjR 2K+ADBaxn1XJ7vRBp0Ri0xnPNJjUd2J8t4t8EE74oB4ONUTR5DSatrpi9P7WQ4yGWg2P I65uEKaE3kvKRsE3hUKIDHWJ5xhIcucSPv35z3NSjLam48C7xBXCRG83HrpvkW9/wsCJ K1RJjrEarAKVQEb1d5p1mcypqTTlf9DBKHQKw3sLiprCFm6bnmgQ1tB8ocTDhrwChIVZ AUg3xuUDilAlfGqLjaGU4fvGPE7pSIcpQS7eYgo5s7Om7x92eyPJX/xOj66Woq4VcVf8 qflA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WJz9xZJr; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-171338-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171338-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id hu15-20020a056871528f00b0023bce5caa44si4324044oac.154.2024.05.07.06.10.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:10:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171338-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WJz9xZJr; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-171338-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171338-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9CADF2831BF for ; Tue, 7 May 2024 13:06:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E895E15E1E6; Tue, 7 May 2024 13:06:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="WJz9xZJr" 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 EA7BD15B56E; Tue, 7 May 2024 13:05:58 +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=1715087160; cv=none; b=HgBvsWkCufxsWz8dyZf9ceeKUYQWTi0ZUxBnGFJuvqWYI2IKLgfhi4AzM1LYE/8p+sg3anPApcdKhxu1oqLs36AaUmp0tU+KySFSyMztS89NgWFWvGiQ0htacHdWfKDKJCHgijg2LV6F0fKKA0iOMgW3bFjdJ18TS1McNcx0yAY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087160; c=relaxed/simple; bh=iflX5pevwZYQ9tiBxExNAjs97YtVMI1RBBPuamrXV0M=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Wpy2QoBqwIhvTEsCGHpYZvkyVIFICxcOYZlu50E2bfYoAsB52p+FToKppktEqILPsqOpoHrUq1CYUB7YmoFmj2S2Jo8qJTx2l1sCQOcEhqAS2c2t5mH+mOnTcmMJsow1vKhyI8fvfxWW4uWT1VFMDwCD0Jem3Nh/SoNGb2wwoog= 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=WJz9xZJr; 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 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 4477otP7010042; Tue, 7 May 2024 13:05:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=qcppdkim1; bh=BqRtXEv F6VtiHp6gyVNo45urmekxuVoCB2rTuoEjS5w=; b=WJz9xZJr19jMel2SC+oYtq2 b2HP8InoA5q3ox68WycKhvRnbezTaMFCrZjdXOUFlI30KvqvnTkIWOO7sbNfSJXV arikp0KYimLipnGOhby2xshsmYhqXwfACdwyKILQBPC6pWkGDCnRfKBdVTTkP4zO jNRY46hYeIhPxEkIkhP0Wzbh1DPbwsMHh8DdP0OQDQgdcHpMPJCDPD0/XPZKr7gW b4IdM9dWItOwA0IjrviPcP/pGOZYDL5mG8JMK8XI9hMPzNFKcMBkirofsRvGCGzn a5yClQeLul6pm46NnRsxl2ZWaAlBmTwePEboieim9Y29cehzJqOOXf+wBPUVcog= = Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xyg8vrqja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 07 May 2024 13:05:46 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 447D5jJE004381 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 7 May 2024 13:05:45 GMT Received: from luoj-gv.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; Tue, 7 May 2024 06:05:42 -0700 From: Luo Jie To: , , , , , , CC: , , , , Subject: [PATCH v14 0/4] add clock controller of qca8386/qca8084 Date: Tue, 7 May 2024 21:05:27 +0800 Message-ID: <20240507130531.3286999-1-quic_luoj@quicinc.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-GUID: JYRuVFCK5yED-83hWatrNRZnSS_1V22a X-Proofpoint-ORIG-GUID: JYRuVFCK5yED-83hWatrNRZnSS_1V22a X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-07_06,2024-05-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 lowpriorityscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 adultscore=0 mlxscore=0 bulkscore=0 phishscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2405070090 qca8xxx is 4 * 2.5GBaseT ports chip, working as switch mode named by qca8386, or working as PHY mode named by qca8084, clock hardware reigster is accessed by MDIO bus. This patch series add the clock controller of qca8363/qca8084, and add the clock ops clk_branch2_prepare_ops to avoid spin lock used during the clock operation of qca8k clock controller where the sleep happens when accessing clock control register by MDIO bus. Changes in v2: * remove clock flag CLK_ENABLE_MUTEX_LOCK. * add clock ops clk_branch2_qca8k_ops. * improve yaml file for fixing dtschema warnings. * enable clock controller driver in defconfig. Changes in v3: * rename clk_branch2_qca8k_ops to clk_branch2_mdio_ops. * fix review comments on yaml file. * use dev_err_probe on driver probe error. * only use the compatible "qcom,qca8084-nsscc". * remove enable clock controller driver patch. Changes in v4: * add _qcom_cc_really_probe function. * commonizing the probe function. * remove flag CLK_IS_CRITICAL from clocks only needed to be enabled in switch device. * update device tree property reg to 0x10. Changes in v5: * commonize qcom_cc_really_probe. * add halt_check for the branch clocks. * fix the review comments on nsscc-qca8k.c. Changes in v6: * rename clk_branch2_mdio_ops to clk_branch2_prepare_ops. Changes in v7: * remove the clock flag CLK_IS_CRITICAL. * optimize the file nsscc-qca8k.c. * identify & fix the comments from Stephen. Changes in v8: * add dependency on ARM in Kconfig. Changes in v9: * take the clk_ops clk_rcg2_mux_closest_ops to remove the redundant freq_tbls. Changes in v10: * fix the patch CHECK and improve the comments. Changes in v11: * update the clock names to reflect hardware connecton. NSS_CC_MAC4_SRDS1_CH2_XGMII_RX_DIV_CLK_SRC -> NSS_CC_MAC4_SRDS1_CH3_XGMII_RX_DIV_CLK_SRC NSS_CC_MAC4_SRDS1_CH2_XGMII_TX_DIV_CLK_SRC -> NSS_CC_MAC4_SRDS1_CH3_XGMII_TX_DIV_CLK_SRC * resolve the qcom_cc_really_probe merge conflict based on the latest code. Changes in v12: * fix the compile error caused by the parameter of qcom_cc_really_probe updated from pdev to &pdev->dev in the new merged clock driver gcc-sm4450.c and camcc-sm8550.c. Changes in v13: * fix the compile error caused by the parameter of qcom_cc_really_probe from pdev to &pdev->dev in the new merged gcc drivers. * use the freq_multi_tbl for the same frequency config, which is introduced by Christian's patch set below. . * add dependent patch set link. Changes in v14: * Rebase the patch series. * Reset clock controller after enabling reference clock. * remove the link of dependent patch series since it is merged. Luo Jie (4): clk: qcom: branch: Add clk_branch2_prepare_ops dt-bindings: clock: add qca8386/qca8084 clock and reset definitions clk: qcom: common: commonize qcom_cc_really_probe clk: qcom: add clock controller driver for qca8386/qca8084 .../bindings/clock/qcom,qca8k-nsscc.yaml | 85 + drivers/clk/qcom/Kconfig | 9 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/apss-ipq6018.c | 2 +- drivers/clk/qcom/camcc-sc7180.c | 2 +- drivers/clk/qcom/camcc-sc7280.c | 2 +- drivers/clk/qcom/camcc-sc8280xp.c | 2 +- drivers/clk/qcom/camcc-sdm845.c | 2 +- drivers/clk/qcom/camcc-sm6350.c | 2 +- drivers/clk/qcom/camcc-sm8250.c | 2 +- drivers/clk/qcom/camcc-sm8450.c | 2 +- drivers/clk/qcom/camcc-sm8550.c | 2 +- drivers/clk/qcom/camcc-x1e80100.c | 2 +- drivers/clk/qcom/clk-branch.c | 7 + drivers/clk/qcom/clk-branch.h | 1 + drivers/clk/qcom/common.c | 7 +- drivers/clk/qcom/common.h | 2 +- drivers/clk/qcom/dispcc-qcm2290.c | 2 +- drivers/clk/qcom/dispcc-sc7180.c | 2 +- drivers/clk/qcom/dispcc-sc7280.c | 2 +- drivers/clk/qcom/dispcc-sc8280xp.c | 2 +- drivers/clk/qcom/dispcc-sdm845.c | 2 +- drivers/clk/qcom/dispcc-sm6115.c | 2 +- drivers/clk/qcom/dispcc-sm6125.c | 2 +- drivers/clk/qcom/dispcc-sm6350.c | 2 +- drivers/clk/qcom/dispcc-sm6375.c | 2 +- drivers/clk/qcom/dispcc-sm8250.c | 2 +- drivers/clk/qcom/dispcc-sm8450.c | 2 +- drivers/clk/qcom/dispcc-sm8550.c | 2 +- drivers/clk/qcom/dispcc-sm8650.c | 2 +- drivers/clk/qcom/dispcc-x1e80100.c | 2 +- drivers/clk/qcom/ecpricc-qdu1000.c | 2 +- drivers/clk/qcom/gcc-ipq5018.c | 2 +- drivers/clk/qcom/gcc-ipq6018.c | 2 +- drivers/clk/qcom/gcc-ipq8074.c | 2 +- drivers/clk/qcom/gcc-mdm9607.c | 2 +- drivers/clk/qcom/gcc-mdm9615.c | 2 +- drivers/clk/qcom/gcc-msm8917.c | 2 +- drivers/clk/qcom/gcc-msm8939.c | 2 +- drivers/clk/qcom/gcc-msm8953.c | 2 +- drivers/clk/qcom/gcc-msm8976.c | 2 +- drivers/clk/qcom/gcc-msm8996.c | 2 +- drivers/clk/qcom/gcc-msm8998.c | 2 +- drivers/clk/qcom/gcc-qcm2290.c | 2 +- drivers/clk/qcom/gcc-qcs404.c | 2 +- drivers/clk/qcom/gcc-qdu1000.c | 2 +- drivers/clk/qcom/gcc-sa8775p.c | 2 +- drivers/clk/qcom/gcc-sc7180.c | 2 +- drivers/clk/qcom/gcc-sc7280.c | 2 +- drivers/clk/qcom/gcc-sc8180x.c | 2 +- drivers/clk/qcom/gcc-sc8280xp.c | 2 +- drivers/clk/qcom/gcc-sdm660.c | 2 +- drivers/clk/qcom/gcc-sdm845.c | 2 +- drivers/clk/qcom/gcc-sdx55.c | 2 +- drivers/clk/qcom/gcc-sdx65.c | 2 +- drivers/clk/qcom/gcc-sdx75.c | 2 +- drivers/clk/qcom/gcc-sm4450.c | 2 +- drivers/clk/qcom/gcc-sm6115.c | 2 +- drivers/clk/qcom/gcc-sm6125.c | 2 +- drivers/clk/qcom/gcc-sm6350.c | 2 +- drivers/clk/qcom/gcc-sm6375.c | 2 +- drivers/clk/qcom/gcc-sm7150.c | 2 +- drivers/clk/qcom/gcc-sm8150.c | 2 +- drivers/clk/qcom/gcc-sm8250.c | 2 +- drivers/clk/qcom/gcc-sm8350.c | 2 +- drivers/clk/qcom/gcc-sm8450.c | 2 +- drivers/clk/qcom/gcc-sm8550.c | 2 +- drivers/clk/qcom/gcc-sm8650.c | 2 +- drivers/clk/qcom/gcc-x1e80100.c | 2 +- drivers/clk/qcom/gpucc-msm8998.c | 2 +- drivers/clk/qcom/gpucc-sa8775p.c | 2 +- drivers/clk/qcom/gpucc-sc7180.c | 2 +- drivers/clk/qcom/gpucc-sc7280.c | 2 +- drivers/clk/qcom/gpucc-sc8280xp.c | 2 +- drivers/clk/qcom/gpucc-sdm660.c | 2 +- drivers/clk/qcom/gpucc-sdm845.c | 2 +- drivers/clk/qcom/gpucc-sm6115.c | 2 +- drivers/clk/qcom/gpucc-sm6125.c | 2 +- drivers/clk/qcom/gpucc-sm6350.c | 2 +- drivers/clk/qcom/gpucc-sm6375.c | 2 +- drivers/clk/qcom/gpucc-sm8150.c | 2 +- drivers/clk/qcom/gpucc-sm8250.c | 2 +- drivers/clk/qcom/gpucc-sm8350.c | 2 +- drivers/clk/qcom/gpucc-sm8450.c | 2 +- drivers/clk/qcom/gpucc-sm8550.c | 2 +- drivers/clk/qcom/gpucc-sm8650.c | 2 +- drivers/clk/qcom/gpucc-x1e80100.c | 2 +- drivers/clk/qcom/lcc-ipq806x.c | 2 +- drivers/clk/qcom/lcc-msm8960.c | 2 +- drivers/clk/qcom/lpassaudiocc-sc7280.c | 4 +- drivers/clk/qcom/lpasscorecc-sc7180.c | 2 +- drivers/clk/qcom/lpasscorecc-sc7280.c | 2 +- drivers/clk/qcom/mmcc-msm8960.c | 2 +- drivers/clk/qcom/mmcc-msm8974.c | 2 +- drivers/clk/qcom/mmcc-msm8994.c | 2 +- drivers/clk/qcom/mmcc-msm8996.c | 2 +- drivers/clk/qcom/mmcc-msm8998.c | 2 +- drivers/clk/qcom/mmcc-sdm660.c | 2 +- drivers/clk/qcom/nsscc-qca8k.c | 2221 +++++++++++++++++ drivers/clk/qcom/tcsrcc-sm8550.c | 2 +- drivers/clk/qcom/videocc-sc7180.c | 2 +- drivers/clk/qcom/videocc-sc7280.c | 2 +- drivers/clk/qcom/videocc-sdm845.c | 2 +- drivers/clk/qcom/videocc-sm8150.c | 2 +- drivers/clk/qcom/videocc-sm8250.c | 2 +- drivers/clk/qcom/videocc-sm8350.c | 2 +- drivers/clk/qcom/videocc-sm8450.c | 2 +- drivers/clk/qcom/videocc-sm8550.c | 2 +- include/dt-bindings/clock/qcom,qca8k-nsscc.h | 101 + include/dt-bindings/reset/qcom,qca8k-nsscc.h | 76 + 110 files changed, 2606 insertions(+), 106 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/qcom,qca8k-nsscc.yaml create mode 100644 drivers/clk/qcom/nsscc-qca8k.c create mode 100644 include/dt-bindings/clock/qcom,qca8k-nsscc.h create mode 100644 include/dt-bindings/reset/qcom,qca8k-nsscc.h base-commit: 93a39e4766083050ca0ecd6a3548093a3b9eb60c -- 2.34.1