aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-07-21phy: sun4i: Add H616 USB PHY supportAndre Przywara2-1/+12
Now that the Allwinner USB PHY driver supports the H616 quirk, let's enable support for USB ports on that SoC. We connect the compatible string to a new struct describing the SoCs USB PHY properties, and unblock the PHY driver selection in Kconfig. A later patch will enable USB support in the H616 boards' defconfigs. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2023-07-21phy: sun4i-usb: Add H616 USB PHY quirk supportAndre Przywara1-0/+46
The H616 USB PHY is some kind of special snowflake: Only port2 works out of the box, but all other ports need some help from this port2 to work correctly: The CLK_BUS_PHY2 and RST_USB_PHY2 clock and reset need to be enabled, and the SIDDQ bit in the PMU PHY control register needs to be cleared. For this register to be accessible, CLK_BUS_ECHI2 needs to be ungated. Don't ask .... Follow the respective Linux patch (b45c6d80325b) and add a quirk bit, triggering the special sequence as outlined above, for PHYs other than PHY2: ungate this one special clock, and clear the SIDDQ bit. We also pick the clock and reset from PHY2 and enable them as well. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2023-07-21phy: sun4i-usb: Replace types with explicit quirk flagsAndre Przywara1-32/+9
So far we were assigning some crude "type" (SoC name, really) to each Allwinner USB PHY model, then guarding certain quirks based on this. This does not only look weird, but gets more or more cumbersome to maintain. Remove the bogus type names altogether, instead introduce flags for each quirk, and explicitly check for them. This improves readability, and simplifies future extensions. Port of Linux patch 8dd256bae653. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2023-07-21sunxi: Kconfig: rework PHY_USB_SUN4I selectionAndre Przywara3-12/+6
At the moment we use "select" in each Allwinner SoC's Kconfig section to include the USB PHY driver in the build. This means it cannot be disabled via Kconfig, although USB is not really a strictly required core functionality, and a particular board might not even include USB ports. Rework the Kconfig part by removing the "select" lines for each SoC's section, and instead letting it default to "y" in the PHY driver section itself. We use "depends on !" to exclude the few SoCs we don't support (yet). The Allwinner V3s does not enable USB (PHY) support at the moment, even though it should work: let the PHY default to "n" to keep the current behaviour. Also the MUSB USB driver directly calls some functions from the PHY driver, so let the former depend on the PHY driver. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Tested-by: Sam Edwards <CFSworks@gmail.com>
2023-07-21phy: sun4i-usb: add Allwinner F1C100s supportAndre Przywara1-0/+9
The Allwinner F1C100s implements a single USB PHY, connected to its MUSB OTG controller. The USB PHY is of the simpler, older type (like the A10), the only real difference is that it's indeed only one PHY. Add a struct describing those F1C100s USB PHY properties, and connect it to the new compatible string. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2023-07-21phy: sun4i-usb: Fix of_xlate() argument checkAndre Przywara1-1/+4
In its of_xlate() function, the Allwinner USB PHY driver compares the args_count variable against the number of implemented USB PHYs, although this is the *number of arguments* to the DT phandle property. Per the DT binding for this PHY device, this number is always one, so this check will always fail if the particular SoC implements exactly one USB PHY. So far this affected only the V3s (which has USB support disabled), but the F1C100s also sports one PHY only. Fix that check to compare args_count against exactly 1, and the args[0] content (requested PHY number) against the number of implemented PHYs. This fixes USB operation on the Allwinner V3s and allows to enable USB on the Allwinner F1C100s SoC. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2023-07-20binman: Reduce state.SetInt and bintool cmd to debug levelSimon Glass2-3/+3
These are not very important message. Change them to use the 'debug' level instead of 'detail'. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Support writing symbols inside a mkimage imageSimon Glass4-2/+127
Add support for writing symbols and determining the assumed position of binaries inside a mkimage image. This is useful as an example for other entry types which might want to do the same thing. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Support templates at any levelSimon Glass3-2/+63
Allow templates to be used inside a section, not just in the top-level /binman node. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Add a test for templating in a FITSimon Glass2-0/+44
Add this as a separate test case. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Support templating with multiple imagesSimon Glass3-2/+42
Allow a template to appear in the top level description when using multiple images. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Support simple templatesSimon Glass5-1/+165
Collections can used to collect the contents of other entries into a single entry, but they result in a single entry, with the original entries 'left behind' in their old place. It is useful to be able to specific a set of entries ones and have it used in multiple images, or parts of an image. Implement this mechanism. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20dtoc: Allow inserting a list of nodes into anotherSimon Glass3-1/+74
Provide a way to specify a phandle list of nodes which are to be inserted into an existing node. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20dtoc: Support copying the contents of a node into anotherSimon Glass3-3/+266
This permits implementation of a simple templating system, where a node can be reused as a base for others. For now this adds new subnodes after any existing ones. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Correct handling of zero bss sizeSimon Glass10-4/+69
Fix the check for the __bss_size symbol, since it may be 0. Unfortunately there was no test coverage for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Drop __bss_size variable in bss_data.cSimon Glass1-2/+1
This is not needed since the linker script sets it up. Drop the variable to avoid confusion. Fix the prototype for main() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Provide a way to specify the fdt-list directlySimon Glass4-0/+85
Sometimes multiple boards are built with binman and it is useful to specify a different FDT list for each. At present this is not possible without providing multiple values of the of-list entryarg (which is not supported in the U-Boot build system). Allow a fit,fdt-list-val string-list property to be used instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Convert mkimage to Entry_sectionMarek Vasut4-80/+130
This is needed to handle mkimage with inner section located itself in a section. Signed-off-by: Marek Vasut <marex@denx.de> Use BuildSectionData() instead of ObtainContents(), add tests and a few other minor fixes: Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Add more detail on how ObtainContents() worksSimon Glass2-1/+34
This area of binman can be a bit confusing. Add some more comments to help. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Update elf to return number of written symbolsSimon Glass2-5/+16
Update the LookupAndWriteSymbols() function to return the number of symbols written. Also add some logging for when debugging is not enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20stm32mp15: Avoid writing symbols in SPLSimon Glass1-0/+1
These boards use SPL in a mkimage entry and apparently access the symbol containing the image position of U-Boot, but put U-Boot in another image. This means that binman is unable to fill in the symbol correctly in the SPL binary. This doesn't matter at present since mkimage doesn't support symbol writing. But with the upcoming conversion to a section, it will. So add a property to disable symbol writing. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Allow disabling symbol writingSimon Glass5-5/+64
Some boards don't use symbol writing but do access the symbols in SPL. Provide an option to work around this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Read _multiple_data_files in the correct placeSimon Glass1-1/+2
Move this to the ReadEntries() function where it belongs. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Use GetEntries() to obtain section contentsSimon Glass1-9/+9
Some section types don't have a simple _entries list. Use the GetEntries() method in GetEntryContents() and other places to handle this. This makes the behaviour more consistent. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20binman: Init align_default in entry_SectionSimon Glass1-0/+1
This should be set up in the init function, to avoid a warning about a property not set up there. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-20tools: Fix package discovery in pyproject.toml of u_boot_pylib.Maxim Cournoyer1-0/+4
When building from source, setuptools would complain about not finding package via its auto-discovery mechanism. Manually specify how to locate the files, relative to the package's directory. * tools/u_boot_pylib/pyproject.toml: New tool.setuptools.packages.find section. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20tools: Fix README file in pyproject.toml of u_boot_pylib.Maxim Cournoyer1-1/+1
* tools/u_boot_pylib/pyproject.toml (readme): Replace README.md with README.rst. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20bootstd: USB devtype detection for script bootJohn Clark1-1/+4
Change the device type from "usb_mass_storage" to "usb" when booting a script. Before this change: => printenv devtype devtype=usb_mass_storage After this change: => printenv devtype devtype=usb Signed-off-by: John Clark <inindev@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20cmd: fix loads, saves on sandboxHeinrich Schuchardt1-4/+12
The loads and saves commands crash on the sandbox due to illegal memory access. For command line arguments the sandbox uses a virtual address space which does not equal the addresses of the memory allocated with memmap(). Add the missing address translations for the loads and saves commands. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20sandbox: fix a compilation errorSergei Antonov3-25/+24
With sandbox and sandbox64 configurations: In file included from .../u-boot/include/test/test.h:156, from .../u-boot/include/test/lib.h:9, from .../u-boot/test/lib/test_crc8.c:8: .../u-boot/arch/sandbox/include/asm/test.h: In function ‘sandbox_sdl_set_bpp’: .../u-boot/arch/sandbox/include/asm/test.h:323:17: error: ‘ENOSYS’ undeclared (first use in this function) 323 | return -ENOSYS; | ^~~~~~ Per Tom Rini's suggestion: move that function prototype over to arch/sandbox/include/asm/sdl.h and make test/dm/video.c include <asm/sdl.h> Cc: Simon Glass <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Sergei Antonov <saproj@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20core: read: fix dev_read_addr_size()John Keeping3-13/+6
The behaviour of dev_read_addr_size() is surprising as it does not handle #address-cells and #size-cells but instead hardcodes the values based on sizeof(fdt_addr_t). This is different from dev_read_addr_size_index() and dev_read_addr_size_name() both of which do read the cell sizes from the device tree. Since dev_read_addr_size() is only used by a single driver and this driver is broken when CONFIG_FDT_64BIT does not match the address size in the device tree, fix the function to behave like all of the other similarly named functions. Drop the property name argument as the only caller passes "reg" and this is the expected property name matching the other similarly named functions. Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # chromebook_jerry Tested-by: Simon Glass <sjg@chromium.org> # chromebook_bob
2023-07-20dm: core: of_access: fix return value in of_property_match_stringEugen Hristev1-1/+4
of_property_match_string calls of_find_property to search for the string property. If the device node does not exist, of_find_property returns NULL, and of_property_match_string returns -EINVAL, which is correct. However, if the device node exists, but the property is not found, of_find_property still returns NULL, but it will place -FDT_ERR_NOTFOUND in the *lenp variable. of_property_match_string does not use the lenp parameter, thus this error case is being lost, and treated as if the node is NULL, and returns -EINVAL, which is incorrect. The callers of of_property_match_string treat the error differently if the return value is -EINVAL or -ENOENT, e.g. in dwc3 driver: ret = generic_phy_get_by_name(dev, "usb3-phy", &phy); if (!ret) { ret = generic_phy_init(&phy); if (ret) return ret; } else if (ret != -ENOENT && ret != -ENODATA) { debug("could not get phy (err %d)\n", ret); return ret; } else { phy.dev = NULL; } So the caller drivers will just consider the property missing if -ENOENT is returned, versus the case of -EINVAL, which means something else. To fix this situation, changed the code to call the of_find_property with the right third argument to catch this error code and treat it accordingly. Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
2023-07-20CI: Add automatic retry for test.py jobsWIP/2023-07-20-assorted-CI-updatesTom Rini2-0/+2
It is not uncommon for some of the QEMU-based jobs to fail not because of a code issue but rather because of a timing issue or similar problem that is out of our control. Make use of the keywords that Azure and GitLab provide so that we will automatically re-run these when they fail 2 times. If they fail that often it is likely we have found a real issue to investigate. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20Azure: Add excludes to the imx8_imx9 jobTom Rini1-1/+1
The job to build all imx8 and imx9 platforms is currently close to, or sometimes exceeding the allowed build time. Exclude some platforms that are already being built under their vendor-specific job as well to reduce the time. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20Azure: Rework our Rockchip jobs slightlyTom Rini1-4/+4
Currently the 64bit "rk" job is close to and sometimes goes over the job time limit. Let us rework this in to one job for "rk" and "rv" (which are the SoC prefixes) jobs which include or exclude "rockchip" the board vendor. This gives us two jobs of similar numbers of platforms to build now instead. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20CI: Update to the latest "Jammy" tagTom Rini3-3/+3
Move to the latest "Jammy" tag from Ubuntu. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20CI: Update to gcc-13.1.0Tom Rini4-32/+33
As this is the current version of the public cross toolchains we use, upgrade to this now. Suggested-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com> Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20buildman: Switch ARC toolchain to the upstream versionAlexey Brodkin3-9/+1
Back in the day we relied a lot on Synopsys own build of the GNU tools for ARC processors, but since then we worked hard on getting all our changes upstream and for a couple of years now we have ARCompact (AKA ARCv1) and ARCv2 processors supported very well in upstream GCC, Binutils, GDB etc. And so there's no need to use Synopsys forks any longer, thus we remove all the references to that form and use upstream components as majority of other architectures in U-Boot. Thanks to Tom for pointing to that left-over! Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20CI: Update to QEMU 8.0.3Tom Rini1-3/+2
Move up to the latest tagged release of QEMU Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-20tools/docker: Dockerfile: Don't specify dtc submoduleTom Rini1-1/+0
When building qemu, all required submodules (of which we need more than just dtc) are handled automatically. Currently trying to init the submodule the way we do results in a git failure. Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20spl: Correct spl_board_boot_device function prototypeTom Rini1-1/+2
With gcc-13.1 we get a warning about enum vs int here, so correct the declaration to match the implementation. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20arm: mx5: Correct mxc_set_clock function prototypeTom Rini1-1/+1
With gcc-13.1 we get a warning about enum vs int here, so correct the declaration to match the implementation. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-07-20mips: octeon: Correct types in cvmx-pko3-queueTom Rini2-6/+9
When building with gcc-13.1 we see that the prototype for cvmx_pko3_sq_config_children does not match the declaration. Make these match and correct a typo in the function's version of the docs that the prototype did not have, as part of keeping those in-sync. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-07-20Merge tag 'efi-2023-10-rc1-2' of ↵Tom Rini11-87/+69
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request efi-2023-10-rc1-2 UEFI: * test: avoid function name 'setup' in capsule tests to not treat it as a fixture * ensure that device paths for USB block devices are unique * enable having multiple EFI_LOADER block devices * use InstallMultipleProtocolInterfaces() in TCG protocol implementation to increase UEFI compliance
2023-07-20efi_loader: support all uclasses in device pathHeinrich Schuchardt2-31/+32
On devices with multiple USB mass storage devices errors like Path /../USB(0x0,0x0)/USB(0x1,0x0)/Ctrl(0x0) already installed. are seen. This is due to creating non-unique device paths. To uniquely identify devices we must provide path nodes for all devices on the path from the root device. Add support for generating device path nodes for all uclasses. Reported-by: Suniel Mahesh <sunil@amarulasolutions.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-07-20efi_loader: fix dp_fill() for BLKMAP, HOST, VIRTIOHeinrich Schuchardt1-9/+3
Do not assume that the preceding device path contains a single VenHW node. Instead use the return value of dp_fill() which provides the address of the next node. Fixes: 23ad52fff4da ("efi_loader: device_path: support Sandbox's "host" devices") Fixes: 19ecced71cfb ("efi_loader: device path for virtio block devices") Fixes: 272ec6b45304 ("efi_loader: device_path: support blkmap devices") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-07-20test: avoid function name 'setup'Heinrich Schuchardt5-24/+24
pytest 7.3.2 treats the function name 'setup' as a fixture [1]. This leads to errors like: TypeError: setup() missing 2 required positional arguments: 'disk_img' and 'osindications' Rename setup() to capsule_setup(). [1] How to run tests written for nose https://docs.pytest.org/en/7.3.x/how-to/nose.html Fixes: 482ef90aeb4c ("test: efi_capsule: refactor efi_capsule test") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-20efi_driver: fix duplicate efiblk#0 issueMasahisa Kojima1-4/+2
The devnum value of the blk_desc structure starts from 0, current efi_bl_create_block_device() function creates two "efiblk#0" devices for the cases that blk_find_max_devnum() returns -ENODEV and blk_find_max_devnum() returns 0(one device found in this case). This commit uses blk_next_free_devnum() instead of blk_find_max_devnum(). Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2023-07-20efi_loader: make efi_remove_protocol() staticIlias Apalodimas2-7/+3
A previous patch is removing the last consumer of efi_remove_protocol(). Switch that to static and treat it as an internal API in order to force users install and remove protocols with the appropriate EFI functions. It's worth noting that we still have files using efi_add_protocol(). We should convert all these to efi_install_multiple_protocol_interfaces() and treat efi_add_protocol() in a similar manner Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-07-20efi_loader: use efi_install_multiple_protocol_interfaces()Ilias Apalodimas1-4/+4
The TCG2 protocol currently adds and removes protocols with efi_(add/remove)_protocol(). Removing protocols with efi_remove_protocol() might prove problematic since it doesn't call DisconnectController() when uninstalling the protocol and does not comply with the UEFI specification. It's also beneficial for readability to have protocol installations and removals in pairs -- IOW when efi_install_multiple_protocol_interfaces() is called, efi_uninstall_multiple_protocol_interfaces() should be used to remove it. So let's swap the efi_add_protocol() as well. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>