Power & Source of Big Ideas

Fast boot & Uboot

Moderators: chensy, FATechsupport

Hi,

I use nanoPi M4 board and I work to improve the boot time. Initially the friendlycore image takes 28sec to start, now I can start image in 12sec (kernel and distribution optimization).

I have one way to save time : uboot

Code: Select all

[0.668417 0.000026] U-Boot 2014.10-RK3399-06-ga6e7a35-dirty (Mar 31 2020 - 01:31:28)
[0.669340 0.000923]
[0.669369 0.000029] CPU: rk3399
[0.669612 0.000243] cpu version = 0
[0.669812 0.000200] CPU's clock information:
[0.670168 0.000356]     aplll = 816000000HZ
[0.670568 0.000400]     apllb = 24000000HZ
[0.670923 0.000355]     gpll = 800000000HZ
[0.671284 0.000361]                aclk_periph_h = 133333333HZ, hclk_periph_h = 66666666HZ, pclk_periph_h = 33333333HZ
[0.672795 0.001511]                aclk_periph_l0 = 266666666HZ, hclk_periph_l0 = 88888888HZ, pclk_periph_l0 = 44444444HZ
[0.674369 0.001574]                hclk_periph_l1 = 100000000HZ, pclk_periph_l1 = 50000000HZ
[0.675516 0.001147]     cpll = 800000000HZ
[0.675954 0.000438]     dpll = 928000000HZ
[0.676365 0.000411]     vpll = 24000000HZ
[0.676793 0.000428]     npll = 24000000HZ
[0.677153 0.000360]     ppll = 676000000HZ
[0.677541 0.000388] Board:   Rockchip platform Board
[0.678045 0.000504] Uboot as second level loader
[0.678667 0.000622] DRAM:  Found dram banks: 1
[0.679125 0.000458] Adding bank:0000000000200000(000000007fe00000)
[0.685434 0.006309] Reserve memory for trust os.
[0.686027 0.000593] dram reserve bank: base = 0x08400000, size = 0x01e00000
[0.687237 0.001210] 128 MiB
[0.741251 0.054014] SdmmcInit = 0 0
[0.741616 0.000365] SDCard Boot.
[0.741741 0.000125] storage init OK!
[0.741931 0.000190] Using default environment
[0.742356 0.000425]
[0.742383 0.000027] GetParam
[0.757199 0.014816] Load FDT from resource image.
[0.757627 0.000428] no key node
[0.789087 0.031460] can't find dts node for fixed
[0.805443 0.016356] usb bc: can find node by path: /dwc-control-usb/usb_bc
[0.837966 0.032523] pmic:rk808
[0.838282 0.000316] can't find dts node for pwm1
[0.838897 0.000615] set pwm voltage ok,pwm_id =2 vol=1000000,pwm_value=33
[0.840033 0.001136] Can't find dts node for fuel guage cw201x
[0.840969 0.000936] can't find dts node for ec-battery
[0.841982 0.001013] Can't find dts node for charger bq25700
[0.842964 0.000982] invalide header tag
[0.843406 0.000442] ca head not found
[0.843837 0.000431] SecureBootEn = 0, SecureBootLock = 0
[0.844638 0.000801]
[0.844651 0.000013] #Boot ver: 2019-08-06#1.09
[0.845286 0.000635] empty serial no.
[0.845836 0.000550] normal boot.
[0.846106 0.000270] checkKey
[0.846306 0.000200] vbus = 1
[0.846518 0.000212] no fuel gauge found
[0.846952 0.000434] no fuel gauge found
[0.847418 0.000466] Rockchip UBOOT DRM driver version: develop-v1.0.0
[0.848536 0.001118] failed to find panel driver
[0.874764 0.026228] delay prepare[20] unprepare[0] enable[20] disable[0]
[0.875650 0.000886] read logo on state from dts [1]
[0.876196 0.000546] no fuel gauge found
[0.970523 0.094327] rockchip_panel_deinit: failed to find panel deinit funcs
[1.234578 0.264055] failed to find display timing
[1.234910 0.000332] Hit any key to stop autoboot:  0
[3.386902 2.151992] load fdt from resouce.
[3.412876 0.025974] error init vendor storage.
[3.413466 0.000590] vendor read error!
[3.413819 0.000353] Set oem_unlocked=0Secure Boot state: 0
[3.414525 0.000706] kernel   @ 0x00280000 (0x01086200)
[3.414923 0.000398] ramdisk  @ 0x04bf0000 (0x005fe3c0)
[3.415392 0.000469] bootrk: do_bootm_linux...
[3.415862 0.000470]    Loading Device Tree to 0000000004600000, end 000000000461c586 ... OK
[3.417545 0.001683] Add bank:0000000000200000, 0000000008200000
[3.419860 0.002315] Add bank:000000000a200000, 0000000075e00000
[3.463041 0.043181] WARNING: could not set reg FDT_ERR_BADOFFSET.
[3.463629 0.000588]
[3.463658 0.000029] Starting kernel ...


Do you know if :
1- I can load kernel directly from the preloader (and skip uboot) ? If yes, how can I do it ?
2- Or if I have a way to optimize uboot to avoid to spend 3 seconds ?

Note : I patched uboot to set the bootdelay to 0.

Thanks for your help.
GoblE wrote:
Hi,

I use nanoPi M4 board and I work to improve the boot time. Initially the friendlycore image takes 28sec to start, now I can start image in 12sec (kernel and distribution optimization).

I have one way to save time : uboot

