14 Aug, 2020

1 commit


29 May, 2020

2 commits

  • Align the kernel's clocks enablement to enable the phy_per, misc_per
    clocks for all iMX8, and enable pciex2_per and pcie_phy_pclk for
    pcieb controller of iMX8QM.

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

    Ye Li
     
  • Current codes only ennable the PER clock. However on iMX8 the LPUART
    also needs IPG clock which is an LPCG. Should not depend on the default
    LPCG setting.

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

    Ye Li
     

28 May, 2020

2 commits


27 May, 2020

3 commits

  • Trusty is not supported for xen so we don't need to check
    the keyslot package or rollback index in spl. Reassign the
    dram address for spl and u-boot to avoid conflicts.

    Support serial init functions to enable debug console
    in spl when xen is running.

    Test: Boot and A/B slot switch on imx8qm_mek.

    Change-Id: If6829252f1ec2e32255f951715c8747181951fd0
    Signed-off-by: Ji Luo
    Reviewed-by: Peng Fan
    (cherry picked from commit 30beee3fe6d4b35166c6e17203909231d33bc2db)
    (cherry picked from commit a4ffa905d90d14ccdd146e4b38a69d40a568b747)
    (cherry picked from commit 4729a057e8ad699ec01357dd219abdf296afe354)

    Ji Luo
     
  • Support output/input using `xl console [domid]`.

    Signed-off-by: Peng Fan
    Reviewed-by: Flynn xu
    (cherry picked from commit 75a9833506aa13c1d5a8641c81ac951c41ced55e)
    (cherry picked from commit 5a495c39679b6641d369fc0c9cfdadafd8a408f6)
    (cherry picked from commit 6f3cc8513ac1afe0cf679422ae82c4a5930a8c64)

    Peng Fan
     
  • Add simple debug output when uboot runs in a VM.
    Needs DM_SERIAL disabled, and XEN_DEBUG_SERIAL enabled.

    Signed-off-by: Peng Fan
    (cherry picked from commit b41475b83c8d7c83bd6069f4fea05d3405e81e50)
    (cherry picked from commit 695ae513cdf6c671cda5c32e4a2974e3119450d0)
    (cherry picked from commit d4189c87bbd3a5fd0abc74f7e9ce12a2f86c0de0)
    (cherry picked from commit 6596b48ccdfe420c7e4862cb0ea315750f002ba8)

    Peng Fan
     

26 May, 2020

1 commit

  • Patch "MLK-22755 mx7ulp: wdog: Wait for WDOG unlock and
    reconfiguration to complete", added some flags checking
    to WDOG driver. But the cs2 register access is wrong, should
    use "readb" not "readl".

    This is fine for some compilers (like gcc8.2, gcc9.2) which
    adjusts the access to "ldrb" instruction. However for old
    compilers (like gcc4.9), it won't fix the instruction and cause
    data abort.

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

    Ye Li
     

22 May, 2020

1 commit

  • Wrong variable is check during pcie driver removing (6QP is checked but
    should be 6Q), so iMX6Q won't enter its handling and cause kernel PCI link
    failed to detect.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 0dd8cc03ecc45faaba0297c2832ff6ae307e8f30)

    Ye Li
     

19 May, 2020

7 commits

  • iMX7 and iMX8M pinctrl drivers uses a uninitilized global variable
    for driver data. This variable will put to BSS section by compiler.
    When the driver is called before u-boot relocation, writting to
    the variable will cause u-boot DTB corrupted since the BSS section
    is not initialized that time.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 3a272228c14da17b8a353ef0d50d1b7f41060ca1)

    Ye Li
     
  • To avoid calling devfdt_get_addr_index in bind, which introduces
    much overhead, checks the req_seq and only call the devfdt_get_addr_index
    when the req_seq (usb alias) is not set in DTS

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

    Ye Li
     
  • Current mxc_gpio DM driver allocates the platdata in bind function to
    handle both OF_CONTROL enabled case and disabled case. This implementation
    puts the devfdt_get_addr in bind, which introduces much overhead especially
    in board_f phase.

    Change the driver to a common way for handling the cases by using
    ofdata_to_platdata and using DM framework to allocate platdata.

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

    Ye Li
     
  • Current driver calls the devfdt_get_addr to get the base address
    of lpi2c controller in each sub-functions. Since the devfdt_get_addr
    accesses the DTB and translate the address, it introduces much
    overhead.
    Improve the codes to use private variable which has recorded the
    base address from probe.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 59f728f4a2bdd6b005f7e9f3a33f84c7bce0f677)

    Ye Li
     
  • Remove the child device binding codes for clk and iomux nodes, because
    the misc uclass has added such operation in post-bind. If we keep the
    codes in scu bind, child devices will be created twices. Find the
    problem by "dm uclass" command.

    uclass 24: clk
    0 * clk @ fce22380, seq 0, (req -1)
    1 clk @ fce23110

    uclass 67: pinctrl
    0 * iomuxc @ fce22470, seq 0, (req -1)
    1 iomuxc @ fce231c0

    After the fix:

    uclass 24: clk
    0 * clk @ fce22380, seq 0, (req -1)

    uclass 67: pinctrl
    0 * iomuxc @ fce22470, seq 0, (req -1)

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan
    (cherry picked from commit 927674dd70cda8512f6bbc47a79babd9a3ec4081)

    Ye Li
     
  • Porting the scu api 'sc_misc_get_button_status()' to get the
    ON-OFF button status.

    Test: Get the ON-OFF button status.

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

    Ji Luo
     
  • 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

