summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-07spi: zynqmp_qspi: Mark zynqmp_qspi_set_tapdelay() as staticVenkatesh Yadav Abbarapu
Fix the following sparse and compile time warning triggered with W=1: drivers/spi/zynqmp_gqspi.c:286:6: warning: no previous prototype for 'zynqmp_qspi_set_tapdelay' [-Wmissing-prototypes] Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20221004053730.25602-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-07arm64: zynqmp: Fix compiler warnings in mp.cVenkatesh Yadav Abbarapu
make W=1 generates the following warning in cpu_disable, cpu_status and cpu_release functions. arch/arm/mach-zynqmp/mp.c:166:16: warning: comparison of unsigned expression in '>= 0' is always true [-Wtype-limits] 166 | if (nr >= ZYNQMP_CORE_APU0 && nr <= ZYNQMP_CORE_APU3) { | ^~ Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20221004053454.25470-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-05arm64: dts: Remove unused property device_idAshok Reddy Soma
Device tree property "xlnx,device_id" is not used anymore, remove it. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Link: https://lore.kernel.org/r/20220930092548.18453-4-ashok.reddy.soma@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-05mmc: zynq_sdhci: Read power-domains id from DT and useAshok Reddy Soma
Firmware calls need node_id which is basically "power-domains" id. At present static values are used based on the "device_id" property of dt. Instead of this, read "power-domains" id from dt and use it. Add a element called node_id in priv structure and read it from dt. Replace static node_id with this priv->node_id across the driver. Since "device_id" is not used anywhere else simply remove it. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Link: https://lore.kernel.org/r/20220930092548.18453-3-ashok.reddy.soma@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-05mmc: zynq_sdhci: Change node_id prototype to u32Ashok Reddy Soma
In Versal platform power domain node_id is bigger than u8, hence change prototype to u32 to accommodate. Change u8 to u32 in the function prototypes that use node_id and remove casting to u32 from xilinx_pm_request() call parameters. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Link: https://lore.kernel.org/r/20220930092548.18453-2-ashok.reddy.soma@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-05net: Fix static checker warningsVenkatesh Yadav Abbarapu
Here are the smatch warning messages: drivers/net/xilinx_axi_emac.c:324 axiemac_phy_init() error: 'phydev' dereferencing possible ERR_PTR() drivers/net/zynq_gem.c:340 zynq_phy_init() error: 'priv->phydev' dereferencing possible ERR_PTR() Fix by adding error checking before dereferencing the pointer. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20220929045605.23964-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-05xilinx: common: Fix static checker warningsVenkatesh Yadav Abbarapu
Avoid signed extension for uuid and byte. Eliminate the below smatch warnings: board/xilinx/common/board.c:128 xilinx_eeprom_legacy_cleanup() warn: impossible condition '(byte == 255) => ((-128)-127 == 255)' board/xilinx/common/board.c:466 board_late_init_xilinx() warn: argument 3 to %02x specifier has type 'char' board/xilinx/common/board.c:466 board_late_init_xilinx() warn: argument 4 to %02x specifier has type 'char' Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20220926065242.4355-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-05net: emaclite: fix handling for IP packets with specific lengthsSamuel Obuch
The maximum length is capped similarly to the emaclite_send function. Avoid integer underflow for values of ip->ip_len < 30, the minimum length of an IP packet is 21 bytes. Signed-off-by: Samuel Obuch <samuel.obuch@codasip.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Link: https://lore.kernel.org/r/20220927112103.155689-3-samuel.obuch@codasip.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-05net: emaclite: fix xemaclite_alignedread/write functionsSamuel Obuch
Use __raw_read* and __raw_write* functions to ensure read/write is passed to the memory-mapped regions, as non-volatile accesses may get optimised out. Signed-off-by: Samuel Obuch <samuel.obuch@codasip.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Link: https://lore.kernel.org/r/20220927112103.155689-2-samuel.obuch@codasip.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-05net: emaclite: enable for more architecturesSamuel Obuch
Function ioremap_nocache seems to be defined only for MIPS and Microblaze architectures. Therefore, the function call in the emaclite driver causes this driver to be unusable with other architectures, for example RISC-V. Use ioremap function instead of ioremap_nocache, and include linux/io.h instead of asm/io.h, so that ioremap function is automatically created, if not defined by the architecture. We can switch to the ioremap function, as Microblaze's ioremap_nocache is just empty and in MIPS implementations of ioremap_nocache and ioremap are the same. Signed-off-by: Samuel Obuch <samuel.obuch@codasip.com> Link: https://lore.kernel.org/r/20220927112103.155689-1-samuel.obuch@codasip.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-05firmware: zynqmp: Change loadable config object from APU_0 to OCM_BANK_0Ashok Reddy Soma
To check dynamic loading of config object, currently APU_0 is used. Suggestion from pmwfw team is to load OCM_BANK_0 and check for XST_PM_NO_ACCESS error only to skip future config objects. Other errors should not be considered for skipping. Change from NODE_APU_0 to NODE_OCM_BANK_0 and check for XST_PM_NO_ACCESS to skip future config objects. Add ": " to printf statement when there is no permission to load config object, to align with PMUFW version print. Update kernel doc for return value for zynqmp_pmufw_load_config_object(). Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/2784018844ba4afced0e3edff76bdbfe532f517d.1664523444.git.michal.simek@amd.com
2022-10-05ARM: zynq: Define rtc alias on zc702/zc706Michal Simek
Define rtc alias on zc702/zc706 boards. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/47df614929d49af9f562c103defb92900de9d3e1.1664279424.git.michal.simek@amd.com
2022-10-05ARM: zynq: Point via nvmem0 alias to eeprom on zc702/zc706Michal Simek
EEPROM stores identification information about board like a board name, revision, serial number and ethernet MAC address. U-Boot is capable to read nvmemX aliases and read/display provided information when nvmem alias link is described. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/c63bba87d0400b6bd0f5651fac21d525f12288f5.1664265311.git.michal.simek@amd.com
2022-10-05xilinx: zynq: Enable early eeprom decodingMichal Simek
Xilinx Zynq evaluation boards have factory program content in eeprom. Enable reading and decoding eeprom content to get information about board name, revision and especially getting ethernet mac address. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/db334bd3c0a377074a43b7ae479fade98efb545f.1664265344.git.michal.simek@amd.com
2022-10-05dm: fpga: Introduce new uclassAlexander Dahl
For future DM based FPGA drivers and for now to have a meaningful logging class for old FPGA drivers. Suggested-by: Michal Simek <michal.simek@amd.com> Suggested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Dahl <post@lespocky.de> Reviewed-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/r/20220930120430.42307-2-post@lespocky.de Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-10-03Merge branch 'next'Tom Rini
2022-10-03Prepare v2022.10v2022.10Tom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-10-03imx8mn-ddr4-evk-u-boot: Fix broken bootFabio Estevam
When the imx8mn.dtsi file was pulled in from Linux, the UARTs were moved into an spba sub-node which wasn't being included in the SPL device tree. This meant the references to the UART weren't being handled properly and when booting the system would constantly reboot. Fix this by adding the spba node to the spl device tree to restore normal booting. Based on the patch from Adam Ford for the imx8mn-beacon-kit-u-boot board. Fixes: 4e5114daf9eb ("imx8mn: synchronise device tree with linux") Signed-off-by: Fabio Estevam <festevam@denx.de>
2022-10-03imx8mn-venice-u-boot: Fix broken bootFabio Estevam
When the imx8mn.dtsi file was pulled in from Linux, the UARTs were moved into an spba sub-node which wasn't being included in the SPL device tree. This meant the references to the UART weren't being handled properly and when booting the system would constantly reboot. Fix this by adding the spba node to the spl device tree to restore normal booting. Based on the patch from Adam Ford for the imx8mn-beacon-kit-u-boot board. Fixes: 4e5114daf9eb ("imx8mn: synchronise device tree with linux") Signed-off-by: Fabio Estevam <festevam@denx.de>
2022-09-30Merge branch '2022-09-29-dm-core-support-multiple-device-trees-in-ofnode' ↵Tom Rini
into next To quote the author: At present the ofnode interface is somewhat limited, in that it cannot access the device tree provided by the OS, only the one used by U-Boot itself (assuming these are separate). This prevents using ofnode functions to handle device tree fixups, i.e. ft_board_setup() and the like. The ofnode interface was introduced to allow a consistent API to access the device tree, whether a flat tree or a live tree (OF_LIVE) is in use. With the flat tree, adding nodes and properties at the start of the tree (as often happens when writing to the /chosen node) requires copying a lot of data for each operation. With live tree, such operations are quite a bit faster, since there is no memory copying required. This has to be weighed against the required memory allocation with OF_LIVE, as well as the cost of unflattening and flattening the device tree which U-Boot is running. This series enables support for access to multiple device trees with the ofnode interface. This is already available to some extent with OF_LIVE, but some of the ofnode functions need changes to allow the tree to be specified. The mechanism works by using the top 1-4 bits of the device tree offset. The sign bit is not affected, since negative values must be supported. With this implemented, it becomes possible to use the ofnode interface to do device tree fixups. The only current user is the EVT_FT_FIXUP event. This has two main benefits: - ofnode can now be used everywhere, in preference to the libfdt calls - live tree can eventually be used everywhere, with potential speed improvements when larger number of fixups are used This series is only a step along the way. Firstly, while it is possible to access the 'fix-up' tree using OF_LIVE, most of the fixup functions use flat tree directly, rather than the ofnode interface. These need to be updated. Also the tree must be flattened again before it is passed to the OS. This is not currently implemented. With OFNODE_MULTI_TREE disabled this has almost no effect on code size: around 4 bytes if EVENT is enabled, 0 if not. With the feature enabled, the increase is around 700 bytes, e.g. on venice2: $ buildman -b ofn2a venice2 -sS --step 0 Summary of 2 commits for 1 boards (1 thread, 64 jobs per thread) 01: image: Drop some other #ifdefs in image-board.c arm: w+ venice2 48: wip arm: (for 1/1 boards) all +668.0 text +668.0 This size increase is not too bad, considering the extra functionality, but is too large to enable everywhere. So for now this features needs to be opt-in only, based on EVENT.
2022-09-30Merge tag 'efi-2022-10-rc6' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-10-rc6 Documentation: * doc: improve description of autostart UEFI: * prefix test functions with efi_st_ in the LoadImage unit test * avoid a warning message in efi_initrd_deregister()
2022-09-29dm: core: Support copying properties with ofnodeSimon Glass
Add a function to copy properties from one node to another. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Allow copying ofnode property data when writingSimon Glass
At present ofnode_write_prop() is inconsistent between livetree and flattree, in that livetree requires the caller to ensure the property value is stable (e.g. in rodata or allocated) but flattree does not, since it makes a copy. This makes the API call a bit painful to use, since the caller must do different things depending on OF_LIVE. Add a new 'copy' argument which tells the function to make a copy if needed. Add some tests to cover this behaviour. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29vbe: Allow test to run with live/flat treeSimon Glass
This test can operate in all conditions now. Update the test and comments. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Expand ofnode testsSimon Glass
The current tests do not cover all functions, nor do they cover the new multi-tree functionality. Add and update the tests accordingly and update the 'future work' notes in the documentation. There is a still more testing needed for the failure cases, since at present some ofnode functions return a libfdt error code instead of converting it to an errno. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Create a function to get a live tree in a testSimon Glass
Move this logic out of the test into separate functions, so we can use it in other tests. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Update comments for default-FDT ofnode functionsSimon Glass
Some ofnode functions can only operate on the default device tree, i.e. U-Boot's control FDT. Add comments to that effect. Fix up the reference to device tree bindings while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Complete phandle implementation using the other FDTSimon Glass
We need to be able to look up phandles in any FDT, not just the control FDT. Use the 'other' FDT to test this, with a helper function which gets this as an oftree that can then we used as needed. Add a few more tests and some comments at the top of the file, to explain what is going on. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Add the ofnode multi-tree implementationSimon Glass
Add the logic to redirect requests for the device tree through a function which can look up the tree ID. This works by using the top bits of ofnode.of_offset to encode a tree. It is assumed that there will only be a few device trees used at runtime, typically the control FDT (always tree ID 0) and possibly a separate FDT to be passed the OS. The maximum number of device trees supported at runtime is 8, with this implementation. That would use bits 30:28 of the node-offset value, meaning that the positive offset range is limited to bits 27:0, versus 30:1 with this feature disabled. That still allows a device tree of up to 256MB, which should be enough for most FITs. Larger ones can be supported by using external data with the FIT, or by enabling OF_LIVE. Update the documentation a little and fix up the comment for ofnode_valid(). Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Add definitions for multiple ofnode treesSimon Glass
At present, unless OF_LIVE is enabled, ofnode only supports access to one device tree, the control FDT. This is because only the node offset is encoded in ofnode, with the tree being implicit. This makes ofnode (without OF_LIVE) unsuitable for device tree fixups, as implemented by ft_board_setup() and other such functions. To solve this, we can use the top bits of the node offset to hold a tree ID. Add the definitions for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Split ofnode_path_root() into two functionsSimon Glass
This function turns out to be a little confusing since it looks up a path and also registers the tree. Split it into two, one that gets the root node and one that looks up a path, so the purpose is clear. Registering the tree will happen in a function to be added in a later patch, called oftree_from_fdt(). Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Allow obtaining a node offset in the same treeSimon Glass
In some cases we want to obtain an ofnode in the same tree as a different ofnode, such as when looking up a subnode. At present this is trivial, since there is only one tree. When there are multiple trees, this implementation will change. Also move the ofnode_to_offset() function up higher in the header file, since we will need to provide a different implementation with multiple trees. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Add a way to look up a phandle in an oftreeSimon Glass
When we have multiple trees, the ofnode logic needs to be told which one to use. Create a new function which takes an oftree argument, along with a helper to obtain the FDT pointer from an oftree. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Add ofnode functions to obtain an oftreeSimon Glass
At present dm_test_ofnode_root() does this manually. Add some inline functions to handle it, so this code can be centralised. Add oftree functions to produce a null tree and to check whether a tree is valid or not. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Add an ofnode function to obtain the flat treeSimon Glass
The flat device tree is assumed to be the control FDT but this is not always the case. Update the ofnode implementation to obtain the node via an function call so we can eventually add support for selecting different trees. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Provide a way to reset the device treeSimon Glass
At present there is only one device tree used by the ofnode functions, except for some esoteric use of live tree. In preparation for supporting more than one, add a way to reset the list of device trees. For now this does nothing. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Expand integer-reading testsSimon Glass
The current tests do not cover all the behaviour. Add some more. Tidy up a few inconsistencies between livetree and flattree which come to light with these tests. Also drop the -ENODATA error since it is never actually returned. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-30efi_loader: fix efi_initrd_deregister()Heinrich Schuchardt
Don't try to delete a non-existent handle. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-09-30efi_selftest: prefix test functions with efi_st_Heinrich Schuchardt
An upcoming patch set creates a global function flush(). To make debugging easier we should not use the same name for a static function. Rename static functions in the LoadImage() unit test adding an efi_st_ prefix. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-09-30doc: improve description of autostartHeinrich Schuchardt
Complete the list of commands influenced by the autostart environment variable. Make it clearer what values qualifies at 'yes'. Eventually the list of environment variables is to be alphabetically sorted. Move autostart up. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Drop ofnode_is_available()Simon Glass
This function is also available as ofnode_is_enabled(), so use that instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Add a macro to iterate through propertiesSimon Glass
Add a 'for_each' macro like we have for nodes. Fix the comment for struct ofprop while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Avoid creating a name property when unflatteningSimon Glass
The current implementation creates a 'name' value for every node. This is not needed for the latest device tree format, which includes a name in the node header. Adjust the code to point the name at the node header instead. Also simplify ofnode_get_name(), now that we can rely on it to set the name correctly. Update the comment to make it clear what name the root node has. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Rename ofnode_get_property_by_prop()Simon Glass
The current name is quite unwieldy. Change it to use an ofprop_ prefix and shorten it. Fix the return-value comment while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Rename ofnode_get_first/next_property()Simon Glass
Drop the 'get' in these names since it does not fit with the rest of the API. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29dm: core: Reduce code size with dev_of_offset()Simon Glass
Update the function to mark it with the const attribute. Also avoid calling it multiple times in the devfdt_get_addr_index() function. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29sandbox: test: Provide an easy way to use the other FDTSimon Glass
Add a test flag which indicates that the 'other' FDT should be set up ready for use. Handle this by copying in the FDT, unflattening it for livetree tests. Free the structures when the tests have run. We cannot use the other FDT unless we are using live tree or OFNODE_MULTI_TREE is enabled, since only one tree is supported by the ofnode interface in that case. Add this condition into ut_run_test_live_flat() and update the comments. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29sandbox: Support setting up the other FDT for testingSimon Glass
Provide a way to copy over the 'other' FDT when running tests. This loads it and allocates memory for the copy, if not done already, then does the copy. Avoid using U-Boot's malloc() pool for these copies, at least for now, since they are part of the test system. Tidy up the cpu.c header files while here. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29sandbox: Support loading the other FDTSimon Glass
We need an 'other' FDT which is different from the control FDT, so we can check that the ofnode tests correctly handle them both. Add this to the build along with a way to read it into the sandbox state. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29sandbox: Add a function to load a relative file pathSimon Glass
At present this implementation is specific to loading the test FDT. We plan to load others, so create a generic function to handle this. The path is now limited to 256 characters, to simplify the code. When there is an empty argv[0] (which should not happen), the function now just uses the path as is, with no prefix. Signed-off-by: Simon Glass <sjg@chromium.org>