diff mbox series

[13/13] rockchip: rk3288-tinker: Change to use FIT

Message ID 20241105160054.1373319-14-jonas@kwiboo.se
State New
Headers show
Series rockchip: rk3288-tinker: Migrate to OF_UPSTREAM | expand

Commit Message

Jonas Karlman Nov. 5, 2024, 4 p.m. UTC
Change to use FIT and FIT_SIGNATURE when loading U-Boot proper in SPL to
allow checksum validation and fallback loading of FIT from a different
mmc device.

Checksum validation of FIT adds around 140 ms to boot time:

Before:

       Mark    Elapsed  Stage
          0          0  reset
         13         13  TPL
      6,957      6,944  end tpl
     25,102     18,145  SPL
    131,932    106,830  end phase
    132,137        205  board_init_f
    444,277    312,140  board_init_r
  1,404,987    960,710  eth_common_init
  1,519,110    114,123  eth_initialize
  1,524,734      5,624  main_loop
  1,525,452        718  cli_loop

After:

       Mark    Elapsed  Stage
          0          0  reset
         13         13  TPL
      6,957      6,944  end tpl
     35,744     28,787  SPL
    271,220    235,476  end phase
    271,420        200  board_init_f
    588,474    317,054  board_init_r
  1,548,950    960,476  eth_common_init
  1,663,105    114,155  eth_initialize
  1,668,734      5,629  main_loop
  1,669,417        683  cli_loop

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 configs/tinker-rk3288_defconfig   | 7 +++++++
 configs/tinker-s-rk3288_defconfig | 7 +++++++
 2 files changed, 14 insertions(+)

Comments

Kever Yang Nov. 6, 2024, 10:23 a.m. UTC | #1
On 2024/11/6 00:00, Jonas Karlman wrote:
> Change to use FIT and FIT_SIGNATURE when loading U-Boot proper in SPL to
> allow checksum validation and fallback loading of FIT from a different
> mmc device.
>
> Checksum validation of FIT adds around 140 ms to boot time:
>
> Before:
>
>         Mark    Elapsed  Stage
>            0          0  reset
>           13         13  TPL
>        6,957      6,944  end tpl
>       25,102     18,145  SPL
>      131,932    106,830  end phase
>      132,137        205  board_init_f
>      444,277    312,140  board_init_r
>    1,404,987    960,710  eth_common_init
>    1,519,110    114,123  eth_initialize
>    1,524,734      5,624  main_loop
>    1,525,452        718  cli_loop
>
> After:
>
>         Mark    Elapsed  Stage
>            0          0  reset
>           13         13  TPL
>        6,957      6,944  end tpl
>       35,744     28,787  SPL
>      271,220    235,476  end phase
>      271,420        200  board_init_f
>      588,474    317,054  board_init_r
>    1,548,950    960,476  eth_common_init
>    1,663,105    114,155  eth_initialize
>    1,668,734      5,629  main_loop
>    1,669,417        683  cli_loop
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   configs/tinker-rk3288_defconfig   | 7 +++++++
>   configs/tinker-s-rk3288_defconfig | 7 +++++++
>   2 files changed, 14 insertions(+)
>
> diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
> index 05dca105d609..bc5379d43430 100644
> --- a/configs/tinker-rk3288_defconfig
> +++ b/configs/tinker-rk3288_defconfig
> @@ -17,9 +17,15 @@ CONFIG_DEBUG_UART_BASE=0xff690000
>   CONFIG_DEBUG_UART_CLOCK=24000000
>   CONFIG_DEBUG_UART=y
>   # CONFIG_ANDROID_BOOT_IMAGE is not set
> +CONFIG_FIT=y
> +CONFIG_FIT_VERBOSE=y
> +CONFIG_SPL_FIT_SIGNATURE=y
> +CONFIG_SPL_LOAD_FIT=y
> +CONFIG_LEGACY_IMAGE_FORMAT=y
>   CONFIG_DEFAULT_FDT_FILE="rockchip/rk3288-tinker.dtb"
>   CONFIG_MISC_INIT_R=y
>   CONFIG_SPL_PAD_TO=0x7f8000
> +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
>   CONFIG_CMD_GPIO=y
>   CONFIG_CMD_GPT=y
>   CONFIG_CMD_I2C=y
> @@ -91,4 +97,5 @@ CONFIG_VIDEO_ROCKCHIP=y
>   CONFIG_DISPLAY_ROCKCHIP_HDMI=y
>   CONFIG_CONSOLE_SCROLL_LINES=10
>   CONFIG_CMD_DHRYSTONE=y
> +CONFIG_SPL_CRC32=y
>   CONFIG_ERRNO_STR=y
> diff --git a/configs/tinker-s-rk3288_defconfig b/configs/tinker-s-rk3288_defconfig
> index 1bee0d094c8d..f0c8cc5bbc1b 100644
> --- a/configs/tinker-s-rk3288_defconfig
> +++ b/configs/tinker-s-rk3288_defconfig
> @@ -17,9 +17,15 @@ CONFIG_DEBUG_UART_BASE=0xff690000
>   CONFIG_DEBUG_UART_CLOCK=24000000
>   CONFIG_DEBUG_UART=y
>   # CONFIG_ANDROID_BOOT_IMAGE is not set
> +CONFIG_FIT=y
> +CONFIG_FIT_VERBOSE=y
> +CONFIG_SPL_FIT_SIGNATURE=y
> +CONFIG_SPL_LOAD_FIT=y
> +CONFIG_LEGACY_IMAGE_FORMAT=y
>   CONFIG_DEFAULT_FDT_FILE="rockchip/rk3288-tinker-s.dtb"
>   CONFIG_MISC_INIT_R=y
>   CONFIG_SPL_PAD_TO=0x7f8000
> +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
>   CONFIG_CMD_GPIO=y
>   CONFIG_CMD_GPT=y
>   CONFIG_CMD_I2C=y
> @@ -91,4 +97,5 @@ CONFIG_VIDEO_ROCKCHIP=y
>   CONFIG_DISPLAY_ROCKCHIP_HDMI=y
>   CONFIG_CONSOLE_SCROLL_LINES=10
>   CONFIG_CMD_DHRYSTONE=y
> +CONFIG_SPL_CRC32=y
>   CONFIG_ERRNO_STR=y
diff mbox series

