[U-Boot] [PATCH 1/3] bootstage: Dont print reset entry separately

From: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com
Printing the first entry reset separately is no longer needed as it now prints the entries with valid name and timestamp zero. This removes duplicate printing of the reset record.
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com ---
common/bootstage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/bootstage.c b/common/bootstage.c index 35bce3d881a5..c8080dcab5d7 100644 --- a/common/bootstage.c +++ b/common/bootstage.c @@ -271,7 +271,7 @@ void bootstage_report(void) /* Fake the first record - we could get it from early boot */ rec->name = "reset"; rec->time_us = 0; - prev = print_time_record(BOOTSTAGE_ID_AWAKE, rec, 0); + prev = 0;
/* Sort records by increasing time */ qsort(record, ARRAY_SIZE(record), sizeof(*rec), h_compare_record);

From: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com
Print all entries in boot stage report even if the recorded time stamp is zero. This lets the user to know all the recorded entries that are made into. This helps user to know if something went wrong with timestamp for that entry.
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com ---
common/bootstage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/bootstage.c b/common/bootstage.c index c8080dcab5d7..bca74cd207fc 100644 --- a/common/bootstage.c +++ b/common/bootstage.c @@ -277,7 +277,7 @@ void bootstage_report(void) qsort(record, ARRAY_SIZE(record), sizeof(*rec), h_compare_record);
for (id = 0; id < BOOTSTAGE_ID_COUNT; id++, rec++) { - if (rec->time_us != 0 && !rec->start_us) + if ((rec->time_us != 0 && !rec->start_us) || rec->name) prev = print_time_record(rec->id, rec, prev); } if (next_id > BOOTSTAGE_ID_COUNT)

From: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com
Modify routine timer_get_boot_us(), as the base_time will be stored in bss if initialized to zero(observed for arm compilers, arm and arm64) and for most of the boards bss was not initialized to zero before relocation and hence causing a junk timestamp value in boot record if there is an entry record before relocation(example would be board_init_f entry). Also, as it is in bss which will be intialized to zero after relocation, it causes the first entry after relocation to be missed while printing bootstage report as the timer_get_boot_us() returns zero if bss_time is zero. This patch fixes the same by initialzing bss_time to 1 and also returning current timestamp if bss_time is 1. Intializing it to 1 causes it to be placed in data section and hence no issues.
Before this patch: ZynqMP> bootstage report Timer summary in microseconds: Mark Elapsed Stage 0 0 reset 491,000 491,000 id=64 516,000 25,000 id=65 522,000 6,000 main_loop 112,092,989,575,347,436,48112,092,989,575,342,216,48 board_init_f
After this patch: ZynqMP> bootstage report Timer summary in microseconds: Mark Elapsed Stage 0 0 reset 9,969 9,969 board_init_f 1,227,000 1,217,031 board_init_r 1,713,000 486,000 id=64 1,733,000 20,000 id=65 1,735,000 2,000 main_loop
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com ---
common/bootstage.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/common/bootstage.c b/common/bootstage.c index bca74cd207fc..b65345c28105 100644 --- a/common/bootstage.c +++ b/common/bootstage.c @@ -294,16 +294,18 @@ void bootstage_report(void)
ulong __timer_get_boot_us(void) { - static ulong base_time; + static ulong base_time = 1;
/* * We can't implement this properly. Return 0 on the first call and * larger values after that. */ - if (base_time) + if (base_time != 1) return get_timer(base_time) * 1000; - base_time = get_timer(0); - return 0; + else + base_time = get_timer(0); + + return base_time; }
ulong timer_get_boot_us(void)

On Tue, May 30, 2017 at 02:22:11PM +0200, Michal Simek wrote:
From: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com
Printing the first entry reset separately is no longer needed as it now prints the entries with valid name and timestamp zero. This removes duplicate printing of the reset record.
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com
Can you please rebase this and the rest of the series on top of master again? And please cc Simon when you repost, thanks!

On 9.6.2017 03:00, Tom Rini wrote:
On Tue, May 30, 2017 at 02:22:11PM +0200, Michal Simek wrote:
From: Siva Durga Prasad Paladugu siva.durga.paladugu@xilinx.com
Printing the first entry reset separately is no longer needed as it now prints the entries with valid name and timestamp zero. This removes duplicate printing of the reset record.
Signed-off-by: Siva Durga Prasad Paladugu sivadur@xilinx.com Signed-off-by: Michal Simek michal.simek@xilinx.com
Can you please rebase this and the rest of the series on top of master again? And please cc Simon when you repost, thanks!
There are new patches from Simon. Siva will look at it and try to validate them on our platforms.
Thanks, Michal
participants (2)
-
Michal Simek
-
Tom Rini