[PATCH v4 0/4] support for booting the compressed U-boot binary on Rockchip based ARM64 SOC's

Manoj Sai abbaraju.manojsai at amarulasolutions.com
Sun Sep 17 21:26:24 CEST 2023


This patchset adds the support on Rockchip based ARM64 SOC's that  compress the U-BOOT proper along with dtb
and ATF in FIT image format.Second stage bootloader(SPL) loads the compressed binaries, uncompress
them and  handover control to the next stage.

Changes for V3 :-

1. Replaced spl_decompression_enabled() function instead of checking IS_ENABLED(CONFIG_SPL_GZIP)
   and IS_ENABLED(CONFIG_SPL_LZMA) in spl_fit.c.

2. Removed extra wrapping parentheses in spl_decompression_enabled().

Changes for V4 :-

1. As per the suggestion from Mr.Jonas Karlman (jonas at kwiboo.se) from  PATCH v2 and v3 ,check boot time
   with the following RFC patch  with CONFIG_SPL_FIT_SIGNATURE enabled that might impact boot time and
   As seen there is an improvement in boot time with both compress enabled and disabled ,
   I have added the logs of it below.

    [RFC] rockchip: spl: Enable caches to speed up checksum validation
    https://patchwork.ozlabs.org/project/uboot/patch/20230702110055.3686457-1-jonas@kwiboo.se/

Size Comparision between compressed and uncompressed binaries :-

       size of uncompressed binary    :- 9.0M (94,21,824 bytes)
         manoj:u-boot$ ls -lb u-boot-rockchip.bin
        -rw-rw-r-- 1 manoj manoj 9421824 Sep 10 22:22 u-boot-rockchip.bin

       size of GZIP compressed binary :- 8.6M (89,85,088 bytes)
         manoj:u-boot$ ls -lb u-boot-rockchip.bin
         -rw-rw-r-- 1 manoj manoj 8985088 Jul 25 07:42 u-boot-rockchip.bin

       size of LZMA compressed binary :- 8.6 M (90,06,592 bytes)
         manoj:u-boot$ ls -lb u-boot-rockchip.bin
         -rw-rw-r-- 1 manoj manoj 9006592 Jul 25 07:47 u-boot-rockchip.bin

Test results of  Booting time using bootstage command in Uboot command prompt on roc-rk3399-pc board :-

1) Uncompressed U-BOOT : Total boot time = 12.063971 seconds
=> bootstage report
Timer summary in microseconds (10 records):
       Mark    Elapsed  Stage
          0          0  reset
  1,833,884  1,833,884  board_init_f
  2,959,528  1,125,644  board_init_r
  5,224,521  2,264,993  eth_common_init
  5,523,428    298,907  eth_initialize
  5,523,606        178  main_loop
  5,523,764        158  usb_start
 12,063,971  6,540,207  cli_loop

2) GZIP Compressed U-BOOT : Total time = 12.824968 seconds

=> bootstage report
Timer summary in microseconds (10 records):
       Mark    Elapsed  Stage
          0          0  reset
  2,594,709  2,594,709  board_init_f
  3,719,969  1,125,260  board_init_r
  5,985,450  2,265,481  eth_common_init
  6,284,371    298,921  eth_initialize
  6,284,549        178  main_loop
  6,284,708        159  usb_start
 12,824,968  6,540,260  cli_loop

3) LZMA Compressed U-BOOT : Total time = 17.025004 seconds

=> bootstage report
Timer summary in microseconds (10 records):
       Mark    Elapsed  Stage
          0          0  reset
  6,852,254  6,852,254  board_init_f
  7,940,143  1,087,889  board_init_r
 10,190,458  2,250,315  eth_common_init
 10,487,254    296,796  eth_initialize
 10,487,432        178  main_loop
 10,487,590        158  usb_start
 17,025,004  6,537,414  cli_loop



Test results of  booting time using RFC patch from Mr.Jonas Karlman(jonas at kwiboo.se)
with CONFIG_SPL_FIT_SIGNATURE enabled  on  roc-rk3399-pc board :-

1. Uncompressed U-BOOT : Total boot time =  10.728 seconds
=> bootstage report
Timer summary in microseconds (10 records):
       Mark    Elapsed  Stage
          0          0  reset
    477,024    477,024  board_init_f
  1,623,670  1,146,646  board_init_r
  3,889,493  2,265,823  eth_common_init
  4,188,402    298,909  eth_initialize
  4,188,579        177  main_loop
  4,188,738        159  usb_start
 10,728,000  6,539,262  cli_loop

2. GZIP Compressed U-BOOT : Total time =  10.708 seconds
=> bootstage report
Timer summary in microseconds (10 records):
       Mark    Elapsed  Stage
          0          0  reset
    457,663    457,663  board_init_f
  1,604,222  1,146,559  board_init_r
  3,869,505  2,265,283  eth_common_init
  4,168,410    298,905  eth_initialize
  4,168,587        177  main_loop
  4,168,745        158  usb_start
 10,707,997  6,539,252  cli_loop

3. LZMA Compressed U-BOOT : Total time =   10.86 seconds
=> bootstage report
Timer summary in microseconds (10 records):
       Mark    Elapsed  Stage
          0          0  reset
    612,427    612,427  board_init_f
  1,756,176  1,143,749  board_init_r
  4,021,522  2,265,346  eth_common_init
  4,320,433    298,911  eth_initialize
  4,320,610        177  main_loop
  4,320,768        158  usb_start
 10,860,001  6,539,233  cli_loop

As I can seen there is an improvement in boot time with Enable caches in SPL to speed up FIT checksum validation,
with the following RFC patch from  Mr.Jonas.
[RFC] rockchip: spl: Enable caches to speed up checksum validation
https://patchwork.ozlabs.org/project/uboot/patch/20230702110055.3686457-1-jonas@kwiboo.se/

Manoj Sai (4):
  spl: fit: support for booting a GZIP-compressed U-boot binary
  spl: fit: support for booting a LZMA-compressed U-boot binary
  rockchip: Add support to generate GZIP compressed U-boot binary
  rockchip: Add support to generate LZMA compressed U-boot binary

 arch/arm/dts/rockchip-u-boot.dtsi | 11 +++++++++++
 common/spl/spl_fit.c              | 20 +++++++++++++++++---
 include/spl.h                     | 10 ++++++++++
 3 files changed, 38 insertions(+), 3 deletions(-)

-- 
2.25.1



More information about the U-Boot mailing list