summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2019-07-24Merge tag 'dm-pull-24jul19-take3' of ↵Tom Rini1-12/+15
https://gitlab.denx.de/u-boot/custodians/u-boot-dm Minor driver-model fixes and tweaks A few device-tree fixes Binman support for extracting files from an image
2019-07-24common: fdt_support: Add missing cpu_to_fdt32() to fdt_pci_dma_ranges()Marek Vasut1-11/+14
The fdt_pci_dma_ranges() cannot work on e.g. ARM, since the DT entries endianness is not adjusted at all. Fix this. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2019-07-24fdt: make fdt_get_base_address() return OF_BAD_ADDR when "reg" not foundMasahiro Yamada1-1/+1
Currently, fdt_get_base_address() returns 0 if the "reg" property is missing. Since 0 is a valid value, it is not suitable for the error handling. Return OF_BAD_ADDR instead. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
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-24common: Implement A/B metadataRuslan Trofymenko3-0/+311
This patch determines the A/B-specific bootloader message structure that is the basis for implementation of recovery and A/B update functions. A/B metadata is stored in this structure and used to decide which slot should we use to boot the device. Also some basic functions for A/B metadata manipulation are implemented (like slot selection). The patch was extracted from commits [1], [2] with some coding style fixes. [1] https://android-review.googlesource.com/c/platform/external/u-boot/+/729878/2 [2] https://android-review.googlesource.com/c/platform/external/u-boot/+/729880/2 Signed-off-by: Ruslan Trofymenko <ruslan.trofymenko@linaro.org> Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-24image: android: allow to wrap uImage into the Android boot imageRoman Stratiienko1-5/+17
This allows to use any available compression format with Android boot image Since not all available compression formats have a magic number we should explicitly specify type of compression. For this purpose using uImage format becomes very useful, as this format is well-known by the community and mkimage tool is already available. Usage example: mkimage -A ARM64 -T kernel -C lzma -d Image.lzma out/kernel At this moment only -C option is handled, but specifying -A and -T options are recommended for compatibility reasons in the future. Kernel that compressed with LZ4 can be already used without wrapping into the uImage, but I recommend wrapping it into the uImage in order to avoid situations when by some mistake legacy LZ4 is used, that is interpreted as raw Image and causes CPU to enter Exception Handler without providing any meaningful explanation to the user. Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2019-07-24menu: don't bother going interactive with just one menu itemLeon Yu1-1/+5
If there is only one menu item available, prompting user to enter choice makes little sense and just causes unnecessary boot delay. This change makes menu_get_choice return the only one item when there is no other choices. Signed-off-by: Leon Yu <leoyu@nvidia.com> Cc: Tom Warren <twarren@nvidia.com> Cc: Stephen Warren <swarren@nvidia.com> Cc: Thierry Reding <treding@nvidia.com>
2019-07-22dm: core: Introduce xxx_translate_dma_address()Fabien Dessenne1-0/+6
Add the following functions to translate DMA address to CPU address: - dev_translate_dma_address() - ofnode_translate_dma_address() - of_translate_dma_address() - fdt_translate_dma_address() These functions work the same way as xxx_translate_address(), with the difference that the translation relies on the "dma-ranges" property instead of the "ranges" property. Add related test. Test report: => ut dm fdt_translation Test: dm_test_fdt_translation: test-fdt.c Test: dm_test_fdt_translation: test-fdt.c (flat tree) Failures: 0 Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
2019-07-18Merge branch '2019-07-17-master-imports'Tom Rini1-1/+6
- Various FS/disk related fixes with security implications. - Proper fix for the pci_ep test. - Assorted bugfixes - Some MediaTek updates. - 'env erase' support.
2019-07-18common: Fix autocompletion with CONFIG_CMDLINE_PS_SUPPORTMarek Vasut1-1/+6
The autocompletion did not work if CONFIG_CMDLINE_PS_SUPPORT was enabled because U-Boot was comparing the prompt string with CONFIG_SYS_PROMPT . While this works if CONFIG_CMDLINE_PS_SUPPORT is disabled, this no longer works if it's enabled because user can override the PS1 . Fix this by checking prompt string against the current PS1 value. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com>
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>
2019-07-15sunxi: move CONFIG_SPL_TEXT_BASE from *_defconfig to KconfigAndre Przywara1-0/+3
The choice of the SPL_TEXT_BASE is not really a decision that should be specified by each board's defconfig, as this setting is actually dictated by the SoC's memory map and the BootROM behaviour. To make this obvious and reduce the clutter in the defconfig files, let's specify the SoC constraints in the Kconfig stanza. This allows us to remove these lines from the defconfig files again. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2019-07-13gpio: add gpio-hog supportHeiko Schocher1-0/+6
add gpio-hog support. GPIO hogging is a mechanism providing automatic GPIO request and configuration as part of the gpio-controller's driver probe function. for more infos see: doc/device-tree-bindings/gpio/gpio.txt Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Michal Simek <michal.simek@xilinx.com> (zcu102) Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-13spl: Move SPL_MMC_TINY option to appear under SPL menuEzequiel Garcia1-0/+17
The SPL_MMC_TINY implements feature-reduced MMC support on SPL, and as such, it's more consistent and convenient to find it as part of the SPL configuration. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
2019-07-12Merge tag 'dm-pull-9jul19-take2' of ↵Tom Rini2-3/+10
https://gitlab.denx.de/u-boot/custodians/u-boot-dm - Sandbox improvements including .dts refactor - Minor tracing and PCI improvements - Various other minor fixes - Conversion of patman, dtoc and binman to support Python 3
2019-07-12Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvellTom Rini1-3/+17
- SPL SATA enhancements to allow booting from RAW SATA device needed for Clearfog (Baruch) - Enable SATA booting on Clearfog (Baruch) - Misc changes to Turris Omnia (Marek) - Enable CMD_BOOTZ and increase SYS_BOOTM_LEN on crs305-1g-4s (Luka) - Enable FIT support for db-xc3-24g4xg (Chris) - Enable DM_SPI on Keymile Kirkwood board with necessary changes for this (Pascal) - Set 38x and 39x AVS on lower frequency (Baruch)
2019-07-11SPL: Default to disabling legacy image support when using FITTom Rini1-1/+1
When we have a FIT image being used by SPL by default that means the most common case is that we'll never run into a legacy image. Disable legacy image support by default in that case to reclaim space. Signed-off-by: Tom Rini <trini@konsulko.com>
2019-07-11configs: Rename CONFIG_IMAGE_FORMAT_LEGACY to CONFIG_LEGACY_IMAGE_FORMATTom Rini3-12/+12
The name CONFIG_LEGACY_IMAGE_FORMAT reads slightly better along with allowing us to avoid a rather nasty Kbuild/Kconfig issue down the line with CONFIG_IS_ENABLED(IMAGE_FORMAT_LEGACY). In a few places outside of cmd/ switch to using CONFIG_IS_ENABLED() to test what is set. Signed-off-by: Tom Rini <trini@konsulko.com>
2019-07-11spl: Fix typo in kernel docMiquel Raynal1-1/+1
Fix a tiny typo in boot_from_devices() kernel doc. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Stefan Roese <sr@denx.de>
2019-07-11spl: sata: don't force FS_FAT supportBaruch Siach1-2/+6
Allow the code to build when FS_FAT is not enabled, and thus spl_load_image_fat() is not provided. A subsequent patch should add alternative raw access U-Boot main image load method. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Stefan Roese <sr@denx.de>
2019-07-11spl: sata: fix build with DM_SCSIBaruch Siach1-1/+3
The init_sata() routine is only present when DM_SCSI is not enabled. Don't call init_sata() when DM_SCSI is enabled. The code will fall back to scsi_scan() in this case. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Stefan Roese <sr@denx.de>
2019-07-11spl: sata: add default partition and image nameBaruch Siach1-0/+8
Add sensible defaults for the FAT partition selection and the main U-Boot image file name. This allows spl_sata to build when the board headers does not select them explicitly. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Stefan Roese <sr@denx.de>
2019-07-11trace: trace buffer may exceed 2GiBHeinrich Schuchardt1-2/+2
Correct the debug output for the trace buffer size to accommodate trace buffers exceeding 2GiB. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-11trace: undefined reference to `trace_early_init'Heinrich Schuchardt1-1/+1
Compiling with TRACE but without TRACE_EARLY results in an error aarch64-linux-gnu-ld.bfd: common/built-in.o:(.rodata.init_sequence_f+0x10): undefined reference to `trace_early_init' trace_early_init() should not be called if CONFIG_TRACE_EARLY is not defined. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-11bootstage: Add support for TPL record countSimon Glass1-0/+7
If bootstage is enabled in TPL it lacks a record count and so does not build. Fix this by adding a new Kconfig option. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-09ubispl: introduce separate CONFIG_UBI_SPL_SILENCE_MSGMarkus Klotzbuecher1-0/+6
This allows to silence ubi and ubispl individually. Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com> Reviewed-by: Heiko Schocher <hs@denx.de> Cc: Kyungmin Park <kmpark@infradead.org>
2019-07-09ubispl: add support for loading volumes by nameHamish Guthrie2-0/+20
The motivation is to use the UBI atomic volume rename functionality to allow double copy software updates on UBI. To that end the SPL is configured to always load the same volume name (e.g. "u-boot"), whereas a software updater always installs into the secondary volume "u-boot_r". After successful installation, these two volume names are switched. This extension is protected by #ifdefs as it will somewhat slow down loading of volumes by id. This is because the code needs to disable the optimization of ignoring all volume ids which are not to-be-loaded, since these can only be resolved after attaching. This adds two vtbl related functions from Linux, which are taken from the same kernel version as the current main U-Boot UBI code (Linux 4.2 64291f7db5bd8). Signed-off-by: Hamish Guthrie <hamish.guthrie@kistler.com> Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com> Reviewed-by: Heiko Schocher <hs@denx.de> Cc: Kyungmin Park <kmpark@infradead.org>
2019-07-09ubispl: migrate configuration to KconfigMarkus Klotzbuecher1-0/+79
Move the ubispl configuration to KConfig and drop them from the whitelist. Signed-off-by: Markus Klotzbuecher <markus.klotzbuecher@kistler.com> Cc: Heiko Schocher <hs@denx.de> Cc: Kyungmin Park <kmpark@infradead.org> Cc: Javier Martínez Canillas <javier@dowhile0.org> Cc: Enric Balletbo i Serra <eballetbo@gmail.com>
2019-07-08board_r: move initr_watchdog to be called after initr_serialWeijie Gao1-3/+3
The initr_watchdog is currently placed before initr_serial. The initr_watchdog calls printf and printf finally calls ops->putc of a serial driver. However, gd->cur_serial_dev points to a udevice allocated in board_f. The gd->cur_serial_dev->driver->ops->putc points the the code region before relocation. Some serial drivers call WATCHDOG_RESET() in ops->putc. When DM is enabled for watchdog, watchdog_reset() is called. watchdog_reset() calls get_timer to get current timer. On some platforms the timer driver is also a DM driver. initr_watchdog is placed right after initr_dm, which means the timer driver hasn't been initialized. So dm_timer_init() is called. To create a new udevice, calloc is called. However start from ops->putc, u-boot execution flow is redirected into the memory region before relocation (board_f). In board_f, dlmalloc hasn't been initialized. The call to calloc will fail, and this will cause DM to print out an error message, and it will call printf again, causing recursive error outputs. This patch places initr_watchdog after initr_serial to solve this issue. Cc: Stefan Roese <sr@denx.de> Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Frank Wunderlich <frank-w@public-files.de> Tested-by: Suniel Mahesh <sunil.m@techveda.org>
2019-07-02spl: atf: Fix uninitialized pointer to bl31_image_infoFrieder Schrempf1-0/+1
The pointer to struct atf_image_info in bl31_params_mem.bl31_params.bl31_image_info is not initialized before being dereferenced. This can cause U-Boot to crash right before jumping to the BL31 ATF binary. Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> Fixes: bcc1726a7bdd ("spl: add support to booting with ATF") Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-06-28Merge tag 'u-boot-imx-20190628' of ↵Tom Rini1-4/+8
https://gitlab.denx.de/u-boot/custodians/u-boot-imx Fixes for 2019.07 - menlo board - allow SDB on Sabre - HAB for mx6sl - apalis board
2019-06-27usb: gadget: f_sdp: Allow SPL to load and boot FIT via SDPFrieder Schrempf1-4/+8
Add support for loading u-boot FIT images over the USB SDP protocol in the SPL Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> [Various build fixes] Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Tested-by: Fabio Estevam <festevam@gmail.com> Tested-by: Lukasz Majewski <lukma@denx.de>
2019-06-21rsa: reject images with unknown paddingPatrick Doyle1-1/+1
Previously we would store NULL in info->padding and jump to an illegal instruction if an unknown value for "padding" was specified in the device tree. Signed-off-by: Patrick Doyle <pdoyle@irobot.com>
2019-06-17Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2-2/+6
- Assorted gadget fixes
2019-06-14configs: Migrate the various SPL_BOOT_xxx choices for PowerPCTom Rini1-0/+20
The non-CONFIG_SPL_FRAMEWORK SPL used on some PowerPC platforms have a choice between CONFIG_SPL_NAND_BOOT, CONFIG_SPL_MMC_BOOT and CONFIG_SPL_SPI_BOOT. Migrate this to Kconfig Signed-off-by: Tom Rini <trini@konsulko.com>
2019-06-14common: Fix a typo abnove -> aboveAndy Shevchenko1-1/+1
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-06-14usb: gadget: error out if g_dnl registration failsSjoerd Simons1-1/+5
If g_dnl_register fails return an error rather then stubornly continuing onwards. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2019-06-14spl: dfu: Fix printed variable nameMarek Vasut1-1/+1
The SPL DFU uses dfu_alt_info_N variable name to determine the DFU configuration, where N is the name of the media (e.g. ram). It does not use the plain dfu_alt_info. Print the name of the missing env variable in case of a failure instead of printing dfu_alt_info, which is just the name of the parameter passed to spl_dfu_cmd(). Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com>
2019-06-11Merge tag 'u-boot-imx-20190612' of git://git.denx.de/u-boot-imxTom Rini1-0/+1
u-boot-imx-20190612 -------------------- - Board fixes: - imx6logic - wandboard - mx6sabre boots again - imx8qm_mek - pico-* boards - Toradex apalis / colibri - engicam imx6 (environment) - KP MX53 - opos6ul - Switch to DM: - vining2000 - dh MX6 - Toradex colibri i.MX7 - Novena - Security : fix CSF size for HAB - Other: - imx: fix building for i.mx8 without spl - pcie and switch to DM mx6sabreauto: Enable SPL SDP support
2019-06-11spl: imx6: Provide a SPL_SIZE_LIMIT defaultFabio Estevam1-0/+1
As explained in include/configs/imx6_spl.h. the i.MX6 SPL size limit is 68KB (4KB header + 64KB max size). Provide such limit for all i.MX6 boards that use SPL to detect SPL size overflow in build time. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-06-10Merge tag 'video-updates-for-2019.07-rc3' of git://git.denx.de/u-boot-videoTom Rini3-11/+22
- mxsfb DM_VIDEO conversion - splash fix for DM_VIDEO configurations - meson HDMI fix for boards without hdmi-supply regulator
2019-06-10Merge tag 'u-boot-atmel-fixes-2019.07-a' of git://git.denx.de/u-boot-atmelTom Rini1-0/+12
First set of u-boot-atmel fixes for 2019.07 cycle
2019-06-08spl: Correct SPL_SIZE_LIMIT Kconfig optionTom Rini1-1/+1
When introduced this limit was an int but was then changed to hex without noting as much in the prompt nor changing existing users. Put this back to an int. Reported-by: Fabio Estevam <festevam@gmail.com> Tested-by: Fabio Estevam <festevam@gmail.com> Fixes: 2577015dc5c4 ("spl: add overall SPL size check") Signed-off-by: Tom Rini <trini@konsulko.com>
2019-06-07spl: add overall SPL size checkSimon Goldschmidt1-0/+36
This adds a size check for SPL that can dynamically check generated SPL binaries (including devicetree) for a size limit that ensures this image plus global data, heap and stack fit in initial SRAM. Since some of these sizes are not available to make, a new host tool 'spl_size_limit' is added that dumps the resulting maximum size for an SPL binary to stdout. This tool is used in toplevel Makefile to implement the size check on SPL binaries. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-06-06spl: at91: add support for SPL_AT91_MCK_BYPASSEugen Hristev1-0/+12
By default the configuration of the PMC is to have an external crystal connected that requires driving on both XIN and XOUT pins. The bypass configuration means that only XIN will be used, the SoC will not do any driving, and the XIN needs to be provided with a proper signal. This is the MOSCXTBY bit in the PMC main clock generator register. The SPL needs to properly initialize the PMC registers before switching to external clock signal and raising the clock to the cruise speed. Also created Kconfig for this specific configuration. By default this is disabled. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2019-06-05splash: display splash in DM_VIDEO configurationsIgor Opaniuk3-11/+22
Currently for CONFIG_DM_VIDEO=y setting splashimage env variable doesn't have any effect. Introduce a common function for both dm-video/lcd stacks, that checks env("splashimage") and invokes bmp_display() accordingly. For additional details please check discussion [1]. [1] https://lists.denx.de/pipermail/u-boot/2019-May/371002.html Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2019-05-24Merge tag 'u-boot-stm32-20190523' of https://github.com/pchotard/u-bootTom Rini2-0/+2
- Add various STM32MP1 fixes for serial, env, clk, board, i2c ... - Add STM32MP1 DDR driver update: These update introduce the DDR interactive mode described in: https://wiki.st.com/stm32mpu/index.php/U-Boot_SPL:_DDR_interactive_mode This mode is used by the CubeMX: DDR tuning tool. https://wiki.st.com/stm32mpu/index.php/STM32CubeMX The DDR interactive mode is NOT activated by default because it increase the SPL size and slow down the boot time (200ms wait added).
2019-05-23stm32mp1: ram: add interactive mode for DDR configurationPatrick Delaunay1-0/+1
This debug mode is used by CubeMX DDR tuning tools or manualy for tests during board bring-up. It is simple console used to change DDR parameters and check initialization. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-05-23stm32mp1: migrate PREBOOT to KconfigPatrick Delaunay1-0/+1
Use Kconfig to activate CONFIG_PREBOOT (empty by default). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>