From patchwork Mon Mar 21 23:15:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 553394 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 D5308C433F5 for ; Mon, 21 Mar 2022 23:45:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233260AbiCUXqq (ORCPT ); Mon, 21 Mar 2022 19:46:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233168AbiCUXqp (ORCPT ); Mon, 21 Mar 2022 19:46:45 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D57BA6E4C5; Mon, 21 Mar 2022 16:45:16 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id r10so22793245wrp.3; Mon, 21 Mar 2022 16:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=XhL5PcXPAVYZIaqVjbCyrF3IgCwpUk1BeN4L/hsgGTo=; b=VtKokik8jZoQyV3SXrJav2zsYascZDoAoeYdKhrVPhTBywjJOCILD+HBgks3+onIT1 zCCcMYlFIoSUiBK29Lpxhu2GpxBMCDnOmhbPeB0lYbYf06jpkkhKZwXM8kwz6oV6uiFx MAc+flCgvYR5hhxADs/2RgSYLxIr7a5HFnNkEwgSPzwAFvNSj8gtKotLB1gwPuFzTWut XxJ1TD58yW8yDoNA5WnqeRYT1Xodqcw+lVyfLg7ZK6GvVlMauyAzkF7qqu2ObKfxqbIR 9+FdZ+qTcQI6TuhU9V2TBuT74lAP5mswSJW0ikVXdMQqt+qTt+EPNTQ9ujHobVLpj5wa Aa1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XhL5PcXPAVYZIaqVjbCyrF3IgCwpUk1BeN4L/hsgGTo=; b=p3L+TtVXn+is4YB3hboLLYOwEx1F/5e/ZoChcXuwg65Qs9vzLYg65irIaKtNGdMYAU R2Vd7atlz94wEblEjmBQ93+GzDOT0QVnrqQDBOmNbwFITb87rpKTb4MnUGrf7IyPpcP2 FSQ7WWJ7e6JjP7iJ4Ge8oxU6feWAyHYsKY8wqFRl9thmMEUHB8iKdhxBtiPx8iRGujN1 BsTSWc9kWtddNZioRQuZiE8blBGrS4P/UUaP280Q+S9PSm1HCuoGkApnOxHkPUCQ4t8a 3WS9VFBC0Cd8U3LwZGPfRGUXYaiibcKAvKHl/xCWOZznl0Lr4PUsOp/p7x1ke5n47dCk 3iMQ== X-Gm-Message-State: AOAM531cZYYKp+YsJlIVw1gqxnij3HYHrOIGiKRFyBO0G5SIAi/Kawf/ /44GlQY1PgtM41yy0uJOEyo= X-Google-Smtp-Source: ABdhPJxTJFdJL1hfeET4DhPZVqmLCzIdHZguEiqvmbEyux3rIVGb5NsscxI0HS2N71uidvVTJspR+A== X-Received: by 2002:a5d:584a:0:b0:203:97f6:5975 with SMTP id i10-20020a5d584a000000b0020397f65975mr19790174wrf.612.1647906315315; Mon, 21 Mar 2022 16:45:15 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-42-69-170.ip85.fastwebnet.it. [93.42.69.170]) by smtp.googlemail.com with ESMTPSA id n10-20020a5d588a000000b002052e4aaf89sm105497wrf.80.2022.03.21.16.45.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:45:14 -0700 (PDT) From: Ansuel Smith To: Rob Herring , Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Ansuel Smith , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v6 03/18] clk: qcom: gcc-ipq806x: add PXO_SRC in clk table Date: Tue, 22 Mar 2022 00:15:33 +0100 Message-Id: <20220321231548.14276-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220321231548.14276-1-ansuelsmth@gmail.com> References: <20220321231548.14276-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org PXO_SRC is currently defined in the gcc include and referenced in the ipq8064 DTSI. Correctly provide a clk after gcc probe to fix kernel panic if a driver starts to actually use it. Signed-off-by: Ansuel Smith --- drivers/clk/qcom/gcc-ipq806x.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/clk/qcom/gcc-ipq806x.c b/drivers/clk/qcom/gcc-ipq806x.c index 27f6d7626abb..7271d3afdc89 100644 --- a/drivers/clk/qcom/gcc-ipq806x.c +++ b/drivers/clk/qcom/gcc-ipq806x.c @@ -26,6 +26,8 @@ #include "clk-hfpll.h" #include "reset.h" +static struct clk_regmap pxo = { }; + static struct clk_pll pll0 = { .l_reg = 0x30c4, .m_reg = 0x30c8, @@ -2754,6 +2756,7 @@ static struct clk_dyn_rcg ubi32_core2_src_clk = { }; static struct clk_regmap *gcc_ipq806x_clks[] = { + [PXO_SRC] = NULL, [PLL0] = &pll0.clkr, [PLL0_VOTE] = &pll0_vote, [PLL3] = &pll3.clkr, @@ -3083,6 +3086,10 @@ static int gcc_ipq806x_probe(struct platform_device *pdev) if (ret) return ret; + clk = clk_get(dev, "pxo"); + pxo.hw = *__clk_get_hw(clk); + gcc_ipq806x_clks[PXO_SRC] = &pxo; + regmap = dev_get_regmap(dev, NULL); if (!regmap) return -ENODEV; From patchwork Mon Mar 21 23:15:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 553393 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 E9A0EC43219 for ; Mon, 21 Mar 2022 23:45:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233280AbiCUXqu (ORCPT ); Mon, 21 Mar 2022 19:46:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233239AbiCUXqp (ORCPT ); Mon, 21 Mar 2022 19:46:45 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 193AF90FF3; Mon, 21 Mar 2022 16:45:18 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id b19so22738246wrh.11; Mon, 21 Mar 2022 16:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=8h0dp/sRCWnE/SzxqBhwWtp3OCJwunZ7486W2HMfBko=; b=QhmJY7LtPm+UvAuVmH0Cww45PV2j8fBGDZzJz0y2y8NId+Cd2mvbcbYsW0jWKvg0cT H5yZvlSLjtNd6YryThsWfap6lf9S595n3m12OhJ6ByBrw4SmgqiPtW9CoQyt7+FWQgxp pMn9Wo2SHTXpojc1YiHuyauPtb5JGp/j3JK4fdNYktj0X6J2JkbFwi5vZKZBsbNTTqad zch49jkz9Upu80QpWJlFWrDc2gbuLNXeuP/Q/4A/aXseR4aeGbvWFfMdkG+GWd0Rt50h WYGrGbQwdPTfHHbxt4E361MeP9qtRlymgDyPkZwadH5hN88ntwBCuIuRgpRg5JwW7y1R DC4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8h0dp/sRCWnE/SzxqBhwWtp3OCJwunZ7486W2HMfBko=; b=g75Hh0CH0hETIjIofYLyTqydKl/PvOzy/UHGjdxY1o5KPeQ0V6FV1z+F95CNsrjdBr f5JzPrHCaZvHAPGrkt1iOCAMkeRP5jhfPlvtTXCcM4N7mep4K6WOwSEzDH61suqiEScy YCBstoGJp5DqUt122d7v7NbWIWTw0A4X/t9ZBfjTAUrakBq7zlNw3CBnBoAwXlm542jf 8gEaO/ZzWcY0Zl+yVUvY6FLVlBeGFxhoeDGdFsTdzMk6xQqnJ0RXBufEf7N1m7jlpFQ9 JnF0O+lF8sn8b9qy5Ywr0cIkzPJzLpD33FGWUDtU3BDc0DnziFIdyOCOdRmHq0RaxGpq wZ7w== X-Gm-Message-State: AOAM533jvCSHcAuO4YeoTPZhgSIARiOn8O6ZfTXEw0Y7WhgYvifeZY1y M1c8uGd9jRsDS9pl4dNxLEE= X-Google-Smtp-Source: ABdhPJxmRmoCgMsgyiwehFFD8Yzdprsgc3FoR5L8FzxPCvZuXmmLtGDZwpQkmpLlYovVVi/l7qu2fg== X-Received: by 2002:a05:6000:18a3:b0:204:1f84:287e with SMTP id b3-20020a05600018a300b002041f84287emr1940879wri.184.1647906316517; Mon, 21 Mar 2022 16:45:16 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-42-69-170.ip85.fastwebnet.it. [93.42.69.170]) by smtp.googlemail.com with ESMTPSA id n10-20020a5d588a000000b002052e4aaf89sm105497wrf.80.2022.03.21.16.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:45:16 -0700 (PDT) From: Ansuel Smith To: Rob Herring , Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Ansuel Smith , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v6 04/18] clk: qcom: clk-hfpll: use poll_timeout macro Date: Tue, 22 Mar 2022 00:15:34 +0100 Message-Id: <20220321231548.14276-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220321231548.14276-1-ansuelsmth@gmail.com> References: <20220321231548.14276-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Use regmap_read_poll_timeout macro instead of do-while structure. Signed-off-by: Ansuel Smith --- drivers/clk/qcom/clk-hfpll.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/clk/qcom/clk-hfpll.c b/drivers/clk/qcom/clk-hfpll.c index e847d586a73a..a4e347eb4d4d 100644 --- a/drivers/clk/qcom/clk-hfpll.c +++ b/drivers/clk/qcom/clk-hfpll.c @@ -12,6 +12,8 @@ #include "clk-regmap.h" #include "clk-hfpll.h" +#define HFPLL_BUSY_WAIT_TIMEOUT 100 + #define PLL_OUTCTRL BIT(0) #define PLL_BYPASSNL BIT(1) #define PLL_RESET_N BIT(2) @@ -72,13 +74,12 @@ static void __clk_hfpll_enable(struct clk_hw *hw) regmap_update_bits(regmap, hd->mode_reg, PLL_RESET_N, PLL_RESET_N); /* Wait for PLL to lock. */ - if (hd->status_reg) { - do { - regmap_read(regmap, hd->status_reg, &val); - } while (!(val & BIT(hd->lock_bit))); - } else { + if (hd->status_reg) + regmap_read_poll_timeout(regmap, hd->status_reg, val, + !(val & BIT(hd->lock_bit)), USEC_PER_MSEC * 2, + HFPLL_BUSY_WAIT_TIMEOUT * USEC_PER_MSEC); + else udelay(60); - } /* Enable PLL output. */ regmap_update_bits(regmap, hd->mode_reg, PLL_OUTCTRL, PLL_OUTCTRL); From patchwork Mon Mar 21 23:15:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 553392 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 363CDC4167B for ; Mon, 21 Mar 2022 23:45:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233314AbiCUXqx (ORCPT ); Mon, 21 Mar 2022 19:46:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233231AbiCUXqu (ORCPT ); Mon, 21 Mar 2022 19:46:50 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ED829155C; Mon, 21 Mar 2022 16:45:21 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id v22so8847821wra.2; Mon, 21 Mar 2022 16:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=uKLqUE0HqMblkYxTDEoLkraH8fYkNKsZ80vlgdu8msQ=; b=PSd5RElnYKdfT7JJ4xRmSZsf3s4ZZ2M6RghbeBlNBFjRzifBRgCWiDV7DrMIm4b7eX +s+QJOlASeV7W5CEHDrrK18BOw/rSPYOQpWO2ewmXSnwQzVb0XlkJttSS62WbzINMXjH fM2MYijB/38Dk4gB5R1MXNPmTK1c0Bg1V4ge4p1dZQtgEqQPV1BI4CicnnJfC3yJkPtZ IXQL1Mz/4H+QwCEhMSAOb2RQ3OOokFFBNsGeiOOt7Uh1lOPR5hu/V5R4pdhJHi1szrd3 hkIxMzx7ihaKt3cI6rHaVeorrGgc9w4z3sHmRS2vykSBNMoSvlq2kIut1PDcHDSjkZeX X90w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uKLqUE0HqMblkYxTDEoLkraH8fYkNKsZ80vlgdu8msQ=; b=gw1Xt8clpNeyB2ei15HtJDmI/8E8OvUjuUIVPnwc9FEL/GW0Q6smSqjzuTdtmH0bMY gJKc3YHOTKSVSGjPWXvTD45CfcE3lg1hvjGzSM/XpsUfwkPFqmzGgXBB7+uGafbFLm4S +TnhF75TRmBhVSU/u73wVeujez7CV9J4SqgpRp90gdAlV7kVJA6JJIF7hF8JXFIQ3x30 bkGKqjPsRr65NO14/NdrtcHEYs+9xuOoNURQsS1B6f69mPc2J2ja7uEfUvPJm9jSh8V9 jiPMw1gUHGrMhUX6ysYI41n3+c/M+h22LS7+8LJeRCAhE8NjuWxnWb6CaoCxmSyJ1zjl JcSQ== X-Gm-Message-State: AOAM531nGAMN+0N/D0oaBLQhuK0b71cDMoApsT9uIQNUB7Ry6PUTgF6b W0uA0pJpCgFi0BTXa1DJq7L6QrUQPz4= X-Google-Smtp-Source: ABdhPJygX3L7achtlpOONDVhOVZGbv6VOE93/ieKdwpP8aYhxet/ApXPkN9SKzQ40eRhSJNKomj63Q== X-Received: by 2002:adf:9581:0:b0:1ed:c341:4ed1 with SMTP id p1-20020adf9581000000b001edc3414ed1mr19797135wrp.299.1647906319637; Mon, 21 Mar 2022 16:45:19 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-42-69-170.ip85.fastwebnet.it. [93.42.69.170]) by smtp.googlemail.com with ESMTPSA id n10-20020a5d588a000000b002052e4aaf89sm105497wrf.80.2022.03.21.16.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:45:19 -0700 (PDT) From: Ansuel Smith To: Rob Herring , Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Ansuel Smith , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v6 07/18] clk: qcom: clk-krait: add hw_parent check for div2_round_rate Date: Tue, 22 Mar 2022 00:15:37 +0100 Message-Id: <20220321231548.14276-8-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220321231548.14276-1-ansuelsmth@gmail.com> References: <20220321231548.14276-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Check if hw_parent is present before calculating the round_rate to prevent kernel panic. On error -EINVAL is reported. Signed-off-by: Ansuel Smith --- drivers/clk/qcom/clk-krait.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/clk-krait.c b/drivers/clk/qcom/clk-krait.c index e447fcc3806d..b6b7650dbf15 100644 --- a/drivers/clk/qcom/clk-krait.c +++ b/drivers/clk/qcom/clk-krait.c @@ -80,7 +80,12 @@ EXPORT_SYMBOL_GPL(krait_mux_clk_ops); static long krait_div2_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *parent_rate) { - *parent_rate = clk_hw_round_rate(clk_hw_get_parent(hw), rate * 2); + struct clk_hw *hw_parent = clk_hw_get_parent(hw); + + if (!hw_parent) + return -EINVAL; + + *parent_rate = clk_hw_round_rate(hw_parent, rate * 2); return DIV_ROUND_UP(*parent_rate, 2); } From patchwork Mon Mar 21 23:15:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 553391 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 7203BC43219 for ; Mon, 21 Mar 2022 23:45:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233325AbiCUXqz (ORCPT ); Mon, 21 Mar 2022 19:46:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233288AbiCUXqu (ORCPT ); Mon, 21 Mar 2022 19:46:50 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44F81985B7; Mon, 21 Mar 2022 16:45:23 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id t11so22783856wrm.5; Mon, 21 Mar 2022 16:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=YuacHx0JsXxYcT0I9GUMkZ9rOmfUJZlRqGllxjL2g6w=; b=osru7FFXR43epZK4c2QW3QaucXPFQ5eFB9J8cxEdjKErs+bVgDMp0luFxr5I0JIatT iu2Kj9az+J1MOvAcCa2CGyNdqU0ypWaIaFkMdHfqwbX/ZM9HqFfczrsABoU4auCCHAc0 mwEekFfczOFFtOqG2fr+Zd1yVNAscjL0l8LeQO5dRVi2Uf+NtXDBsyB6N7Z31tX/hN0R SEQgP602r2zum/PW9geCPsbsorc72/oWJqVIgwZ0GIJZoUMq3YgiAcovOmU8wf/q14j9 QQYUon7eDtebGhgpCqQhOkbzjQCYPKkS//TepvZm+FfO0sriwbhG6ldaQHGDnH9yLikB i72Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YuacHx0JsXxYcT0I9GUMkZ9rOmfUJZlRqGllxjL2g6w=; b=FFVPOfQZxTJnbuIoKlv9jPo/9hNoyWmRnKXZiV0EwBlrZrPVmj6AV8dVVrQ3uF79/h K1RCBE/Yo5fhlDCgYxPSAJhj9Az8zGGkaylpI+eAJ+JT9vs9HAKz1V3j0klPRqiwh0Rd AwTXWjGOLImyRE53+2g1j3mVB8jHUXymJPuH/SonJ9JvyXFdx/IyYzLYoA6NqyPKt7Ck 4qc+hL7pBmVOOPCrpyrCoFGgNpGeZScT9+P5iB8FrZ6GXgwVkfoBg5TMfRAKGDzFTGyM iDMu5w6B+zXmUZsKMuloM7jQ6VKvwJTJLqWgne+3lTNabIzSaFzHvxQa08/njeZyMhqB hh0A== X-Gm-Message-State: AOAM532RRh8R/uACuMj8/PjfCsLOGUDceJUaV3s7DDKaUftdI/YaYzww hB/SPFznTerPC8xUqEJaI2c= X-Google-Smtp-Source: ABdhPJzHFtbV2R4F7mL5thcV/AiiTdas9T7vnBA0wMMKaPyuA22iynkUSHyS5hd1YA8o28g2wJR+Pw== X-Received: by 2002:a05:6000:1ac7:b0:1f1:f9ee:7c57 with SMTP id i7-20020a0560001ac700b001f1f9ee7c57mr19420906wry.52.1647906321760; Mon, 21 Mar 2022 16:45:21 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-42-69-170.ip85.fastwebnet.it. [93.42.69.170]) by smtp.googlemail.com with ESMTPSA id n10-20020a5d588a000000b002052e4aaf89sm105497wrf.80.2022.03.21.16.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:45:21 -0700 (PDT) From: Ansuel Smith To: Rob Herring , Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Ansuel Smith , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v6 09/18] clk: qcom: krait-cc: drop pr_info and register qsb only if needed Date: Tue, 22 Mar 2022 00:15:39 +0100 Message-Id: <20220321231548.14276-10-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220321231548.14276-1-ansuelsmth@gmail.com> References: <20220321231548.14276-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Replace pr_info() with dev_info() to provide better diagnostics. Register qsb fixed clk only if it's not declared in DTS. Signed-off-by: Ansuel Smith --- drivers/clk/qcom/krait-cc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c index 645ad9e8dd73..e9508e3104ea 100644 --- a/drivers/clk/qcom/krait-cc.c +++ b/drivers/clk/qcom/krait-cc.c @@ -308,7 +308,9 @@ static int krait_cc_probe(struct platform_device *pdev) return -ENODEV; /* Rate is 1 because 0 causes problems for __clk_mux_determine_rate */ - clk = clk_register_fixed_rate(dev, "qsb", NULL, 0, 1); + if (IS_ERR(clk_get(dev, "qsb"))) + clk = clk_register_fixed_rate(dev, "qsb", NULL, 0, 1); + if (IS_ERR(clk)) return PTR_ERR(clk); @@ -363,25 +365,25 @@ static int krait_cc_probe(struct platform_device *pdev) cur_rate = clk_get_rate(l2_pri_mux_clk); aux_rate = 384000000; if (cur_rate == 1) { - pr_info("L2 @ QSB rate. Forcing new rate.\n"); + dev_info(dev, "L2 @ QSB rate. Forcing new rate.\n"); cur_rate = aux_rate; } clk_set_rate(l2_pri_mux_clk, aux_rate); clk_set_rate(l2_pri_mux_clk, 2); clk_set_rate(l2_pri_mux_clk, cur_rate); - pr_info("L2 @ %lu KHz\n", clk_get_rate(l2_pri_mux_clk) / 1000); + dev_info(dev, "L2 @ %lu KHz\n", clk_get_rate(l2_pri_mux_clk) / 1000); for_each_possible_cpu(cpu) { clk = clks[cpu]; cur_rate = clk_get_rate(clk); if (cur_rate == 1) { - pr_info("CPU%d @ QSB rate. Forcing new rate.\n", cpu); + dev_info(dev, "CPU%d @ QSB rate. Forcing new rate.\n", cpu); cur_rate = aux_rate; } clk_set_rate(clk, aux_rate); clk_set_rate(clk, 2); clk_set_rate(clk, cur_rate); - pr_info("CPU%d @ %lu KHz\n", cpu, clk_get_rate(clk) / 1000); + dev_info(dev, "CPU%d @ %lu KHz\n", cpu, clk_get_rate(clk) / 1000); } of_clk_add_provider(dev->of_node, krait_of_get, clks); From patchwork Mon Mar 21 23:15:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 553388 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 6682CC35280 for ; Mon, 21 Mar 2022 23:45:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233299AbiCUXrB (ORCPT ); Mon, 21 Mar 2022 19:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233311AbiCUXqw (ORCPT ); Mon, 21 Mar 2022 19:46:52 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FB3791ACD; Mon, 21 Mar 2022 16:45:25 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id j13-20020a05600c1c0d00b0038c8f94aac2so461571wms.3; Mon, 21 Mar 2022 16:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=qACBw0o2MS9FzPU5J+S+Zvtw1uM7Qy8GLYaDlXl8cVc=; b=iw4y1sosX82Uo7ZrwSqURxgcrLwJCvxn4uZoH3seSgje+Ees4ov9mTKU6d9ywwq5aI ywxWQmy8rDQtQza0VIJkaP/n9uVWm8JNIZSRt+z25JKHsnUudVhUgGSdzvIV4nzfQMOP 6+dRijY7DZ4+LIhGrN6nGekLsEYXl0/Kej861IGv3SxJRvQCjKNObHlTqM0fVtkcH2kt 2q6DkLoEttaT6u+wE2bLgU3HbsvhbK+mCDu/SAwoR7lu3/jDgqXxJzpaFo86b/OorIgP ISrptaYCONGiPSS/hebIU4MxMaHDT1iC+SHWMB6p+7oc0+4R6+lQWSnfg835+zkiqEmS Y1Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qACBw0o2MS9FzPU5J+S+Zvtw1uM7Qy8GLYaDlXl8cVc=; b=eCDoosUc3642FZdFyiNABzcgqLLh3F21xTRyTTQ2pCESyRYzanWXUSU+picVG8uVhG FQAze3IY5vuCC/R50KMMBrEI0GxoXZIWreuKqz+rrDfwcdbTN8I1DF5nyzwMT1rv6lVD qHQvS3yHMEjSlRM03A1CKtJftyKjRXFugLFVaFU3DMuPjKKgR4FcOHMRsBwmVux3y15J /5MD8aRoepgyBXvlwfgDZB4e5sotaPe0qkshUuHHimxsT+tB2ezqMk9C153y4gTYhX89 PzRm4lrS23e1W/foGzP302g5LzZ2imsCX+rNT48gVosdp8XgHYTFT+Kh3QbT2HFd9HJ+ PBBg== X-Gm-Message-State: AOAM530TZZRcmvHF5JAxMOlsqs4CRRtVdeqmUjITe9F04mWPRBSJY3q6 Bp2+TcjK/S4z5k1AW5A4gRg1iXtPdIM= X-Google-Smtp-Source: ABdhPJyc6HIlSVB3CoyWYcnXdbT1/VUCA3ga7IMCIxjAuQXe/ByImscn1BxBBGeNjhxgth3dsqjwqQ== X-Received: by 2002:a05:600c:2146:b0:38c:ab68:1919 with SMTP id v6-20020a05600c214600b0038cab681919mr1273044wml.52.1647906323799; Mon, 21 Mar 2022 16:45:23 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-42-69-170.ip85.fastwebnet.it. [93.42.69.170]) by smtp.googlemail.com with ESMTPSA id n10-20020a5d588a000000b002052e4aaf89sm105497wrf.80.2022.03.21.16.45.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:45:23 -0700 (PDT) From: Ansuel Smith To: Rob Herring , Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Ansuel Smith , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v6 11/18] clk: qcom: krait-cc: force sec_mux to QSB Date: Tue, 22 Mar 2022 00:15:41 +0100 Message-Id: <20220321231548.14276-12-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220321231548.14276-1-ansuelsmth@gmail.com> References: <20220321231548.14276-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Now that we have converted every driver to parent_data, it was notice that the bootloader can't really leave the system in a strange state where l2 or the cpu0/1 can be sourced in a number of ways for example cpu1 sourcing out of qsb, l2 sourcing out of pxo. To correctly reset the mux and the HFPLL force the sec_mux to QSB. Signed-off-by: Ansuel Smith --- drivers/clk/qcom/krait-cc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/krait-cc.c b/drivers/clk/qcom/krait-cc.c index 5f98ee1c3681..299eb4c81d96 100644 --- a/drivers/clk/qcom/krait-cc.c +++ b/drivers/clk/qcom/krait-cc.c @@ -15,6 +15,8 @@ #include "clk-krait.h" +#define QSB_RATE 1 + static unsigned int sec_mux_map[] = { 2, 0, @@ -181,6 +183,13 @@ krait_add_sec_mux(struct device *dev, struct clk *qsb, int id, if (ret) clk = ERR_PTR(ret); + /* + * Force the sec_mux to be set to QSB rate. + * This is needed to correctly set the parents and + * to later reset mux and HFPLL to a known freq. + */ + clk_set_rate(clk, QSB_RATE); + err_clk: if (unique_aux) kfree(parent_name); @@ -378,7 +387,7 @@ static int krait_cc_probe(struct platform_device *pdev) */ cur_rate = clk_get_rate(l2_pri_mux_clk); aux_rate = 384000000; - if (cur_rate == 1) { + if (cur_rate == QSB_RATE) { dev_info(dev, "L2 @ QSB rate. Forcing new rate.\n"); cur_rate = aux_rate; } @@ -389,7 +398,7 @@ static int krait_cc_probe(struct platform_device *pdev) for_each_possible_cpu(cpu) { clk = clks[cpu]; cur_rate = clk_get_rate(clk); - if (cur_rate == 1) { + if (cur_rate == QSB_RATE) { dev_info(dev, "CPU%d @ QSB rate. Forcing new rate.\n", cpu); cur_rate = aux_rate; } From patchwork Mon Mar 21 23:15:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 553389 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 F1FBFC43217 for ; Mon, 21 Mar 2022 23:45:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233355AbiCUXrA (ORCPT ); Mon, 21 Mar 2022 19:47:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233178AbiCUXqy (ORCPT ); Mon, 21 Mar 2022 19:46:54 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C292B53F1; Mon, 21 Mar 2022 16:45:27 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id o30-20020a05600c511e00b0038c9cfb79cbso501308wms.1; Mon, 21 Mar 2022 16:45:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=QkfgyebL6ZDeFyix3jLmVd6pOSFa+uhSyC95dgb9bxk=; b=bge0TBx2KjLdT9bxG+d3B5PQrNAM+swGbZbw7/73YAo/TJh+4n+fSfEjHb8k44lo6m mZK8pJlbbwcz0YhVHXI+i7ER3FbBbwAXEJ95bYaT4+32AKUVJX/IDxD0EDtls5HUxkPL K2a0/wmLDaDY1j/c8EJ20IeMpL6CWq21X6c4N79csGgJ9NgJ9BCLQVA8RXNQHeDZUB9e +Fdo11CYYc2CwKRUqSluf2rynkK428wRIe158HA+WQSXO4ltMQiApDGsrTXQCHCuM7wx ZwSahXQp+zGBAzYacz3Bj5pgiDb2g58igMlKEO3FDmOidvY0ZsuoGaAgHimA0bKaf+e4 79vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QkfgyebL6ZDeFyix3jLmVd6pOSFa+uhSyC95dgb9bxk=; b=wuVhWPHQqep3k7cimQ5CCF6g7RxN9/GpbaxhqThr58gZEaqjS+5ds1R0Dpr+RNM0vX lAKWd8FH24FRXejS5DGUortJ6JbRo9lhHh8c75tMMIpFw1kEcKUWT/ssaAfgNj5UZHLr 9buntucdkRoZIogsdP5uGOGop8ziu+PNQf7Ci/3/vH1+ZNdvw09b25lZ4kl5OQ0bgVDz e9fspUf/PSYOTOAexEE5Q3x5VzqfxJKVwIx61BmjY95/Oa7cnhpy/7dtFQSEiR4yOn8c hYYzN/vEJxuovK0ZzWZeKTXgrKz86+NkPV+c53IPFB+05ZNEh6NxaT2Jc1glNyZcT/9e tQMw== X-Gm-Message-State: AOAM530P9Rlz+6DCCglXgIGjriIeDgPmcSCyV6XC68y+ie8L7qN+Zcbb 6Nn6PfaxSn/f19Wb4jAuOTc= X-Google-Smtp-Source: ABdhPJwkW2p7PHJBwZCI9ei0rE/h0snTHL1QPZPHV8gfqAHhnM2mPHcGMoJOR9bqyon0jUX13coDUg== X-Received: by 2002:a05:600c:a0b:b0:389:dd65:66f1 with SMTP id z11-20020a05600c0a0b00b00389dd6566f1mr1190829wmp.95.1647906325852; Mon, 21 Mar 2022 16:45:25 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-42-69-170.ip85.fastwebnet.it. [93.42.69.170]) by smtp.googlemail.com with ESMTPSA id n10-20020a5d588a000000b002052e4aaf89sm105497wrf.80.2022.03.21.16.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:45:25 -0700 (PDT) From: Ansuel Smith To: Rob Herring , Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Ansuel Smith , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v6 13/18] clk: qcom: clk-krait: add enable disable ops Date: Tue, 22 Mar 2022 00:15:43 +0100 Message-Id: <20220321231548.14276-14-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220321231548.14276-1-ansuelsmth@gmail.com> References: <20220321231548.14276-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add enable/disable ops for krait mux. On disable the mux is set to the safe selection. Signed-off-by: Ansuel Smith --- drivers/clk/qcom/clk-krait.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/clk/qcom/clk-krait.c b/drivers/clk/qcom/clk-krait.c index 7ba5dbc72bce..061af57b0ec2 100644 --- a/drivers/clk/qcom/clk-krait.c +++ b/drivers/clk/qcom/clk-krait.c @@ -85,7 +85,25 @@ static u8 krait_mux_get_parent(struct clk_hw *hw) return clk_mux_val_to_index(hw, mux->parent_map, 0, sel); } +static int krait_mux_enable(struct clk_hw *hw) +{ + struct krait_mux_clk *mux = to_krait_mux_clk(hw); + + __krait_mux_set_sel(mux, mux->en_mask); + + return 0; +} + +static void krait_mux_disable(struct clk_hw *hw) +{ + struct krait_mux_clk *mux = to_krait_mux_clk(hw); + + __krait_mux_set_sel(mux, mux->safe_sel); +} + const struct clk_ops krait_mux_clk_ops = { + .enable = krait_mux_enable, + .disable = krait_mux_disable, .set_parent = krait_mux_set_parent, .get_parent = krait_mux_get_parent, .determine_rate = __clk_mux_determine_rate_closest, From patchwork Mon Mar 21 23:15:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 553390 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 3B687C4321E for ; Mon, 21 Mar 2022 23:45:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233353AbiCUXq7 (ORCPT ); Mon, 21 Mar 2022 19:46:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233252AbiCUXq4 (ORCPT ); Mon, 21 Mar 2022 19:46:56 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DB27DE09B; Mon, 21 Mar 2022 16:45:29 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id d7so22756302wrb.7; Mon, 21 Mar 2022 16:45:29 -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=K/YdzwT6SzO2Fufqs+3VjNkZ7pK2lc35vBubZjd9sSo=; b=qpCSDArJms2zr0r7JCBIwZbWYktgyNWaD+UYTox41F+eoSSHLpHWuIsAJgfshcGHLP SE5K8ag3YOdyO662rINwWMtyXK6xx6hcNeGvd21cyCrH88775/jvotIOPPmb15YMUisa Nn2PsFfNZOLiUwGjVdU5w7TBdyAaLbniOzgvZFp8p6LNONda7INuMplQxLYxG8WnZzH9 +bMtiKhfL0lQPxbZHOsDJHwDweNKwMoU+Qjn6mX4qALSFqR8vBijGFzy3gLbfa7QGoir CXWq2ZS8eeVCa74m+DEiLzOoBY8TdYK+UZVJlVFaV3h77ou8JrUfA5SGpHMLvO+eVeNX WgLQ== 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=K/YdzwT6SzO2Fufqs+3VjNkZ7pK2lc35vBubZjd9sSo=; b=IkoN4MRQQClIbrNbZRx43LNUEHklb0AjigqCVT2DwnsNOd7+8g5o1IJ7Yyy2iWC/Zf iABRrL/NDOkPSwv0hTKytN3Njex7/FWZVUZW39gOizO7+lxwjy1l/wQB02Oa1Ui408+6 rElDTvRRcjYY3vEYZtPlV05rDgwMv23We9ybdY7Ii4eKthu5f5CeGrND+DCtwjsxYzzW 8HdNcKS3SzlgC5RIKW1GTY4LWA/++8RUurR8zNjQE/asL+4EE33eeVKGNQ1LVO+ycVck +7hmn0kM8IKKmfp9SBi8qW2pQJaM0XLmn8/mbHSecg9LX/C+XMxctdxJhKsJgbpfLUtq xtaw== X-Gm-Message-State: AOAM5302hDgHeUh9w63RUB7jSvN6Ixbm0cQCpaM9AyoMNocKenBDgAZP pdOU2txSYhc9cBzzxlDyOjs= X-Google-Smtp-Source: ABdhPJwzrJh8StunMpQ1GvycDhtu+wkcSpS1ivCr2z0tEccGE0oiuOpn6/dMDUC/19y7M9+cmDrg0Q== X-Received: by 2002:adf:e4c2:0:b0:204:6d8:ce9a with SMTP id v2-20020adfe4c2000000b0020406d8ce9amr8714240wrm.189.1647906328047; Mon, 21 Mar 2022 16:45:28 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-42-69-170.ip85.fastwebnet.it. [93.42.69.170]) by smtp.googlemail.com with ESMTPSA id n10-20020a5d588a000000b002052e4aaf89sm105497wrf.80.2022.03.21.16.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:45:27 -0700 (PDT) From: Ansuel Smith To: Rob Herring , Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Ansuel Smith , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH v6 15/18] dt-bindings: clock: Add L2 clocks to qcom,krait-cc Documentation Date: Tue, 22 Mar 2022 00:15:45 +0100 Message-Id: <20220321231548.14276-16-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220321231548.14276-1-ansuelsmth@gmail.com> References: <20220321231548.14276-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Krait-cc qcom driver provide also L2 clocks and require the acpu_l2_aux and the hfpll_l2 clock to be provided. Add these missing clocks to the Documentation. The driver keep support for both old (it did already used these clocks and we keep the same naming scheme) and this new implementation and should prevent any regression by this fixup. Signed-off-by: Ansuel Smith Reviewed-by: Krzysztof Kozlowski --- .../devicetree/bindings/clock/qcom,krait-cc.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/qcom,krait-cc.yaml b/Documentation/devicetree/bindings/clock/qcom,krait-cc.yaml index e879bfbe67ac..de4320a85764 100644 --- a/Documentation/devicetree/bindings/clock/qcom,krait-cc.yaml +++ b/Documentation/devicetree/bindings/clock/qcom,krait-cc.yaml @@ -26,6 +26,8 @@ properties: - description: phandle to CPU0 aux clock - description: phandle to CPU1 aux clock - description: phandle to QSB fixed clk + - description: phandle to hfpll for L2 mux + - description: phandle to L2 aux clock clock-names: items: @@ -34,6 +36,8 @@ properties: - const: acpu0_aux - const: acpu1_aux - const: qsb + - const: hfpll_l2 + - const: acpu_l2_aux '#clock-cells': const: 1 @@ -51,9 +55,11 @@ examples: clock-controller { compatible = "qcom,krait-cc-v1"; clocks = <&hfpll0>, <&hfpll1>, - <&acpu0_aux>, <&acpu1_aux>, <&qsb>; + <&acpu0_aux>, <&acpu1_aux>, <&qsb>, + <&hfpll_l2>, <&acpu_l2_aux>; clock-names = "hfpll0", "hfpll1", - "acpu0_aux", "acpu1_aux", "qsb"; + "acpu0_aux", "acpu1_aux", "qsb", + "hfpll_l2", "acpu_l2_aux"; #clock-cells = <1>; }; ... From patchwork Mon Mar 21 23:15:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 553387 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 CFBEFC433F5 for ; Mon, 21 Mar 2022 23:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233376AbiCUXrC (ORCPT ); Mon, 21 Mar 2022 19:47:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233228AbiCUXq6 (ORCPT ); Mon, 21 Mar 2022 19:46:58 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A761AABF44; Mon, 21 Mar 2022 16:45:31 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id n35so7835665wms.5; Mon, 21 Mar 2022 16:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=QG9s/BfSVGU8jsdzGXm0TiCI+CujKEDhbEbtNyUhqpk=; b=LaHhiHTr0XBEoqpJTl36kJdLT6sVAwokS3jUX37my7JYO60hHrWlxS5wya3Qv1pQSM bC1BOdqpbl3PljZ+QrATEAFGW704L/DYlQsuDKLzemoVlieBPgMcPQL1uSH2oauX5Iw7 gWbr/h529KYQoOJOjtxNQX69+cQvl2+l0mFbzX/FP8V+xm1CMp2j46mNwDJ1Zm1aJvPP ip06iUwprxqXIdNY6zMbLDi8CJsD6LgxUh+SjwzIdIqx78tEPvxaXpSFYrALtq8MjWrz 7dWogDx+4vhfMsiU21U2caSCdGGwpkhhuTeEqoviHKc+b2cBesH9YuyFgKhNK4O6T8mk 7ROw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QG9s/BfSVGU8jsdzGXm0TiCI+CujKEDhbEbtNyUhqpk=; b=mahiNQG0fN1K38nFVVfuog6/0pQ11XTOMYV+adjv6OOwKyP1jyKvevPJjIHjIwd/NQ 8POlraw0E/YfxcYcLHp0u5PRSOuj3T45NQm5zCseCxzIIb7hGk12GRFHFNpxhjsECiXW UHvRWil2jXK+ZME+o91eaIRMrleGyAi5cY+ugUbfpWcu5XXb62sPmwAgeVegTUHio9BA uPgLZx640nMWztXUjkH7wlZ4W7rCqPMYitJSIUCr8fUXNmh2Zst1N5afW9uWUUEj3xWa 4Cg1PsiFs+jebIlz4QtAtxeEgMlc7Ka5q6d4gmzp7WdcXQHjxUeo+Ih9iiwMD6e/gTHT C4DA== X-Gm-Message-State: AOAM530FXslzw5VGuMLWr2E1KlHqxhfkaD6qSL/wyBfwz90yp3u+tgpM c6M/cGOheNBwv+OakmugXAw= X-Google-Smtp-Source: ABdhPJwKiRCONTohtqtiZPiT0ur0vM7t7veYodTy2fc+d8uOVCAAt0x9UNrG4MpN43gaHJmkj5KKtg== X-Received: by 2002:a05:600c:4e12:b0:38b:b715:18a6 with SMTP id b18-20020a05600c4e1200b0038bb71518a6mr1202075wmq.17.1647906330106; Mon, 21 Mar 2022 16:45:30 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-42-69-170.ip85.fastwebnet.it. [93.42.69.170]) by smtp.googlemail.com with ESMTPSA id n10-20020a5d588a000000b002052e4aaf89sm105497wrf.80.2022.03.21.16.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:45:29 -0700 (PDT) From: Ansuel Smith To: Rob Herring , Bjorn Andersson , Andy Gross , Michael Turquette , Stephen Boyd , Ansuel Smith , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH v6 17/18] dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml Date: Tue, 22 Mar 2022 00:15:47 +0100 Message-Id: <20220321231548.14276-18-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220321231548.14276-1-ansuelsmth@gmail.com> References: <20220321231548.14276-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Convert kpss-gcc driver Documentation to yaml. Since kpss-gcc expose a clock add the required '#clock-cells' binding while converting it. Signed-off-by: Ansuel Smith --- .../bindings/arm/msm/qcom,kpss-gcc.txt | 44 ------------ .../bindings/arm/msm/qcom,kpss-gcc.yaml | 69 +++++++++++++++++++ 2 files changed, 69 insertions(+), 44 deletions(-) delete mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.yaml diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt deleted file mode 100644 index e628758950e1..000000000000 --- a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt +++ /dev/null @@ -1,44 +0,0 @@ -Krait Processor Sub-system (KPSS) Global Clock Controller (GCC) - -PROPERTIES - -- compatible: - Usage: required - Value type: - Definition: should be one of the following. The generic compatible - "qcom,kpss-gcc" should also be included. - "qcom,kpss-gcc-ipq8064", "qcom,kpss-gcc" - "qcom,kpss-gcc-apq8064", "qcom,kpss-gcc" - "qcom,kpss-gcc-msm8974", "qcom,kpss-gcc" - "qcom,kpss-gcc-msm8960", "qcom,kpss-gcc" - -- reg: - Usage: required - Value type: - Definition: base address and size of the register region - -- clocks: - Usage: required - Value type: - Definition: reference to the pll parents. - -- clock-names: - Usage: required - Value type: - Definition: must be "pll8_vote", "pxo". - -- clock-output-names: - Usage: required - Value type: - Definition: Name of the output clock. Typically acpu_l2_aux indicating - an L2 cache auxiliary clock. - -Example: - - l2cc: clock-controller@2011000 { - compatible = "qcom,kpss-gcc-ipq8064", "qcom,kpss-gcc"; - reg = <0x2011000 0x1000>; - clocks = <&gcc PLL8_VOTE>, <&gcc PXO_SRC>; - clock-names = "pll8_vote", "pxo"; - clock-output-names = "acpu_l2_aux"; - }; diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.yaml b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.yaml new file mode 100644 index 000000000000..7eb852be02c1 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.yaml @@ -0,0 +1,69 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/msm/qcom,kpss-gcc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Krait Processor Sub-system (KPSS) Global Clock Controller (GCC) + +maintainers: + - Ansuel Smith + +description: | + Krait Processor Sub-system (KPSS) Global Clock Controller (GCC). Used + to control L2 mux (in the current implementation). + +properties: + compatible: + items: + - enum: + - qcom,kpss-gcc-ipq8064 + - qcom,kpss-gcc-apq8064 + - qcom,kpss-gcc-msm8974 + - qcom,kpss-gcc-msm8960 + - const: qcom,kpss-gcc + - const: syscon + + reg: + maxItems: 1 + + clocks: + items: + - description: phandle to pll8_vote + - description: phandle to pxo_board + + clock-names: + items: + - const: pll8_vote + - const: pxo + + clock-output-names: + const: acpu_l2_aux + + '#clock-cells': + const: 0 + +required: + - compatible + - reg + - clocks + - clock-names + - clock-output-names + - '#clock-cells' + +additionalProperties: false + +examples: + - | + #include + + clock-controller@2011000 { + compatible = "qcom,kpss-gcc-ipq8064", "qcom,kpss-gcc", "syscon"; + reg = <0x2011000 0x1000>; + clocks = <&gcc PLL8_VOTE>, <&pxo_board>; + clock-names = "pll8_vote", "pxo"; + clock-output-names = "acpu_l2_aux"; + #clock-cells = <0>; + }; +... +