[U-Boot] [PATCH v1 06/15] dm: clk: imx: Add support for controlling imx6q clocks via Driver Model

Fabio Estevam festevam at gmail.com
Mon Jan 21 13:36:03 UTC 2019


Hi Lukasz,

On Sat, Jan 19, 2019 at 7:15 AM Lukasz Majewski <lukma at denx.de> wrote:

> +static ulong imx6q_clk_get_rate(struct clk *clk)
> +{
> +       ulong rate = 0;
> +
> +       debug("%s(#%lu)\n", __func__, clk->id);
> +
> +       switch (clk->id) {
> +       case IMX6QDL_CLK_ECSPI1:
> +       case IMX6QDL_CLK_ECSPI2:
> +       case IMX6QDL_CLK_ECSPI3:
> +       case IMX6QDL_CLK_ECSPI4:
> +               return imx6_get_cspi_clk();
> +
> +       case IMX6QDL_CLK_USDHC1:
> +       case IMX6QDL_CLK_USDHC2:
> +       case IMX6QDL_CLK_USDHC3:
> +       case IMX6QDL_CLK_USDHC4:
> +               return imx6_get_usdhc_clk(clk->id - IMX6QDL_CLK_USDHC1);

I don't think this scales well as this needs to grow for all other
peripherals and for each port instance.

If we are adding a clock driver for mx6, why don't we add it just like
the kernel one?

Barebox imports the clock driver from the kernel and it is much cleaner:
https://git.pengutronix.de/cgit/barebox/tree/drivers/clk/imx/clk-imx6.c


More information about the U-Boot mailing list