Skip to content

Fastboot optimization - #3238

Merged
xiaoxiang781216 merged 4 commits into
apache:masterfrom
yangsong8-a1:fastboot
Dec 9, 2025
Merged

xiaoxiang781216 merged 4 commits into
apache:masterfrom
yangsong8-a1:fastboot

Conversation

@yangsong8-a1

Copy link
Copy Markdown
Contributor

Summary

If using TCP fastboot, an additional config is added so that the network can be initialized during fastboot initialization.
add an interface fastboot_handler. When nsh is not enabled, fastboot can be started directly through this interface.
add switchboot command.

Impact

For devices with strict boot time requirements, the network in bootloaders (BL) does not need to be initialized every time. It can be initialized when entering fastboot mode to save boot time. Therefore, a configuration similar to that for USB has been added to initialize the network during fastboot initialization.

Testing

PC: ubuntu 22.04.1
target: tricore device

$ fastboot -s tcp:169.254.65.143 getvar version
version: 12.3.0
Finished. Total time: 0.001s

$ fastboot -s tcp:169.254.65.143 flash core0_b vela_core0.bin
...
Sending sparse 'core0_b' 22/22 (32 KB)             OKAY [  0.003s]
Writing 'core0_b'                                  OKAY [  0.093s]
Finished. Total time: 3.636s

$ fastboot -s tcp:169.254.65.143 oem switchboot swap
                                                   OKAY [  0.001s]
Finished. Total time: 0.001s

$ fastboot -s tcp:169.254.65.143 reboot
Rebooting                                          OKAY [  0.000s]
Finished. Total time: 0.000s

Bring up the network when do fastboot tcp init.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
add an interface fastboot_handler. This interface can be called
when nsh is disable.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
The switchboot command can be sent even without enabling sh

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
apps/system/fastboot/fastboot.c:351:43: error: '%s' directive output may be truncated writing up to 63 bytes into a region of size 60 [-Werror=format-truncation=] ...... apps/system/fastboot/fastboot.c:351:3: note: 'snprintf' output between 5 and 68 bytes into a destination of size 64 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ apps/system/fastboot/fastboot.c:351:43: error: '%s' directive output may be truncated writing up to 63 bytes into a region of size 60 [-Werror=format-truncation=] ...... apps/system/fastboot/fastboot.c:351:3: note: 'snprintf' output between 5 and 68 bytes into a destination of size 64 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
@yangsong8-a1 yangsong8-a1 changed the title Fastboot Fastboot optimization Dec 8, 2025

@linguini1 linguini1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice optimization!

@cederom cederom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @yangsong8-a1 :-)

Lets just wait for the CI to complete :-)

@xiaoxiang781216
xiaoxiang781216 merged commit e19d990 into apache:master Dec 9, 2025
40 checks passed
@yangsong8-a1
yangsong8-a1 deleted the fastboot branch November 19, 2026 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants