From patchwork Thu Aug 18 22:06:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12948027 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 CD6F9C28B2B for ; Thu, 18 Aug 2022 22:06:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242255AbiHRWGe (ORCPT ); Thu, 18 Aug 2022 18:06:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232990AbiHRWGd (ORCPT ); Thu, 18 Aug 2022 18:06:33 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 396ABD21F7; Thu, 18 Aug 2022 15:06:32 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id w19so5670395ejc.7; Thu, 18 Aug 2022 15:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=JCTh8kG/kYdyoUHtyXB+jjX01mOnfuolr7Ild9fizAg=; b=Elp+bln4oYJ2TL8Kz11eRwuDXELrurfYX7F96HcVgoDhNrih84Wi1fwB5zaEPrordD UP1Blce+6zK/CiMXxfzsnNOEelFQuLC2uLO7v0btgAW614L1OTem1BW8lvPVfanvWKL7 fFeyj7k1uobaoghg+g0CHxn2vLI4CWqcXRxaruzE/L2QrxzaffSxSwgfZF4HBxnXXIcE l89PNc9mbU8jA8XFk7qBnIO8C0LRoY9U6RfPzFCtuqesZdEswP90weWEmz/xTs1k+3+0 Uyq+Gzka5gO0s6bxUSdMOPYVcz+BOxgMJ+pttNBJ4XYifLOJQ4z0UgcqA7KYegBK1j7k lozw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=JCTh8kG/kYdyoUHtyXB+jjX01mOnfuolr7Ild9fizAg=; b=CpVQyuwPVCeb5mdbHyFAT3V4kTH68YdswM+5g/BG0mIxQ4zuBpi092ju26AtjOrDuV lvcZbXwXSWh0Wmqusux2uC6aYRFr8cNH+aLMtc86SeppHxJcB5pIQRr23sYVRN/eZrI1 qwQ7okKcwx1WwVHlDLxLr6WN1VxVUfFhST4k4BUY1ugjSa1GF/s9ASgHawOAdzUWzk3B blwhwD1jjJmyEagZOfF5WtLJb1hVOx4GlHyrI0vbMBM32Awi9AVrUJrhITe4LOjaOphM Dm3pmwDc04tYfB2WC82wKoAUTbKfaBN4tYv2VHjpe1k6u1o2gprot2ElzjXRVMGk0/kq H7MA== X-Gm-Message-State: ACgBeo3WYqo8KfglYXSMQfJBCDjC19csaU0jkqYck9bBYQ7aHmulHRYA cwttXi0vlf64Glq4/8mRMrE= X-Google-Smtp-Source: AA6agR4xImEt3gc0hR6OSGR8kI9kikSTupIwRDS50TI7JIiPFifM6tDC+Iykx66rN2W8OEDh6lfH9w== X-Received: by 2002:a17:907:608b:b0:731:8a9d:5a2d with SMTP id ht11-20020a170907608b00b007318a9d5a2dmr3104711ejc.443.1660860390741; Thu, 18 Aug 2022 15:06:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 15:06:30 -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: Christian Marangi , Robert Marko Subject: [PATCH v3 1/9] clk: qcom: clk-rcg2: add rcg2 mux ops Date: Fri, 19 Aug 2022 00:06:20 +0200 Message-Id: <20220818220628.339366-1-robimarko@gmail.com> X-Mailer: git-send-email 2.37.2 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 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: 12948028 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 3F827C32774 for ; Thu, 18 Aug 2022 22:06:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245021AbiHRWGf (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: 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 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: 12948029 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 37D05C28B2B for ; Thu, 18 Aug 2022 22:06:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343707AbiHRWGg (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: 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 Thu Aug 18 22:06:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12948030 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 17C60C28B2B for ; Thu, 18 Aug 2022 22:06:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344258AbiHRWGi (ORCPT ); Thu, 18 Aug 2022 18:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232990AbiHRWGg (ORCPT ); Thu, 18 Aug 2022 18:06:36 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 883F7D21FD; Thu, 18 Aug 2022 15:06:35 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id o22so3517121edc.10; Thu, 18 Aug 2022 15:06:35 -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=+/nnw6P3VjEE7fxsWw9HS7hocIb1CR7Edy+bXNA5xbE=; b=GqVlQND4Ffnhd10O5kdtYmasl4lYsiHuOHijvyeuejZibxkh6pgTGB/1Q4+P2pXXtf QHXifGoBLmD3+rFuaIYZfWGreKWAEwGrw8qJH4/og6VfOk/5B3MqUpuJbCEd59Rimtav 112M7O33GK1xc3fRWSo2AGMy691pRXYs6omlu1bhEtlQR7TkmiJ5LqYNVe/olde2I9hm U7b0gfzV431wEYeS8guM70bHKjbu5NXAeqSYNUuNDMDjrE3319qknMz64TOHCYi6cqvn mMKsTNZ3OFN9lig95nuTqoxcbv7w6Sk9/26DPdBgKHQz/JjTcS8HiT7hZodsmb72D9Du hKpQ== 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=+/nnw6P3VjEE7fxsWw9HS7hocIb1CR7Edy+bXNA5xbE=; b=6e+rxu21MuM0C1St9Q5FtiRLRS8DntFDSZqtuGI1qO69matfgByRwHyEd8kSieOOZT rgp8iIBA3tD+lyKVHr00yas5NGgDDZDJkKHZDXcwtk87mYpueA2e4LPOu3ajcqt7Gcfi A5RzGy7C9JluoLBs6lYDiZz+Z/9PToukW5PsTtjVuiCD2Oe/5PdUuc74k5vbCVt3axWH i43vEhItCQNllulZ2/nvBD4MxyyDYDScp9igZN5LRN0fAv1y9r/gIJ/Fu6Bk/TleTW8m 2zFj2BRHJCsG+sUrjcEDESSk7JznNzXixbxYflhOqJfkOHfuKDeKUEIY8HSAk8M1ieZJ fIJA== X-Gm-Message-State: ACgBeo36AEaJjiPSGfrI/mIkD/+eVy1CUTKeucmJOAADVb4jwSe8RacD Qj4D6kHdOrqQoT6SBp97gXo= X-Google-Smtp-Source: AA6agR7cQrTvw/gSZQdLR46VStoL3nBL64dfZY9uQj7dx0rSXb/S/dW226Tf5G+7CHNsTp0e65cezQ== X-Received: by 2002:a50:9f44:0:b0:445:dfca:87da with SMTP id b62-20020a509f44000000b00445dfca87damr3660384edf.105.1660860394145; Thu, 18 Aug 2022 15:06:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 15:06:33 -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 , Krzysztof Kozlowski Subject: [PATCH v3 4/9] dt-bindings: clock: qcom,a53pll: add IPQ8074 compatible Date: Fri, 19 Aug 2022 00:06:23 +0200 Message-Id: <20220818220628.339366-4-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: 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 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: 12948031 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 81914C3F6B0 for ; Thu, 18 Aug 2022 22:06:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345509AbiHRWGs (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: 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 Thu Aug 18 22:06:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12948032 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 92A66C32774 for ; Thu, 18 Aug 2022 22:06:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345848AbiHRWGu (ORCPT ); Thu, 18 Aug 2022 18:06:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345587AbiHRWGj (ORCPT ); Thu, 18 Aug 2022 18:06:39 -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 EB956D25E6; Thu, 18 Aug 2022 15:06:36 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id t5so3526107edc.11; 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=ua4G1zirXRRHrwuTv4PR9g1sFu4rKsD/OWAdeD6VB6g=; b=Fqt73Un6KjBRBR0cDWIAe3ejsKnL1rkkc4IrO96YkhqG/YOHJFGCT5fvac2tmo7lTb wriZglilbZit3jkY+aRzvDXEWYieFkAPhCk11znRBTY0bSpb9JZhlWMAvqwr5ddnPIey zDD6BZ1QGA4fYEaji/2NLtHXXLd8l10eRhYgiyWNe13vdAbEA4d4qqR4MGda/2BhzE0s fsEpMKZJ1S9qpCK+hRWHEJMZ+sQqUhak6SkFfiFRwgfYjaCefz3PfnU7WwBhxcdCq/P5 s3Zj9FhUdgINYRPI3xtEKLqvmM65KeGgXQNn4AaciK+5Eeo/ADhkwYPKRtBoYF1zn6T0 HCzA== 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=ua4G1zirXRRHrwuTv4PR9g1sFu4rKsD/OWAdeD6VB6g=; b=kuYMOPB9KgAjAqxtdlGKhPK71gvecPdox6nbvmo12Cj+sIX9rASdqsv1HpHd+PGYxN 8knMpzhKcp5Y6qcENPjfy8nqAd6f3LyQ6TE3hK+HfK0ezi2nnYQ1soXyJDpESmN34sR3 qJl/K624VvboVOUulXWEQEnB46ENLA/OpQeaOCCNUOisPe1ANkAV4KaYGerK4BPY83D8 +TFRo/yp2db+jRXJnK8k8UfoQFoqv+C5z+TVQNIyCty0d5iAF3Eq/B4ko1pziFp3tcRX ljW6c9LjG07NX3B6BQX3R0yW6sFf4cZOMQmpEMhJqzGB73lihvQ2tuy53RuC0NDLi3Uf v8YQ== X-Gm-Message-State: ACgBeo0Iac7M+gN8FNULC57Hasq3KWXGEUQlBvTZmqv5tkFgw9REL/mV 5Ldx659RfRJeMm9qZ+bcexZmAyCdKzc= X-Google-Smtp-Source: AA6agR7Hr+vVEbXDrPSFnxZqQ6THbPtlgX8i61gGGGM+UE+6B7913v6bPdGrPW6Ezcu6Y2jFiP5AxA== X-Received: by 2002:a05:6402:3492:b0:43e:9666:ece2 with SMTP id v18-20020a056402349200b0043e9666ece2mr3805305edc.65.1660860396342; Thu, 18 Aug 2022 15:06:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 15:06:36 -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 6/9] clk: qcom: apss-ipq-pll: update IPQ6018 Alpha PLL config Date: Fri, 19 Aug 2022 00:06:25 +0200 Message-Id: <20220818220628.339366-6-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: 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 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: 12948033 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 8E126C32793 for ; Thu, 18 Aug 2022 22:06:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345957AbiHRWGv (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: 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); From patchwork Thu Aug 18 22:06:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12948034 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 47712C38142 for ; Thu, 18 Aug 2022 22:06:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243873AbiHRWGw (ORCPT ); Thu, 18 Aug 2022 18:06:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345707AbiHRWGq (ORCPT ); Thu, 18 Aug 2022 18:06:46 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3E06D2753; Thu, 18 Aug 2022 15:06:39 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id e13so3506737edj.12; Thu, 18 Aug 2022 15:06:39 -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=gwYDRHCLyvIG0hzZx/1wWa1CYvcFrSAVpZX2Hp0kcmU=; b=H78nhzPQj2CiZRP5EzXW7psCXuxBq7jJkgaQBfsnAuLG3GYpjwqvl/urxI9rh6DTrV zRpBFYYSIsQjXRI1hAIB9USyI8aGRkGiIlW9aWuh/a6kZDKMzFhWfdWTXynLhCryz9Sf 2NVanzEsFGkvMOE8tVfQwTvkf/Va0DG4Cvl+ggIaYJMNgTS5d6AzBo7OTHitieI2VgNh JeVjcbgAqgwavgnRkCvqW1g18um2C8oXeTqUulPWwyE/jsVuVebcS5qrwvgo0gX5XnwU nryJs6jkELH2CGewUK5pInSh78SsKNB/S/ilW2jRZ1LHQaiW9Az4YdL0Dp0XxJ7Y8aaU 4ZIg== 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=gwYDRHCLyvIG0hzZx/1wWa1CYvcFrSAVpZX2Hp0kcmU=; b=02I/nJ6uvBKwtUtBimWSzj4A8avZVB3Z+8SYZvhbHidJqBZE0bBt7ZPRfOBCEKTFJv WJMSqxOhO7iocuyFG4gm4MG15RTa1uzjyKe9phIg3xb4ai9gviKgPOhYbGLZT6S73WVi fXPyflBEx61CtwXWUqSEED/Q4mg4J5vgWcZ3BEC+3m6PAHxmzpdl73J3CvDAh4v2Q27T /QsE5XsLxjmuGtID1zuLm0bY7KyTeoIrUbUaI1fw3HJ+hYVtpPiPLgaz3mRHZVI6BC3y kmXpwM9rHcWKzBOt3PAs69yWgYOmzSmQdiX41YLYZb/JuGFmKUwMjEDm4rrQqCyc9NZ7 DAhA== X-Gm-Message-State: ACgBeo1R98IgLFs4M2KjQiK6t2GUOebcJft5j8LledjQ7MMi+GcOR/N/ 4j76yo2zA2Dvkeef9XeihHg= X-Google-Smtp-Source: AA6agR4ymEF8d31W/DQMQr9RGspNJvr+iK2oLJ9vpS+bdmPhTHUIYxu5iKfq0dR1ej+Y4waRyjHfgw== X-Received: by 2002:a05:6402:332:b0:446:3427:5c62 with SMTP id q18-20020a056402033200b0044634275c62mr815100edw.141.1660860398575; Thu, 18 Aug 2022 15:06:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 15:06:38 -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 8/9] arm64: dts: qcom: ipq8074: correct APCS register space size Date: Fri, 19 Aug 2022 00:06:27 +0200 Message-Id: <20220818220628.339366-8-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: linux-arm-msm@vger.kernel.org APCS DTS addition that was merged, was not supposed to get merged as it was part of patch series that was superseded by 2 more patch series that resolved issues with this one and greatly simplified things. Since it already got merged, start by correcting the register space size as APCS will not be providing regmap for PLL and it will conflict with the standalone A53 PLL node. Fixes: 50ed9fffec3a ("arm64: dts: qcom: ipq8074: add APCS node") Signed-off-by: Robert Marko --- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/ipq8074.dtsi b/arch/arm64/boot/dts/qcom/ipq8074.dtsi index 5985dfff073d..5b62d7590fc6 100644 --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi @@ -703,7 +703,7 @@ watchdog: watchdog@b017000 { apcs_glb: mailbox@b111000 { compatible = "qcom,ipq8074-apcs-apps-global"; - reg = <0x0b111000 0x6000>; + reg = <0x0b111000 0x1000>; #clock-cells = <1>; #mbox-cells = <1>; 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: 12948035 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 5E346C32774 for ; Thu, 18 Aug 2022 22:07:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345836AbiHRWG7 (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: linux-arm-msm@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>;