Adding SCFW API to u-boot

We need to add WDT support for Apalis IMX8QXP U-boot. Our understanding from NXP is that this cannot be done by doing u-boot memory writes directly to the CS register. Instead the Watchdog Timer must be configured and enabled by the SCFW API because access is through the SCFW on IMX8QXP. Therefore we need to add the API to U-boot. Have you assisted with adding the SCFW API to u-boot for other customers? Please provide any assistance on enabling the WDT and/or porting the SCFW API to U-boot.

We need the WDT in case of hang conditions before booting the kernel and need to set a 6 second delay to do a reset if a hang occurs.

To enable the virtual WDT in the SCFW, modify board.c in board_system_config(). The SCFW Porting Guide recommends using the internal SCFW APIs to enable the software WDT as below for the boot partition or M4. Alternatively, use the SCFW WDT APIs and WDT driver in uboot if available to enable the WDT on IMX8X Apalis.

— a/scfw_export_mx8qx_b0/platform/board/mx8qx_apalis/board.c
+++ b/scfw_export_mx8qx_b0/platform/board/mx8qx_apalis/board.c
@@ -987,6 +987,18 @@ void board_system_config(sc_bool_t early, sc_rm_pt_t pt_boot)
BRD_ERR(rm_assign_resource(pt_m4_0, pt_sh, SC_R_M4_0_PID3));
BRD_ERR(rm_assign_resource(pt_m4_0, pt_sh, SC_R_M4_0_PID4));

+/* Adding virtual WDT to boot partition */
+timer_set_wdog_timeout(pt_boot, 120000);
+timer_set_wdog_action(SC_PT, pt_boot, SC_TIMER_WDOG_ACTION_BOARD);
+timer_start_wdog(pt_boot, 0);
+// Alternatively set WDT for the m4
++// timer_set_wdog_timeout(pt_m4_0, 120000);
+// timer_set_wdog_action(pt_boot, pt_m4_0, SC_TIMER_WDOG_ACTION_BOARD);
+// timer_start_wdog(pt_m4_0, SC_TRUE);

Also follow the release notes:

Note by default the SC hardware WDT is enabled by default to protect the SCU, SCFW, and SECO according to the SCFW Porting Guide. The SCFW virtual WDTs are not enabled by default. Also the SCFW enables and services the PMIC WDOG by default in board.c and does a hard reset. See the PF8100 PMIC datasheet and SCFW board.c pf8100_pmic_wdog_enable() for details.

This can be closed.

HI Tracy

Thanks for sharing the solution.
Best regards,