aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-05-31mmc: fix improper use of memsetWIP/2023-05-31-assorted-fixes-and-improvementsSam Edwards1-1/+1
Buffers created through DEFINE_(CACHE_)ALIGN_BUFFER are actually pointers to the real underlying buffer. Using sizeof(...) is not appropriate in this case. Signed-off-by: Sam Edwards <CFSworks@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2023-05-31common: dfu: Remove leading space charactersRavi Gunasekaran1-0/+2
As per [1], dfu_alt_info is mentioned to be as semicolon separated string of information on each alternate and the parsing logic in the dfu.c is based on this. Typically, the dfu_alt_info_* is defined in .h files as preprocessor macros with 'alt' info separated by semicolon. But when dfu_alt_info_* is added in the environment files(.env) the script at "scripts/env2string.awk" converts a newline to space. Thus adding a space character after semicolon. This results in incorrect parsing in dfu.c which is based on the information that 'alt' info are only semicolon separated. One option is to add dfu_alt_info_* variable in .env in single line. But there is possiblity for it to exceed the line length limit. So update the parsing logic to remove leading space characters before adding to the dfu list. [1]: https://u-boot.readthedocs.io/en/latest/usage/dfu.html Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
2023-05-31cmd: sf/nand: Print and return failure when 0 length is passedAshok Reddy Soma2-0/+10
For sf commands, when '0' length is passed for erase, update, write or read, there might be undesired results. Ideally '0' length means nothing to do. So print 'ERROR: Invalid size 0' and return cmd failure when length '0' is passed to sf commands. Same thing applies for nand commands also. Example: ZynqMP> sf erase 0 0 ERROR: Invalid size 0 ZynqMP> sf write 10000 0 0 ERROR: Invalid size 0 ZynqMP> sf read 10000 0 0 ERROR: Invalid size 0 ZynqMP> sf update 1000 10000 0 ERROR: Invalid size 0 ZynqMP> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
2023-05-31scripts/Makefile.lib: change spelling of $(srctree)/arch/$(ARCH)/dts in ↵Rasmus Villemoes1-1/+1
dtc_cpp_flags Currently, all in-tree .dts files (apart from some under test/ and tools/), reside in arch/$ARCH/dts. However, in the linux kernel tree, dts files for arm64 boards, and probably in the not too distant future [1], arm boards as well, live in subdirectories of that. For private forks, using a vendor or project subdirectory is also more convenient to clearly separate private code from upstream - in the same way that code under board/ is also split and easy to maintain. In order to prepare for us to follow suit and do the splitting of the in-tree .dts files, and to make life a little easier for private forks that already place dts files not directly in arch/$ARCH/dts, change the $(srctree)/arch/$(ARCH)/dts path to instead refer to the directory of the .dts file being compiled. This should be a no-op for all existing cases. [1] https://lore.kernel.org/lkml/20220328000915.15041-1-ansuelsmth@gmail.com/ Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2023-05-31semihosting: create file in smh_fs_write_at()Heinrich Schuchardt1-0/+4
If a file does not exist, it should be created. Fixes: f676b45151c3 ("fs: Add semihosting filesystem") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-05-31arm: set alignment properly for asm funcsSam Edwards1-2/+2
ARM requires a 4-byte alignment on all ARM code (though this requirement is relaxed to 2-byte for some THUMB code) and we should be explicit about that here. GAS has its own fix for this[1] that forces proper alignment on any section containing assembled instructions, but this is not universal: Clang's and other gaslike assemblers lack this implicit alignment. Whether or not this is considered a bug in those assemblers, it is better to ask directly for what we want. [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=12931 Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2023-05-31cmd: fs: document where 'size' stores its resultBaruch Siach1-1/+1
Make it a little bit easier for the user to utilize the 'size' command. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-31cli: avoid buffer overrunHeinrich Schuchardt1-1/+1
Invoking the sandbox with /u-boot -c ⧵0xef⧵0xbf⧵0xbd results in a segmentation fault. Function b_getch() retrieves a character from the input stream. This character may be > 0x7f. If type char is signed, static_get() will return a negative number and in parse_stream() we will use that negative number as an index for array map[] resulting in a buffer overflow. Reported-by: Harry Lockyer <harry_lockyer@tutanota.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-31spl: Correct checking of configuration nodeBin Meng1-1/+1
Per the fit_conf_get_node() API doc, it returns configuration node offset when found (>=0). Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-31cmd: fdt: Correct checking of configuration nodeBin Meng1-1/+1
fit_conf_get_node() returns a negative value on error. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-31efi: Correct .efi rulesSimon Glass1-0/+3
These files should have both 'always' and 'targets' so that dependencies are detected correctly. When only 'always' is used, the target is built every time, although I am not quite sure why. Make sure each has both 'always' and 'targets' to avoid this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-31acpi: Put the version numbers in a central placeSimon Glass4-17/+18
At present two acpi files are built every time since they use a version number from version.h This is not necessary. Make use of the same technique as for the version string, so that they are build only when they change. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-31Makefile: Fix incorrect FORCE deps on env rulesSimon Glass1-2/+2
These rules run on every build even if nothing has changed. The FORCE dependency is only needed for if_changed, not for cmd. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-31fastboot: Only call the bootm command if it is enabledSamuel Holland1-1/+1
This fixes an error with trying to link against do_bootm() when CONFIG_CMD_BOOTM is disabled. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2023-05-31Merge branch '2023-05-31-cleanup-unaligned-access-macros' into nextTom Rini8-175/+83
To quote the author: There are two versions of get/set_unaligned, get_unaligned_be64, put_unaligned_le64 etc in U-Boot causing confusion (and bugs). In this patch-set, I'm trying to fix that with a single unified version of the access macros to be used across all archs. This work is inspired by similar changes in this Linux kernel by Arnd Bergman, https://lore.kernel.org/lkml/20210514100106.3404011-1-arnd@kernel.org/
2023-05-31asm-generic: simplify unaligned.hWIP/2023-05-31-cleanup-unaligned-access-macrosJens Wiklander1-16/+73
The get_unaligned()/put_unaligned() implementations are more complex than necessary. Move everything into one file and use a more compact implementation based on packed struct access and byte swapping macros. This patch is based on the Linux kernel commit 803f4e1eab7a ("asm-generic: simplify asm/unaligned.h") by Arnd Bergmann. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-05-31linux/unaligned: remove unused access_ok.hJens Wiklander1-66/+0
linux/unaligned/access_ok.h is unused, so remove it. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-05-31fs/btrfs: use asm/unaligned.hJens Wiklander1-1/+1
Use asm/unaligned.h instead of linux/unaligned/access_ok.h for unaligned access. This is needed on architectures that doesn't handle unaligned accesses directly. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-05-31powerpc: use asm-generic/unaligned.hJens Wiklander1-16/+2
Powerpc configurations are apparently able to do unaligned accesses. But in an attempt to clean up and handle unaligned accesses in the same way we ignore that and use the common asm-generic/unaligned.h directly instead. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-05-31m68k: use asm-generic/unaligned.hJens Wiklander1-15/+2
M68k essentially duplicates the content of asm-generic/unaligned.h, with an exception for non-Coldfire configurations. Coldfire configurations are apparently able to do unaligned accesses. But in an attempt to clean up and handle unaligned accesses in the same way we ignore that and use the common asm-generic/unaligned.h directly instead. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Angelo Dureghello <angelo@kernel-space.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-05-31mips: use asm-generic/unaligned.hJens Wiklander1-22/+1
Mips essentially duplicates the content of asm-generic/unaligned.h, so use that file directly instead. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-05-31sh: use asm-generic/unaligned.hJens Wiklander1-20/+2
Sh essentially duplicates the content of asm-generic/unaligned.h, so use that file directly instead. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-05-31arm: use asm-generic/unaligned.hJens Wiklander1-19/+2
Arm duplicates the content of asm-generic/unaligned.h, so use that file directly instead. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-05-31Merge branch '2023-05-31-code-cleanups' into nextTom Rini88-8046/+12
- Correct some header double-inclusion guards and remove some dead (or in the case of ti816x, unmaintained) code.
2023-05-31include: Remove unused header filesTom Rini49-5488/+0
As part of various code clean-ups we have on occasion missed removing unused header files. None of these files are referenced anywhere else at this point. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-05-31faraday: remove orphaned header fileAndre Przywara1-46/+0
Commit 11232139e399 ("nds32: Remove the architecture") removed the nds32 architecture, and with it the last user of the Faraday AHB controller header file. Consequently remove that header file as well. This was found because the inclusion guard was misspelled. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-05-31exynos: fix header inclusion guardAndre Przywara1-1/+1
It seems like the header inclusion guard for the Exynos pinctrl header was misspelled. Make the preprocessor symbol for the #ifndef and #define lines the same, so that the double inclusion protection works as expected. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-05-31freescale: vsc3316_3308: fix header inclusion guardAndre Przywara1-1/+1
It seems like the header inclusion guard for some Freescale crosspoint switch header was misspelled. Make the preprocessor symbol for the #ifndef and #define lines the same, so that the double inclusion protection works as expected. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-05-31arm: uniphier: fix header inclusion guardAndre Przywara1-1/+1
It seems like the header inclusion guard for some Uniphier DDR PHY header was misspelled. Make the preprocessor symbol for the #ifndef and #define lines the same, so that the double inclusion protection works as expected. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-05-31imx: fix header inclusion guardsAndre Przywara4-4/+4
It seems like the header inclusion guards for some IMX related headers were misspelled or got out of sync. Make the preprocessor symbols for the #ifndef and #define lines the same, so that the double inclusion protection works as expected. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-05-31arm: Remove ti816x_evm board and ti816x SoC supportTom Rini31-2505/+5
This platform is currently unmaintained and untested, so remove it. Further, as it is the only TI816X SoC example, remove related files as well. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-05-18configs: Resync with savedefconfigTom Rini59-154/+154
Rsync all defconfig files using moveconfig.py Signed-off-by: Tom Rini <trini@konsulko.com>
2023-05-18Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-usb ↵Tom Rini5-95/+126
into next - USB and SPL related Kconfig clean-up / re-organization
2023-05-16Merge branch 'next_gpio' of ↵Tom Rini1-13/+2
https://source.denx.de/u-boot/custodians/u-boot-sh into next - gpio: renesas: Simplify .request/.rfree callbacks
2023-05-16Merge branch '2023-05-16-remove-misuse-of-env-is-nowhere' into nextTom Rini8-60/+0
To quote the author: When using a list of writeable variables, the initial values come from the built-in default environment since commit 5ab81058364b ("env: Complete generic support for writable list"). Remove unnecessary misuse of the env is nowhere driver as default environment.
2023-05-17usb: gadget: Add and use matching SPL USB ethernet gadget Kconfig symbolsMarek Vasut2-2/+25
Define SPL_USB_ETH_RNDIS symbol to make it possible to select USB gadget ethernet support in SPL and U-Boot separately in Kconfig . Make use of the new symbols in gadget Makefile and move the rndis.o just below the now merged USB_ETHER symbol in Makefile. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-05-17usb: Move SPL_USB_GADGET and related Kconfig symbols to drivers/usb/Marek Vasut3-66/+66
To avoid piling up all the various Kconfig symbols in one place, i.e. common/spl/Kconfig, move the USB Kconfig symbols into drivers/usb/ . This commit moves SPL_USB_GADGET and related symbols. Fix typo and rename SPL_USB_GADGET to "USB Gadget Support in SPL" . Update the gadget Makefile to match the symbol changes. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-05-17usb: Move SPL_USB_STORAGE Kconfig symbol to drivers/usb/Marek Vasut2-17/+22
To avoid piling up all the various Kconfig symbols in one place, i.e. common/spl/Kconfig, move the USB Kconfig symbols into drivers/usb/ . This commit moves SPL_USB_STORAGE and matching SYS_USB_FAT_BOOT_PARTITION . Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-05-17usb: Move SPL_USB_HOST Kconfig symbol to drivers/usb/Marek Vasut2-10/+13
To avoid piling up all the various Kconfig symbols in one place, i.e. common/spl/Kconfig, move the USB Kconfig symbols into drivers/usb/ . This commit moves SPL_USB_HOST and updates help text of both USB_HOST and SPL_USB_HOST . Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-05-16gpio: renesas: Simplify .request/.rfree callbacksPali Rohár1-13/+2
Remove identify wrapper functions. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Marek Vasut <marex@denx.de>
2023-05-16env: Remove misuse of env is nowhere leftoverWIP/2023-05-16-remove-misuse-of-env-is-nowhereStefan Herbrechtsmeier1-2/+0
When using a list of writeable variables, the initial values come from the built-in default environment since commit 5ab81058364b ("env: Complete generic support for writable list"). Remove leftover of misuse of the env is nowhere driver as default environment. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2023-05-16powerpc/mpc85xx: socrates: Remove misuse of env is nowhere driverStefan Herbrechtsmeier2-18/+0
When using a list of writeable variables, the initial values come from the built-in default environment since commit 5ab81058364b ("env: Complete generic support for writable list"). Remove unnecessary misuse of the env is nowhere driver as default environment. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2023-05-16imx6q: acc: Remove misuse of env is nowhere driverStefan Herbrechtsmeier2-18/+0
When using a list of writeable variables, the initial values come from the built-in default environment since commit 5ab81058364b ("env: Complete generic support for writable list"). Remove unnecessary misuse of the env is nowhere driver as default environment. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2023-05-16imx6: aristainetos: Remove misuse of env is nowhere driverStefan Herbrechtsmeier3-22/+0
When using a list of writeable variables, the initial values come from the built-in default environment since commit 5ab81058364b ("env: Complete generic support for writable list"). Remove unnecessary misuse of the env is nowhere driver as default environment. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2023-05-15Merge branch '2023-05-15-build-system-updates' into nextTom Rini6-44/+21
- Bring in a few kbuild changes from upstream Linux to fix running the checker (make C=1/C=2), and clean up some of the logic related to how choose what device trees to build.
2023-05-15Fix sparse checks processingWIP/2023-05-15-build-system-updatesChristophe Leroy3-40/+14
A lot of errors are encountered when building with sparse checking activated (make C=1 or make C=2). Many of them are fixed in Linux. Resynchronise Makefile and include/linux/build_bug.h with Linux kernel sources by porting the following Linux commits into u-boot: - 6c49f359ca14 ("kbuild: disable sparse warnings about unknown attributes") - 80591e61a0f7 ("kbuild: tell sparse about the $ARCH") - 8788994376d8 ("linux/build_bug.h: change type to int") - 527edbc18a70 ("build_bug.h: remove most of dummy BUILD_BUG_ON stubs for Sparse") - c60d3b79423a ("build_bug.h: remove negative-array fallback for BUILD_BUG_ON()") - 14e83077d55f ("include: drop pointless __compiler_offsetof indirection") Also revert commit aa9e891c63 ("include/linux/stddef.h: avoid 'warning: preprocessor token offsetof redefined'") because the error it creates is worse than the warning it is trying to fix. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-05-15kbuild: Allow DTB overlays to built from .dtso named source filesRasmus Villemoes1-0/+3
[Linux commit 363547d2191c] Currently DTB Overlays (.dtbo) are build from source files with the same extension (.dts) as the base DTs (.dtb). This may become confusing and even lead to wrong results. For example, a composite DTB (created from a base DTB and a set of overlays) might have the same name as one of the overlays that create it. Different files should be generated from differently named sources. .dtb <-> .dts .dtbo <-> .dtso We do not remove the ability to compile DTBO files from .dts files here, only add a new rule allowing the .dtso file name. The current .dts named overlays can be renamed with time. After all have been renamed we can remove the other rule. [Import notes: Adapt to U-Boot by using the cmd_dtco function instead of cmd_dtc just like the current .dts -> .dtbo rule.] Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-15kbuild: add dtc as dependency on .dtb filesRasmus Villemoes1-2/+2
[Linux commit b8fc5b2157b1] If dtc is rebuilt, we should rebuild .dtb files with the new dtc. [Import notes: Back then there was no .dtbo rule in Linux's Makefile.lib, but the current .dtbo rules in Linux also have the $(DTC) dependency, so also add it to our .dtbo rule.] Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-15scripts/Makefile.dts: tweak logic for deciding which dtbs to buildRasmus Villemoes1-1/+1
The idea in 3609e1dc5f4d (dts: automatically build necessary .dtb files) was fine, but the implementation was suboptimal due to some misunderstandings on my part (and possibly defects in some defconfig files): - Sometimes DEFAULT_DEVICE_TREE is not included in OF_LIST or SPL_OF_LIST - SPL_OF_LIST is not always a subset of OF_LIST - While SPL_OF_LIST governs the list of dtbs relevant to SPL (i.e., may be built into an SPL-with-bunch-of-dtbs-to-choose-between-at-runtime), those dtbs are not actually _built_ during the SPL build phase, i.e. when $(SPL_) would expand to SPL_. fdtgrep runs on the artifacts produced during the ordinary U-Boot build. Tweak the logic so that we simply add the union of all dtbs mentioned in either DEFAULT_DEVICE_TREE, OF_LIST and SPL_OF_LIST to dtb-y. That should, for real, ensure that we always build all the dtbs that is relevant to the current board, and should in turn enable us to massively simplify arch/*/dts/Makefile. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Tested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-05-15scripts: dtc-version: support git version strings tooMartin Hundebøll1-1/+1
Building dtc from git causes the version number to start with a 'v' (e.g. v1.7.0). printf then fails to parse 'v1' as a decimal value, and prints '000700' instead of '010700'. Subsequently, the build fails, because '000700' is less than the required '010400' version. Signed-off-by: Martin Hundebøll <martin@geanix.com>