summaryrefslogtreecommitdiff
path: root/common/spl
AgeCommit message (Collapse)AuthorFilesLines
2018-03-19spl: add SPL_RESET_SUPPORTPatrick Delaunay1-0/+9
Add option to include RESET driver and uclass in SPL. That can be useful to handle IP reset with same driver in U-Boot and in SPL. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-19SPL: Add signature verification when loading imageJun Nie1-0/+12
U-boot proper signature is not verified by SPL on most platforms even config SPL_FIT_SIGNATURE is enabled. Only fsl-layerscape platform support secure boot in platform specific code. So verified boot cannot be achieved if u-boot proper is loaded by SPL. This patch add signature verification to u-boot proper images when loading FIT image in SPL. It is tested on Allwinner bananapi zero board with H2+ SoC. Signed-off-by: Jun Nie <jun.nie@linaro.org>
2018-03-05libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>Masahiro Yamada6-6/+6
Thomas reported U-Boot failed to build host tools if libfdt-devel package is installed because tools include libfdt headers from /usr/include/ instead of using internal ones. This commit moves the header code: include/libfdt.h -> include/linux/libfdt.h include/libfdt_env.h -> include/linux/libfdt_env.h and replaces include directives: #include <libfdt.h> -> #include <linux/libfdt.h> #include <libfdt_env.h> -> #include <linux/libfdt_env.h> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-03-05spl: Kconfig: Rename SPL_USBETH_SUPPORT to SPL_USB_ETHER to match with the ↵Faiz Abbas2-3/+3
U-boot CONFIG Rename CONFIG_SPL_USBETH_SUPPORT to CONFIG_SPL_USB_ETHER. This enables users to block text using CONFIG_IS_ENABLED() instead of resorting to #if ladders with SPL and non-SPL cases. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
2018-02-21usb: gadget: sdp: add missing line breaksAndre Heider1-2/+2
Cosmetic change. Signed-off-by: Andre Heider <a.heider@gmail.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2018-02-14configs: Migrate CONFIG_SPL_FRAMEWORKTom Rini1-1/+9
Migrate the option CONFIG_SPL_FRAMEWORK and make this gate most of the current set of options we have in Kconfig. We will need to have some options available for SPL and !SPL_FRAMEWORK so this is important. In a few cases we re-order existing options so that we have less escapes from the SPL_FRAMEWORK guard. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-02-08spl: eMMC/SD: Provide one __weak spl_boot_mode() functionLukasz Majewski1-0/+11
The goal of this patch is to clean up the code related to choosing SPL MMC boot mode. The spl_boot_mode() now is called only in spl_mmc_load_image() function, which is only compiled in if CONFIG_SPL_MMC_SUPPORT is enabled. To achieve the goal, all per mach/arch implementations eligible for unification has been replaced with one __weak implementation. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Stefano Babic <sbabic@denx.de> Acked-by: Michal Simek <michal.simek@xilinx.com> (For ZynqMP) Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-01-29spl: include timezone in bannerKlaus Goger1-1/+1
Include the timezone in the SPL banner so the timestamp matches with that from u-boot proper. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-01-28Merge git://git.denx.de/u-boot-rockchipTom Rini1-1/+2
2018-01-28spl: add option to disable SPL banner outputAnatolij Gustschin2-0/+9
Selecting this option will reduce SPL boot time by approx. 6 ms (e. g. with 70 bytes long banner string at 115200 baud). Signed-off-by: Anatolij Gustschin <agust@denx.de> Tested-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-01-28spl: use different BOARD_INIT MACRO for spl and tplKever Yang2-1/+8
SPL and TPL may not always need spl_board_init() at the same time. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-01-28spl: atf: pass NULL for bl32_ep pcKever Yang1-1/+2
ATF use bl32_ep_info->pc to decide if thre is an available bl32, let's mark it as NULL first. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-01-12mmc: add a Kconfig option to enable the support for MMC write operationsJean-Jacques Hiblot1-0/+9
This allows using CONFIG_IS_ENABLED(MMC_WRITE) to compile out code needed only if write support is required. The option is added for u-boot and for SPL Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-01-03spl: atf: add SPL_ATF_NO_PLATFORM_PARAM optionPhilipp Tomsich2-3/+27
While we expect to call a pointer to a valid FDT (or NULL) as the platform parameter to an ATF, some ATF versions are not U-Boot aware and have an insufficiently robust (or an overzealour) parameter validation: either way, this may cause a hard-stop with uncooperative ATF versions. This change adds the option to suppress passing a platform parameter and will always pass NULL. Debug output from ATF w/ this option disabled (i.e. default): INFO: plat_param_from_bl2: 0x291450 Debug output from ATF w/ this option enabled: INFO: plat_param_from_bl2: 0 Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2017-12-14Merge git://git.denx.de/u-boot-dmTom Rini2-6/+29
2017-12-13binman: Add binman support to spl_ram.cSimon Glass1-4/+15
SPL supports reading U-Boot from a RAM location. At present this is hard-coded to the U-Boot text base address. Use binman to allow this to come from the image file, if binman is used. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-13binman: Add binman symbol support to SPLSimon Glass1-2/+14
Allow SPL to access binman symbols and use this to get the address of U-Boot. This falls back to CONFIG_SYS_TEXT_BASE if the binman symbol is not available. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-13SPL: Add FIT data-position property supportPeng Fan1-2/+9
For external data, FIT has a optional property "data-position" which can set the external data to a fixed offset to FIT beginning. Add the support for this property in SPL FIT. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tomas Melin <tomas.melin@vaisala.com> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: "Andrew F. Davis" <afd@ti.com> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: "tomas.melin@vaisala.com" <tomas.melin@vaisala.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Andre Przywara <andre.przywara@arm.com> Cc: York Sun <york.sun@nxp.com> Cc: Lokesh Vutla <lokeshvutla@ti.com> Cc: "Cooper Jr., Franklin" <fcooper@ti.com> Cc: George McCollister <george.mccollister@gmail.com> Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Cc: Rick Altherr <raltherr@google.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: York Sun <york.sun@nxp.com>
2017-11-28spl: TI: Do not default to SPL_FIT_IMAGE_TINY being enabledTom Rini1-1/+0
This option prevents booting on am335x_evm at least along with most likely other platforms. Fixes: 337bbb629777 ("spl: fit: add SPL_FIT_IMAGE_TINY config to reduce code-size") Signed-off-by: Tom Rini <trini@konsulko.com>
2017-11-26spl: fit: add SPL_FIT_IMAGE_TINY config to reduce code-sizePhilipp Tomsich2-3/+33
A minor code-size increase from the changes for tracking the os-type of FIT images and from infrastructure for recording the loadables into the the loaded FDT, broke the builds for sun50i and some OMAP2+ devices. This change adds a new config option (enabled by default for MACH_SUN50I, MACH_SUN50I_H5 and ARCH_OMAP2PLUS) that does skips these processing steps (bringing code size down to below the limit again). The os-type is not evaluated, but assumed to be IH_OS_UBOOT (i.e. taking the code-paths intended for backward-compatibility). Note that enabling this config option precludes any useful downstream processing, such as utilising a special calling convention for ATF or OPTEE, based on the os-type of the loadables. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-11-26spl: atf: drop the SPL_ATF_TEXT_BASE configuration itemPhilipp Tomsich1-6/+0
The SPL_ATF_TEXT_BASE configuration item has become obsolete. Remove it from Kconfig. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-26spl: rename config item SPL_ATF_SUPPORT to SPL_ATFPhilipp Tomsich2-2/+2
Having CONFIG_SPL_ATF seems more natural. Rename it, while it it is easy and there's few boards that use it (only RK3399 and RK3368 boards). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-26spl: atf: introduce spl_invoke_atf and make bl31_entry privatePhilipp Tomsich2-13/+82
This adds a new interface spl_invoke_atf() that takes a spl_image_info argument and then derives the necessary parameters for the ATF entry. Based on the additional information recorded (into /fit-images) from the FIT loadables, we can now easily locate the next boot stage. We now pass a pointer to a FDT as the platform-specific parameter pointer to ATF (so we don't run into the future headache of every board/platform defining their own proprietary tag-structure), as FDT access is already available in ATF. With the necessary infrastructure in place, we can now update the support for the ARM Trusted Firmware to dispatch into the spl_invoke_atf function only if a IH_OS_ARM_TRUSTED_FIRMWARE image is loaded. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-26spl: fit: implement recording of loadables into /fit-imagesPhilipp Tomsich1-14/+81
If a FDT was loaded (e.g. to append it to U-Boot image), we store it's address and record information for all loadables into this FDT. This allows us to easily keep track of images for multiple privilege levels (e.g. with ATF) or of firmware images preloaded into temporary locations (e.g. PMU firmware that may overlap the SPL stage). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-26spl: fit: simplify logic for FDT loading for non-OS bootsPhilipp Tomsich1-30/+56
To better support bootin through an ATF or OPTEE, we need to streamline some of the logic for when the FDT is appended to an image: depending on the image type, we'd like to append the FDT not at all (the case for the OS boot), to the 'firmware' image (if it is a U-Boot) or to one of the loadables (if the 'firmware' is an ATF, an OPTEE, or some other image-type and U-Boot is listed in the loadabled). To achieve this goal, we drop the os_boot flag and track the type of image loaded. If it is of type IH_OS_U_BOOT, we append the FDT. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: York Sun <york.sun@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-21thermal: ti-bandgap: Add support for temperature sensorFaiz Abbas1-0/+8
The dra7xx series of SOCs contain a temperature sensor and an associated analog-to-digital converter (ADC) which produces an output which is proportional to the SOC temperature. Add support for this temperature sensor. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-17SPL: fix printing of image nameAndré Draszik1-1/+1
The maximum length of the name of the image is obviously not sizeof(), which is just the length of a pointer, but IH_NMLEN. fixes: 62cf11c0921a90c6bd62344f4bc069668e6c698c ("SPL: Limit image name print length") Signed-off-by: André Draszik <adraszik@tycoint.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-11-07spl: set SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x4000 for rockchipKever Yang1-1/+2
Rockchip use a 'loader2' partition for U-Boot, so u-boot.bin or u-boot.itb load by SPL need to locate at0x4000. Detail here: http://opensource.rock-chips.com/wiki_Boot_option Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-11-06stm32: fix STMicroelectronics copyrightPatrice Chotard1-1/+2
Uniformize STMicroelectronics copyrights headers for STM32 related code. Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2017-10-12Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini1-1/+9
2017-10-09spl: fix assignment of board info to global dataYork Sun1-1/+9
Commit 15eb1d43bf47 ("spl: reorder the assignment of board info to global data") intended to move assignment of board info earlier, into board_init_r(). However, function preload_console_init() is called either from spl_board_init() or from board_init_f(). For the latter case, the board info assignment is much earlier than proposed board_init_r(). Create a new function to fill gd->bd and call this function when needed. Signed-off-by: York Sun <york.sun@nxp.com> CC: Lokesh Vutla <lokeshvutla@ti.com> CC: Ravi Babu <ravibabu@ti.com> CC: Lukasz Majewski <lukma@denx.de> CC: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-10-04treewide: replace with error() with pr_err()Masahiro Yamada2-4/+4
U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // <smpl> @@@@ -error +pr_err (...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Re-run Coccinelle] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-29TI: ARCH_OMAP2PLUS: Enable SPL_STACK_R and provide default valueTom Rini1-0/+1
On ARCH_OMAP2PLUS platforms we know what the DDR layout is going to be, and that it is safe to use SPL_STACK_R and provide a default value for it. select this and re-sync the defconfigs. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-29spl: spl_mmc: add __maybe_unused to mmc_load_image_raw_sector()Seung-Woo Kim1-2/+3
If there are no CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR and CONFIG_SPL_OS_BOOT, there is unused-function build warning. Add __maybe_unused macro to remove the warning. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2017-09-22spl: Fix compiling warning on gunzip argumentYork Sun1-1/+4
common/spl/spl_fit.c:201:12: warning: passing argument 4 of ‘gunzip’ from incompatible pointer type [-Wincompatible-pointer-types] src, &length)) Signed-off-by: York Sun <york.sun@nxp.com> Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de> CC: Jean-Jacques Hiblot <jjhiblot@ti.com>
2017-09-22spl: stash bootstage info before jump to next stageKever Yang1-7/+7
Since we may jump to next stage like ATF/OP-TEE instead of U-Boot, we need to stash the bootstage info before it. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-13spl: add newline in debug outputAnatolij Gustschin1-2/+2
With debug enabled, SPL output following these debug prints is on the same line and it is hard to read. Fix it. Signed-off-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-11spl: fit: Add booting OS firstYork Sun1-19/+41
If CONFIG_SPL_OS_BOOT is enabled, boot OS if kernel image is found in FIT structure. Signed-off-by: York Sun <york.sun@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-11spl: fit: Support both external and embedded dataYork Sun1-19/+33
SPL supports U-Boot image in FIT format which has data outside of FIT structure. This adds support for embedded data for normal FIT images. Signed-off-by: York Sun <york.sun@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-11spl: fit: Eanble GZIP support for image decompressionYork Sun1-2/+30
Add Kconfig option SPL_GZIP and SPL_ZLIB to enable gunzip support for SPL boot, eg. falcon boot compressed kernel image. Signed-off-by: York Sun <york.sun@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-07spl: typo fix for SPL_ATF_SUPPORT descriptionKever Yang1-1/+1
Delete one redundant 'which' for SPL_ATF_SUPPORT description. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2017-08-29spl: do not repeat timer init on i.MX6Anatolij Gustschin1-1/+1
The GPT timer was already initialised in board_init_f() as it is needed in dram init. Do not repeat timer init in board_init_r(). Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Stefano Babic <sbabic@denx.de>
2017-08-23spl: add serial download protocol (SDP) supportStefan Agner3-0/+44
Add USB serial download protocol support to SPL. If the SoC started in recovery mode the SPL will immediately switch to SDP and wait for further downloads/commands from the host side. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Stefano Babic <sbabic@denx.de> Reviewed-by: Łukasz Majewski <lukma@denx.de>
2017-08-20spl: spl_mmc.c Correct blk_dread() return value checkTom Rini1-1/+1
The function blk_dread will return -ENOSYS on failure or on success the number of blocks read, which must be the number asked to read (otherwise it failed somewhere). Correct this check. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-08-17spl: fix Makefile for NOR, XIP and YMODEMPhilipp Tomsich1-3/+3
During the the conversion to $(SPL_TPL_), the SPL_ fragment was left over for the NOR, XIP and YMODEM boot methods in SPL, making these unselectable. This commit fixes this by dropping the spurious 'SPL_' fragment from each line. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reported-by: Bo Shen <voice.shen@gmail.com> Fixes: f94e643 (spl: consistently use $(SPL_TPL_) to select features for SPL and TPL builds)
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass4-6/+6
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename setenv() to env_set()Simon Glass3-4/+4
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-13dm: timer: normalise SPL and TPL supportPhilipp Tomsich1-8/+0
To fully support DM timer in SPL and TPL, we need a few things cleaned up and normalised: - inclusion of the uclass and drivers should be an all-or-nothing decision for each stage and under control of $(SPL_TPL_)TIMER instead of having the two-level configuration with TIMER and $(SPL_TPL_)TIMER_SUPPORT - when $(SPL_TPL_)TIMER is enabled, the ARMv8 generic timer code can not be compiled in This normalises configuration to $(SPL_TPL_)TIMER and moves the config options to drivers/timer/Kconfig (and cleans up the collateral damage to some defconfigs that had SPL_TIMER_SUPPORT enabled). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-08-13moveconfig: migrate TPL_STACK, TPL_TEXT_BASE and TPL_MAX_SIZEPhilipp Tomsich1-0/+1
We can finally drop TPL_STACK, TPL_TEXT_BASE and TPL_MAX_SIZE off the whitelist (this time it's really happening!) and migrate the setting (only used on the RK3368-uQ7 so far) into Kconfig. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-08-13spl: support TPL_STACK, TPL_MAX_SIZE and TPL_TEXT_BASE via KconfigPhilipp Tomsich1-0/+39
Let's clean up behind ourselves and move the (newly defined) TPL_STACK, TPL_MAX_SIZE and TPL_TEXT_BASE into Kconfig. Given that 0x0 might be considered to be valid values for TPL_TEXT_BASE and TPL_STACK, we need to introduce helper config options ("TPL_NEEDS_SEPARATE_...") to indicate that these symbols are used (and not inherited from their SPL variants) for any given target-platform. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>