summaryrefslogtreecommitdiff
path: root/common/image-android.c
AgeCommit message (Collapse)Author
2019-07-05MA-15082 Do not pass btmacaddr from uboot if serial is all zeroyang.tian
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 <yang.tian@nxp.com>
2019-05-30MA-14898 Fix build warningsJi 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@nxp.com>
2019-05-13MA-14712 change androidboot.storage_type to androidboot.boot_device_rootJindong
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.yue@nxp.com>
2019-03-18env variable to specify androidboot.storage_typeAdrian Negreanu
The boota command boots an Android already written to mmc/emmc. It calls get_boot_device() to figure out where to look for Android; but when a board is booted over serial, get_boot_device() returns an invalid boot mode. Explicitly setting the storage_type will enable boota on a board booted over serial. FB: ucmd setenv storage_type emmc FB: ucmd boota Signed-off-by: Adrian Negreanu <adrian.negreanu@nxp.com>
2019-02-21MA-14120 Add config to guard append bootargs supportJi Luo
Grant user the permission to change the bootargs can be very dangerous, so add config 'CONFIG_APPEND_BOOTARGS' to guard the bootargs appending feature. Test: bootargs can't be appended if "CONFIG_APPEND_BOOTARGS" is not set. Change-Id: I6d6879415ca251c806b56490290e5032aef24277 Signed-off-by: Ji Luo <ji.luo@nxp.com>
2019-01-07MA-13879-2 Revert adding bootargs for multi-vendor of 8mmyang.tian
Remove this patch to specify wifi vendor info from uboot, instead we directly add the bootargs in cmdline. Revert commit 9f1a11bdc3fef58bc41bebec858ccab0cd9050e4 MA-13879[wifi concurrency] Add bootargs to set a property for wifi vendor of 8mm Change-Id: Icf7e89df2b4993f6e17a6b7cf38b891591f680d7 Signed-off-by: yang.tian <yang.tian@nxp.com>
2019-01-03MA-13879[wifi concurrency] Add bootargs to set a property for wifi vendor of 8mmyang.tian
Since evk_8mm will support both QCA9377 and BCM43455 wifi, add bootargs to pass a property to differ which wifi is used. Change-Id: I83f7fd657dbdedc54931148cd6dd3d59563b6ec3 Signed-off-by: yang.tian <yang.tian@nxp.com>
2018-12-11MA-13748 Pass BDADDR from uboot cmdlineyang.tian
Pass bt mac address from uboot cmdline to write ro.boot.btmacaddr property for bluetooth hal to parse BDADDR which is composed from ro.boot.serialno, or it will fall back to persist property seted in init.rc. Change-Id: If6886596c79c699b8530d3249b1cc98f19aad51f Signed-off-by: yang.tian <yang.tian@nxp.com>
2018-11-21MA-13480-1 [Auto] Fix XEN hang with wrong keymaster serviceJi Luo
Pass "androidboot.keystore=trusty" for trusty backed keymaster service, pass "androidboot.keystore=software" for software keymaster service. Test: boot pass on imx8qm_mek. Change-Id: I9fa38c15a7c10aef09ab29b0e9859b690e3e7a41 Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-11-12Set different bootargs for imx8m_phanbell based on ram capacityfaqiang.zhu
for 1GB ram: cma=296M galcore.contiguousSize=8388608 for 3GB ram: cma=384M Test: Boot successfully on AIY-1G & AIY-3G Change-Id: If082d5b751b5a5e06efe301c0b8e49ec4ac3dfb7 Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com> Reviewed-on: http://androidsource.ap.freescale.net/project/5262 Reviewed-by: Wang Haoran <elven.wang@nxp.com> Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
2018-11-02MA-13276 [Auto] Generate key blob when set the rpmb keyJi Luo
Generate the key blob and store it to the last block of boot1 partition after setting the rpmb key. The key blob should be checked in spl and be passed to Trusty OS if it's valid. If the key blob are damaged, RPMB storage proxy service will return fail and should make the device hang. Test: Build and boot ok on imx8qm/qxp. Change-Id: Ia274cd72109ab6ae15920e91b2a2008e1f1e667c Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-09-28MA-12943 [VTS] Fix firmware dtbo verify failJi Luo
VTS need commandline 'androidboot.dtbo_idx=<dtb_index_in_dtbo>' to verify fdt overlay. Pass the dtb index as "0" here since we only have one dtb in dtbo partition and haven't enabled the dtb overlay. Test: VTS case "VtsFirmwareDtboVerification#testVerifyOverlay" pass on imx8mq and imx8qxp. Change-Id: I33b089bf5a945e0b558bbb189b183a38f145dcbe Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-09-27MA-12915 [AUTO] Only print kernel command line in debug modeJi Luo
Print the kernel command line in normal mode will consume about 122ms on imx8qm, move the log print to debug mode to save some boot time. Change-Id: I5996555cf3f210be8ea25111d2bc84e0d06caa5c Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-09-26MA-12886 Set keymaster HAL to trusty when use Trusty OSHaoran.Wang
When use Trusty OS, set the property keymaster HAL to use the Trusty OS backed one. This patch make the bootloader able to control the Android Keymaster HAL. Change-Id: I0a533c12b99824ef499ce642cf87c22d72b51503 Signed-off-by: Haoran.Wang <elven.wang@nxp.com>
2018-09-13MA-12703 Android: Read bootargs from u-boot dtsLuo Ji
Load bootargs from the "/chosen/bootargs" dts node and combine it with the bootargs in bootimage header. Change-Id: I68c9b0d53fff1f51c4d91aa513dfd38b5d9650d4 Signed-off-by: Luo Ji <ji.luo@nxp.com>
2018-09-11MA-12335 Canonical Boot Reason in Android Pie 9.0Ji Luo
Read boot reason from SRC(system reset controller) and report it to kernel by "androidboot.bootreason=<>" kernel commandline. This is enabled on imx6/7/7ulp/8m, imx8 will report default value "androidboot.bootreason=reboot" since it can't get such info on A core at u-boot stage. Test: Boot reason report ok on imx6qp/imx7ulp/imx8qxp. Change-Id: I03effaa03bc513bec6153e82c1a04e29c07e7db8 Signed-off-by: Ji Luo <ji.luo@nxp.com>
2018-06-13MLK-18591-3 android: Add FSL android fastboot supportYe Li
Porting the FSL android fastboot features from imx u-boot v2017.03 to support all SoCs: imx6/imx7/imx7ulp/imx8/imx8m Signed-off-by: Ye Li <ye.li@nxp.com>
2018-02-07parse the second area of android imageBin Chen
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 <bin.chen@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass
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 <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename setenv() to env_set()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 <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-05-11image: Update include/android_image.hAlex Deymo
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 <deymo@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-06-24common: image: minimal android image iminfo supportMichael Trimarchi
We already support iminfo for other images. The idea of this patch is start to have a minimal support for android image format. We still need to print id[] array Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-10-11image: fix support for Android boot images with no ramdiskRob Herring
If an Android boot image does not contain a ramdisk, make sure rd_len and rd_data are returned to indicate no ramdisk rather than just relying on returning an error. Signed-off-by: Rob Herring <robh@kernel.org>
2015-05-08image: android: handle default kernel addressMaxime Ripard
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@free-electrons.com>
2014-10-27image: Fix Android boot image supportAhmad Draidi
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 <ar2000jp@gmail.com> Cc: Tom Rini <trini@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2014-05-08image: add support for Android's boot image formatSebastian Siewior
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 <wd@denx.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Tom Rini <trini@ti.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>