22 Oct, 2019

1 commit


09 Aug, 2019

1 commit

  • On imx8 platform, the usb2 and usb3 ports are both supported. Which
    means we can use usb2(ci_udc_otg) and usb3(cdns3_generic_peripheral)
    gadget driver to run sdp/fastboot/ums at the same time.

    For sdp and the fastboot that runs automatically when uboot starts,
    board_usb_gadget_port_auto() is added to autodetect usb port, this
    means that we don't have to specify which USB port should be used to
    download in code, now we can just connect either usb port then it
    will download automatically.

    Signed-off-by: Sherry Sun

    Sherry Sun
     

01 Aug, 2019

1 commit

  • We may need to enable the dual bootloader feature on non-trusty
    platforms, skip the bootloader rollback index check in spl if
    trusty is not enabled.

    Don't generate rpmb key in spl, it should be generated in u-boot
    proper with u-boot commands.

    Test: dual bootloader on imx8mm.

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

    Ji Luo
     

25 Jul, 2019

1 commit

  • 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
     

24 Jul, 2019

2 commits


17 Jul, 2019

1 commit

  • 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
     

15 Jul, 2019

3 commits

  • storage_type is emmc or sd, which is not friendly
    for user space, for example android health HAL need access
    /sys/block/mmcblkX/stat.

    Replace it with mmcblkX named as boot_device_root.
    (Keep storage_type for compatibility now)

    Change-Id: I7486d522696e9fe3dde8bdc8834ac11d25df7d79
    Signed-off-by: Jindong

    Jindong
     
  • Serial init in board_init_f will cost much time, skip it here
    because the serial will be initialized again in board_init_r
    and it's more faster (after cache is enabled). We will miss
    some logs before the serial is ready but it's ok for Android Auto.
    This commit will save about 190ms on imx8qm.

    Test: boot ok for both imx8qm and imx8qxp.

    Change-Id: If6efdc19794aecda862f22b6fec7f7aba2005766
    Signed-off-by: Ji Luo
    Reviewed-by: Ye Li

    Ji Luo
     
  • this commit is a merge of three patches from imx_v2018.03 as below:

    1.
    commit dbcf1e3cc079d2f1b3df6c4c9ec3a34d0c05eb4c
    Author: Luo Ji
    Date: Fri Jun 8 10:31:11 2018 +0800

    [iot] Support dual bootloader in SPL

    Move the A/B slot check to SPL, the A/B slot switch
    workflow is just like what we have in libavb_ab.

    Test: A/B select works fine on imx8m.

    2.
    commit 71562aae3b8123ccd7503e596e478951568fcd24
    Author: Ji Luo
    Date: Mon Jan 14 18:28:08 2019 +0800

    MA-13938 [Android] imx8q: Support dual bootloader feature

    Support dual bootloader feature for imx8q which uses the
    container format. Move the A/B slot select and verify to
    SPL stage, the bootloader rollback index will be stored
    at the last 8K bytes of eMMC rpmb storage.

    Test: Boot and rbindex verify pass on imx8q.

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

    Ji Luo
     

09 Jul, 2019

3 commits

  • When download image through ROM API for stream mode (USB, eMMC fastboot).
    We uses tricky way to get the total image size:
    The spl_load_simple_fit is called but the data reading is invalid, so the image
    data is not really downloaded.
    We should not call HAB authenticate in this tricky way. Otherwise it
    will alway fail.
    This patch add a new flag SPL_FIT_BYPASS_POST_LOAD to skip the authentication
    only for this tricky using.

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

    Ye Li
     
  • ROM supports secondary boot which can boot from a new offset specified
    by fuse. So adjust the offset calculation by counting the ROM's image_offset
    parameter for SD/eMMC.
    The secondary boot on flexspi is different like SD/eMMC. ROM will map the
    space of secondary boot to the start of flexspi AHB memory. So it is same
    as primary boot for SPL.

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

    Ye Li
     
  • i.MX8MNano ROM exports APIs to load images from boot device. We use this way
    for SPL loading FIT image. Users need enable CONFIG_SPL_IMX_ROMAPI_SUPPORT
    and set a buffer address via CONFIG_SPL_IMX_ROMAPI_LOADADDR

    Signed-off-by: Ye Li
    Signed-off-by: Frank Li
    (cherry picked from commit 4783e96fa88a7f279a3efee2cc7646bb53c7c1a7)

    Ye Li
     

28 Jun, 2019

1 commit


18 Jun, 2019

