19 May, 2020

1 commit

  • According to the google boot flow, an orange warning should
    be displayed on UNLOCKED device to reminder the users of the
    potential risks.

    This commit will show an orange warning logo and warning text
    on the screen, it shall be dismissed after 3 seconds, users
    can also skip it by pressing the ON-OFF button.

    Config 'CONFIG_AVB_WARNING_LOGO_COLS' and 'CONFIG_AVB_WARNING_LOGO_ROWS'
    define the (x, y) position of the warning logo, its default
    value is for 1080*720 resolution display and can be overridden.

    Test: Orange warning logo show on all imx8m/imx8q platfroms.

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

    Ji Luo
     

18 May, 2020

12 commits

  • Only check the bootloader rollback index and trusty keyslot package
    for rpmb key flashed boards.

    Test: boots on boards without rpmb key.

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

    Ji Luo
     
  • Address 0x8880_0000 is reserved for M4 image on imx8q, which
    leaves limited memory region for the malloc pool. The avb
    will consume much heap memory to verify the kernel and dtbo
    image, memory conflicts may happen as the kernel/dtbo image
    size is getting larger.

    As the avb will load kernel/dtbo in every avb_slot_verify(), but
    will only free the memory after both slots are checked(if needed).
    And for trusty enabled platforms, extra heap memory will be used
    to do the hash calculation.

    This commit will free the slot memory once it's marked as unbootable
    and will use fixed memory started from CONFIG_FASTBOOT_BUF_ADDR to
    help store the data to do the hash calculation. With above change,
    we get a chance to decrease the malloc pool size.

    Test: boot on imx8qxp and imx8mm.

    Change-Id: Ia5cdaf9962ae1cb8b8e9bee5305205ec6d90b84a
    Signed-off-by: Ji Luo
    (cherry picked from commit 0a299eb1a4c8c929d069cb4a0d58a096c04f09f7)

    Ji Luo
     
  • Slot will be marked as "unbootable" state if error happens during
    image load/verify process, this may cause the board never boot up
    if some random failures happen (like eMMC/DRAM access error at some
    critical temperature).

    Check the "successful_boot" flag before marking the slot as "unbootable",
    this will help ease the "no bootable slot" issue.

    Test: slot switch on imx8qm_mek.

    Signed-off-by: Ji Luo
    (cherry picked from commit 6db8ebe2224ab6656e8e798288bd1b3c0472c0c0)

    Change-Id: Ib060b11cc6687a3bacd09cecda7dd925beba6316

    Ji Luo
     
  • Don't skip vbmeta public key verify for non-trusty
    platforms.

    Test: boot on imx8mm.

    Change-Id: I4712e5dd6e5c8848468e9d85c6b38eb5fb11377f
    Signed-off-by: Ji Luo
    (cherry picked from commit 9b8264c89ccb3e9179a438e428ad79d72c7efe9b)

    Ji Luo
     
  • 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
    (cherry picked from commit 631149fc0fc8ce035311949db643c2708e41435a)

    Ji Luo
     
  • MMC device id remap function "board_mmc_get_env_dev()" was
    removed in u-boot v2019 because we add the mmc device aliases
    in dts file. But we still need to remap the mmc device id in
    spl or read/write rpmb keyslot package will fail.

    This patch adds mmc device id remap function in spl to get the
    correct device id.

    Test: boot on imx8mm with trusty enabled.

    Change-Id: I41c46494326d9eb2658d2cda692968fb895d0292
    Signed-off-by: Ji Luo
    (cherry picked from commit c079188d06b3669df7836e1b8c6126558b1fa39e)

    Ji Luo
     
  • 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
    (cherry picked from commit 46cc755cf3f42422ee1d7783394e14e8125df2b6)

    Ji Luo
     
  • 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
    (cherry picked from commit 52300d644a275dfa4fe73ecb51601a8efaff8ab7)

    Ji Luo
     
  • Due SPL doesn't have env, so cannot use mmc_get_env_dev() get
    the mmc index.
    Following spl_mmc.c get correct mmc index in SPL.

    Change-Id: I0f07a9ea35d5b3ba0d638af436238d0cfe925981
    Signed-off-by: Haoran.Wang
    (cherry picked from commit 6e4753b4dc0c5bde5aa573b42cb6b7caa6a95bc9)

    Haoran.Wang
     
  • This commit enables dual bootloader feature for imx8m/imx8q, but
    as commit 'a2018ab' already brings in some dual bootloader codes
    when enabling fastboot support, so this commit won't be a complete
    and standalone patch to introduce the dual bootloader feature.

    This commit will do the following:
    1. clean up dual bootloader flow and add missing implementation.
    2. Merge the dual bootloader entry for fit and container to one
    function 'mmc_load_image_raw_sector_dual_uboot'.

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

    Ji Luo
     
  • Driver Module may be used in SPL, with CONFIG_BLK enabled for U-Boot,
    CONFIG_SPL_BLK will be enabled, struct mmc definition will be different.
    comply with that mmc struct definition in fsl_avbkey.c file to handle
    conditions when DM is used in SPL.

    Change-Id: I632600556e764b25228ba467a5e5141cf3fc3dfe
    Signed-off-by: faqiang.zhu
    (cherry picked from commit de905a8a3c6dfdf9241a188b2e22c76dbef851c1)

    faqiang.zhu
     
  • 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 fsl_avb_sysdeps_uboot.c as the functions have been defined in
    avb_sysdeps_posix.c.

    Change-Id: I4216e3ddb4e3e810783e4f46b953eda510c2627b
    Signed-off-by: faqiang.zhu
    Signed-off-by: Ji Luo
    (cherry pick from 58010b99560eea2027dd39909eb5b35404e6030e)

    faqiang.zhu
     

27 Apr, 2020

2 commits

  • Porting the FSL android fastboot features from imx u-boot v2018.03 to
    support all SoCs: imx6/imx7/imx7ulp/imx8/imx8m.

    The UUU commands like UCmd and ACmd are also added. Users need set
    CONFIG_FASTBOOT_UUU_SUPPORT=y to enable the feature.

    Signed-off-by: Frank Li
    Signed-off-by: Ye Li
    (cherry picked from commit 65120b06a7f750b9b1a6e0db3d2082cc7088d5a8)
    (cherry picked from commit 9b149c2a28829fe7017f83981d634157bc31cc94)

    Ye Li
     
  • Porting the android AVB lib from imx u-boot v2018.03. Since 2019 u-boot
    has added latest AVB library, try to reuse it.

    Signed-off-by: Ye Li
    (cherry picked from commit 2105662ada738a271e12a81d775134a5821dc38f)
    (cherry picked from commit f7291d86c4183ce2e299ad271aa5618c71507ffc)
    (cherry picked from commit b871714c519e1bda3de6afbd354bee2cb246e4b7)

    Ye Li