From: Sean Anderson <seanga2@gmail.com>
To: Yifan Gu <me@yifangu.com>, u-boot@lists.denx.de
Cc: Jagan Teki <jagan@amarulasolutions.com>,
Andre Przywara <andre.przywara@arm.com>,
Icenowy Zheng <icenowy@aosc.io>,
George Hilliard <thirtythreeforty@gmail.com>
Subject: Re: [PATCH 14/27] sunxi: implement clock driver for suniv f1c100s
Date: Wed, 19 Jan 2022 19:38:21 -0500 [thread overview]
Message-ID: <0f584a7d-b7d0-5846-51ea-0ac378c25c5b@gmail.com> (raw)
In-Reply-To: <20210725231636.879913-15-me@yifangu.com>
On 7/25/21 7:16 PM, Yifan Gu wrote:
> From: George Hilliard <thirtythreeforty@gmail.com>
>
> The f1c100s has a simple clock tree similar to those of other sunxi
> parts. Add support for it.
>
> Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
> Signed-off-by: Yifan Gu <me@yifangu.com>
> ---
> 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 <thirtythreeforty@gmail.com>.
> + */
> +
> +#include <common.h>
> +#include <clk-uclass.h>
> +#include <dm.h>
> +#include <errno.h>
> +#include <asm/arch/ccu.h>
> +#include <dt-bindings/clock/suniv-ccu.h>
> +#include <dt-bindings/reset/suniv-ccu.h>
> +
> +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 <seanga2@gmail.com>
next prev parent reply other threads:[~2022-01-20 0:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-25 23:16 [PATCH 00/27] Add F1C100s based PocketGo handheld support Yifan Gu
2021-07-25 23:16 ` [PATCH 01/27] arm: arm926ejs: start.S: port save_boot_params support from armv7 code Yifan Gu
2021-07-25 23:16 ` [PATCH 02/27] arm: arm926ej-s: add sunxi code Yifan Gu
2021-07-25 23:16 ` [PATCH 03/27] sunxi: add support for suniv architecture Yifan Gu
2021-07-25 23:16 ` [PATCH 04/27] sunxi: suniv: add support for Lichee Pi Nano Yifan Gu
2021-07-25 23:16 ` [PATCH 05/27] sunxi: suniv: add boot sequence for SPL to try Yifan Gu
2021-07-25 23:16 ` [PATCH 06/27] sunxi: spi-spl: add support for SUNIV Yifan Gu
2021-07-25 23:16 ` [PATCH 07/27] sunxi: add SPI0 node for suniv Yifan Gu
2021-07-25 23:16 ` [PATCH 08/27] sunxi: enable SPI NOR on Lichee Pi Nano Yifan Gu
2021-07-25 23:16 ` [PATCH 09/27] sunxi: add defconfig for Lichee Pi Nano with SPI Flash support Yifan Gu
2021-07-25 23:16 ` [PATCH 10/27] sunxi: add support for UART at PF for suniv Yifan Gu
2021-07-25 23:16 ` [PATCH 11/27] sunxi: do not set PF MMC0 pinmux when PF uart is used Yifan Gu
2021-07-25 23:16 ` [PATCH 12/27] sunxi: allow to enable MMC driver when using PF UART0 Yifan Gu
2021-07-25 23:16 ` [PATCH 13/27] sunxi: Don't provide enable_cache() on suniv Yifan Gu
2021-07-25 23:16 ` [PATCH 14/27] sunxi: implement clock driver for suniv f1c100s Yifan Gu
2022-01-20 0:38 ` Sean Anderson [this message]
2021-07-25 23:16 ` [PATCH 15/27] sunxi: gpio: Add support for suniv-f1c100s Yifan Gu
2021-07-25 23:16 ` [PATCH 16/27] sunxi: spi: restore bus speed and mode after reset Yifan Gu
2021-07-25 23:16 ` [PATCH 17/27] sunxi: spi: Add suniv pin controller support Yifan Gu
2021-07-25 23:16 ` [PATCH 18/27] sunxi: suniv: add device tree nodes for f1c100s MMC controllers Yifan Gu
2021-07-25 23:16 ` [PATCH 19/27] arm: dts: sunxi: do not renumber if mmc2 does not exist Yifan Gu
2021-07-26 1:01 ` Icenowy Zheng
2021-07-25 23:16 ` [PATCH 20/27] board: licheepi_nano: set CONFIG_MMC_SUNXI_SLOT_EXTRA Yifan Gu
2021-07-25 23:16 ` [PATCH 21/27] sunxi: suniv: add missing header include for udelay Yifan Gu
2021-07-25 23:16 ` [PATCH 22/27] sunxi: suniv: allow serial connection on uart1 Yifan Gu
2021-07-25 23:16 ` [PATCH 23/27] sunxi: suniv: do not detect boot sector on suniv Yifan Gu
2021-07-25 23:16 ` [PATCH 24/27] sunxi: suniv: set SYS_TEXT_BASE default Yifan Gu
2021-07-25 23:16 ` [PATCH 25/27] sunxi: suniv: disable mmc optimization for suniv Yifan Gu
2021-07-25 23:16 ` [PATCH 26/27] arm: dts: suniv: define uart1 pins Yifan Gu
2021-07-25 23:16 ` [PATCH 27/27] arm: dts: add pocketgo handheld support Yifan Gu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0f584a7d-b7d0-5846-51ea-0ac378c25c5b@gmail.com \
--to=seanga2@gmail.com \
--cc=andre.przywara@arm.com \
--cc=icenowy@aosc.io \
--cc=jagan@amarulasolutions.com \
--cc=me@yifangu.com \
--cc=thirtythreeforty@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).