[PATCH v4 4/4] clk: mediatek: add drivers for MT7988 SoC
Rob Herring
robh+dt at kernel.org
Mon Dec 11 09:36:41 PST 2023
On Sat, Dec 9, 2023 at 3:56 PM Daniel Golle <daniel at makrotopia.org> wrote:
>
> From: Sam Shih <sam.shih at mediatek.com>
>
> Add APMIXED, ETH, INFRACFG and TOPCKGEN clock drivers which are
> typical MediaTek designs.
>
> Also add driver for XFIPLL clock generating the 156.25MHz clock for
> the XFI SerDes. It needs an undocumented software workaround and has
> an unknown internal design.
>
> Signed-off-by: Sam Shih <sam.shih at mediatek.com>
> Signed-off-by: Daniel Golle <daniel at makrotopia.org>
> ---
> v4:
> * make use of existing GATE_MTK_FLAGS macro
> * reformat to max. 100 columns
> * cosmetics
>
> v3: use git --from ...
> v2: no changes
>
>
> drivers/clk/mediatek/Kconfig | 9 +
> drivers/clk/mediatek/Makefile | 5 +
> drivers/clk/mediatek/clk-mt7988-apmixed.c | 102 +++++++
> drivers/clk/mediatek/clk-mt7988-eth.c | 133 +++++++++
> drivers/clk/mediatek/clk-mt7988-infracfg.c | 274 +++++++++++++++++
> drivers/clk/mediatek/clk-mt7988-topckgen.c | 325 +++++++++++++++++++++
> drivers/clk/mediatek/clk-mt7988-xfipll.c | 78 +++++
> 7 files changed, 926 insertions(+)
> create mode 100644 drivers/clk/mediatek/clk-mt7988-apmixed.c
> create mode 100644 drivers/clk/mediatek/clk-mt7988-eth.c
> create mode 100644 drivers/clk/mediatek/clk-mt7988-infracfg.c
> create mode 100644 drivers/clk/mediatek/clk-mt7988-topckgen.c
> create mode 100644 drivers/clk/mediatek/clk-mt7988-xfipll.c
>
> diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig
> index 48b42d11111cd..70a005e7e1b18 100644
> --- a/drivers/clk/mediatek/Kconfig
> +++ b/drivers/clk/mediatek/Kconfig
> @@ -423,6 +423,15 @@ config COMMON_CLK_MT7986_ETHSYS
> This driver adds support for clocks for Ethernet and SGMII
> required on MediaTek MT7986 SoC.
>
> +config COMMON_CLK_MT7988
> + tristate "Clock driver for MediaTek MT7988"
> + depends on ARCH_MEDIATEK || COMPILE_TEST
> + select COMMON_CLK_MEDIATEK
> + default ARCH_MEDIATEK
> + help
> + This driver supports MediaTek MT7988 basic clocks and clocks
> + required for various periperals found on this SoC.
> +
> config COMMON_CLK_MT8135
> tristate "Clock driver for MediaTek MT8135"
> depends on (ARCH_MEDIATEK && ARM) || COMPILE_TEST
> diff --git a/drivers/clk/mediatek/Makefile b/drivers/clk/mediatek/Makefile
> index dbeaa5b41177d..eeccfa039896f 100644
> --- a/drivers/clk/mediatek/Makefile
> +++ b/drivers/clk/mediatek/Makefile
> @@ -62,6 +62,11 @@ obj-$(CONFIG_COMMON_CLK_MT7986) += clk-mt7986-apmixed.o
> obj-$(CONFIG_COMMON_CLK_MT7986) += clk-mt7986-topckgen.o
> obj-$(CONFIG_COMMON_CLK_MT7986) += clk-mt7986-infracfg.o
> obj-$(CONFIG_COMMON_CLK_MT7986_ETHSYS) += clk-mt7986-eth.o
> +obj-$(CONFIG_COMMON_CLK_MT7988) += clk-mt7988-apmixed.o
> +obj-$(CONFIG_COMMON_CLK_MT7988) += clk-mt7988-topckgen.o
> +obj-$(CONFIG_COMMON_CLK_MT7988) += clk-mt7988-infracfg.o
> +obj-$(CONFIG_COMMON_CLK_MT7988) += clk-mt7988-eth.o
> +obj-$(CONFIG_COMMON_CLK_MT7988) += clk-mt7988-xfipll.o
> obj-$(CONFIG_COMMON_CLK_MT8135) += clk-mt8135-apmixedsys.o clk-mt8135.o
> obj-$(CONFIG_COMMON_CLK_MT8167) += clk-mt8167-apmixedsys.o clk-mt8167.o
> obj-$(CONFIG_COMMON_CLK_MT8167_AUDSYS) += clk-mt8167-aud.o
> diff --git a/drivers/clk/mediatek/clk-mt7988-apmixed.c b/drivers/clk/mediatek/clk-mt7988-apmixed.c
> new file mode 100644
> index 0000000000000..02eb6354b01a8
> --- /dev/null
> +++ b/drivers/clk/mediatek/clk-mt7988-apmixed.c
> @@ -0,0 +1,102 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2023 MediaTek Inc.
> + * Author: Sam Shih <sam.shih at mediatek.com>
> + * Author: Xiufeng Li <Xiufeng.Li at mediatek.com>
> + */
> +
> +#include <linux/clk-provider.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/of_device.h>
You probably don't need these 2 headers and the implicit includes
of_device.h makes are dropped now in linux-next. Please check what you
actually need and make them explicit.
Rob
More information about the Linux-mediatek
mailing list