From patchwork Tue Feb 14 16:23:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 13140484 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6CB9C64EC7 for ; Tue, 14 Feb 2023 16:23:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232292AbjBNQX4 (ORCPT ); Tue, 14 Feb 2023 11:23:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232035AbjBNQXu (ORCPT ); Tue, 14 Feb 2023 11:23:50 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50AF6144AB for ; Tue, 14 Feb 2023 08:23:35 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id a3so7416547ejb.3 for ; Tue, 14 Feb 2023 08:23:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura.hr; s=sartura; 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=ScsbgOXtpb9xWT2guFGbhC+yddLEssXusAms+kqhCFk=; b=mmkWUKrp937tG//xDt3X3HVHLpC30KDnmup1PHGm2Pjdte+jEvbhzaVFoWqV2Xo/vK mNOsyewSVg1cdGFY9VmNetfjvy1/LFfZHfIRRNIPZM5ucWu12I2xjklpVRxzbNXiz2MX 9tp1leXdE6YhH+Frl0fdqF2RmKgaOhToQQ6ynIbc2S/daeKv6I8T5IG7E4eUgnPRFPMn kRoZHclZlOZ6dx75jJpL2et3WoxMFbjvHDQ6Id24cIASJpEWEH0yqebXqnNf3zgu4Wn9 AJubIpTteiUxfV+dwHIALfnKhr5GopYqDg49qUEkIqte1I+Oj1OFitHFDiolTW1vDEYJ 71QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ScsbgOXtpb9xWT2guFGbhC+yddLEssXusAms+kqhCFk=; b=2PMiiv9Zh1r4TLZuHLcziHT0pz6qDYhQRDY1XxI7MyRx3RUsErE+V9fHm4bLdQT6Ik DKIyTIMJQF89MP4HJGL9YzQjjwBSVb78ghjEKf6fTqgwkoQ0O/DffW+mWRzGTmN8Tg/n 2ilstBEg6pojHAedsZ1y30A//CVHe7M64+EPfvrAe92VSXeYilIatxTUEIIu+bdFec7V PDq5GgIsOpDWg/wGLMbZ38b9QwI4L73Ukx0bt+B4SwAfJP+B7ulpB8oSfhecbCbCVbZY wlr35zt5+aIeD6unMxPoZTPoAmXEUz3WzmSgM+xpSpVuVKmtULxwwhcJVL1P/Md1mM5u 3DTw== X-Gm-Message-State: AO0yUKWg1flWfTxwu2ScUYBpxDBnnqHvpQ8OyGzF5bd1mOma4nXDKIt6 7Y4TvwxtK3grBZqCOds5h6zFSQ== X-Google-Smtp-Source: AK7set8ImZ4JswXFxpHDOJaqVcds+Hhjo91zVyfsT+KKOOoC/GCkMy9HYgfMLWD4lsWMLEzZ6sKQLw== X-Received: by 2002:a17:906:57ca:b0:879:6abe:915e with SMTP id u10-20020a17090657ca00b008796abe915emr4323971ejr.69.1676391813943; Tue, 14 Feb 2023 08:23:33 -0800 (PST) Received: from fedora.. (cpezg-94-253-130-165-cbl.xnet.hr. [94.253.130.165]) by smtp.googlemail.com with ESMTPSA id bp8-20020a170907918800b008806a3c22c5sm1318027ejb.25.2023.02.14.08.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 08:23:33 -0800 (PST) From: Robert Marko To: andersson@kernel.org, agross@kernel.org, konrad.dybcio@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: luka.perkov@sartura.hr, Robert Marko Subject: [PATCH 6/7] clk: qcom: gcc-ipq4019: move pcnoc clocks up Date: Tue, 14 Feb 2023 17:23:24 +0100 Message-Id: <20230214162325.312057-6-robert.marko@sartura.hr> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214162325.312057-1-robert.marko@sartura.hr> References: <20230214162325.312057-1-robert.marko@sartura.hr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Move pcnoc clocks up just after PLL-s to be able to use their HW fields. Signed-off-by: Robert Marko Reviewed-by: Konrad Dybcio --- drivers/clk/qcom/gcc-ipq4019.c | 74 +++++++++++++++++----------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/drivers/clk/qcom/gcc-ipq4019.c b/drivers/clk/qcom/gcc-ipq4019.c index f4bc587131c20..f2728dc1e5521 100644 --- a/drivers/clk/qcom/gcc-ipq4019.c +++ b/drivers/clk/qcom/gcc-ipq4019.c @@ -499,6 +499,43 @@ static struct clk_fepll gcc_fepllwcss5g_clk = { .pll_vco = &gcc_fepll_vco, }; +static const struct freq_tbl ftbl_gcc_pcnoc_ahb_clk[] = { + F(48000000, P_XO, 1, 0, 0), + F(100000000, P_FEPLL200, 2, 0, 0), + { } +}; + +static struct clk_rcg2 gcc_pcnoc_ahb_clk_src = { + .cmd_rcgr = 0x21024, + .hid_width = 5, + .parent_map = gcc_xo_200_500_map, + .freq_tbl = ftbl_gcc_pcnoc_ahb_clk, + .clkr.hw.init = &(struct clk_init_data){ + .name = "gcc_pcnoc_ahb_clk_src", + .parent_names = gcc_xo_200_500, + .num_parents = 3, + .ops = &clk_rcg2_ops, + }, +}; + +static struct clk_branch pcnoc_clk_src = { + .halt_reg = 0x21030, + .clkr = { + .enable_reg = 0x21030, + .enable_mask = BIT(0), + .hw.init = &(struct clk_init_data){ + .name = "pcnoc_clk_src", + .parent_names = (const char *[]){ + "gcc_pcnoc_ahb_clk_src", + }, + .num_parents = 1, + .ops = &clk_branch2_ops, + .flags = CLK_SET_RATE_PARENT | + CLK_IS_CRITICAL, + }, + }, +}; + static const struct freq_tbl ftbl_gcc_audio_pwm_clk[] = { F(48000000, P_XO, 1, 0, 0), F(200000000, P_FEPLL200, 1, 0, 0), @@ -1541,43 +1578,6 @@ static struct clk_branch gcc_wcss5g_rtc_clk = { }, }; -static const struct freq_tbl ftbl_gcc_pcnoc_ahb_clk[] = { - F(48000000, P_XO, 1, 0, 0), - F(100000000, P_FEPLL200, 2, 0, 0), - { } -}; - -static struct clk_rcg2 gcc_pcnoc_ahb_clk_src = { - .cmd_rcgr = 0x21024, - .hid_width = 5, - .parent_map = gcc_xo_200_500_map, - .freq_tbl = ftbl_gcc_pcnoc_ahb_clk, - .clkr.hw.init = &(struct clk_init_data){ - .name = "gcc_pcnoc_ahb_clk_src", - .parent_names = gcc_xo_200_500, - .num_parents = 3, - .ops = &clk_rcg2_ops, - }, -}; - -static struct clk_branch pcnoc_clk_src = { - .halt_reg = 0x21030, - .clkr = { - .enable_reg = 0x21030, - .enable_mask = BIT(0), - .hw.init = &(struct clk_init_data){ - .name = "pcnoc_clk_src", - .parent_names = (const char *[]){ - "gcc_pcnoc_ahb_clk_src", - }, - .num_parents = 1, - .ops = &clk_branch2_ops, - .flags = CLK_SET_RATE_PARENT | - CLK_IS_CRITICAL, - }, - }, -}; - static struct clk_regmap *gcc_ipq4019_clocks[] = { [AUDIO_CLK_SRC] = &audio_clk_src.clkr, [BLSP1_QUP1_I2C_APPS_CLK_SRC] = &blsp1_qup1_i2c_apps_clk_src.clkr,