aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* timer: orion-timer: Only init timer onceStefan Roese2022-10-061-5/+5
| | | | | | | | | | Move the code making sure that the timer is initialized only once into orion_timer_init(), which is called from timer_early_init() and from orion_timer_probe(). This way the timer is not re-initialized. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Michael Walle <michael@walle.cc> Cc: Pali Rohár <pali@kernel.org>
* mtd: nand: pxa3xx: simplify ECC hardware parametersChris Packham2022-10-061-179/+68
| | | | | | | | | | | | | Replace the if/else chain in pxa_ecc_init() with a lookup table. This makes the code more concise and hopefully easier to follow. Remove the unused ecc_layout tables and replace it with a single dummy one (the pxa3xx driver has never used this but the mtd subsystem expects it to be provided). Tested on an Allied Telesis x530 switch with Micron MT29F2G08ABAEAWP NAND Flash. Signed-off-by: Chris Packham <judge.packham@gmail.com>
* Merge branch 'next'WIP/03Oct2022Tom Rini2022-10-03189-1905/+10343
|\
| * dm: core: Support copying properties with ofnodeWIP/2022-09-29-dm-core-support-multiple-device-trees-in-ofnodeSimon Glass2022-09-291-0/+24
| | | | | | | | | | | | Add a function to copy properties from one node to another. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Allow copying ofnode property data when writingSimon Glass2022-09-291-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * dm: core: Complete phandle implementation using the other FDTSimon Glass2022-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
| * dm: core: Add the ofnode multi-tree implementationSimon Glass2022-09-291-4/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * dm: core: Add definitions for multiple ofnode treesSimon Glass2022-09-291-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * dm: core: Split ofnode_path_root() into two functionsSimon Glass2022-09-291-5/+37
| | | | | | | | | | | | | | | | | | | | | | 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>
| * dm: core: Allow obtaining a node offset in the same treeSimon Glass2022-09-291-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * dm: core: Add a way to look up a phandle in an oftreeSimon Glass2022-09-291-0/+14
| | | | | | | | | | | | | | | | 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>
| * dm: core: Add an ofnode function to obtain the flat treeSimon Glass2022-09-291-41/+50
| | | | | | | | | | | | | | | | | | 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>
| * dm: core: Expand integer-reading testsSimon Glass2022-09-292-7/+15
| | | | | | | | | | | | | | | | | | | | 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>
| * dm: core: Drop ofnode_is_available()Simon Glass2022-09-2916-26/+17
| | | | | | | | | | | | | | This function is also available as ofnode_is_enabled(), so use that instead. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Avoid creating a name property when unflatteningSimon Glass2022-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * dm: core: Rename ofnode_get_property_by_prop()Simon Glass2022-09-292-3/+3
| | | | | | | | | | | | | | 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>
| * dm: core: Rename ofnode_get_first/next_property()Simon Glass2022-09-292-4/+4
| | | | | | | | | | | | | | 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>
| * dm: core: Reduce code size with dev_of_offset()Simon Glass2022-09-291-9/+9
| | | | | | | | | | | | | | 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>
| * dm: core: Drop the const from ofnodeSimon Glass2022-09-291-2/+2
| | | | | | | | | | | | | | | | | | Now that we support writing to ofnodes, the const is not accurate. Drop it to avoid undesirable casting. Also drop the ofnode_to_npw() which is now the same as ofnode_to_np(). Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Support writing a property to an empty nodeSimon Glass2022-09-291-4/+4
| | | | | | | | | | | | At present this does not work with livetree. Fix it and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Allow adding ofnode subnodesSimon Glass2022-09-292-0/+98
| | | | | | | | | | | | | | | | Add this feature to the ofnode interface, supporting both livetree and flattree. If the node exists it is returned, along with a -EEXIST error. Update the functions it calls to handle this too. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: core: Pass a root node to of_find_node_by_phandle()Simon Glass2022-09-292-4/+5
| | | | | | | | | | | | | | | | | | | | This function currently assumes that the control FDT is used. Update it to allow a root node to be passed, so it can work with any tree. Also add a comment to ofnode_get_by_phandle() so that its purpose is clear. Signed-off-by: Simon Glass <sjg@chromium.org>
| * sandbox: power: Update PMIC driver to use logSimon Glass2022-09-291-4/+6
| | | | | | | | | | | | | | Use the log functions instead of pr_...() so we can avoid using __func__. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
| * treewide: Drop image_header_t typedefSimon Glass2022-09-292-3/+3
| | | | | | | | | | | | | | This is not needed and we should avoid typedefs. Use the struct instead and rename it to indicate that it really is a legacy struct. Signed-off-by: Simon Glass <sjg@chromium.org>
| * Merge tag 'xilinx-for-v2023.01-rc1-v2' of ↵WIP/26Sep2022-nextTom Rini2022-09-268-5/+10
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2023.01-rc1 (round 2) xilinx: - Add support for new Versal NET SOC zynqmp: - Use mdio bus for ethernet phy description - Wire ethernet phy reset via i2c-gpio versal: - Config cleanup
| | * reset: zynqmp: Enable reset driver for Versal NETJay Buddhabhatti2022-09-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Enable zynqmp reset driver for Versal NET. Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/c8c26618f87d8451c6ffa9487809a24718bff6a7.1663589964.git.michal.simek@amd.com
| | * mailbox: zynqmp: Enable ipi mailbox driver for Versal NETJay Buddhabhatti2022-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Enable mailbox configs for Versal NET. Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/b3a9a6a58b74d17e2ec5f60617fa42062fbab951.1663589964.git.michal.simek@amd.com
| | * firmware: zynqmp: Add Versal NET compatible stringJay Buddhabhatti2022-09-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add compatible string for Versal NET. Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/ec73f786e1c89094752ff3693f6f0fb4536c85c5.1663589964.git.michal.simek@amd.com
| | * clk: versal: Enable clock driver for Versal NETJay Buddhabhatti2022-09-262-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Add support for Versal NET compatible string in clock driver. Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/20a35d0c1ffcc222fbe93dd406cdd0aff92f5223.1663589964.git.michal.simek@amd.com
| | * spi: zynqmp_gqspi: Add support for Versal NETMichal Simek2022-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | Add support for Versal NET platform. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/f374e9a81f2d85de1240029f3ba5f6423cfa0680.1663589964.git.michal.simek@amd.com
| | * spi: cadence_qspi: Add support for Versal NET platformMichal Simek2022-09-262-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Trivial changes to support cadence ospi driver for Versal NET platform. Also avoid ospi flash reset for now. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/0789141f432189aab69bc496fe33e0218d1d7510.1663589964.git.michal.simek@amd.com
| * | Merge branch 'next' of https://gitlab.denx.de/u-boot/custodians/u-boot-riscv ↵Tom Rini2022-09-264-1025/+1
| |\ \ | | | | | | | | | | | | into next
| * | | sandbox: Convert to use driver model for SCSISimon Glass2022-09-251-3/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present sandbox is producing a warning about SCSI migration. Drop the legacy code and replace it with a new implementation. Also drop the SATA command, which does not work with driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: scsi: Move request-handling code to scsi_emulSimon Glass2022-09-253-77/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move this code into the emulator file so it can be used by multiple drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: scsi: Move structs to header fileSimon Glass2022-09-251-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move these to the SCSI header file so we can access them from multiple emulators. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: scsi: Remove setup calls from handle_read()Simon Glass2022-09-251-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | Move the device-specific code out into the top-level function. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: scsi: Move reply setup out of helperSimon Glass2022-09-251-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move this code out of the helper function so we can (later) add it as part of the shared emulation code. Set a default value of 0 for buff_used since that is what we use when there is an error. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: scsi: Move file size into shared structSimon Glass2022-09-251-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move this information into struct scsi_emul_info so we can use it in common code. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: scsi: Move block size into shared structSimon Glass2022-09-251-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move this information into struct scsi_emul_info so we can use it in common code. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | scsi: Move vendor/product info into the shared structSimon Glass2022-09-251-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move this information into struct scsi_emul_info so we can use it in common code. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: Move buffer to scsi_emul_infoSimon Glass2022-09-251-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the buffer into this struct so it can be shared between different implementations. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | scsi: Move core emulation state into a new structSimon Glass2022-09-251-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for sharing the emulation code between two drivers, move some of the fields into a new struct. Use a separate header file so it can be used by various drivers. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | scsi: Move cmd_phase enum to the headerSimon Glass2022-09-251-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be used by common files, so move it to the SCSI header and rename it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | sandbox: usb: Rename transfer_len in protocol structSimon Glass2022-09-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This has the same name as a field in our local private struct, which is confusing. Change the name to xfer_len instead. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | blk: Rename if_type to uclass_idSimon Glass2022-09-2512-128/+127
| | | | | | | | | | | | | | | | | | | | | | | | Use the word 'uclass' instead of 'if_type' to complete the conversion. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | | serial: Call flush() before changing baudratePali Rohár2022-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing baudrate is a sensitive operation. To ensure that U-Boot messages printed before changing baudrate are not lost, call new U-Boot console flush() function. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | serial: Implement serial_flush() function for console flush() fallbackPali Rohár2022-09-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like in all other console functions, implement also serial_flush() function as a fallback int console flush() function. Flush support is available only when config option CONSOLE_FLUSH_SUPPORT is enabled. So when it is disabled then provides just empty static inline function serial_flush(). Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | serial: Implement flush callbackPali Rohár2022-09-241-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UART drivers have putc/puts functions which just put characters into HW transmit queue and do not wait until all data are transmitted. Implement flush callback via serial driver's pending(false) callback which waits until HW transmit all characters from the queue. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | | ddr: fsl: Fix re-align of verbose DRAM information for non-SPL buildsPali Rohár2022-09-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During init_dram() is called also compute_lowest_common_dimm_parameters() function which prints multi-line detailed output. So print also re-aligning filler after "Detected ?DIMM" line to have "DRAM: " output aligned. Signed-off-by: Pali Rohár <pali@kernel.org>
| * | | ddr: fsl: Allow to detect 4 GB DDR modules in 32-bit modePali Rohár2022-09-231-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | U-Boot core code already handles the case when RAM size is bigger than CONFIG_MAX_MEM_MAPPED. So there is no need to do duplicate check in fsl ddr driver for CONFIG_MAX_MEM_MAPPED. Instead simplify code to just check if RAM size can be representable in phys_size_t type. And avoid printing warning if phys_size_t is just 1 byte smaller than RAM size, which is the typical situation with 4 GB DDR module. Signed-off-by: Pali Rohár <pali@kernel.org>