Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3090188rwb; Mon, 15 Aug 2022 17:53:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR726HTLcLlahj0AurgSqAtra7e2+Db6KK+C2PFvj9+bYEXwzf1B3YgXw6gz+zhhwJlSgk4B X-Received: by 2002:a05:6402:4241:b0:43d:a7c9:8b21 with SMTP id g1-20020a056402424100b0043da7c98b21mr16764975edb.374.1660611196606; Mon, 15 Aug 2022 17:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611196; cv=none; d=google.com; s=arc-20160816; b=HKn4s/xxry0slRJ+ax2MAKva/g9iYMcFyXbjlvpLqQuEAetXyJKwQmQoT3KFa9pOh1 lIsMs6jE4emqZQDjeMXdYXPuutNLp9cNBSXIoeZ8EsXilA1RfpkJZ+pKqlZdLpslO/q3 U6sqaDZwYhB8/YTonh7k5T5tkPPVoyaTnBtM5npzrj2UBVZwidbEodkbvgu4gYlITrKo E7r6XWnPMsdS3LMudhxpVKDsbjKO7e4Rt8TXD2oaUFNnJrvGQCGJQd5q9WadiiX6OcUR XKLXKRIV2LSnUXkT79Rtrp2QkCppmr1haL+cYP9Tz+uyHRB3+ADWqolsMijHEIu2F94L 7rDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FyKgVaCnDDUkSutUkNt2TyhP/yMS3AttVGFizFcdRag=; b=Y+0LeO0/+8uY60U5i9GCb1CD3AGFJrSDq1EOBM24I1DGubzgvDNpPV6xM/m9v70DD3 m3YKuszs0gUoL1zEqIhzyFkmCktnFACtg+ocO3ItRKOyDBO6xbto9kYRxAXH9NjV8Ode q/TNlRfue8B4QRNoafvNaxr/WHcSsSw+LiD2nD+uPXcDGhLt2xdaL8mlEovXaI6tGuBj Xmzz7L8m+Suu1uZQeJcJX4pYaaDfsxk/p3BI8KvdoOOwnYVMHGl8AxTWssV/5yN2tixL tnTQohs3wHV+geNOCsZupJoHTBgKpjNZQR/q9PQigpO+XiJt4+2LVp4DR9lkVKst7WNX ZIYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=txAVAFKh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn16-20020a1709070d1000b007306f35b498si9003435ejc.711.2022.08.15.17.52.51; Mon, 15 Aug 2022 17:53:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=txAVAFKh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351312AbiHPAUM (ORCPT + 99 others); Mon, 15 Aug 2022 20:20:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357425AbiHPANe (ORCPT ); Mon, 15 Aug 2022 20:13:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8BC4CD51A; Mon, 15 Aug 2022 13:30:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B575D61057; Mon, 15 Aug 2022 20:30:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CAA0C433C1; Mon, 15 Aug 2022 20:30:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595414; bh=EIFqnLnUM23Nz1J6+mXn0fbS1tnry5gPG/oOFxiGxUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=txAVAFKhgzKkaIy0JND9D4xSMuZgwfHuT8P+nK5NxphYwQIL6av1P+UnB/AY4Pb6u 8bDu/mhljj9dg/ToyHnAtyelvhfX9FHweeSsmV8j0ntOomGtPFoDIyoX9yOuxc45+S PFfsDlimVHkohn0maM4PWVjpTjBnWnZlgnpvo+tQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Marko , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.19 0755/1157] clk: qcom: ipq8074: fix NSS core PLL-s Date: Mon, 15 Aug 2022 20:01:51 +0200 Message-Id: <20220815180509.711110862@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Robert Marko [ Upstream commit ca41ec1b30434636c56c5600b24a8d964d359d9c ] Like in IPQ6018 the NSS related Alpha PLL-s require initial configuration to work. So, obtain the regmap that is required for the Alpha PLL configuration and thus utilize the qcom_cc_really_probe() as we already have the regmap. Then utilize the Alpha PLL configs from the downstream QCA 5.4 based kernel to configure them. This fixes the UBI32 and NSS crypto PLL-s failing to get enabled by the kernel. Fixes: b8e7e519625f ("clk: qcom: ipq8074: add remaining PLL’s") Signed-off-by: Robert Marko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220515210048.483898-1-robimarko@gmail.com Signed-off-by: Sasha Levin --- drivers/clk/qcom/gcc-ipq8074.c | 39 +++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/gcc-ipq8074.c b/drivers/clk/qcom/gcc-ipq8074.c index 541016db3c4b..1a5141da7e23 100644 --- a/drivers/clk/qcom/gcc-ipq8074.c +++ b/drivers/clk/qcom/gcc-ipq8074.c @@ -4371,6 +4371,33 @@ static struct clk_branch gcc_pcie0_axi_s_bridge_clk = { }, }; +static const struct alpha_pll_config ubi32_pll_config = { + .l = 0x4e, + .config_ctl_val = 0x200d4aa8, + .config_ctl_hi_val = 0x3c2, + .main_output_mask = BIT(0), + .aux_output_mask = BIT(1), + .pre_div_val = 0x0, + .pre_div_mask = BIT(12), + .post_div_val = 0x0, + .post_div_mask = GENMASK(9, 8), +}; + +static const struct alpha_pll_config nss_crypto_pll_config = { + .l = 0x3e, + .alpha = 0x0, + .alpha_hi = 0x80, + .config_ctl_val = 0x4001055b, + .main_output_mask = BIT(0), + .pre_div_val = 0x0, + .pre_div_mask = GENMASK(14, 12), + .post_div_val = 0x1 << 8, + .post_div_mask = GENMASK(11, 8), + .vco_mask = GENMASK(21, 20), + .vco_val = 0x0, + .alpha_en_mask = BIT(24), +}; + static struct clk_hw *gcc_ipq8074_hws[] = { &gpll0_out_main_div2.hw, &gpll6_out_main_div2.hw, @@ -4772,7 +4799,17 @@ static const struct qcom_cc_desc gcc_ipq8074_desc = { static int gcc_ipq8074_probe(struct platform_device *pdev) { - return qcom_cc_probe(pdev, &gcc_ipq8074_desc); + struct regmap *regmap; + + regmap = qcom_cc_map(pdev, &gcc_ipq8074_desc); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + clk_alpha_pll_configure(&ubi32_pll_main, regmap, &ubi32_pll_config); + clk_alpha_pll_configure(&nss_crypto_pll_main, regmap, + &nss_crypto_pll_config); + + return qcom_cc_really_probe(pdev, &gcc_ipq8074_desc, regmap); } static struct platform_driver gcc_ipq8074_driver = { -- 2.35.1