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

4 commits

  • 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
     
  • The polarity of PCIE reset gpio is wrong in imx6qp-sdb DTS, which
    causes PCIE link failed to setup on iMX6QP.

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

    Ye Li
     
  • The main memory contents can spontaneously come to the cache due to
    the speculative memory access by the CPU, this may cause coherency
    problem if this happens during the DMA operaion is on-going.

    Invalidate the dcache range after DMA opeartion but before the main
    memory read to avoid coherency problem.

    Test: reboot test.

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

    Ji Luo
     
  • When UUU runs acmd command to boot into kernel, the fastboot never
    get chance to exit, so the usb gadget is not disconnected. This causes
    kernel USB gadget failed to work.

    Re-use iMX8MQ implementation to disconnect DWC3 gadget before jumping
    to kernel.

    Signed-off-by: Ye Li
    Reviewed-by: Jun Li
    (cherry picked from commit bb8aaeb2ba407542f6cadeb2274927dd4280c0cd)

    Ye Li
     

21 May, 2020

2 commits

  • Open configs to enable bootloader menu feature for imx7ulp.

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

    Ji Luo
     
  • According to the spec of android wear, the device MUST provides a
    bootloader menu for debugging purpose.

    This commit implements a simple bootloader menu based on imx7ulp_evk
    revb board, the menu will show when booting with 'VOL+' key pressed,
    users can press "VOL+" to choose the item, then press "ONOFF" key to
    confirm.

    Test: bootloader menu show on imx7ulp_evk revb.

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

    Ji Luo
     

20 May, 2020

1 commit


19 May, 2020

14 commits

  • Fix fec phy addr for network support on imx8mn/imx8mn
    audio board 2 targets

    Reviewed-by: Ye Li
    Signed-off-by: Adrian Alonso
    (cherry picked from commit cef3045bd7cc620051c8dd8e9248157d19b4514f)

    Adrian Alonso
     
  • Increase timeout to allow phy net negotiation for
    imx8mm/imx8mn audio board 2.0 targets

    Reviewed-by: Ye Li
    Signed-off-by: Adrian Alonso
    (cherry picked from commit 4624ee792fc3e46bc40c63b7675e73cd87f9c01c)

    Adrian Alonso
     
  • 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
     
  • Current iMX8QM DTSi is a version with full nodes, but this introduces
    overhead in u-boot initf_dm phase because the initf_dm will search all
    subnodes of the root. This is does not like SPL which has slimmed the
    DTB.

    During initf_dm the dcache is not enabled, so the overhead is large
    if we have many unused nodes in the DTS. This patch removed iMX8QM
    nodes those we won't ever used in SPL/u-boot, like VPU/GPU, Audio,
    camera, M4 i2c, flexcan, pwm, etc.

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

    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
     
  • Open configs to enable the avb warning logo feature for all
    standard android platforms.

    Test: Warning logo show on imx7ulp/imx8m/imx8q.

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

    Ji Luo
     
  • Add board level implementation to get the ON-OFF button
    status for imx8q/imx8m.

    Test: Get ON-OFF button status on imx7ulp/imx8m/imx8q.

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

    Ji Luo
     
  • 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
     
  • Open configs to enable splash screen feature for standard
    android.

    Test: Splash screen show on all imx7ulp/imx8/imx8m platfroms.

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

    Ji Luo
     
  • Some gpio pins are disabled for automotive to save boot time, but now
    we need to enable them on uboot 2020 or the display won't work.

    Test: boots with lvds-hdmi display on imx8qm.

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

    Ji Luo
     

18 May, 2020

18 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
     
  • 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
     
  • Include correct header files to avoid build warning:
    common/image-android.c:151:68: warning: implicit declaration
    of function ‘mmc_get_env_dev’ [-Wimplicit-function-declaration]
    " androidboot.boot_device_root=mmcblk%d", mmc_map_to_kernel_blk(mmc_get_env_dev()));

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

    Ji Luo
     
  • camera sometime can't been open once run M4 image.
    ISI-CH0 probe funtion is not called when meet issue.

    The root cause is:
    M4 image set assign resource SC_R_ISI_CH0 into m4 partition
    when open camera in m4 side.
    Uboot will call update_fdt_with_owned_resources to check
    the pd in current dts node. it will call sc_rm_is_resource_owned to
    check the pd whether in other partition, if yes, it will delete
    the dts node. uboot delete isi_0 node whose pd is SC_R_ISI_CH0.

    add CONFIG_SKIP_RESOURCE_CHECKING to skip checking resource when load
    dtb.

    Change-Id: Iaf9a5eda07074c45c15c43f23cb6ad6b5a77de47
    Signed-off-by: zhang sanshan

    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
     
  • Android use AVB to verify the kernel, hab authentication is
    not necessary for boot image.

    For imx8m, don't authenticate the kernel image when AVB
    (CONFIG_AVB_SUPPORT) is enabled. For imx8q, as android uses
    different 'CONFIG_EXTRA_ENV_SETTINGS' and 'CONFIG_BOOTCOMMAND'
    with linux bsp, so it won't try to do kernel hab authentication.
    by default.

    Test: boot imx8mp with "CONFIG_IMX_HAB" and imx8qxp with
    'CONFIG_AHAB_BOOT'.

    Change-Id: I1b2087ce7d8f9795422a053b6b68a694c86f0b3d
    Signed-off-by: Ji Luo
    (cherry picked from commit f907e4ac090e960ba5110b8039cccc4296841595)

    Ji Luo
     
  • 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
     
  • Add mmc board level implementation for imx8mp, so we can support
    boot from mmc besides ROMAPI.

    Test: eMMC/SD boot.

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

    Ji Luo
     
  • Only limited heap memory is available on imx8q platforms due
    to some memory is reserved for m4 image. Commit cd67414 will
    free avb verify data and thus help decrease the heap memory
    consumption.

    But when the device is locked, avb will try to verify one slot
    first, it will continue to verify another if the first slot
    returns failure. Function load_full_partition() will alloc memory
    to load boot/dtbo images from heap (which is a big and continuous
    memory region), this memory will be freed if the first slot returns
    verify failure. but because part of the continous memory region
    will be used in following verify process, even total available memory
    is enough, u-boot can't find a continous memory region to load the
    boot/dtbo image for another slot and will return error "Failed to
    allocate memory".

    Instead, this commit use fixed memory region start from 96MB offset of
    CONFIG_FASTBOOT_BUF_ADDR to load the boot/dtbo images.

    Test: slot verify and A/B slot switch.

    Change-Id: Ifc83bed5a6be37196c0fd109d942eaf9b07b6a74
    Signed-off-by: Ji Luo
    (cherry picked from commit d13752e831957fb84c71f8ca24fd1979d3605cde)

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