aboutsummaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2019-08-11Drop PCMCIASimon Glass
This is no-longer used in U-Boot and has not been converted to driver model. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Rename environment.h to env_internal.hSimon Glass
This file contains lots of internal details about the environment. Most code can include env.h instead, calling the functions there as needed. Rename this file and add a comment at the top to indicate its internal nature. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> [trini: Fixup apalis-tk1.c] Signed-off-by: Tom Rini <trini@konsulko.com>
2019-08-11env: Drop environment.h header file where not neededSimon Glass
This header file is now only used by files that access internal environment features. Drop it from various places where it is not needed. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move get/set_default_env() to env.hSimon Glass
Move these functions to the new header file and rename set_default_env() to env_set_default() so that it has a consistent env_ prefix. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_get() to env.hSimon Glass
Move env_get() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_set() to env.hSimon Glass
Move env_set() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Move env_get_hex() to env.hSimon Glass
Move env_get_hex() over to the new header file. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-08-11env: Move env_set_hex() to env.hSimon Glass
Move env_set_hex() over to the new header file along with env_set_addr() which uses it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-08-11env: Move env_relocate() to env.hSimon Glass
Move env_relocate() over to the new header file. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-08-11env: Move env_init() to env.hSimon Glass
Move env_init() over to the new header file. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-08-11env: Create a new file for environment functionsSimon Glass
At present we have environment.h but this file includes all the environment-related header files as well as internals such as default_environment. It seems desirable to have a new header to hold the commonly used environment functions, so that most files can avoid including all of this unnecessary stuff. Create a new env.h header and move one function over to it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-08-11common: Remove video_setmem()Simon Glass
This function is no-longer defined in U-Boot. Drop the declaration from common.h Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11common: Move lcd_setmem() to lcd.hSimon Glass
This function relates to lcd.h and is about to become obsolete with the driver-model conversion. Move it out of common.h Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11common: Move gzip functions into a new gzip headerSimon Glass
As part of the effort to remove things from common.h, create a new header for the gzip functions. Move the function declarations to it and add missing documentation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-08-11spl: implement stack usage checkSimon Goldschmidt
This implements a stack usage check in SPL. Many boards start up SPL to run code + data from one common, rather small SRAM. To implement a sophisticated SPL binary size limit on such boards, the stack size (as well as malloc size and global data size) must be subtracted from this SRAM size. However, to do that properly, the stack size first needs to be known. This patch adds a new Kconfig option: - SPL_SYS_REPORT_STACK_F_USAGE: memset(0xaa) the whole area of the stack very early and check stack usage based on this constant later before the stack is switched to DRAM Initializing the stack and checking it is implemented in weak functions, in case a board does not use the stack as saved in gd->start_addr_sp. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-08-07common: image-android-dt: Fix logic in print fdt info routineSam Protsenko
Do not attempt to print fdt info if root node wasn't found. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-08-07fit: Do not automatically decompress ramdisk imagesJulius Werner
The Linux ramdisk should always be decompressed by the kernel itself, not by U-Boot. Therefore, the 'compression' node in the FIT image should always be set to "none" for ramdisk images, since the only point of using that node is if you want U-Boot to do the decompression itself. Yet some systems populate the node to the compression algorithm used by the kernel instead. This used to be ignored, but now that we support decompression of all image types it becomes a problem. Since ramdisks should never be decompressed by U-Boot anyway, this patch adds a special exception for them to avoid these issues. Still, setting the 'compression' node like that is wrong in the first place, so we still want to print out a warning so that third-party distributions doing this can notice and fix it. Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de> Tested-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-08-07console: execute flush on uart when silent is removedPatrick Delaunay
Avoid to flush buffer when silent console is activated as the console can be reactivate later, after relocation, when the env will be updated with the saved one. Solve issue (missing beginning of U-Boot trace) when: - CONFIG_SILENT_CONSOLE is activated - silent=1 is defined in default environment (CONFIG_EXTRA_ENV_SETTINGS) - silent is removed in saved environment with: > env delete silent; env save Only functional when PRE_CONSOLE_BUFFER is activated. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-08-07console: update silent tag after env loadPatrick Delaunay
Update the "silent" property with the variable "silent" get from saved environment, it solves the issue when: - CONFIG_SILENT_CONSOLE and CONFIG_SYS_CONSOLE_IS_IN_ENV are activated - silent is not defined in default environment - silent is requested in saved environment with: > env set silent 1; env save On next reboot the console is not disabled as expected after relocation and the environment load from flash (the callback is not called when the INSERT is requested in the created hash table) Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2019-08-07avb: Fix build when CONFIG_OPTEE_TA_AVB is disabledSam Protsenko
When having only these AVB related configs enabled: CONFIG_AVB_VERIFY=y CONFIG_CMD_AVB=y CONFIG_LIBAVB=y build fails with next errors: common/avb_verify.c: In function 'read_persistent_value': common/avb_verify.c:867:6: warning: implicit declaration of function 'get_open_session' common/avb_verify.c:870:45: error: 'struct AvbOpsData' has no member named 'tee' common/avb_verify.c:894:7: warning: implicit declaration of function 'invoke_func' common/avb_verify.c: In function 'write_persistent_value': common/avb_verify.c:931:45: error: 'struct AvbOpsData' has no member named 'tee' Guard read_persistent_value() and write_persistent_value() functions by checking if CONFIG_OPTEE_TA_AVB is enabled (as those are only used in that case) to fix the build with mentioned configuration. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
2019-08-07autoboot: fix bug using with CAAM and AUTOBOOT_ENCRYPTIONHeiko Schocher
if CONFIG_AUTOBOOT_KEYED, CONFIG_AUTOBOOT_ENCRYPTION and CONFIG_AUTOBOOT_STOP_STR_SHA256 are enabled in conjunction with CONFIG_SHA_HW_ACCEL and CONFIG_FSL_CAAM, we get the Error when pressing a key while waiting for bootdelay: Error: Address arguments are not aligned CAAM was not setup properly or it is faulty Reason is, that used variables are not cache aligned, so malloc this variables cache aligned. Probably this is also a bugfix for other hw accelerators than CAAM. Signed-off-by: Heiko Schocher <hs@denx.de>
2019-08-02autoboot: Adjust the implementation in autoboot_command()Simon Glass
Avoid use of #ifdef and keep the common condion in a variable. This makes the code easier to read. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02autoboot: Move a few more options from #ifdef to if()Simon Glass
Adjust some of the code which can be trivially moved to use IS_ENABLED() instead of #ifdef. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02autoboot: Rename CONFIG_MENU_SHOW to include AUTOBOOTSimon Glass
Rename this option to CONFIG_AUTOBOOT_MENU_SHOW this it relates to the autoboot functionality. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02autoboot: Tidy up use of menukeySimon Glass
Move the variable to the top of the file and adjust the code which uses it to use if() rather than #ifdef, to make it easier to read. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02autoboot: Rename CONFIG_MENUKEY to CONFIG_AUTOBOOT_MENUKEYSimon Glass
Since this is part of the autoboot functionality, it makes sense to name it with an AUTOBOOT prefix. No mainline boards use it so this should be safe, and downstream boards will need to adjust. Since this option is just an integer value, it really needs another option to control whether the feature is enabled or not. Add a new CONFIG_USE_AUTOBOOT_MENUKEY for that. This fits better with how things are done with Kconfig, avoiding the need to use a specific value to disable the feature. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02autoboot: Drop unused CONFIG_MENUPROMPTSimon Glass
This is not defined by any board. We could use CONFIG_AUTOBOOT_PROMPT instead perhaps, but this depends on CONFIG_AUTOBOOT_KEYED which is not used for the single-key case. So let's just remove CONFIG_MENUPROMPT. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02autoboot: Drop #ifdef CONFIG_AUTOBOOT_KEYEDSimon Glass
At present we have two functions named __autoboot() which do different things. This is confusing. Fix it by using if() instead of #ifdef for selecting the functions, and renaming them to meaningful names. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02autoboot: Use if() for CONFIG_SILENT_CONSOLESimon Glass
Avoid an #ifdef in this function, to improve readability. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02autoboot: Improve docs for CONFIG_AUTOBOOT_ENCRYPTIONSimon Glass
This option is not documented properly at present. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02autoboot: Drop #ifdef for CONFIG_AUTOBOOT_ENCRYPTIONSimon Glass
Use if() instead for this option, renaming the two different passwd_abort() functions to indicate their purpose. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02autoboot: Use CONFIG_AUTOBOOT_STOP_STR_SHA256 indirectlySimon Glass
This CONFIG option is only present if CONFIG_AUTOBOOT_ENCRYPTION is enabled so it cannot be used in code without that #ifdef. But we want to reduce the use of #ifdef in this file and in particular to avoid having two different functions both named passwd_abort() but which do different things. In preparation for this, create an intermediate value which is set to an empty string if there is no value for CONFIG_AUTOBOOT_STOP_STR_SHA256. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02Convert CONFIG_SHOW_BOOT_PROGRESS to KconfigSimon Glass
This converts the following to Kconfig: CONFIG_SHOW_BOOT_PROGRESS Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-02main: Use conditional run_preboot_environment_command()Simon Glass
The function name indicates that it does something, but its entire operation is actually condition on a CONFIG. Move the condition outside the function so this is clearer, and use if() instead of #ifdef, like the reset of the file. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-30Merge tag 'video-for-2019.10-rc1' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-video - fix EDID mode filtering - extend mxc_ipuv3_fb to enable backlight/display - include fb_base in global_data for DM_VIDEO - show frame buffer address via board info as used to be with legacy VIDEO support
2019-07-29edid: fix edid_get_timing_validate() mode_valid lookupNeil Armstrong
Add a condition to the break in the modes lookup, without this when the first mode is not valid, then edid_get_timing_validate() return an error instead of checking the next modes. Fixes: 1c1ed441b0d1 ("edid: add edid_get_timing_validate() variant to filter out edid modes") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-07-29Merge branch '2019-07-29-master-imports'Tom Rini
- Assorted bug fixes
2019-07-29gpio: fixes for gpio-hog supportHeiko Schocher
recently added gpio hog patch was "in discussion" state with Simon Glass. This patch now adds most of comments from Simon Glass. Signed-off-by: Heiko Schocher <hs@denx.de>
2019-07-29fit: Support compat string property in configuration nodeJulius Werner
This patch adds support for an optional optimization to compatible string matching where the compatible string property from the root node of the kernel FDT can be copied into the configuration node of the FIT image. This is most useful when using compressed FDTs or when using FDT overlays, where the traditional extraction of the compatible string from the kernel FDT itself is not easily possible. Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-29fit: Support compression for non-kernel components (e.g. FDT)Julius Werner
This patch adds support for compressing non-kernel image nodes in a FIT image (kernel nodes could already be compressed previously). This can reduce the size of FIT images and therefore improve boot times (especially when an image bundles many different kernel FDTs). The images will automatically be decompressed on load. This patch does not support extracting compatible strings from compressed FDTs, so it's not very helpful in conjunction with CONFIG_FIT_BEST_MATCH yet, but it can already be used in environments that select the configuration to load explicitly. Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-07-29common: Move bootm_decomp_image() to image.c (as image_decomp())Julius Werner
Upcoming patches want to add decompression to use cases that are no longer directly related to booting. It makes sense to retain a single decompression routine, but it should no longer be in bootm.c (which is not compiled for all configurations). This patch moves bootm_decomp_image() to image.c and renames it to image_decomp() in preparation of those upcoming patches. Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> [trini: Fix warning around handle_decomp_error being unused] Signed-off-by: Tom Rini <trini@konsulko.com>
2019-07-29edid: add edid_get_timing_validate() variant to filter out edid modesNeil Armstrong
The original edid_get_timing() function returns the first valid timing, but on some plaforms, we could only supports a subset of the listed monitot's navite timing. Let's introduce a edid_get_timing_validate() adding a mode_valid callback including a private cookie pointer. If the callback returns false, the current timing is discared and the next one is checked. If no valid & supported timings are found, the function would return an error. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-07-27Merge tag 'u-boot-imx-20190719' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20190719 - CCF for i.MX6 - nandbcb command to write SPL into NAND - Switch to DM (i.MX28) - Boards: Toradex, engicam, DH - Fixes for i.MX8 - Fixes for i.MX7ULP Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/561147504
2019-07-24Merge tag 'dm-pull-24jul19-take3' of ↵Tom Rini
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 Vasut
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 Yamada
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 Siach
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 Trofymenko
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 Stratiienko
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 Yu
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>