23 commits

  • Add board level support and configs for standard android and android automotive,
    each board has android/android auto specific header files include.

    Test: boot/fastboot/avb/AB switch/trusty test.

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

    Ji Luo
     
  • dynamic partition feature is not enabled on automotive, so there is
    system partition in GPT, uboot for automotive need to get the info of
    this partition to generate the correct bootargs.

    And also, there is no commandline descriptor as "dm=***" in vbmeta image
    for standard Android after dynamic partition feature is enabled, so
    there is no need to use "strstr" to eleminate this from the bootargs.

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

    faqiang.zhu
     
  • With this patch, the macro MAX_KERNEL_LEN will be set for non-imx8
    SoC and will pass the build.

    Change-Id: I15599546127b843e171b2f177aaf3b3dc33b8baa
    Signed-off-by: Haoran.Wang
    (cherry picked from commit a72c79bc17c0ed3bd3385f8195f3cd35ee223af6)

    Haoran.Wang
     
  • boot_buf was used to point to the memory allocated in do_boota function
    to save boot partition data. now boot partition is loaded by AVB, this
    boot_buf should be removed.

    Change-Id: I614c412b5f7ed980d29106b364a8193c56db13dc
    Signed-off-by: faqiang.zhu
    (cherry picked from commit 2a27f021798e31a8bab37804b053d2b9ebaea928)

    faqiang.zhu
     
  • The Kernel image will get bigger with some debug configs,
    48MB memory is not enough to hold the kernel image and its
    .bss segment now.

    For imx8m, we will reserve 64MB for kernel, 2MB for fdt and
    16MB for ramdisk. For imx8q, we will reserve 60MB for kernel,
    1.5MB for fdt and 16MB for ramdisk.

    Test: boots with 'kasan' enabled.

    Change-Id: I79d8e76c89f4add51bea1a16486c94c0b9f017db
    Signed-off-by: Ji Luo
    (cherry picked from commit 7ee2b20c22242f61e2595dffcb525ebdd54f9257)

    Ji Luo
     
  • We use the 'second_addr' in boot image header to store the
    fdt load address which is set by '--second_offset' parameter,
    but actually we don't pass any 'second' image to it. Now the
    mkbootimg.py will check the 'second' image size and set the
    'second_addr' as 0x0 if no 'second' image is specified.

    Since we don't store dtbs in the boot.img (except recovery dtb
    for legacy platforms), so set the dtb load offset in bootloader.
    The dtb load address will be 'kernel_addr + FDT_OFFSET_TO_KERNEL'
    (48MB memory reserved).

    Test: Boots on imx8mq.

    Change-Id: Ie597731992107ec2343e5ab6db0cab0e123f009c
    Signed-off-by: Ji Luo
    (cherry picked from commit efb9b0c9322f531c15ceedccd2fa9c6c170003a2)

    Ji Luo
     
  • Android implement the userspace fastboot in Android Recovery.
    Follow Google's spec, added below 2 fastboot command support:
    * fastboot getvar is-userspace
    * fastboot reboot fastboot

    TEST: fastboot commands.

    Change-Id: Ib6047413be0a45b3c00626cdb8594809eb8a2b6b
    Signed-off-by: Haoran.Wang
    (cherry picked from commit 314bded076dfc3e544cc7094ce3f6c4c330be4dd)

    Haoran.Wang
     
  • To enable dynamic partition feature, system partition will be a logic
    parition in "super" partition, uboot can't access system partition
    anymore.

    In i.MX Android use case, only vbmeta partition is used to verify other
    imags. boot and system are not used. so there is no need to access
    system partition to get avb device info, remove system partition from
    avb lib.

    Now, standard Android will boot with ramdisk in boot.img, there is no
    need to provide root info to kernel for standard Android. so only
    Android Auto will provide this info.

    Change-Id: I99a43eb8f7aa1dc635e3937c93266f881c9b3655
    Signed-off-by: faqiang.zhu
    (cherry picked from commit 3a2418a1cc097cd956347fc12b0b4e0566652bfd)

    faqiang.zhu
     
  • "is-logical" is used to check whether the partition to be flashed is
    dynamic partition, if it is, a partition resize command will be issued
    by host fastboot. this can be well processed in fastbootd.

    process this "is-logical" in uboot, now there is no logical partition,
    for every partition found in u-boot, returns "no".

    Signed-off-by: faqiang.zhu
    Change-Id: I4d93a0c7b32fed9fe5a5ac846bc4e97bfbe69e67
    (cherry picked from commit 7b27a2290aec78b49ce7c2aed497db858f436eb4)

    faqiang.zhu
     
  • Guard oem unlock permission protection feature with new config
    'CONFIG_TRUSTY_UNLOCK_PERMISSION', so we can enable or disable
    it as needed.

    Test: build and boot on imx8mm.

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

    Change-Id: If1db4b46ecac21b8f187854531704eaff2df30c4

    Ji Luo
     
  • Target mmc dev is not properly switched when the device enters
    fastboot mode via uuu "-i" parameter, which causes "erase"
    operation doesn't work.

    Get and switch the target mmc dev every time before erase operations
    happen.

    Test: "fastboot erase boot_a" in uuu fastboot mode.

    Change-Id: I4822d2b4ecfd2d874dfbe7474d6824b8fc3a7903
    Signed-off-by: Ji Luo
    (cherry picked from commit 46161b62c341139dcdbb13e00634ae8ae903c5da)

    Ji Luo
     
  • To avoid both A/B slots are marked as unbootable because
    of some random failures, we will need to reset at spl stage
    when current slot load/verify fail but already with flag
    "successful_boot" set.

    imx8q can't be reset via the psci driver because the atf
    is not avaiable at spl stage, porting the sc_pm_reboot()
    scu api so we can do reset at spl stage for imx8qm/imx8qxp
    mek boards.

    Test: reset on imx8qm_mek and imx8qxp_mek.

    Change-Id: Ifa0bdea9393e413942a8a0188a4f937fa0aa9ab8
    Signed-off-by: Ji Luo
    (cherry picked from a5c5748101c383bc3afb424a3ef2689ab2664846)

    Ji Luo
     
  • With Android10 code, to build GSI image for devices launching with
    Android10, the target should be "aosp_$arch-user". Google releases GSI
    images is so built in user mode.

    To do CTS-on-GSI test, a debug ramdisk containing .prop file to enable
    adb root permission and GSI keys to verify the GSI image is needed, this
    ramdisk is in boot image. so ramdisk in boot image need to be loaded by
    uboot even in non-recovery mode.

    To save boot time, only standard Android use ramdisk to boot up Android,
    Android Auto keeps the original way: kernel be responsible for verify
    and mount system partition. Let the customers to decide whether to use
    recovery ramdisk to boot the system. and under this condition, user-debug
    Android Auto GSI image need to be used for VTS-on-GSI test.

    when use ramdisk to bootup Android, info provided by "dm=" bootarg is
    not used by kernel to setup dm-verity, so it is removed from the
    bootargs. The 4.19 kernel used together with this uboot does not handle
    "skip_initramfs", so it's also removed.

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

    faqiang.zhu
     
  • Add commands to read oem device unlock state from
    trusty avb app. Use the oem device unlock state to
    determine if the device can be unlocked instead of
    the state in persistdata part.

    Test: Read oem device unlock state from avb app.

    Change-Id: Ifccaa788ba0f681c2b3a47151c8474e8da5a2559
    Signed-off-by: Ji Luo
    (cherry picked from commit c6eaf8e32987f120c0c5441ea39aa0f39a65b50d)

    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
     
  • 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
    (cherry picked from commit 250ef119c1dc02908046113893df5eeb9ef40605)

    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
     
  • 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
    (cherry picked from commit b81f0b617d23548cd30953b94aca4ff8cc4da723)

    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
    (cherry picked from commit 3fc3f521957677b1f363624494ed866985a25505)

    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
    (cherry picked from commit 58965915dd69050429142d3d180c75e98ad14788)

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

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

    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
    (cherry picked from commit dc25b7b27fa5c2293d09789a338a1aed2e3a010f)

    Ji Luo