summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2020-05-18MA-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>
2020-05-18MA-15678 image-android: remove deprecated androidboot.storage_typeJindong
androidboot.storage_type has been replaced by androidboot.boot_device_root. Change-Id: Ibec80808e6ae720be128c0a2d9e2f4d325c56716 Signed-off-by: Jindong <jindong.yue@nxp.com> (cherry picked from commit 6a5534d13b9e7fe14a457c5f4664b054382d35e3)
2020-05-18MA-15158 Set spl recovery mode for dual bootloaderJi 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 <ji.luo@nxp.com> (cherry picked from commit 46cc755cf3f42422ee1d7783394e14e8125df2b6)
2020-05-18MA-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> (cherry picked from c23398fb379131ad3c5c17c3d762c582796698fb)
2020-05-18MA-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> (cherry picked from commit db441a89a090c46149457ee29492bc315c2bdfa9)
2020-05-18MA-12973 [AUTO] Skip serial init in board_init_fJi Luo
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 <ji.luo@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 690a14ed2fc64328b417a9de448f4a18cc653698)
2020-05-18MA-14916-4 support dual bootloader for imx8m/imx8qJi Luo
This commit enables dual bootloader feature for imx8m/imx8q, but as commit 'a2018ab' already brings in some dual bootloader codes when enabling fastboot support, so this commit won't be a complete and standalone patch to introduce the dual bootloader feature. This commit will do the following: 1. clean up dual bootloader flow and add missing implementation. 2. Merge the dual bootloader entry for fit and container to one function 'mmc_load_image_raw_sector_dual_uboot'. Change-Id: Ic9410a48092cc05de599dd897fc912177e2a1fe1 Signed-off-by: Ji Luo <ji.luo@nxp.com>
2020-05-11MLK-23964-3 splash: Fix build warning on 64 bits CPUYe Li
Meet below warning on ARM64 platform, because the bmp_load_addr is defined to u32. common/splash.c: In function ‘splash_video_logo_load’: common/splash.c:74:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 74 | memcpy((void *)bmp_load_addr, bmp_logo_bitmap, Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 037db06f9441b0e889c730f78874d3b120942ea9)
2020-05-11MLK-23964-1 video: Add video link frameworkYe Li
The video link framework bases a port-endpoint gragh in DTB to connect the video components in uclass like: video, display, bridge, and panel. Using the port-endpoint gragh, we manage multiple video link and user can select one of them for splash screen. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit d6e6b1293f89b8a26033ac2f82151985f70e4036)
2020-04-26MLK-22357-2 sdp/fastboot: Add board_usb_gadget_port_auto() to autodetect the ↵Sherry Sun
connected usb port 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@nxp.com> (cherry picked from commit 2b6fd3da6fffae0732e8e91ef5c1f870ea393ca9)
2020-04-26MLK-22078 romapi: Fix issue for stream mode with secure boot enabledYe Li
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 <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 47b0cf6de06ff9b3e2b2755d5c8203210378b26a) (cherry picked from commit 3e50573a7007771586e737b343bdde4d98c21c23)
2020-04-26MLK-22045-2 sdp: Add DM gadget support for sdpSherry Sun
When enable CONFG_SPL_DM_USB_GADGET, sdp should use usb_gadget_initialize() and usb_gadget_release() to support DM gadget driver. Signed-off-by: Sherry Sun <sherry.sun@nxp.com> (cherry picked from commit 22b59b69af0bfc0a2aeff9a995252d58c77c3955)
2020-04-26MLK-22035-1 lmb: Add lmb_reserve_overlap for fdt reserved memoryYe Li
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@nxp.com> (cherry picked from commit 2109dc2a4da592003ec62820f5bdfb6bd0899805)
2020-04-26MLK-20467 imx8m: Fix issue for booting signed image through uuuYe Li
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 <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 710efd3ccb99e144bd30af8e1ee46459b4a54dd6) (cherry picked from commit f48835f0b6b801cb267b4c27a50136c93dfd3bcf)
2020-04-26MLK-21854-2 imx: uuu: Update autoboot to run uuu or fastbootYe 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@nxp.com> (cherry picked from commit eba8710106348a283940b851080b049bc7fbe466)
2020-04-26MLK-18591-6 android: iot: Add boot Trusty OS codes for i.MX SoCsYe 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 <ye.li@nxp.com> Signed-off-by: Haoran.Wang <elven.wang@nxp.com> (cherry picked from commit 1ae9ecc73f5001b8bd743011c06a7d07861be64e) (cherry picked from commit 6fa4f4a42fd90631f8dc8303b17f600c085d8595)
2020-04-26MLK-18591-3 android: Add FSL android fastboot supportYe 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 <Frank.Li@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 65120b06a7f750b9b1a6e0db3d2082cc7088d5a8) (cherry picked from commit 9b149c2a28829fe7017f83981d634157bc31cc94)
2020-04-26MLK-18591-1 android: Add the AVB libraryYe 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 <ye.li@nxp.com> (cherry picked from commit 2105662ada738a271e12a81d775134a5821dc38f) (cherry picked from commit f7291d86c4183ce2e299ad271aa5618c71507ffc) (cherry picked from commit b871714c519e1bda3de6afbd354bee2cb246e4b7)
2020-04-26MLK-12425-2 video: epdc: introduce epdc supportPeng Fan
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 <peng.fan@nxp.com> Signed-off-by: Robby Cai <R63905@freescale.com> Signed-off-by: Nitin Garg <nitin.garg@freescale.com> Signed-off-by: Ye.Li <B37916@freescale.com> (cherry picked from commit a7244f279cc3c3994bcd103f5e9a183b1075ae71) (cherry picked from commit 21bf1c38b7d75c31875fb02a972c458f25d9c33a) (cherry picked from commit 237742f73998b35dd896592e19f1e119e72baa71)
2020-04-26MLK-20559-5 f_sdp: Add a callback to clean up USB driverYe 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 <ye.li@nxp.com> (cherry picked from commit 1f6b3efc62cb277fd4316d8ed5115f47b09369a0) (cherry picked from commit a3ed6467a4efb7acaa15281ec2c37e7f051b00db)
2020-04-26MLK-20559-1 spl_sdp: Add CONFIG_SPL_SDP_USB_DEV for USB deviceYe 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 <ye.li@nxp.com> (cherry picked from commit dba0d7c7dc3b9b60043726931b1f635b725e9756) (cherry picked from commit c2da455b3d690d1d0bafece240360a288dad661a)
2020-04-26MLK-19181-1: sdp: call board_usb_init at spl_sdp_load_imageFrank Li
Need initialize UDC before run sdp download Signed-off-by: Frank Li <Frank.Li@nxp.com> (cherry picked from commit ab6696c4f7ff3f13153e27b696fcbf38188b009a) (cherry picked from commit 9f0962216f852a7f5ade66bbf66f57a36654a5bd)
2020-04-26MLK-20664-2 imx8/imx8m: Disable the SPL RAW image supportYe Li
The RAW image support must be disabled, otherwise a RAW image can be used to bypass FIT image. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit ca7ebfcf0737699d5f62f97be4b0015c88108ae7) (cherry picked from commit 9e9524c86a08d5b16bb94c1a30eda378536c4860)
2020-04-23MLK-21828-2 common: board_f: Use cpu_get_current_dev in print_cpuinfoYe 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@nxp.com> (cherry picked from commit 30b9f6f88e4e310a03458eecee5f594ebd218564)
2020-04-09usb: Keep async schedule running only across mass storage xfersMarek Vasut
Rather than keeping the asynchronous schedule running always, keep it running only across USB mass storage transfers for now, as it seems that keeping it running all the time interferes with certain control transfers during device enumeration. Note that running the async schedule all the time should not be an issue, especially on EHCI HCD, as that one implements most of the transfers using async schedule. Note that we have usb_disable_asynch(), which however is utterly broken. The usb_disable_asynch() blocks the USB core from doing async transfers by setting a global flag. The async schedule should however be disabled per USB controller. Moreover, setting a global flag does not prevent the controller from using the async schedule, which e.g. the EHCI HCD does. This patch implements additional callback to the controller, which permits it to lock the async schedule and keep it running across multiple transfers. Once the schedule is unlocked, it must also be disabled. This thus prevents the async schedule from running outside of the USB mass storage transfers. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Tom Rini <trini@konsulko.com> Tested-by: Tom Rini <trini@konsulko.com> [omap3_beagle, previously failing]
2020-04-03Revert "common: spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled"Ye Li
Commit cf8dcc5d02c3 ("common: spl_fit: Default to IH_OS_U_BOOT if FIT_IMAGE_TINY enabled") is not correct, it will append fdt to each loadable image. Actually when using TINY FIT, the first loadable image is thought as u-boot and already have fdt appended. Signed-off-by: Ye Li <ye.li@nxp.com> Tested-by: Fabio Estevam <festevam@gmail.com>
2020-04-02rockchip: Enable pre console for rk3399Jagan Teki
Enable pre console buffer for rk3399 platform. This would help to capture the console messages prior to the console being initialised. Enabling this would help to capture all the console messages on video output source like HDMI. So we can find the full console messages of U-Boot proper on HDMI display when enabled it for RK3399 platform boards. Buffer address used for pre console is 0x0f200000 which is ram base plus 240MiB. right now the Allwinner SoC is using similar computation. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Tested-by: Peter Robinson <pbrobinson@gmail.com>
2020-04-01image: Use constants for 'required' and 'key-name-hint'Simon Glass
These are used in multiple places so update them to use a shared #define. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-04-01image: Load the correct configuration in fit_check_signSimon Glass
At present bootm_host_load_images() is passed the configuration that has been verified, but ignores it and just uses the default configuration. This may not be the same. Update this function to use the selected configuration. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-01image: Check hash-nodes when checking configurationsSimon Glass
It is currently possible to use a different configuration's signature and thus bypass the configuration check. Make sure that the configuration node that was hashed matches the one being checked, to catch this problem. Also add a proper function comment to fit_config_check_sig() and make it static. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-01image: Return an error message from fit_config_verify_sig()Simon Glass
This function only returns an error message sometimes. Update it to always return an error message if one is available. This makes it easier to see what went wrong. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-01image: Be a little more verbose when checking signaturesSimon Glass
It is useful to be a little more specific about what is being checked. Update a few messages to help with this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-01image: Correct comment for fit_conf_get_node()Simon Glass
This should mention that conf_uname can be NULL and should be in the header file. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-03-31image-fit: Allow loading FIT image for VxWorksLihua Zhao
This adds the check against IH_OS_VXWORKS during FIT image load, to allow loading FIT image for VxWorks. Signed-off-by: Lihua Zhao <lihua.zhao@windriver.com> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-03-13fit: check return value of fit_image_get_data_size()Heinrich Schuchardt
GCC-10 reports: In file included from tools/common/image-fit.c:1: include/image.h: In function ‘fit_image_get_data_and_size’: ./tools/../common/image-fit.c:1015:9: warning: ‘len’ may be used uninitialized in this function [-Wmaybe-uninitialized] 1015 | *size = len; | ~~~~~~^~~~~ ./tools/../common/image-fit.c:996:6: note: ‘len’ was declared here 996 | int len; | ^~~ Add the missing check of the return value of fit_image_get_data_size(). Fixes: c3c863880479 ("add FIT data-position & data-offset property support") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2020-03-09spl: mmc: Fix spl_mmc_get_uboot_raw_sector() implementationFaiz Abbas
The call to spl_mmc_get_uboot_raw_sector() completely ignores and overwrites the raw_sect value passed from the caller of spl_mmc_load(). Fix this by passing raw_sect to the function and returning the same value in the default case. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2020-02-19rockchip: rk3288: Enable pre console bufferJagan Teki
Enable pre console buffer for rk3288 platform. This would help to capture the console messages prior to the console being initialised. Enabling this would help to capture all the console messages on video output source like HDMI. So we can find the full console messages of U-Boot proper on HDMI display when enabled it for RK3288 platform boards. Buffer address used for pre console is 0x0f000000 which is ram base plus 240MiB. right now the Allwinner SoC is using similar computation. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2020-02-13board_f: Make clear_bss genericOvidiu Panait
clear_bss is already used by 3 arches (x86, arc, xtensa), so make it generic and provide a weak nop stub for it. This also removes arch-specific ifdef duplications around clear_bss. Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
2020-02-13common/console.c: discard volatileHeinrich Schuchardt
Avoid errors of like common/console.c: In function ‘console_record_reset’: common/console.c:615:16: error: passing argument 1 of ‘membuff_purge’ discards ‘volatile’ qualifier from pointer target type [-Werror=discarded-qualifiers] 615 | membuff_purge(&gd->console_out); | ^~~~~~~~~~~~~~~~ by casting to non-volatile. The volatile property stems from declarations like arch/arm/include/asm/global_data.h:114: But there is no need to treat gd->console_out and gd->console_in as volatile in the context of common/console.c. Fixes: b612312816ff ("console: Add a function to read a line of the output / eof") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-02-11Merge tag 'dm-pull-6feb20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dmTom Rini
sandbox conversion to SDL2 TPM TEE driver Various minor sandbox video enhancements New driver model core utility functions
2020-02-10Kconfig: update LOGLEVEL rangeMarek Bykowski
As LOGLEVEL ranges form 0 to 9 set the limit to 10. Signed-off-by: Marek Bykowski <marek.bykowski@gmail.com>
2020-02-05dm: core: Create a new header file for 'compat' featuresSimon Glass
At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05exports: Add the malloc.h headerSimon Glass
This file should include the malloc.h header since it references malloc(). Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05cli: Make the sandbox board_run_command the defaultSean Anderson
If CONFIG_CMDLINE=n, common/cli.c calls board_run_command. This fails to link on most architectures. However, the sandbox architecture has an implementation which we can use. Signed-off-by: Sean Anderson <seanga2@gmail.com>
2020-02-05image: fdt: check "status" of "/reserved-memory" subnodesThirupathaiah Annapureddy
boot_fdt_add_mem_rsv_regions() scans the subnodes of "/reserved-memory" and adds them to reserved lmb regions. Currently this scanning does not take into "status" property. Even if the subnode is disabled, it gets added to the reserved lmb regions. This patch checks the "status" property before adding it to reserved lmb regions. Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
2020-02-05console: Add a function to read a line of the output / eofSimon Glass
When recording the console output for testing it is useful to be able to read the output a line at a time to check that the output is correct. Also we need to check that we get to the end of the output. Add a console function to return the next line and another to see how must data is left. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05bloblist: Zero records when addingSimon Glass
It is convenient for bloblist to zero out the contents of a records when it is added. This saves the callers having to do it. Update the API accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05bloblist: Tidy up a few comments and code-style nitsSimon Glass
Add a messing error code to bloblist_new() and tidy up the line length in bloblist_addrec(). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05bloblist: Add a new function to add or check sizeSimon Glass
A common check is to see if a blob is present, create it if not and make sure that the size is large enough. Add a function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-04image: android: Add routine to get dtbo paramsSam Protsenko
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 <joe.skb7@gmail.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>