aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-04-03Merge tag 'dm-next-3apr23' of ↵WIP/03Apr2023-nextWIP/03Apr2023Tom Rini10-85/+200
https://source.denx.de/u-boot/custodians/u-boot-dm into next Enable VPL tests Minor changes with fdt command, vboot test, pinctrl
2023-04-03Revert "disk: Use a helper function to reduce duplication"Tom Rini1-25/+21
Per Takahiro Akashi this is not an equivalent rework, so revert it. This reverts commit d87bdb82eae66512c222fd93280acaf4dd1cd4be. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-04-03test: Run the VPL tests with 'make check'Simon Glass1-0/+5
Update the script to run VPL tests as well as the others. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-03CI: Ensure that vpl test is runSimon Glass2-2/+2
This is actually skipped at present due to the condition in the file. Fix this by running all vpl tests. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-03vbe: Use the correct image filename in the testSimon Glass1-2/+4
At present this inadvertently relies on having a symlink to the correct file from the current directory. Use the correct path to fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-03sandbox: Update the VBE firmware locationSimon Glass1-1/+1
The image size was increased but the firmware-update part was not updated. Correct this so that VBE firmware update can succeed with sandbox_vpl. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 85c66dc95c2 ("sandbox: Expand size for VPL image")
2023-04-03doc: sandbox: replace sgdisk input with optionsCorentin Guillevic1-1/+1
The input provided to sgdisk is in fact aimed for sfdisk. The use of sgdisk and sfdisk, coming from different projects, is not the same. So, this commit translates the sfdisk-formatted input into sgdisk-compatible options. Partitions are not modified. Signed-off-by: Corentin Guillevic <corentin.guillevic@smile.fr>
2023-04-03fdt: Make fdt addr -q quieterPeter Hoyes2-6/+14
64597346 "fdt: Add -q option to fdt addr for distro_bootcmd" introduced the -q option for fdt addr, which sets the current working fdt address without printing any output. baf41410 "fdt: Show a message when the working FDT changes" made the utility function set_working_fdt_addr (in cmd/fdt.c) output a message on each invocation, even if called via fdt addr -q, in which case its output is now slightly noisier. To fix this, split out set_working_fdt_addr into set_working_fdt_addr plus the static function set_working_fdt_addr_quiet. set_working_fdt_addr_quiet can be called by "quiet" fdt cmd logic and set_working_fdt_addr is exported (as before) to other boot logic. The latter calls the former. Remove the assertion from the fdt addr test case when calling with the -q argument. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-03pinctrl: fix pinctrl_gpio_get_pinctrl_and_offset for gpio-ranges arrayQuanyang Wang1-24/+23
Sometimes a multi-element array is used for "gpio-ranges" property in dts file: qe_pio_e: gpio-controller@1460 { ...... gpio-ranges = <&pinctrl1 0 20 10>, <&pinctrl2 10 50 20>; ...... }; But the function pinctrl_gpio_get_pinctrl_and_offset can't handle this case because the "index" argument passed to dev_read_phandle_with_args is fixed to be "0". Use a loop to traverse the array to fix it. Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
2023-04-03cmd: fdt: Use env_set_hex() for "get addr" and "get size"Marek Vasut1-11/+2
The 'fdt get addr' and 'env get size' is always assumed to be hex value, drop the prefix, and outright switch to env_set_hex(). Since this might break existing users who depend on the existing behavior with 0x prefix, this is a separate patch. Revert if this breaks anything. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-02test_vboot.py: include test of fdt_add_pubkey toolRoman Kopytin1-38/+148
Add test_fdt_add_pubkey test which provides simple functionality test which contains such steps: create DTB and FIT files add keys with fdt_add_pubkey to DTB sign FIT image check with fit_check_sign that keys properly added to DTB file Signed-off-by: Roman Kopytin <Roman.Kopytin@kaspersky.com> Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com> Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2023-03-31Merge tag 'u-boot-imx-next-20230331' of ↵WIP/31Mar2023-nextTom Rini101-2212/+4575
https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next u-boot-imx-next-20230331 for next --------------------------------- CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/15819 i.MX patches queued for next: - Conversions to DM_SERIAL - Fixes for Toradex boards - Gateworks Boards - i.MX8ULP - EQoS support / fixes, changes in boards
2023-03-31Merge branch '2023-03-30-assorted-general-upates' into nextTom Rini37-92/+971
- RTC cleanups / improvements, run_commandf() cleanups, fs bugfixes, socrates config fix, PCI MPS support, GPIO improvements, other code cleanups
2023-03-30test: fs: Check fat short file nameWIP/2023-03-30-assorted-general-upatesStefan Herbrechtsmeier1-0/+36
Ensure that a freshly written fat file with a lower case filename which fits into the upper case 8.3 short filename is not mangeled with a tilde and number. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2023-03-30input: button_kbd: make driver complementary to gpio buttonsSvyatoslav Ryhel2-7/+5
Remove need of dts binding for button keyboard since it reuses gpio-keys binding. Select gpio-keys driver if button keyboard is selected since button keyboard can not operate on its own. Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # HTC One X T30 Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30cmd: ums: abort mounting by pressing any keySvyatoslav Ryhel2-0/+16
This patch introduses config which allows interrupt run of usb mass storage with any key. This is especially useful on devices with limited input capabilities like tablets and smatphones which have only gpio keys in direct access. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30test: exit: fix run_commandf() warningsEvgeny Bachinin1-9/+9
Fix warnings after adding printf-like attribute format for run_commandf(): warning: too many arguments for format [-Wformat-extra-args] Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30test: fdt: fix run_commandf() warningsEvgeny Bachinin1-11/+11
Fix warnings both for 32bit and 64bit architecture after adding printf-like attribute format for run_commandf(): warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘ulong {aka long unsigned int}’ [-Wformat=] ret = run_commandf("fdt addr -c %08x", addr); ^ Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru> Cc: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Fixup testcases added since patch was posted] Signed-off-by: Tom Rini <trini@konsulko.com>
2023-03-30unit-test: cover run_commandf() by test-casesEvgeny Bachinin1-0/+34
As run_commandf() is variadic version of run_command() and just a wrapper, hence apply similar run_command's test-cases. Let's avoid warning about empty string passing: warning: zero-length gnu_printf format string [-Wformat-zero-length] assert(run_commandf("") == 0); Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30cli: run_commandf(): small fixupsEvgeny Bachinin2-9/+29
* vsnprintf() can truncate cmd, hence it makes no sense to launch such command (it's broken). Moreover, it's better to signalize to the caller about such case (for facilitating debugging or bug hunting). * Fix kernel-doc warnings: include/command.h:264: info: Scanning doc for run_commandf include/command.h:268: warning: contents before sections include/command.h:271: warning: No description found for return value of 'run_commandf' * Add printf-like format attribute to validate at compile-time the format string against parameters's type. * Fix compilation error in case of -Wall, -Werror, -Wextra: error: variable ‘i’ set but not used [-Werror=unused-but-set-variable] * Drop extra ret variable. Signed-off-by: Evgeny Bachinin <EABachinin@sberdevices.ru> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30drivers: rtc: add max313xx series rtc driverChris Packham4-0/+474
Adding support for Analog Devices MAX313XX series RTCs. This is ported from the Linux driver and adapted for use in u-boot. Notable differences are - handling of tm_year and tm_mon differ - clock source support is omitted - hwmon support for the MAX31328 and MAX31343 is omitted - rtc_ops->reset is added Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30include: kernel.h: port find_closest() from LinuxChris Packham1-0/+24
The find_closest() macro can be used to find an element in a sorted array that is closest to an input value. Bring in this macro from Linux v6.3-rc1-2-g8ca09d5fa354. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30disk: Use a helper function to reduce duplicationSimon Glass1-21/+25
Reduce the duplicated code slightly by using a helper function to handle the common code. This reduces the code size very slightly. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-30lib: Fix SYS_TIMER_COUNTS_DOWN description in KconfigMarek Vasut1-1/+1
The SYS_TIMER_COUNTS_DOWN description contains a typo, s@rathe@&r@ , fix it. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-03-30gpio: allow passing NULL to gpio_request_by_line_name() to search all gpio ↵Rasmus Villemoes2-1/+9
controllers The API is more convenient to use if one doesn't have to know upfront which gpio controller has a line with the name one is searching for, and arrange to look that device up somehow. Or implement this loop oneself. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30rtc: m41t62: implements read8/write8 operationsThomas Perrot1-0/+12
These operations are required by dm_rtc_read and dm_bootcount_get helpers. Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30fs: ext4: fix files seen as symlink during deletionCorentin GUILLEVIC1-1/+1
The deletion process handles special case for symlinks whose target are small enough that it fits in struct ext2_inode.b.symlink. So no block had been allocated. But the check of file type wrongly considered regular files as symlink. So, no block was freed. So, the EXT4 partition could be corrupted because of no free block available. Signed-off-by: Corentin GUILLEVIC <corentin.guillevic@smile.fr>
2023-03-30fs: fat: do not mangle short filenamesStefan Herbrechtsmeier1-4/+7
Do not mangle lower or mixed case filenames which fit into the upper case 8.3 short filename. This ensures FAT standard compatible short filenames (SFN) to support systems without long filename (LFN) support like boot roms (ex. SFN BOOT.BIN instead of BOOT~1.BIN for LFN boot.bin). Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2023-03-30test: Add test for new command pci_mpsStephen Carlson6-0/+60
Adds a test for the new pci_mps command to ensure that it can set the Maximum Payload Size (MPS) of all devices to 256 bytes in the sandbox environment. Enables the pci_mps command in the sandbox environment so that this test can be run. Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
2023-03-30drivers: pci: sandbox: Add stub sandbox PCI MPS supportStephen Carlson1-0/+3
Reports the sandbox swapcase PCI Express device to support a 256 byte Maximum Payload Size for MPS tuning tests. Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30cmd: pci: Add command to set MPS of all PCIe devicesStephen Carlson4-0/+182
Enable tuning of the PCI Express MPS (Maximum Payload Size) of each device. The Maximum Read Request Size is not altered. The SAFE method uses the largest MPS value supported by all devices in the system for each device. This method is the same algorithm as used by Linux pci=pcie_bus_safe. The PEER2PEER method sets all devices to the minimal (128 byte) MPS, which allows hot plug of devices later that might only support the minimum size, and ensures compatibility of DMA between two devices on the bus. Signed-off-by: Stephen Carlson <stcarlso@linux.microsoft.com>
2023-03-30sysinfo: gpio: fix loop over DT "revisions" arrayRasmus Villemoes1-2/+3
There can certainly be a lot more elements in the "revisions" (and "names") arrays than there are gpios used to form the trinary number we're searching for; we simply don't know the array size up-front. Nor do we need to, because the loop body already knows to recognize -EOVERFLOW as "not that many elements present" (and we have a test that specifically ensures that dev_read_u32_index() returns exactly that). So just drop the i < priv->gpio_num condition. While in here, fix the weird placement of the default: keyword. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2023-03-30nvedit: simplify do_env_indirect()Rasmus Villemoes1-7/+4
Instead of calling env_get(from) up to three times, just do it once, computing the value we will put into 'to' and error out if that is NULL (i.e. no 'from' variable and no default provided). No functional change. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30api: move API related config options into submenuHeinrich Schuchardt2-9/+10
Kconfig settings that are related to the API for standalone applications should be in the API sub-menu and not on the top level. CONFIG_STANDALONE_LOAD_ADDR is only relevant if standalone example applications are built. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-03-30Kconfig: Sort the BUILD_TARGET listMarek Vasut1-5/+5
Sort the defaults list in BUILD_TARGET Kconfig option. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30image: Fix potentially uninitialized data variableMarek Vasut1-4/+11
In case fitImage support is disabled, and image_locate_script() is passed a fitImage, then the 'data' variable is used uninitialized. Drop into the default: branch of the switch-case statement and do not return the uninitialized data, and do not modify the return pointer either, just print an error message. Reported by clang build: " $ make HOSTCC=clang CC=clang KCFLAGS=-Werror sandbox64_defconfig && make HOSTCC=clang CC=clang KCFLAGS=-Werror ... boot/image-board.c:1006:7: error: variable 'data' is used uninitialized whenever switch case is taken [-Werror,-Wsometimes-uninitialized] case IMAGE_FORMAT_LEGACY: ^~~~~~~~~~~~~~~~~~~ include/image.h:608:29: note: expanded from macro 'IMAGE_FORMAT_LEGACY' ^~~~ boot/image-board.c:1128:19: note: uninitialized use occurs here *datap = (char *)data; ^~~~ boot/image-board.c:1001:11: note: initialize the variable 'data' to silence this warning u32 *data; ^ = NULL " Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-30powerpc/mpc85xx: disable legacy format bootingHeiko Schocher1-1/+0
disable CONFIG_LEGACY_IMAGE_FORMAT so prevent of booting not signed fitimages. Signed-off-by: Heiko Schocher <hs@denx.de>
2023-03-30Merge branch 'next' of ↵Tom Rini6-34/+164
https://source.denx.de/u-boot/custodians/u-boot-marvell into next - mvebu: Fix boot mode detection (Pali) - mvebu: clearfog: defconfig and eMMC updates (Martin)
2023-03-30clk: imx8mp: add pwm clocks supportTommaso Merciai1-0/+24
Add clocks support for the PWM controllers. This is ported from Linux v6.3.0-rc1 Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
2023-03-30arm64: imx8mm: imx8mn: imx8mp: Drop FEC GPR[1] board workaroundMarek Vasut4-86/+2
The FEC interface mode is now configured in common board_interface_eth_init() and called by FEC MAC driver when appropriate. Drop the board side duplicates if the same functionality. Signed-off-by: Marek Vasut <marex@denx.de>
2023-03-30arm64: imx8mp: Drop EQoS GPR[1] board workaroundMarek Vasut9-157/+1
The EQoS interface mode is now configured in common board_interface_eth_init() and called by EQoS MAC driver when appropriate. Drop the board side duplicates if the same functionality. Signed-off-by: Marek Vasut <marex@denx.de>
2023-03-30arm64: dts: imx8mp: Drop EQoS clock workaroundMarek Vasut5-30/+0
The assigned-clock no longer have to be dropped, the clock are now defined in clk-imx8mp.c and used by DWMAC driver to configure the DWMAC clock. Drop the workarounds from U-Boot specific DT extras. Signed-off-by: Marek Vasut <marex@denx.de>
2023-03-30configs: verdin-imx8mp: Fix wrong early malloc() heap sizeEmanuele Ghidoli1-0/+1
Set, previously unset, CONFIG_SPL_SYS_MALLOC_F_LEN to 0x4000 whose default value is 0x10000. Early malloc() uses CRAM_S at 0x184000 (CFG_MALLOC_F_ADDR), this ram area end at 0x188000. Fixes: 2bc2f817cea7 ("board: toradex: add verdin imx8m plus support") Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-03-30ARM: imx: imx8mp: fix enable_i2c_clkRasmus Villemoes1-2/+2
In order for i2c_num==4 and 5 to stay invalid for non-imx8mp SOCs, the i2c_ccgr[] array must be sized by the number of initializers present, not with a hard-coded 6 which would implicitly initialize the last two elements with zeroes. Also, the bounds check is off-by-one. Fixes: c92c3a4453b8 "ARM: imx: imx8mp: Enable support for i2c5 and i2c6 on i.MX8MP" Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2023-03-30compulab: imx8mm-cl-iot-gate: Fix some function declarations in ddr.hYing-Chun Liu (PaulLiu)1-2/+2
We have a few places here that the function declarations do not match their prototypes, correct them. Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org> Cc: Tom Rini <trini@konsulko.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reported-by: Tom Rini <trini@konsulko.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2023-03-30net: fec_mxc: Add board_interface_eth_init() for i.MX8M Mini/Nano/PlusMarek Vasut3-0/+52
Implement common board_interface_eth_init() and call it from the FEC driver to configure IOMUXC GPR[1] register according to the PHY mode obtained from DT. This supports all three interface modes supported by the i.MX8M Mini/Nano/Plus FEC and supersedes the current board-side configuration of the same IOMUX GPR[1] duplicated in the board files. Signed-off-by: Marek Vasut <marex@denx.de>
2023-03-30net: fec_mxc: Add ref clock setup support for i.MX8M Mini/Nano/PlusMarek Vasut1-0/+32
The FEC ref clock frequency on i.MX8M Mini/Nano/Plus was so far configured via ad-hoc board code. Replace that with DM clock clk_set_rate() instead. This way, the driver claims all its required clock and sets the ref clock rate, without any need of architecture specific register fiddling. Signed-off-by: Marek Vasut <marex@denx.de>
2023-03-30net: dwc_eth_qos: Add board_interface_eth_init() for i.MX8M PlusMarek Vasut3-2/+69
Implement common board_interface_eth_init() and call it from the DWMAC driver to configure IOMUXC GPR[1] register according to the PHY mode obtained from DT. This supports all three interface modes supported by the i.MX8M Plus DWMAC and supersedes current board-side configuration of the same IOMUX GPR[1] duplicated in the board files. Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de>
2023-03-30net: dwc_eth_qos: Add i.MX8M Plus RMII supportMarek Vasut1-11/+18
With DM clock support in place, it is easy to add RMII support into the MAC driver. The RMII cannot operate at 1000 Mbps and at 100 and 10 Mbps the clock frequency is 50 MHz and 5 MHz instead of 25 MHz and 2.5 MHz. The board DT requires the following adjustments to EQoS node: phy-mode = "rmii"; assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_266M>, <&clk IMX8MP_SYS_PLL2_100M>, <&clk IMX8MP_SYS_PLL2_50M>; assigned-clock-rates = <0>, <100000000>, <50000000>; Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Marek Vasut <marex@denx.de>
2023-03-30net: dwc_eth_qos: Add DM CLK support for i.MX8M PlusMarek Vasut2-51/+121
The DWMAC clock in i.MX8M Plus were so far configured via ad-hoc architecture code. Replace that with DM clock instead. This way, the driver claims all its required clock, enables and disables them, and even gets the CSR clock rate and sets the TX clock rate, without any need of architecture specific register fiddling. Drop the architecture specific code while at it too. The adjustment here is modeled after STM32MP15xx clock handling in this driver. Signed-off-by: Marek Vasut <marex@denx.de>