Patch

diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
index 05dca105d609..bc5379d43430 100644
--- a/configs/tinker-rk3288_defconfig
+++ b/configs/tinker-rk3288_defconfig
@@ -17,9 +17,15 @@  CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3288-tinker.dtb"
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_PAD_TO=0x7f8000
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -91,4 +97,5 @@  CONFIG_VIDEO_ROCKCHIP=y
 CONFIG_DISPLAY_ROCKCHIP_HDMI=y
 CONFIG_CONSOLE_SCROLL_LINES=10
 CONFIG_CMD_DHRYSTONE=y
+CONFIG_SPL_CRC32=y
 CONFIG_ERRNO_STR=y
diff --git a/configs/tinker-s-rk3288_defconfig b/configs/tinker-s-rk3288_defconfig
index 1bee0d094c8d..f0c8cc5bbc1b 100644
--- a/configs/tinker-s-rk3288_defconfig
+++ b/configs/tinker-s-rk3288_defconfig
@@ -17,9 +17,15 @@  CONFIG_DEBUG_UART_BASE=0xff690000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_LEGACY_IMAGE_FORMAT=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3288-tinker-s.dtb"
 CONFIG_MISC_INIT_R=y
 CONFIG_SPL_PAD_TO=0x7f8000
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -91,4 +97,5 @@  CONFIG_VIDEO_ROCKCHIP=y
 CONFIG_DISPLAY_ROCKCHIP_HDMI=y
 CONFIG_CONSOLE_SCROLL_LINES=10
 CONFIG_CMD_DHRYSTONE=y
+CONFIG_SPL_CRC32=y
 CONFIG_ERRNO_STR=y