]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
udoo_neo: Convert to watchdog driver model
authorFabio Estevam <festevam@gmail.com>
Fri, 19 Jul 2024 20:33:08 +0000 (17:33 -0300)
committerFabio Estevam <festevam@gmail.com>
Mon, 22 Jul 2024 20:55:35 +0000 (17:55 -0300)
Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused
the 'reset' command in U-Boot to not cause a board reset.

Fix it by switching to the watchdog driver model via sysreset, which
is the preferred method for implementing the watchdog reset.

With the watchdog driver model in place, it is no longer needed
to have board code to initialize the watchdog, so remove
its related board code.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
arch/arm/dts/imx6sx-udoo-neo-basic-u-boot.dtsi
board/udoo/neo/neo.c
configs/udoo_neo_defconfig

index b5e1f2b9a16faf85161efeade3aabf1b7ef50376..7f5a6424bac837c9b9477e66af6690e68f52c05f 100644 (file)
@@ -1,5 +1,13 @@
 // SPDX-License-Identifier: GPL-2.0+
 
+/ {
+       wdt-reboot {
+               compatible = "wdt-reboot";
+               wdt = <&wdog1>;
+               bootph-pre-ram;
+       };
+};
+
 &soc {
        bootph-all;
 };
@@ -15,3 +23,7 @@
 &uart1 {
        bootph-all;
 };
+
+&wdog1 {
+       bootph-pre-ram;
+};
index b435b721e53c8e9ae2c72cbbcee616cc026d4eaa..1a0aaecc3328b822917b3cccc766b2958104ed01 100644 (file)
@@ -57,9 +57,6 @@ enum {
 #define ENET_RX_PAD_CTRL  (PAD_CTL_PKE | PAD_CTL_PUE |          \
        PAD_CTL_SPEED_MED   | PAD_CTL_SRE_FAST)
 
-#define WDOG_PAD_CTRL (PAD_CTL_PUE | PAD_CTL_PKE | PAD_CTL_SPEED_MED | \
-       PAD_CTL_DSE_40ohm)
-
 #define BOARD_DETECT_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE |             \
        PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED |               \
        PAD_CTL_DSE_34ohm | PAD_CTL_HYS | PAD_CTL_SRE_FAST)
@@ -113,10 +110,6 @@ static iomux_v3_cfg_t const phy_control_pads[] = {
        MUX_PAD_CTRL(ENET_CLK_PAD_CTRL),
 };
 
-static iomux_v3_cfg_t const wdog_b_pad = {
-       MX6_PAD_GPIO1_IO13__GPIO1_IO_13 | MUX_PAD_CTRL(WDOG_PAD_CTRL),
-};
-
 static iomux_v3_cfg_t const peri_3v3_pads[] = {
        MX6_PAD_QSPI1A_DATA0__GPIO4_IO_16 | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
@@ -148,15 +141,6 @@ int board_init(void)
        /* Address of boot parameters */
        gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-       /*
-        * Because kernel set WDOG_B mux before pad with the commone pinctrl
-        * framwork now and wdog reset will be triggered once set WDOG_B mux
-        * with default pad setting, we set pad setting here to workaround this.
-        * Since imx_iomux_v3_setup_pad also set mux before pad setting, we set
-        * as GPIO mux firstly here to workaround it.
-        */
-       imx_iomux_v3_setup_pad(wdog_b_pad);
-
        /* Enable PERI_3V3, which is used by SD2, ENET, LVDS, BT */
        imx_iomux_v3_setup_multiple_pads(peri_3v3_pads,
                                         ARRAY_SIZE(peri_3v3_pads));
index 4986b4c26260eb51dce2c3c9d90a4a7f77de081c..9f9ad0ad5ec799d98de064d4feebffe7407ae3dc 100644 (file)
@@ -61,5 +61,8 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_REGULATOR_ANATOP=y
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_IMX_THERMAL=y
 CONFIG_USB=y
+CONFIG_IMX_WATCHDOG=y