From patchwork Mon Jul 11 10:47:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 589543 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 A202ACCA480 for ; Mon, 11 Jul 2022 11:22:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231211AbiGKLWj (ORCPT ); Mon, 11 Jul 2022 07:22:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231156AbiGKLWN (ORCPT ); Mon, 11 Jul 2022 07:22:13 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77047292; Mon, 11 Jul 2022 03:47:26 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id bi22-20020a05600c3d9600b003a04de22ab6so2781920wmb.1; Mon, 11 Jul 2022 03:47:26 -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=+HVJW7F1K6wwajjNiFtroQgNImhSLi34xU+wa1Cgw+Q=; b=Y9GEdopa3o8OdYGhlwPne4NRX97Pjgrb17XEryWJrkZrDb+1vrRA+lsV6YRdNPInRI LSr/l2WKjp/vWEEB5MHPVMxOGRaAxMFA29T76iZYTJPftiVHQOcl5NrRIlwwRAmJCfUu BclJZ9SuLD09Mv6Jv/EBFUOcZ7RJIGYyIHqN2s7uHvdA5V4pok1gCLEBSCe6VGo1tVgW w3HNyBIHnFYiYtgLEyykkpmKsTYpSELhu/fegA2mROBoKjqFxL4+r6x72Kt1cJNJQScz X08ZdIqxzob3KG9kGrGnEbUcacmbesYycFHgMsJQDY8Cc8jCSSEz5zTRHtyeDDgyOl50 qnQg== 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=+HVJW7F1K6wwajjNiFtroQgNImhSLi34xU+wa1Cgw+Q=; b=Zeds8xhabg2RI/V7SpSSlRaOk0xUoQ1gHQbEdELFSvvdVLXeFUtJmR3ofZwbm/oOgx s/dCqu6geCKsg7jOqDwsOuQuBb7iviyDzgsorgiN+AMYTx30xTKtjOU8WCX6BmugliYL 5rPiGQT10mnm3VZvlkxCTf+nAC0187d0bAdr6An6OvhJjes9wllFrGaQWuMTqoMj7ixS ZHOWxk+EOvRW0+YYq/P3b/0EI2P06m15vYAijL9CJcXuVpTHXC6h3nZ8aX7VnT0vuFab G441tXQqsWthgT5dUv2ljkVvEFBNz4Ogdwf5V3T5bcKIstmDDU0+km9P5p2tI462tfHh jmZg== X-Gm-Message-State: AJIora/YFkU402Wqhtrc4x4L6iKjk9hiXM4UwxY9FfPnh+vY30hX2GA9 ACNFFqkKrKg5qal8Xdniyz8= X-Google-Smtp-Source: AGRyM1sLFtigAlMz6p6003Ctun0EzJ4efrh/28U35kZN9NLZUjilcNWAJOQpLy2KnVXLIhPc+xW1pQ== X-Received: by 2002:a05:600c:3594:b0:3a2:b918:fc99 with SMTP id p20-20020a05600c359400b003a2b918fc99mr15305330wmq.46.1657536444932; Mon, 11 Jul 2022 03:47:24 -0700 (PDT) Received: from fedora.robimarko.hr (cpezg-94-253-144-242-cbl.xnet.hr. [94.253.144.242]) by smtp.googlemail.com with ESMTPSA id n3-20020a7bcbc3000000b003a05621dc53sm6338716wmi.29.2022.07.11.03.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 03:47:24 -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, sivaprak@codeaurora.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 1/6] clk: qcom: clk-rcg2: add rcg2 mux ops Date: Mon, 11 Jul 2022 12:47:14 +0200 Message-Id: <20220711104719.40939-1-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 --- 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 10:47:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 589542 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 69614CCA488 for ; Mon, 11 Jul 2022 11:22:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231316AbiGKLWl (ORCPT ); Mon, 11 Jul 2022 07:22:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230515AbiGKLWN (ORCPT ); Mon, 11 Jul 2022 07:22:13 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 790D729D; Mon, 11 Jul 2022 03:47:28 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id be14-20020a05600c1e8e00b003a04a458c54so2769184wmb.3; Mon, 11 Jul 2022 03:47:28 -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=EmmKDO3uSNG8KEjBRQCwO0eqGFCI/Gc3kxhTePWS+oA=; b=lu88mRBppIIfqRSXhSLApFkduMzkcU/MYd++hUvqpSneCZKuVtSxI7gZYLDnTK8YuE XR99aShIOhDWOthEWCDDjZ0nbtQO/AjbLBWoM1FqNC4x3LStMszrYm79RQK9zs2mTr23 ahGWJe/WXL+f6jp+SAc+L/G4NcGyevKVz/K1Lvj6GgL1K4DrifYLv5UBkQY2QuF77Tdr /xUFATGR+srl9tufBfrB8so/IbBOXAGunt7ufqK0I9Qd0gVb0JL7QPrtnE6wczjoQv5Z Xl8yWW06qeHqUa3N7ZyrDB0UW8p1YMPSCeBS4WDe92pFeKqYMEDoVN7emXEjsplymimX 7BLg== 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=EmmKDO3uSNG8KEjBRQCwO0eqGFCI/Gc3kxhTePWS+oA=; b=yMfrgnShWVf54QxE9Lfxt2QGm1CgVWYeBf0DiYtjO04ler7ocKaoYrIlO1HvF2TUbb 9RMySnCsGCE9ifJjt+B1Nn4GnikgN2Uc9GElV8A3+YpQFVd36RpO3i34tnAV3EYX5KHD I1HIEE5JNS6q495B2h4orC0WuC/ckj1ef33CzRSiXDJwsNV6FHEx0v3DBwPs2AYkNjGU Nidl48GFjtmH7iR5r1gyak9ZOOga7KuPjwwOuBv+yMZGJdom4YUfdjhqu9DHcl5OdgjW T72VFzvzCpe7PWtAp+u0a70X9CgCfh1vjwZWx79McLeTTeEbNw2hhkLfOHeBT0qWxPWT 4qPA== X-Gm-Message-State: AJIora96XhrVTOc6ihw0QxLiYWar5WMpMIiPvVxseamjOnYNfHi8FMuk Mq3F96/YhnaMDk8qknWG7e0= X-Google-Smtp-Source: AGRyM1saqJy8yDxoRKR0T3TrtOTforlsoeAZeizzqapkU7iORZzdTpxt1HeudfqsZIpl3xs/wB1hrw== X-Received: by 2002:a1c:43c5:0:b0:3a2:e4f5:4b17 with SMTP id q188-20020a1c43c5000000b003a2e4f54b17mr8400927wma.26.1657536447072; Mon, 11 Jul 2022 03:47:27 -0700 (PDT) Received: from fedora.robimarko.hr (cpezg-94-253-144-242-cbl.xnet.hr. [94.253.144.242]) by smtp.googlemail.com with ESMTPSA id n3-20020a7bcbc3000000b003a05621dc53sm6338716wmi.29.2022.07.11.03.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 03:47:26 -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, sivaprak@codeaurora.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 3/6] clk: qcom: apss-ipq6018: mark apcs_alias0_core_clk as critical Date: Mon, 11 Jul 2022 12:47:16 +0200 Message-Id: <20220711104719.40939-3-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711104719.40939-1-robimarko@gmail.com> References: <20220711104719.40939-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 --- 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 10:47:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 589541 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 3FFC2C43334 for ; Mon, 11 Jul 2022 11:22:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbiGKLWn (ORCPT ); Mon, 11 Jul 2022 07:22:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231250AbiGKLWN (ORCPT ); Mon, 11 Jul 2022 07:22:13 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5600B1F; Mon, 11 Jul 2022 03:47:30 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id v10-20020a05600c15ca00b003a2db8aa2c4so2776878wmf.2; Mon, 11 Jul 2022 03:47:30 -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=yIboIxQuAfrUWzSoLEOVgFtmcLKnX85uUb2His2TGbY=; b=dOJyfD9l6amfDM3zplFOXRyFmKj5AwfAxqo+vWqeLJtBapQVPT1lWvTCnpEAmlhwwm nUx4/i/bkomrny7/7NIM8PcnU3WLhI7/y4MFmIP8ZOIW4fwRHrRzbijn78phwZuVX1BC 7qmkreHu+04MuaLE804IhOJ1cr/C8dWdFZQdDk/Rz5m+p6IOXwbjc+37EVn1EXlPMlxm bmRQ/r7I35EQC2X9k0bNpZSEOZWlZRk328dsRXyWKkExDl2c+yPOQiEnJpIFu7KYS3vJ VObY1gj8ta1miFAG+/u4ev8pip0mRWHJ30EtkQg2QwNFL45IXl/3486ECA5SaUnqw1pq ZNQg== 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=yIboIxQuAfrUWzSoLEOVgFtmcLKnX85uUb2His2TGbY=; b=bBqn6Qh0fOJ8xt9mW3BHsnTh6pgcYumCinOjmWvsWk07d5ExZ8sGOaz1xIlf3C7BO7 ICd1lhASpv+9Sr2Ke9qp6zNijqqok1bgRmXOkOLEh7sCZHyO4S6RsozS8JS39FtkStKN VbskwlTsWSFBXVqU4mqyjr3fzFqK/oXRD4OSiwjFhMgZUKlPbcNpxwyFY1XQdIUqSTEU 5p3q7lHq/3l7f7XdLkwotge5ATQbwHWfWexh9ySafxeSjByeafYJeJOiq8epF/FmQdwt 6jcNOxDM82xeel4hLRPTMaCN4WaoA6MqohKL1lgigvkwQ7/xnTNfwXphueeBUVqj0B9Q u67g== X-Gm-Message-State: AJIora8bQhR+kl24BjFmmbG71CnPU8cnk8Y5ZrrbGMHUVBTqsZacohy6 3++3sJj9LgjZB+8QSWoY3vU= X-Google-Smtp-Source: AGRyM1vU/SdEQIabKWNF5X4Uup1rp0Z87VjUhlm5s8YuiLECN1N+WHPmrhd6HkVn4oJ/V4uUBh3IiA== X-Received: by 2002:a05:600c:5007:b0:3a1:7c44:44f5 with SMTP id n7-20020a05600c500700b003a17c4444f5mr14911653wmr.106.1657536449360; Mon, 11 Jul 2022 03:47:29 -0700 (PDT) Received: from fedora.robimarko.hr (cpezg-94-253-144-242-cbl.xnet.hr. [94.253.144.242]) by smtp.googlemail.com with ESMTPSA id n3-20020a7bcbc3000000b003a05621dc53sm6338716wmi.29.2022.07.11.03.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 03:47:29 -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, sivaprak@codeaurora.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 5/6] dt-bindings: clock: qcom,a53pll: add IPQ8074 compatible Date: Mon, 11 Jul 2022 12:47:18 +0200 Message-Id: <20220711104719.40939-5-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220711104719.40939-1-robimarko@gmail.com> References: <20220711104719.40939-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add IPQ8074 compatible to A53 PLL bindings. Signed-off-by: Robert Marko --- 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