2022/12/02 15:26
如何控制让M4自己重启而不影响A35
我们有3个watchdog,wdt0不用配置,默认给A35,wdt1和wdt2可以配置,配置寄存器是SYS_MISCRFCR(SYS_BA+0x014)
bit18:
WDT 1 Reset Real Time Cortex-M4 Sub-system Enable Bit (Write Protect)
0 = WDT 1 reset real time Cortex-M4 sub-system Disabled. (Default)
1 = WDT 1 reset real time Cortex-M4 sub-system Enabled.
Note 1: This bit is write protected. Refer to the SYS_RLKTZS register.
Note 2: This bit keeps high if WDT1ON (SYS_PWRONOTP) is high.
bit17:
WDT 2 Reset Cortex-A35 Enable Bit (Write Protect)
0 = WDT 2 reset Cortex-A35 Disabled. (Default)
1 = WDT 2 reset Cortex-A35 Enabled.
Note: This bit is write protected. Refer to the SYS_RLKTZS register.
bit16:
WDT 1 Reset Cortex-A35 Enable Bit (Write Protect)
0 = WDT 1 reset Cortex-A35 Disabled. (Default)
1 = WDT 1 reset Cortex-A35 Enabled.
Note 1: This bit is write protected. Refer to the SYS_RLKTZS register.
Note 2: This bit keeps high if WDT1ON (SYS_PWRONOTP) is high.
平台默认配置是0x70000,也就是这3个bit都设置为1,这2个wdt 都会使A35和M4重启。
如果需要M4重启而A35不重启,那么需要修改这个值。
修改位置:
arm-trusted-firmware-custom/plat/nuvoton/ma35d1/ma35d1_common.c
/* enable WDT1/WDT2 reset */
outp32((void *)(SYS_BA+0x14), 0x70000);
修改为
/* enable WDT1/WDT2 reset */
outp32((void *)(SYS_BA+0x14), 0x50000);