11 Oct, 2019

1 commit


20 Aug, 2019

2 commits

  • Decrypt and verify the secure credential in keymaster TA, unlock
    operation can only be allowed after secure credential verify pass.

    Since the mppubk can only be generated on hab closed imx8q, so secure
    unlock feature can only supported when hab is closed.

    Test: secure unlock credential verify on hab closed imx8mm_evk.

    Change-Id: I1ab5e24df28d1e75ff853de3adf29f34da1d0a71
    Signed-off-by: Ji Luo

    Ji Luo
     
  • Add commands to support extract serial number from device.
    Commands:
    $ fastboot oem get-serial-number
    $ fastboot get_staged

    Test: serial number upload on imx8mm.

    Change-Id: I5c905ab797d4fd28d76c8403914f191eaf2ef687
    Signed-off-by: Ji Luo

    Ji Luo
     

26 Jul, 2019

1 commit


25 Jul, 2019

5 commits

  • The A/B slot selection is moved to spl, it may lead to hang
    if no bootable slots found. The only way to recover the board
    is re-flash images with uuu tool, which is quite inconvenient
    for some customers who can't enter serial download mode.

    This patch will set "spl recovery mode" which will give us a
    chance to re-flash images with fastboot commands.

    Test: Enter spl recovery mode and flash images when no bootable
    slots found.

    Change-Id: I31278f5212bde7609fe2f49e77b3849e92c0c516
    Signed-off-by: Ji Luo

    Ji Luo
     
  • when conduct fastboot lock/unlock operations, erase the userdata first
    and then set lock/unlock status to improve security level.

    Change-Id: I74c571c35b88afd6fdd4c287463f7209da8c15ff
    Signed-off-by: faqiang.zhu

    faqiang.zhu
     
  • It can be dangerous to export some hwcrypto commands to Linux,
    add commands to limit some commands within bootloader.

    Test: hwcrypto commands can't be used after locking boot state.

    Change-Id: Ib0a96a87f661778c133178840d8dccf49f151c22
    Signed-off-by: Ji Luo

    Ji Luo
     
  • In host end, need encrypt the attestation keys and certs
    by manufacture protection public key though AES-128-ECB.
    Then use below 4 set of commands to provision encrypted
    RSA attestation and EC attestation:
    * $fastboot stage atte_rsa_key.bin
    * $fastboot oem set-rsa-atte-key-enc
    * $fastboot stage atte_rsa_cert.bin
    * $fastboot oem append-rsa-atte-cert-enc
    * $fastboot stage atte_ec_key.bin
    * $fastboot oem set-ec-atte-key-enc
    * $fastboot stage atte_ec_cert.bin
    * $fastboot oem append-ec-atte-cert-enc

    Change-Id: I8a7c64004a17f7dde89f28c3123a2e2b1a6d3346
    Signed-off-by: Haoran.Wang

    Haoran.Wang
     
  • Add new keymaster commands to get Manufacure Production key (mppubk).
    Since the mppubk can only be generated in OEM CLOSED imx8q board, so
    we can only use this command when the board is HAB/AHAB closed.

    Commands to extract the mppubk:
    * $fastboot oem get-mppubk
    * $fastboot get_staged mppubk.bin

    Test: Generate and dump the mppubk.bin

    Change-Id: Idc59e78ca6345497e744162664b8293f50d1eda4
    Signed-off-by: Ji Luo

    Ji Luo
     

24 Jul, 2019

3 commits

  • Follow Bootloader requirement spec in
    https://source.android.com/devices/bootloader/unlock-trusty.
    Need to pass the flash lock status by androidboot.flash.locked.

    This patch fixed the GTS failure
    com.google.android.gts.persistentdata.PersistentDataHostTest#testTestGetFlashLockState.

    Change-Id: I9a3508f7546b02c998e7668df2a33f864a58db75
    Signed-off-by: Haoran.Wang

    Haoran.Wang
     
  • new imx8mn chips have Cortex-M7 inside, not like any other existing
    multi-core i.MX MPU, users may manually flash mcu firmware with
    fastboot, partition name need to be specified at the same time, so the
    mcu firmware partition name need to be changed. related enum and
    variable names are also modified.

    Change-Id: Ia801e76fb3a20d0074dbbc1433258358c1a53907
    Signed-off-by: faqiang.zhu
    Signed-off-by: Ji Luo

    Ji Luo
     
  • Align the eMMC device id to '2' to get correct bootloader0
    offset.

    Test: bootloader0 partition flash.

    Change-Id: Idac6bfe55857e3f80b7e18691bbe3c5e5c453e10
    Signed-off-by: Ji Luo

    Ji Luo
     

