From patchwork Thu Aug 18 22:06:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 598276 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 20B32C25B0E for ; Thu, 18 Aug 2022 22:06:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244944AbiHRWGf (ORCPT ); Thu, 18 Aug 2022 18:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239768AbiHRWGe (ORCPT ); Thu, 18 Aug 2022 18:06:34 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 587FCD21FD; Thu, 18 Aug 2022 15:06:33 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id t5so3525900edc.11; Thu, 18 Aug 2022 15:06:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=G2AMVsOrIUOLF7qOXeTIv39jlg5CAbzNTt2ny2QTgn4=; b=TxXiPRhsg+uZrhV4DrN+n8u/s0qBbirzhKotirjIiSAQ5s5Imopy5k0PaAY9sy+KNT GAY4uuZrsEqfNgBFZq6LH4uJrNW+WpkuhuyPXqXTMXpSaVjv9KqXK0/DrYctXLwHOryT UOjwGWTGtsElS6VDkq0oe2VV3NPWTrz9+RCoR/zD3dhQQzWdHP3cCA54tAc8xmxmwzZ4 ff3whgF/Iz8p3PNomMO54Dwv7YXO0VHnuINyAqiCbZXBdW+Nw83hR2Ac9dK1oiMa7PxV esw679Y8Px8Cl3zTP3O0VTjBz4q5IOxOUygZcUa/UhU89vQD5+0jNLBeiQjVkzf+V4iK r/Zg== 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; bh=G2AMVsOrIUOLF7qOXeTIv39jlg5CAbzNTt2ny2QTgn4=; b=A/S3u0o78lLrf2YZm+coKLLIHmAqtrxNNK66ZpEimm5tc0szNLzixZv10+4Cwf5xy5 od4lAKUMtQMkTfJXjW3seP7l/gIdEw/nIjxg9KQNZXu7efkBKWFhAlmcuIpGJHva+xU2 aXxmvQOst2Vmsk9g0tY0a2RFjT4MO7lYoPX2TBGP9kaczv8Q+oMERvGpHcjMBvVo/Ed6 TnwNT1Wnv30ne4kiz560NNBew32qiYhPoU3I9/vigSmRSNk55KiLTGZBjNb8I6GpW6dK IDsKfCqQ3gTRtUsxlECisy/mdRXPdfSQVUJQssTPhIO8kBEkCo4HWjK2KxN1Et8YzHHQ EN+Q== X-Gm-Message-State: ACgBeo3fYERqa/m+kHcvjOFEN1E3NIg+MLCslnYFwim2Zwy8wVinVQRA ooMmm4k0fZxRcFJ2nQTvBnF5YyyXTRY= X-Google-Smtp-Source: AA6agR7MLYAGrhAAe5zzSzARCBj2p8fb63sVh+4ikZ0b8qjDY0GDsMle/rmdFYj4rhi65iqOsJMQtA== X-Received: by 2002:a05:6402:e86:b0:440:d1be:20c7 with SMTP id h6-20020a0564020e8600b00440d1be20c7mr3732546eda.349.1660860391880; Thu, 18 Aug 2022 15:06:31 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-74.zg.cable.xnet.hr. [94.253.165.74]) by smtp.googlemail.com with ESMTPSA id dk5-20020a0564021d8500b00442d5054a51sm1851584edb.87.2022.08.18.15.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 15:06:31 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, konrad.dybcio@somainline.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sivaprak@codeaurora.org, dmitry.baryshkov@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH v3 2/9] clk: qcom: apss-ipq6018: fix apcs_alias0_clk_src Date: Fri, 19 Aug 2022 00:06:21 +0200 Message-Id: <20220818220628.339366-2-robimarko@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220818220628.339366-1-robimarko@gmail.com> References: <20220818220628.339366-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org While working on IPQ8074 APSS driver it was discovered that IPQ6018 and IPQ8074 use almost the same PLL and APSS clocks, however APSS driver is currently broken. More precisely apcs_alias0_clk_src is broken, it was added as regmap_mux clock. However after debugging why it was always stuck at 800Mhz, it was figured out that its not regmap_mux compatible at all. It is a simple mux but it uses RCG2 register layout and control bits, so utilize the new clk_rcg2_mux_closest_ops to correctly drive it while not having to provide a dummy frequency table. While we are here, use ARRAY_SIZE for number of parents. Tested on IPQ6018-CP01-C1 reference board and multiple IPQ8074 boards. Fixes: 5e77b4ef1b19 ("clk: qcom: Add ipq6018 apss clock controller") Signed-off-by: Robert Marko Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/apss-ipq6018.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/clk/qcom/apss-ipq6018.c b/drivers/clk/qcom/apss-ipq6018.c index d78ff2f310bf..be952d417ded 100644 --- a/drivers/clk/qcom/apss-ipq6018.c +++ b/drivers/clk/qcom/apss-ipq6018.c @@ -16,7 +16,7 @@ #include "clk-regmap.h" #include "clk-branch.h" #include "clk-alpha-pll.h" -#include "clk-regmap-mux.h" +#include "clk-rcg.h" enum { P_XO, @@ -33,16 +33,15 @@ static const struct parent_map parents_apcs_alias0_clk_src_map[] = { { P_APSS_PLL_EARLY, 5 }, }; -static struct clk_regmap_mux apcs_alias0_clk_src = { - .reg = 0x0050, - .width = 3, - .shift = 7, +static struct clk_rcg2 apcs_alias0_clk_src = { + .cmd_rcgr = 0x0050, + .hid_width = 5, .parent_map = parents_apcs_alias0_clk_src_map, .clkr.hw.init = &(struct clk_init_data){ .name = "apcs_alias0_clk_src", .parent_data = parents_apcs_alias0_clk_src, - .num_parents = 2, - .ops = &clk_regmap_mux_closest_ops, + .num_parents = ARRAY_SIZE(parents_apcs_alias0_clk_src), + .ops = &clk_rcg2_mux_closest_ops, .flags = CLK_SET_RATE_PARENT, }, }; From patchwork Thu Aug 18 22:06:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 598275 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 2935BC32792 for ; Thu, 18 Aug 2022 22:06:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343649AbiHRWGg (ORCPT ); Thu, 18 Aug 2022 18:06:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245098AbiHRWGf (ORCPT ); Thu, 18 Aug 2022 18:06:35 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EE6FD21F7; Thu, 18 Aug 2022 15:06:34 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id c39so3563201edf.0; Thu, 18 Aug 2022 15:06:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=rXCQ8SbozupG6ha1H9wZwHDGGr1UUdJ24PVvc1F+k98=; b=qn5CAoIVHpQInp9BIT7gOkNmrutb2Ci1prwWfuAddCgSkrpdbHfyntWsKKfgPkgs44 8UQYym3h8qBk9LSWTscOy/GeZxsfbxAPjcxIycTTWYuqsG3gx7N6gnckZCqHWSKpJJxO j9lOR9f6am7jmSfxx3VizQModuY3HRLCfBz+FnT9hjMXV1OD2289Ca5BPcdyfQCxv8G6 FfQYhoIcD5eb+Y+nlBAAw+jzzXUzamGpRQolLg/WPKViRWshv+FywVcOb+4WtSMDeM05 9nediODEpyS2l1vaPfbF8JpR16TVhcpZj6C0dG2NCVTJEJSeGeoeY+Hjtoq5ZFc4j+6G uldg== 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; bh=rXCQ8SbozupG6ha1H9wZwHDGGr1UUdJ24PVvc1F+k98=; b=zIOCTpLs0/NdRCvzM6bNNhAaYlTncCUhOqvNPz0iMrg+foaYcGu0CBVdyr47dThkGp hZ0im3PCJE82d3gMQGdFFPdBpLUo/Now8sCeakszfF/Q45DR2db5cP6h8Gqlqjyp5Vg4 YeNOXuJVQGnHlJKprNtahEO/qfNhdeExktKCGHjWqD0mvpjBKrB0UMHRQXKLqXZwQECw bGBiJQrnueXEIjpnPlDy4UNQwNJTax9yLNH/XcHp9TlpwzzjPPRLN54PAljZ05U+Q2l/ p6Hp/rCQfxveDRAWQJVww/6BvVuq8ezpKmD4bvCrclvIFsCWPwbRHyWdLPOL7i1zjORR ZvsA== X-Gm-Message-State: ACgBeo0Fp2ar2/z0AFGm+dT0A+iSCrXBXf/A/vIDU9qQU+yzQ/NxYNZW MEtfaK5Smlur2F9EGfoUNerWUDYeO2A= X-Google-Smtp-Source: AA6agR455XAlEKvdEXZh03rSWl/Cq/MwRL5ESK3iNkYuBOdA+v4ZUCmSFXNbYbvPrz93DjwqLNvMUQ== X-Received: by 2002:aa7:d802:0:b0:445:e618:fae8 with SMTP id v2-20020aa7d802000000b00445e618fae8mr3817005edq.182.1660860393009; Thu, 18 Aug 2022 15:06:33 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-74.zg.cable.xnet.hr. [94.253.165.74]) by smtp.googlemail.com with ESMTPSA id dk5-20020a0564021d8500b00442d5054a51sm1851584edb.87.2022.08.18.15.06.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 15:06:32 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, konrad.dybcio@somainline.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sivaprak@codeaurora.org, dmitry.baryshkov@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH v3 3/9] clk: qcom: apss-ipq6018: mark apcs_alias0_core_clk as critical Date: Fri, 19 Aug 2022 00:06:22 +0200 Message-Id: <20220818220628.339366-3-robimarko@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220818220628.339366-1-robimarko@gmail.com> References: <20220818220628.339366-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org While fixing up the driver I noticed that my IPQ8074 board was hanging after CPUFreq switched the frequency during boot, WDT would eventually reset it. So mark apcs_alias0_core_clk as critical since its the clock feeding the CPU cluster and must never be disabled. Fixes: 5e77b4ef1b19 ("clk: qcom: Add ipq6018 apss clock controller") Signed-off-by: Robert Marko Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/apss-ipq6018.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/qcom/apss-ipq6018.c b/drivers/clk/qcom/apss-ipq6018.c index be952d417ded..f2f502e2d5a4 100644 --- a/drivers/clk/qcom/apss-ipq6018.c +++ b/drivers/clk/qcom/apss-ipq6018.c @@ -56,7 +56,7 @@ static struct clk_branch apcs_alias0_core_clk = { .parent_hws = (const struct clk_hw *[]){ &apcs_alias0_clk_src.clkr.hw }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, .ops = &clk_branch2_ops, }, }, From patchwork Thu Aug 18 22:06:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 598274 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 60AE4C28B2B for ; Thu, 18 Aug 2022 22:06:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241661AbiHRWGs (ORCPT ); Thu, 18 Aug 2022 18:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345265AbiHRWGi (ORCPT ); Thu, 18 Aug 2022 18:06:38 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBB37D25E9; Thu, 18 Aug 2022 15:06:36 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id z2so3542310edc.1; Thu, 18 Aug 2022 15:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=FCwIidSpgWojKZHiatQEHHdaDA4BlPDLukpx2Wl2YA8=; b=OXZJRFfv/tDTLpZ7EcRPyoHaYOizwRF3OnsLDsIyoTjjM+el1vrWD+H7UIHTVMhb+T n46TP7/uhWgA+k2iTr8XNklJjiuhX0eECXG1wMrHrf2dhu89O92eu5M7s+SKfYachAYA bqmQuGjSajfZK1aUOAYg3ZZkXSx1jvjJVtjRwr+Y3DZMwTOzf4vEoQhhJ9zigafwsG8N gnrKHFOmYozFPZvs4v5p6XNhEQ7/JvEriKQa3jYhxPJOgECvxsgPoVUrjkJcU3fby7+d iRPswszNDx7uOpdwyHEHSxbSM0RvveIXH4NZDEiB+t1JMnbDR3Bq85VDr3oP0mmnKMgP 9T/Q== 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; bh=FCwIidSpgWojKZHiatQEHHdaDA4BlPDLukpx2Wl2YA8=; b=lmPiU7ZKnzIEHmdrBmzL+LQrxKKLpL3oC5VfYw/D76Y+f163Tpd7nPkiuA+BYGg5UP ksiuQnl82Rcgx3LTXoMQwwRzud/eruQfm8WBLBD/89234329Dt+UmTuZgVgq66YASyWY zDzwUC3boBZ8lNvajny+SeQEbqkCrWTQ1xEl7bs+vbSJyZ7dQ8sCneZciynQx+ZFoFpp bQe9eXizGtE5yffpP4VN7P9gJXZBB2ap1gt5SczkHT+L07bANr1HtvpFIoR2LWeKVNNr 41SU06yUOPY2v5N05zIHfoMM3KJSVtLyT2sgifWtUnxZ4WY8pYlzLs25GnnENaIw7F6M SyhQ== X-Gm-Message-State: ACgBeo2bpwQVljfEQIMYtM8hcxDU/zuMcUKzfK+aSDVnGFaLRPiPRRg2 9skMXAA93KFZ8L4F/65e4rI= X-Google-Smtp-Source: AA6agR49r2mKm0LVyTgxcULjsiTvK2W3/OBx8qOa30gQyB+N4Zw7F3ucffAyAehE+pZjQxTc6fx8zQ== X-Received: by 2002:a05:6402:20b:b0:440:cb9f:c469 with SMTP id t11-20020a056402020b00b00440cb9fc469mr3807435edv.420.1660860395240; Thu, 18 Aug 2022 15:06:35 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-74.zg.cable.xnet.hr. [94.253.165.74]) by smtp.googlemail.com with ESMTPSA id dk5-20020a0564021d8500b00442d5054a51sm1851584edb.87.2022.08.18.15.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 15:06:34 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, konrad.dybcio@somainline.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sivaprak@codeaurora.org, dmitry.baryshkov@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH v3 5/9] clk: qcom: apss-ipq-pll: use OF match data for Alpha PLL config Date: Fri, 19 Aug 2022 00:06:24 +0200 Message-Id: <20220818220628.339366-5-robimarko@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220818220628.339366-1-robimarko@gmail.com> References: <20220818220628.339366-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Convert the driver to use OF match data for providing the Alpha PLL config per compatible. This is required for IPQ8074 support since it uses a different Alpha PLL config. While we are here rename "ipq_pll_config" to "ipq6018_pll_config" to make it clear that it is for IPQ6018 only. Signed-off-by: Robert Marko --- drivers/clk/qcom/apss-ipq-pll.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/apss-ipq-pll.c b/drivers/clk/qcom/apss-ipq-pll.c index bef7899ad0d6..ba77749b16c4 100644 --- a/drivers/clk/qcom/apss-ipq-pll.c +++ b/drivers/clk/qcom/apss-ipq-pll.c @@ -2,6 +2,7 @@ // Copyright (c) 2018, The Linux Foundation. All rights reserved. #include #include +#include #include #include @@ -36,7 +37,7 @@ static struct clk_alpha_pll ipq_pll = { }, }; -static const struct alpha_pll_config ipq_pll_config = { +static const struct alpha_pll_config ipq6018_pll_config = { .l = 0x37, .config_ctl_val = 0x04141200, .config_ctl_hi_val = 0x0, @@ -54,6 +55,7 @@ static const struct regmap_config ipq_pll_regmap_config = { static int apss_ipq_pll_probe(struct platform_device *pdev) { + const struct alpha_pll_config *ipq_pll_config; struct device *dev = &pdev->dev; struct regmap *regmap; void __iomem *base; @@ -67,7 +69,11 @@ static int apss_ipq_pll_probe(struct platform_device *pdev) if (IS_ERR(regmap)) return PTR_ERR(regmap); - clk_alpha_pll_configure(&ipq_pll, regmap, &ipq_pll_config); + ipq_pll_config = of_device_get_match_data(&pdev->dev); + if (!ipq_pll_config) + return -ENODEV; + + clk_alpha_pll_configure(&ipq_pll, regmap, ipq_pll_config); ret = devm_clk_register_regmap(dev, &ipq_pll.clkr); if (ret) @@ -78,7 +84,7 @@ static int apss_ipq_pll_probe(struct platform_device *pdev) } static const struct of_device_id apss_ipq_pll_match_table[] = { - { .compatible = "qcom,ipq6018-a53pll" }, + { .compatible = "qcom,ipq6018-a53pll", .data = &ipq6018_pll_config }, { } }; MODULE_DEVICE_TABLE(of, apss_ipq_pll_match_table); From patchwork Thu Aug 18 22:06:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 598273 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 9F8ABC32796 for ; Thu, 18 Aug 2022 22:06:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345966AbiHRWGv (ORCPT ); Thu, 18 Aug 2022 18:06:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245098AbiHRWGq (ORCPT ); Thu, 18 Aug 2022 18:06:46 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0151D25FF; Thu, 18 Aug 2022 15:06:38 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id e13so3506669edj.12; Thu, 18 Aug 2022 15:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=cOo4Et7NAlia+d7YoxikfbUbzkauXGD559ac+lhPQD0=; b=YnGZV402MKh2rXUJ1vPNqPLdRdGhEraZk61ps8qnwJrWzGIQxo0l41McW7fkfSy9uB SO6R1ncNIRUob7FWdOvI3Lqyz7YJd2T9XC2hJ5tf7oTQZHfofxi1QPyd+RYWqRfAyY7T 5YMIAl05rKbYoM6fs0Xu7FC7b8dB6UO3kbJ6JaMAIpgamkZahbo0O9eegZWfzFXaung2 MuggSRTdHPtIk9kbTl+A2fEKvzaMjkhHGOKIX+s9l1rXkjb1O0hFOWpgrPyEzvb/NWtN VViBlFNTuupdWyCHAodmFKnC2WVcvDXq46jovMnX9S3V5CGBw4osFsHhz7EDW7wkzEOB xkNg== 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; bh=cOo4Et7NAlia+d7YoxikfbUbzkauXGD559ac+lhPQD0=; b=sNbKHk9uCVTmjPbxZksSL3L2CDeAWsWmEzrcjIfEYS+vMlLZ8I4lEMJTCsN+UiphQj iw75hfgc7Rdf/lkhS/CeXffo/x0XMLqB3+5CpoWFVHnT3xf0Xx69OFxMpoMb8HjWHLJU FqF5cMX9ECPmQqajfLTvd9Rah87TuUwE6eiC6KmRwdpyHLZ1RX86WsuKI6cSKcPIm1MP Dfi26RCNtlA+/u9exvrEJsiUxoHiZA6A8kNuJwXW8fyz8Ve9Jvx2/9WyQfEZomuNiSYP LH8HiKKQI6MFqyFbvDBDIKaVj7TNiAMrw6dUC0ePhZ3xbRmi/ZLEy8vOF6QPFax8qGQ3 viBg== X-Gm-Message-State: ACgBeo1atzrTjOHPyQLu3l2VuawCXpTCFmOut/VnIY0jG3q1i+qT2QZr FWF4BluGhP99ldwOxVxEYMo= X-Google-Smtp-Source: AA6agR6dxYVG3NB2Aw34X8VZnW0zb7a13V4hg4xpPOmkL4eiN4iuZyftHEw75Zon3exGYDKH0FQPuw== X-Received: by 2002:a05:6402:428a:b0:42e:8f7e:1638 with SMTP id g10-20020a056402428a00b0042e8f7e1638mr3778405edc.228.1660860397482; Thu, 18 Aug 2022 15:06:37 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-74.zg.cable.xnet.hr. [94.253.165.74]) by smtp.googlemail.com with ESMTPSA id dk5-20020a0564021d8500b00442d5054a51sm1851584edb.87.2022.08.18.15.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 15:06:37 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, konrad.dybcio@somainline.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sivaprak@codeaurora.org, dmitry.baryshkov@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH v3 7/9] clk: qcom: apss-ipq-pll: add support for IPQ8074 Date: Fri, 19 Aug 2022 00:06:26 +0200 Message-Id: <20220818220628.339366-7-robimarko@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220818220628.339366-1-robimarko@gmail.com> References: <20220818220628.339366-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add support for IPQ8074 since it uses the same PLL setup, however it uses slightly different Alpha PLL config. Alpha PLL config was obtained by dumping PLL registers from a running device. Signed-off-by: Robert Marko --- Changes in v2: * Drop hardcoded compatible check for IPQ6018 to do the PLL config and utilize match data provided by previous commit * Add IPQ8074 Alpha PLL config using match data * Update commit description to reflect changes --- drivers/clk/qcom/apss-ipq-pll.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/clk/qcom/apss-ipq-pll.c b/drivers/clk/qcom/apss-ipq-pll.c index a4016f3854c2..a5aea27eb867 100644 --- a/drivers/clk/qcom/apss-ipq-pll.c +++ b/drivers/clk/qcom/apss-ipq-pll.c @@ -49,6 +49,18 @@ static const struct alpha_pll_config ipq6018_pll_config = { .test_ctl_hi_val = 0x4000, }; +static const struct alpha_pll_config ipq8074_pll_config = { + .l = 0x48, + .config_ctl_val = 0x200d4828, + .config_ctl_hi_val = 0x6, + .early_output_mask = BIT(3), + .aux2_output_mask = BIT(2), + .aux_output_mask = BIT(1), + .main_output_mask = BIT(0), + .test_ctl_val = 0x1c000000, + .test_ctl_hi_val = 0x4000, +}; + static const struct regmap_config ipq_pll_regmap_config = { .reg_bits = 32, .reg_stride = 4, @@ -89,6 +101,7 @@ static int apss_ipq_pll_probe(struct platform_device *pdev) static const struct of_device_id apss_ipq_pll_match_table[] = { { .compatible = "qcom,ipq6018-a53pll", .data = &ipq6018_pll_config }, + { .compatible = "qcom,ipq8074-a53pll", .data = &ipq8074_pll_config }, { } }; MODULE_DEVICE_TABLE(of, apss_ipq_pll_match_table); From patchwork Thu Aug 18 22:06:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 598272 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 3893BC00140 for ; Thu, 18 Aug 2022 22:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345730AbiHRWG7 (ORCPT ); Thu, 18 Aug 2022 18:06:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345210AbiHRWGq (ORCPT ); Thu, 18 Aug 2022 18:06:46 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D529D25D7; Thu, 18 Aug 2022 15:06:41 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id j21so294121ejs.0; Thu, 18 Aug 2022 15:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=/p7wEsx40ftm7k1b0tuUKI3U1MknbT3BVCyH8Q6QIMU=; b=O7gPhKqOA0e5MnX3kqEysQ7xDxR0LdWdJTtp0H1JYMxXNafSfWudGmq7yFKqCD4U2X ZGW6JhJjTqhBSY8Wqxekj6ZUq40biTjtb+vzGF9EFk5FRMJUy9S+pA2yCIq+Thn3B+ib 2VSz38MptPDZlsrJEuO6pwRL7+Rl7bMI5yfe9XtPthli/btDuO2JnthwjwhHs+2Ke7il Wbsdo5FdpQ/x8ZvehO/d1prc8dFPbYqQuPXu1/k7t+264B8OEv9TLeJTOhJkiaZVyyP9 788fkhpjdD8jDLLvF70xgyluNBXrJAU3veWN+gefn8dU0BaEii8kNzWuYwpI0F9BcksO hgDA== 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; bh=/p7wEsx40ftm7k1b0tuUKI3U1MknbT3BVCyH8Q6QIMU=; b=ENbeHRJf9oj6DDlpzC6ifHUHx2r2DPeJOLeyrAMYh6aUM41kAZfmZL3X7CBc9IF++n +mfVCzTN3ilamZO4eVCa27b2fo/9Mhrvpd/FzKbnWkPjqdGyvBLVWw3smX6sFCj265Pj WYlYOVpwYbTgISIcGLpHpyzDLSdaTY+66W0maZn1F8tPLTBKa5EtwYhcF3QIqErshQAS kqocMg9fEKK5MTMQxp0ZB3YuzinDaPYae8PnIdKm2zdrGS2mF1k6E/1z1keUC1LfpKbI PlFeHDZr05L/ft+ITj6mDZJzs7Aydvn6UoEBDAms3bGCu8HOe3lXJYPbcsFqnc16uWFf kesg== X-Gm-Message-State: ACgBeo2C5X1njPrtosvWMwAMGypKWr1vWf1CYXADTDDMEwtsvEIMSywU MDdPifcjadd8IH0uCo+U7cI= X-Google-Smtp-Source: AA6agR4fdYnQnGN3buSCRWdAQjBgFY2MsSDF7MfCymXNJOZKGU1skM3Y2SD1j+dAwwTgceh1EvRqwQ== X-Received: by 2002:a17:906:b2d4:b0:731:4594:8ba1 with SMTP id cf20-20020a170906b2d400b0073145948ba1mr3088359ejb.288.1660860399732; Thu, 18 Aug 2022 15:06:39 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-74.zg.cable.xnet.hr. [94.253.165.74]) by smtp.googlemail.com with ESMTPSA id dk5-20020a0564021d8500b00442d5054a51sm1851584edb.87.2022.08.18.15.06.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 15:06:39 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, konrad.dybcio@somainline.org, mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, sivaprak@codeaurora.org, dmitry.baryshkov@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Robert Marko Subject: [PATCH v3 9/9] arm64: dts: qcom: ipq8074: add A53 PLL node Date: Fri, 19 Aug 2022 00:06:28 +0200 Message-Id: <20220818220628.339366-9-robimarko@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220818220628.339366-1-robimarko@gmail.com> References: <20220818220628.339366-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add the required node for A53 PLL which will be used to provide the CPU clock via APCS for APSS scaling. Signed-off-by: Robert Marko --- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/ipq8074.dtsi b/arch/arm64/boot/dts/qcom/ipq8074.dtsi index 5b62d7590fc6..bace14b742a1 100644 --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi @@ -709,6 +709,14 @@ apcs_glb: mailbox@b111000 { #mbox-cells = <1>; }; + a53pll: clock@b116000 { + compatible = "qcom,ipq8074-a53pll"; + reg = <0x0b116000 0x40>; + #clock-cells = <0>; + clocks = <&xo>; + clock-names = "xo"; + }; + timer@b120000 { #address-cells = <1>; #size-cells = <1>;