xtensa/esp32: Move RTC WDT deinit after initial setup
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
parent
8c70e4f1c1
commit
db18a12844
@ -86,14 +86,6 @@ void IRAM_ATTR __start(void)
|
|||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
uint32_t sp;
|
uint32_t sp;
|
||||||
|
|
||||||
/* Kill the watchdog timer */
|
|
||||||
|
|
||||||
putreg32(RTC_CNTL_WDT_WKEY_VALUE, RTC_CNTL_WDTWPROTECT_REG);
|
|
||||||
regval = getreg32(RTC_CNTL_WDTCONFIG0_REG);
|
|
||||||
regval &= ~RTC_CNTL_WDT_EN;
|
|
||||||
putreg32(regval, RTC_CNTL_WDTCONFIG0_REG);
|
|
||||||
putreg32(0, RTC_CNTL_WDTWPROTECT_REG);
|
|
||||||
|
|
||||||
/* Make sure that normal interrupts are disabled. This is really only an
|
/* Make sure that normal interrupts are disabled. This is really only an
|
||||||
* issue when we are started in un-usual ways (such as from IRAM). In this
|
* issue when we are started in un-usual ways (such as from IRAM). In this
|
||||||
* case, we can at least defer some unexpected interrupts left over from
|
* case, we can at least defer some unexpected interrupts left over from
|
||||||
@ -129,6 +121,17 @@ void IRAM_ATTR __start(void)
|
|||||||
regval &= ~DPORT_APPCPU_CLKGATE_EN;
|
regval &= ~DPORT_APPCPU_CLKGATE_EN;
|
||||||
putreg32(regval, DPORT_APPCPU_CTRL_B_REG);
|
putreg32(regval, DPORT_APPCPU_CTRL_B_REG);
|
||||||
|
|
||||||
|
/* The 2nd stage bootloader enables RTC WDT to check on startup sequence
|
||||||
|
* related issues in application. Hence disable that as we are about to
|
||||||
|
* start the NuttX environment.
|
||||||
|
*/
|
||||||
|
|
||||||
|
putreg32(RTC_CNTL_WDT_WKEY_VALUE, RTC_CNTL_WDTWPROTECT_REG);
|
||||||
|
regval = getreg32(RTC_CNTL_WDTCONFIG0_REG);
|
||||||
|
regval &= ~RTC_CNTL_WDT_EN;
|
||||||
|
putreg32(regval, RTC_CNTL_WDTCONFIG0_REG);
|
||||||
|
putreg32(0, RTC_CNTL_WDTWPROTECT_REG);
|
||||||
|
|
||||||
/* Set CPU frequency configured in board.h */
|
/* Set CPU frequency configured in board.h */
|
||||||
|
|
||||||
esp32_clockconfig();
|
esp32_clockconfig();
|
||||||
|
Loading…
Reference in New Issue
Block a user