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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B475C77B73 for ; Mon, 17 Apr 2023 01:01:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E1B0285CB5; Mon, 17 Apr 2023 03:01:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id C4A6285E7B; Mon, 17 Apr 2023 03:01:31 +0200 (CEST) Received: from mail-m11880.qiye.163.com (mail-m11880.qiye.163.com [115.236.118.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 30EF2859F2 for ; Mon, 17 Apr 2023 03:01:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@rock-chips.com Received: from [172.16.12.93] (unknown [58.22.7.114]) by mail-m11880.qiye.163.com (Hmail) with ESMTPA id 4871F2017B; Mon, 17 Apr 2023 09:01:15 +0800 (CST) Message-ID: Date: Mon, 17 Apr 2023 09:01:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 1/2] clk: rockchip: rk3588: add hardcoded assigned clocks values Content-Language: en-US To: Eugen Hristev , u-boot@lists.denx.de, jonas@kwiboo.se Cc: jagan@edgeble.ai References: <20230413113646.261415-1-eugen.hristev@collabora.com> From: Kever Yang In-Reply-To: <20230413113646.261415-1-eugen.hristev@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZQk8aGFZCHkxLGR1OTE4ZQx9VEwETFh oSFyQUDg9ZV1kYEgtZQVlOQ1VJSVVMVUpKT1lXWRYaDxIVHRRZQVlPS0hVSkpLSEpMVUpLS1VLWQ Y+ X-HM-Tid: 0a878cbaf4f92eb6kusn4871f2017b X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Ojo6UTo4TT0TGh8oDioJHDM# SAoKCR5VSlVKTUNKTUJISUxOQk9DVTMWGhIXVRAeDR4JVQIaFRw7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlOQ1VJSVVMVUpKT1lXWQgBWUFITUhINwY+ X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 2023/4/13 19:36, Eugen Hristev wrote: > The CRU is being probed with a default set of assigned clocks, which > are not implemented in the driver at all. > Hence, when clk_set_defaults is called, it fails with ENOENT. > This would not be a problem, as the CRU still handles all the required > clocks, and the assigned clocks are default configs which are preprogrammed > or not required for Uboot operations. > However, the rockchip reset driver is being bound by the same DT node > as CRU, as the reset driver has no DT node. > But, when probing the reset node, it will call again the clk_set_defaults > for the CRU node, and failing because of missing those specific clocks > in the rk3588 clock driver. > To avoid this, simply implement a basic set/get that will just return > success and the default corresponding rate for the required assigned clocks. > As those clocks were not supported in Uboot, not required for Uboot > operations, there is no need to do any different kind of initialization. > > Signed-off-by: Eugen Hristev Reviewed-by: Kever Yang Thanks, - Kever > --- > drivers/clk/rockchip/clk_rk3588.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/drivers/clk/rockchip/clk_rk3588.c b/drivers/clk/rockchip/clk_rk3588.c > index 41e31b61a55b..c93c9c304d40 100644 > --- a/drivers/clk/rockchip/clk_rk3588.c > +++ b/drivers/clk/rockchip/clk_rk3588.c > @@ -1556,6 +1556,21 @@ static ulong rk3588_clk_get_rate(struct clk *clk) > case TCLK_WDT0: > rate = OSC_HZ; > break; > + case PCLK_PMU0_ROOT: > + rate = 100000000; > + break; > + case HCLK_PMU_CM0_ROOT: > + rate = 200000000; > + break; > + case ACLK_BUS_ROOT: > + rate = 375000000; > + break; > + case CLK_150M_SRC: > + rate = 150000000; > + break; > + case CLK_GPU: > + rate = 200000000; > + break; > #ifndef CONFIG_SPL_BUILD > case CLK_AUX16M_0: > case CLK_AUX16M_1: > @@ -1705,6 +1720,13 @@ static ulong rk3588_clk_set_rate(struct clk *clk, ulong rate) > case TCLK_WDT0: > ret = OSC_HZ; > break; > + case PCLK_PMU0_ROOT: > + case CLK_GPU: > + case HCLK_PMU_CM0_ROOT: > + case ACLK_BUS_ROOT: > + case CLK_150M_SRC: > + ret = 0; > + break; > #ifndef CONFIG_SPL_BUILD > case CLK_AUX16M_0: > case CLK_AUX16M_1: