summaryrefslogtreecommitdiff
path: root/drivers/fastboot/fb_common.c
AgeCommit message (Collapse)Author
2025-11-24fastboot: integrate block flashing back-endDmitrii Merkurev
1. Get partition info/size 2. Erase partition 3. Flash partition 4. BCB Make FASTBOOT_FLASH also depend on BLK, but make sure it doesn't affect SUNXI and ROCKCHIP platforms since they default to y already. Make it only default on SUNXI when MMC or NAND is enabled, so it doesn't break the CHIP & Nintendo boards, and for ROCKCHIP when MMC is enabled. Signed-off-by: Dmitrii Merkurev <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mattijs Korpershoek <[email protected]>
2025-04-10fastboot: lift restrictions on !NET_LWIP for USBMichael Walle
Fastboot works either over TCP, UDP or USB. The latter doesn't have anything to do with networking, thus should work just fine with regardless which network stack is selected. In practice, header symbols are used inside common code paths. Add some ifdeffery to guard against that. This will make fastboot over USB work with the new LWIP stack. Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Jerome Forissier <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mattijs Korpershoek <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-07fastboot: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Reviewed-by: Mattijs Korpershoek <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-04-18Revert "Merge patch series "pxe: Allow extlinux booting without CMDLINE ↵Tom Rini
enabled"" As reported by Jonas Karlman this series breaks booting on some AArch64 platforms with common use cases. For now the best path forward is to revert the series. This reverts commit 777c28460947371ada40868dc994dfe8537d7115, reversing changes made to ab3453e7b12daef47b9e91da2a2a3d48615dc6fc. Link: https://lore.kernel.org/u-boot/[email protected]/ Signed-off-by: Tom Rini <[email protected]>
2024-04-10fastboot: Remove dependencies on CMDLINESimon Glass
It is possible to boot a kernel without CMDLINE being enabled. Update the implementation to handle this, and drop the condition from the FASTBOOT config. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2024-04-10fastboot: Change fastboot_buf_addr to an addressSimon Glass
Given the name of this variable, it should be an address, not a pointer. Update this, to make it easier to use with sandbox. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Dmitrii Merkurev <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]> # on vim3
2023-11-16cmd: bcb: extend BCB C API to allow read/write the fieldsDmitrii Merkurev
Currently BCB C API only allows to modify 'command' BCB field. Extend it so that we can also read and modify all the available BCB fields (command, status, recovery, stage). Co-developed-by: Cody Schuffelen <[email protected]> Signed-off-by: Cody Schuffelen <[email protected]> Signed-off-by: Dmitrii Merkurev <[email protected]> Cc: Eugeniu Rosca <[email protected]> Cc: Ying-Chun Liu (PaulLiu) <[email protected]> Cc: Simon Glass <[email protected]> Cc: Mattijs Korpershoek <[email protected]> Cc: Sean Anderson <[email protected]> Cc: Cody Schuffelen <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]> # on vim3 Reviewed-by: Mattijs Korpershoek <[email protected]>
2023-11-16cmd: bcb: support various block device interfaces for BCB commandDmitrii Merkurev
Currently BCB command-line, C APIs and implementation only support MMC interface. Extend it to allow various block device interfaces. Signed-off-by: Dmitrii Merkurev <[email protected]> Cc: Eugeniu Rosca <[email protected]> Cc: Ying-Chun Liu (PaulLiu) <[email protected]> Cc: Simon Glass <[email protected]> Cc: Mattijs Korpershoek <[email protected]> Cc: Sean Anderson <[email protected]> Cc: Cody Schuffelen <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]> # on vim3 Reviewed-by: Mattijs Korpershoek <[email protected]>
2023-05-31fastboot: Only call the bootm command if it is enabledSamuel Holland
This fixes an error with trying to link against do_bootm() when CONFIG_CMD_BOOTM is disabled. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2023-05-05net: share fastboot boot handle logic between transportsDmitrii Merkurev
Introduce reboot, boot and continue commands support to TCP fastboot by moving existing UDP logic into the common module. Signed-off-by: Dmitrii Merkurev <[email protected]> Cc: Ying-Chun Liu (PaulLiu) <[email protected]> Cc: Simon Glass <[email protected]> Сс: Joe Hershberger <[email protected]> Сс: Ramon Fried <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-05-05net: add fastboot TCP supportDmitrii Merkurev
Known limitations are 1. fastboot reboot doesn't work (answering OK but not rebooting) 2. flashing isn't supported (TCP transport only limitation) The command syntax is fastboot tcp Signed-off-by: Dmitrii Merkurev <[email protected]> Cc: Ying-Chun Liu (PaulLiu) <[email protected]> Cc: Simon Glass <[email protected]> Сс: Joe Hershberger <[email protected]> Сс: Ramon Fried <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-02-10Correct SPL uses of FASTBOOT_FLASH_MMCSimon Glass
This converts 5 usages of this option to the non-SPL form, since there is no SPL_FASTBOOT_FLASH_MMC defined in Kconfig Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2023-01-11fastboot: remove #ifdef CONFIG when it is possiblePatrick Delaunay
Much of the fastboot code predates the introduction of Kconfig and has quite a few #ifdefs in it which is unnecessary now that we can use IS_ENABLED() et al. Signed-off-by: Patrick Delaunay <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Reviewed-by: Sean Anderson <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]> # on vim3l
2022-01-28fastboot: fix fastboot_set_reboot_flag()Roman Stratiienko
In case CONFIG_FASTBOOT_FLASH_MMC_DEV == 0, compile-time condition is not met and fastboot_set_reboot_flag() fails. Fixes: a362ce214f03 ("fastboot: Implement generic fastboot_set_reboot_flag") Signed-off-by: Roman Stratiienko <[email protected]> Reviewed-by: Sean Anderson <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]>
2021-02-07fastboot: Implement generic fastboot_set_reboot_flagRoman Kovalivskyi
It is possible to implement fastboot_set_reboot_flag in a generic way if BCB commands are turned on for a target. Using bcb_set_reboot_reason allows to do this by simply passing string with correct reboot reason that should be handled during next boot process. If BCB are turned off, then bcb_set_reboot_reason would simply return error, so it won't introduce any new behaviour for such targets. Signed-off-by: Roman Kovalivskyi <[email protected]>
2020-09-01fastboot: Extend fastboot_set_reboot_flag with reboot reasonRoman Kovalivskyi
Extend fastboot_set_reboot_flag arguments with reboot reason so that it could handle different reboot cases in future. Signed-off-by: Roman Kovalivskyi <[email protected]>
2019-12-02common: Move command functions out of common.hSimon Glass
Move these functions into the command.h header file which is a better fit. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2019-08-11env: Move env_get() to env.hSimon Glass
Move env_get() over to the new header file. Acked-by: Joe Hershberger <[email protected]> Signed-off-by: Simon Glass <[email protected]>
2019-03-16fastboot: common: fix default fastboot_boot on 64-bitNeil Armstrong
When booting on a 64-bit system, the boot_addr_start buffer is not large enough to contain a 64-bit number, thus leading to a crash even if fastboot_buf_addr is valid, only the high part of the address will be printed to boot_addr_start : fastboot with fastboot_buf_addr = 0x0000000006000000: downloading of 92239872 bytes finished Booting kernel at 0x00000000... "Synchronous Abort" handler, esr 0x96000004 elr: 00000000010561f4 lr : 0000000001056fac (reloc) <snip> x28: 000000007df2d38f x29: 000000007df2d1b0 Resetting CPU ... With this fix, boot_addr_start can have the full 64-bit address passed to bootm. Fixes: f73a7df984a9 ("net: fastboot: Merge AOSP UDP fastboot") Cc: Simon Glass <[email protected]> Cc: Alex Kiernan <[email protected]> Cc: Sam Protsenko <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2018-05-30net: fastboot: Merge AOSP UDP fastbootAlex Kiernan
Merge UDP fastboot support from AOSP: https://android.googlesource.com/platform/external/u-boot/+/android-o-mr1-iot-preview-8 Signed-off-by: Alex Kiernan <[email protected]> Signed-off-by: Alex Deymo <[email protected]> Signed-off-by: Jocelyn Bohr <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2018-05-30fastboot: Rename fb_set_reboot_flag to fastboot_set_reboot_flagAlex Kiernan
Rename fb_set_reboot_flag to fastboot_set_reboot_flag so it matches all other fastboot code in the global name space. Fix the guards around them so that they're dependent on FASTBOOT, not just USB_FUNCTION_FASTBOOT. Move the weak implementation of fastboot_set_reboot_flag to fb_common.c so we can call it from non-USB fastboot code. Signed-off-by: Alex Kiernan <[email protected]> Reviewed-by: Simon Glass <[email protected]> Acked-by: Joe Hershberger <[email protected]>
2018-05-30fastboot: Extract fastboot_okay/fail to fb_common.cAlex Kiernan
Add drivers/fastboot/fb_common.c, where fastboot_okay/fail are implemented so we can call them from a non-USB implementation. Introduce fastboot_response which takes varargs parameters so we can use it to generate formatted response strings. Refactor fastboot_okay/fail to use it. Signed-off-by: Alex Kiernan <[email protected]> Reviewed-by: Joe Hershberger <[email protected]>