diff mbox series

imx: Add support for i.MX8MM Beacon EmbeddedWorks devkit.

Message ID f89bc3c8-567f-d713-3824-52faa9e048d1@denx.de
State New
Headers show
Series imx: Add support for i.MX8MM Beacon EmbeddedWorks devkit. | expand

Commit Message

Marek Vasut April 28, 2020, 2:03 p.m. UTC
On 4/28/20 3:30 PM, Adam Ford wrote:
[...]
>>>> Either arch/arm/lib/reset.c or drivers/sysreset/sysreset_watchdog.c
>>>> should be used, in this case it's likely the later.
>>>>
>>>>> Since I don't know what the
>>>>> 'right' was is, I don't know what I need to do.  Ideally, it would be
>>>>> nice if NXP had platform-common code that would do it
>>>>
>>>> Reset implementation is not platform code, it shouldn't be there, see
>>>> drivers/sysreset/ .
>>>
>>> For the benefit of anyone else with an i.MX8M Mini, I found that that
>>> if I enable
>>> CONFIG_PANIC_HANG, the need for this function disappears, and it still
>>> appears to boot normally from microSD.
>>
>> Except if something calls hang(), the board is stuck instead of
>> rebooting and trying again. I think you might want to look at the
>> sysreset_watchdog.c, it implements basically the same thing, except via
>> DM and without hacks in board files.
> 
> My understanding is that SPL isn't required to support DM and not all
> drivers have their DM equivalents enabled in SPL.

The MX8MM already has DM enabled in SPL, and the above drivers I pointed
you to already have DM support.

> For my boards, I'm
> not seeing hang, nor am I seeing any issues by removing the do_reset
> function in spl with the CONFIG_PANIC_HANG.  I can't speak for others,
> but I'm fine with that work around for my board.  If there is a hang()
> call in SPL, it seems like I need to fix that issue rather than
> whether or not it reboots.

It could be a transient failure.

So instead of spending more time trying to convince you to fix your
patch, this is what you have to add. See? It's less work than to keep
this discussion going...
diff mbox series

Patch

diff --git a/arch/arm/dts/imx8mm-board-u-boot.dtsi
b/arch/arm/dts/imx8mm-board-u-boot.dtsi
index da841e94a9..dccd26663f 100644
--- a/arch/arm/dts/imx8mm-board-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-board-u-boot.dtsi
@@ -9,3 +9,8 @@ 
 / {
+       wdt-reboot {
+               compatible = "wdt-reboot";
+               wdt = <&wdog1>;
+               u-boot,dm-spl;
+       };
 };

@@ -121 +126,5 @@ 
 };
+
+&wdog1 {
+       u-boot,dm-spl;
+};
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index bbfc9c5576..09be0153fd 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -384,7 +384,7 @@  int ft_system_setup(void *blob, bd_t *bd)
 }
 #endif

-#if defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SYSRESET)
+#if !CONFIG_IS_ENABLED(SYSRESET)
 void reset_cpu(ulong addr)
 {
        struct watchdog_regs *wdog = (struct watchdog_regs *)addr;
diff --git a/configs/imx8mm_board_defconfig b/configs/imx8mm_board_defconfig
index d6d30015e1..049c687910 100644
--- a/configs/imx8mm_board_defconfig
+++ b/configs/imx8mm_board_defconfig
@@ -30 +30,5 @@  CONFIG_SPL_BOARD_INIT=y
-CONFIG_PANIC_HANG=y
+CONFIG_SPL_WATCHDOG_SUPPORT=y
+CONFIG_SPL_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
+# CONFIG_WATCHDOG is not set
+CONFIG_IMX_WATCHDOG=y