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

Jonas Karlman jonas at kwiboo.se
Sun Sep 10 21:03:51 CEST 2023


Hi,

On 2023-09-10 20:24, Manoj Sai wrote:
> 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().
> 
> 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
> 
> 
> As per suggestion from Mr.Jonas Karlman (jonas at kwiboo.se) through Patchset V2,that check boot time
> with enabling CONFIG_SPL_FIT_SIGNATURE that might impact boot time.
> 
> Tried to check the boot time with CONFIG_FIT_SIGNATURE enabled, I didnt find any significant
> boot time improvement  with enabling CONFIG_SPL_FIT_SIGNATURE.

I may not have been that clear in my last mail, it is the following
rfc/patch that may improve performance. That prfc/patch does improve
performance for sha256 validation when CONFIG_SPL_FIT_SIGNATURE is
enabled.

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

Would be great to get confirmation if D-cache enabled in SPL also
benefit this series, and not just checksum validation.
(that rfc/patch unfortunately did not get much feedback)

Regards,
Jonas

> 
> Comparision of GZIP and LZMA compressed U-boot Boot time with and without Enable of CONFIG_FIT_SIGNATURE :-
> 
> - GZIP Compressed U-BOOT  and CONFIG_FIT_SIGNATURE enabled  :-  Total time ≈ 13.283998 seconds
> 
> => bootstage report
> Timer summary in microseconds (10 records):
>        Mark    Elapsed  Stage
>           0          0  reset
>   3,052,571  3,052,571  board_init_f
>   4,179,787  1,127,216  board_init_r
>   6,445,472  2,265,685  eth_common_init
>   6,744,416    298,944  eth_initialize
>   6,744,593        177  main_loop
>   6,744,751        158  usb_start
>  13,283,998  6,539,247  cli_loop
> 
> - GZIP Compressed U-BOOT and CONFIG_FIT_SIGNATURE disabled  :- Total time ≈ 12.824968 seconds
> 
> 
> - LZMA Compressed U-BOOT  and CONFIG_FIT_SIGNATURE enabled  :-  Total time ≈ 17.005996 seconds
> 
>    => bootstage report
> Timer summary in microseconds (10 records):
>        Mark    Elapsed  Stage
>           0          0  reset
>   6,775,071  6,775,071  board_init_f
>   7,902,443  1,127,372  board_init_r
>  10,167,546  2,265,103  eth_common_init
>  10,466,418    298,872  eth_initialize
>  10,466,595        177  main_loop
>  10,466,753        158  usb_start
>  17,005,996  6,539,243  cli_loop
> 
> - LZMA Compressed U-BOOT  and CONFIG_FIT_SIGNATURE disabled  :- Total time ≈ 17.025004 seconds
> 
> 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