lynxis lazus has uploaded this change for review.

View Change

Errata 2.6.10: enable watchdog on boot

Previous the code was enabling the watchdog window on boot,
but not the watchdog as the errata specified.
It seems WDT EN and WDT WEN got accidental swapped.

Use the hal defines which also describes the function
of the bits.

Change-Id: I581037724d19fb5abd0c5067f16a5769f9e264a7
---
M usb_flash_main.c
1 file changed, 3 insertions(+), 3 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-asf4-dfu refs/changes/02/42302/1
diff --git a/usb_flash_main.c b/usb_flash_main.c
index 8a18f27..3a60ca7 100644
--- a/usb_flash_main.c
+++ b/usb_flash_main.c
@@ -141,10 +141,10 @@
* Workaround: Start WDT with shortest period via NVMEM and stop it by ARM core.
*/
bool chiprev_lower_revG = ((DSU->DID.reg >> 8) & 0xf) < 0x6;
- bool startup_wdt_inactive = _user_area_read_bits((void *)NVMCTRL_USER, 62, 1) != 1;
+ bool startup_wdt_inactive = _user_area_read_bits((void *)WDT_FUSES_ENABLE_ADDR, WDT_FUSES_ENABLE_Pos, 1) != 1;
if (chiprev_lower_revG && startup_wdt_inactive) {
- _user_area_write_bits((void *)NVMCTRL_USER, 50, 0, 4);
- _user_area_write_bits((void *)NVMCTRL_USER, 62, 1, 1);
+ _user_area_write_bits((void *)WDT_FUSES_PER_ADDR, WDT_FUSES_PER_Pos, 0, 4); /* Watchdog period 0 */
+ _user_area_write_bits((void *)WDT_FUSES_ENABLE_ADDR, WDT_FUSES_ENABLE_Pos, 1, 1); /* Enable watchdog */
}

// set bootprot bits for (15-13)=2 x8192 byte

To view, visit change 42302. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-Change-Id: I581037724d19fb5abd0c5067f16a5769f9e264a7
Gerrit-Change-Number: 42302
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis@fe80.eu>