15 Jul, 2019

1 commit

  • In Android, the reboot bootloader flag is written to misc partition, in
    the boot flow, u-boot will check that message to decide whether enter
    fastboot mode or not. To be compatible with the common implemention,
    keep the fastboot_set_reboot_flag there and redefine it to avoid the
    error return value which block the reboot process.

    Change-Id: Ifb55236d5a5daf3edd124d3ed01851ff6e916e1a
    Signed-off-by: faqiang.zhu

    faqiang.zhu
     

10 Jul, 2019

1 commit

  • libavb is now under the directory of lib/, not lib/avb/ as before, to
    adapt to this change, some modifications are made:
    1. header file inclusion change, including parameter of -I option in
    Makefile
    2. remove avb_sysdeps_posix.o in Makefile since the functions in
    avb_sysdeps_posix.c has beed redefined in fsl_avb_sysdeps_uboot.c

    Change-Id: I4216e3ddb4e3e810783e4f46b953eda510c2627b
    Signed-off-by: faqiang.zhu

    faqiang.zhu
     

09 Jul, 2019

3 commits

  • The bootloader offset of SD and eMMC user area on imx8mn is 32KB.
    When booting from eMMC boot0 or boot1 partition, no matter normal boot
    or fastboot, the image offset is 0.

    Signed-off-by: Ye Li
    (cherry picked from commit ab8b408407f55ce55214312c1f5726382d337bd2)

    Ye Li
     
  • Add is_imx8mn for runtime soc type checking, and update drivers to use it.

    Signed-off-by: Ye Li
    Signed-off-by: Peng Fan
    (cherry picked from commit e8ec22ef74a9d98e621fe1ac6418b06d5586ab12)

    Ye Li
     
  • the warning info is as below:

    drivers/fastboot/fb_fsl/fb_fsl_command.c:66:13: warning: 'process_erase_mmc' defined but not used [-Wunused-function]
    static void process_erase_mmc(const char *cmdbuf, char *response)
    ^

    move this process_erase_mmc function to fb_fsl_dev.c and make remove the
    static attribute.

    Change-Id: Ifc30348e53693e26119c760406b4c650e591aef4
    Signed-off-by: faqiang.zhu

    faqiang.zhu
     

08 Jul, 2019

1 commit

  • in imx_v2018.03, fastboot response buffer is an array defined in the
    handle function for "fastboot getvar", sizeof(response) will get the
    length of this array, which is FASTBOOT_RESPONSE_LEN.

    but in imx_v2019.04, "response" in "fastboot getvar" function is a
    pointer parameter transmitted to it, so sizeof(response) will only get
    the length of the pointer, not the buffer length. in 32bit device, the
    pointer length is 4, so the header info of fastboot can't be fully
    stored in the buffer in this case, cause the response info can't be
    parsed by host fastboot.

    this commit replace "sizeof(response)" to be FASTBOOT_RESPONSE_LEN
    directly.

    Change-Id: I9d3893406c0361b7aba9cba74b2d751bc311d142
    Signed-off-by: faqiang.zhu

    faqiang.zhu
     

02 Jul, 2019

1 commit

  • to fix build issues, add two header files, "fastboot_lock_unlock.h" is
    copied from imx_v2018.03 branch, "fb_fsl_common.h" contains some
    varialbes and a function used in more than one files.

    the places where "fastboot_lock_unlock.h" is included is modified to
    adapt to this change.
    "fsl_fastboot.h" is renamed to "fb_fsl.h", the places where
    "fsl_fastboot.h" is included is modified to adapt to this change.

    to fix function issues, command handle function in "fb_fsl_command.c" is
    modified.

    build based on imx8mm_ddr4_evk, the board can boot and basic fastboot
    function can work.

    Change-Id: I34961ef70351a1ee4c84b6721dba5ac7b261a0d3
    Signed-off-by: faqiang.zhu

    faqiang.zhu
     

26 Jun, 2019

1 commit


30 May, 2019

1 commit


24 May, 2019

2 commits


16 Mar, 2019

1 commit

  • 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)

    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
    Cc: Alex Kiernan
    Cc: Sam Protsenko
    Signed-off-by: Neil Armstrong
    Reviewed-by: Simon Glass

    Neil Armstrong
     

28 Oct, 2018

1 commit


08 Oct, 2018

1 commit


30 May, 2018

