Add fastboot UDP support
Get series with b4
b4 am 20180528093953.76d2502f@jawaVersions newest first · linked by author and title
- v7 Latest0 of 18 patches 0 repliesNew
- v1 RFC0 of 5 patches 0 repliesSuperseded
Patches in v7 No applies recorded yet
None of the 18 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v7 yet.
Cover letter [U-Boot] [PATCH v7 00/18] Add fastboot UDP support
Hi Alex, Sam,
Sam have you tested Alex patches on your HW (as you asked earlier for the repo to fetch the code)?
Could you add Tested-by: tag?
Are there any more comments on this series?
Best regards,
Łukasz
Quoted 269 lines
This series merges the fastboot UDP support from AOSP into mainline U-Boot.
Changes in UDP behaviour from the AOSP code, so it follows the existing USB behaviour:
- 'boot' now follows the USB code and does 'bootm
CONFIG_FASTBOOT_BUF_ADDR'. I've added 'fastboot_bootcmd' which if set overrides the boot command and allows the existing UDP behaviour to be preserved.
- 'continue' in UDP now exits the fastboot server rather than executing 'run bootcmd'
- 'reboot-bootloader' no longer writes 'reboot-bootloader' toCONFIG_FASTBOOT_BUF_ADDRas its marker for the subsequent boot. The
code which is in AOSPcommon/android_bootloader.cexpects this marker, but we have prior art in the USB code using the weak function
fastboot_set_reboot_flag
- 'getvar' in the UDP path now supports fetching 'fastboot.' prefixed variables (inherited from the USB path), these override the defaultsI've pushed both USB and UDP into a single consolidated protocol layer now I've tested it on a BeagleBone Green.
Green Travis build:
https://travis-ci.org/akiernan/u-boot/builds/383077278Changes in v7:
- setFASTBOOT_CMD_OEM_FORMATfor all existing users ofFASTBOOT_FLASH_MMC_DEVthat also haveCMD_GPTChanges in v6:
- accomodate master change and switch dependency onimx6dl_mamojfrom FASTBOOT toUSB_FUNCTION_FASTBOOT
- delete redundantFASTBOOT_FLASH_NAND_DEVsymbol
- add docbook comments
- add docbook comments
- renamefastboot_download_data()tofastboot_data_download(), renamefastboot_get_bytes_remaining()tofastboot_data_remaining()
- splitfastboot_data_complete()out fromfastboot_data_download()so we can call it at the end of the transfer phase for USB
- merged from RFC USB fastboot series
- when entering the DATA phase ensure we actually install the correct handler
- on completion of DATA call newfastboot_data_complete()
- previous changes:
- remove redundantversion.h
- use newfastboot_get_bytes_remaining()function
- newChanges in v5:
- don't depend onUDP_FUNCTION_FASTBOOTuntil it exists
- squash in subsequent patch which updates defconfigs so we don't leave users ofCONFIG_FASTBOOTwithout it enabled
- fix build indrivers/fastbootwhen we haveCONFIG_FASTBOOTwithout flash or erase and we've not yet addedfb_common.cto the build
- fix docbook formatting
- new
- new
- renameCONFIG_FASTBOOT_FLASH_FILLBUF_SIZEtoCONFIG_IMAGE_SPARSE_FILLBUF_SIZEand migrate it toKconfig.
- make fastboot_bytes_received/expected static and add functionfastboot_get_bytes_remaining()
- move fastboot_buf_addr/fastboot_buf_size/fastboot_progress_callback intofastboot-internal.h
- delete redundantfb_prefixes from statics
- newChanges in v4:
- add docbook comments
- leavestrcmp_l1()in USB fastboot as we don't need it in UDP path
- add docbook comments
- new
- guard fb_getvar/fb_command withUDP_FUNCTION_FASTBOOTinMakefile
- add docbook comments
- remove parameter fromfastboot_boot()since we always wantfastboot_buf_addr(and if we're usingfastboot_bootcmdthen it's ignored)
- split oem format into new patchChanges in v3:
- move implyANDROID_BOOT_IMAGE,CMD_FASTBOOTto FASTBOOT fromUSB_FUNCTION_FASTBOOT
- add depend onUSB_FUNCTION_FASTBOOTtoFASTBOOT_USB_DEV
- leaveimages-sparse.cin common to acommodate 2f83f21
- refactor for changes in master
- Merge subsequent patch for formatting response strings into this one
- allow NULL tofastboot_okay()when there's no message to send
- guard FASTBOOT_GPT_NAME/FASTBOOT_MBR_NAME with EFI/DOS_PARTITION
- new
- new
- new
- new
- new
- new
- use FASTBOOT as our guard inKconfignot a list of USB || UDP
- correct mis-translation from AOSP introduced when cleaning up for checkpatch - we should write when buffer is not NULL, rather than erasing, and erase when buffer is NULL
- useCMD_RET_USAGEfromdo_fastboot
- removedo_fastboot_udpfromcmd/net.cand rewrite usingnet_loop()
- renametimed_send_infotofastboot_send_info, renamefastboot_send_infotofastboot_udp_send_info
- replaceFASTBOOT_HEADER_SIZEwithsizeof(struct fastboot_header)
- move start time intotimed_send_info()rather than passing it in
- make calls tofastboot_udp_send_infoa runtime dependency, not a compile time one
- set ${filesize} to size of downloaded image
- add progress meter from USB path during download
- add support for 'oem format' command from the USB path
- rename 'fastbootcmd' to 'fastboot_bootcmd' to make clear that this is the fastboot boot command
- make getvar implementation table driven
- addfastboot_buf_addr,fastboot_buf_sizeto override buffer address and size
- return correct filesystem type in getvar partition-type on MMC
- process "fastboot." prefixed env variables in getvar first so you can override the normal values (this also lets you set a fs type for NAND devices)
- squash subsequent patches which change this code into this one:
- If the fastboot flash/erase commands are disabled, remove that
support so we still build correctly.
- Add NAND support to fastboot UDP flash/erase commands
- If we don't have a partition name passed, report it as not found.
- Change the behaviour of the fastboot net code such that "reboot-bootloader" is no longer written toCONFIG_FASTBOOT_BUF_ADDRfor use as a marker on reboot (the AOSP code incommon/android-bootloader.cuses this marker - this code could be reinstated there if that gets merged).
- Merge USB and UDP boot code. The USB implementation stays the
same, but UDP no longer passes an fdt. We introduce a new environment variable 'fastboot_bootcmd' which if set overrides the hardcoded boot command, setting this then allows the UDP implementation to remain the same. If after running 'fastboot_bootcmd' the board has not booted, control is returned to U-Boot and the fastboot process ends.
- Separate the fastboot protocol handling from the fastboot UDP
code in preparation for reusing it in the USB code.Changes in v2:
- ensure fastboot syntax is backward compatible - 'fastboot 0' means 'fastboot usb 0'Alex Kiernan (18):
fastboot: Move fastboot todrivers/fastboot
fastboot: Refactor fastboot_okay/fail to take response
fastboot: Extract fastboot_okay/fail tofb_common.c
fastboot: Correct dependencies inFASTBOOT_FLASH
fastboot: Add missing newlines
fastboot: Remove FIXME for CONFIG_FASTBOOT_...NAME
fastboot: Fix parameter types in_fb_nand_write
fastboot: Renamefb_set_reboot_flagtofastboot_set_reboot_flag
fastboot: Extract common definitions from USB fastboot
fastboot: Rename publicfb_functions tofastboot_
ti: fastboot: Move weak overrides to board files
fs: Addfs_get_type_nameto return current filesystem name
fastboot: MigrateFASTBOOT_FLASH_NAND_TRIMFFStoKconfig
mmc: Separate "mmc swrite" from fastboot
net: fastboot: Merge AOSP UDP fastboot
fastboot: Add support for 'oem format' command
usb: fastboot: Convert USBf_fastbootto shared fastboot
fastboot: Update fastboot documentationarch/arm/Kconfig | 2 - arch/arm/mach-omap2/boot-common.c | 10 - arch/arm/mach-omap2/utils.c | 4 +- arch/arm/mach-rockchip/rk3128-board.c | 4 +- arch/arm/mach-rockchip/rk322x-board.c | 4 +- board/amazon/kc1/kc1.c | 2 +- board/lg/sniper/sniper.c | 2 +- board/ti/am57xx/board.c | 10 + board/ti/common/Kconfig | 1 - board/ti/dra7xx/evm.c | 10 + cmd/Kconfig | 22 +- cmd/fastboot.c | 91 ++++- cmd/mmc.c | 14 +- common/Makefile | 14 - configs/A13-OLinuXino_defconfig | 1 + configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 + configs/A20-OLinuXino-Lime2_defconfig | 1 + configs/A20-Olimex-SOM204-EVB-eMMC_defconfig | 1 + configs/A20-Olimex-SOM204-EVB_defconfig | 1 + configs/Bananapi_m2m_defconfig | 1 + configs/Cubietruck_defconfig | 1 + configs/Sinlinx_SinA33_defconfig | 1 + configs/am335x_boneblack_defconfig | 7 +- configs/am335x_boneblack_vboot_defconfig | 2 +- configs/am335x_evm_defconfig | 2 +- configs/am335x_evm_nor_defconfig | 2 +- configs/am335x_evm_norboot_defconfig | 2 +- configs/am335x_evm_spiboot_defconfig | 2 +- configs/am335x_evm_usbspl_defconfig | 2 +- configs/am57xx_evm_defconfig | 13 +- configs/am57xx_hs_evm_defconfig | 13 +- configs/bcm23550_w1d_defconfig | 2 +- configs/bcm28155_ap_defconfig | 2 +- configs/birdland_bav335a_defconfig | 2 +- configs/birdland_bav335b_defconfig | 2 +- configs/cgtqmx6eval_defconfig | 2 +- configs/chromebit_mickey_defconfig | 5 +- configs/chromebook_jerry_defconfig | 5 +- configs/chromebook_minnie_defconfig | 5 +- configs/dra7xx_evm_defconfig | 11 +- configs/dra7xx_hs_evm_defconfig | 11 +- configs/evb-rk3036_defconfig | 5 +- configs/evb-rk3128_defconfig | 9 +- configs/evb-rk3229_defconfig | 5 +- configs/evb-rk3288_defconfig | 5 +- configs/evb-rk3328_defconfig | 7 +- configs/fennec-rk3288_defconfig | 5 +- configs/firefly-rk3288_defconfig | 5 +- configs/imx6dl_mamoj_defconfig | 2 +- configs/kc1_defconfig | 2 +- configs/kylin-rk3036_defconfig | 5 +- configs/miqi-rk3288_defconfig | 5 +- configs/mx6qsabrelite_defconfig | 2 +- configs/mx6sabresd_defconfig | 2 +- configs/nitrogen6dl2g_defconfig | 2 +- configs/nitrogen6dl_defconfig | 2 +- configs/nitrogen6q2g_defconfig | 2 +- configs/nitrogen6q_defconfig | 2 +- configs/nitrogen6s1g_defconfig | 2 +- configs/nitrogen6s_defconfig | 2 +- configs/omap3_beagle_defconfig | 2 +- configs/omap3_evm_defconfig | 2 +- configs/omap3_logic_defconfig | 2 +- configs/parrot_r16_defconfig | 1 + configs/phycore-rk3288_defconfig | 5 +- configs/popmetal-rk3288_defconfig | 5 +- configs/rock2_defconfig | 5 +- configs/sniper_defconfig | 2 +- configs/stih410-b2260_defconfig | 11 +- configs/tbs_a711_defconfig | 1 + configs/tinker-rk3288_defconfig | 5 +- .../xilinx_zynqmp_zc1751_xm015_dc1_defconfig | 7 +- .../xilinx_zynqmp_zc1751_xm016_dc2_defconfig | 2 +- configs/xilinx_zynqmp_zcu102_rev1_0_defconfig | 7 +- configs/xilinx_zynqmp_zcu102_revA_defconfig | 7 +- configs/xilinx_zynqmp_zcu102_revB_defconfig | 7 +- configs/xilinx_zynqmp_zcu106_revA_defconfig | 7 +- doc/README.android-fastboot | 240 +++++++----- drivers/Kconfig | 2 + drivers/Makefile | 1 + {cmd => drivers}/fastboot/Kconfig | 63 ++-- drivers/fastboot/Makefile | 7 + drivers/fastboot/fb_command.c | 335 +++++++++++++++++ drivers/fastboot/fb_common.c | 169 +++++++++ drivers/fastboot/fb_getvar.c | 230 ++++++++++++ {common => drivers/fastboot}/fb_mmc.c | 216 +++++++---- {common => drivers/fastboot}/fb_nand.c | 69 +++- drivers/usb/gadget/f_fastboot.c | 347 ++---------------- fs/fs.c | 13 + include/fastboot-internal.h | 36 ++ include/fastboot.h | 137 ++++++- include/fb_mmc.h | 35 +- include/fb_nand.h | 37 +- include/fs.h | 10 + include/image-sparse.h | 4 +- include/net.h | 2 +- include/net/fastboot.h | 21 ++ lib/Kconfig | 11 + lib/Makefile | 1 + {common => lib}/image-sparse.c | 38 +- net/Makefile | 1 + net/fastboot.c | 317 ++++++++++++++++ net/net.c | 7 + scripts/config_whitelist.txt | 2 - 104 files changed, 2094 insertions(+), 696 deletions(-) rename {cmd => drivers}/fastboot/Kconfig (78%) create mode 100644 drivers/fastboot/Makefile create mode 100644 drivers/fastboot/fb_command.c
Quoted 9 lines
create mode 100644 drivers/fastboot/fb_common.c
create mode 100644 drivers/fastboot/fb_getvar.c
rename {common => drivers/fastboot}/fb_mmc.c (62%)
rename {common => drivers/fastboot}/fb_nand.c (71%)
create mode 100644 include/fastboot-internal.h
create mode 100644 include/net/fastboot.h
rename {common => lib}/image-sparse.c (88%)
create mode 100644 net/fastboot.cBest regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180528/cfa760d9/attachment-0001.sig>