aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-08-14Merge tag 'dm-next-14aug23' of ↵WIP/14Aug2023-nextTom Rini13-107/+845
https://source.denx.de/u-boot/custodians/u-boot-dm into next Enhance bootmeth_cros
2023-08-14Merge branch '2023-08-14-keep-fixed-gpio-regulator-count-in-balance' into nextTom Rini5-36/+37
To quote the author: The commit 4fcba5d556b4 ("regulator: implement basic reference counter") have made it more important to keep fixed/gpio regulators enable/disable state in balance. This series fixes an inbalance in the mmc_dw driver and changes to use the more relaxed regulator_set_enable_if_allowed function for a few other drivers. The regulator_set_enable_if_allowed function is more relaxed and will return ENOSYS if the provided regulator is NULL or when DM_REGULATOR was disabled. Using the following call convention should be safe: ret = regulator_set_enable_if_allowed(<supply>, <true|false>); if (ret && ret != -ENOSYS) return ret;
2023-08-14mmc: dw_mmc: Keep vqmmc-supply enable count in balanceJonas Karlman1-0/+4
With the commit 4fcba5d556b4 ("regulator: implement basic reference counter"), keeping regulator enablement in balance become more important. Disable vqmmc-supply before signal voltage is changed to keep regulator enable counter in balance. Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2023-08-14mmc: Use regulator_set_enable_if_allowedJonas Karlman1-4/+6
With the commit 4fcba5d556b4 ("regulator: implement basic reference counter") the return value of regulator_set_enable may be EALREADY or EBUSY for fixed/gpio regulators. Change to use the more relaxed regulator_set_enable_if_allowed to continue if regulator already was enabled or disabled. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # P895 Tegra 3; Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # rockpro64-rk3399
2023-08-14usb: ehci-generic: Use regulator_set_enable_if_allowedJonas Karlman1-12/+11
With the commit 4fcba5d556b4 ("regulator: implement basic reference counter") the return value of regulator_set_enable may be EALREADY or EBUSY for fixed/gpio regulators. Change to use the more relaxed regulator_set_enable_if_allowed to continue if regulator already was enabled or disabled. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Marek Vasut <marex@denx.de>
2023-08-14usb: dwc2: Use regulator_set_enable_if_allowedJonas Karlman1-8/+6
With the commit 4fcba5d556b4 ("regulator: implement basic reference counter") the return value of regulator_set_enable may be EALREADY or EBUSY for fixed/gpio regulators. Change to use the more relaxed regulator_set_enable_if_allowed to continue if regulator already was enabled or disabled. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # rockpro64-rk3399 Reviewed-by: Marek Vasut <marex@denx.de>
2023-08-14adc: Use regulator_set_enable_if_allowedJonas Karlman1-12/+10
With the commit 4fcba5d556b4 ("regulator: implement basic reference counter") the return value of regulator_set_enable may be EALREADY or EBUSY for fixed/gpio regulators. Change to use the more relaxed regulator_set_enable_if_allowed to continue if regulator already was enabled or disabled. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # rockpro64-rk3399
2023-08-11bootstd: cros: Add ARM supportSimon Glass4-8/+57
Support booting ChromiumOS on ARM devices using FIT. Add an entry into the boot implementation which does not require a command line. This can be expanded over time as the bootm code is refactored. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-11bootstd: Add a command to read all files for a bootflowSimon Glass7-4/+195
Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until it is needed to boot. This saves time when scanning and avoids needing to allocate memory for something that may never be used. To permit reading of these files, add a new 'bootflow read' command. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: Allow display of the x86 setup informationSimon Glass6-18/+86
Provide an option to dump this information if available. Move the funciion prototype to the common x86 header. Allow the command line to be left out since 'bootflow info' show this itself and it is not in the correct place in memory until the kernel is actually booted. Fix a badly aligned heading while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Split up reading info and kernelSimon Glass1-73/+23
Use the two new functions to separate reading of the ChromiumOS info from the partition from actually reading the kernel and booting it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Add a function to read a kernelSimon Glass1-0/+39
The code to read the ChromiumOS information from the partition is currently all in one function. Create a new function which reads the kernel, assuming that the metadata has been parsed. For now this function is not used. Future work will plumb it in. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Add a function to read info from partitionSimon Glass1-0/+121
The code to read the ChromiumOS information from the partition is currently all in one function. It reads the entire kernel, which is unnecessary unless it is to be booted. Create a new function which reads just the minimum required data from the disk, then obtains what it needs from there. For now this function is not used. Future work will plumb it in. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: Add private bootmeth data to the bootflowSimon Glass2-0/+3
Some bootmeths need to store their own information related to the bootflow, in addition to the generic information in struct bootflow. Add a pointer for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Add private info for ChromiumOSSimon Glass1-13/+42
Create a new private structure to hold information gleaned from the disk. This will allow separation between reading of the bootflow information and (later) reading the whole kernel. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Add docs for the kernel layoutSimon Glass1-0/+29
Provide brief documentation about the ChromiumOS kernel layout. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: Move common zimage functions to bootm.hSimon Glass3-30/+29
We want to avoid using #ifdefs around header files and in the code. It makes sense to collect the various functions used for loading images into a single header which can be included by all architectures. The best place for this is the arch-neutral bootm.h header, so use that. Move some zimage functions into this bootm.h header. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Simplify setup and cmdline expressionsSimon Glass1-10/+10
Create a common base from which the other parts are offset and make all of the offsets related to that. This makes the code a little easier to read. Use X86_ prefixes for the two values which are x86-specific. Drop OFFSET_BASE since it is available in a header field. Drop the unnecessary 'start' variable too. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Decode some kernel preamble fieldsSimon Glass1-17/+37
Decode the kernel start and size using the structures provided. This accesses the same data, just in a cleaner way. Add some logging for some of the fields in the kernel preamble. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Support a kernel on either partitionSimon Glass1-7/+14
ChromiumOS allows a kernel to be on either partition 2 or 4. Add support for scanning both and using the first one we find with a suitable signature. Record the partition which is used. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Bring in some ChromiumOS structuresSimon Glass2-2/+201
Add a header file with structures for booting ChromiumOS, taken from the vboot tree. Using these makes it easier to understand the code. Note that the code style has not been updated for U-Boot, with use of uint64_t, __attribute__((packed)) and one comment-style nit. This should make it easier to keep the code in sync. It was taken from commit: 5b8596ce ("2sha256_arm: Fix data abort issue") Update the CHROMEOS string to use the defined values. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Move partition reading into a functionSimon Glass1-16/+50
Move the code which reads a partition into its own function. Add a constant for the number of bytes to 'probe' at the start of the partition. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10bootstd: cros: Correct reporting of I/O errorsSimon Glass1-2/+2
Return -EIO when the read failed, rather than the number of blocks read. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-09Merge branch '2023-08-09-misc-cleanups' into nextTom Rini126-169/+164
- Rework the arch linker scripts to be consistent for all, support Kconfig fragments in the board directory and fix some Kconfig options that were hex-type by default of 0 not 0x0.
2023-08-09scripts: kconfig: Add config fragment support in board/../WIP/2023-08-09-misc-cleanupsJason Kacines1-1/+3
Add support to config fragments (.config) located in the /board directory. This will allow only base defconfigs to live in /configs and all fragments to live in their respective device directory in /board/.. Signed-off-by: Jason Kacines <j-kacines@ti.com>
2023-08-09treewide: unify the linker symbol reference formatShiji Yang21-59/+59
Now all linker symbols are declared as type char[]. Though we can reference the address via both the array name 'var' and its address '&var'. It's better to unify them to avoid confusing developers. This patch converts all '&var' linker symbol refrences to the most commonly used format 'var'. Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-09treewide: rework linker symbol declarations in sections headerShiji Yang58-45/+64
1. Convert all linker symbols to char[] type so that we can get the corresponding address by calling array name 'var' or its address '&var'. In this way, we can avoid some potential issues[1]. 2. Remove unused symbol '_TEXT_BASE'. It has been abandoned and has not been referenced by any source code. 3. Move '__data_end' to the arch x86's own sections header as it's only used by x86 arch. 4. Remove some duplicate declared linker symbols. Now we use the standard header file to declare them. [1] This patch fixes the boot failure on MIPS target. Error log: SPL: Image overlaps SPL Fixes: 1b8a1be1a1f1 ("spl: spl_legacy: Fix spl_end address") Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-09Kconfigs: Correct default of "0" on hex type entriesTom Rini47-64/+38
It is not a parse error to have a default value of "0" for a "hex" type entry, instead of "0x0". However, "0" and "0x0" are not treated the same even by the tools themselves. Correct this by changing the default value from "0" to "0x0" for all hex type questions that had the incorrect default. Fix one instance (in two configs) of a default of "0" being used on a hex question to be "0x0". Remove the cases where a defconfig had set a value of "0x0" to be used as the default had been "0". Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08Merge branch '2023-08-08-assorted-code-corrections' into nextTom Rini26-53/+51
- A number of code corrections caught by Smatch and a few others as well.
2023-08-08pci: correct function name in messageWIP/2023-08-08-assorted-code-correctionsHeinrich Schuchardt1-2/+2
If an error message contains a function name, it should match the name of the function throwing the message. Fixes: 7739d93d8288 ("pci: Match region flags using a mask") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08board_f: Cosmetic style fixBin Meng1-2/+3
Some coding convention fixes for print_resetinfo(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08crc32: Drop duplicates crc header includesIlya Lukin5-5/+0
Fixes: 3db711085752 ("crc32: Use the crc.h header for crc functions") Signed-off-by: Ilya Lukin <4.shket@gmail.com>
2023-08-08btrfs: fix some error checking for btrfs_decompress()Dan Carpenter1-2/+2
The btrfs_decompress() function mostly (u32)-1 on error but it can also return -EPERM or other kernel error codes from zstd_decompress(). The "ret" variable is an int, so we could just check for negatives. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Qu Wenruo <wqu@suse.com>
2023-08-08test: fix a couple NULL vs IS_ERR() checksDan Carpenter1-2/+2
The x509_cert_parse() and pkcs7_parse_message() functions return error pointers. They don't return NULL. Update the checks accordingly. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08expo: allocate correct amount of memoryDan Carpenter1-1/+1
This should be allocating the memory for "item" instead of "menu". The item struct is 48 bytes instead of 96 (assuming a 64bit system) so this saves a little memory. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08cmd: improve string matching for hexDan Carpenter1-1/+1
Match the "=0x" instead of just "=0". Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Heinrich.Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-08-08cramfs: clean up some error messagesDan Carpenter1-4/+2
This line break is not done correctly. We don't want to have all those tabs in the printed output. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08test: unicode: fix a sizeof() vs ARRAY_SIZE() bugDan Carpenter1-3/+3
The u16_strlcat() is in units of u16 not bytes. So the limit needs to be ARRAY_SIZE() instead of sizeof(). Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2023-08-08cmd: pxe_utils: add some missing tabsDan Carpenter1-2/+2
These lines are supposed to be indented one more tab. Otherwise it's confusing to read. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2023-08-08remoteproc: uclass: Clean up a returnDan Carpenter1-1/+1
We know that "pa" is non-NULL so it's nicer to just return zero instead of return !pa. This has no effect on runtime behavior. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08fdt: off by one in ofnode_lookup_fdt()Dan Carpenter1-1/+1
The "oftree_count" is the number of entries which have been set in the oftree_list[] array. If all the entries have been initialized then this off by one would result in reading one element beyond the end of the array. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08fs: btrfs: Prevent error pointer dereference in list_subvolums()Dan Carpenter1-0/+1
If btrfs_read_fs_root() fails with -ENOENT, then we go to the next entry. Fine. But if it fails for a different reason then we need to clean up and return an error code. In the current code it doesn't clean up but instead dereferences "root" and crashes. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Marek Behún <kabel@kernel.org> Reviewed-by: Qu Wenruo <wqu@suse.com>
2023-08-08cros_ec: Fix an error code is cros_ec_get_sku_id()Dan Carpenter1-2/+5
The ec_command_inptr() function returns negative error codes or the number of bytes that it was able to read. The cros_ec_get_sku_id() function should return negative error codes. Right now it returns positive error codes or negative byte counts. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08video: Add parentheses around VNBYTES() macroDan Carpenter1-1/+1
The VNBYTES() macro needs to have parentheses to prevent some (harmless) macro expansion bugs. The VNBYTES() macro is used like this: VID_TO_PIXEL(x) * VNBYTES(vid_priv->bpix) The * operation is done before the / operation. It still ends up with the same results, but it's not ideal. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-08cmd: Fix a size parameter in test_readonly()Dan Carpenter1-2/+2
The parentheses are in the wrong place so this passes the number of bytes to write as "sizeof(index_0) != TPM_SUCCESS" when just "sizeof(index_0)" was intended. (1 byte vs 4 bytes). Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2023-08-08cmd: Fix an error code in cmd_mux_find()Dan Carpenter1-1/+1
This returns the wrong variable. It ends up returning NULL when it was suppose to return an error pointer. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
2023-08-08lib/charset: fix u16_strlcat() return valueMatthias Schiffer2-8/+8
strlcat returns min(strlen(dest), count)+strlen(src). Make u16_strlcat's behaviour the same for consistency. Fixes: eca08ce94ceb ("lib/charset: add u16_strlcat() function") Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
2023-08-08Revert "lib: string: Fix strlcpy return value", fix callersMatthias Schiffer4-13/+13
Both the Linux kernel and libbsd agree that strlcpy() should always return strlen(src) and not include the NUL termination. The incorrect U-Boot implementation makes it impossible to check the return value for truncation, and breaks code written with the usual implementation in mind (for example, fdtdec_add_reserved_memory() was subtly broken). I reviewed all callers of strlcpy() and strlcat() and fixed them according to my understanding of the intended function. This reverts commit d3358ecc54be0bc3b4dd11f7a63eab0a2842f772 and adds related fixes. Fixes: d3358ecc54be ("lib: string: Fix strlcpy return value") Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2023-08-07Prepare v2023.10-rc2v2023.10-rc2Tom Rini2-3/+3
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-07configs: Resync with savedefconfigTom Rini36-43/+15
Rsync all defconfig files using moveconfig.py Signed-off-by: Tom Rini <trini@konsulko.com>