14 commits

  • Convert USB fastboot code to use shared fastboot protocol.

    Signed-off-by: Alex Kiernan
    Reviewed-by: Simon Glass

    Alex Kiernan
     
  • Introduce 'oem format' which matches the USB implementation, guard this
    with CONFIG_FASTBOOT_CMD_OEM_FORMAT so that you can configure it out.

    Signed-off-by: Alex Kiernan
    Reviewed-by: Simon Glass

    Alex 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
    Signed-off-by: Alex Deymo
    Signed-off-by: Jocelyn Bohr
    Reviewed-by: Simon Glass

    Alex Kiernan
     
  • Introduce CONFIG_IMAGE_SPARSE and CONFIG_CMD_MMC_SWRITE so the "mmc
    swrite" command is separated from the fastboot code.

    Move image-sparse from common to lib so it's clear it's library code.

    Rename CONFIG_FASTBOOT_FLASH_FILLBUF_SIZE to CONFIG_IMAGE_SPARSE_FILLBUF_SIZE
    and migrate it to Kconfig.

    Signed-off-by: Alex Kiernan
    Acked-by: Jassi Brar
    Reviewed-by: Simon Glass

    Alex Kiernan
     
  • Add FASTBOOT_FLASH_NAND_TRIMFFS to Kconfig; note there are no in-tree
    users of it.

    Signed-off-by: Alex Kiernan
    Reviewed-by: Simon Glass

    Alex Kiernan
     
  • Rename fb_mmc_flash_write/fb_mmc_erase/fb_nand_flash_write/fb_nand_erase to
    fastboot_... as they form a public interface

    Signed-off-by: Alex Kiernan
    Reviewed-by: Simon Glass

    Alex 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
    Reviewed-by: Simon Glass
    Acked-by: Joe Hershberger

    Alex Kiernan
     
  • Compiling on a 64 bit target the arguments to _fb_nand_write are
    incompatible:

    drivers/fastboot/fb_nand.c: In function ‘_fb_nand_write’:
    drivers/fastboot/fb_nand.c:101:42: warning: passing argument 3 of ‘nand_write_skip_bad’ from incompatible pointer type [-Wincompatible-pointer-types]
    return nand_write_skip_bad(mtd, offset, &length, written,
    ^
    In file included from drivers/fastboot/fb_nand.c:16:0:
    include/nand.h:107:5: note: expected ‘size_t * {aka long unsigned int *}’ but argument is of type ‘unsigned int *’
    int nand_write_skip_bad(struct mtd_info *mtd, loff_t offset, size_t *length,
    ^~~~~~~~~~~~~~~~~~~

    Signed-off-by: Alex Kiernan
    Reviewed-by: Simon Glass
    Acked-by: Joe Hershberger

    Alex Kiernan
     
  • CONFIG_FASTBOOT_GPT_NAME and CONFIG_FASTBOOT_MBR_NAME are always defined
    by Kconfig if you're compiling this code, so remove these redundant
    defaults.

    Signed-off-by: Alex Kiernan
    Reviewed-by: Simon Glass
    Acked-by: Joe Hershberger

    Alex Kiernan
     
  • Add newlines so we format our output correctly.

    Signed-off-by: Alex Kiernan
    Acked-by: Joe Hershberger
    Reviewed-by: Jocelyn Bohr

    Alex Kiernan
     
  • Ensure that when selecting FASTBOOT_FLASH you end up with a buildable
    configuration. Prior to this you could select NAND without MTDPARTS
    and end up with an image which (surprisingly) excluded NAND.

    Also fix dependencies on FASTBOOT_GPT_NAME/FASTBOOT_MBR_NAME which require
    you have EFI_PARTITION/DOS_PARTITION enabled.

    Delete redundant FASTBOOT_FLASH_NAND_DEV from Kconfig - it was only ever
    used as a guard and the value was ignored in all cases, we're using
    FASTBOOT_FLASH_NAND as the guard now.

    Signed-off-by: Alex Kiernan
    Reviewed-by: Joe Hershberger

    Alex 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
    Reviewed-by: Joe Hershberger

    Alex Kiernan
     
  • Add the response string as a parameter to fastboot_okay/fail, instead
    of modifying a global, to match the contract expected by the AOSP
    U-Boot code.

    Signed-off-by: Alex Kiernan
    Reviewed-by: Joe Hershberger

    Alex Kiernan
     
  • Separate CMD_FASTBOOT from FASTBOOT and move code and configuration to
    drivers/fastboot.

    Switch dependencies on FASTBOOT to USB_FUNCTION_FASTBOOT as anyone who wants
    FASTBOOT before this series wants USB_FUNCTION_FASTBOOT. Split
    USB_FUNCTION_FASTBOOT from FASTBOOT so they retain their existing
    behaviour.

    Signed-off-by: Alex Kiernan
    Reviewed-by: Simon Glass
    Acked-by: Joe Hershberger

    Alex Kiernan