aboutsummaryrefslogtreecommitdiff
path: root/include/bootstage.h
AgeCommit message (Collapse)AuthorFilesLines
2021-07-07bootstage: Eliminate when not enabledTom Rini1-1/+3
When we do not have bootstage enabled, rather than include an empty dummy function, we just don't reference it. This saves us space in some tight builds. This also shows a few cases where show_boot_progress was incorrectly guarded before. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-09bootstage: Fix 'stacked' typoSimon Glass1-1/+1
This should be 'stashed'. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-05-18bootstage: Use BOOTSTAGE instead of BOOTSTATESimon Glass1-5/+5
Some of the enum members are wrong. Fix them. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-12-15x86: fsp: Add FSP2 base supportSimon Glass1-0/+3
Add support for some important configuration options and FSP memory init. The memory init uses swizzle tables from the device tree. Support for the FSP_S binary is also included. Bootstage timing is used for both FSP_M and FSP_S and memory-mapped SPI reads. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-27bootstage: Mark the start/end of TPL and SPL separatelySimon Glass1-0/+2
At present bootstage in TPL and SPL use the same ID so it is not possible to see the timing of each. Separate out the IDs and use the correct one depending on which phase we are at. Example output: Timer summary in microseconds (14 records): Mark Elapsed Stage 0 0 reset 224,787 224,787 TPL 282,248 57,461 end TPL 341,067 58,819 SPL 925,436 584,369 end SPL 931,710 6,274 board_init_f 1,035,482 103,772 board_init_r 1,387,852 352,370 main_loop 1,387,911 59 id=175 Accumulated time: 196 dm_r 8,300 dm_spl 14,139 dm_f 229,121 fsp-m 262,992 fsp-s Signed-off-by: Simon Glass <sjg@chromium.org>
2019-04-26main: add new bootstage ID for entering cli loopHeiko Schocher1-0/+1
adding a new bootstage ID: BOOTSTAGE_ID_ENTER_CLI_LOOP Signed-off-by: Heiko Schocher <hs@denx.de>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-16bootstage: Drop unused optionsSimon Glass1-6/+0
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 <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-06-05bootstage: Record time taken to set up the live device treeSimon Glass1-0/+1
This time is interesting as a comparision with the flat device tree time. Add it to the record. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Support SPLSimon Glass1-3/+12
At present bootstage only supports U-Boot proper. But SPL can also consume boot time so it is useful to have the record start there. Add bootstage support to SPL. Also support stashing the timing information when SPL finishes so that it can be picked up and reported by U-Boot proper. This provides a full boot time record, excluding only the time taken by the boot ROM. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Adjust to use const * where possibleSimon Glass1-2/+2
There are a few places that should use const *, such as bootstage_unstash(). Update these to make it clearer when parameters are changed. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Tidy up error return valuesSimon Glass1-1/+3
We should return a proper error number instead of just -1. This helps the caller to determine what when wrong. Update a few functions to fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Record the time taken to set up driver modelSimon Glass1-0/+2
Driver model is set up ones before relocation and once after. Record the time taken in each case. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Support relocating boostage dataSimon Glass1-0/+12
Some boards cannot access pre-relocation data after relocation. Reserve space for this and copy it during preparation for relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Fix up code style and commentsSimon Glass1-4/+4
There are several code style and comment nits. Fix them and also remove the comment about passing bootstage to the kernel being TBD. This is already supported. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Convert to use malloc()Simon Glass1-0/+13
At present bootstage uses the data section of the image to store its information. There are a few problems with this: - It does not work on all boards (e.g. those which run from flash before relocation) - Allocated strings still point back to the pre-relocation data after relocation Now that U-Boot has a pre-relocation malloc() we can use this instead, with a pointer to the data in global_data. Update bootstage to do this and set up an init routine to allocate the memory. Now that we have a real init function, we can drop the fake 'reset' record and add a normal one instead. Note that part of the problem with allocated strings remains. They are reallocated but this will only work where pre-relocation memory is accessible after relocation. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-05bootstage: Require timer_get_boot_us() to be definedSimon Glass1-1/+2
At present we provide a default version of this function for use by bootstage. However it uses the system timer and therefore likely requires driver model. This makes it impossible to time driver-model init. Drop the function and require boards to provide their own. Add a sandbox version also. There is a default implememtation in lib/time.c for boards which use CONFIG_SYS_TIMER_COUNTER. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-06-09bootstage: call show_boot_progress also in SPLHeiko Schocher1-3/+3
show_boot_progress() is now called from SPL also. Signed-off-by: Heiko Schocher <hs@denx.de>
2016-05-24image: Add boot_get_fpga() to load fpga with bootmMichal Simek1-0/+1
Add function boot_get_fpga() which find and load bitstream to programmable logic if fpga entry is present. Function is supported on Xilinx devices for full and partial bitstreams in BIN and BIT format. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Remove additional blankline in image.h
2015-05-28add boot_get_loadables() to load listed imagesKarl Apsite1-0/+1
Added a trimmed down instance of boot_get_<thing>() to satisfy the minimum requierments of the added feature. The function follows the normal patterns set by other boot_get<thing>'s, which should make it a bit easier to combine them all together into one boot_get_image() function in a later refactor. Documentation for the new function can be found in source: include/image.h Signed-off-by: Karl Apsite <Karl.Apsite@dornerworks.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-05-14bootstage: Add IDs for SPI flash reading and decompressionSimon Glass1-0/+2
We maintain an accumulator for time spent reading from SPI flash, since this can be significant on some platforms. Also add one for decompression time. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Jagan Teki <jteki@openedev.com>
2015-04-18Kconfig: Move CONFIG_BOOTSTAGE to KconfigSimon Glass1-1/+1
Move CONFIG_BOOT_STAGE and its associated options to Kconfig. Adjust existing users and code. Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-06bootstage: Fix typos in the commentBin Meng1-2/+2
There are two typos in the comment block in bootstage.h, fix them. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2015-02-06scsi: bootstage: Measure time taken to scan the busSimon Glass1-0/+1
On some hardware this time can be significant. Add bootstage support for measuring this. The result can be obtained using 'bootstage report' or passed on to the Linux via the device tree. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-10-22x86: Support loading kernel setup from a FITSimon Glass1-0/+3
Add a new setup@ section to the FIT which can be used to provide a setup binary for booting Linux on x86. This makes it possible to boot x86 from a FIT. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-08-15bootstage: get more BOOTSTAGE_ID* in show_boot_progress()Heiko Schocher1-0/+1
In case CONFIG_BOOTSTAGE is not defined, call from bootstage_mark_name() show_boot_progress(), so get more BOOTSTAGE_ID* ids in show_boot_progress() if CONFIG_BOOTSTAGE is not defined. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@ti.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Acked-by: Simon Glass <sjg@chromium.org>
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk1-16/+1
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
2013-06-04bootstage: Remove unused entries related to kernel/ramdisk/fdt loadSimon Glass1-26/+3
Now that the code for loading these three images from a FIT is common, we don't need individual boostage IDs for each of them. Note: there are some minor changes in the bootstage numbering, particuarly for kernel loading. I don't believe this matters. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-06-04bootstage: Introduce sub-IDs for use with image loadingSimon Glass1-0/+22
Loading a ramdisk, kernel or FDT goes through similar stages. Create a block of IDs for each task, and define a consistent numbering within the block. This will allow use of common code for image loading. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-14bootstage: Don't build for HOSTCCSimon Glass1-2/+3
We don't measure boot timing on the host, or with SPL, so use both conditions in the bootstage header. This allows us to avoid using conditional compilation around bootstage_...() calls. (#ifdef) Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-13bootstage: Allow marking a particular line of codeSimon Glass1-0/+23
Add a function which allows a (file, function, line number) to be marked in bootstage. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
2013-05-13bootstage: Copy bootstage strings post-relocationDoug Anderson1-0/+15
Any pointers to name strings that were passed to bootstage_mark_name() pre-relocation should be copied post-relocation so that they don't get trashed as the original location of U-Boot is re-used for other purposes. This change introduces a new API call that should be called from board_init_r() after malloc has been initted on any board that uses bootstage. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2013-05-13bootstage: Add stubs for new bootstage functionsSimon Glass1-0/+16
Some functions don't have a stub for when CONFIG_BOOTSTAGE is not defined. Add one to avoid #ifdefs in the code when this is used in U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
2012-10-15Merge branch 'agust@denx.de-next' of git://git.denx.de/u-boot-stagingTom Rini1-0/+85
2012-10-03bootstage: Add new bootstage IDs for board, LCDSimon Glass1-0/+5
Add bootstage IDs for board init and LCD. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-10-03bootstage: Add feature to stash/unstash bootstage infoSimon Glass1-0/+29
It is useful to be able to write the bootstage information to memory for use by a later utility, or the Linux kernel. Provide a function to do this as well as a function to read bootstage information back and incorporate it into the current table. This also makes it possible for U-Boot to chain to another U-Boot and pass on its bootstage information. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-10-02bootstage: Store boot timings in device treeSimon Glass1-0/+7
Add an option, CONFIG_BOOTSTAGE_FDT to pass boot timings to the kernel in the device tree, if available. To use this, you must have CONFIG_OF_LIBFDT defined. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-10-02bootstage: Add time accumulation featureSimon Glass1-0/+27
Sometimes we want to add up the amount of time spent in a particular activity when it is happening in a number of discrete chunks. Add bootstage_start() to mark the start of an acitivity and bootstage_accum() to accumulate the time since the last start. Calling these function in pairs results in the accumulated time being collected. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-10-02bootstage: Export bootstage_add_record() functionSimon Glass1-0/+17
This function is not static, but not exported either. Add a prototype in the header file and move the required enum to the header also. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-10-01OMAP: networking support for SPLIlya Yanok1-1/+5
This patch adds support for networking in SPL. Some devices are capable of loading SPL via network so it makes sense to load the main U-Boot binary via network too. This patch tries to use existing network code as much as possible. Unfortunately, it depends on environment which in turn depends on other code so SPL size is increased significantly. No effort was done to decouple network code and environment so far. Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Tom Rini <trini@ti.com>
2012-04-10Move bootstage timer out of lib/time.cSimon Glass1-0/+7
The standalone example does not have get_timer() defined, so we cannot rely on it being available. Move the timer function into boootstage.c to avoid this problem. This corrects a build breakage for the standalone example on some boards. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Matthias Fuchs <matthias.fuchs@esd.eu>
2012-03-18bootstage: Implement core microsecond boot time measurementSimon Glass1-0/+43
This defines the basics of a new boot time measurement feature. This allows logging of very accurate time measurements as the boot proceeds, by using an available microsecond counter. To enable the feature, define CONFIG_BOOTSTAGE in your board config file. Also available is CONFIG_BOOTSTAGE_REPORT which will cause a report to be printed just before handing off to the OS. Most IDs are not named at this stage. For that I would first like to renumber them all. Timer summary in microseconds: Mark Elapsed Stage 0 0 reset 205,000 205,000 board_init_f 6,053,000 5,848,000 bootm_start 6,053,000 0 id=1 6,058,000 5,000 id=101 6,058,000 0 id=100 6,061,000 3,000 id=103 6,064,000 3,000 id=104 6,093,000 29,000 id=107 6,093,000 0 id=106 6,093,000 0 id=105 6,093,000 0 id=108 7,089,000 996,000 id=7 7,089,000 0 id=15 7,089,000 0 id=8 7,097,000 8,000 start_kernel Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Replace show_boot_progress/error() with bootstage_...()Simon Glass1-2/+28
These calls should not be made directly any more, since bootstage will call the show_boot_...() functions as needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Convert FIT progress numbers to enumsSimon Glass1-0/+38
This changes over all the FIT image progress numbers to use enums from bootstage.h. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Convert net progress numbers to enumsSimon Glass1-0/+11
This changes over the network-related progress numbers to use enums from bootstage.h. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Convert NAND progress numbers to enumsSimon Glass1-0/+15
This changes over the NAND progress numbers to use enums from bootstage.h. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Convert IDE progress numbers to enumsSimon Glass1-0/+14
This changes over the IDE progress numbers to use enums from bootstage.h. Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Convert progress numbers 20-41 to enumsSimon Glass1-0/+25
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18bootstage: Convert progress numbers 10-19 to enumsSimon Glass1-0/+7
Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-18bootstage: Convert progress numbers 1-9 into enumsSimon Glass1-0/+14
Signed-off-by: Simon Glass <sjg@chromium.org>