From 5ee94b4f4032502c26cd3c9ede6a910d7e2c9b46 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 5 Sep 2017 19:49:45 -0600 Subject: 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 Reviewed-by: Bin Meng --- common/board_f.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common') diff --git a/common/board_f.c b/common/board_f.c index 104d144f41a..9220815441e 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. -- cgit v1.2.3 From 066b25b6c4995d1e04dbafdb7dfb4fe55630b586 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 5 Sep 2017 19:49:48 -0600 Subject: bootstage: Drop unused options The CONFIG_BOOTSTAGE_USER_COUNT option is no-longer needed since we can now support any number of user IDs. Also BOOTSTAGE_ID_COUNT is not needed now. Drop these unused options. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- common/Kconfig | 9 --------- common/bootstage.c | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'common') diff --git a/common/Kconfig b/common/Kconfig index 4d8cae96109..abd4146922e 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -46,15 +46,6 @@ config BOOTSTAGE_REPORT 29,916,167 26,005,792 bootm_start 30,361,327 445,160 start_kernel -config BOOTSTAGE_USER_COUNT - int "Number of boot ID numbers available for user use" - default 20 - help - This is the number of available user bootstage records. - Each time you call bootstage_mark(BOOTSTAGE_ID_ALLOC, ...) - a new ID will be allocated from this stash. If you exceed - the limit, recording will stop. - config BOOTSTAGE_RECORD_COUNT int "Number of boot stage records to store" default 30 diff --git a/common/bootstage.c b/common/bootstage.c index 61479d7f079..efc99fc6810 100644 --- a/common/bootstage.c +++ b/common/bootstage.c @@ -456,7 +456,7 @@ int bootstage_unstash(const void *base, int size) if (data->rec_count + hdr->count > RECORD_COUNT) { debug("%s: Bootstage has %d records, we have space for %d\n" - "- please increase CONFIG_BOOTSTAGE_USER_COUNT\n", + "- please increase CONFIG_BOOTSTAGE_RECORD_COUNT\n", __func__, hdr->count, RECORD_COUNT - data->rec_count); return -ENOSPC; } -- cgit v1.2.3 From d69bb0ecbf9f73dc75096368653a796d5167b884 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 5 Sep 2017 19:49:49 -0600 Subject: bootstage: Provide a separate record count setting for SPL With SPL we often have limited memory and do not need very many bootstage records. Add a separate Kconfig option for SPL. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- common/Kconfig | 7 +++++++ common/bootstage.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/Kconfig b/common/Kconfig index abd4146922e..540cc9999bc 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -53,6 +53,13 @@ config BOOTSTAGE_RECORD_COUNT This is the size of the bootstage record list and is the maximum number of bootstage records that can be recorded. +config SPL_BOOTSTAGE_RECORD_COUNT + int "Number of boot stage records to store for SPL" + default 5 + help + This is the size of the bootstage record list and is the maximum + number of bootstage records that can be recorded. + config BOOTSTAGE_FDT bool "Store boot timing information in the OS device tree" depends on BOOTSTAGE diff --git a/common/bootstage.c b/common/bootstage.c index efc99fc6810..b866e66979e 100644 --- a/common/bootstage.c +++ b/common/bootstage.c @@ -18,7 +18,7 @@ DECLARE_GLOBAL_DATA_PTR; enum { - RECORD_COUNT = CONFIG_BOOTSTAGE_RECORD_COUNT, + RECORD_COUNT = CONFIG_VAL(BOOTSTAGE_RECORD_COUNT), }; struct bootstage_record { @@ -327,7 +327,7 @@ void bootstage_report(void) } if (data->rec_count > RECORD_COUNT) printf("Overflowed internal boot id table by %d entries\n" - "- please increase CONFIG_BOOTSTAGE_RECORD_COUNT\n", + "Please increase CONFIG_(SPL_)BOOTSTAGE_RECORD_COUNT\n", data->rec_count - RECORD_COUNT); puts("\nAccumulated time:\n"); @@ -456,7 +456,7 @@ int bootstage_unstash(const void *base, int size) if (data->rec_count + hdr->count > RECORD_COUNT) { debug("%s: Bootstage has %d records, we have space for %d\n" - "- please increase CONFIG_BOOTSTAGE_RECORD_COUNT\n", + "Please increase CONFIG_(SPL_)BOOTSTAGE_RECORD_COUNT\n", __func__, hdr->count, RECORD_COUNT - data->rec_count); return -ENOSPC; } -- cgit v1.2.3