08 Jan, 2021

1 commit

  • pass imx8 soc revision info to kernel so it can be used to judge
    bootloader0 partition offset in postinstall command and update
    the partition.

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

    faqiang.zhu
     

09 Nov, 2020

1 commit

  • imx8mp has serial number as all zeros, hard code the BT mac
    address for such case instead of setting it by property.

    Test: BT on imx8mp.

    Change-Id: I99f5b49164e1fa40c7fc6ecb639c71fa89158852
    Signed-off-by: Ji Luo
    (cherry picked from commit 501690cb93c4df30700c1bf40f0f2eaed2444503)

    Ji Luo
     

19 Oct, 2020

1 commit

  • Disable unused dts and configs for imx8q to reduce the boot time.

    The 'part_get_info_by_name' can be very time consuming as it will
    loop through all the GPT entries to find the matched partition,
    specify the number of 'misc' partition and use 'part_get_info' to
    load the partition info directly will save much time.

    With this patch, about 300ms can be save for imx8qm, about 350ms
    can be saved for imx8qxp.

    Test: boot tests.

    Signed-off-by: Ji Luo
    Change-Id: I66bc7e002caea62754b670d0a30860a23a17ff61
    (cherry picked from commit d25c0c7b9de22abd6c326975199c86c943e742cf)

    Ji Luo
     

16 Jun, 2020

5 commits

  • GKI(Generic Kernel Image) would require the boot header v3 and vendor
    boot support, all device specific info are moved to vendor_boot partition
    ,the boot header v3 will not be compatible with earlier version(0/1/2).

    This commit adds support for boot header v3 and vendor boot, it would
    concatenate the generic ramdisk and vendor ramdisk to generate the
    final ramdisk passed to kernel.

    Test: boots with or without boot header v3 and vendor boot support.

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

    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
     
  • androidboot.storage_type has been replaced by androidboot.boot_device_root.

    Change-Id: Ibec80808e6ae720be128c0a2d9e2f4d325c56716
    Signed-off-by: Jindong
    (cherry picked from commit 6a5534d13b9e7fe14a457c5f4664b054382d35e3)

    Jindong
     
  • Do not pass BDADDR from uboot cmdline when
    serial is all zero, and instead btmacaddr
    will be set from persist.service.bdroid.bdaddr
    which is set in device's init.freescale.rc

    Change-Id: I429c6f369d0b7aaca643443fe505d943a3901215
    Signed-off-by: yang.tian
    (cherry picked from c23398fb379131ad3c5c17c3d762c582796698fb)

    yang.tian
     
  • 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
    (cherry picked from commit db441a89a090c46149457ee29492bc315c2bdfa9)

    Jindong
     

06 May, 2020

1 commit

  • 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
     

04 Feb, 2020

2 commits

  • Android Boot Image v1 adds "Recovery DTB" field in image header and
    associate payload in boot image itself [1]. Payload should be in
    Android DTB/DTBO format [2]. That "Recovery DTB" area should be only
    populated for non-A/B devices, and only in recovery image.

    Add function to get an address and size of that payload. That function
    can be further used e.g. in 'abootimg' command to provide the user a way
    to get the address of recovery dtbo from U-Boot shell, which can be
    further parsed using 'adtimg' command.

    [1] https://source.android.com/devices/bootloader/boot-image-header
    [2] https://source.android.com/devices/architecture/dto/partitions

    Signed-off-by: Sam Protsenko
    Signed-off-by: Lokesh Vutla

    Sam Protsenko
     
  • Android Boot Image v2 adds "DTB" payload (and corresponding field in the
    image header). Provide functions for its handling:

    - android_image_get_dtb_by_index(): Obtain DTB blob from "DTB" part of
    boot image, by blob's index
    - android_image_print_dtb_contents(): Iterate over all DTB blobs in
    "DTB" part of boot image and print those blobs info

    "DTB" payload might be in one of the following formats:
    1. concatenated DTB blobs
    2. Android DTBO format

    The latter requires "android-image-dt.c" functionality, so this commit
    selects that file for building for CONFIG_ANDROID_BOOT_IMAGE option.

    Right now this new functionality isn't used, but it can be used further.
    As it's required to apply some specific dtbo blob(s) from "dtbo"
    partition, we can't automate this process inside of "bootm" command. But
    we can do next:
    - come up with some new command like "abootimg" to extract dtb blob
    from boot image (using functions from this patch)
    - extract desired dtbo blobs from "dtbo" partition using "adtimg"
    command
    - merge dtbo blobs into dtb blob using "fdt apply" command
    - pass resulting dtb blob into bootm command in order to boot the
    Android kernel with Android ramdisk from boot image

    Signed-off-by: Sam Protsenko
    Signed-off-by: Lokesh Vutla

    Sam Protsenko
     

