04 Oct, 2017

1 commit

  • U-Boot widely uses error() as a bit noisier variant of printf().

    This macro causes name conflict with the following line in
    include/linux/compiler-gcc.h:

    # define __compiletime_error(message) __attribute__((error(message)))

    This prevents us from using __compiletime_error(), and makes it
    difficult to fully sync BUILD_BUG macros with Linux. (Notice
    Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().)

    Let's convert error() into now treewide-available pr_err().

    Done with the help of Coccinelle, excluing tools/ directory.

    The semantic patch I used is as follows:

    //
    @@@@
    -error
    +pr_err
    (...)
    //

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Simon Glass
    [trini: Re-run Coccinelle]
    Signed-off-by: Tom Rini

    Masahiro Yamada
     

21 Aug, 2017

2 commits


16 Aug, 2017

1 commit

  • We are now using an env_ prefix for environment functions. Rename these
    two functions for consistency. Also add function comments in common.h.

    Quite a few places use getenv() in a condition context, provoking a
    warning from checkpatch. These are fixed up in this patch also.

    Suggested-by: Wolfgang Denk
    Signed-off-by: Simon Glass

    Simon Glass
     

04 Jun, 2017

1 commit

  • This patch adds support for flashing zImage to the Android boot
    partition on eMMC.

    Usage:

    $ fastboot flash zImage

    It's based on [1].

    [1] http://omapzoom.org/?p=repo/u-boot.git;a=commit;h=3393b908c1e848bba3706612cbe50aa8970720b3

    Signed-off-by: Sam Protsenko

    Sam Protsenko
     

12 May, 2017

1 commit


28 Jan, 2017

2 commits


02 Oct, 2016

3 commits

  • Move FASTBOOT_MBR_NAME and FASTBOOT_GPT_NAME into Kconfig.
    Add dependency on the FASTBOOT_FLASH setting (also for FASTBOOT_MBR_NAME).
    Remove the now redundant GPT_ENTRY_NAME.

    Signed-off-by: Petr Kulhavy
    Reviewed-by: Tom Rini
    Acked-by: Steve Rae
    Reviewed-by: Simon Glass
    [trini: Add FIXME about xxx_PARTITION needing to be in Kconfig]
    Signed-off-by: Tom Rini

    Petr Kulhavy
     
  • Add special target "mbr" (otherwise configurable via CONFIG_FASTBOOT_MBR_NAME)
    to write MBR partition table.
    Partitions are now searched using the generic function which finds any
    partiiton by name. For MBR the partition names hda1, sda1, etc. are used.

    Signed-off-by: Petr Kulhavy
    Reviewed-by: Tom Rini
    Acked-by: Steve Rae
    Reviewed-by: Simon Glass

    Petr Kulhavy
     
  • So far partition search by name has been supported only on the EFI partition
    table. This patch extends the search to all partition tables.

    Rename part_get_info_efi_by_name() to part_get_info_by_name(), move it from
    part_efi.c into part.c and make it a generic function which traverses all part
    drivers and searches all partitions (in the order given by the linked list).

    For this a new variable struct part_driver.max_entries is added, which limits
    the number of partitions searched. For EFI this was GPT_ENTRY_NUMBERS.
    Similarly the limit is defined for DOS, ISO, MAC and AMIGA partition tables.

    Signed-off-by: Petr Kulhavy
    Reviewed-by: Tom Rini
    Acked-by: Steve Rae

    Petr Kulhavy
     

12 Jul, 2016

1 commit


28 Jun, 2016

4 commits

  • In order to process the CHUNK_TYPE_DONT_CARE properly, there is
    a requirement to be able to 'reserve' a specified number of blocks
    in the storage media. Because of the special handling of "bad blocks"
    in NAND devices, this is implemented in a storage abstraction function.

    Signed-off-by: Steve Rae
    Reviewed-by: Maxime Ripard

    Steve Rae
     
  • - 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

    Steve Rae
     
  • This file originally came from upstream code.

    While retaining the storage abstraction feature, this is the first
    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

    Steve Rae
     
  • 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

    Steve Rae
     

15 Mar, 2016

5 commits


14 Jan, 2016

1 commit

  • This will allow the implementation to make use of data in the block_dev
    structure beyond the base device number. This will be useful so that eMMC
    block devices can encompass the HW partition ID rather than treating this
    out-of-band. Equally, the existence of the priv field is crying out for
    this patch to exist.

    Signed-off-by: Stephen Warren
    Reviewed-by: Tom Rini

    Stephen Warren
     

