summaryrefslogtreecommitdiff
path: root/common/spl
AgeCommit message (Collapse)AuthorFilesLines
2019-10-18spl: mmc: make eMMC HW boot partition configuration optionalAnatolij Gustschin1-6/+22
Loading U-Boot on i.MX8QXP MEK board is broken since recent changes in spl_mmc: U-Boot SPL 2019.10-00162-gff5bd397e4 (Oct 18 2019 - 15:50:45 +0200) Normal Boot WDT: Not found! Trying to boot from MMC2_2 Load image from MMC/SD 0x46400 spl: mmc partition switch failed SPL: failed to boot from all boot devices ### ERROR ### Please RESET the board ### The newly added CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION option is selected automatically and overrides the EXT_CSC_PART_CONFIG configurations with default value, always selecting the eMMC boot partition 1. Boards which place U-Boot image in other partitions became not bootable. Fix this by making the eMMC HW boot partition selection optional. Fixes: 17241ea0543a (spl: mmc: Add option to set eMMC HW boot partition) Reviewed-by: Lukasz Majewski <lukma@denx.de> Signed-off-by: Anatolij Gustschin <agust@denx.de>
2019-10-14Merge tag 'mmc-10-10-2019' of ↵Tom Rini1-10/+4
https://gitlab.denx.de/u-boot/custodians/u-boot-mmc - Add sdhci driver for Broadcom iProc platform - Add a driver callback for power-cycle for mmc - Implement host_power_cycle callback for stm32_sdmmc2 - spl: dm_mmc: Initialize only the required mmc device
2019-10-12Merge branch '2019-10-11-master-imports'Tom Rini3-20/+64
- Assorted cleanups - FAT bugfixes - mediatek platform updates
2019-10-11spl: Introduce SPL_DM_SPI Kconfig defineLukasz Majewski1-0/+7
This define indicates if DM_SPI shall be supported in SPL. This allows proper operation of DM converted SPI drivers in SPL, which use #if !CONFIG_IS_ENABLED(DM_SPI) to also support not yet DM/DTS converted boards. Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-10-11spl: mmc: Add option to set eMMC HW boot partitionMans Rullgard2-0/+10
This change allows setting pre-defined eMMC boot partition for SPL eMMC booting. It is necessary in the case when one wants to boot (through falcon boot) from eMMC after loading SPL from other memory (like SPI-NOR). Signed-off-by: Mans Rullgard <mans@mansr.com> [lukma: Edit the commit message] Signed-off-by: Lukasz Majewski <lukma@denx.de> Acked-by: Andreas Dannenberg <dannenberg@ti.com>
2019-10-11spl: mmc: Fix indentation in spl_mmc.c fileMans Rullgard1-20/+20
This fixes a wrongly indented block of code. Signed-off-by: Mans Rullgard <mans@mansr.com> [lukma: Make the commit message more verbose] Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-10-11spl: add a generic function board_init_fPhilippe Reynes2-0/+27
This commit add a generic function board_init_f that only initialize some device (for example serial). It avoid to define a board function only to launch the serial configuration. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2019-10-11spl: ymodem: Make SPL Y-Modem loader framework accessibleAndreas Dannenberg1-2/+2
Expose SPL's Y-Modem core loader function via the common SPL header file so it can be re-used for purposes other than loading U-Boot itself. Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
2019-10-11spl: ymodem: Fix FIT loading termination handlingAndreas Dannenberg1-2/+3
During FIT reading through ymodem_read_fit() the function xyzModem_stream_read() is being used which returns zero once the end of a stream has been reached. This could lead to an premature exit from ymodem_read_fit() with certain-sized FIT images reporting that zero bytes overall were read. Such a premature exit would then result in an -EIO failure being triggered within the spl_load_simple_fit() caller function and ultimately lead to a boot failure. Fix this logic by simply aborting the stream read loops and continuing with the regular code flow which ultimately would lead to returning the number of bytes to be read ('size') as expected by the callers of ymodem_read_fit(). Fixes: fa715193c083 ("spl: Add an option to load a FIT containing U-Boot from UART") Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
2019-10-10spl: dm_mmc: Initialize only the required mmc deviceLokesh Vutla1-10/+4
In SPL, all the available mmc devices gets initialized during boot. This might not work in cases where clocks are not available for certain mmc devices(other than boot device) and the support for enabling device might not be ready. Texas Instruments' K3 J721E device having a central system controller (dmsc) is one such example falling in this category. Below is the sequence for the failing scenario: - ROM comes up in SD mode and loads SPL by just initialing SD card. - SPL loads dmsc firmware from SD Card. Since ROM has enabled SD, SPL need not enable the SD, just need to re initialize the card. But SPL is trying to initialize other MMC instances which are in disabled state. Since dmsc firmware is not yet available, devices cannot be enabled. So in SPL, initialize only the mmc device that is needed. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-10-09Merge tag 'xilinx-for-v2020.01' of ↵Tom Rini1-0/+1
https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze Xilinx/FPGA changes for v2020.01 FPGA: - Enable fpga loading on Versal - Minor fix Microblaze: - Fix LMB configurations to support initrds - Some other cleanups Zynq: - Minor config/dt changes - Add distro boot support for usb1 and mmc1 - Remove Xilinx private boot commands and use only distro boot ZynqMP: - Kconfig cleanups, defconfig updates - Update some dt files - Add firmware driver for talking to PMUFW - Extend distro boot support for jtag - Add new IDs - Add system controller configurations - Convert code to talk firmware via mailbox or SMCs Versal: - Add board_late_init() - Add run time DT memory setup - Add DFU support - Extend distro boot support for jtag and dfu - Add clock driver - Tune mini configurations Xilinx: - Improve documentation (boot scripts, dt binding) - Enable run time initrd_high calculation - Define default SYS_PROMPT - Add zynq/zynqmp virtual defconfig Drivers: - Add Xilinx mailbox driver for talking to firmware - Clean zynq_gem for Versal - Move ZYNQ_HISPD_BROKEN to Kconfig - Wire genphy_init() in phy.c - Add Xilinx gii2rgmii bridge - Cleanup zynq_sdhci - dwc3 fix - zynq_gpio fix - axi_emac fix Others: - apalis-tk1 - clean config file
2019-10-09Merge tag 'u-boot-imx-20191009' of ↵Tom Rini7-14/+89
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20191009 ------------------- Travis : https://travis-ci.org/sbabic/u-boot-imx/builds/595148532 - MX6UL / ULZ - Toradex board - Allow to set OCRAM for MX6Q/D - MX7ULP - MX8: (container image, imx8mq_mek), SCU API - fix several board booting from SD/EMMC (cubox-i for example) - pico boards [trini: display5 merged manually] Signed-off-by: Tom Rini <trini@konsulko.com>
2019-10-08imx: replace CONFIG_SECURE_BOOT with CONFIG_IMX_HABStefano Babic1-1/+1
CONFIG_SECURE_BOOT is too generic and forbids to use it for cross architecture purposes. If Secure Boot is required for imx, this means to enable and use the HAB processor in the soc. Signed-off-by: Stefano Babic <sbabic@denx.de>
2019-10-08spl: nor: support loading i.MX container format filePeng Fan1-2/+7
i.MX8 only support AHAB secure boot with Container format image, we could not use FIT to support secure boot, so introduce container support to let SPL could load container images. Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee <tien.fong.chee@intel.com> Cc: York Sun <york.sun@nxp.com> Cc: Marek Vasut <marex@denx.de> Cc: Alex Kiernan <alex.kiernan@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Heiko Schocher <hs@denx.de> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-10-08spl: spi: support loading i.MX container format filePeng Fan1-0/+11
i.MX8 only support AHAB secure boot with Container format image, we could not use FIT to support secure boot, so introduce container support to let SPL could load container images. Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee <tien.fong.chee@intel.com> Cc: York Sun <york.sun@nxp.com> Cc: Marek Vasut <marex@denx.de> Cc: Alex Kiernan <alex.kiernan@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Heiko Schocher <hs@denx.de> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-10-08spl: nand: support loading i.MX container format filePeng Fan1-0/+9
i.MX8 only support AHAB secure boot with Container format image, we could not use FIT to support secure boot, so introduce container support to let SPL could load container images. Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee <tien.fong.chee@intel.com> Cc: York Sun <york.sun@nxp.com> Cc: Marek Vasut <marex@denx.de> Cc: Alex Kiernan <alex.kiernan@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Heiko Schocher <hs@denx.de> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-10-08spl: nand: Introduce spl_nand_get_uboot_raw_pagePeng Fan1-2/+7
Introduce weak spl_nand_get_uboot_raw_page, then platform could have their own implementation. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee <tien.fong.chee@intel.com> Cc: Marek Vasut <marex@denx.de> Cc: Andreas Dannenberg <dannenberg@ti.com> Cc: Alex Kiernan <alex.kiernan@gmail.com> Cc: Stefan Roese <sr@denx.de> Cc: Patrick Delaunay <patrick.delaunay@st.com> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Michal Simek <michal.simek@xilinx.com>
2019-10-08spl: nor: introduce spl_nor_get_uboot_basePeng Fan1-4/+9
Introduce weak spl_nor_get_uboot_base, then platform have their own implementation. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee <tien.fong.chee@intel.com> Cc: Marek Vasut <marex@denx.de> Cc: Andreas Dannenberg <dannenberg@ti.com> Cc: Alex Kiernan <alex.kiernan@gmail.com> Cc: Stefan Roese <sr@denx.de> Cc: Patrick Delaunay <patrick.delaunay@st.com> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Michal Simek <michal.simek@xilinx.com>
2019-10-08spl: spi: introduce spl_spi_get_uboot_offsPeng Fan1-1/+9
Introduce a weak function spl_spi_get_uboot_offs, then platform could have their own implementation. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee <tien.fong.chee@intel.com> Cc: Marek Vasut <marex@denx.de> Cc: Andreas Dannenberg <dannenberg@ti.com> Cc: Alex Kiernan <alex.kiernan@gmail.com> Cc: Stefan Roese <sr@denx.de> Cc: Patrick Delaunay <patrick.delaunay@st.com> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Michal Simek <michal.simek@xilinx.com>
2019-10-08spl: mmc: introduce spl_mmc_get_uboot_raw_sectorPeng Fan1-0/+11
Introduce a weak function spl_mmc_get_uboot_raw_sector, then platform could have their own implementation. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee <tien.fong.chee@intel.com> Cc: Marek Vasut <marex@denx.de> Cc: Andreas Dannenberg <dannenberg@ti.com> Cc: Alex Kiernan <alex.kiernan@gmail.com> Cc: Stefan Roese <sr@denx.de> Cc: Patrick Delaunay <patrick.delaunay@st.com> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Michal Simek <michal.simek@xilinx.com>
2019-10-08imx: Introduce CONFIG_SPL_FORCE_MMC_BOOT to force MMC boot on falcon modeLukasz Majewski1-0/+9
This change tries to fix the following problem: - The board boots (to be more precise - ROM loads SPL) from a slow SPI-NOR memory. As a result the spl_boot_device() will return SPI-NOR as a boot device (which is correct). - The problem is that in 'falcon boot' the eMMC is used as a boot medium to load kernel from its partition. Calling spl_boot_device() will break things as it returns SPI-NOR device. To fix this issue the new CONFIG_SPL_FORCE_MMC_BOOT Kconfig flag is introduced to handle this special use case. By default it is not defined, so there is no change in the legacy code flow. Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-10-08spl: mmc: support loading i.MX container format filePeng Fan1-0/+10
i.MX8 only support AHAB secure boot with Container format image, we could not use FIT to support secure boot, so introduce container support to let SPL could load container images. Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee <tien.fong.chee@intel.com> Cc: York Sun <york.sun@nxp.com> Cc: Marek Vasut <marex@denx.de> Cc: Alex Kiernan <alex.kiernan@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Heiko Schocher <hs@denx.de> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-10-08ARM: imx: Support larger SPL size on IMX6DQRobert Hancock1-1/+2
Previously the SPL size on all iMX6 platforms was restricted to 68KB because the OCRAM size on iMX6SL/DL parts is only 128KB. However, the other iMX6 variants have 256KB of OCRAM. Add an option CONFIG_MX6_OCRAM_256KB which allows using the full size on boards which don't need to support the SL/DL variants. This allows for an SPL size of 196KB, which makes it much easier to use configurations such as SPL with driver model and FDT control. Signed-off-by: Robert Hancock <hancock@sedsystems.ca> Tested-by: Adam Ford <aford173@gmail.com> #imx6q_logic
2019-10-08spl: pass args to board_return_to_bootromPeng Fan1-3/+4
Pass spl_image and bootdev to board_return_bootrom. i.MX8MN needs the args to let ROM to load images Cc: Simon Glass <sjg@chromium.org> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-10-08arm64: zynqmp: Define default SPL_TEXT_BASE address in KconfigMichal Simek1-0/+1
Define default address via Kconfig. There is no need to change this address for most of the boards but it is also possible. This one line save a lot of lines in defconfigs that's why make sense to do it. The similar change has been done by commit 9340d8fe8beb ("sunxi: move CONFIG_SPL_TEXT_BASE from *_defconfig to Kconfig") Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
2019-10-08spl: Convert CONFIG_SPL_SIZE_LIMIT to hexSimon Glass1-1/+1
This is currently a decimal value which is not as convenient or meaningful. Also U-Boot tends to use hex everywhere. Convert this option to hex and add a comment for the size_check macro. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Acked-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: correct the typo in the commit title] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-08spl: Allow tiny printf() to be controlled in SPL and TPLSimon Glass1-1/+1
At present there is only one control for this and it is used for both SPL and TPL. But SPL might have a lot more space than TPL so the extra cost of a full printf() might be acceptable. Split the option into two, providing separate SPL and TPL controls. The TPL setting defaults to the same as SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-08spl: Set up the bloblist in board_init_r()Simon Glass1-17/+18
At present the bloblist is set up in spl_common_init() which can be called from spl_early_init(), i.e. before SDRAM is ready. This prevents the bloblist from being located in SDRAM, which is useful on some platforms where SRAM is inaccessible after U-Boot relocates (e.g. x86 CAR region). It doesn't serve much purpose to have the bloblist available early, since very little is known about the platform then, and the handoff info is written when SPL is about to jump to U-Boot. Move the code to board_init_r() to avoid any restrictions. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-08spl: Add an arch-specific hook for writing to SPL handoffSimon Glass1-3/+9
At present there is an arch-specific area in the SPL handoff area intended for use by arch-specific code, but there is no explicit call to fill in this data. Add a hook for this. Also use the hook to remove the sandbox-specific test code from write_spl_handoff(). Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-08spl: handoff: Correct Kconfig condition for SPL and TPLSimon Glass1-2/+2
At present these options can be enabled when bloblist is not enabled for SPL or TPL. This is incorrect as SPL handoff requires bloblist. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-08-27Merge branch '2019-08-26-master-imports'Tom Rini1-0/+1
- Assorted minor bugfixes
2019-08-26Kconfig: Varios: Fix more SPL, TPL dependenciesAdam Ford1-0/+1
Several options are presenting themselves on a various boards where the options are clearly not used. (ie, SPL/TPL options when SPL or TPL are not defined) This patch is not attempting to be a complete list of items, but more like low hanging fruit. In some instances, I wasn't sure of DM was required, so I simply made them SPL or TPL. This patch attempts to reduce some of the menuconfig noise by defining dependencies so they don't appear when not used. Signed-off-by: Adam Ford <aford173@gmail.com>
2019-08-26Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscvTom Rini5-14/+134
- Support SPL and OpenSBI (FW_DYNAMIC firmware) boot. - Fix qemu kconfig build warning.
2019-08-26riscv: support SPL stack and global data relocationLukas Auer1-1/+1
To support relocation of the stack and global data on RISC-V, the secondary harts must be notified of the change using IPIs. We can reuse the hart relocation code for this purpose. It uses global data to store the new stack pointer and global data pointer for the secondary harts. This means that we cannot update the global data pointer of the main hart in spl_relocate_stack_gd(), because the secondary harts have not yet been relocated at this point. It is updated after the secondary harts have been notified. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2019-08-26spl: support booting via RISC-V OpenSBILukas Auer4-0/+109
RISC-V OpenSBI is an open-source implementation of the RISC-V Supervisor Binary Interface (SBI) specification. It is required by Linux and U-Boot running in supervisor mode. This patch adds support for booting via the OpenSBI FW_DYNAMIC firmware. It supports OpenSBI version 0.4 and higher. In this configuration, U-Boot SPL starts in machine mode. After loading OpenSBI and U-Boot proper, it will start OpenSBI. All necessary parameters are generated by U-Boot SPL and are passed to OpenSBI. U-Boot proper is started in supervisor mode by OpenSBI. Support for OpenSBI is enabled with CONFIG_SPL_OPENSBI. An additional configuration entry, CONFIG_SPL_OPENSBI_LOAD_ADDR, is used to specify the load address of the OpenSBI firmware binary. It is not used directly in U-Boot and instead is intended to make the value available to scripts such as FIT configuration generators. The header file include/opensbi.h is based on header files from the OpenSBI project. They are recent, as of commit bae54f764570 ("firmware: Add fw_dynamic firmware"). Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2019-08-26spl: fit: use U-Boot device tree when FIT image has no device treeLukas Auer1-13/+24
As part of the SPL FIT boot flow, the device tree is appended to U-Boot proper. The device tree is used to record information on the loadables to make them available to the SPL framework and U-Boot proper. Depending on the U-Boot device tree provider, the FIT image might not include a device tree. Information on the loadables is missing in this case. When booting via firmware bundled with the FIT image, U-Boot SPL loads the firmware binary and U-Boot proper before starting the firmware. The firmware, in turn, is responsible for starting U-Boot proper. Information on the memory location of the U-Boot proper loadable must be available to the SPL framework so that it can be passed to the firmware binary. To support this use case when no device tree is found in the FIT image, fall back to the U-Boot device tree in this situation. At the same time, update the comment to remove the note that the destination address must be aligned to ARCH_DMA_MINALIGN. Alignment is only required as an intermediate step when reading external data. This is automatically handled by spl_fit_append_fdt(). After reading the external data, it is copied to the specified address, which does not have to be aligned to ARCH_DMA_MINALIGN. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2019-08-26Convert CONFIG_SYS_SPI_U_BOOT_OFFS to KconfigHannes Schmelzer1-0/+8
This converts the following to Kconfig: CONFIG_SYS_SPI_U_BOOT_OFFS Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com> [trini: Expose this for SPL_SPI_SUNXI for now] Signed-off-by: Tom Rini <trini@konsulko.com>
2019-08-23Kconfigs: Various: Fix some SPL, TPL and ARM64 dependenciesAdam Ford1-0/+2
Several options are presenting themselves on a various boards where the options are clearly not used. (ie, arm64 options on arm9, or SPL/TPL options when SPL or TPL are not defined) This patch is not attempting to be a complete list of items, but more like low hanging fruit. This patch attempts to reduce some of the menuconfig noise by defining dependencies so they don't appear when not used. Signed-off-by: Adam Ford <aford173@gmail.com>
2019-08-11env: Drop environment.h header file where not neededSimon Glass1-1/+0
This header file is now only used by files that access internal environment features. Drop it from various places where it is not needed. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move get/set_default_env() to env.hSimon Glass1-1/+1
Move these functions to the new header file and rename set_default_env() to env_set_default() so that it has a consistent env_ prefix. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_get() to env.hSimon Glass2-0/+2
Move env_get() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_set() to env.hSimon Glass1-0/+1
Move env_set() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_init() to env.hSimon Glass1-0/+1
Move env_init() over to the new header file. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-08-11common: Move gzip functions into a new gzip headerSimon Glass2-0/+2
As part of the effort to remove things from common.h, create a new header for the gzip functions. Move the function declarations to it and add missing documentation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-08-11spl: implement stack usage checkSimon Goldschmidt2-0/+44
This implements a stack usage check in SPL. Many boards start up SPL to run code + data from one common, rather small SRAM. To implement a sophisticated SPL binary size limit on such boards, the stack size (as well as malloc size and global data size) must be subtracted from this SRAM size. However, to do that properly, the stack size first needs to be known. This patch adds a new Kconfig option: - SPL_SYS_REPORT_STACK_F_USAGE: memset(0xaa) the whole area of the stack very early and check stack usage based on this constant later before the stack is switched to DRAM Initializing the stack and checking it is implemented in weak functions, in case a board does not use the stack as saved in gd->start_addr_sp. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-07-27Merge tag 'u-boot-imx-20190719' of ↵Tom Rini2-1/+2
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20190719 - CCF for i.MX6 - nandbcb command to write SPL into NAND - Switch to DM (i.MX28) - Boards: Toradex, engicam, DH - Fixes for i.MX8 - Fixes for i.MX7ULP Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/561147504
2019-07-24spl: sata: support U-Boot load from raw sata diskBaruch Siach2-0/+48
Support load of the U-Boot image from raw SATA disk sector. This is equivalent to load from MMC raw sector. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2019-07-19watchdog: Split WDT from SPL_WDTMarek Vasut2-1/+2
Use CONFIG_IS_ENABLED(WDT) to permit use of WDT in SPL without DM, while the full U-Boot can use rich DM/DT WDT driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Peng Fan <Peng.Fan@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Tested-by: Heiko Schocher <hs@denx.de> Tested-by: Suniel Mahesh <sunil.m@techveda.org>
2019-07-17spl: Make image loader infrastructure more universalAndreas Dannenberg2-25/+65
The current U-Boot SPL image loader infrastructure is very powerful, able to initialize and load from a variety of boot media however it is strongly geared towards loading specific types of images in a very specific way. To address the need being able to use this infrastructure to load arbitrary image files go ahead and refactor it as follows: - Refactor existing spl_mmc_load_image function into superset function, accepting additional arguments such as filenames and media load offset (same concept can also be applied toother spl_XXX_load_image functions) - Extend the loader function to "remember" their peripheral initialization status so that the init is only done once during the boot process, - Extend the FIT image loading function to allow skipping the parsing/ processing of the FIT contents (so that this can be done separately in a more customized fashion) - Populate the SPL_LOAD_IMAGE_METHOD() list with a trampoline function, invoking the newly refactored superset functions in a way to maintain compatibility with the existing behavior This refactoring initially covers MMC/SD card loading (RAW and FS-based). Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-07-17spl: Allow performing BSS init early before board_init_f()Andreas Dannenberg1-0/+10
On some platform we have sufficient memory available early on to allow setting up and using a basic BSS prior to entering board_init_f(). Doing so can for example be used to carry state over to board_init_r() without having to resort to extending U-Boot's global data structure. To support such scenarios add a Kconfig option called CONFIG_SPL_EARLY_BSS to allow moving the initialization of BSS prior to entering board_init_f(), if enabled. Note that using this option usually should go along with using CONFIG_SPL_SEPARATE_BSS and configuring BSS to be located in memory actually available prior to board_init_f(). Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>