summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2023-12-22MA-21597 check spl fit pointer before parsing itJi Luo
the spl fit pointer could be set as NULL in HAB verify failed case, return error in such case. Change-Id: Idb44a19ca89f2a6065ea423782441e57109d6e3a Signed-off-by: Ji Luo <ji.luo@nxp.com> Upstream-Status: Inappropriate [downstream specific] Upstream U-Boot fixed this differently in combination with binman to create the final bootcontainer. Commit 6039e0edc854 ("imx: hab: Simplify the mechanism") Upstream-Status: Inappropriate [downstream specific] Upstream U-Boot fixed this differently in combination with binman to create the final bootcontainer. Commit 6039e0edc854 ("imx: hab: Simplify the mechanism") Backport from NXP downstream [6cb283bb4e19da6667abaedd83efc23a15fdc48d] Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2023-09-04usb: Add missing guard around env_get() in usb_hubMarek Vasut
The env_get() might be undefined in case ENV_SUPPORT is disabled, which may happen e.g. in SPL. Add missing ifdef guard around the env_get() to prevent build failure. Upstream-Status: Backport[fcb670b794c9839c026757bf2d5cd564323ce199] Signed-off-by: Marek Vasut <marex@denx.de> Tested-by: Fabio Estevam <festevam@denx.de>
2023-06-15gpio: Enable hogging support in SPLEddie James
Use the CONFIG macros to conditionally build the GPIO hogging support in either the SPL or U-Boot, or both, depending on the configuration. Also call the GPIO hog probe function in the common SPL board initialization as an equivalent to adding it to the U-Boot init sequence functions. Upstream-Status: Backport [1d99e673c752bc7d55aa25b02e050741496f7109] Signed-off-by: Eddie James <eajames@linux.ibm.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-14board_init: Do not reserve MALLOC_F area on stack if non-zero MALLOC_F_ADDRMarek Vasut
In case the MALLOC_F_ADDR is set to non-zero value, the early malloc area is not going to be placed just below stack top, but elsewhere. Do not reserve MALLOC_F bytes in this case, as that wastes stack space and may even cause insufficient stack space in SPL. This functionality is particularly useful on i.MX8M, where the insufficient stack space can be triggered. Upstream-Status: Backport [5004901efb3b47f7fb22b29cdd127245d3814fd2] Signed-off-by: Marek Vasut <marex@denx.de> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Cc: Fabio Estevam <festevam@denx.de> Cc: Peng Fan <peng.fan@nxp.com> Cc: Simon Glass <sjg@chromium.org> Cc: Stefano Babic <sbabic@denx.de> Cc: Thomas Chou <thomas@wytron.com.tw> Cc: Tom Rini <trini@konsulko.com>
2022-11-08Merge remote-tracking branch 'gh-nxp/lf_v2022.04' into ↵Philippe Schenker
update-to-5.15.52_2.1.0__toradex_imx_lf_v2022.04
2022-07-14fdt: Add U-Boot version to chosen nodeFrancesco Dolcini
commit 622ecee93a604c017aca23906c5cc903b4002b78 upstream. Add a new device tree property "u-boot,version" in the chosen node to pass the U-Boot version to the operating system. This can be useful to implement a firmware upgrade procedure from the operating system. Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-07-06LFU-330-7 spl: Use SPL_FIT_IMAGE_TINY for iMX9Peng Fan
Select SPL_FIT_IMAGE_TINY for i.MX9 Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-05-25MA-20303-1 Support rollback index check for single bootloaderJi Luo
Add support to check the rollback index of next stage images (ATF, TEE, u-boot proper) in SPL to harden the security. And because there is no backup bootloader image to fall back to so the board would hang in SPL if rollback index is rejected. Change-Id: I4c7d1f084dd5b3d37899a9e4c4755c03145542c7 Signed-off-by: Ji Luo <ji.luo@nxp.com>
2022-04-20MA-19048-1 MCU security enhancementJi Luo
Move the MCU RDC config to dts, it will be parsed by SPL and stored in OCRAM_S, then the MCU RDC config will be setup before MCU kicking. Use HAB to verify the MCU image to guarantee its integrity. Change-Id: I82dd378a6516b4d3cc47c5de2e403d817ba80256 Signed-off-by: Ji Luo <ji.luo@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 2e972e4aa6c44eec0444d59d11c0a0c175699cf2)
2022-04-18MA-17390 Clean build warnings for androidJi Luo
This commit eliminate the annoying build warning logs. Test: builds with buildman. Signed-off-by: Ji Luo <ji.luo@nxp.com> Change-Id: Ia335dafe3f4c0eab08e011215b9de5d2974b8d0c (cherry picked from commit 85e0d429d19b8f9a62369a5f20e088644c488b1e) (cherry picked from commit 52471735760a8d3a410f88c144910a07a161028d) (cherry picked from commit c0ed4a68aecf0cf67d61c72c273fcd655682366f)
2022-04-18MA-17382 spl: Add weak function at the end of image loadJi Luo
Add a weak function after the image load in case we have extra steps to complete, like check the rpmb keyblob for trusty enabled platform. Test: Boots with trusty. Signed-off-by: Ji Luo <ji.luo@nxp.com> Change-Id: Ie8181fcb32d1640e39fdcc3cebb2dbf50cbfdbab (cherry picked from commit b16fc52cf9a9ea4d63bced50b949d0bc2328ddea) (cherry picked from commit 3e40454cdac6b7b63cdff36ab48f86e4b98502be) (cherry picked from commit f3fb8740f9aea5a024a2b4579903e78affcda9e1)
2022-04-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) (cherry picked from commit 047f09ef2ef33657d76fd92d8f5599e00158cd6b) (cherry picked from commit e96b68d22e89e4031d1117ab347f042577c5c8f1)
2022-04-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) (cherry picked from commit fdea93a968d6f6b353fd1343acbed051b812edc8)
2022-04-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> (cherry picked from commit d00da7c6e2d3b0ed5f3f93eb98d841d1b7a114ca)
2022-04-06LFU-278-16 usb_hub: Set DM_FLAG_DEFAULT_PD_CTRL_OFF to usb_hub driverYe Li
Because usb_hub uses same device tree node with USB controller device, when probe and remove usb_hub, it will call the power domain control of USB controller device. This is not expected, because power domain control implmentation may not have count while the power domain is dedicated for USB controller. So when removing usb_hub the power domain is power off before removing USB controller. Signed-off-by: Ye Li <ye.li@nxp.com>
2022-04-06MLK-25504-7 imx: Support loading container image from RAM deviceYe Li
For some debug case, we have preloaded the full boot image to RAM device. Add the support that SPL can load the u-boot-atf container from the RAM device. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit d2c4568802708366b3157ce790bfe23a23a96cc2) (cherry picked from commit 1f2609289289f1bc9b6249e7d6f746d2d459cbb5)
2022-04-06MLK-23820 imx8mq/mm: Add config to support secondary image bootYe Li
When primary image boot is failed, ROM will select secondary image to boot if SIT (secondary image table) exists. However, SPL does not know the secondary boot, still loads the FIT from the position of primary image. Introduce a config to add secondary image sector offset to FIT sector offset. This config is default set to 0. Secondary image should configure it to the same value of firstSectorNumber field in SIT. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 7caa7682a8e3ba765c513127fa2a15e335617a65) (cherry picked from commit fc88ace3e14761984b5c24c831dfdfc1840ec376) (cherry picked from commit a9c09cc034b37b7c82d0db5df0e82a2a56aca145)
2022-04-06MLK-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) (cherry picked from commit 0257e77fdae8faf7a00b3bc9f5c91f11de65f205) (cherry picked from commit 3d8e964596129d54d71ea104a1d0a51f76bbc92d) (cherry picked from commit 7cc8e2625df97f6b373d695397990fc5e2c69ca0)
2022-04-06MLK-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) (cherry picked from commit 7c8e0606ea4aaeceae1f1d1e17db1503ac9f841e) (cherry picked from commit f680079db70dfb53a96dbafe0b3f6bf8f3f6ca42) (cherry picked from commit 6767d87d4db3947b62164a44f35280ea7daa8e0c)
2022-04-06MLK-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) (cherry picked from commit 50ea462702262c65afbd1985d831edf16e47e212) (cherry picked from commit f1c7088597ea5a9d7172e2f0eb06348fb3beed5d) (cherry picked from commit 12859567e106cc47ab546c7aa059a4a4e0a0bb16)
2022-04-06MLK-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) (cherry picked from commit 0539983695e4cef88080ec3fd083c68c8c662a35) (cherry picked from commit 31fca4fbc23ea22a27bdf520c8928a5df595a183) (cherry picked from commit b4e6e2957d8b1828bc9ec513f96a722f6337636b)
2022-04-06MLK-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) (cherry picked from commit d5046e6f021f3d55c58e8b46b13ac3e8e1761755) (cherry picked from commit e1588a2741dfd0f37421e13ceb5e310e0b35d3bf) (cherry picked from commit 6eae7a4c237199be90984f03f5c396e0d63b34f1)
2022-04-06MLK-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) (cherry picked from commit 9f99e9de1d37e9f6c02c1b27348ea3dcdab94569) (cherry picked from commit 6ae1c043431a4987f563026b179b33945a5880ee) (cherry picked from commit 806c9ba15e8742a23b1b9147d9b85219133b6f10) (cherry picked from commit 1357b84595d617f6ebc09f23e7b9d14b080f8048)
2022-04-06MLK-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) (cherry picked from commit 64520f3e5f495ecce79177fba11e3d41299529b2) (cherry picked from commit 076fe5bc4d29deaf6d008e579b5cfe7408bc4525) (cherry picked from commit 5c5c11b5eb2f185aeb6ae432520093b0ef684b26) (cherry picked from commit 6afb9ebcce19079981344822211b3b8c4bfce635)
2022-04-06MLK-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) (cherry picked from commit 3e788604343274e806510261aea407a9d916755b) (cherry picked from commit 23f3d6499e05e82c462a6238970923d72c3e1465) (cherry picked from commit eb91e772b346d437a075d9554b2c6831a4ca5156)
2022-04-06LFU-278-3 Revert "sdp: call board_usb_init at spl_sdp_load_image"Ye Li
This reverts commit 0ced2faba08a9faf0ac1cbeb2a320faa635651d9. It is already applied from history, and re-apply causes problem after switching to DM Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 7adf6be8ac8982d307a9e8a9086a095f10c5db39) (cherry picked from commit b8639b4b281e246767e03b061e382b04d601a43a)
2022-04-06MLK-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) (cherry picked from commit 1759ef0b52f972cff6c2c23014c534c9c8d0d55f) (cherry picked from commit 96b3e4da1bc02fe527571ac8df7b47131f9c85d7)
2022-02-22spl: Allow disabling binman symbols in SPLSimon Glass
When CONFIG_SPL_FIT is enabled we do not access U-Boot directly in the image, since it is embedded in a FIT which is parsed at runtime. Provide a CONFIG option to drop the symbols in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-22spl: x86: Correct the binman symbols for SPLSimon Glass
These symbols are incorrect, meaning that binman cannot find the associated entry. This leads to errors like: binman: Section '/binman/simple-bin': Symbol '_binman_spl_prop_size' in entry '/binman/simple-bin/u-boot-spl/u-boot-spl-nodtb': Entry 'spl' not found in list (mkimage,u-boot-spl-nodtb, u-boot-spl-bss-pad,u-boot-spl-dtb,u-boot-spl,u-boot-img,main-section) Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-11malloc_simple: Remove usage of unsupported %zx format stringPali Rohár
Replace %zx by %lx and cast size_t to ulong. U-Boot currently prints garbage debug output: size=x, ptr=18, limit=18: 4002a000 With this change it prints correct debug data: size=18, ptr=18, limit=2000: 4002a000 Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-02-11common: fdt_support: add support for "partitions" subnode to ↵Matthias Schiffer
fdt_fixup_mtdparts() Listing MTD partitions directly in the flash mode has been deprecated for a while for kernel Device Trees. Look for a node "partitions" in the found flash nodes and use it instead of the flash node itself for the partition list when it exists, so Device Trees following the current best practices can be fixed up. Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-02-11console: usb: kbd: Limit poll frequency to improve performanceThomas Watson
Using the XHCI driver, the function `usb_kbd_poll_for_event` takes 30-40ms to run. The exact time is dependent on the polling interval the keyboard requests in its descriptor, and likely cannot be significantly reduced without major rework to the XHCI driver. The U-Boot EFI console service sets a timer to poll the keyboard every 5 microseconds, and this timer is checked every time a block is read off disk. The net effect is that, on my system, loading a ~40MiB kernel and initrd takes about 62 seconds with a slower keyboard and 53 seconds with a faster one, with the vast majority of the time spent polling the keyboard. To solve this problem, this patch adds a 20ms delay between consecutive calls to `usb_kbd_poll_for_event`. This is sufficient to reduce the total loading time to under half a second for both keyboards, and does not impact the perceived keystroke latency. Signed-off-by: Thomas Watson <twatson52@icloud.com>
2022-02-08bloblist: Update to use conditional valueSimon Glass
Use the new IF_ENABLED_INT() feature to avoid needing our own inline function to handle this case. Tidy up the logic to ensure that the value is only used when present. Update the 'expected' comment also. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-02-03spl: ymodem: Fix buffer overflow during Image copyVignesh Raghavendra
ymodem_read_fit() driver will end copying up to BUF_SIZE boundary even when requested size of copy operation is less than that. For example, if offset = 0, size = 1440B, ymodem_read_fit() ends up copying 2KB from offset = 0, to destination buffer addr This causes data corruption when malloc'd buffer is passed during UART boot since commit 03f1f78a9b44 ("spl: fit: Prefer a malloc()'d buffer for loading images") With this, UART boot works again on K3 (AM654, J7, AM64) family of devices. Fixes: 03f1f78a9b44 ("spl: fit: Prefer a malloc()'d buffer for loading images") Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2022-01-28spl: add support for custom boot method namesHeiko Thiery
Currently the names MMC1, MMC2 and MMC2_2 are output in the SPL. To achieve more userbility here the name of the boot source can be returned. E.g. for "MMC1" -> "eMMC" or "MMC2" -> "SD card". Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Michael Walle <michael@walle.cc> Tested-by: Michael Walle <michael@walle.cc>
2022-01-27Merge tag 'dm-pull-26jan22' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dm acpi refactoring to allow non-x86 use binman support for bintools (binary tools) minor tools improvements in preparation for FDT signing various minor fixes and improvements
2022-01-26usb: gadget: Add CDC ACM functionLoic Poulain
Add support for CDC ACM using the new UDC and gadget API. This protocol can be used for serial over USB data transfer and is widely supported by various OS (GNU/Linux, MS-Windows, OSX...). The usual purpose of such link is to access device debug console and can be useful for products not exposing regular UART to the user. A default stdio device named 'usbacm' is created, and can be used to redirect console to USB link over CDC ACM: > setenv stdin usbacm; setenv stdout usbacm Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2022-01-26tools: Pass the key blob aroundSimon Glass
At present we rely on the key blob being in the global_data fdt_blob pointer. This is true in U-Boot but not with tools. For clarity, pass the parameter around. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-21mtd: cfi: introduce CFI_FLASH_BANKSPatrick Delaunay
Replace CONFIG_SYS_MAX_FLASH_BANKS by CFI_FLASH_BANKS to prepare Kconfig migration and avoid to redefine CONFIG_SYS_MAX_FLASH_BANKS in cfi_flash.h. After this patch CONFIG_SYS_MAX_FLASH_BANKS should be never used in the cfi code: use CFI_MAX_FLASH_BANKS for struct size or CFI_FLASH_BANKS for number of CFI banks which can be dynamic. This patch modify all the files which include mtd/cfi_flash.h. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-21spl: Convert SYS_MMCSD_RAW_MODE_KERNEL_SECTOR to KconfigAlexandru Gagniuc
Falcon mode is very useful in improving boot speed. A question that Falcon mode asks is "Where do I look for the kernel". With MMC boot media, the correct answer is CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR. The scope of this patch is to move this to Kconfig. It is possible for a system to support Falcon mode from NOR but not MMC. In that case, mmc_load_image_raw_os() would not be used. To address this, conditionally compile mmc_load_image_raw_os() when SPL_FALCON_BOOT_MMCSD, instead of SPL_OS_BOOT. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Move spl_start_uboot to its own guard in spl_mmc.c, rerun migration] Signed-off-by: Tom Rini <trini@konsulko.com>
2022-01-20Merge https://source.denx.de/u-boot/custodians/u-boot-marvellTom Rini
- fdt_support: Add fdt_for_each_node_by_compatible() helper macro (Marek) - turris_omnia: Fixup SATA or PCIe nodes at runtime in DT blob (Pali) - pci_mvebu: Add support for Kirkwood PCIe controllers (Pali) - SPL: More verifications for kwbimage in SPL (Pali) - mvebu: Remove comphy_update_map() (Pali) - Minor misc stuff
2022-01-20SPL: Add support for checking board / BootROM specific image typesPali Rohár
Commit 9baab60b8054 ("SPL: Add support for parsing board / BootROM specific image types") added support for loading board specific image types. This commit adds support for a new weak function spl_parse_board_header() which is called after loading boot image. Board may implement this function for checking if loaded board specific image is valid. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-20SPL: Add struct spl_boot_device parameter into spl_parse_board_header()Pali Rohár
Add parameter spl_boot_device to spl_parse_board_header(), which allows the implementations to see from which device we are booting and do boot-device-specific checks of the image header. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-20fdt_support: Add fdt_for_each_node_by_compatible() helper macroMarek Behún
Add macro fdt_for_each_node_by_compatible() to allow iterating over fdt nodes by compatible string. Convert various usages of off = fdt_node_offset_by_compatible(fdt, start, compat); while (off > 0) { code(); off = fdt_node_offset_by_compatible(fdt, off, compat); } and similar, to fdt_for_each_node_by_compatible(off, fdt, start, compat) code(); Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-01-19doc: replace @return by Return:Heinrich Schuchardt
Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-01-18common: board_r: drop ifdefs around header includesOvidiu Panait
Drop the remaining ifdefs around header includes, to fix an old TODO. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2022-01-18common: board_r: include asm-generic/gpio.hOvidiu Panait
Not all architectures define <asm/gpio.h> and even on those that do, the header cannot be included for all boards without causing various build failures. Since common/board_r.c only needs gpio_hog_probe_all() declaration, include <asm-generic/gpio.h> and drop the associated ifdef. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2022-01-18common: board_r: move init_addr_map() to init.hOvidiu Panait
asm/mmu.h include is currently guarded by CONFIG_ADDR_MAP ifdef because the header is only present on arm and powerpc. In order to remove the dependency on this header and the associated ifdef, move init_addr_map() declaration to init.h, since it is only called during the common init sequence. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2022-01-18common: board_r: drop initr_addr_map wrapperOvidiu Panait
Add a return value to init_addr_map and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Reviewed-by: Matthias Brugger <mbrugger@suse.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2022-01-18common: board_r: drop initr_kgdb wrapperOvidiu Panait
Add a return value to kgdb_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Also, move the "KGDB" print message inside kgdb_init(). Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>