[PATCH] arm64: dts: imx8mm: Model PMIC to SNVS RTC clock path on Data Modul i.MX8M Mini eDM SBC

Tim Harvey tharvey at gateworks.com
Tue Sep 27 13:43:38 PDT 2022


On Tue, Sep 27, 2022 at 1:31 PM Marek Vasut <marex at denx.de> wrote:
>
> On 9/27/22 22:23, Tim Harvey wrote:
> > On Tue, Sep 27, 2022 at 1:10 PM Marek Vasut <marex at denx.de> wrote:
> >>
> >> On 9/27/22 21:43, Tim Harvey wrote:
> >>
> >> Tim,
> >>
> >>> Marek,
> >>>
> >>> The modeling here makes sense, but I tried this on the boards I have
> >>> with the rohm,bd71847 and it did not bump the clk_enable_count for
> >>> clk-32k-out and thus drivers/clk/clk-bd718x7.c still disables the
> >>> clock. Is something else required to make that happen?
> >>
> >> The only thing I can think of is, do you have SNVS_RTC driver enabled
> >> and compiled in, just like the PMIC, or are they maybe modules ?
> >>
> >> You can always try and add a printk() into the snvs rtc driver and see
> >> whether the clk_get there doesn't fail for some reason, and what the
> >> error code is.
> >
> > Marek,
>
> Tim,
>
> > Thanks! I did 'not' have CONFIG_RTC_DRV_SNVS enabled in this test case
> > and as soon as I enable that it does bump the count and enable the
> > clock. We actually have a separate watchdog on our boards so I
> > typically disable the SNVS one to avoid the confusion of having two
> > watchdogs for our users. I tried adding 'clocks = <&pmic>' to the wdog
> > node and disalbing the RTC_DRV_SNVS again but it fails to enable that
> > clock.
>
> I believe the 32 kHz fed into the SNVS RTC are mandatory, they must be
> supplied to the MX8M otherwise the SoC hangs. So whatever supplies the
> RTC_XTALI on your board should be connected to the SNVS RTC node clock
> and the SNVS RTC should be enabled.

hmmm... I'm not sure if I agree that the SNVS RTC must be enabled. The
effect of the BD718XX CLK not being enabled is for sure that the SNVS
RTC does not tick 'and' the WDOG timer does not work (simulating a
kernel crash with sysreq_trigger for example hangs indefinitely). If I
leave the SNVS RTC disabled but force the CLK to be enabled (by
disabling CONFIG_COMMON_CLK_BD718XX) the WDOG behaves properly (as
well as the RTC if I have that enabled, but enabling it is not
required).

Maybe there is some board stability issue that I have failed to see as
I have not done much testing with the BD718XX CLK disabled but I
certainly want to make it enabled by default.

>
> > Also I wonder if your patch deserves a 'Fixes: acb01032e11a5 ("arm64:
> > defconfig: Enable clock driver for ROHM BD718x7 PMIC")' tag?
>
> No, since the current board DT without this patch is not really broken.
> Without the clock parts in the PMIC node, the PMIC just supplies 32 kHz
> clock and does not disable those clock, because Linux is not even aware
> of them, so everything works just fine even if the PMIC driver is
> enabled. This could potentially by a Fixes for this specific board DT,
> but I am don't think it's worth it either.

For any board with a BD718x7 PMIC providing the CLK to IMX8M RTC
without your dt change enabling CONFIG_COMMON_CLK_BD718XX will cause
the CLK to get diabled thus the SNVS RTC 'and' WDOG will not function.
So one could argue the dt change fixes the config enabling the clock
driver. It won't cause the board to crash, but it will cause it to not
wdog reset from a crash ;)

Tim



More information about the linux-arm-kernel mailing list