From patchwork Mon Jul 11 21: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: 12914273 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 D0042C43334 for ; Mon, 11 Jul 2022 21:06:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbiGKVGm (ORCPT ); Mon, 11 Jul 2022 17:06:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiGKVGj (ORCPT ); Mon, 11 Jul 2022 17:06:39 -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 746365A451; Mon, 11 Jul 2022 14:06:38 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id m16so7744897edb.11; Mon, 11 Jul 2022 14:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Xfp89QyK0/p/8PmDaqGqGqPNT0fmeAkB/Wk4K0Cj4hI=; b=h7qJwRXjuIF5/hRpUwuhAUXZrPIT36RfWFWRQzyE53G2dK1gl40u+X3NukQI/xyISR TB5FLI6Y2DQwU1bC0aGmsgyhkgqKQUcdptIIxDyi//HjQjwZD1QIkvunHqWg7CbUoN9X qe+Er0GIK2fL5fhM288QM6MoaPc9a/XcuS6kDo1tyUynTJVp+wrIFk+CoCOuNb8B0UAi mzbXV5+3Q+nXGjeDoQpxQtp6T06ETs+eD3olHpfAVT9NGi9M1KfGERP0gtEd5V37uVtN gGh7xWhxbHAfrbRxfUkNTX8fklN/dlqGikQQR6kygNdcgQsb3FdwCntgkJF5yK0n5kgC sFCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Xfp89QyK0/p/8PmDaqGqGqPNT0fmeAkB/Wk4K0Cj4hI=; b=ISqe3pF3K62J5nsawVpeNfx+2WtVNcSaDLeI21oTATcQOjTWA9QwO/GzRJuUODg+1/ 0pgk8JCHXx2/so7goTKWxmzV4y1R5qacei5J/+zPe4ly2BJP3xueYKOOLdv7Jy67Cf1A 4hKthTb+gFdX858saU1H3IGo1+DXq3eoAosEwm0UGKCSZ0nKkD+LLV6i9xom95ZkpXa+ rL8bYu8kWvRBC6ny9wpxVMRcmRjZEMZ0XOk1AJQhQsm0at2cmkNFYGCvrCyVT+z69qug 9Q+/tLMlAxeWsfXqCR2jABGNI/TVteAhgqDE7AyGOw4cUBTCdMQVoWoD+8WClK0/EuQu CayA== X-Gm-Message-State: AJIora8lqE5tkt6y+slEtI7CH9bXR0FhONGUN1Pyx2Qt2Vm1GVR8dy/C 9f/GUS8GoB943nxI1fMqevg= X-Google-Smtp-Source: AGRyM1sH60y9Q8ZWrBVFITITOeGCiSlaWCsvQmhRaNGjeHqGABOg3dklQHXFKaOC0FNlCC6krenczg== X-Received: by 2002:a05:6402:5205:b0:43a:b520:c7de with SMTP id s5-20020a056402520500b0043ab520c7demr23403794edd.22.1657573597018; Mon, 11 Jul 2022 14:06:37 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-104.zg.cable.xnet.hr. [94.253.165.104]) by smtp.googlemail.com with ESMTPSA id lb17-20020a170907785100b0072a430d2abdsm3052562ejc.91.2022.07.11.14.06.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 14:06:36 -0700 (PDT) From: Robert Marko To: bjorn.andersson@linaro.org, agross@kernel.org, konrad.dybcio@somainline.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: Christian Marangi , Robert Marko , Dmitry Baryshkov Subject: [PATCH v2 1/7] clk: qcom: clk-rcg2: add rcg2 mux ops Date: Mon, 11 Jul 2022 23:06:28 +0200 Message-Id: <20220711210634.3042092-1-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Christian Marangi An RCG may act as a mux that switch between 2 parents. This is the case on IPQ6018 and IPQ8074 where the APCS core clk that feeds the CPU cluster clock just switches between XO and the PLL that feeds it. Add the required ops to add support for this special configuration and use the generic mux function to determine the rate. This way we dont have to keep a essentially dummy frequency table to use RCG2 as a mux. Signed-off-by: Christian Marangi Signed-off-by: Robert Marko Reviewed-by: Dmitry Baryshkov --- drivers/clk/qcom/clk-rcg.h | 1 + drivers/clk/qcom/clk-rcg2.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/clk/qcom/clk-rcg.h b/drivers/clk/qcom/clk-rcg.h index 012e745794fd..01581f4d2c39 100644 --- a/drivers/clk/qcom/clk-rcg.h +++ b/drivers/clk/qcom/clk-rcg.h @@ -167,6 +167,7 @@ struct clk_rcg2_gfx3d { extern const struct clk_ops clk_rcg2_ops; extern const struct clk_ops clk_rcg2_floor_ops; +extern const struct clk_ops clk_rcg2_mux_closest_ops; extern const struct clk_ops clk_edp_pixel_ops; extern const struct clk_ops clk_byte_ops; extern const struct clk_ops clk_byte2_ops; diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index 28019edd2a50..609c10f8d0d9 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -509,6 +509,13 @@ const struct clk_ops clk_rcg2_floor_ops = { }; EXPORT_SYMBOL_GPL(clk_rcg2_floor_ops); +const struct clk_ops clk_rcg2_mux_closest_ops = { + .determine_rate = __clk_mux_determine_rate_closest, + .get_parent = clk_rcg2_get_parent, + .set_parent = clk_rcg2_set_parent, +}; +EXPORT_SYMBOL_GPL(clk_rcg2_mux_closest_ops); + struct frac_entry { int num; int den; From patchwork Mon Jul 11 21:06:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12914274 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 886A5C433EF for ; Mon, 11 Jul 2022 21:06:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231916AbiGKVGo (ORCPT ); Mon, 11 Jul 2022 17:06:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiGKVGn (ORCPT ); Mon, 11 Jul 2022 17:06:43 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 914C861136; Mon, 11 Jul 2022 14:06:39 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id y8so7777278eda.3; Mon, 11 Jul 2022 14:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uazmij0Esvr2NeRa8qq3R8EEDOgLATsuriz7SNqzQq4=; b=KNpmjORjN9Cnuurg42Z9ZqXLSIUAEkJg6aGJbC/9NZgi+A1YF6BMgWBuuNptWA8bWR UYpjcsoHZwbMZoGRC0y/m6FsYkkrmppYAF1FrrfZ0NyKQkxAnu/rKJ2qmLuKGevblnPC X8aYi4fkjvX7v0RIxtFI0YcPr2U5gQcctWLaLhHNDfp5MdjZnPZB80FLR3cYfEUiQgmD abjwMP0Xf8vBXfay6xxY3xoCw3DyQ1PiW9gBtCxVkAs1sj48UJeSdFgeI+a2boSC27Fx DDDevk6tkN9YQ3T32Io8uDdDbRGGeZxZRxze8auZ7i8lXhDjiSmTBL1bEGsm16iQWuJS tqTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uazmij0Esvr2NeRa8qq3R8EEDOgLATsuriz7SNqzQq4=; b=pnTdDABJCMt6TAa38d0YY275zCbP/8PkdRR+fPomseIGrobgs3U8MkNcEji9YJARqn UpkMXSvFr6wq5Bfu0WwYyJYzVjSQSstHjZ5HOiJP30YzQ8nd+gipqkcUhSUEKDtAsLrh LXxcjcVv/amjX4AUcijBgaVvxtrVkAOOrMjKS8BNMj/5IjYUJ9W6NlYLZxszukYU9U/l dN3VykN0Qf+uzLKjOGhEJgRrkzGRe34YRLDfgQkclEDHDXC8/F6ebGOYYKIZkWXzIYxu eg7yz+jUy6tArXg1CPDmLkVQrxiuo5Klw2GDUDK0kcV7NMEAC+xdEsnk7Nw9JStSYlCv pQzg== X-Gm-Message-State: AJIora/31WTnewRx4VoKAmeDXDSbq7UJ+wRtI1wD1hLNlGrNBeGj8EEa /u+Q/40xBrbomL6arcvQEHU= X-Google-Smtp-Source: AGRyM1szg7J3Am+CedvikNzTE+AzcoNI3BTG1zSobgSxdI2pvbuLF/Q8MLQ+euSX7ezHJ9Q7PZ1rBQ== X-Received: by 2002:a05:6402:913:b0:43a:b594:93a8 with SMTP id g19-20020a056402091300b0043ab59493a8mr23154274edz.346.1657573598153; Mon, 11 Jul 2022 14:06:38 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-104.zg.cable.xnet.hr. [94.253.165.104]) by smtp.googlemail.com with ESMTPSA id lb17-20020a170907785100b0072a430d2abdsm3052562ejc.91.2022.07.11.14.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 14:06:37 -0700 (PDT) From: Robert Marko To: bjorn.andersson@linaro.org, agross@kernel.org, konrad.dybcio@somainline.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: Robert Marko , Dmitry Baryshkov Subject: [PATCH v2 2/7] clk: qcom: apss-ipq6018: fix apcs_alias0_clk_src Date: Mon, 11 Jul 2022 23:06:29 +0200 Message-Id: <20220711210634.3042092-2-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711210634.3042092-1-robimarko@gmail.com> References: <20220711210634.3042092-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 Mon Jul 11 21:06:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12914275 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 32C08CCA487 for ; Mon, 11 Jul 2022 21:06:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231934AbiGKVGp (ORCPT ); Mon, 11 Jul 2022 17:06:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbiGKVGn (ORCPT ); Mon, 11 Jul 2022 17:06:43 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED67F6BC04; Mon, 11 Jul 2022 14:06:40 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id y4so7768233edc.4; Mon, 11 Jul 2022 14:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PGbjfMuKxaOhS50lbNgGWMXPU73MU+jgwIU4egsEGPA=; b=VHt3yMJA1FdLEc0vJgKBkKlQoeeICXVviHGUKPmj8vH+6RyCWVLLO5ruBnZCw43LtF bWnJ2mjToqgKLUwmtDOEyL9optbnMiaLGlmB7sMID5MDftwinTzij/zb8jJ8HpGkYllZ diiQfFf8PKvfjHzDIZ5cpgMFep2a6ZFQ8OYWLjGp4ibGr0RnNvSwk0XKLQ4xpUTA8hyz 2aOFcb4UU9rWuUsBmuUp7523NeX3aAZBAeDmmJMX4WXdpyEhgesdJFUF2wFg0tWH6cuO bDU+pg08bBuQ2+CHEWVxpkSyMlhPpjsl0aMTX+8WMffp1/MvMMP5arfjz9oQQ269jT6b E96A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PGbjfMuKxaOhS50lbNgGWMXPU73MU+jgwIU4egsEGPA=; b=ioOF14CmbrSZ+7+KVvm9syZVkKKbWQpUwjm7KCl4+BINe+dxCd9GpclfqrB3zjhjyl sh008cl4QNywbWB0bLpiiI2RHplVn+ImrnvJy093A6QV1ZVNNfzCPoNjBS/Ynil1ry+/ SdVCR9LXuaZ/3qjU2LKOGjB6W4lig651aAazIC/tKggGwQO5bPMuS8MEt8zB/AQLUeBo BrI/f+HMZtXb32JJCC5gPat2sngkbRbUFxx6JwkJX4ggvvOF4K7bLAOLKc08iNmzpzEF KsgYNGGFaudj8cCqBxPIokejzfJ70erwmUS1BfV+n0x8SXDBKyqAEV2e3kNsqmesmDbY 9bsA== X-Gm-Message-State: AJIora9ekgJv5nLaYonbzu7dter+bUpwKoTUmaSBQpd4lnqLK5qwEImD qp7ezqpLcv3TPLaqcNOgJXtkAcNHDXrsGQ== X-Google-Smtp-Source: AGRyM1sowQ6xE6jpQs3VbaWxjP/XD64VFRDPLbXmWlMdfH3EGGURoUzbtW2b/w7SY2k1ZzQ6wj4mWg== X-Received: by 2002:a05:6402:518b:b0:43a:dc65:35f8 with SMTP id q11-20020a056402518b00b0043adc6535f8mr6501856edd.185.1657573599610; Mon, 11 Jul 2022 14:06:39 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-104.zg.cable.xnet.hr. [94.253.165.104]) by smtp.googlemail.com with ESMTPSA id lb17-20020a170907785100b0072a430d2abdsm3052562ejc.91.2022.07.11.14.06.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 14:06:39 -0700 (PDT) From: Robert Marko To: bjorn.andersson@linaro.org, agross@kernel.org, konrad.dybcio@somainline.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: Robert Marko , Dmitry Baryshkov Subject: [PATCH v2 3/7] clk: qcom: apss-ipq6018: mark apcs_alias0_core_clk as critical Date: Mon, 11 Jul 2022 23:06:30 +0200 Message-Id: <20220711210634.3042092-3-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711210634.3042092-1-robimarko@gmail.com> References: <20220711210634.3042092-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 Mon Jul 11 21:06:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12914276 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 39D25CCA47F for ; Mon, 11 Jul 2022 21:06:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231966AbiGKVGp (ORCPT ); Mon, 11 Jul 2022 17:06:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbiGKVGn (ORCPT ); Mon, 11 Jul 2022 17:06:43 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DBC75A451; Mon, 11 Jul 2022 14:06:42 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id j22so10928309ejs.2; Mon, 11 Jul 2022 14:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=87rHYw1h7ZiXA3EtL/T15oHp4poCj2yJmQAssY50qpE=; b=OSME6oao5WcH7dcN/CfQilh7jXArC9VmZ1ehPmxsaHWFDgiqhrVWen1yKwit80ZmaX TcmAyX2eSni8R1zQ3BLdj6ufSTreyqnQccI39XA1nNeGG6AeZhCmnbNyE6AiCpuyPX+n ON7UIwY1/I8U6h8LZ/SvkyIFb7GlvYOGSVNP3s818V11FixK9T0AVIF0vMqKPNlpp0lg zHOJ9sqb94iKhU/CDbVBi7XiABWY7cIatbco9BMAWx77R2T/R7RmwNIBs9LNv1JXQHrs FL7YnK9uPfmFDfH7jqMq1XtBq/bLvXNVg3Kd4lhjqx1jhiYJK5RtXrzS3p72dUkfj955 Mx3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=87rHYw1h7ZiXA3EtL/T15oHp4poCj2yJmQAssY50qpE=; b=aDk5pNtxRxk9Tc2SMML9fW+miZj2CPRqRDih0oprkEVGt7OXNRzIujI6VeUWGoO5pc tzyApq2BzfcNSQvfdXVvIQysm+vvNI4n1SBGz0dZfiz3/LX0ivTE4yFFx0f49dZ+IhJy Feynf5qf2ibc4F5F9c3PeF5TvZbJ1cdlB/H5J5e4EBZzLIy9c6WrAtifOmBhvmgB6Hea 03L0Z1ibMJI5ypRM3fwSvxxqlUme9jF0HUD7SspTaH6fgzmvVmbX6WalqB3fZWqGOJrX xB0+dtnosIHWKtE3EXsh/7mnx6mydtb5q884j9ndpQb8TY3Xa4Z5KjOWlURTm5YvyOWH nlrg== X-Gm-Message-State: AJIora8YZvdeV8ZSS4l2XIJX90Z+lzlvNEV3lJwejFicXoqN4ThKXaHX TVlK4ghn1JAivW3ylyx7nIE= X-Google-Smtp-Source: AGRyM1sHCAo2QnOaev3GH6c+tVTUpIWpHUr+ELOY4dVBRNVXhNsLaNc0aimpzzICufwnFVWc2B/jKA== X-Received: by 2002:a17:907:2c57:b0:72b:32a8:7afc with SMTP id hf23-20020a1709072c5700b0072b32a87afcmr16243526ejc.129.1657573600684; Mon, 11 Jul 2022 14:06:40 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-104.zg.cable.xnet.hr. [94.253.165.104]) by smtp.googlemail.com with ESMTPSA id lb17-20020a170907785100b0072a430d2abdsm3052562ejc.91.2022.07.11.14.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 14:06:40 -0700 (PDT) From: Robert Marko To: bjorn.andersson@linaro.org, agross@kernel.org, konrad.dybcio@somainline.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: Robert Marko , Krzysztof Kozlowski Subject: [PATCH v2 4/7] dt-bindings: clock: qcom,a53pll: add IPQ8074 compatible Date: Mon, 11 Jul 2022 23:06:31 +0200 Message-Id: <20220711210634.3042092-4-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711210634.3042092-1-robimarko@gmail.com> References: <20220711210634.3042092-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add IPQ8074 compatible to A53 PLL bindings. Signed-off-by: Robert Marko Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/clock/qcom,a53pll.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml b/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml index fbd758470b88..76830816982e 100644 --- a/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml +++ b/Documentation/devicetree/bindings/clock/qcom,a53pll.yaml @@ -17,6 +17,7 @@ properties: compatible: enum: - qcom,ipq6018-a53pll + - qcom,ipq8074-a53pll - qcom,msm8916-a53pll - qcom,msm8939-a53pll From patchwork Mon Jul 11 21:06:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12914277 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 B37FCCCA48B for ; Mon, 11 Jul 2022 21:06:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231974AbiGKVGq (ORCPT ); Mon, 11 Jul 2022 17:06:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231928AbiGKVGo (ORCPT ); Mon, 11 Jul 2022 17:06:44 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43A7273586; Mon, 11 Jul 2022 14:06:43 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id k30so7761251edk.8; Mon, 11 Jul 2022 14:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M0J6xbmqkN6QXcHlYwZcevB8vSh02K48PUp/GkwVo1E=; b=hGFiDLyM8/CvuTVFC+GFGIysQgqwIE7WvsnLvFTM0usr2VoSa57Tka8YoGPwVU11Zr jvcXRCSL8pJ5H4a8jcGT6yZvb7GEd8BTJAWUuSOBMhFFddFRn4EYNRH9vH0i/ySO6x0/ e1MPZcKXRQNUhE3rN4ggtUr2pjXimPOlPJKRqDctZPKvuOkqsdLx88RmuTnp7mFnhe2h MvxrrIerOEpLF4yG+arC3BE9Vo4bxFuZOyCQ76KatQwwV+2Y33WxNkPElRsbGSGTIAGc T67dpV8sGWXnkOjKng1nRn1Pu5JwIwjnLxxcfQDkeFuJlfWzLuU6XGtyBsTnx1q05YRX ns1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M0J6xbmqkN6QXcHlYwZcevB8vSh02K48PUp/GkwVo1E=; b=lJQjk7ih1SDtKA1n5KzT0eMhERs2l7vUuqsOer1dRIYA89t2XCQShSw1HM9o+rjJnS /2f94axBwmeC4XKwcrjmEPIY0TOPuO+EEFXWHN6/vy6L2IX+EDM6Uh4X847Zy8BWKPMu sWUq418+3ZRDF0RR00ucYpHqiJmpeXSSD4OXiRjiuH0B4oTkO9GtqiAfoRSCzpdv+uv4 8OaBsKPvwYWaJI7BKBJj8a98L2O1/uS8ZLYBVEbTZpDLH2QCuk9FuvdD9Bkc1r5mvyni uh72Bw/Zsk++MQL2CsHsmsH+uHF48uVGvXkco/UOivwPDgbrkm4gdwD+mhHFyhDUUHSG zTaA== X-Gm-Message-State: AJIora9iQXFdWgBeZvmXwgdP2SC3R0UpUlen7j06tIcLC9hpiImlRFpa 7MAy4OO3b5yPEgX2xwFBg70= X-Google-Smtp-Source: AGRyM1sn+7LpW1RgyEQSqBPBHXcSfT87CJCovy3xQnyLfa8KlqnHXiHRK+vn6MrkZzfMDX/K1araBw== X-Received: by 2002:a05:6402:1691:b0:43a:db2:a213 with SMTP id a17-20020a056402169100b0043a0db2a213mr27664448edv.100.1657573601737; Mon, 11 Jul 2022 14:06:41 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-104.zg.cable.xnet.hr. [94.253.165.104]) by smtp.googlemail.com with ESMTPSA id lb17-20020a170907785100b0072a430d2abdsm3052562ejc.91.2022.07.11.14.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 14:06:41 -0700 (PDT) From: Robert Marko To: bjorn.andersson@linaro.org, agross@kernel.org, konrad.dybcio@somainline.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: Robert Marko Subject: [PATCH v2 5/7] clk: qcom: apss-ipq-pll: use OF match data for Alpha PLL config Date: Mon, 11 Jul 2022 23:06:32 +0200 Message-Id: <20220711210634.3042092-5-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711210634.3042092-1-robimarko@gmail.com> References: <20220711210634.3042092-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 Mon Jul 11 21:06:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12914278 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 E8E1BCCA47F for ; Mon, 11 Jul 2022 21:06:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232053AbiGKVGy (ORCPT ); Mon, 11 Jul 2022 17:06:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231948AbiGKVGp (ORCPT ); Mon, 11 Jul 2022 17:06:45 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 322DD76EAB; Mon, 11 Jul 2022 14:06:44 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id eq6so7776191edb.6; Mon, 11 Jul 2022 14:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oLBfjcLmD6YsbkjIodLWwt28j3M7ElYSLrVTRWGG6T4=; b=P4O30aAsE0qULmewnkHhs/ve4U4Oc/1NiXNPJ0EdoJdniA+vFSnPsUXf5BQWw11bEf nizX+v3wwbbMNW5qf3v3ADmPyci2GrTEajFpqfhqIslLDRRYZwmcK0e5nRcgrn34fUrZ 7z0xQzbDWMJ9erpFluUQ72tbvzQHWNW9YAckuBQ0pjBI6Y5QC/IrRY8MJyM3/lvObtyr 6A3ioa77Urqr5qmEXdqs/TZOZLJTYjE1Sl6N4ZXpTcl4dZgcgGUBSR17tjgJdQdGROXF mwXslj+On9YSnMKSFoJatEwpLkccra1SZwzXoNC9zVy6NSdgIF2uZgdWgOsvt2JChYtl a3og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oLBfjcLmD6YsbkjIodLWwt28j3M7ElYSLrVTRWGG6T4=; b=QHv9fVJz8IQ6R0UjW622ibeQCan+rXu322kYEc9yodS3gJJoZ9u5NDXi6r1jGQy12O 8Z+DWIYxlC+m5TIzRFk4Fsoy6KVaIPzvWWxZIXpq8frH7jYzRrffEDJqPWchRlRrUsHM o/zGV7trXGGG4L52Hhh7iBBZs5lb2ygDKONCJnn5zkkM6BT2JGKPe/EShie+/Kd4CkYX PntM1kdWRxVUqDLeFk9LOODoN63P3BYqnf9tdA8nOC8E+fAi+GIa8amCvh7/PB5Bb4mX zYfpjt65bERwK9AU37QVL+6oi1sCWqMUibnaOMrvn9cS3LlWwVE7qxmz6aSJLrMzdN+t ynEg== X-Gm-Message-State: AJIora8eLKYDLb9zseCnF/ArL7deVd1qAEkke+hxzFt+vjthuYqWQDQ1 4Ayh8EShyME0xTvfuRf+sWE= X-Google-Smtp-Source: AGRyM1u2WyDYgjKJPz3dB8Wpohf70WV87DHt2v9c88x/RFHihxzbbyPFGOGbBSezs1UcDFmpRAxsqA== X-Received: by 2002:a05:6402:5cb:b0:434:eb48:754f with SMTP id n11-20020a05640205cb00b00434eb48754fmr27774202edx.421.1657573602805; Mon, 11 Jul 2022 14:06:42 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-104.zg.cable.xnet.hr. [94.253.165.104]) by smtp.googlemail.com with ESMTPSA id lb17-20020a170907785100b0072a430d2abdsm3052562ejc.91.2022.07.11.14.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 14:06:42 -0700 (PDT) From: Robert Marko To: bjorn.andersson@linaro.org, agross@kernel.org, konrad.dybcio@somainline.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: Robert Marko Subject: [PATCH v2 6/7] clk: qcom: apss-ipq-pll: update IPQ6018 Alpha PLL config Date: Mon, 11 Jul 2022 23:06:33 +0200 Message-Id: <20220711210634.3042092-6-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711210634.3042092-1-robimarko@gmail.com> References: <20220711210634.3042092-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Update the IPQ6018 Alpha PLL config to the latest one from the downstream 5.4 kernel[1]. This one should match the production SoC-s. Tested on IPQ6018 CP01-C1 reference board. [1] https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.1.r4/drivers/clk/qcom/apss-ipq-pll.c#L41 Signed-off-by: Robert Marko --- drivers/clk/qcom/apss-ipq-pll.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/apss-ipq-pll.c b/drivers/clk/qcom/apss-ipq-pll.c index ba77749b16c4..a4016f3854c2 100644 --- a/drivers/clk/qcom/apss-ipq-pll.c +++ b/drivers/clk/qcom/apss-ipq-pll.c @@ -39,10 +39,14 @@ static struct clk_alpha_pll ipq_pll = { static const struct alpha_pll_config ipq6018_pll_config = { .l = 0x37, - .config_ctl_val = 0x04141200, - .config_ctl_hi_val = 0x0, + .config_ctl_val = 0x240d4828, + .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 = 0x1c0000C0, + .test_ctl_hi_val = 0x4000, }; static const struct regmap_config ipq_pll_regmap_config = { From patchwork Mon Jul 11 21:06:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12914279 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 BC2BBCCA485 for ; Mon, 11 Jul 2022 21:06:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232086AbiGKVG4 (ORCPT ); Mon, 11 Jul 2022 17:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiGKVGq (ORCPT ); Mon, 11 Jul 2022 17:06:46 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A6FE72ED3; Mon, 11 Jul 2022 14:06:45 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id mf4so9723158ejc.3; Mon, 11 Jul 2022 14:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NvqH53z3vfF6U45ZTWaGu0TE308tKtxhxwmMlElMdBE=; b=qYvIvMcpLeWDoKMI/RLevejKWOs/kEIkWr8bMRdXO4c5POuhJGQf1bga7kZ75FfUFI QsaNnlLx4Xbbw+R6EZbrgn7IrHbK+MCHxAN41CgqdYCx0R3Zs6SkSNNGW4Biav6AvQBB xEg36YoY6VTY1gVaelNJUR/Ft+AhOn4PpV2aLANEIs7urxD5OODsJ3BlFsSzyIKXyyyA 5VUtOTgZKHOCIUWWwxmcErrIY06BG/7cpNQfEugh/BNGRcfTwKRb+upgZqgU+iQppHmv rCHQ/jdGJeBuyiQLbjmj962Y0auQcpmyYhgalIvXAP4sSyDpvlWYr9xLH+UYaNnuFiVH fJHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NvqH53z3vfF6U45ZTWaGu0TE308tKtxhxwmMlElMdBE=; b=ukytmXfYKCwzPgSh68O/p9XiTdtZPzcZxbimEElvfJHbMqVRaG55PDC8nRvdzZTqae 8lJfAo4Ovn13f/oOyr4DV398+oGB7VVW8zq2X+7/sjxZrL5tWoVzOq8ZRMkzhF4iSZ6Y 0jRf9RFTF1+g3Pyc0TTHQKt3F6ZTLAL8/ifksrIQRDYrzjUYawisFeuwZ3U6oKPwKD2z ETwCWH6oMWlnqzPRfgLckiqXcSVXetl2V+t6H4jLZNnt+XBF3mD+fnZhBzEW+z+108F+ 5MAUg73lNy8ntwBN5qGdjhmQ4n9gT+iBJvWRItbkugP9cgCmK12l7l4wFMxQ611Y4jPZ Uv/A== X-Gm-Message-State: AJIora8M9Mx7p7cB6JLbElhcfFuSLIO2zGzVidIEyLMtM99ShUm+cFEB UN/ej46a0Gvxn36a0cmnZSc= X-Google-Smtp-Source: AGRyM1s937WdgEeYwZkVmEzHdo1tCO78QyCuWBMwTdXsFbD93r+Moi+/aQECuJSlpc5HRaOOy9Esqg== X-Received: by 2002:a17:907:a042:b0:72b:4fac:1ddf with SMTP id gz2-20020a170907a04200b0072b4fac1ddfmr8602337ejc.285.1657573603837; Mon, 11 Jul 2022 14:06:43 -0700 (PDT) Received: from fedora.robimarko.hr (cpe-94-253-165-104.zg.cable.xnet.hr. [94.253.165.104]) by smtp.googlemail.com with ESMTPSA id lb17-20020a170907785100b0072a430d2abdsm3052562ejc.91.2022.07.11.14.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 14:06:43 -0700 (PDT) From: Robert Marko To: bjorn.andersson@linaro.org, agross@kernel.org, konrad.dybcio@somainline.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: Robert Marko Subject: [PATCH v2 7/7] clk: qcom: apss-ipq-pll: add support for IPQ8074 Date: Mon, 11 Jul 2022 23:06:34 +0200 Message-Id: <20220711210634.3042092-7-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711210634.3042092-1-robimarko@gmail.com> References: <20220711210634.3042092-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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);