Commit Graph

4 Commits

Author SHA1 Message Date
Jocelyn Bohr 8b464fa913 Implement fastboot flash and erase.
Add function to respond to fastboot flash and erase. Flash writes the
previously downloaded image to indicated partition. Erase clears the
indicated partition. fb_flash and fb_erase are essentially wrappers
for fb_mmc_flash_write and fb_mmc_erase, which are implemented in
common/fb_mmc.c.

Added common/fb_common.c, where fastboot_okay/fail are implemented.
common/fb_mmc.c assumes fasboot_okay() and fastboot_fail() are
implemented, but they were tied to the fastboot USB implementation.
This refactor adds the response string as a parameter to
fastboot_okay/fail, instead of modifying a global.

Bug: 31887729
Test: FLASH:
      - Create file "foo" containing 2048 chars = "-"
      - Start "fastboot udp" on device and run
        "fastboot -s udp:$RPI_IP flash misc foo" from host
      - From U-boot console, read into memory the first 4 blocks from
        misc partition, observe each byte is "-".

      ERASE
      - Start "fastboot udp" on device and run
        "fastboot -s udp:$RPI_IP erase misc" from host
	  - From U-boot console, read into memory many blocks from misc
        partition, observe each byte is 0x00

	  Configs that use fastboot USB implementation still build.

Change-Id: I5bd54868990bd9d5736d0969b3db240c2926eeec
2017-11-14 10:55:45 +08:00
Steve Rae 9bc34799c8 fastboot: sparse: resync common/image-sparse.c (part 2)
- update fastboot_okay() and fastboot_fail()

This file originally came from upstream code.

While retaining the storage abstraction feature, this is the second
set of the changes required to resync with the
  cmd_flash_mmc_sparse_img()
in the file
  aboot.c
from
  https://us.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=LE.BR.1.2.1

Signed-off-by: Steve Rae <srae@broadcom.com>
2016-06-27 16:37:38 -04:00
Steve Rae 64ece84854 fastboot: sparse: remove session-id logic
This "session-id" alogrithm is not required, and currently corrupts
the stored image whenever more the one "session" is required.

Signed-off-by: Steve Rae <srae@broadcom.com>
2016-06-27 16:36:33 -04:00
Maxime Ripard bf8940d35b fastboot: Implement NAND backend
So far the fastboot code was only supporting MMC-backed devices for its
flashing operations (flash and erase).

Add a storage backend for NAND-backed devices.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2015-11-12 13:18:58 -05:00