This allows using CONFIG_IS_ENABLED(SPLMTD_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: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ia48169fcd601ad51d1723923ed71d610901275e1
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
Change-Id: Ibb3836ed8713e491238460783a85ee1808770f66
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
(cherry picked from commit d6400c3f8520bb9a203fe397039279c80f093c27)
This option was added by RKFW boot flow, let's reuse it.
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id4625a783747ce2e4ebaf69a5fa3812077a79639
Find the uboot by CONFIG_MTD_BLK_U_BOOT_OFFS address from nand,
spi nand, nor flash with mtd block interface.
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I6032570406a8eda2609ad877785e71c6c8b5df0c
Load compressed kernel and ramdisk firmwares in these addresses.
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Icca49069fcaa08c19f5ef574d9ec4f803dbba6d1
The symbol CONFIG_SPL_DFU_SUPPORT in SPL build has the same
meaning as CONFIG_DFU in regular U-Boot. Drop the _SUPPORT
to allow for cleaner use in code.
Conflicts:
arch/arm/mach-zynqmp/spl.c
common/Makefile
common/spl/Kconfig
common/spl/spl_ram.c
Change-Id: I93f09d5953284d511df135e6e71c03c0552719a2
Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Lukasz Majewski <lukma@denx.de>
(cherry picked from commit 6536ca4d6676bf38e50784298e713edc30b9cde9)
The SPL option for USB gadget should be named after the option for u-boot
(CONFIG_USB_GADGET)
Conflicts:
arch/arm/mach-imx/mx6/Kconfig
arch/arm/mach-imx/spl.c
configs/am335x_boneblack_vboot_defconfig
configs/am335x_evm_usbspl_defconfig
configs/am43xx_evm_defconfig
configs/am43xx_hs_evm_defconfig
configs/imx6q_logic_defconfig
configs/mx6memcal_defconfig
configs/mx6sabresd_defconfig
configs/pico-hobbit-imx6ul_defconfig
configs/pico-hobbit-imx7d_defconfig
configs/pico-imx6ul_defconfig
configs/pico-imx7d_defconfig
configs/pico-pi-imx6ul_defconfig
configs/pico-pi-imx7d_defconfig
drivers/Makefile
Change-Id: I51305422f13cb7d743274f82c531000c0f93c144
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
(cherry picked from commit f811e9763f4b6f6f5e3fe9c2fa30d2b6c62d289e)
Add a tiny SPI flash stack that just supports reading data/images from
SPI flash. This is useful for boards that have SPL size constraints and
would need to use SPI flash framework just to read images/data from
flash. There is approximately 1.5 to 2KB savings with this.
Based on prior work of reducing spi flash id table by
Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Change-Id: I9b87d3ed4a01d2ce31eee327b67689e5e2ecff57
Signed-off-by: Vignesh R <vigneshr@ti.com>
Tested-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Tested-by: Stefan Roese <sr@denx.de>
Tested-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Tested-by: Jagan Teki <jagan@amarulasolutions.com> #zynq-microzed
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 778572d7cb1e2df678340fda9b081e4f7bd6c4b3)
Sync Serial Flash Discoverable Parameters (SFDP) parsing support from
Linux. This allows auto detection and configuration of Flash parameters.
Signed-off-by: Vignesh R <vigneshr@ti.com>
Tested-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Tested-by: Stefan Roese <sr@denx.de>
Tested-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Jagan Teki <jagan@openedev.com>
Tested-by: Jagan Teki <jagan@amarulasolutions.com> #zynq-microzed
Change-Id: I595586c8e491a56b6819182bc30de8e7f70b9476
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 0c6f187cdb18b52bcf6d3964771cf3a36b758568)
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>
Change-Id: Ibb56f85620c4798fb579be3e4e30438963b7c48b
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit a430fa06a4ac50e785fdbfb7f43c3cb14b35619c)
This patch add SPL support to load rockchip images(trust and U-Boot).
Change-Id: I4f66dbd26af051feb93dfaca57062fd31b3dc695
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Some times we want to relocate spl code to dram after dram
initialization or relocate spl code to a high memory to avoid
code overide.
For example on Rockchip armv8 platform, we run with boot flow
TPL->SPL->ATF->U-Boot.
TPL run in sram and is responsible for dram initialization.
SPL run from the start address of dram and is responsible for
loading ATF and U-Boot.
The case here is that the ATF load address is from 64KB of dram,
which overlaps with spl code itself.
So we want to relocate spl itself to high memory to aovid this.
Change-Id: Ifcae4444c04fa1208406b51196cf8737277ace90
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Some devices cann't use SPL framework at TPL stage, but the
CONFIG_SPL_FRAMEWORK is still defined at TPL stage, so need
to separate them with CONFIG_TINY_TPL.
If the SPL framewrok was used both at TPL and SPL stage,
CONFIG_TINY_TPL is not defined.
If the SPL framewrok was used at SPL stage, but not use at
TPL, need to define CONFIG_TINY_TPL.
Change-Id: Iabb7e0377ee00311ca468cb8ff7544c96bd999d6
Signed-off-by: David Wu <david.wu@rock-chips.com>
SPL and TPL may not always need spl_board_init() at the same time.
Change-Id: I5f26956414f1d2ff3fd2fce11a4d7759de7804fe
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
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;
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
Change-Id: I1344a35dd11bd69ca00e9b99909e1eb610648d86
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 32470d8ebee6a9c31a7a6b82704c486ef06cf549)
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
Change-Id: Ic13bf77aa509407563d10ad3ce790087f2d1dc07
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>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit d21fb63d772d32373600abeb7afcb53033e087a7)
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.
Change-Id: I32036975208be6e9d9d2ad3b5376444efd693f25
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit 337bbb6297775e8e9d664e96e96004f00d1d8c02)
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).
Change-Id: Ie13ba6eeb687bf6f8c8d326c197f453fb752e9bd
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
(cherry picked from commit aa122f6b3d24bd133392c7dd2a882a8cc2cbd622)
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
Change-Id: I3375346d04538cef1ce797bd2da5480c9ed50674
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
We don't need SPL_ATF_TEXT_BASE since we can get the bl31 entry
from spl_image.entry_point.
Change-Id: I730ad6548e277527f1b07b40ffb7a3bc0a9d6d35
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
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;
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
Change-Id: I1344a35dd11bd69ca00e9b99909e1eb610648d86
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
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>
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>
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>
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>
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>
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>
Now that we have split up SPL_LDSCRIPT into a SPL and TPL variant and
have started to use the TPL-variant for the RK3368, it's time to clean
up behind ourselves: move both variants into Kconfig and remove them
from the whitelist.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This adds the TPL_DRIVER_MISC_SUPPORT option to allow activation of
DRIVER_MISC_SUPPORT for devices that need it in the TPL stage.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
As include/malloc.h already checks for SYS_MALLOC_SIMPLE using the
CONFIG_IS_ENABLED macro, we need to move to having separate entries
as we switch to fully separate configuration for SPL and TPL.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
TPL_NAND_SUPPORT, TPL_SERIAL_SUPPORT, TPL_SPI_FLASH_SUPPORT and
TPL_SPI_SUPPORT refer to SPL in their help text. This fixes up
the description to correctly reference TPL.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
On the RK3368, we want our TPL to use the 'return to bootrom' boot
method (to have the bootrom load up the SPL stage) and then continue
with different boot methods (MMC, SPI, etc.) from SPL.
This adds the config option needed to control the availabily of the
'return to bootrom' boot-method separately for the TPL stage.
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Some devices (e.g. the RK3368) have only limited SRAM, but provide
support for loading the next boot stage after our SPL performs basic
setup (e.g. DRAM).
For target systems like these, we add a boot device BOOTROM that will
invoke a board-specific hook to return to the bootrom (if supported).
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Enable support for XIP (execute in place) of U-Boot or kernel image. There is
no need to copy image from flash to ram if flash supports execute in place.
Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
Reviewed-by: Alexandru Gagniuc <alex.g@adaptrum.com>
Much of the entries here simply depend on SPL (or TPL). Instead of this
redundancy use if SPL / if TPL to guard the rest of the choices and only
show them when we have the relevant option enabled.
Signed-off-by: Tom Rini <trini@konsulko.com>