15 Oct, 2019

1 commit

  • In new versions of Android Boot Image next fields are added to the
    header (and corresponding payloads are added to the image itself):
    - v1: Recovery DTBO
    - v2: DTB

    Account for these new fields in next functions:
    1. android_image_get_end(): as v1 and v2 have new payloads in the
    image, the calculation of image end address should be extended
    correspondingly; this is used e.g. by "bootm" command when booting
    the kernel from Android Boot Image
    2. android_print_contents(): new fields values in v1 and v2 should be
    printed; the result of this function can be seen e.g. in "iminfo"
    command

    This commit doesn't add the means for working with new payloads in v1
    and v2 images (it will be done in further commits), it only updates
    existing functions w.r.t. changes in boot image v1/v2.

    Signed-off-by: Sam Protsenko

    Sam Protsenko
     

12 Aug, 2019

1 commit


25 Jul, 2019

1 commit

  • This allows to use any available compression format with Android boot image

    Since not all available compression formats have a magic number we should
    explicitly specify type of compression.

    For this purpose using uImage format becomes very useful, as this format is
    well-known by the community and mkimage tool is already available.

    Usage example:
    mkimage -A ARM64 -T kernel -C lzma -d Image.lzma out/kernel

    At this moment only -C option is handled, but specifying -A and -T options
    are recommended for compatibility reasons in the future.

    Kernel that compressed with LZ4 can be already used without wrapping into
    the uImage, but I recommend wrapping it into the uImage in order to avoid
    situations when by some mistake legacy LZ4 is used, that is interpreted as
    raw Image and causes CPU to enter Exception Handler without providing any
    meaningful explanation to the user.

    Signed-off-by: Roman Stratiienko

    Roman Stratiienko
     

24 Apr, 2019

2 commits

  • Fix below CP warning triggered by the 'iminfo' output in another patch:
    WARNING: 'addrress' may be misspelled - perhaps 'address'?

    Fixes: 4f1318b29c7a20 ("common: image: minimal android image iminfo support")
    Signed-off-by: Eugeniu Rosca
    Acked-by: Marek Vasut

    Eugeniu Rosca
     
  • According to Android image format [1], kernel image resides at 1 page
    offset from the boot image address. Grab the magic number from there
    and allow U-Boot to handle LZ4-compressed KNL binaries instead of
    hardcoding compression type to IH_COMP_NONE. Other compression types,
    if needed, can be added later.

    Tested on H3ULCB-KF using the image detailed in [2].

    [1] Excerpt from include/android_image.h
    +-----------------+
    | boot header | 1 page
    +-----------------+
    | kernel | n pages
    +-----------------+
    | ramdisk | m pages
    +-----------------+
    | second stage | o pages
    +-----------------+

    [2] => iminfo 4c000000
    ## Checking Image at 4c000000 ...
    Android image found
    kernel size: 85b9d1
    kernel address: 48080000
    ramdisk size: 54ddbc
    ramdisk addrress: 4a180000
    second size: 0
    second address: 48000800
    tags address: 48000100
    page size: 800
    os_version: 1200012a (ver: 0.9.0, level: 2018.10)
    name:
    cmdline: buildvariant=userdebug

    Signed-off-by: Eugeniu Rosca

    Eugeniu Rosca
     

07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

08 Feb, 2018