1 commit

  • Previous patch "MLK-21885 lmb: Handle the overlap case for lmb reserve" adds
    the overlap support to lmb reserve. However, u-boot has some places to use the
    lmb_reserve when allocating memory in loading images. If we allowed overlap
    in this function, it means images loading address can overlap each other and
    cause the address check mechanism not work.

    So add another function to allow overlap and only use it for fdt reserved-memory
    nodes. The FDT reserved-memory is ok to merge with other reserved memory, since
    this won't break image loading address check.

    Signed-off-by: Ye Li

    Ye Li
     

24 May, 2019

19 commits

  • For Some USB mass storage devices, such as:
    "
    - Kingston DataTraveler 2.0 001D7D06CF09B04199C7B3EA
    - Class: (from Interface) Mass Storage
    - PacketSize: 64 Configurations: 1
    - Vendor: 0x0930 Product 0x6545 Version 1.16
    "
    When `usb read 0x80000000 0 0x2000`, we met
    "EHCI timed out on TD - token=0x80008d80".

    The devices does not support scsi VPD page, we are not able
    to get the maximum transfer length for READ(10)/WRITE(10).

    So we limit this to 256 blocks as READ(6).

    Signed-off-by: Peng Fan
    (cherry picked from commit df0052575b2bc9d66ae73584768e1a457ed5d914)
    (cherry picked from commit 0716cc14a3739e9d161f5d0c3a0bebf0272759f9)
    Signed-off-by: Ye Li

    Peng Fan
     
  • The SPL loads the FIT image FDT part to an address related with the device
    block length. This length is 512 for SD/MMC and is 1 for other devices
    like SDP, NOR, NAND, SPI, etc.
    When signing FIT image, we use fixed address caculated by SD/MMC block length
    to sign FDT part. Thus, when booting through uuu, this causes mismatch and
    gets authentication failed.

    Fix the issue by providing a override function for this FIT buffer address.
    When secure boot is enabled, adjust the addresses of other devices to be same
    with SD/MMC.

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

    Ye Li
     
  • When booting from USB device, change u-boot autoboot to default
    run UUU bootcmd or enter fastboot directly for android.

    Signed-off-by: Ye Li

    Ye Li
     
  • Use trusty_os_init to load Trusty OS from CONFIG_TRUSTY_OS_ENTRY
    before u-boot ready.

    Add Trusty OS SOC level codes and u-boot/SPL common codes.

    Signed-off-by: Ye Li
    Signed-off-by: Haoran.Wang
    (cherry picked from commit 1ae9ecc73f5001b8bd743011c06a7d07861be64e)

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

    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)

    Ye Li
     
  • Support EPDC.
    E-Ink feature is supported by i.MX6DL/SL/SLL/ULL and i.MX7D.

    This driver supports user defined logo file, if there is no logo file, it will
    draw a black border around a white screen.

    If need to enable EPDC, a waveform file is required to let all
    work.

    Since we need LCD_MONOCHROME mode for EPDC, we introduce LCD_MONOCHROME
    support.

    Please refer to Linux Reference Manual for how to flash WAVEFORM file.

    Signed-off-by: Peng Fan
    Signed-off-by: Robby Cai
    Signed-off-by: Nitin Garg
    Signed-off-by: Ye.Li
    (cherry picked from commit a7244f279cc3c3994bcd103f5e9a183b1075ae71)
    (cherry picked from commit 21bf1c38b7d75c31875fb02a972c458f25d9c33a)

    Peng Fan
     
  • Since FSPI is assigned to M4 partition, A core only can read it from its
    memory-map address. So we have to enable SPL NOR which won't access
    flexspi driver.

    Update SPL container parser for the RAW NOR support.

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

    Ye Li
     
  • The RAW image support must be disabled, otherwise a RAW image can be used
    to bypass FIT image.

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

    Ye Li
     
  • Add the NAND support to SPL container parser and enable it for imx8qxp arm2
    nand reworked board.
    The SPL NAND will read from nandfit mtdpart (128MB offset) to parsing the entire
    boot image and get the 3rd container from it. This requires burning tool (uuu)
    to program the entire boot image into nandfit.

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

    Ye Li
     
  • Because SDP directly jumps to next level boot image, we'd better
    clean up the USB driver before it. Implement a weak callback function,
    that spl sdp can use it to clean up USB driver.

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

    Ye Li
     
  • Add a new configuration CONFIG_SPL_SDP_USB_DEV to specify the
    usb index for spl sdp driver, so that we change use different device.
    The default value is 0.

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

    Ye Li
     
  • Need initialize UDC before run sdp download

    Signed-off-by: Frank Li
    (cherry picked from commit ab6696c4f7ff3f13153e27b696fcbf38188b009a)

    Frank Li
     
  • Before parsing the image header, try to check if there is a container and
    validate it first. If no (valid) container then as a fall-through parse
    the image as before.

    Signed-off-by: Abel Vesa
    Reviewed-by: Ye Li
    (cherry picked from commit 2bd8277fd7eceed3aa4b07b6fe238b7beef62530)

    Abel Vesa
     
  • This intends to replace the FIT image support since that cannot be
    authenticated. Instead, we append another container at the end of
    flash.bin, this new one containing a new container with two
    images representing the ATF and uboot proper.

    Signed-off-by: Abel Vesa
    Reviewed-by: Ye Li
    (cherry picked from commit c853049068ba2026cf91a6268958913db379a432)

    Abel Vesa
     
  • Add implementation necessary for supporting SPL loading image from NAND.

    Signed-off-by: Teo Hall
    (cherry picked from commit fe6af144930a0a32cbc4599635a96c8a629432a1)

    Teo Hall
     
  • This transforms almost all related functions from mmc specific to device
    independent. This allows the container size to be computed from QSPI and other
    future devices that will be supported for boot.

    Signed-off-by: Abel Vesa
    Reviewed-by: Ye Li
    (cherry picked from commit c70afc348ee9fae242f00be56cde556822f93156)

    Abel Vesa
     
  • Add a weak function spl_mmc_get_uboot_raw_sector to get u-boot raw sector.
    At default it returns CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR. Users
    can overwrite it to return customized offset.

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

    Ye Li
     
  • Current print_cpuinfo gets the first udevice in CPU class to return
    the cpu info. This has problem if the boot CPU is not fixed.

    Change to use new API cpu_get_current_dev to resolve the issue.

    Signed-off-by: Ye Li

    Ye Li
     

