Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3021992rwb; Mon, 15 Aug 2022 16:19:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR4aGfaiE6cWknX7y1IRZApIJ4OgXciHbKfUBAOYT3cyQWtz5YX0iKHHvB/Tn1WCnrlC6HoM X-Received: by 2002:a17:90a:8009:b0:1f5:2e52:1e2d with SMTP id b9-20020a17090a800900b001f52e521e2dmr21295271pjn.29.1660605564932; Mon, 15 Aug 2022 16:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605564; cv=none; d=google.com; s=arc-20160816; b=WUVl8hglL7Dsb2CdOnGZbhEkzVnEEIGJyMPWyCWC83k2sI94tWTKzfNe84OXWun47x KB3Sikf5c8JcXA3p+hh0k0FkO89QLWSKkn7EbYhuybdBR3SXYfa7N3FyIJHucOuckEm9 oylQkw1WwpzObdBZ8GQ1EgaX9bo1g3r4zSRM2gDUfx+kRu/A/aiGgCwuxB7RGuOwE6qq MvPyyhTwlN1ehhUaVCzK2L0fCasjBeKjNuBf7XC7EnfniT5RYhnO0xG8iGiQAdIL1yDL 6ELEVnDYE+5n3N7GhF7VASE6mpHOGKGjdhX+f1iqX346K4DYVfVpV2EaDSvR5/wELPNc IyQw== 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=breOr81nDfEfmGpijVm8Vzm19C+xSpVAa05A50/4/ilQu22MeSJx7+83foJCFFw8L0 6AjgYxC1w8VLoD519DvM6mRgu7+qWCenmYGJIqCqVjYpj17DtfuQWZd3AIj3q0OAPle/ TJjM0lvPMHMPQEFw3g1nCDArJGg1coXRacWmVfODvQ8J2ibyPmKfR2kaH5bkVdkxVh71 1kzU/eBBz0buRlE9u/1gpIZbkuekC5BbwJ+AXMz37sA01dvYiHwkAeaDAauAfWcBCusT 9wyHwmFbYPu3pacFILGpPJPNzBGE/OMYCLHpDMaDvoDmvfSSdeNiUzczHnejbd8nStmO CFig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rS3cUN29; 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 m16-20020a170902db1000b0016d2d5c251dsi13173859plx.329.2022.08.15.16.19.13; Mon, 15 Aug 2022 16:19:24 -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=rS3cUN29; 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 S245365AbiHOVy1 (ORCPT + 99 others); Mon, 15 Aug 2022 17:54:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350093AbiHOVuL (ORCPT ); Mon, 15 Aug 2022 17:50:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16155BD154; Mon, 15 Aug 2022 12:32: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 ams.source.kernel.org (Postfix) with ESMTPS id 37E96B80FD3; Mon, 15 Aug 2022 19:32:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 677C1C433C1; Mon, 15 Aug 2022 19:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591932; bh=EIFqnLnUM23Nz1J6+mXn0fbS1tnry5gPG/oOFxiGxUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rS3cUN29VnD9w2I/vSymQavVLN192Y0PKWX5ur5JLgHBZ0WH0W1JVx05K/H41cQM+ KkpOEX+Xre4zmz/mepUeCmY1te7zfFNeH7U1i0sT0CK2KFePZfyO8mpmSNanhFw1nm HyxNaMfSOhN89AXkiVvJn/8JEhX8JRIbnZTNaSYk= 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.18 0706/1095] clk: qcom: ipq8074: fix NSS core PLL-s Date: Mon, 15 Aug 2022 20:01:45 +0200 Message-Id: <20220815180458.594771040@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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