summaryrefslogtreecommitdiff
path: root/board/discovery
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2012-02-02 17:00:53 +0000
committerVincent Palatin <vpalatin@chromium.org>2012-02-02 17:05:40 +0000
commitf771cca719c09feb8da6ce5b670d85fa4c9920db (patch)
tree336dfa495c11e027c07fe51ea7ea61b92be973a3 /board/discovery
parenta0d1a9e80e9f884ba8963742554a2950b1ce11ae (diff)
downloadchrome-ec-f771cca719c09feb8da6ce5b670d85fa4c9920db.tar.gz
stm32l: add watchdog support
Use the Independant WatchDog. The Window WatchDog would provide a nice early warning interrupt before actually rebooting but the max period (128 ms) is probably too short for our purpose. The full GPIO support and the reboot cause detection will be implemented in later steps. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=on Discovery board, do blocking waits of 500ms and 1500ms, and check the latter reboots the platform and the former does not. Change-Id: I26e4d8b26b733269b7811cc3b3a09daf98ea364a
Diffstat (limited to 'board/discovery')
-rw-r--r--board/discovery/board.c6
-rw-r--r--board/discovery/ec.tasklist1
2 files changed, 7 insertions, 0 deletions
diff --git a/board/discovery/board.c b/board/discovery/board.c
index ec18af63e3..560773d829 100644
--- a/board/discovery/board.c
+++ b/board/discovery/board.c
@@ -20,6 +20,9 @@ void configure_board(void)
(0x7 << 12) | (0x7 << 8);
STM32L_GPIO_MODER(B) = (STM32L_GPIO_MODER(B) & ~0x00F00000) |
0x00A00000;
+
+ /* Green and blue LEDs : configure port 6 and 7 as output */
+ STM32L_GPIO_MODER(B) |= (1 << (7 * 2)) | (1 << (6 * 2));
}
/**
@@ -28,6 +31,9 @@ void configure_board(void)
*/
int jtag_pre_init(void)
{
+ /* stop TIM2, TIM3 and watchdogs when the JTAG stops the CPU */
+ STM32L_DBGMCU_APB1FZ |= 0x00001803;
+
return EC_SUCCESS;
}
diff --git a/board/discovery/ec.tasklist b/board/discovery/ec.tasklist
index 8e52f9f1c2..0e5992b96b 100644
--- a/board/discovery/ec.tasklist
+++ b/board/discovery/ec.tasklist
@@ -14,4 +14,5 @@
* 'd' in an opaque parameter passed to the routine at startup
*/
#define CONFIG_TASK_LIST \
+ TASK(WATCHDOG, watchdog_task, NULL) \
TASK(CONSOLE, console_task, NULL)