summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2018-04-11spl: ram: Add TPL Kconfig symbolsMarek Vasut1-0/+14
Add TPL config symbols for RAM loading matching the SPL ones. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2018-04-11spl: ram: Convert to CONFIG_IS_ENABLEDMarek Vasut1-3/+3
This patch is a preparation for adding TPL support for RAM loading. CONFIG_IS_ENABLED allows for proper handling of the U-Boot/SPL/TPL differences in config symbol names. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2018-04-11tpl: ymodem: Add CONFIG_TPL_YMODEM_SUPPORT to KconfigMarek Vasut1-0/+8
Add Kconfig entry for CONFIG_TPL_YMODEM_SUPPORT symbol to match the SPL one. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2018-04-11tpl: spi: Add CONFIG_TPL_SPI_LOAD to KconfigMarek Vasut1-0/+7
Add Kconfig entry for CONFIG_TPL_SPI_LOAD symbol to match the SPL one. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2018-04-11spl: spi: Move CONFIG_SPL_SPI_LOAD to KconfigMarek Vasut1-0/+7
Add Kconfig entry for CONFIG_SPL_SPI_LOAD symbol and move all configurations using it to Kconfig. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2018-04-10log: Correct missing free() on error in log_add_filter()Simon Glass1-6/+11
If there is a problem with the parameters to log_add_filter(), the memory allocated is currently not freed. Fix this. Reported-by: Coverity (CID: 171962) Signed-off-by: Simon Glass <sjg@chromium.org>
2018-04-08treewide: Migrate CONFIG_DISPLAY_BOARDINFO_LATE to KconfigMario Six1-1/+8
Migrate the CONFIG_DISPLAY_BOARDINFO_LATE option to Kconfig. Signed-off-by: Mario Six <mario.six@gdsys.cc> [trini: Re-run migration] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-08treewide: Migrate CONFIG_LAST_STAGE_INIT to KconfigMario Six1-0/+9
Migrate the CONFIG_LAST_STAGE_INIT option to Kconfig. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-04-08treewide: Migrate CONFIG_BOARD_EARLY_INIT_R to KconfigMario Six1-0/+7
Migrate the CONFIG_BOARD_EARLY_INIT_R option to Kconfig. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-04-07image: fit: Show information about OS type in firwmare case tooMichal Simek1-1/+2
SPL ATF implementation requires FIT image with partitions where the one is Firmware/ATF and another one Firmware/U-Boot. OS field is used for recording that difference that's why make sense to show values there for Firmware types. For example: Image 0 (atf) Description: ATF bl31.bin Created: Mon Mar 26 15:58:14 2018 Type: Firmware Compression: uncompressed Data Size: 51152 Bytes = 49.95 KiB = 0.05 MiB Architecture: ARM OS: ARM Trusted Firmware Load Address: 0xfffe0000 Hash algo: md5 Hash value: 36a4212bbb698126bf5a248f0f4b5336 Image 1 (uboot) Description: u-boot.bin Created: Mon Mar 26 15:58:14 2018 Type: Firmware Compression: uncompressed Data Size: 761216 Bytes = 743.38 KiB = 0.73 MiB Architecture: ARM OS: U-Boot Load Address: 0x08000000 Hash algo: md5 Hash value: f22960fe429be72296dc8dc59a47d566 Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jun Nie <jun.nie@linaro.org>
2018-04-07image: fit: Show firmware configuration property if presentMichal Simek2-1/+6
SPL ATF support requires to have firmware property which should be also listed by mkimage -l when images is created. The patch is also using this macro in spl_fit to match keyword. When image is created: Default Configuration: 'config' Configuration 0 (config) Description: ATF with full u-boot Kernel: unavailable Firmware: atf FDT: dtb Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jun Nie <jun.nie@linaro.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-04-07spl: spl_mmc: provide one weak function spl_boot_partitionPatrick Delaunay1-2/+13
The spl_boot_partition function has been added in order to have the possibility to boot on a same binary from different mmc devices with different partitions. By default keep the current behavior, SPL use the partition defined by CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Christophe KERELLO <christophe.kerello@st.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-04-07input: Drop PS/2 keyboard supportSimon Glass1-15/+0
This is not used by any current board and has not been converted to driver model. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-04-07Migrate CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSCAlex Kiernan1-0/+7
This converts CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC to Kconfig Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-04-04Merge git://git.denx.de/u-boot-sunxiTom Rini1-2/+8
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-03spl: fix binman_sym output checkMiquel Raynal1-2/+8
A previous commit introduced the use of binman in the SPL. After the binman_sym call over the 'pos' symbol, the output value is checked against BINMAN_SYM_MISSING (-1UL). According to the documentation (tools/binman/README), when it comes to the 'pos' attribute: pos: This sets the position of an entry within the image. The first byte of the image is normally at position 0. If 'pos' is not provided, binman sets it to the end of the previous region, or the start of the image's entry area (normally 0) if there is no previous region. So instead of checking if the return value is BINMAN_SYM_MISSING, we should also check if the value is not null. The failure happens when using both the SPL file and the U-Boot file independently instead of the concatenated file (SPL + padding + U-Boot). This is because the U-Boot binary file alone does not have the U-Boot header while it is present in the concatenation file. Not having the header forces the SPL to discover where it should load U-Boot. The binman_sym call is supposed to do that but fails. Because of the wrong check, the destination address was set to 0 while it should have been somewhere in RAM. This, obviously, stalls the board. Fixes: 8bee2d251afb ("binman: Add binman symbol support to SPL") Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
2018-04-02Merge git://git.denx.de/u-boot-dmTom Rini1-0/+3
2018-04-01libfdt: move FDT_RAMDISK_OVERHEAD to image-fdt.cMasahiro Yamada1-0/+3
This macro is locally referenced in common/image-fdt.c Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-03-30tools: mkimage: Support RISC-V archRick Chen1-0/+1
Add riscv uimage arch to support riscv-linux booting. It can Convert riscv-linux to image which can be booted by bootm command. Signed-off-by: Rick Chen <rick@andestech.com> Signed-off-by: Rick Chen <rickchen36@gmail.com>
2018-03-21arc: Introduce a possibility to not relocate U-bootAlexey Brodkin1-1/+2
Disabling relocation might be useful on ARC for 2 reasons: a) For advanced debugging with Synopsys proprietary MetaWare debugger which is capable of accessing much more specific hardware resources compared to gdb. For example it may show contents of L1 and L2 caches, internal states of some hardware blocks etc. But on the downside MetaWare debugger still cannot work with PIE. Even though that limitation could be work-arounded with change of ELF's header and stripping down all debug info but with it we won't have debug info for source-level debugging which is quite inconvenient. b) Some platforms which might benefit from usage of U-Boot basically don't have enough RAM to accommodate relocation of U-Boot so we keep code in flash and use as much of RAM as possible for more interesting things. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Heiko Schocher <hs@denx.de> Cc: York Sun <york.sun@nxp.com> Cc: Stefan Roese <sr@denx.de>
2018-03-19bootm: optee: Add a bootm command for type IH_OS_TEEBryan O'Donoghue1-0/+32
This patch makes it possible to verify the contents and location of an OPTEE image in DRAM prior to handing off control to that image. If image verification fails we won't try to boot any further. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Suggested-by: Andrew F. Davis <afd@ti.com> Cc: Harinarayan Bhatta <harinarayan@ti.com> Cc: Andrew F. Davis <afd@ti.com> Cc: Tom Rini <trini@konsulko.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Peng Fan <peng.fan@nxp.com>
2018-03-19image: Add IH_OS_TEE for TEE chain-load bootBryan O'Donoghue1-0/+1
This patch adds a new type IH_OS_TEE. This new OS type will be used for chain-loading to Linux via a TEE. With this patch in-place you can generate a bootable OPTEE image like this: mkimage -A arm -T kernel -O tee -C none -d tee.bin uTee.optee where "tee.bin" is the input binary prefixed with an OPTEE header and uTee.optee is the output prefixed with a u-boot wrapper header. This image type "-T kernel -O tee" is differentiated from the existing IH_TYPE_TEE "-T tee" in that the IH_TYPE is installed by u-boot (flow control returns to u-boot) whereas for the new IH_OS_TEE control passes to the OPTEE firmware and the firmware chainloads onto Linux. Andrew Davis gave the following ASCII diagram: IH_OS_TEE: (mkimage -T kernel -O tee) Non-Secure Secure BootROM | ------------- | v SPL | v U-Boot ------> <----- OP-TEE | V Linux IH_TYPE_TEE: (mkimage -T tee) Non-Secure Secure BootROM | ------------- | v SPL -------> <----- OP-TEE | v U-Boot | V Linux Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Suggested-by: Andrew F. Davis <afd@ti.com> Cc: Harinarayan Bhatta <harinarayan@ti.com> Cc: Andrew F. Davis <afd@ti.com> Cc: Tom Rini <trini@konsulko.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Peng Fan <peng.fan@nxp.com> Link: http://mrvan.github.io/optee-imx6ul
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-19tools/mkimage: add support for STM32 image formatPatrick Delaunay1-0/+1
STM32MP157 bootrom needs a specific header for first boot stage. This patch adds support of this header in mkimage. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-19SPL: Add signature verification when loading imageJun Nie2-22/+46
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-16common: move init_helpers.h prototypes in init.hPatrick Delaunay2-2/+0
Merge init_helpers.h in the new file init.h with only prototypes for init_cache_f_r used in common/board_f.c Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-16common: move board_f.c prototypes in init.hPatrick Delaunay1-1/+1
Move prototypes for function used in common/board_f.c from common.h to init.h Remove weak for arch_reserve_stacks in prototype (checkpatch issue) Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-14common/memsize.c: restore content of the base addressPatrick Delaunay1-0/+7
For the last return of function get_ram_size(), when size=maxsize, restore the base address (*base) content. Add comment for the remaining case to avoid regression: this case is already correctly handled. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-14common/memsize.c: prepare get_ram_size updatePatrick Delaunay1-3/+4
Save the content of the base address in a new variable in stack (save_base) to prepare restore this content. This patch don't modified code behavior and stack usage. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-05libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>Masahiro Yamada15-15/+15
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-24Convert CONFIG_BOOTP_BOOTPATH et al to KconfigAdam Ford1-0/+8
This converts the following to Kconfig: CONFIG_BOOTP_BOOTPATH CONFIG_BOOTP_DNS CONFIG_BOOTP_GATEWAY CONFIG_BOOTP_HOSTNAME CONFIG_BOOTP_PXE CONFIG_BOOTP_SUBNETMASK CONFIG_CMDLINE_EDITING CONFIG_AUTO_COMPLETE CONFIG_SYS_LONGHELP CONFIG_SUPPORT_RAW_INITRD CONFIG_ENV_VARS_UBOOT_CONFIG Signed-off-by: Adam Ford <aford173@gmail.com> [trini: Re-run the migration] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-02-23Merge git://git.denx.de/u-boot-usbTom Rini2-4/+6
2018-02-23fdt: Fixup only valid memory banksThierry Reding1-0/+7
Memory banks with address 0 and size 0 are empty and should not be passed to the OS via device tree. Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2018-02-21dfu: Rename _FUNCTION_DFU to DFU_OVER_Marek Vasut1-2/+2
Do the following to make the symbol names less confusing. sed -i "s/\([TU][^_]\+\)_FUNCTION_DFU/DFU_OVER_\1/g" \ `git grep _FUNCTION_DFU | cut -d ":" -f 1 | sort -u` Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Lukasz Majewski <lukma@denx.de>
2018-02-21dfu: Fix up the Kconfig messMarek Vasut1-2/+4
Clean up the screaming mess of configuration options that DFU is. It was impossible to configure DFU such that TFTP is enabled and USB is not, this patch fixes that and assures that DFU TFTP and DFU USB can be enabled separatelly and that the correct pieces of code are compiled in. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Lukasz Majewski <lukma@denx.de>
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-18fdt: Fixup only valid memory banksThierry Reding1-1/+7
Memory banks with address 0 and size 0 are empty and should not be passed to the OS via device tree. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Stephen Warren <swarren@nvidia.com>
2018-02-18fdt: Implement weak arch_fixup_fdt()Alexey Brodkin1-0/+5
Only ARM and in some configs MIPS really implement arch_fixup_fdt(). Others just use the same boilerplate which is not good by itself, but what's worse if we try to build with disabled CONFIG_CMD_BOOTM and enabled CONFIG_OF_LIBFDT we'll hit an unknown symbol which was apparently implemented in arch/xxx/lib/bootm.c. Now with weak arch_fixup_fdt() right in image-fdt.c where it is used we get both items highlighted above fixed. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: York Sun <york.sun@nxp.com> Cc: Stefan Roese <sr@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.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-14fix spelling of 'functions' in 2 places (was 'funtcions')Simon Goldschmidt1-1/+1
Signed-off-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com>
2018-02-14tftp: update: Include missing cfi_flash.h headerMarek Vasut1-0/+1
Add the missing header, otherwise CONFIG_SYS_MAX_FLASH_BANKS may be undeclared. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2018-02-14cmd: fitupd: Convert CONFIG_UPDATE_TFTP and co.Marek Vasut1-0/+21
Convert the CONFIG_UPDATE_TFTP and related symbols to Kconfig. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2018-02-13spl: fit: move fdt_record_loadable out of ARCH_FIXUP_FDT_MEMORY guardPhilipp Tomsich1-39/+39
The fdt_record_loadable()-function was wedged between other functions that were guarded by ARCH_FIXUP_FDT_MEMORY. This could lead to linker errors on some configurations. With this change, fdt_record_loadable() is moved out of the ARCH_FIXUP_FDT_MEMORY guard (plus I tried to retain alphabetical ordering for functions by placing it appropriately). References: 9f45aeb ("spl: fit: implement fdt_record_loadable") Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reported-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Michal Simek <michal.simek@xilinx.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-02-08parse the second area of android imageBin Chen1-0/+19
The second area of android image was intended to put a 2nd stage bootloader but in practice were rarely used (in my knowledge). An proposal was made to the AOSP to (re)use the second area as the dtb[1], This patch itself doesn't depend on that proposal being accepted but it won't be that helpful as well if that proposal won't be accepted. But don't do any harm as well. [1] https://android-review.googlesource.com/#/c/417447/ Signed-off-by: Bin Chen <bin.chen@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2018-02-03log: add category LOGC_EFIHeinrich Schuchardt1-0/+1
The EFI implementation does not fit into any of the existing categories. Provide LOGC_EFI so that EFI related message can be filtered. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-02-03log: Add a way to log error-return valuesSimon Glass1-0/+13
When functions return an error it propagates up the stack to the point where it is reported. Often the error code provides enough information about the root cause of the error that this is obvious what went wrong. However in some cases the error may be hard to trace. For example if a driver uses several devices to perform an operation, it may not be obvious which one failed. Add a log_ret() macro to help with this. This can be used to wrap any error-return value. The logging system will then output a log record when the original error is generated, making it easy to trace the call stack of the error. This macro can significantly impact code size, so its use is controlled by a Kconfig option, which is enabled for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-02-03log: Update log_console to honour the log formatSimon Glass1-1/+26
At present this just outputs the message. Update it to output whatever the format requests. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-02-03log: Add control over log formattingSimon Glass1-0/+1
It is useful to be able to control the output format of log records on the console. As a starting point, add definitions for controlling which elements of the log record are displayed. Use function and message as the default, since these are the most useful fields. Signed-off-by: Simon Glass <sjg@chromium.org>