Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5723532rwp; Mon, 17 Jul 2023 08:31:39 -0700 (PDT) X-Google-Smtp-Source: APBJJlE98L8tKlW+vzootIDoQ662Y+9tJYMVstVE7ijHGei5sKwhSscmrjjlE7tYVJnFRnw+OB4Q X-Received: by 2002:a17:906:fad4:b0:993:d8a2:380 with SMTP id lu20-20020a170906fad400b00993d8a20380mr10366125ejb.21.1689607899195; Mon, 17 Jul 2023 08:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689607899; cv=none; d=google.com; s=arc-20160816; b=q4DJDbE7zxbSoZCKNoNOY9JUsV4F3ak00Akalbwa8o1z7vkr86hLkUrxp8Aq229vuV 8lBpzborQmpBR2lCEV3u/kb6M3dbbOP/sz8hbjfTcbEwyvyZxLn7PG94GBpYyIsNSJw0 xvtncngdLMBuFoUQy7AFs46/BvF6NjefYk7iKQVnVDEdDoN5Xt0MZZLxaYVmpiir4tH2 xAr1dg0eozS9yadeaUb7Q6jVXc7A0nOk8+ITU9of7x3uykFBmxWqaZ6PaHfj7ln1/HQa isa13u9taQrFTN49tNzXICp1NI2xzv2y5qGwWn8r/TUSz7DhQzrRsRF/J0PM+c7L6GO5 C6jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=8dB0fbKd3+8AbGwql3M82AbS790ZYBGNIltYY40ECjw=; fh=E58dWdTK3D0DoIKuSZYoE/gJoipBIXlqiTk01lLVuRg=; b=P1kezZDPoLzoswH9rDr0AfeOf8zT4LI7J3touZW+kigV0BOB5M1Es/575l2EoWybfC tlokoHvP3v7OIXTK+V9bK93Q7Tq5X452nqKm6pJKiwBWC69r7HyrQ6KkN5uahcLGPYRk xcQ0r22gr6waDQh9cB29td59xTvGMEJ2pYcH44/paJhlz9uP6qp4mFc7/KOXH3wbX0Ap ZNGtcBRsMKkacBEEri0WHKH/H8XhEHyfa+GkAYsOILfiet4apgrjRdNIzow/aLya+E7j KEaWRPgdtFwSUjHnsP3Sh2PkYYxFXcbT4m94/BVNeMZcSk3oV2AhggTaFHWpTzu+gyJV U5Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VoNKx2pf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d17-20020a170906175100b00991d54db2afsi13200117eje.702.2023.07.17.08.31.14; Mon, 17 Jul 2023 08:31:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VoNKx2pf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231400AbjGQPTX (ORCPT + 99 others); Mon, 17 Jul 2023 11:19:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231391AbjGQPTT (ORCPT ); Mon, 17 Jul 2023 11:19:19 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E796D2 for ; Mon, 17 Jul 2023 08:19:17 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4faaaa476a9so7473607e87.2 for ; Mon, 17 Jul 2023 08:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689607155; x=1692199155; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8dB0fbKd3+8AbGwql3M82AbS790ZYBGNIltYY40ECjw=; b=VoNKx2pfjcI/atQfdZc39nUP0jj9XPlEdzjSv36h/itQHX65GtSU51yXxBlOEdYMpP 2jinTqzUXPuzZGEWI22d5HKIlt8yFJL9+GmLgNO9dZOPDvul8yDyKi4xd8Gkvpzg+kmt XEmg6SqxdHDWsVtrh4qK0PkSY5sPqAAkbRRaQr/uIKLObHO600u5VrObNoWnv6tSw96G Un/ypVIys1fO7umkh8w9g8O0RPqmw0Op4YQ0vTcecRj0Kvf4qEy8aM7vHlOoMFbL4l/A 7fhxotZHC4pAPAonoIzAI8fTLM1R3ALs4LVHV8i6Qx21sJEFaH/ZoFhLbM3zVAf9wosE 8tVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689607155; x=1692199155; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8dB0fbKd3+8AbGwql3M82AbS790ZYBGNIltYY40ECjw=; b=YmHmnP7b9bwaMFuq5hUDFuJ0KLmALriuDVpURmCk1h5Aj7Nav1RSecgL/Ly/4qPtru WaVtLQquIls9Jow/CRtRNk0TwykbNRpELJEb4rLzhFU5yT6PjulNHxbHW/jcHFCK+VfQ OrTzQjX/akahOMNYrflGn8MlUl6FnwFa7bUXI8oKN9iD9Dlonvvp0lI6145ml+4XzGxG JrSrLB+K6wZgXo5Z/QmZAYaLGEdsXcAwGp/TStNI86U542G10BY9RZpRj+FyCgD3O6ap jcW27GGuOxRWRGq02TPuR9hPq3ZxFFiodnxZGL7zW1eYDOwORW368xqPmzSguAr4iaIT U00Q== X-Gm-Message-State: ABy/qLbcAheVlM3M7ckx627Jqqy6biH2I6U3uq4UgMKNzgAo+gOsTS9v 5FDe6M3F2Gwtb+gD/MvNujbJxg== X-Received: by 2002:a05:6512:110a:b0:4fd:c715:5667 with SMTP id l10-20020a056512110a00b004fdc7155667mr978338lfg.20.1689607155303; Mon, 17 Jul 2023 08:19:15 -0700 (PDT) Received: from [192.168.1.101] (abyj181.neoplus.adsl.tpnet.pl. [83.9.29.181]) by smtp.gmail.com with ESMTPSA id z7-20020ac24187000000b004f26d63f823sm2873949lfh.237.2023.07.17.08.19.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 08:19:14 -0700 (PDT) From: Konrad Dybcio Date: Mon, 17 Jul 2023 17:19:10 +0200 Subject: [PATCH 03/15] clk: qcom: gcc-sm6375: Unregister critical clocks MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230717-topic-branch_aon_cleanup-v1-3-27784d27a4f4@linaro.org> References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> In-Reply-To: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> To: Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1689607149; l=6998; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=nlQSrpDwXAIARKneY1DtqMYtmRn22TVOrx5+llC+mac=; b=Q8exJDNvf0akjWbLPSSCB3p1/wGsxf7IiaC12cwhOiJjkDGuhdyQjIWhE1y7NZQgd/WL03TeR 09db139MQWIAkYjF+lSjURkUbstR21+5GO8OwWhjceBVb21azUQy2a2 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some clocks need to be always-on, but we don't really do anything with them, other than calling enable() once and telling Linux they're enabled. Unregister them to save a couple of bytes and, perhaps more importantly, allow for runtime suspend of the clock controller device, as CLK_IS_CRITICAL prevents the latter. Signed-off-by: Konrad Dybcio --- drivers/clk/qcom/gcc-sm6375.c | 103 ++++++------------------------------------ 1 file changed, 13 insertions(+), 90 deletions(-) diff --git a/drivers/clk/qcom/gcc-sm6375.c b/drivers/clk/qcom/gcc-sm6375.c index e94e88bdfb91..14dafea45ac9 100644 --- a/drivers/clk/qcom/gcc-sm6375.c +++ b/drivers/clk/qcom/gcc-sm6375.c @@ -1742,22 +1742,6 @@ static struct clk_branch gcc_cam_throttle_rt_clk = { }, }; -static struct clk_branch gcc_camera_ahb_clk = { - .halt_reg = 0x17008, - .halt_check = BRANCH_HALT_DELAY, - .hwcg_reg = 0x17008, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x17008, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_camera_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_camss_axi_clk = { .halt_reg = 0x58044, .halt_check = BRANCH_HALT, @@ -2308,22 +2292,6 @@ static struct clk_branch gcc_cfg_noc_usb3_prim_axi_clk = { }, }; -static struct clk_branch gcc_disp_ahb_clk = { - .halt_reg = 0x1700c, - .halt_check = BRANCH_HALT_VOTED, - .hwcg_reg = 0x1700c, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x1700c, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_disp_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_regmap_div gcc_disp_gpll0_clk_src = { .reg = 0x17058, .shift = 0, @@ -2454,22 +2422,6 @@ static struct clk_branch gcc_gp3_clk = { }, }; -static struct clk_branch gcc_gpu_cfg_ahb_clk = { - .halt_reg = 0x36004, - .halt_check = BRANCH_HALT_VOTED, - .hwcg_reg = 0x36004, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x36004, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_gpu_cfg_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_gpu_gpll0_clk_src = { .halt_check = BRANCH_HALT_DELAY, .clkr = { @@ -3093,26 +3045,6 @@ static struct clk_branch gcc_sdcc2_apps_clk = { }, }; -static struct clk_branch gcc_sys_noc_cpuss_ahb_clk = { - .halt_reg = 0x2b06c, - .halt_check = BRANCH_HALT_VOTED, - .hwcg_reg = 0x2b06c, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x79004, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_sys_noc_cpuss_ahb_clk", - .parent_hws = (const struct clk_hw*[]) { - &gcc_cpuss_ahb_postdiv_clk_src.clkr.hw, - }, - .num_parents = 1, - .flags = CLK_IS_CRITICAL | CLK_SET_RATE_PARENT, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_sys_noc_ufs_phy_axi_clk = { .halt_reg = 0x45098, .halt_check = BRANCH_HALT, @@ -3432,22 +3364,6 @@ static struct clk_branch gcc_venus_ctl_axi_clk = { }, }; -static struct clk_branch gcc_video_ahb_clk = { - .halt_reg = 0x17004, - .halt_check = BRANCH_HALT_DELAY, - .hwcg_reg = 0x17004, - .hwcg_bit = 1, - .clkr = { - .enable_reg = 0x17004, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "gcc_video_ahb_clk", - .flags = CLK_IS_CRITICAL, - .ops = &clk_branch2_ops, - }, - }, -}; - static struct clk_branch gcc_video_axi0_clk = { .halt_reg = 0x1701c, .halt_check = BRANCH_HALT_VOTED, @@ -3614,7 +3530,6 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_BOOT_ROM_AHB_CLK] = &gcc_boot_rom_ahb_clk.clkr, [GCC_CAM_THROTTLE_NRT_CLK] = &gcc_cam_throttle_nrt_clk.clkr, [GCC_CAM_THROTTLE_RT_CLK] = &gcc_cam_throttle_rt_clk.clkr, - [GCC_CAMERA_AHB_CLK] = &gcc_camera_ahb_clk.clkr, [GCC_CAMSS_AXI_CLK] = &gcc_camss_axi_clk.clkr, [GCC_CAMSS_AXI_CLK_SRC] = &gcc_camss_axi_clk_src.clkr, [GCC_CAMSS_CCI_0_CLK] = &gcc_camss_cci_0_clk.clkr, @@ -3670,7 +3585,6 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_CFG_NOC_USB3_PRIM_AXI_CLK] = &gcc_cfg_noc_usb3_prim_axi_clk.clkr, [GCC_CPUSS_AHB_CLK_SRC] = &gcc_cpuss_ahb_clk_src.clkr, [GCC_CPUSS_AHB_POSTDIV_CLK_SRC] = &gcc_cpuss_ahb_postdiv_clk_src.clkr, - [GCC_DISP_AHB_CLK] = &gcc_disp_ahb_clk.clkr, [GCC_DISP_GPLL0_CLK_SRC] = &gcc_disp_gpll0_clk_src.clkr, [GCC_DISP_GPLL0_DIV_CLK_SRC] = &gcc_disp_gpll0_div_clk_src.clkr, [GCC_DISP_HF_AXI_CLK] = &gcc_disp_hf_axi_clk.clkr, @@ -3682,7 +3596,6 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_GP2_CLK_SRC] = &gcc_gp2_clk_src.clkr, [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr, - [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr, [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr, [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr, [GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr, @@ -3738,7 +3651,6 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_SDCC2_AHB_CLK] = &gcc_sdcc2_ahb_clk.clkr, [GCC_SDCC2_APPS_CLK] = &gcc_sdcc2_apps_clk.clkr, [GCC_SDCC2_APPS_CLK_SRC] = &gcc_sdcc2_apps_clk_src.clkr, - [GCC_SYS_NOC_CPUSS_AHB_CLK] = &gcc_sys_noc_cpuss_ahb_clk.clkr, [GCC_SYS_NOC_UFS_PHY_AXI_CLK] = &gcc_sys_noc_ufs_phy_axi_clk.clkr, [GCC_SYS_NOC_USB3_PRIM_AXI_CLK] = &gcc_sys_noc_usb3_prim_axi_clk.clkr, [GCC_UFS_PHY_AHB_CLK] = &gcc_ufs_phy_ahb_clk.clkr, @@ -3765,7 +3677,6 @@ static struct clk_regmap *gcc_sm6375_clocks[] = { [GCC_VCODEC0_AXI_CLK] = &gcc_vcodec0_axi_clk.clkr, [GCC_VENUS_AHB_CLK] = &gcc_venus_ahb_clk.clkr, [GCC_VENUS_CTL_AXI_CLK] = &gcc_venus_ctl_axi_clk.clkr, - [GCC_VIDEO_AHB_CLK] = &gcc_video_ahb_clk.clkr, [GCC_VIDEO_AXI0_CLK] = &gcc_video_axi0_clk.clkr, [GCC_VIDEO_THROTTLE_CORE_CLK] = &gcc_video_throttle_core_clk.clkr, [GCC_VIDEO_VCODEC0_SYS_CLK] = &gcc_video_vcodec0_sys_clk.clkr, @@ -3883,11 +3794,23 @@ static int gcc_sm6375_probe(struct platform_device *pdev) /* * Keep the following clocks always on: - * GCC_CAMERA_XO_CLK, GCC_CPUSS_GNOC_CLK, GCC_DISP_XO_CLK + * GCC_CAMERA_XO_CLK + * GCC_CPUSS_GNOC_CLK + * GCC_DISP_XO_CLK + * GCC_CAMERA_AHB_CLK + * GCC_DISP_AHB_CLK + * GCC_GPU_CFG_AHB_CLK + * GCC_SYS_NOC_CPUSS_AHB_CLK + * GCC_VIDEO_AHB_CLK */ qcom_branch_set_clk_en(regmap, 0x17028); qcom_branch_set_clk_en(regmap, 0x2b004); qcom_branch_set_clk_en(regmap, 0x1702c); + qcom_branch_set_clk_en(regmap, 0x17008); + qcom_branch_set_clk_en(regmap, 0x1700c); + qcom_branch_set_clk_en(regmap, 0x36004); + qcom_branch_set_clk_en(regmap, 0x2b06c); + qcom_branch_set_clk_en(regmap, 0x17004); clk_lucid_pll_configure(&gpll10, regmap, &gpll10_config); clk_lucid_pll_configure(&gpll11, regmap, &gpll11_config); -- 2.41.0