diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-02-02 17:00:53 +0000 |
---|---|---|
committer | Vincent Palatin <vpalatin@chromium.org> | 2012-02-02 17:05:40 +0000 |
commit | f771cca719c09feb8da6ce5b670d85fa4c9920db (patch) | |
tree | 336dfa495c11e027c07fe51ea7ea61b92be973a3 /board/discovery/board.c | |
parent | a0d1a9e80e9f884ba8963742554a2950b1ce11ae (diff) | |
download | chrome-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/board.c')
-rw-r--r-- | board/discovery/board.c | 6 |
1 files changed, 6 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; } |