Re: [PATCH V2 3/9] clk: imx: Support building SCU clock driver as module

From: Arnd Bergmann
Date: Mon Jun 29 2020 - 17:48:09 EST


On Mon, Jun 29, 2020 at 9:18 AM Dong Aisheng <dongas86@xxxxxxxxx> wrote:
> On Thu, Jun 25, 2020 at 6:43 AM Stephen Boyd <sboyd@xxxxxxxxxx> wrote:
> > Quoting Aisheng Dong (2020-06-23 19:59:09)
> > Why aren't there options to enable clk-imx6q and clk-imx6sl in the
> > clk/imx/Kconfig file? Those can be bool or tristate depending on if the
> > SoC drivers use CLK_OF_DECLARE or not and depend on the mxc-clk library
> > and SoC config we have in the makefile today.
>
> Yes, we can do that in clk/imx/Kconfig as follows theoretically.
> config CLK_IMX6Q
> bool
> def_bool ARCH_MXC && ARM
> select MXC_CLK
>
> But we have totally 15 platforms that need to change.

I would make that

config CLK_IMX6Q
bool "Clock driver for NXP i.MX6Q"
depends on SOC_IMX6Q || COMPILE_TEST
default SOC_IMX6Q
select MXC_CLK

> e.g.
> drivers/clk/imx/Makefile
> obj-$(CONFIG_SOC_IMX1) += clk-imx1.o
> obj-$(CONFIG_SOC_IMX21) += clk-imx21.o
> obj-$(CONFIG_SOC_IMX25) += clk-imx25.o
> obj-$(CONFIG_SOC_IMX27) += clk-imx27.o
> obj-$(CONFIG_SOC_IMX31) += clk-imx31.o
> obj-$(CONFIG_SOC_IMX35) += clk-imx35.o
> obj-$(CONFIG_SOC_IMX5) += clk-imx5.o
> obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o
> obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o
> obj-$(CONFIG_SOC_IMX6SLL) += clk-imx6sll.o
> obj-$(CONFIG_SOC_IMX6SX) += clk-imx6sx.o
> obj-$(CONFIG_SOC_IMX6UL) += clk-imx6ul.o
> obj-$(CONFIG_SOC_IMX7D) += clk-imx7d.o
> obj-$(CONFIG_SOC_IMX7ULP) += clk-imx7ulp.o
> obj-$(CONFIG_SOC_VF610) += clk-vf610.o
>
> Not sure if it's really worth to do that.
> The easiest way to address this issue is just select it in
> arch/arm/mach-imx/Kconfig,

Changing them can be a one or two patches, that's totally
worth it IMHO.

I really don't like the 'select' in arch/arm/mach-imx/Kconfig: if
you've done the work to make the imx8 clk driver modular,
I would expect to see the same at least tried for the other
ones.

For the clk drivers that cannot yet be 'tristate' because of the
CLK_OF_DECLARE(), can you include a list of drivers
that depend on the clocks being available during early
boot?

Arnd