[PATCH 00/20] Add i.MXRT family support

Simon Glass
2020-01-09T20:04:11Z

Hi Giulio,

On Thu, 9 Jan 2020 at 06:53, Giulio Benetti
<giulio.benetti@benettiengineering.com> wrote:
>
> Hi Simon,
>
> On 1/8/20 6:39 PM, Simon Glass wrote:
> > Hi Giulio,
> >
> > On Tue, 7 Jan 2020 at 10:23, Giulio Benetti
> > <giulio.benetti@benettiengineering.com> wrote:
> >>
> >> Hi Stefano, Simon, All,
> >>
> >> On 1/3/20 12:39 PM, Stefano Babic wrote:
> >>> Hi Giulio,
> >>>
> >>> On 04/12/19 18:44, Giulio Benetti wrote:
> >>>> This patchset add support for i.MXRT family starting from i.MXRT1050 SoC.
> >>>> It provides:
> >>>> - i.MXRT1050 SoC entry
> >>>> - i.MXRT pinctrl driver
> >>>> - i.MXRT serial driver tweaking
> >>>> - i.MXRT sdram controller driver
> >>>> - i.MXRT usdhc driver tweaking
> >>>> - i.MXRT1050-evk initial support
> >>>>
> >>>> It uses all DM clocks all around and it loads correctly a basic Linux zImage.
> >>>>
> >>>
> >>> Lukasz has already reviewed most patches, and a V2 is surely WIP. FYI: I
> >>> archive this first series, and I'll wait for your next V2 - thanks !
> >>
> >> I really would like to, but I'm stuck on OF_PLATDATA issue for named
> >> clocks in SPL, see:
> >> https://lists.denx.de/pipermail/u-boot/2019-December/394944.html
> >>
> >> Is it enough for the moment to keep SPL *without* OF_PLATDATA and
> >> implement it later?
> >
> > It seems fine to me, but the assert() idea should work too.
>
> With assert() idea you mean define a header(i.e. imx-clk-names-id.h) like:
> ```
> #define IMX_CLK_NAME_PER 0
> #define IMX_CLK_NAME_IPG 1
> ...
> ```
>
> And then in non-OF_PLATDATA trying to:
> ```
> struct clk per_clk;
> int ret;
>
> ret = clk_get_by_index(dev, IMX_CLK_NAME_PER, &clk);
> ```
>
> And check if clock's name is "per"?

Well actually the assert would only happen in the non-of-platdata
code, which would use clk_get_by_name() and then assert that clk.id is
IMX_CLK_NAME_PER, for example. That would provide a check that the
of-platdata code is getting the right clock.

You can't do anything in the of-platdata code since you don't have the names.

BTW I added noisy_assert() recently which is active even without DEBUG
defined, so that might be useful.

Regards,
Simon