23 Mar, 2019

2 commits

  • Currently, 'dtimg' allows users to check indexes equal to
    dt_entry_count [1]. Forbid that [2].

    [1] Behavior w/o the patch:

    => ext2load mmc 0:1 0x48000000 dtb.img
    105695 bytes read in 5 ms (20.2 MiB/s)

    => dtimg dump 0x48000000
    dt_table_header:
    magic = d7b7ab1e
    total_size = 105695
    header_size = 32
    dt_entry_size = 32
    dt_entry_count = 2
    dt_entries_offset = 32
    page_size = 4096
    version = 0
    dt_table_entry[0]:
    dt_size = 105599
    dt_offset = 96
    id = 0b779520
    rev = 00000000
    custom[0] = 00000000
    custom[1] = 00000000
    custom[2] = 00000000
    custom[3] = 00000000
    (FDT)size = 105599
    (FDT)compatible = shimafuji,kingfisher
    dt_table_entry[1]:
    dt_size = 105599
    dt_offset = 96
    id = 0b779530
    rev = 00000000
    custom[0] = 00000000
    custom[1] = 00000000
    custom[2] = 00000000
    custom[3] = 00000000
    (FDT)size = 105599
    (FDT)compatible = shimafuji,kingfisher

    => dtimg size 0x48000000 0 z; print z
    z=19c7f
    => dtimg size 0x48000000 1 z; print z
    z=19c7f
    => dtimg size 0x48000000 2 z; print z
    z=d00dfeed
    => dtimg size 0x48000000 3 z
    Error: index > dt_entry_count (3 > 2)

    [2] Behavior with the patch:

    => dtimg size 0x48000000 0 z; print z
    z=19c7f
    => dtimg size 0x48000000 1 z; print z
    z=19c7f
    => dtimg size 0x48000000 2 z
    Error: index >= dt_entry_count (2 >= 2)

    Fixes: c04473345712 ("common: Add support for Android DT image")
    Signed-off-by: Eugeniu Rosca

    Eugeniu Rosca
     
  • If FIT_IMAGE_TINY is enabled, spl_fit_image_get_os returns -ENOTSUPP.
    In this case, we should default to IH_OS_U_BOOT not to IH_OS_INVALID.

    Signed-off-by: Abel Vesa
    Tested-by: Fabio Estevam

    Abel Vesa
     

09 Mar, 2019

1 commit

  • Handle in boot_fdt_reserve_region
    any return value > 0 of lmb_reserve() function;
    it occurs when coalesced region are found:
    adjacent reserved region are merged.

    This patch avoid the error trace:
    ERROR: reserving fdt memory region failed..
    when reserved region are merged (return value = 1).

    Signed-off-by: Patrick Delaunay

    Patrick Delaunay
     

01 Mar, 2019

1 commit


23 Feb, 2019

1 commit


20 Feb, 2019

1 commit