Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp111863lqe; Fri, 5 Apr 2024 14:37:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVISeo9gnqp9QPje1QEW4IDMQ3blSDQwDBFB0ASDLP6ydNoOArfGRWfsjbKq30NLuGk12+pywaExqOKZyQ5JHTagCfET5P8ToD8GK2BvA== X-Google-Smtp-Source: AGHT+IFK9+YjMpHx6hGW68+HJx1cvabiufDPv1G8juDDKjEtqHcBf3ddrBXckLBLQhmxvQMU0V4+ X-Received: by 2002:a05:622a:1ba5:b0:432:f6b2:2df7 with SMTP id bp37-20020a05622a1ba500b00432f6b22df7mr3250177qtb.60.1712353053925; Fri, 05 Apr 2024 14:37:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712353053; cv=pass; d=google.com; s=arc-20160816; b=I1ok5ja7AoDXVQlJV1cW+f+dHH0UoJorbHBNb6PbOXfXkLuRlqRDWkaJ9wexC7bUNC nnGM5Z3TOj5ugjAt8gJBHhe4O1m71oyetMf5LvGTFuvCDEZxr+P/FMypaMC3fufoGSly X8uBu5w0blDC3AC2P/87Bcf3GqgSNzvgKdUmUsxnByf3NcRxiSDPBvbyCyBIQMMC2bOp OwOUGPssBr9O/B1sPwaWPth32xtIiqKXDgHMl2rb1UuamKH0IX86CRpEdHKXOWJ5ppDb HuN6GhdjqB1isasSxjThu5RDl+TITyleV+4+4ymrMYnWi5tEclCuJypOpccqZDpQn86C S9XA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:date:to:cc:from:subject:references:in-reply-to :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:dkim-signature; bh=E/sP85nVXLCC17MxWSVivRjYD8oqFEd8liXYweYSNxM=; fh=jwG161nKlMZBvNebb6qYVQI9okH87FeQw8q1n2qwTtI=; b=FbixeyryFba/5nCfCXABsq0HPDZt5FY2Vtpbl+jkUvfmf53INiA7uUzjfWw0io3ORb /xv3T3e622TusqeEg1eUpvfHKIIeZtpICKa6OX8YCA36hRzXnZbWrLWyRhuDtirsrBbT XXK09buMYFzg2PwbScbRT6Bb9RAqMWMZbtTe1+YrNhi8AI9R5D4+FepvQuAnPEa0NuW5 r1xUltFzh+Zmk2iTj6TDLCBoMel/p3VJ81JhnbHLNUNb7TYZRlQ/bRzHvhiiOb0tVTap u6whjnZCwUgYZJKIyGTEviLGrEt+xf99ZcdM8omU4cMEBLxj7NFVaaG54Y5PFHsDq03E tnDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fVcbNjTn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133597-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133597-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c10-20020a05622a024a00b0043450049b6bsi2778497qtx.138.2024.04.05.14.37.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 14:37:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133597-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fVcbNjTn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133597-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133597-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8AAF01C20CE9 for ; Fri, 5 Apr 2024 21:37:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EC69175553; Fri, 5 Apr 2024 21:37:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fVcbNjTn" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AD791E87C; Fri, 5 Apr 2024 21:37:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712353045; cv=none; b=Ge5iyQEAYXNAu/dsXRDSdg42eVeKZrhEnVJjJfvqfXgwm25FkvD0qlXmrKPdaCT6uTKnd9mt3uIx2XL0xHPtmCBNnDbZaMwvTlN4u/gl1y3Q5wwgt7cJ9f0SrhiQKifONtCKVAywxZWIAocwz8Ni20MGapHphe0YK25fFXh9/+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712353045; c=relaxed/simple; bh=HRY5hhaW64V8NU8mf6JssyKiFddMjgw/28ouTE9i8oQ=; h=Message-ID:Content-Type:MIME-Version:In-Reply-To:References: Subject:From:Cc:To:Date; b=BO4TZ4LD6FHqEu4pGJDtMw/LF5KS+z4IEXblz4M+Qk1ys9WoN6ylD70fsuyn/fNDNEFl3+ynYRC4BeL4MhKAfaNM7Ta8cPbH2wEt80vTOusn8l4xbLSFkl5Y7Thb3MSr9RWQV82VSC8SRZAfEmAcJlRRshD/zedmm841PtYpXAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fVcbNjTn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6C0BC433F1; Fri, 5 Apr 2024 21:37:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712353044; bh=HRY5hhaW64V8NU8mf6JssyKiFddMjgw/28ouTE9i8oQ=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=fVcbNjTngZrTTYeW0UvQ09QyyH1QIXo+3JsshjvnlSpw4x5qjkHXS1E9mFu2jal5p 3lsWFfAOeSqT8cQiqrD1Ko3zg5zXoioz/UfFHaiXZgxkIEVgD6RKL5Xh/U8BCJ7DfE pTyVDK3QHEVFsjTyyzswPnPpndZzgQGGXJp9GorLmrzy/u3i5NHsjE5Qdpb1t/Y0gM OYyCroRQZN0Wp2Jtb4rtog2FVULbOrWLu/3mQUJyxDTrl6H2UBRgBqDLUisEVjZjFM wfPWR0jvWnJcraIqYAcYK2VjYEPPvR6VNUO8ZNEYf54YtKUUazCP4PPMPNuxNNKPBb ERD1XjKS4h9Mg== Message-ID: Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20240219-topic-rb1_gpu-v3-2-86f67786539a@linaro.org> References: <20240219-topic-rb1_gpu-v3-0-86f67786539a@linaro.org> <20240219-topic-rb1_gpu-v3-2-86f67786539a@linaro.org> Subject: Re: [PATCH v3 2/5] clk: qcom: clk-alpha-pll: Add HUAYRA_2290 support From: Stephen Boyd Cc: Marijn Suijten , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Dmitry Baryshkov To: Bjorn Andersson , Conor Dooley , Konrad Dybcio , Krzysztof Kozlowski , Michael Turquette , Rob Herring Date: Fri, 05 Apr 2024 14:37:22 -0700 User-Agent: alot/0.10 Quoting Konrad Dybcio (2024-03-26 14:08:24) > diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alph= a-pll.c > index 8a412ef47e16..27ba8aa3e577 100644 > --- a/drivers/clk/qcom/clk-alpha-pll.c > +++ b/drivers/clk/qcom/clk-alpha-pll.c > @@ -779,6 +792,40 @@ static long clk_alpha_pll_round_rate(struct clk_hw *= hw, unsigned long rate, > return clamp(rate, min_freq, max_freq); > } > =20 > +void clk_huayra_2290_pll_configure(struct clk_alpha_pll *pll, struct reg= map *regmap, > + const struct alpha_pll_config *config) > +{ > + u32 val; > + > + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL(pll), config->c= onfig_ctl_val); > + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U(pll), config-= >config_ctl_hi_val); > + clk_alpha_pll_write_config(regmap, PLL_CONFIG_CTL_U1(pll), config= ->config_ctl_hi1_val); > + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL(pll), config->tes= t_ctl_val); > + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U(pll), config->t= est_ctl_hi_val); > + clk_alpha_pll_write_config(regmap, PLL_TEST_CTL_U1(pll), config->= test_ctl_hi1_val); > + clk_alpha_pll_write_config(regmap, PLL_L_VAL(pll), config->l); > + clk_alpha_pll_write_config(regmap, PLL_ALPHA_VAL(pll), config->al= pha); > + clk_alpha_pll_write_config(regmap, PLL_USER_CTL(pll), config->use= r_ctl_val); > + > + /* Set PLL_BYPASSNL */ > + regmap_update_bits(regmap, PLL_MODE(pll), PLL_BYPASSNL, PLL_BYPAS= SNL); > + regmap_read(regmap, PLL_MODE(pll), &val); > + > + /* Wait 5 us between setting BYPASS and deasserting reset */ > + udelay(5); > + > + /* Take PLL out from reset state */ > + regmap_update_bits(regmap, PLL_MODE(pll), PLL_RESET_N, PLL_RESET_= N); > + regmap_read(regmap, PLL_MODE(pll), &val); > + > + /* Wait 50us for PLL_LOCK_DET bit to go high */ Is the bit not reliable or something? I'd expect to see a polling loop here but it's a sleep. > + usleep_range(50, 55);