Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1862913rwb; Fri, 19 Aug 2022 10:37:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR7qG/43NMb1t6IRLzjn6UO6vtRfJ6DK0/qCDI88ov6zBAZqH+COyFDo9XG9puOJUoHNXK3Z X-Received: by 2002:a17:90a:b794:b0:1f4:feec:2910 with SMTP id m20-20020a17090ab79400b001f4feec2910mr14978133pjr.214.1660930669544; Fri, 19 Aug 2022 10:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930669; cv=none; d=google.com; s=arc-20160816; b=hqtQifRY5zJC2axYeGbm28QSf4b9A2MOwBjVPBFISsYYMb4ewaH63DefxMc1i+iH1b s+mu5q9gk1UeKy5ayNTEs6ufRN6pNYb9czqzRCkmHK2Z/6ANZ/JXUSCuR0aR8wPp+sIX 4vdW8pVhKeZM8Gs/10CYn2bvU8AhwE/mvPbBG9BEpYRljwYCdBJk8A6H8zGxIaqo2PNS 4/oX6N5w/UbCGeCW2ANX2FEtrJWAyrmy/hNEs7Pow6/vjM3Bloyf4WbdjCVf9lLo1vxp kEhf5S4PFfNK0gGmeSEsoEsCV7c55yQ9tvrTq93NUk3pvgVT7lyZWm0rCGyx94E3g8fK CTjQ== 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=eeXPTly5elZUzDtL4uADbWCFowN5sGGq9yWOYnNqDPb0BrM7PJ5bc8PKW4b3MjXXzS /XcoCj0xvaJwXJDzvh1cAkZg+tlK+jPwV37OGE+xmdUDCa3AuF+lzkoZtcSDd8f0RzId 8SVZ5dth7DMFW9yBxI/C9ZFzCcpFReES+qNCmJVY5wo1hC8rB5GBKGZU34ny36JN5BSf XPhPvg3inSqtOh39lwGB3IHqj53sMvRPBeIWUv0UOfJFJ27jf70KnYfhhRkRrzArfF0u WfzGj1Y+Davk3jg2AcHIQlaN7TpQOogZRsY+xjdE6+rN/ySPPXg9f+l1kOs6XCR1URZz NlhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="z/BarQEK"; 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 a19-20020a62d413000000b00528c39ccb81si4425232pfh.277.2022.08.19.10.37.38; Fri, 19 Aug 2022 10:37:49 -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="z/BarQEK"; 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 S1350293AbiHSQWs (ORCPT + 99 others); Fri, 19 Aug 2022 12:22:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352678AbiHSQRc (ORCPT ); Fri, 19 Aug 2022 12:17:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DCB011844F; Fri, 19 Aug 2022 09:00:38 -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 0B8776177D; Fri, 19 Aug 2022 16:00:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1435DC433D6; Fri, 19 Aug 2022 16:00:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924828; bh=EIFqnLnUM23Nz1J6+mXn0fbS1tnry5gPG/oOFxiGxUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z/BarQEKu+qmDtWluqnt5t9WU0vA7NHcE8twM729k6Y6NoGaHt/p+ZTrQ9wsAlRYm ynQ2FkBalfOZpTkObe0fhCS12VHYWuAAi5qTQRwawgGlCChoYAze5IooXPop0ocIre 7ZYTDhfAhkHlCL8huZ1HxxJOTaOJOniM9Z45Kd4Q= 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.10 296/545] clk: qcom: ipq8074: fix NSS core PLL-s Date: Fri, 19 Aug 2022 17:41:06 +0200 Message-Id: <20220819153842.581724787@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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