Code: Select all

[0.668417 0.000026] U-Boot 2014.10-RK3399-06-ga6e7a35-dirty (Mar 31 2020 - 01:31:28)
[0.669340 0.000923]
[0.669369 0.000029] CPU: rk3399
[0.669612 0.000243] cpu version = 0
[0.669812 0.000200] CPU's clock information:
[0.670168 0.000356]     aplll = 816000000HZ
[0.670568 0.000400]     apllb = 24000000HZ
[0.670923 0.000355]     gpll = 800000000HZ
[0.671284 0.000361]                aclk_periph_h = 133333333HZ, hclk_periph_h = 66666666HZ, pclk_periph_h = 33333333HZ
[0.672795 0.001511]                aclk_periph_l0 = 266666666HZ, hclk_periph_l0 = 88888888HZ, pclk_periph_l0 = 44444444HZ
[0.674369 0.001574]                hclk_periph_l1 = 100000000HZ, pclk_periph_l1 = 50000000HZ
[0.675516 0.001147]     cpll = 800000000HZ
[0.675954 0.000438]     dpll = 928000000HZ
[0.676365 0.000411]     vpll = 24000000HZ
[0.676793 0.000428]     npll = 24000000HZ
[0.677153 0.000360]     ppll = 676000000HZ
[0.677541 0.000388] Board:   Rockchip platform Board
[0.678045 0.000504] Uboot as second level loader
[0.678667 0.000622] DRAM:  Found dram banks: 1
[0.679125 0.000458] Adding bank:0000000000200000(000000007fe00000)
[0.685434 0.006309] Reserve memory for trust os.
[0.686027 0.000593] dram reserve bank: base = 0x08400000, size = 0x01e00000
[0.687237 0.001210] 128 MiB
[0.741251 0.054014] SdmmcInit = 0 0
[0.741616 0.000365] SDCard Boot.
[0.741741 0.000125] storage init OK!
[0.741931 0.000190] Using default environment
[0.742356 0.000425]
[0.742383 0.000027] GetParam
[0.757199 0.014816] Load FDT from resource image.
[0.757627 0.000428] no key node
[0.789087 0.031460] can't find dts node for fixed
[0.805443 0.016356] usb bc: can find node by path: /dwc-control-usb/usb_bc
[0.837966 0.032523] pmic:rk808
[0.838282 0.000316] can't find dts node for pwm1
[0.838897 0.000615] set pwm voltage ok,pwm_id =2 vol=1000000,pwm_value=33
[0.840033 0.001136] Can't find dts node for fuel guage cw201x
[0.840969 0.000936] can't find dts node for ec-battery
[0.841982 0.001013] Can't find dts node for charger bq25700
[0.842964 0.000982] invalide header tag
[0.843406 0.000442] ca head not found
[0.843837 0.000431] SecureBootEn = 0, SecureBootLock = 0
[0.844638 0.000801]
[0.844651 0.000013] #Boot ver: 2019-08-06#1.09
[0.845286 0.000635] empty serial no.
[0.845836 0.000550] normal boot.
[0.846106 0.000270] checkKey
[0.846306 0.000200] vbus = 1
[0.846518 0.000212] no fuel gauge found
[0.846952 0.000434] no fuel gauge found
[0.847418 0.000466] Rockchip UBOOT DRM driver version: develop-v1.0.0
[0.848536 0.001118] failed to find panel driver
[0.874764 0.026228] delay prepare[20] unprepare[0] enable[20] disable[0]
[0.875650 0.000886] read logo on state from dts [1]
[0.876196 0.000546] no fuel gauge found
[0.970523 0.094327] rockchip_panel_deinit: failed to find panel deinit funcs
[1.234578 0.264055] failed to find display timing
[1.234910 0.000332] Hit any key to stop autoboot:  0
[3.386902 2.151992] load fdt from resouce.
[3.412876 0.025974] error init vendor storage.
[3.413466 0.000590] vendor read error!
[3.413819 0.000353] Set oem_unlocked=0Secure Boot state: 0
[3.414525 0.000706] kernel   @ 0x00280000 (0x01086200)
[3.414923 0.000398] ramdisk  @ 0x04bf0000 (0x005fe3c0)
[3.415392 0.000469] bootrk: do_bootm_linux...
[3.415862 0.000470]    Loading Device Tree to 0000000004600000, end 000000000461c586 ... OK
[3.417545 0.001683] Add bank:0000000000200000, 0000000008200000
[3.419860 0.002315] Add bank:000000000a200000, 0000000075e00000
[3.463041 0.043181] WARNING: could not set reg FDT_ERR_BADOFFSET.
[3.463629 0.000588]
[3.463658 0.000029] Starting kernel ...


Do you know if :
1- I can load kernel directly from the preloader (and skip uboot) ? If yes, how can I do it ?
2- Or if I have a way to optimize uboot to avoid to spend 3 seconds ?

Note : I patched uboot to set the bootdelay to 0.

Thanks for your help.


1. if its support, it should be described here http://opensource.rock-chips.com/wiki_Boot_option
2. probably
1- Thank you for the link. According this documentation there is no way to skip bootloader. I haven't time to write a bootloader, so I forget this solution.

2- I've studied uboot sequences, I can't optimize it directly : spent time is the time to load boot image (0.566233s) and kernel image (1.582596s). So I must remove unused features of the kernel to reduce boot time...

Who is online

In total there are 35 users online :: 0 registered, 0 hidden and 35 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 35 guests