aboutsummaryrefslogtreecommitdiff
path: root/common/spl
AgeCommit message (Collapse)Author
2019-01-01Merge tag 'u-boot-imx-20190101' of git://www.denx.de/git/u-boot-imxTom Rini
imx for 2019.01 - introduce support for i.MX8M - fix size limit for Vhybrid / pico boards - several board fixes - w1 driver for MX2x / MX5x
2019-01-01imx8m: Enable CONFIG_SPL_FIT_IMAGE_TINY for iMX8MYe Li
If we don't define CONFIG_SPL_FIT_IMAGE_TINY, when loading images from FIT, the SPL will record all loadables' info to u-boot's FDT. This causes problem when HAB is enabled, because FDT's content is modified before we authenticate it. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-01-01SPL: Add HAB image authentication to FITYe Li
Introduce two board level callback functions to FIT image loading process, and a SPL_FIT_FOUND flag to differentiate FIT image or RAW image. Implement functions in imx common SPL codes to call HAB funtion to authenticate the FIT image. Generally, we have to sign multiple regions in FIT image: 1. Sign FIT FDT data (configuration) 2. Sign FIT external data (Sub-images) Because the CSF supports to sign multiple memory blocks, so that we can use one signature to cover all regions in FIT image and only authenticate once. The authentication should be done after the entire FIT image is loaded into memory including all sub-images. We use "-p" option to generate FIT image to reserve a space for FIT IVT and FIT CSF, also this help to fix the offset of the external data (u-boot-nodtb.bin, ATF, u-boot DTB). The signed FIT image layout is as below: -------------------------------------------------- | | | | | | | | | FIT | FIT | FIT | | U-BOOT | ATF | U-BOOT | | FDT | IVT | CSF | | nodtb.bin | | DTB | | | | | | | | | -------------------------------------------------- Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2018-12-14spl: net: dm: usb: bind the gadget before attempting to load the imageJean-Jacques Hiblot
If DM_USB_GADGET is used, the usb ethernet gadget driver must be bound to a controller before the image can be downloaded over the network. In u-boot this can be done with the bind command. In SPL it must be done programmatically. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-12spl: fix build failure with !CONFIG_SPL_PCI_SUPPORTSekhar Nori
Building U-Boot with CONFIG_PCI and CONFIG_DM_PCI enabled, but CONFIG_SPL_PCI_SUPPORT disabled, results in following linker error: lib/built-in.o: In function `fdtdec_get_pci_bar32': lib/fdtdec.c:305: undefined reference to `dm_pci_read_bar32' fdtdec.c:305:(.text.fdtdec_get_pci_bar32+0x24): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `dm_pci_read_bar32' This is because reference to dm_pci_read_bar32() remains in lib/fdtdec.c while SPL build does not descend into drivers/pci directory in drivers/Makefile if CONFIG_SPL_PCI_SUPPORT is not enabled. Fix this by applying appropriate #define guards in lib/fdtdec.c. It looks like ns16550.c has the same problem, so fixed that too. To simplify this, CONFIG_SPL_PCI_SUPPORT is renamed to CONFIG_SPL_PCI (enables use of CONFIG_IS_ENABLED() macro). Suggested-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-12-12blk: Rework guard around part_init callTom Rini
The function part_init() will only be built when we have both CONFIG_PARTITIONS and CONFIG_HAVE_BLOCK_DEVICE set. Protect the call to this function with both of these tests now. Cc: Simon Glass <sjg@chromium.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: York Sun <york.sun@nxp.com> Cc: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> Cc: Mingkai Hu <mingkai.hu@nxp.com> Cc: Stefan Roese <sr@denx.de> Cc: Marek BehĂșn <marek.behun@nic.cz> Cc: Vanessa Maegima <vanessa.maegima@nxp.com> Cc: Eugen Hristev <eugen.hristev@microchip.com> Cc: Adam Ford <aford173@gmail.com> Cc: Jagan Teki <jagan@amarulasolutions.com> Cc: Tom Warren <twarren@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Vitaly Andrianov <vitalya@ti.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Add support for passing handoff info to U-Boot properSimon Glass
There is some basic informaton that SPL normally wants to pass through to U-Boot, such as the SDRAM size and bank information. Mkae use of the new bloblist structure for this. Add a new 'handoff' blob which is set up in SPL and passed to U-Boot proper. Also adda test for sandbox_spl that checks that this works correctly and a new 'sb' command to show the information passed from SPL. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Add a comment to spl_set_bd()Simon Glass
There is a strange feature to set global_data to a data-section variable early in SPL. This only works if SPL actually has access to SRAM which is not the case on x86, for eaxmple. Add a comment to this effect. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Make SPL_DISABLE_BANNER_PRINT a positive optionSimon Glass
Rather than having a negative option, make this a positive option and enable it by default. This makes it easier to understand. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Add a define for SPL_TPL_PROMPTSimon Glass
We should use a macro rather than hard-coding the SPL prompt to 'spl' since the code can be used by TPL too. Add a macro that works for both and use it in various places. This allows TPL to use the same code without printing confusing messages. Note that the string is lower case ('spl', 'tpl') which is a change from previously. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Support hash, input, pch, pci, rtc, tpm in SPLSimon Glass
At present these subsystems are only supported in U-Boot proper but it is sometimes necessary to support them in SPL, or even TPL. Update the Kconfig and Makefile to support this. Also adjust GPIO so that it can be used in TPL if required. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Set up the bloblist in SPLSimon Glass
The bloblist is normally set up in SPL ready for use by U-Boot. Add a simple implementation of this to the common SPL code. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26spl: Add support for logging in SPL and TPLSimon Glass
It is sometimes useful to log information in SPL and TPL. Add support for this. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-09spl: fix debug prints for tiny printfSimon Goldschmidt
Tiny printf does not support %.*s and %lX. Since tiny printf should be very common in SPL, replace these by %32s (for printing image name) and %lx. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-10-16spl: fpga: Implement fpga bistream loading with fpga_loadMichal Simek
This patch partially reverts: "spl: fit: Add support for loading FPGA bitstream" (sha1: 26a642238bdecc53527142dc043b29e21c5cc94c) There shouldn't be a need to call private spl_load_fpga_image function because the whole sequence should be already handled by fpga framework. If there is missing loading bistream by chunks it should be done via fpga framework instead of having private hooks. Also spl_load_fpga_image() weak function is not used anywhere and opening a way for not reviewed hacks out of mainline U-Boot is not the right way to go. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-10-06spl: spi: Do not hardcode fixed size for headerMichal Simek
Find out size directly from header structure. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-10-06spl: ram: Fix u_boot_pos calculationMichal Simek
The patch: "spl: Weed out CONFIG_SYS_TEXT_BASE usage" (sha1: 04ce5427bd3914cab8be78513275a20ab878520a) introduced bug where assigning to u_boot_pos variable wasn't done which end up in situation where SPL wasn't able to find out image on the selected address. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-10-05Merge tag 'rockchip-for-v2018.11-rc2' of git://git.denx.de/u-boot-rockchipTom Rini
Rockchip-focused changes for v2018.11-rc2: - fixes to rkimage for SPL boot via USB - fixes to make_fit_atf.py, incl. entry-point calculation and python3 compatibility - OP-TEE support for ARMv7-based SoCs - fixes to RGMII/GMII selection on the RK3328 Signed-off-by: Tom Rini <trini@konsulko.com>
2018-10-04spl: add support to booting with OP-TEEKever Yang
OP-TEE is an open source trusted OS, in armv7, its loading and running are like this: loading: - SPL load both OP-TEE and U-Boot running: - SPL run into OP-TEE in secure mode; - OP-TEE run into U-Boot in non-secure mode; To make code simple, it would be fine to use IH_OS_TEE for the os tyle in TPL(just like IH_OS_LINUX is using both in SPL and U-Boot). Here is the diagram for SPL loading OP-TEE, IH_OS_TEE:(make u-boot.itb for SPL) Non-Secure Secure BootROM | v SPL | v --------- OP-TEE | v U-Boot | V Linux For other two king of OP-TEE loading/booting, see commit message: 45b55712d4 image: Add IH_OS_TEE for TEE chain-load boot More detail: https://github.com/OP-TEE/optee_os and search for 'boot arguments' for detail entry parameter in: core/arch/arm/kernel/generic_entry_a32.S Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-10-02Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini
This is the PR for SPI-NAND changes along with few spi changes. [trini: Re-sync changes for ls1012afrwy_qspi*_defconfig] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-09-30spl: mmc: Report device number when we failAlex Kiernan
If we fail to find the MMC boot device, report the number of the one we were looking for in the error to aid diagnosis. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-09-27Merge tag 'xilinx-for-v2018.11' of git://git.denx.de/u-boot-microblazeTom Rini
Xilinx changes for v2018.11 - Handle BOARD_LATE_INIT via Kconfig SPL: - Enable GZIP for all partitions types(not only for kernel) ZynqMP: - Rearrange pmufw version handling - Support newer PMUFW with improved fpga load sequence Zynq: - Cleanup config file - Simplify zybo config by enabling option via Kconfig net: - Fix gems max-speed property reading - Enable support for fixed-link phys
2018-09-26spl: fit: Enable GZIP compression also for no kernel partitionsMichal Simek
There is no reason to limit gzip usage only for OS_BOOT and kernel image type. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Tested-by: York Sun <york.sun@nxp.com>
2018-09-25spl: Weed out CONFIG_SYS_TEXT_BASE usageMarek Vasut
The SPL loaders assume that the CONFIG_SYS_TEXT_BASE memory location is available and can be corrupted by loading ie. uImage or fitImage headers there. Sometimes it could be beneficial to load the headers elsewhere, ie. if CONFIG_SYS_TEXT_BASE is not yet writable while we still want to parse the image headers in some local onchip memory to ie. extract firmware from that image. Add the possibility to override the location where the headers get loaded by introducing new function, spl_get_load_buffer() which takes two arguments -- offset from the CONFIG_SYS_TEXT_BASE and size of the data that are to be loaded there -- and returns a valid buffer address or hangs the system. The default behavior is the same as before, add the offset to CONFIG_SYS_TEXT_BASE and return that address. User can override the weak spl_get_load_buffer() function though. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2018-09-20mtd: move NAND files into a raw/ subdirectoryMiquel Raynal
NAND flavors, like serial and parallel, have a lot in common and would benefit to share code. Let's move raw (parallel) NAND specific code in a raw/ subdirectory, to ease the addition of a core file in nand/ and the introduction of a spi/ subdirectory specific to SPI NANDs. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
2018-09-11spl: Allow remoteproc drivers to be used within SPLLokesh Vutla
Add an option for building remoteproc drivers within SPL. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2018-09-11spl: Allow mailbox drivers to be used within SPLLokesh Vutla
Add an option for building mailbox drivers within SPL. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2018-09-11arm: K3: Add initial support for TI's K3 generation of SoCsLokesh Vutla
Add support for Texas Instruments' K3 Generation Processor families. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-08-31spl: Kconfig: Fix typo in 'Upgrade'Fabio Estevam
Correct the spelling of 'Upgrade'. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-08-20spl: fix debug print in spl_common_init()Simon Goldschmidt
spl_common_init() debug-prints "spl_early_init()\n" but it is called both from spl_early_init() and spl_init(). Fix this by moving the debug() statement to the calling functions which now print their name. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-08-17kconfig: fix typo 'parition'Simon Goldschmidt
Replaced misspelled words "parition"/"paritioning" (missing 't') in two Kconfig files by correct words "partition"/"partitioning" Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-08-06power: Add CONFIG_SPL_POWER_DOMAIN configPeng Fan
Add CONFIG_SPL_POWER_DOMAIN config entry. Build drivers/power/domain if this config is selected. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-04Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini
2018-08-01binman: Add a new 'image-pos' propertySimon Glass
At present each entry has an offset within its parent section. This is useful for figuring out how entries relate to one another. However it is sometimes necessary to locate an entry within an image, regardless of which sections it is nested inside. Add a new 'image-pos' property to provide this information. Also add some documentation for the -u option binman provides, which updates the device tree with final entry information. Since the image position is a better symbol to use for the position of U-Boot as obtained by SPL, update the SPL symbols to use this instead of offset, which might be incorrect if hierarchical sections are used. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-08-01binman: Rename 'position' to 'offset'Simon Glass
After some thought, I believe there is an unfortunate naming flaw in binman. Entries have a position and size, but now that we support hierarchical sections it is unclear whether a position should be an absolute position within the image, or a relative position within its parent section. At present 'position' actually means the relative position. This indicates a need for an 'image position' for code that wants to find the location of an entry without having to do calculations back through parents to discover this image position. A better name for the current 'position' or 'pos' is 'offset'. It is not always an absolute position, but it is always an offset from its parent offset. It is unfortunate to rename this concept now, 18 months after binman was introduced. However I believe it is the right thing to do. The impact is mostly limited to binman itself and a few changes to in-tree users to binman: tegra sunxi x86 The change makes old binman definitions (e.g. downstream or out-of-tree) incompatible if they use the 'pos = <...>' property. Later work will adjust binman to generate an error when it is used. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-31sunxi: add support for Allwinner H6 SoCIcenowy Zheng
Allwinner H6 is a new SoC from Allwinner features USB3 and PCIe interfaces. This patch adds support for it. The corresponding DTSI file, from Linux next-20180720, is also introduced. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Jagan Teki <jagan@openedev.com> Tested-by: Jagan Teki <jagan@amarulasolutions.com>
2018-07-26spl: Add option SPL_PAYLOADYork Sun
Some legacy boards use RAW image for SPL boot. Add Kconfig option SPL_PAYLOAD to set alternative image. Signed-off-by: York Sun <york.sun@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-07-24spl: remove dependency to "asm/utils.h"Paulo Zaneti
Header file "asm/utils.h" is not required to compile "spl_ymodem.c". So, removing this dependency allows other architectures to use this booting device as "asm/utils.h" is only present in "arm" architecture. Signed-off-by: Paulo Zaneti <paulo.zaneti@datacom.ind.br>
2018-07-21spl: record boot_device into spl_image and call spl_perform_fixupsPhilipp Tomsich
On some boards, we want to give the board/architecture-specific code a chance to look at where the next image has been loaded from and perform fixups before starting the next image. This is of particular importance, when we probe multiple devices for bootable payloads and boot the first one found. This change adds the following: - we record the boot_device used into the spl_image structure - we provide an extension-point for boards/architectures that can perform late fixups depending on a fully populated spl_image structure (i.e. we'll know the final boot_device and have info on the image type and operating system to be booted). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2018-07-20spl: Make the spl_nand_load_image staticMichael Trimarchi
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2018-07-20spl: mmc: Skip RAW mode ARGS sectors if not definedYork Sun
RAW mode ARGS sector doesn't have to be used for all falcon boot. Skip loading ARGS sectors if not defined. Signed-off-by: York Sun <york.sun@nxp.com>
2018-07-19spl: nor: Skip CONFIG_SYS_FDT_BASE if not definedYork Sun
If FIT image is used, CONFIG_SYS_FDT_BASE is not needed. Signed-off-by: York Sun <york.sun@nxp.com>
2018-07-19spl: nor: Add FIT supportYork Sun
Add support of loading FIT image from NOR flash. Signed-off-by: York Sun <york.sun@nxp.com>
2018-07-19env: common: accept flags on reset to default envYaniv Levinsky
The function set_default_env() sets the hashtable flags for import_r(). Formally set_default_env() doesn't accept flags from its callers. In practice the caller can (un)set the H_INTERACTIVE flag, but it has to be done using the first character of the function's string argument. Other flags like H_FORCE can't be set by the caller. Change the function to accept flags argument. The benefits are: 1. The caller will have to explicitly set the H_INTERACTIVE flag, instead of un-setting it using a special char in a string. 2. Add the ability to propagate flags from the caller to himport(), especially the H_FORCE flag from do_env_default() in nvedit.c that currently gets ignored for "env default -a -f" commands. 3. Flags and messages will not be coupled together. A caller will be able to set flags without passing a string and vice versa. Please note: The propagation of H_FORCE from do_env_default() does not introduce any functional changes, because currently himport_r() is set to destroy the old environment regardless if H_FORCE flag is set or not. More changes are needed to utilize the propagation of H_FORCE. Signed-off-by: Yaniv Levinsky <yaniv.levinsky@compulab.co.il> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
2018-07-19spl: fit: display a message when an FPGA image is loadedLuis Araneda
A message should be displayed if an image is loaded to an FPGA, because the hardware might have changed, and the user should be informed Signed-off-by: Luis Araneda <luaraneda@gmail.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-07-10spl: fit: verify images prior to post processingBen Whitten
Verification of hashes needs to take place before any image post processing, thus matching full FIT image processing. This allows mechanisms such as encryption be applied to images prior to fit generation at the spl level. Signed-off-by: Ben Whitten <ben.whitten@lairdtech.com>
2018-07-10spl: fit: Fix support for loading FPGA bitstreamMarek Vasut
Move the FPGA loading from IS_ENABLED(CONFIG_SPL_OS_BOOT) && IS_ENABLED(CONFIG_SPL_GZIP) conditional. The FPGA loading can be used without OS loading and GZIP support in SPL. This issue was most likely induced by some merge conflict, so fix it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com>
2018-07-10spl: spi: Support full fitImage handlingMarek Vasut
Handle the case where the full fitImage support is enabled. In this case, the whole fitImage must be loaded up front as some parts of the fitImage code require memory-mapped access to the entire fitImage. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Simon Glass <sjg@chromium.org>
2018-07-10spl: fat: Support full fitImage handlingMarek Vasut
Handle the case where the full fitImage support is enabled. In this case, the whole fitImage must be loaded up front as some parts of the fitImage code require memory-mapped access to the entire fitImage. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Simon Glass <sjg@chromium.org>
2018-07-09reset: Rename CONFIG_SPL_RESET_SUPPORT to CONFIG_SPL_DM_RESETLey Foon Tan
Rename CONFIG_SPL_RESET_SUPPORT to CONFIG_SPL_DM_RESET, so can use CONFIG_IS_ENABLED(DM_RESET) checking in reset.h later. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>