aboutsummaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2020-11-06board: Rename uclass to sysinfoSimon Glass1-7/+8
This uclass is intended to provide a way to obtain information about a U-Boot board. But the concept of a U-Boot 'board' is the whole system, not just one circuit board, meaning that 'board' is something of a misnomer for this uclass. In addition, the name 'board' is a bit overused in U-Boot and we want to use the same uclass to provide SMBIOS information. The obvious name is 'system' but that is so vague as to be meaningless. Use 'sysinfo' instead, since this uclass is aimed at providing information on the system. Rename everything accordingly. Note: Due to the patch delta caused by the symbol renames, this patch shows some renamed files as being deleted in one place and created in another. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-11-06x86: zimage: Add a little more loggingSimon Glass1-0/+1
Add logging for each part of the boot process, using a new Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
2020-11-06x86: Use CONFIG_CHROMEOS_VBOOT for verified bootSimon Glass1-0/+17
At present CONFIG_CHROMEOS is used to determine whether verified boot is in use. The code to implement that is not in U-Boot mainline. However, it is useful to be able to boot a Chromebook in developer mode in U-Boot mainline without needing the verified boot code. To allow this, use CONFIG_CHROMEOS_VBOOT to indicate that verified boot should be used, and CONFIG_CHROMEOS to indicate that the board supports Chrome OS. That allows us to define CONFIG_CHROMEOS on coral. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-11-01Merge tag 'efi-2020-01-rc2-2' of ↵WIP/01Nov2020Tom Rini4-4/+97
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2021-01-rc2 (2) The series contains the following enhancements * preparatory patches for UEFI capsule updates * initialization of the emulated RTC using an environment variable and a bug fix * If DisconnectController() is called for a child controller that is the only child of the driver, the driver must be disconnected.
2020-10-30Merge tag 'dm-pull-30oct20' of ↵Tom Rini1-10/+9
https://gitlab.denx.de/u-boot/custodians/u-boot-dm of-platdata and dtoc improvements sandbox SPL tests binman support for compressed sections
2020-10-30log: Add filter flag to match greater than a log levelSean Anderson1-3/+9
This is the complement of the existing behavior to match only messages with a log level less than a threshold. This is primarily useful in conjunction with LOGFF_DENY. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30log: Add filter flag to deny on matchSean Anderson1-2/+10
Without this flag, log filters can only explicitly accept messages. Allowing denial makes it easier to filter certain subsystems. Unlike allow-ing filters, deny-ing filters are added to the beginning of the filter list. This should do the Right Thing most of the time, but it's less-universal than allowing filters to be inserted anywhere. If this becomes a problem, then perhaps log_filter_add* should take a filter number to insert before/after. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30log: Add function to create a filter with flagsSean Anderson1-2/+4
This function exposes a way to specify flags when creating a filter. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30log: Expose some helper functionsSean Anderson1-20/+3
These functions are required by "cmd: log: Add commands to manipulate filters" and "test: Add a test for log filter-*". Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30log: Add additional const qualifier to arraysSean Anderson1-2/+2
Both these arrays and their members are const. Fixes checkpatch complaint. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-30log: Fix missing negation of ENOMEMSean Anderson1-1/+1
Errors returned should be negative. Fixes: 45fac9fc18 ("log: Correct missing free() on error in log_add_filter()") Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30efi_loader: add option to initialise EFI subsystem earlyAKASHI Takahiro1-0/+6
If this option, CONFIG_EFI_SETUP_EARLY, is enabled, the initialisation of UEFI subsystem will be done as part of U-Boot initialisation. Please note that this option won't be enabled explicitly by users, instead, should be enabled implicitly by other configuration options. Specifically, this feature will be utilised in implementing capsule-on-disk feature. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-10-30common: update: add a generic interface for FIT imageAKASHI Takahiro3-2/+87
The main purpose of this patch is to separate a generic interface for updating firmware using DFU drivers from "auto-update" via tftp. This function will also be used in implementing UEFI capsule update in a later commit. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-10-30dfu: modify an argument type for an addressAKASHI Takahiro1-1/+2
The range of an addressable pointer can go beyond 'integer'. So change the argument type to a void pointer. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-10-30dfu: rename dfu_tftp_write() to dfu_write_by_name()AKASHI Takahiro1-2/+3
This function is essentially independent from tftp, and will also be utilised in implementing UEFI capsule update in a later commit. So just give it a more generic name. In addition, a new configuration option, CONFIG_DFU_WRITE_ALT, was introduced so that the file will be compiled with different options, particularly one added in a later commit. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-10-29dm: Avoid using #ifdef for CONFIG_OF_LIVESimon Glass1-10/+9
At present this option results in a number of #ifdefs due to the presence or absence of the global_data of_root member. Add a few macros to global_data.h to work around this. Update the code accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-29Merge tag 'xilinx-for-v2021.01-v2' of ↵Tom Rini5-21/+22
https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze Xilinx changes for v2021.01-v2 common: - Add support for 64bit loadables from SPL xilinx: - Update documentation and record ownership - Enable eeprom board detection based legacy and fru formats - Add support for FRU format microblaze: - Optimize low level ASM code - Enable SPI/I2C - Enable distro boot zynq: - Add support for Zturn V5 zynqmp: - Improve silicon detection code - Enable several kconfig options - Align DT with the latest state - Enabling security commands - Enable and support FPGA loading from SPL - Optimize xilinx_pm_request() calling versal: - Some DTs/Kconfig/defconfig alignments - Add binding header for clock and power zynq-sdhci: - Add support for tap delay programming zynq-spi/zynq-qspi: - Use clock framework for getting clocks xilinx-spi: - Fix some code issues (unused variables) serial: - Check return value from clock functions in pl01x
2020-10-28dm: board: complete the initialization of the muxes in initr_dm()Jean-Jacques Hiblot1-0/+12
This will probe the multiplexer devices that have a "u-boot,mux-autoprobe" property. As a consequence they will be put in their idle state. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
2020-10-27log: correct and check array size of log categoriesHeinrich Schuchardt1-2/+8
The log command has led to NULL dereferences if an unknown category name name was used due to missing entries in the list of category names. Add compile time checks for the array sizes of log_cat_name and log_lvl_name to avoid future mishaps. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-27log: allow for message continuationHeinrich Schuchardt1-5/+18
Some drivers use macro pr_cont() for continuing a message sent via printk. Hence if we want to convert printk messaging to using the logging system, we must support continuation of log messages too. As pr_cont() does not provide a message level we need a means of remembering the last log level. With the patch a pseudo log level LOGL_CONT as well as a pseudo log category LOGC_CONT are introduced. Using these results in the application of the same log level and category as in the previous log message. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-27log: move processing_msg to global dataHeinrich Schuchardt1-4/+3
Replace the static variable processing_msg by a field in the global data. Make the field bool at it can only be true or false. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-27spl: fdt: Record load/entry fit-images entries in 64bit formatMichal Simek2-12/+8
The commit 9f45aeb93727 ("spl: fit: implement fdt_record_loadable") which introduced fdt_record_loadable() state there spl_fit.c is not 64bit safe. Based on my tests on Xilinx ZynqMP zcu102 platform there shouldn't be a problem to record these addresses in 64bit format. The patch adds support for systems which need to load images above 4GB. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-27spl: Use standard FIT entriesMichal Simek4-11/+16
SPL is creating fit-images DT node when loadables are recorded in selected configuration. Entries which are created are using entry-point and load-addr property names. But there shouldn't be a need to use non standard properties because entry/load are standard FIT properties. But using standard FIT properties enables option to use generic FIT functions to descrease SPL size. Here is result for ZynqMP virt configuration: xilinx_zynqmp_virt: spl/u-boot-spl:all -82 spl/u-boot-spl:rodata -22 spl/u-boot-spl:text -60 The patch causes change in run time fit image record. Before: fit-images { uboot { os = "u-boot"; type = "firmware"; size = <0xfd520>; entry-point = <0x8000000>; load-addr = <0x8000000>; }; }; After: fit-images { uboot { os = "u-boot"; type = "firmware"; size = <0xfd520>; entry = <0x8000000>; load = <0x8000000>; }; }; Replacing calling fdt_getprop_u32() by fit_image_get_entry/load() also enables support for reading entry/load properties recorded in 64bit format. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-26eb_cpu5282: fix CONFIG_DM_VIDEO build warningsAnatolij Gustschin1-1/+3
Remove CONFIG_VIDEO dependency to fix board removal warnings. Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Jens Scharsig <esw@bus-elektronik.de>
2020-10-23bootm: fix wrong conditions about images overlapJaehoon Chung1-3/+5
It doesn't need to consider start byte address. If ramdisk size is 0x800000 and start address is 0x2700000, then it's used until 0x02efffff, not 0x02f00000. But it's detected to overlapt RD image, when kernel start address is 0x02f00000. Because it's doing wrong calculation about rd_len. This patch fixed wrong calculation address position when check condition. In addition, it needs to check one more condition about overlapping entire area. Fixes: commit fbde7589ce30 ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image") Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2020-10-22Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-sunxiWIP/22Oct2020Tom Rini2-4/+17
- sun8i emac changes (Andre) - SCP firmware (Samuel)
2020-10-22Remove default value of CONFIG_PREBOOT for CONFIG_USB_STORAGEPatrick Delaunay1-1/+1
Remove the default value "usb start" for CONFIG_USB_STORAGE as the USB storage boot initialization is correctly managed by distro boot command ('usb_boot' defined in include/config_distro_bootcmd.h already include the command 'usb start'). Fixes: 324d77998ed6 ("Define default CONFIG_PREBOOT with right config option") Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-22common: rename getc() to getchar()Heinrich Schuchardt5-15/+15
The sandbox is built with the SDL2 library with invokes the X11 library which in turn calls getc(). But getc() in glibc is defined as int getc(FILE *) This does not match our definition. int getc(void) The sandbox crashes when called with parameter -l. Rename our library symbol getc() to getchar(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-22cli_hush.c: remove broken sanity checkRasmus Villemoes1-8/+0
This code is intended do prevent one from setting a shell variable abc by doing abc=123 if an environment variable named abc already exists. However, the check is broken, since the env_get is done before the split on =, so we look up whether an environment variable "abc=123" exists, which is obviously never the case. One could move the code to below the split on =, but instead, just remove it, saving a little .text: The check has never worked as intended (it goes all the way back to the initial git commit), and it would anyway not guard against one first setting the shell variable, then doing 'env set abc xyz'. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-10-22common, autoboot: sync functionality with Kconfig descriptionHeiko Schocher1-1/+2
add back again special case: -2 autoboot with no delay and no check for abort as described in Kconfig option, see common/Kconfig help text for option BOOTDELAY. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-22cosmetic: image: Fix comments and the order of definitionsNaoki Hayama1-10/+10
Fix some comments about functions. Move genimg_get_comp_name() above genimg_get_short_name() because genimg_get_comp_name() is related to get_table_entry_name(). Signed-off-by: Naoki Hayama <naoki.hayama@lineo.co.jp> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-22image: Add a function to modify category informationNaoki Hayama1-0/+18
Add a generic function which can check whether a category has an entry ID. Signed-off-by: Naoki Hayama <naoki.hayama@lineo.co.jp> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-22Kconfig: Use hex values for CONFIG_{SPL,TPL}_SIZE_LIMITOvidiu Panait1-4/+4
CONFIG_{SPL,TPL}_SIZE_LIMIT are defined as hex (SPL_SIZE_LIMIT was converted in b51882d0 ("spl: Convert CONFIG_SPL_SIZE_LIMIT to hex"), but there are still places that reference integer values. Change those to hex as well. Also, update the Makefile to check for 0x0 instead of 0. This also fixes the following build error when CONFIG_SPL_SIZE_LIMIT is set by menuconfig to 0x0: ... spl/u-boot-spl.bin exceeds file size limit: limit: 0 bytes actual: 0x80f0 bytes excess: 0x80f0 bytes Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-22board: Show memory for frame buffersSimon Glass1-0/+2
When debugging is enabled, show the memory allocated to video frame buffers. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-22bloblist: Place on a 4KB boundarySimon Glass1-1/+3
It is much easier to read the bloblist addresses if it starts on a 4KB boundary. Update it to align it accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-22log: Add missing category namesSimon Glass1-0/+5
Add some category names that were missed in recent changes. Update the comment as a reminder. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-22spl: fit: Minimally parse OS properties with FIT_IMAGE_TINYSamuel Holland2-4/+17
Some boards, specifically 64-bit Allwinner boards (sun50i), are extremely limited on SPL size. One strategy that was used to make space was to remove the FIT "os" property parsing code, because it uses a rather large lookup table. However, this forces the legacy FIT parsing code path, which requires the "firmware" entry in the FIT to reference the U-Boot binary, even if U-Boot is not the next binary in the boot sequence (for example, on sun50i boards, ATF is run first). This prevents the same FIT image from being used with a SPL with CONFIG_SPL_FIT_IMAGE_TINY=n and CONFIG_SPL_ATF=y, because the boot method selection code looks at `spl_image.os`, which is only set from the "firmware" entry's "os" property. To be able to use CONFIG_SPL_ATF=y, the "firmware" entry in the FIT must be ATF, and U-Boot must be a loadable. For this to work, we need to parse the "os" property just enough to tell U-Boot from other images, so we can find it in the loadables list to append the FDT, and so we don't try to append the FDT to ATF (which could clobber adjacent firmware). So add the minimal code necessary to distinguish U-Boot/non-U-Boot loadables with CONFIG_SPL_FIT_IMAGE_TINY=y. This adds about 300 bytes, much less than the 7400 bytes added by CONFIG_SPL_FIT_IMAGE_TINY=n. Acked-by: Patrick Wildt <patrick@blueri.se> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-10-21Revert "Fix data abort caused by mis-aligning FIT data"Marek Vasut1-5/+2
This reverts commit eb39d8ba5f0d1468b01b89a2a464d18612d3ea76. The commit breaks booting of fitImage by SPL, the system simply hangs. This is because on arm32, the fitImage and all of its content can be aligned to 4 bytes and U-Boot expects just that. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Reuben Dowle <reuben.dowle@4rf.com> Cc: Tom Rini <trini@konsulko.com> Signed-off-by: Marek Vasut <marex@denx.de>
2020-10-14spl: Add SPL_SERIAL as requirement for SDP_USB_SDPOtavio Salvador1-0/+1
The USB SDP protocol require the SPL serial support to allow the build to succeed. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2020-10-14spl: Avoid printing boot device if silent console is enabledOtavio Salvador1-1/+3
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-10-14cmd: Fixup DT to pass PStore Ramoops parametersFrédéric Danis1-0/+4
To simplify configuration and keep synchronized the PStore/Ramoops between U-Boot and the Linux kernel, this commit dynamically adds the Ramoops parameters defined in the U-Boot session to the Device Tree. Signed-off-by: Frédéric Danis <frederic.danis@collabora.com> Cc: Tom Rini <trini@konsulko.com> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Heiko Schocher <hs@denx.de>
2020-10-12fit: cipher: aes: allow to read the IV in the FIT imagePhilippe Reynes1-7/+15
This commit add the support in u-boot to read the IV in the FIT image instead of u-boot device tree. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-10-12vboot: add DTB policy for supporting multiple required conf keysThirupathaiah Annapureddy1-3/+29
Currently FIT image must be signed by all required conf keys. This means Verified Boot fails if there is a signature verification failure using any required key in U-Boot DTB. This patch introduces a new policy in DTB that can be set to any required conf key. This means if verified boot passes with one of the required keys, U-Boot will continue the OS hand off. There were prior attempts to address this: https://lists.denx.de/pipermail/u-boot/2019-April/366047.html The above patch was failing "make tests". https://lists.denx.de/pipermail/u-boot/2020-January/396629.html Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-10log: syslog: Handle errors in net_initSean Anderson1-1/+3
Since the previous patch, net_init now exposes some errors, so check for them. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-10-10log: Disable the syslog driver by defaultSimon Glass1-1/+0
This driver interferes with other sandbox tests since it causes log output to be interspersed with "No ethernet found." messages. Disable this driver by default. Enable it for the syslog tests so that they still pass. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-10log: Add a way to enable/disable a log deviceSimon Glass1-0/+38
At present all log devices are enabled by default. Add a function to allow devices to be disabled or enabled at runtime. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-10log: Add a flag to enable log driversSimon Glass3-1/+5
At present there is no way to disable a log driver. But the syslog driver causes (attempted) network traffic in sandbox every time a log message is printed, which is often. Add a flag to enable a log driver. Adjust struct log_device to use a short for next_filter_num so that no more memory is used for devices. Also fix a missing line in the struct log_driver comment while here. To maintain compatibility, enable it for all drivers for now. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-10log: Allow LOG_DEBUG to always enable log outputSimon Glass1-1/+5
At present if CONFIG_LOG enabled, putting LOG_DEBUG at the top of a file (before log.h inclusion) causes _log() to be executed for every log() call, regardless of the build- or run-time logging level. However there is no guarantee that the log record will actually be displayed. If the current log level is lower than LOGL_DEBUG then it will not be. Add a way to signal that the log record should always be displayed and update log_passes_filters() to handle this. With the new behaviour, log_debug() will always log if LOG_DEBUG is enabled. Move log_test_syslog_nodebug() into its own file since it cannot be made to work where it is, with LOG_DEBUG defined. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move BOARD_TYPES under init optionsSimon Glass1-8/+8
This actually relates to something displayed on start-up, so move it into that menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-10-09Kconfig: Move BOUNCE_BUFFER under driver optionsSimon Glass1-11/+0
This option does not belong at the top level. Move it under generic driver options. Signed-off-by: Simon Glass <sjg@chromium.org>