Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp551264rwb; Thu, 11 Aug 2022 06:17:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR4176tnmCF5mmTVxTyumkpjajmLT8b5I6x4PJAuowIMaaZUjMR0PHSohxHM9JKjRYG82keF X-Received: by 2002:a17:90a:1b65:b0:1f7:4725:aa6e with SMTP id q92-20020a17090a1b6500b001f74725aa6emr8660635pjq.179.1660223864199; Thu, 11 Aug 2022 06:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660223864; cv=none; d=google.com; s=arc-20160816; b=uhseJVAniDYvfGk8ZwYlie3iMIpGG3O5YZ5Om/cZPTPOpMtphPT7Uzd5D+IEkU+hjB 0XSzdBpa5AzI+sjCZC6iqWCWYfXRhUKJ/DRT1bPtaGNvTdywIkb/Y6SoCznMN6V4qQD8 iQfssbyYh2zGInSqKxIEU/dDznRHOMgzTQWdxkPjcEhaFnNmGC6NgcnmBoI5cRpxBIFM U4qc03Xt2u1h3BhZ9a5NTXmYOxBdAd4NFmRp7u49jSk4xU4ASjAp8uz/Z3N4vnOz0Xav mgQCCspYpxZV0hCB9vJoU26JH7gN8MpSud9Z3a+6K94KHcxN+9vFOsdPp0IvFi8+kFOz QvlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=7qOJ2iSEVhbL4soYYVRufdakZPMD3ECMpcdcVEtd/kI=; b=LQiaJlyOTOhmGT36BebsONlSJ2O73hgvuJYuR4uZejjKPeoLPIVFY/5KR+0uhF3eN2 Qo6Jfe03dRU19jyuxY2wq3duw/7pcgwe/jJ1nZdYtIWY4SYJ0c1/tEPppKrNpttmgKXn 1Z1/9buDiDBzJ+YpZvykaMjVEQuCTt2OjkmgFjjRYOgFTwd+EBh0NyhNLJ4PHecc65YR WPFbCQrqw/VZWxbZ9jgseRkT/R8R64XAhgG3fSvQD8rxv639mOC4P0zmKD6eY2Otz0or 4iuWo2DAH/QO148gG7/5/gxWD4FAbZhLoxDcnGwy3u+FmMPaotFPiqtVb3kCXfrRHg85 Drtg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v9-20020a63b649000000b0041ae144858dsi18743187pgt.323.2022.08.11.06.17.29; Thu, 11 Aug 2022 06:17:44 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235393AbiHKMq7 (ORCPT + 99 others); Thu, 11 Aug 2022 08:46:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235362AbiHKMq6 (ORCPT ); Thu, 11 Aug 2022 08:46:58 -0400 Received: from relay08.th.seeweb.it (relay08.th.seeweb.it [IPv6:2001:4b7a:2000:18::169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C5FF2558F for ; Thu, 11 Aug 2022 05:46:57 -0700 (PDT) Received: from [192.168.1.101] (abxh187.neoplus.adsl.tpnet.pl [83.9.1.187]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id 103193F64F; Thu, 11 Aug 2022 14:46:55 +0200 (CEST) Message-ID: <3ad241c6-3b94-2c4e-8e17-ba526383cecf@somainline.org> Date: Thu, 11 Aug 2022 14:46:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH 2/2] clk: qcom: Add SC8280XP GPU clock controller Content-Language: en-US To: Bjorn Andersson , Andy Gross , Stephen Boyd , Taniya Das Cc: Michael Turquette , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220811042855.3867774-1-bjorn.andersson@linaro.org> <20220811042855.3867774-3-bjorn.andersson@linaro.org> From: Konrad Dybcio In-Reply-To: <20220811042855.3867774-3-bjorn.andersson@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 11.08.2022 06:28, Bjorn Andersson wrote: > Add driver for the GPU clock controller in the Qualcomm SC8280XP > platform. > > Signed-off-by: Bjorn Andersson > --- > drivers/clk/qcom/Kconfig | 8 + > drivers/clk/qcom/Makefile | 1 + > drivers/clk/qcom/gpucc-sc8280xp.c | 460 ++++++++++++++++++++++++++++++ > 3 files changed, 469 insertions(+) > create mode 100644 drivers/clk/qcom/gpucc-sc8280xp.c > > diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig > index 7ea5c2208a86..64a9cf245295 100644 > --- a/drivers/clk/qcom/Kconfig > +++ b/drivers/clk/qcom/Kconfig > @@ -454,6 +454,14 @@ config SC_GPUCC_7280 > Say Y if you want to support graphics controller devices and > functionality such as 3D graphics. > > +config SC_GPUCC_8280XP > + tristate "SC8280XP Graphics Clock Controller" > + select SC_GCC_8280XP > + help > + Support for the graphics clock controller on SC8280XP devices. > + Say Y if you want to support graphics controller devices and > + functionality such as 3D graphics. > + > config SC_LPASSCC_7280 > tristate "SC7280 Low Power Audio Subsystem (LPASS) Clock Controller" > select SC_GCC_7280 > diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile > index 4fd88ee7679b..6cdb05152548 100644 > --- a/drivers/clk/qcom/Makefile > +++ b/drivers/clk/qcom/Makefile > @@ -72,6 +72,7 @@ obj-$(CONFIG_SC_GCC_8180X) += gcc-sc8180x.o > obj-$(CONFIG_SC_GCC_8280XP) += gcc-sc8280xp.o > obj-$(CONFIG_SC_GPUCC_7180) += gpucc-sc7180.o > obj-$(CONFIG_SC_GPUCC_7280) += gpucc-sc7280.o > +obj-$(CONFIG_SC_GPUCC_8280XP) += gpucc-sc8280xp.o > obj-$(CONFIG_SC_LPASSCC_7280) += lpasscc-sc7280.o > obj-$(CONFIG_SC_LPASS_CORECC_7180) += lpasscorecc-sc7180.o > obj-$(CONFIG_SC_LPASS_CORECC_7280) += lpasscorecc-sc7280.o lpassaudiocc-sc7280.o > diff --git a/drivers/clk/qcom/gpucc-sc8280xp.c b/drivers/clk/qcom/gpucc-sc8280xp.c > new file mode 100644 > index 000000000000..555fd4ff58ab > --- /dev/null > +++ b/drivers/clk/qcom/gpucc-sc8280xp.c > @@ -0,0 +1,460 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) 2021, The Linux Foundation. All rights reserved. > + */ > + > +#include > +#include > +#include > +#include > + > +#include > + > +#include "clk-alpha-pll.h" > +#include "clk-branch.h" > +#include "clk-rcg.h" > +#include "clk-regmap-divider.h" > +#include "common.h" > +#include "reset.h" > +#include "gdsc.h" > + > +/* Need to match the order of clocks in DT binding */ > +enum { > + DT_BI_TCXO, > + DT_GCC_GPU_GPLL0_CLK_SRC, > + DT_GCC_GPU_GPLL0_DIV_CLK_SRC, > +}; > + > +enum { > + P_BI_TCXO, > + P_GCC_GPU_GPLL0_CLK_SRC, > + P_GCC_GPU_GPLL0_DIV_CLK_SRC, > + P_GPU_CC_PLL0_OUT_MAIN, > + P_GPU_CC_PLL1_OUT_MAIN, > +}; > + > +static const struct clk_parent_data parent_data_tcxo = { .index = DT_BI_TCXO }; > + > +static const struct pll_vco lucid_5lpe_vco[] = { > + { 249600000, 1800000000, 0 }, > +}; > + > +static struct alpha_pll_config gpu_cc_pll0_config = { > + .l = 0x1c, > + .alpha = 0xa555, > + .config_ctl_val = 0x20485699, > + .config_ctl_hi_val = 0x00002261, > + .config_ctl_hi1_val = 0x2a9a699c, > + .test_ctl_val = 0x00000000, > + .test_ctl_hi_val = 0x00000000, > + .test_ctl_hi1_val = 0x01800000, > + .user_ctl_val = 0x00000000, > + .user_ctl_hi_val = 0x00000805, > + .user_ctl_hi1_val = 0x00000000, > +}; > + > +static struct clk_alpha_pll gpu_cc_pll0 = { > + .offset = 0x0, > + .vco_table = lucid_5lpe_vco, > + .num_vco = ARRAY_SIZE(lucid_5lpe_vco), > + .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_LUCID], > + .clkr = { > + .hw.init = &(struct clk_init_data){ > + .name = "gpu_cc_pll0", > + .parent_data = &parent_data_tcxo, > + .num_parents = 1, > + .ops = &clk_alpha_pll_lucid_5lpe_ops, > + }, > + }, > +}; > + > +static struct alpha_pll_config gpu_cc_pll1_config = { > + .l = 0x1A, > + .alpha = 0xAAA, > + .config_ctl_val = 0x20485699, > + .config_ctl_hi_val = 0x00002261, > + .config_ctl_hi1_val = 0x2A9A699C, Lowercase hex, please. Otherwise, this looks nice: Reviewed-by: Konrad Dybcio Konrad