13 Nov, 2015

5 commits

  • This fixes compilation problems when using a hardfloat toolchain on
    ARM, which manifest themselves as "libgcc.a(_udivmoddi4.o) uses
    VFP register arguments, u-boot does not".

    These problems have been reported in the U-Boot mailing list:
    http://lists.denx.de/pipermail/u-boot/2015-October/230314.html
    http://lists.denx.de/pipermail/u-boot/2015-October/231908.html

    Signed-off-by: Siarhei Siamashka
    Reviewed-by: Tom Rini

    Siarhei Siamashka
     
  • The Android sparse image format is currently supported through a file
    called aboot, which isn't really such a great name, since the sparse image
    format is only used for transferring data with fastboot.

    Rename the file and header to a file called "sparse", which also makes it
    consistent with the header defining the image structures.

    Signed-off-by: Maxime Ripard
    Reviewed-by: Tom Rini

    Maxime Ripard
     
  • The fastboot flash command that writes an image to a partition works in
    several steps:

    1 - Retrieve the maximum size the device can download through the
    "max-download-size" variable

    2 - Retrieve the partition type through the "partition-type:%s" variable,
    that indicates whether or not the partition needs to be erased (even
    though the fastboot client has minimal support for that)

    3a - If the image is smaller than what the device can handle, send the image
    and flash it.

    3b - If the image is larger than what the device can handle, create a
    sparse image, and split it in several chunks that would fit. Send the
    chunk, flash it, repeat until we have no more data to send.

    However, in the 3b case, the subsequent transfers have no particular
    identifiers, the protocol just assumes that you would resume the writes
    where you left it.

    While doing so works well, it also means that flashing two subsequent
    images on the same partition (for example because the user made a mistake)
    would not work withouth flashing another partition or rebooting the board,
    which is not really intuitive.

    Since we have always the same pattern, we can however maintain a counter
    that will be reset every time the client will retrieve max-download-size,
    and incremented after each buffer will be flashed, that will allow us to
    tell whether we should simply resume the flashing where we were, or start
    back at the beginning of the partition.

    Signed-off-by: Maxime Ripard
    Reviewed-by: Tom Rini

    Maxime Ripard
     
  • The current sparse image parser relies heavily on the MMC layer, and
    doesn't allow any other kind of storage medium to be used.

    Rework the parser to support any kind of storage medium, as long as there
    is an implementation for it.

    Signed-off-by: Maxime Ripard
    Reviewed-by: Tom Rini

    Maxime Ripard
     
  • The functions and a few define to generate a fastboot message to be sent
    back to the host were so far duplicated among the users.

    Move them all to a common place.

    Signed-off-by: Maxime Ripard
    Reviewed-by: Tom Rini

    Maxime Ripard
     

14 Apr, 2015

1 commit

  • Implement an alias name check for devices where GPT limitations prevent
    user-friendly partition names such as "boot", "system" and "cache". Or,
    where the actual partition name doesn't match a standard partition name
    used commonly with fastboot.

    To set an alias, add an environment setting as follows:
    fastboot_partition_alias_=

    Example: fastboot_partition_alias_boot=LNX

    Signed-off-by: Michael Scott
    Acked-by: Steve Rae
    Cc: Steve Rae
    Cc: Lukasz Majewski

    Michael Scott
     

26 Feb, 2015

2 commits

  • If the string is copied without NULL termination using strncpy(),
    then strncat() on the next line, may concatenate the string after
    some stale (or random) data, if the response string was not
    zero-initialized.

    Signed-off-by: Dileep Katta
    Reviewed-by: Steve Rae
    Reviewed-by: Lukasz Majewski

    Dileep Katta
     
  • Adds the fastboot erase functionality, to erase a partition
    specified by name. The erase is performed based on erase group size,
    to avoid erasing other partitions. The start address and the size
    is aligned to the erase group size for this.

    Currently only supports erasing from eMMC.

    Signed-off-by: Dileep Katta
    Reviewed-by: Lukasz Majewski

    Dileep Katta
     

18 Dec, 2014

1 commit

  • Implement a feature to allow fastboot to write the downloaded image
    to the space reserved for the Protective MBR and the Primary GUID
    Partition Table.
    Additionally, prepare and write the Backup GUID Partition Table.

    Signed-off-by: Steve Rae
    Tested-by: Lukasz Majewski
    [Test HW: Exynos4412 - Trats2]

    Steve Rae
     

25 Sep, 2014

2 commits