-
Notifications
You must be signed in to change notification settings - Fork 1
fastboot: Add "fastboot device" command for runtime block device selection #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rk3576
Are you sure you want to change the base?
Conversation
| #if CONFIG_IS_ENABLED(FASTBOOT_FLASH_BLOCK) | ||
| #include <fb_block.h> | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No conditionals around headers usually
| #if IS_ENABLED(CONFIG_TCP_FUNCTION_FASTBOOT) | ||
| " | tcp" | ||
| #endif | ||
| #if IS_ENABLED(CONFIG_UDP_FUNCTION_FASTBOOT) | ||
| " | udp" | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does checkpatch.pl think about all this beauty? :)
| /** | ||
| * fastboot_block_interface - runtime block interface name | ||
| */ | ||
| static char fastboot_block_interface[16]; | ||
|
|
||
| /** | ||
| * fastboot_block_device - runtime block device ID | ||
| */ | ||
| static int fastboot_block_device = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way to achieve this without global variables?
| { | ||
| if (*fastboot_block_interface) | ||
| return fastboot_block_interface; | ||
| return config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line between an if statement and the following code
| { | ||
| if (fastboot_block_device >= 0) | ||
| return fastboot_block_device; | ||
| return config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
cb1565d to
9cc3c2d
Compare
…ction Add the ability to change the fastboot flash target device at runtime without recompiling. This is useful for: - Platforms with multiple storage options (eMMC + UFS + NVMe) - Development and testing scenarios - Recovery situations where the default device is unavailable New command syntax: fastboot device <interface> <dev> - set flash interface and device fastboot device - show current interface and device Implementation details: - Add fastboot_block_set_interface() and fastboot_block_set_device() functions to set runtime values - Add fastboot_block_get_interface() and fastboot_block_get_device() getters that return runtime value if set, otherwise fall back to Kconfig defaults - Update fb_block.c to use the new getter functions - Add command handler gated by CONFIG_FASTBOOT_FLASH_BLOCK Example usage: => fastboot device scsi 0 Set fastboot block interface to 'scsi', device to 0 => fastboot usb 0 (now flashing targets SCSI device 0 instead of default) Change-Id: 7b54f839-5659-4aaf-b58f-d6107e08a24d Signed-off-by: Anton Burticica <mouse@ya.ru>
9cc3c2d to
7b9f96a
Compare
Add the ability to change the fastboot flash target device at runtime without recompiling. This is useful for:
New command syntax:
fastboot device - set flash interface and device
fastboot device - show current interface and device
Implementation details:
Example usage:
=> fastboot device scsi 0 Set fastboot block interface to 'scsi', device to 0 => fastboot usb 0 (now flashing targets SCSI device 0 instead of default)
Change-Id: 7b54f839-5659-4aaf-b58f-d6107e08a24d