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 E5AE3C433F5 for ; Thu, 20 Jan 2022 00:38:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 06BBC832CD; Thu, 20 Jan 2022 01:38:28 +0100 (CET) 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="GJWKePcu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 65F28832DA; Thu, 20 Jan 2022 01:38:26 +0100 (CET) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (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 77ED982F73 for ; Thu, 20 Jan 2022 01:38:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qk1-x72a.google.com with SMTP id a21so4748559qkn.0 for ; Wed, 19 Jan 2022 16:38:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9Jfwfp0mVBPfn35B/3P0x5Ttf4EEmgFY9teRqSYkRu0=; b=GJWKePcuwoA/9hJoOJ9X+nm1pPAZCqiSu2r/ygfqsJZc4j4MEXVJMilFdnnyy2sL+p 2PiaySUmL0mJuD0IawnB+N7Dnd04tpoj04gmCTZRl41KNZQuliDrwisl81WkrBvprN+C Jn3k8246pR+alxm0Ua4+Q3t4rgNhL1QMeYfmIii6st1kM0RtjuTp+ztia3esj1K4tVyN fBpB7GBFuKtR1DlOtRqyU2cdB9qkmTl0FFcE9GmFlyPxQySYhFQs1b+owNdmgb1mIjCm CkKUeoW3QmqIZ2lZb/sJ6pWWrWDQetyia31jOiZvCJQxwnBxGNwpiFDb+8qiEcZXDLji j2pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9Jfwfp0mVBPfn35B/3P0x5Ttf4EEmgFY9teRqSYkRu0=; b=zYaj0j/0Wy9NG/QIr50CLXycaru550jbFvmz4llkKNd0Vvzegdggvr9tc5vBDrtJ5V tTkBqy5PzTatrtDSGdC+VzjLPUimIdU6a7T2pqOoqe+hno+5exp+9383ZpwUk7Gi3Zmo Bgy9kEMVfyyA/t8BQFWnDo/30hjkPOUwWfjWPg/u4pkK8ZVCtLyGrxvSg97HgyKUHaTU HJ5zG4xvwDKfoCSbEuMCsMaD8cQlSOrq7FAw5fdWEAxtRlQu+aUrCzQT16zaORNGIu6z dZZ5mVc/eplNPnmykhTG0Dn98aGjXflZyQrVgCxtBMHwnDFE/NgyDOYl/6V7mhE/XXx0 2Dyg== X-Gm-Message-State: AOAM530LlbGOxPa3YbRZVjh5unRs9Faa7RLWhscyTD9VTeQilPQgHQYA UkfN7j2VDIoNi7JKVBIIRu1p756OT2s= X-Google-Smtp-Source: ABdhPJyGWcgC9o5zasgZn3uEEy6Le6jajm1v4lBcOKV5TH0pSO3XJbWE5c5H7VV5Dmbmp4I1xs39wA== X-Received: by 2002:a05:620a:214c:: with SMTP id m12mr19858137qkm.356.1642639102392; Wed, 19 Jan 2022 16:38:22 -0800 (PST) Received: from [192.168.1.201] (pool-108-18-137-133.washdc.fios.verizon.net. [108.18.137.133]) by smtp.googlemail.com with ESMTPSA id bl17sm653148qkb.16.2022.01.19.16.38.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jan 2022 16:38:22 -0800 (PST) Subject: Re: [PATCH 14/27] sunxi: implement clock driver for suniv f1c100s To: Yifan Gu , u-boot@lists.denx.de Cc: Jagan Teki , Andre Przywara , Icenowy Zheng , George Hilliard References: <20210725231636.879913-1-me@yifangu.com> <20210725231636.879913-15-me@yifangu.com> From: Sean Anderson Message-ID: <0f584a7d-b7d0-5846-51ea-0ac378c25c5b@gmail.com> Date: Wed, 19 Jan 2022 19:38:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20210725231636.879913-15-me@yifangu.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US 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.2 at phobos.denx.de X-Virus-Status: Clean On 7/25/21 7:16 PM, Yifan Gu wrote: > From: George Hilliard > > The f1c100s has a simple clock tree similar to those of other sunxi > parts. Add support for it. > > Signed-off-by: George Hilliard > Signed-off-by: Yifan Gu > --- > drivers/clk/sunxi/Kconfig | 7 ++++ > drivers/clk/sunxi/Makefile | 1 + > drivers/clk/sunxi/clk_f1c100s.c | 66 +++++++++++++++++++++++++++++++++ > 3 files changed, 74 insertions(+) > create mode 100644 drivers/clk/sunxi/clk_f1c100s.c > > diff --git a/drivers/clk/sunxi/Kconfig b/drivers/clk/sunxi/Kconfig > index bf084fa7a8..28928fef1f 100644 > --- a/drivers/clk/sunxi/Kconfig > +++ b/drivers/clk/sunxi/Kconfig > @@ -9,6 +9,13 @@ config CLK_SUNXI > > if CLK_SUNXI > > +config CLK_SUNIV_F1C100S > + bool "Clock driver for Allwinner F1C100s" > + default MACH_SUNIV > + help > + This enables common clock driver support for platforms based > + on Allwinner F1C100s SoC. > + > config CLK_SUN4I_A10 > bool "Clock driver for Allwinner A10/A20" > default MACH_SUN4I || MACH_SUN7I > diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile > index 4f9282a8b9..da43f8a0ed 100644 > --- a/drivers/clk/sunxi/Makefile > +++ b/drivers/clk/sunxi/Makefile > @@ -8,6 +8,7 @@ obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o > > obj-$(CONFIG_CLK_SUNXI) += clk_sun6i_rtc.o > > +obj-$(CONFIG_CLK_SUNIV_F1C100S) += clk_f1c100s.o > obj-$(CONFIG_CLK_SUN4I_A10) += clk_a10.o > obj-$(CONFIG_CLK_SUN5I_A10S) += clk_a10s.o > obj-$(CONFIG_CLK_SUN6I_A31) += clk_a31.o > diff --git a/drivers/clk/sunxi/clk_f1c100s.c b/drivers/clk/sunxi/clk_f1c100s.c > new file mode 100644 > index 0000000000..3b64445d89 > --- /dev/null > +++ b/drivers/clk/sunxi/clk_f1c100s.c > @@ -0,0 +1,66 @@ > +// SPDX-License-Identifier: (GPL-2.0+) > +/* > + * Copyright (C) 2019 George Hilliard . > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +static struct ccu_clk_gate f1c100s_gates[] = { > + [CLK_BUS_MMC0] = GATE(0x060, BIT(8)), > + [CLK_BUS_MMC1] = GATE(0x060, BIT(9)), > + [CLK_BUS_SPI0] = GATE(0x060, BIT(20)), > + [CLK_BUS_SPI1] = GATE(0x060, BIT(21)), > + [CLK_BUS_OTG] = GATE(0x060, BIT(24)), > + > + [CLK_BUS_UART0] = GATE(0x06c, BIT(20)), > + [CLK_BUS_UART1] = GATE(0x06c, BIT(21)), > + [CLK_BUS_UART2] = GATE(0x06c, BIT(22)), > + > + [CLK_USB_PHY0] = GATE(0x0cc, BIT(1)), > +}; > + > +static struct ccu_reset f1c100s_resets[] = { > + [RST_USB_PHY0] = RESET(0x0cc, BIT(0)), > + > + [RST_BUS_MMC0] = RESET(0x2c0, BIT(8)), > + [RST_BUS_MMC1] = RESET(0x2c0, BIT(9)), > + [RST_BUS_SPI0] = RESET(0x2c0, BIT(20)), > + [RST_BUS_SPI1] = RESET(0x2c0, BIT(21)), > + [RST_BUS_OTG] = RESET(0x2c0, BIT(24)), > + > + [RST_BUS_UART0] = RESET(0x2d0, BIT(20)), > + [RST_BUS_UART1] = RESET(0x2d0, BIT(21)), > + [RST_BUS_UART2] = RESET(0x2d0, BIT(22)), > +}; > + > +static const struct ccu_desc f1c100s_ccu_desc = { > + .gates = f1c100s_gates, > + .resets = f1c100s_resets, > +}; > + > +static int f1c100s_clk_bind(struct udevice *dev) > +{ > + return sunxi_reset_bind(dev, ARRAY_SIZE(f1c100s_resets)); > +} > + > +static const struct udevice_id f1c100s_clk_ids[] = { > + { .compatible = "allwinner,suniv-f1c100s-ccu", > + .data = (ulong)&f1c100s_ccu_desc }, > + { } > +}; > + > +U_BOOT_DRIVER(clk_suniv_f1c100s) = { > + .name = "suniv_f1c100s_ccu", > + .id = UCLASS_CLK, > + .of_match = f1c100s_clk_ids, > + .priv_auto = sizeof(struct ccu_priv), > + .ops = &sunxi_clk_ops, > + .probe = sunxi_clk_probe, > + .bind = f1c100s_clk_bind, > +}; > Acked-by: Sean Anderson