From mboxrd@z Thu Jan 1 00:00:00 1970 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 7AF82C7EE23 for ; Mon, 22 May 2023 03:58:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3CC7984677; Mon, 22 May 2023 05:58:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EKdVeGJ5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7D0F88468B; Mon, 22 May 2023 05:58:04 +0200 (CEST) Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 00A5484676 for ; Mon, 22 May 2023 05:58:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=cfsworks@gmail.com Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2533d74895bso4063707a91.0 for ; Sun, 21 May 2023 20:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684727880; x=1687319880; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=UnKUc44Dr8rGSTvLAGaw7pv5hSZw2rBmOzB8p1aBcus=; b=EKdVeGJ5MI3AHfbYSDoqiWwy+jbNj1JSjb1aVkjHx6djq3FEfWG/834IdZwnxy3ncn gkpNPZEmdz3Fn6F+9kIAL+LeJgtQP/Ig/K8eDP3GSAP5J6P4RQwDAIe64R85tYGAxsuK CXd5cgn+X0lrxI3pjuY8SjM/LKqkV9WVCH+9P4Lx9WsIqPOMenarCowpLhSbxmIDMT3o GcKRU08ruqGC4HgEZW3XHLyhaE1/vZNyLvVtX6eCUFzr/fFhPKNgzQIHcxWXYYxZWZto HuAlhlc763HWydv3MOPIYZegmTGWW6Z8URm0RyCg7yos75Q8LLS5MKySChTOi8dJMoxw LWLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684727880; x=1687319880; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UnKUc44Dr8rGSTvLAGaw7pv5hSZw2rBmOzB8p1aBcus=; b=JUgjzcdEPVRkWH9DMslL9fXMV69kc2T1tpPryUqf4KJRdJmRulTCAgyDhHN7XXy4QY wo0ni5NPw5P36cpDw8ocRYn/Sal8Sc61A5BLpvqyH/vRNEU6f922lnWaiJWbjFjfULrK /pehx26bLggG2EJ+f8b1+j4k1vQnvsliOSsE2VnaMzrK+4Yd7hnx9RFfYg6XKjBZiVPV gBRdaXiMU+ODp1LuwwNRebOqvnlj8MND95vptbqdzY9FYd/x0DIP089eJwMyCKguRVKE Qn327uDiCXTYLzzp7XojVhIOSS77xI21HxbIuFBLvzPZ/Zqx9v55uD+D4Gb5axuBP5V8 2cvw== X-Gm-Message-State: AC+VfDwqvZqJzC5wtGX2dg1bHXU+r/4jdWPEdZE+cCMwP7gGx4weYmNX 3aUl6I0IPFoL2+wTyp0Mswg= X-Google-Smtp-Source: ACHHUZ7J0J459ZDlJBpPemSqkIct4sSwa1egvzUydU4nB46yGnoSzJoaNCWSKGIttH5wNJs7V3uErA== X-Received: by 2002:a17:902:6907:b0:1af:aafb:64c8 with SMTP id j7-20020a170902690700b001afaafb64c8mr2747859plk.21.1684727880141; Sun, 21 May 2023 20:58:00 -0700 (PDT) Received: from [10.64.107.252] (static-198-54-134-172.cust.tzulo.com. [198.54.134.172]) by smtp.gmail.com with ESMTPSA id q20-20020a170902e31400b001a4edbabad3sm3695619plc.230.2023.05.21.20.57.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 May 2023 20:57:59 -0700 (PDT) Message-ID: Date: Sun, 21 May 2023 21:57:57 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [RFC PATCH 10/17] clk: sunxi: Add support for the D1 CCU Content-Language: en-US To: Andre Przywara , Samuel Holland , Jagan Teki Cc: u-boot@lists.denx.de, Icenowy Zheng , Jernej Skrabec References: <20221206004549.29015-1-andre.przywara@arm.com> <20221206004549.29015-11-andre.przywara@arm.com> From: Sam Edwards In-Reply-To: <20221206004549.29015-11-andre.przywara@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 12/5/22 17:45, Andre Przywara wrote: > From: Samuel Holland > > Since the D1 CCU binding is defined, we can add support for its > gates/resets, following the pattern of the existing drivers. > > Signed-off-by: Samuel Holland > Reviewed-by: Andre Przywara > Acked-by: Sean Anderson Hi Andre, So far so good! This patchset seems pretty functional. I'm still trying to get various peripherals on my board up and running; there are a couple of rough edges I'm encountering. I'll report back when I have a build I like. In particular, I had to update this patch in your series to be consistent with 46fa23f9ee. My own patch follows. I'd also suggest adding to `mangopi_mq_r_defconfig`: CONFIG_CLK_SUN20I_D1=y ...or, better yet, an appropriate `select` in Kconfig? Cheers, Sam -- diff --git a/drivers/clk/sunxi/clk_d1.c b/drivers/clk/sunxi/clk_d1.c index 9412b77a54..f4ff682566 100644 --- a/drivers/clk/sunxi/clk_d1.c +++ b/drivers/clk/sunxi/clk_d1.c @@ -74,28 +74,9 @@ static struct ccu_reset d1_resets[] = { [RST_BUS_LRADC] = RESET(0xa9c, BIT(16)), }; -static const struct ccu_desc d1_ccu_desc = { +const struct ccu_desc d1_ccu_desc = { .gates = d1_gates, .resets = d1_resets, -}; - -static int d1_clk_bind(struct udevice *dev) -{ - return sunxi_reset_bind(dev, ARRAY_SIZE(d1_resets)); -} - -static const struct udevice_id d1_ccu_ids[] = { - { .compatible = "allwinner,sun20i-d1-ccu", - .data = (ulong)&d1_ccu_desc }, - { } -}; - -U_BOOT_DRIVER(clk_sun20i_d1) = { - .name = "sun20i_d1_ccu", - .id = UCLASS_CLK, - .of_match = d1_ccu_ids, - .priv_auto = sizeof(struct ccu_priv), - .ops = &sunxi_clk_ops, - .probe = sunxi_clk_probe, - .bind = d1_clk_bind, + .num_gates = ARRAY_SIZE(d1_gates), + .num_resets = ARRAY_SIZE(d1_resets), }; diff --git a/drivers/clk/sunxi/clk_sunxi.c b/drivers/clk/sunxi/clk_sunxi.c index ec02a2d037..176d3cbc28 100644 --- a/drivers/clk/sunxi/clk_sunxi.c +++ b/drivers/clk/sunxi/clk_sunxi.c @@ -125,6 +125,7 @@ extern const struct ccu_desc h616_ccu_desc; extern const struct ccu_desc h6_r_ccu_desc; extern const struct ccu_desc r40_ccu_desc; extern const struct ccu_desc v3s_ccu_desc; +extern const struct ccu_desc d1_ccu_desc; static const struct udevice_id sunxi_clk_ids[] = { #ifdef CONFIG_CLK_SUN4I_A10 @@ -214,6 +215,10 @@ static const struct udevice_id sunxi_clk_ids[] = { #ifdef CONFIG_CLK_SUNIV_F1C100S { .compatible = "allwinner,suniv-f1c100s-ccu", .data = (ulong)&f1c100s_ccu_desc }, +#endif +#ifdef CONFIG_CLK_SUN20I_D1 + { .compatible = "allwinner,sun20i-d1-ccu", + .data = (ulong)&d1_ccu_desc }, #endif { } };