1 commit

  • The second area of android image was intended to put a 2nd stage
    bootloader but in practice were rarely used (in my knowledge).

    An proposal was made to the AOSP to (re)use the second area as the dtb[1],
    This patch itself doesn't depend on that proposal being accepted but it won't
    be that helpful as well if that proposal won't be accepted. But don't do
    any harm as well.

    [1] https://android-review.googlesource.com/#/c/417447/
    Signed-off-by: Bin Chen
    Reviewed-by: Tom Rini
    Reviewed-by: Kever Yang

    Bin Chen
     

16 Aug, 2017

2 commits

  • We are now using an env_ prefix for environment functions. Rename these
    two functions for consistency. Also add function comments in common.h.

    Quite a few places use getenv() in a condition context, provoking a
    warning from checkpatch. These are fixed up in this patch also.

    Suggested-by: Wolfgang Denk
    Signed-off-by: Simon Glass

    Simon Glass
     
  • We are now using an env_ prefix for environment functions. Rename setenv()
    for consistency. Also add function comments in common.h.

    Suggested-by: Wolfgang Denk
    Signed-off-by: Simon Glass

    Simon Glass
     

12 May, 2017

1 commit

  • Update the Android image header format to the latest version published
    in AOSP. The original code moved to a new repository, so this patch also
    updates the reference to that path.

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

    Alex Deymo
     

25 Jun, 2016

1 commit


12 Oct, 2015

1 commit


09 May, 2015

1 commit

  • The two tools that create android boot images, mkbootimg and the fastboot
    client, set the kernel address by default to 0x10008000.

    U-boot always honors this field, and will try to relocate the kernel to
    whatever value is set in the header, which won't be mapped to the actual RAM on
    most platforms, resulting in the kernel obviously not booting.

    All the targets in U-Boot right now will download the android boot image to
    CONFIG_SYS_LOAD_ADDR, which means that it will already have been downloaded to
    some location that is suitable for execution.

    In order to have the kernel booting even with the default boot image kernel
    address, if that address is used, just execute the kernel where it is.

    Signed-off-by: Maxime Ripard

    Maxime Ripard
     

28 Oct, 2014

1 commit

  • This patch makes the following changes:
    - Set kernel entry point correctly
    - Append bootargs from image to global bootargs instead
    of replacing them
    - Return end address instead of size from android_image_get_end()
    - Give correct parameter to genimg_get_format() in boot_get_ramdisk()
    - Move ramdisk message printing from android_image_get_kernel() to
    android_image_get_ramdisk()

    Signed-off-by: Ahmad Draidi
    Cc: Tom Rini
    Reviewed-by: Simon Glass

    Ahmad Draidi
     

08 May, 2014

1 commit

  • This patch adds support for the Android boot-image format. The header
    file is from the Android project and got slightly alterted so the struct +
    its defines are not generic but have something like a namespace. The
    header file is from bootloader/legacy/include/boot/bootimg.h. The header
    parsing has been written from scratch and I looked at
    bootloader/legacy/usbloader/usbloader.c for some details.
    The image contains the physical address (load address) of the kernel and
    ramdisk. This address is considered only for the kernel image.
    The "second image" defined in the image header is currently not
    supported. I haven't found anything that is creating this.

    v3 (Rob Herring):
    This is based on http://patchwork.ozlabs.org/patch/126797/ with the
    following changes:
    - Rebased to current mainline
    - Moved android image handling to separate functions in
    common/image-android.c
    - s/u8/char/ in header to fix string function warnings
    - Use SPDX identifiers for licenses
    - Cleaned-up file source information:
    android_image.h is from file include/boot/bootimg.h in repository:
    https://android.googlesource.com/platform/bootable/bootloader/legacy
    The git commit hash is 4205b865141ff2e255fe1d3bd16de18e217ef06a
    usbloader.c would be from the same commit, but it does not appear
    to have been used for any actual code.
    v4:
    - s/andriod/android/
    - Use a separate flag ep_found to track if the entry point has been set
    rather than using a magic value.

    Cc: Wolfgang Denk
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Rob Herring
    Reviewed-by: Tom Rini
    Reviewed-by: Lukasz Majewski

    Sebastian Siewior