[U-Boot] [PATCH v3 1/6] board_f: Drop the timer after relocation

Simon Glass sjg at chromium.org
Wed Sep 6 01:49:45 UTC 2017


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 at chromium.org>
---

Changes in v3:
- Bracket access to gd->timer with an #ifdef

Changes in v2: None

 common/board_f.c | 3 +++
 1 file changed, 3 insertions(+)

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.
-- 
2.14.1.581.gf28d330327-goog



More information about the U-Boot mailing list