[U-Boot] [PATCH 0/19] Remove unused code, add accurate timier and bootstage

Simon Glass sjg at chromium.org
Fri Apr 26 00:12:39 CEST 2013


Hi Vadim,

On Thu, Apr 18, 2013 at 8:50 AM, Vadim Bendebury (вб)
<vbendeb at google.com> wrote:
>  On Wed, Apr 17, 2013 at 7:13 PM, Simon Glass <sjg at chromium.org> wrote:
>>
>> This series removes unused x86 code based on advice from Graeme Russ. THis
>> code was used for real mode which is no longer needed in U-Boot.
>>
>> A new more accurate timer is added, and this permits bootstage to be
>> enabled and produce useful results on x86.
>>
>>
>> Doug Anderson (2):
>>   bootstage: Copy bootstage strings post-relocation
>>   Call bootstage_relocate() after malloc is initted
>>
>> Simon Glass (17):
>>   x86: Remove unused bios/pci code
>>   x86: Remove unused portion of link script
>>   x86: Remove legacy board init code
>>   x86: Declare global_data pointer when it is used
>>   x86: Implement panic output for coreboot
>>   x86: Rationalise kernel booting logic and bootstage
>>   x86: Add TSC timer
>>   x86: Remove old broken timer implementation
>>   x86: Remove ISR timer
>>   x86: Re-enable PCAT timer 2 for beeping
>>   bootstage: Add stubs for new bootstage functions
>>   x86: Enable bootstage for coreboot
>>   bootstage: Allow marking a particular line of code
>>   x86: Fix warning in cmd_ximg.c when CONFIG_GZIP is not defined
>>   x86: config: Enable LZO for coreboot, remove zlib, gzip
>>   x86: Support adding coreboot timestanps to bootstage
>>   x86: Add coreboot timestamps
>>
>>  arch/x86/cpu/Makefile                          |   2 +-
>>  arch/x86/cpu/coreboot/coreboot.c               |  13 ++
>>  arch/x86/cpu/coreboot/timestamp.c              |  42 +++-
>>  arch/x86/cpu/cpu.c                             |   5 +
>>  arch/x86/cpu/interrupts.c                      |   2 +
>>  arch/x86/cpu/timer.c                           |  17 --
>>  arch/x86/cpu/u-boot.lds                        |  12 --
>>  arch/x86/include/asm/arch-coreboot/timestamp.h |   7 +
>>  arch/x86/include/asm/init_helpers.h            |   9 -
>>  arch/x86/include/asm/init_wrappers.h           |  42 ----
>>  arch/x86/include/asm/pci.h                     |   4 -
>>  arch/x86/include/asm/u-boot-x86.h              |   4 +
>>  arch/x86/include/asm/u-boot.h                  |  32 ---
>>  arch/x86/lib/Makefile                          |  10 +-
>>  arch/x86/lib/bios.h                            | 170 ---------------
>>  arch/x86/lib/board.c                           | 273 -------------------------
>>  arch/x86/lib/bootm.c                           |   8 -
>>  arch/x86/lib/cmd_boot.c                        |   2 +
>>  arch/x86/lib/init_helpers.c                    |  98 ---------
>>  arch/x86/lib/init_wrappers.c                   | 164 ---------------
>>  arch/x86/lib/pcat_timer.c                      |  69 +------
>>  arch/x86/lib/pci.c                             | 188 -----------------
>>  arch/x86/lib/physmem.c                         |   2 +
>>  arch/x86/lib/relocate.c                        |   2 +
>>  arch/x86/lib/timer.c                           | 116 -----------
>>  arch/x86/lib/tsc_timer.c                       | 107 ++++++++++
>>  arch/x86/lib/zimage.c                          |  11 +-
>>  common/board_r.c                               |   1 +
>>  common/bootstage.c                             |  44 ++++
>>  common/cmd_ximg.c                              |   2 +
>>  include/bootstage.h                            |  54 +++++
>>  include/configs/coreboot.h                     |  18 +-
>>  32 files changed, 314 insertions(+), 1216 deletions(-)
>>  delete mode 100644 arch/x86/cpu/timer.c
>>  delete mode 100644 arch/x86/include/asm/init_wrappers.h
>>  delete mode 100644 arch/x86/lib/bios.h
>>  delete mode 100644 arch/x86/lib/board.c
>>  delete mode 100644 arch/x86/lib/init_wrappers.c
>>  delete mode 100644 arch/x86/lib/pci.c
>>  delete mode 100644 arch/x86/lib/timer.c
>>  create mode 100644 arch/x86/lib/tsc_timer.c
>>
>> --
>> 1.8.2.1
>>
>
> Simon, just out of curiosity: how was this tested, on what platforms,
> what procedure was followed, etc.

I used the time command to test that the time seems about right, by
timing for 10 seconds and comparing against a stopwatch:

boot > time sleep 10

time: 10.000 seconds, 10000 ticks

Also I obtained a bootstage report which looked fairly sane:

boot > bootstage report
Timer summary in microseconds:
       Mark    Elapsed  Stage
          0          0  reset
  1,028,998  1,028,998  board_init_f
  1,035,680      6,682  board_init_r
  1,092,769     57,089  id=64
  1,094,506      1,737  main_loop

Accumulated time:

All testing was done on link only.

Regards,
Simon


More information about the U-Boot mailing list