diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-12-13 00:19:23 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-12-13 00:20:18 +0100 |
commit | 8666871cb378e68fb9b4c7c429aa3d4cb22a685b (patch) | |
tree | df9bb6057093cfb8038e79370fbca30c4dbbdb9e | |
parent | 3bbe52bb852995286211b3863356087424259940 (diff) | |
download | rockbox-8666871cb378e68fb9b4c7c429aa3d4cb22a685b.tar.gz rockbox-8666871cb378e68fb9b4c7c429aa3d4cb22a685b.zip |
hwstub/stmp: disable watchdog
Some targets like Sony NWZ use a watchdog, so we must disable it to prevent
spurious reboot when we take over
Change-Id: I138a8d7f9a1b089acb2d08d7f6c4a58e8b088b3a
-rw-r--r-- | utils/hwstub/stub/stmp/target.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/hwstub/stub/stmp/target.c b/utils/hwstub/stub/stmp/target.c index 47768aab0d..98f65da625 100644 --- a/utils/hwstub/stub/stmp/target.c +++ b/utils/hwstub/stub/stmp/target.c | |||
@@ -168,6 +168,15 @@ void clkctrl_reset(void) | |||
168 | 168 | ||
169 | #define HW_USBPHY_CTRL (*(volatile uint32_t *)(HW_USBPHY_BASE + 0x30)) | 169 | #define HW_USBPHY_CTRL (*(volatile uint32_t *)(HW_USBPHY_BASE + 0x30)) |
170 | 170 | ||
171 | /** | ||
172 | * | ||
173 | * RTC | ||
174 | * | ||
175 | */ | ||
176 | #define HW_RTC_BASE 0x8005C000 | ||
177 | #define HW_RTC_CTRL (*(volatile uint32_t *)(HW_RTC_BASE + 0)) | ||
178 | #define HW_RTC_CTRL__WATCHDOGEN (1 << 4) | ||
179 | |||
171 | void target_init(void) | 180 | void target_init(void) |
172 | { | 181 | { |
173 | /* detect family */ | 182 | /* detect family */ |
@@ -194,6 +203,8 @@ void target_init(void) | |||
194 | } | 203 | } |
195 | else | 204 | else |
196 | logf("cannot identify family: 0x%x\n", product_code); | 205 | logf("cannot identify family: 0x%x\n", product_code); |
206 | /* disable watchdog */ | ||
207 | __REG_CLR(HW_RTC_CTRL) = HW_RTC_CTRL__WATCHDOGEN; | ||
197 | 208 | ||
198 | if(g_stmp_family == STMP3600) | 209 | if(g_stmp_family == STMP3600) |
199 | { | 210 | { |