summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2018-05-26add FIT data-position & data-offset property supportKelvin Cheung
Add FIT data-position & data-offset property support for bootm, which were already supported in SPL. Signed-off-by: Kelvin Cheung <keguang.zhang@gmail.com>
2018-05-26malloc: Use malloc simple before malloc is fully initialized in memalign()Ley Foon Tan
Follow implementation in mALLOc(). Check GD_FLG_FULL_MALLOC_INIT flag and use malloc_simple if GD_FLG_FULL_MALLOC_INIT is unset. Adjust the malloc bytes to align with the requested alignment. The original memalign() function will access mchunkptr struct to adjust the alignment if there is misalignment happen, but mchunkptr struct is not being initialized before full malloc is initialized. This cause the system crash. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
2018-05-23spl: Add full fitImage supportMarek Vasut
Add support for loading U-Boot and optionally FDT from a fitImage in SPL by using the full fitImage support from U-Boot. While we do have limited SPL loading support in SPL with a small footprint, it is missing a lot of important features, like checking signatures. This support has all the fitImage features, while the footprint is obviously larger. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-23fit: Add standalone image type handlingMarek Vasut
Just add IH_TYPE_STANDALONE to fit_get_image_type_property(). Signed-off-by: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-23fit: Add empty fit_print_contents() and fit_image_print()Marek Vasut
These functions may be needed in SPL, so add empty variants of them if CONFIG_SPL_FIT_PRINT is disabled. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-23fit: Fix CONFIG_FIT_SPL_PRINTMarek Vasut
Rename CONFIG_FIT_SPL_PRINT to CONFIG_SPL_FIT_PRINT and add Kconfig entry for it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-23spl: fit: Add support for loading FPGA bitstreamMarek Vasut
Add support for loading FPGA into the SPL fitImage support. The mechanism is flexible and allows user to override the actual function for loading the FPGA itself. This is because on some systems, the FPGA must be programmed to allow DRAM access, so loading the full fitImage may not be possible if it contains the bitstream. Instead, the spl_load_fpga_image() provides all the tools to load the bitstream in parts while programming it into the FPGA. Signed-off-by: Marek Vasut <marex@denx.de> [trini: Don't always have a branch to print out type] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-23FIT: Make fit_conf_print() be a static functionTom Rini
We only call fit_conf_print from one place in the code, so mark it as static and move it up to where we call it. This in turn has us move a few other already static functions up further as well. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-11Merge tag 'xilinx-for-v2018.07' of git://www.denx.de/git/u-boot-microblazeTom Rini
Xilinx changes for v2018.07 microblaze: - Align defconfig zynq: - Rework fpga initialization and cpuinfo handling zynqmp: - Add ZynqMP R5 support - Wire and enable watchdog on zcu100-revC - Setup MMU map for DDR at run time - Show board info based on DT and cleanup IDENT_STRING zynqmp tools: - Add read partition support - Add initial support for Xilinx bif format for boot.bin generation mmc: - Fix get_timer usage on 64bit cpus - Add support for SD3.0 UHS mode nand-zynq: - Add support for 16bit buswidth - Use address cycles from onfi params scsi: - convert ceva sata to UCLASS_AHCI timer: - Add Cadence TTC for ZynqMP r5 watchdog: - Minor cadence driver cleanup
2018-05-11tools: zynqmpimage: Add bif supportAlexander Graf
The officially described way to generate boot.bin files for ZynqMP is to describe the contents of the target binary using a file of the "bif" format. This file then links to other files that all get packed into a bootable image. This patch adds support to read such a .bif file and generate a respective ZynqMP boot.bin file that can include the normal image and pmu files, but also supports image partitions now. This makes it a handy replacement for the proprietary "bootgen" utility that is currently used to generate boot.bin files with FSBL. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-05-10Merge git://git.denx.de/u-boot-socfpgaTom Rini
2018-05-10xyz-modem: va_start() must be matched by va_end()Heinrich Schuchardt
Every va_start() call must be matched by a va_end() call. scripts/checkpatch.pl required reformatting the complete function zm_dprintf(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-05-10Fix Ymodem build when DEBUG and CONFIG_USE_TINY_PRINTF are selectedAlex Kiernan
Attempting to build with both DEBUG and CONFIG_USE_TINY_PRINTF along with CONFIG_SPL_YMODEM_SUPPORT fails at link time: common/built-in.o: In function `zm_dprintf': common/xyzModem.c:190: undefined reference to `vsprintf' Disable Ymodem debug if we don't have full vsprintf support. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
2018-05-10bootcount: spl: Extend SPL to support bootcount incrementationLukasz Majewski
This patch adds support for incrementation of the bootcount in SPL. Such feature is necessary when we do want to use this feature with 'falcon' boot mode (which loads OS directly in SPL). Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-05-10bootcount: Rewrite autoboot to use wrapper functions from bootcount.hLukasz Majewski
The code has been refactored to use common wrappers from bootcount.h header. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-05-10bootcount: spl: Enable bootcount support in SPLLukasz Majewski
New, SPL related config option - CONFIG_SPL_BOOTCOUNT_LIMIT has been added to allow drivers/bootcount code re-usage in SPL. This code is necessary to use and setup bootcount in SPL in the case of falcon boot mode. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-05-08bootm.c: Correct the flush_len used in bootm_load_os()Tom Rini
In do_bootm_states when doing BOOTM_STATE_LOADOS we use load_end uninitialized and Coverity notes this now. This however leads down another interesting path. We pass this pointer to bootm_load_os and that in turn uses this uninitialized value immediately to calculate the flush length, and is wrong. We do not know what load_end will be until after bootm_decomp_image is called, so we must only set flush_len after that. All of this also makes it clear that the only reason we pass a pointer for load_end to bootm_load_os is so that we can call lmb_reserve on success. Rather than initialize load_end to 0 in do_bootm_states we can just call lmb_reserve ourself. Reported-by: Coverity (CID: 175572) Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-08image: fit: Show signatures and hashes for configurationsClément Péron
The signature/hash information are displayed for images but nor for configurations. Add subnodes printing in fit_conf_print() like it's done in fit_image_print() Signed-off-by: Clément Péron <peron.clem@gmail.com> [trini: Add guards around fit_conf_print to avoid warnings] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-08image: socfpga: Add SFP image version 1 definitionMarek Vasut
Add support for the SoCFPGA header v1, which is used on Arria 10. The layout of the v0 and v1 header is similar, yet there are a few differences which make it incompatible with previous v0 header, so add a new entry. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Chin Liang See <chin.liang.see@intel.com>
2018-05-07fastboot: sparse: make write_sparse_image useable for non-fastbootJassi Brar
write_sparse_image could be useful for non-fastboot users. For ex a platform, without usb-device/fastboot support, could get sparse images over tftp and write using the mmc command. Or non-android systems could also leverage the sparse format. Towards that, this patch removes anything fastboot specific from the write_sparse_image implementation. Which includes making the function return integer as error code and calls for fastboot logging via an optional callback function 'mssg'. Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2018-05-07fastboot: sparse: remove redundant argument to write_sparse_imageJassi Brar
'sz' has no use for write_sparse_image, remove it simplifying the api. Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2018-05-07SPDX: Convert all of our multiple license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have multiple licenses (in these cases, dual license) declared in the SPDX-License-Identifier tag. In this case we change from listing "LICENSE-A LICENSE-B" or "LICENSE-A or LICENSE-B" or "(LICENSE-A OR LICENSE-B)" to "LICENSE-A OR LICENSE-B" as per the Linux Kernel style document. Note that parenthesis are allowed so when they were used before we continue to use them. Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-06stdio_names: Ensure MAX_NAMES is defined before use, don't use 3 directlyTom Rini
With tighter build flags the fact that <stdio_dev.h> doesn't have a reference back to MAX_NAMES causes an error. Include <stdio.h> here and then in common/console.c use MAX_NAMES rather than 3 when working with stdio_names. Reported-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com> Tested-by: Peter Robinson <pbrobinson@gmail.com>
2018-04-28spl: Split sprintf, strto* from SPL serial in KconfigAlex Kiernan
When SPL serial is disabled, callers who need sprintf or strtoul fail because their inclusion is guarded by CONFIG_SPL_SERIAL_SUPPORT/ CONFIG_TPL_SERIAL_SUPPORT. Split printf, sprintf and strto into their own entries and then select all of them if SERIAL_SUPPORT is enabled to match the current behaviour. Include panic.o unconditionally as it can be called from anywhere which uses BUG_ON(). Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-04-28spl: Add dependency on serial to YmodemAlex Kiernan
Building with Ymodem support requires serial in SPL/TPL, add that dependency here. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-04-28spl: ti: Avoid preloader_console_init if !CONFIG_SPL_SERIAL_SUPPORTAlex Kiernan
If CONFIG_SPL_SERIAL_SUPPORT is disabled then the build fails because serial_init is undefined. Guard preloader_console_init() appropriately to fix this. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-04-28log: CONFIG_LOG should select CONFIG_DMHeinrich Schuchardt
Compling with CONFIG_LOG and without CONFIG_DM results in common/log.c:47: undefined reference to `uclass_get_name' Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-04-27Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini
We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-27Convert CONFIG_SPI to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_SPI This partly involves updating code that assumes that CONFIG_SPI implies things that are specific to the MPC8xx SPI driver. For now, just update the CONFIG tests. This also involves reworking the default for CONFIG_SYS_DEF_EEPROM_ADDR so that we don't set it when we cannot make a reasonable default, as it does not cause any compile failures. Signed-off-by: Adam Ford <aford173@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-17bootm: Align cache flush begin addressBryan O'Donoghue
commit b4d956f6bc0f ("bootm: Align cache flush end address correctly") aligns the end address of the cache flush operation to a cache-line size to ensure lower-layers in the code accept the range provided and flush. A similar action should be taken for the begin address of a cache flush operation. The load address may not be aligned to a cache-line boundary, so ensure the passed address is aligned. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reported-by: Breno Matheus Lima <brenomatheus@gmail.com> Suggested-by: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Tested-by: Breno Lima <breno.lima@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-04-11spl: ram: Add TPL Kconfig symbolsMarek Vasut
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 Vasut
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 Vasut
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 Vasut
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 Vasut
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 Glass
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 Six
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 Six
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 Six
Migrate the CONFIG_BOARD_EARLY_INIT_R option to Kconfig. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-04-06image: fit: Show information about OS type in firwmare case tooMichal Simek
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-06image: fit: Show firmware configuration property if presentMichal Simek
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-06spl: spl_mmc: provide one weak function spl_boot_partitionPatrick Delaunay
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-06input: Drop PS/2 keyboard supportSimon Glass
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-06Migrate CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSCAlex Kiernan
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 Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-03spl: fix binman_sym output checkMiquel Raynal
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-01Merge git://git.denx.de/u-boot-dmTom Rini
2018-04-01libfdt: move FDT_RAMDISK_OVERHEAD to image-fdt.cMasahiro Yamada
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 Chen
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>