summaryrefslogtreecommitdiffstats
path: root/common/board_f.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-09-05 19:49:45 -0600
committerBin Meng <bmeng.cn@gmail.com>2017-09-16 14:57:44 +0800
commit5ee94b4f4032502c26cd3c9ede6a910d7e2c9b46 (patch)
tree8eae080d0bcf0d5f9f57b3b55efa07e045016c3a /common/board_f.c
parenteb45787b396f197f2d4c3bc3556c48421528f62b (diff)
downloadu-boot-5ee94b4f4032502c26cd3c9ede6a910d7e2c9b46.tar.gz
u-boot-5ee94b4f4032502c26cd3c9ede6a910d7e2c9b46.tar.xz
u-boot-5ee94b4f4032502c26cd3c9ede6a910d7e2c9b46.zip
board_f: Drop the timer after relocation
Once U-Boot relocates itself the existing driver-model timer (if any) is no-longer valid until the device is reinitialised. Any use of the device may cause a crash. To handle this, set the timer to NULL after relocation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'common/board_f.c')
-rw-r--r--common/board_f.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 104d144f41..9220815441 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -952,6 +952,9 @@ void board_init_f_r(void)
* UART if available.
*/
gd->flags &= ~GD_FLG_SERIAL_READY;
+#ifdef CONFIG_TIMER
+ gd->timer = NULL;
+#endif
/*
* U-Boot has been copied into SDRAM, the BSS has been cleared etc.