summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'clk-2023.01' of https://source.denx.de/u-boot/custodians/u-boot-clkTom Rini2022-10-203-7/+23
|\ | | | | | | | | | | Clock patches for 2023.01 This contains various fixes (some long overdue) for the next release.
| * clk: update clk_clean_rate_cache to use private clk structPatrick Delaunay2022-10-191-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In clk_clean_rate_cache, clk->rate should update the private clock struct, in particular when CCF is activated, to save the cached rate value. When clk_get_parent_rate is called, the cached information is read from pclk->rate, with pclk = clk_get_parent(clk). As the cached is read from private clk data, the update should be done also on it. Fixes: 6b7fd3128f7 ("clk: fix set_rate to clean up cached rates for the hierarchy") Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220620153717.v2.1.Ifa06360115ffa3f3307372e6cdd98ec16759d6ba@changeid Link: https://lore.kernel.org/r/20220712142352.RESEND.v2.1.Ifa06360115ffa3f3307372e6cdd98ec16759d6ba@changeid/
| * rockchip: clk: pll: Fix constant typoMichal Suchanek2022-10-191-3/+3
| | | | | | | | | | | | Fixes: bbda2ed584 ("rockchip: clk: pll: add common pll setting funcs") Signed-off-by: Michal Suchanek <msuchanek@suse.de> Link: https://lore.kernel.org/r/20220928104129.13240-1-msuchanek@suse.de
| * clk: change return type of clk_get_parent_rate from long long to ulongMichal Suchanek2022-10-192-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All functions getting and setting clock rate use ulong for rate, only clk_get_parent_rate is an exception. Change the return value to match other clock rate funcrions. Most users directly assign the rate to unsigned long anyway, and the few users that use u64 (not s64) multiply the rate so they may need the extra bits for the result in their use case. Fixes: 4aa78300a0 ("dm: clk: Define clk_get_parent_rate() for clk operations") Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220928103757.11870-1-msuchanek@suse.de
* | Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiTom Rini2022-10-20230-1037/+657
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Beside some rather unexciting sync of the DTs from the kernel tree, and some Kconfig cleanup, there are some improvements for the ARMv5 Allwinner family, to support boards with the F1C200s (64MB DRAM) better. We will get actual board support as soon as the DTs have passed the Linux review process. There is also support for the X96 Mate TV Box, featuring the H616 SoC and a full 4GB of DRAM. Also we found the secret to enable SPI booting on the H616 (pin PC5 must be pulled to GND), so the SPI boot support patch is now good to go. Passed the gitlab CI, plus briefly tested on Pine64-LTS, LicheePi Nano, X96 Mate and OrangePi Zero.
| * | suniv: add UART1 supportAndre Przywara2022-10-192-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some boards with the Allwinner F1C100s family SoCs use UART1 for its debug UART, so define the pins for the SPL and the pinmux name and mux value for U-Boot proper. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
| * | suniv: move SKIP_LOWLEVEL_INIT_ONLY into KconfigAndre Przywara2022-10-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we stated the lack of a lowlevel() init function for the Allwinner F1C100s board by defining the respective SKIP_* symbol in the board's defconfig. However we don't expect any *board* to employ such low level code, so expect this to be never used for the ARMv5 Allwinner SoCs. Select the appropriate symbols in the Kconfig, so that we can remove them from the defconfig, and avoid putting them in future defconfigs for other boards. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
| * | sunxi: fix 32MB load address layoutAndre Przywara2022-10-191-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default load addresses for the various payloads (kernel, DT, ramdisk) on systems with just 32MB of DRAM have some issues: For a start the preceding comment doesn't match the actual values: apparently they were copied from the 64MB S3 layout, then halved, but since 0x5 is NOT the half of 0x10, they don't match up. Also those projected maximum sizes are quite restrictive: it's not easy to build a compressed kernel image with just 4MB. The only defconfig in mainline Linux that supports the F1C100s (the only 32MB user so far) creates a 6MB compressed / 15MB uncompressed kernel. Rearrange the default load addresses to accommodate such a kernel: we allow an 7MB/16MB kernel, and up to 5MB of ramdisk, stuffing the smaller binaries like the DTB towards the end, just before the relocated U-Boot. Shrink the size for DTB and scripts on the way, there is no need for allowing up to 512K for them. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
| * | sunxi: Kconfig: introduce SUNXI_MINIMUM_DRAM_MBAndre Przywara2022-10-194-19/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally we assumed that every Allwinner board would come with at least 256 MB of DRAM, and set our DRAM layout accordingly. This affected both the default load addresses, but also U-Boot's own address expectations (like being loaded at 160 MB). Some SoCs come with co-packaged DRAM, but only provide 32 or 64MB. So far we special-cased those *chips*, as there was only one chip per DRAM size. However new chips force us to take a more general approach. Introduce a Kconfig symbol, which provides the minimum DRAM size of the board. If nothing else is specified, we use 256 MB, and default to smaller values for those co-packaged SoCs. Then select the different DRAM maps according to this new symbol, so that different SoCs with the same DRAM size can share those definitions. Inspired by an idea from Icenowy. This is just refactoring: compiled for all boards before and after this patch: the binaries were identical. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
| * | configs: sunxi: licheepi_nano: enable D-CacheIcenowy Zheng2022-10-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | As the compile error when D-Cache is enabled is gone, we can have D-Cache enabled now. Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
| * | sunxi: fix SUNIV build when enabling D-CacheIcenowy Zheng2022-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The enable_caches function in architecture-specific board code is only necessary for V7A CPUs, code for both V8A and ARM926 have already declared this function. Only provide our implementation of enable_caches() for V7A CPUs. Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
| * | sunxi: defconfig: Add X96 Mate TV boxAndre Przywara2022-10-192-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The X96 Mate TV box is a TV box with the Allwinner H616 SoC. It is available with up to 4GB of DRAM and 64GB eMMC. The DRAM chips require a different configuration when compared to the OrangePi Zero2, we must not use read/write training and write leveling. Add a defconfig for the box, so that we can easily build U-Boot for it. We synced the .dts file already from the kernel tree. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
| * | sunxi: OrangePi Zero 2: Enable SPI bootingAndre Przywara2022-10-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OrangePi Zero 2 board comes with 2MB of SPI flash, from which the BROM is able to boot from. Please note that the fuse setup requires PC5 (BOOT_SEL3) to be pulled to GND for that to actually work. Enable the SPL code responsible for finding and loading U-Boot proper and friends, so that u-boot-sunxi-with-spl.bin can be written into the flash. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Ivan Shishkin <s45rus@gmail.com>
| * | sunxi: SPL SPI: Add SPI boot support for the Allwinner H616 SoCAndre Przywara2022-10-182-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The H616 SoC uses the same SPI IP as the H6, also shares the same clocks and reset bits. The only real difference is a slight change in the pin assignment: the H6 uses PC5, the H616 PC4 instead. This makes for a small change in our spi0_pinmux_setup() routine. Apart from that, just extend the H6 #ifdef guards to also cover the H616, using the shared CONFIG_SUN50I_GEN_H6 symbol. Also use this symbol for the Kconfig dependency. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Tested-by: Ivan Shishkin <s45rus@gmail.com>
| * | sunxi: defconfig: drop redundant definitionsAndre Przywara2022-10-18160-354/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When some configuration symbols were converted from header files to Kconfig, their values were placed into *every* defconfig file. Since we now have sensible per-SoC defaults defined in Kconfig, those values are now redundant, and can just be removed. This affects CONFIG_SPL_STACK, CONFIG_SYS_PBSIZE, CONFIG_SPL_MAX_SIZE, and CONFIG_SYS_BOOTM_LEN. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
| * | sunxi: Kconfig: use SoC-wide values for some symbolsAndre Przywara2022-10-182-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some configuration symbols formerly defined in header files were recently converted to Kconfig symbols. This moved their value definition into *every* defconfig file, even though those values are hardly board choices. Use the new Kconfig option to define per-SoC default values, in just one place, which makes the definition in each defconfig file redundant. We refrain from setting a sunxi specific value for CONFIG_SYS_BOOTM_LEN, so this defaults to a much better 64MB for uncompressed arm64 kernels. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * | sunxi: dts: arm: update devicetree filesAndre Przywara2022-10-1835-350/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the devicetree files from the Linux kernel, version v6.0-rc4. This is covering the 32-bit SoCs, from arch/arm/boot/dts/. This avoids the not backwards-compatible r_intc binding change, to allow older kernels to boot, but the other nodes are updated. Not much change here, the vast majority is actually cosmetic: node names and using symbolic names for the the RTC clocks. The R40 boards gain DVFS support. Some A23/A33 tablet DTs are unified into a single file. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
| * | sunxi: dts: arm64: update devicetree filesAndre Przywara2022-10-1824-288/+353
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the devicetree files from the Linux kernel, version v6.0-rc4. This is covering the 64-bit SoCs, from arch/arm64/boot/dts/allwinner. This avoids the not backwards-compatible r_intc binding change, to allow older kernels to boot, but the other nodes are updated. Not much change here, the vast majority is actually cosmetic: node names and using symbolic names for the the RTC clocks. Some A64 boards gain some audio nodes. The H616 DTs are now switched to the version finally merged into the kernel, which brings some changes, but none affecting U-Boot. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
* | | Merge branch '2022-10-18-TI-platform-updates'Tom Rini2022-10-1820-384/+410
|\ \ \ | | | | | | | | | | | | - Assorted fixes and improvements to some TI platforms
| * | | watchdog: omap_wdt: Switch required include for watchdog definesTom Rini2022-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the required values for using the omap_wdt.c driver are found in <asm/ti-common/omap_wdt.h> and this is what is indirectly pulled in via <asm/arch/hardware.h> when it exists. Signed-off-by: Tom Rini <trini@konsulko.com>
| * | | Nokia RX-51: Fix compilation with non-zero CONFIG_SYS_TEXT_BASEPali Rohár2022-10-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some unknown reason GNU assembler version 2.31.1 (arm-linux-gnueabi-as from Debian Buster) cannot compile following code from located in file board/nokia/rx51/lowlevel_init.S: kernoffs: .word KERNEL_OFFSET - (. - CONFIG_SYS_TEXT_BASE) when CONFIG_SYS_TEXT_BASE is set to 0x80008000. It throws strange compile error which is even without line number: AS board/nokia/rx51/lowlevel_init.o {standard input}: Assembler messages: {standard input}: Error: attempt to get value of unresolved symbol `L0' make[2]: *** [scripts/Makefile.build:293: board/nokia/rx51/lowlevel_init.o] Error 1 I have no idea about this error and my experiments showed that ARM GNU assembler is happy with negation of that number. So changing code to: kernoffs: .word . - CONFIG_SYS_TEXT_BASE - KERNEL_OFFSET and then replacing mathematical addition by substraction of "kernoffs" value (so calculation of address does not change) compiles assembler file without any error now. There should be not any functional change. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Tom Rini <trini@konsulko.com>
| * | | arm: mach-k3: Move hardware handling to common filesAndrew Davis2022-10-187-106/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These hardware register definitions are common for all K3, remove duplicate data them by moving them to hardware.h. While here do some minor whitespace cleanup + grouping. Signed-off-by: Andrew Davis <afd@ti.com>
| * | | arm: mach-k3: security: Use dma-mapping for cache opsAndrew Davis2022-10-181-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This matches how this would be done in Linux and these functions do the alignment for us which makes the code look cleaner. Signed-off-by: Andrew Davis <afd@ti.com>
| * | | dma: Transfer dma_ops should use DMA address typesAndrew Davis2022-10-185-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DMA operations should function on DMA addresses, not virtual addresses. Although these are usually the same in U-Boot, it is more correct to be explicit with our types here. Signed-off-by: Andrew Davis <afd@ti.com>
| * | | dma: ti-edma3: Add DMA map operations before and after transfersAndrew Davis2022-10-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should clean the caches before any DMA operation and clean+invalidate after. This matches what the DMA framework does for us already but adds it to the two functions here in this driver that don't yet go through the new DMA framework. Signed-off-by: Andrew Davis <afd@ti.com>
| * | | dma: Use dma-mapping for cache ops and sync after writeAndrew Davis2022-10-181-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The DMA'd memory area needs cleaned and invalidated after the DMA write so that any stale cache lines do not mask new data. Signed-off-by: Andrew Davis <afd@ti.com>
| * | | arm: mach-k3: common: Set boot_fit on non-GP devicesAndrew Davis2022-10-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This matches what we did for pre-K3 devices. This allows us to build boot commands that can check for our device type at runtime. Signed-off-by: Andrew Davis <afd@ti.com>
| * | | phy: ti: j721e-wiz: add j784s4-wiz-10g module supportMatt Ranostay2022-10-181-3/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for j784s4-wiz-10g device which has two core reference clocks (e.g core_ref_clk, core_ref1_clk) which requires an additional mux selection option. Signed-off-by: Matt Ranostay <mranostay@ti.com>
| * | | arm: dts: k3-am64-evm: EMIF tool update to v0.08.40 for 1600MT/s DDR4Dave Gerlach2022-10-181-60/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move to latest DDR4 1600MT/s for k3-am64-evm based on EMIF tool v0.08.40. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
| * | | arm: dts: k3-am64-sk: EMIF tool update to v0.08.40 and move to 1600MT/s LPDDR4Dave Gerlach2022-10-182-187/+186
|/ / / | | | | | | | | | | | | | | | | | | | | | Move k3-am64-sk to use 1600MT/s LPDDR4 configuration and update to latest EMIF tool v0.08.40. Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
* | | Merge tag 'dm-pull-18oct22' of ↵Tom Rini2022-10-1877-405/+904
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://source.denx.de/u-boot/custodians/u-boot-dm Update uclass iterators to work better when devices fail to probe Support VBE OS requests / fixups Minor error-handling tweaks to bootm command
| * | | vbe: Add a test for VBE device tree fixupsSimon Glass2022-10-177-3/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a FIT includes some OS requests, U-Boot should process these and add the requested info to corresponding subnodes of the /chosen node. Add a pytest for this, which sets up the FIT, runs bootm and then uses a C unit test to check that everything looks OK. The test needs to run on sandbox_flattree since we don't support device tree fixups on sandbox (live tree) yet. So enable BOOTMETH_VBE and disable bootflow_system(), since EFI is not supported on sandbox_flattree. Add a link to the initial documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | dm: core: Update docs about oftree_from_fdt()Simon Glass2022-10-172-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Update this function's comment and also the livetree documentation, so it is clear when to use the function. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | vbe: Add fixups for a basic set of OS requestsSimon Glass2022-10-173-1/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a starting point, add support for providing random data, if requested by the OS. Also add ASLR, as a placeholder for now. Signed-off-by: Simon Glass <sjg@chromium.org> (fixed up to use uclass_first_device_err() instead)
| * | | test: Move common FIT code into a separate fit_util fileSimon Glass2022-10-173-80/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid duplicating code, create a new fit_util module which provides various utility functions for FIT. Move this code out from the existing test_fit.py and refactor it with addition parameters. Fix up pylint warnings in the conversion. This involves no functional change. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | boot: Tidy up logging and naming in vbe_simpleSimon Glass2022-10-171-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure the log_msg_ret() values are unique so that the log trace is unambiguous with LOG_ERROR_RETURN. Also avoid reusing the 'node' variable for two different nodes in bootmeth_vbe_simple_ft_fixup(), since this is confusing. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | boot: Pass the correct FDT to the EVT_FT_FIXUP eventSimon Glass2022-10-171-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we support multiple device trees with the ofnode interface, we can pass the correct FDT to this event. This allows the 'working' FDT to be fixed up, as expected, so long as OFNODE_MULTI_TREE is enabled. Also make sure we don't try to do this with livetree, which does not support fixups yet. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: Support FDT fixupsSimon Glass2022-10-171-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for doing device tree fixups in sandbox. This allows us to test that functionality in CI. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | bootstd: Move VBE setup into a shared functionSimon Glass2022-10-173-30/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This information needs to be set up by the bootstd tests as well. Move it into a common function and ensure it is executed before any bootstd test is run. Make sure the 'images' parameter is set correctly for fixups. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | fdt: Show a message when the working FDT changesSimon Glass2022-10-173-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The working FDT is the one which comes from the OS and is fixed up by U-Boot. When the bootm command runs, it sets up the working FDT to be the one it is about to pass to the OS, so that fixups can happen. This seems like an important step, so add a message indicating that the working FDT has changed. This is shown during the running of the bootm command. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | fs: Quieten down the filesystems moreSimon Glass2022-10-174-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When looking for a filesystem on a partition we should do so quietly. At present if the filesystem is very small (e.g. 512 bytes) we get a host of messages. Update these to only show when debugging. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | boot: Correct handling of addresses in boot_relocate_fdt()Simon Glass2022-10-171-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This code uses casts between addresses and pointers, so does not work with sandbox. Update it so we can allow sandbox to do device tree fixups. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | bootm: Drop #ifdef from do_bootm()Simon Glass2022-10-171-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop the #ifdefs from this command by using a variable to hold the states that should be executed. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | bootm: Avoid returning error codes from commandSimon Glass2022-10-171-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functions which implement commands must return a CMD_RET_... error code. At present bootm can return a negative errno value in some cases, thus causing strange behaviour such as trying to exit the shell and printing usage information. Fix this by returning the correct value. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | bootm: Change incorrect 'unsupported' errorSimon Glass2022-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present when bootm fails, it says: subcommand not supported and then prints help for the bootm command. This is not very useful, since generally the error is related to something else, such as fixups failing. It is quite confusing to see this in a test run. Change the error and show the error code. We could update the OS functions to return -ENOSYS when they do not support the bootm subcommand. But this involves some thought since this is arch-specific code and proper errno error codes are not always returned. Also, with the code as is, all required subcommands are of course supported - a problem would only come if someone added a new one or removed support for one from an existing OS. Therefore it seems better to leave that sort of effort for when our bootm tests are improved. Note: v1 of this patch generated a discussion[1] about printing error strings automatically using printf(). That is outside the scope of this patch but will be dealt with separately. [1] https://patchwork.ozlabs.org/project/uboot/patch/20220909151801.336551-3-sjg@chromium.org/ Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | dm: core: Switch uclass_*_device_err to use uclass_*_device_checkMichal Suchanek2022-10-172-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The _err variant iterators use the simple iterators without suffix as basis. However, there is no user that uclass_next_device_err for iteration, many users of uclass_first_device_err use it to get the first and (assumed) only device of an uclass, and a couple that use uclass_next_device_err to get the device following a known device in the uclass list. While there are some truly singleton device classes in which more than one device cannot exist these are quite rare, and most classes can have multiple devices even if it is not the case on the SoC's EVB. In a later patch the simple iterators will be updated to not stop on error and return next device instead. With this in many cases the code that expects the first device or an error if it fails to probe may get the next device instead. Use the _check iterators as the basis of _err iterators to preserve the old behavior. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | dm: core: Switch uclass_foreach_dev_probe to use simple iteratorMichal Suchanek2022-10-172-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The return value is not used for anythig, and in a later patch the behavior of the _err iterator will change in an incompatible way. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Update pvblock_probe() to avoid using internal var: Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | mpc83xx: gazerbeam: Update sysinfo_get error handlingMichal Suchanek2022-10-171-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a later patch sysinfo_get will be changed to return the device in cae of an error. Set sysinfo to NULL on error to preserve previous behavior. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | net: eth-uclass: Do not set device on errorMichal Suchanek2022-10-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eth_get_dev relies on the broken behavior that returns an error but not the device on which the error happened which gives the caller no reasonable way to report or handle the error. In a later patch uclass_first_device_err will be changed to return the device on error but eth_get_dev stores the returned device pointer directly in a global state without checking the return value. Unset the pointer again in the error case. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | dm: blk: Do not use uclass_next_device_errMichal Suchanek2022-10-171-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blk_first_device_err/blk_next_device_err uses uclass_first_device_err/uclass_next_device_err for device iteration. Although the function names superficially match the return value from uclass_first_device_err/uclass_next_device_err is never used meaningfully, and uclass_first_device/uclass_next_device works equally well for this purpose. In the following patch the semantic of uclass_first_device_err/uclass_next_device_err will be changed to be based on uclass_first_device_check/uclass_next_device_check breaking this sole user that uses uclass_next_device_err for iteration. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>