summaryrefslogtreecommitdiff
path: root/drivers/pci
AgeCommit message (Collapse)Author
2025-08-17pci: pcie-rcar-gen4: Fix PHY initializationMarek Vasut
R-Car V4H Reference Manual R19UH0186EJ0130 Rev.1.30 Apr. 21, 2025 page 4581 Figure 104.3b Initial Setting of PCIEC(example) middle of the figure indicates that fourth write into register 0x148 [2:0] is 0x3 or GENMASK(1, 0). The current code writes GENMASK(11, 0) which is a typo. Fix the typo. Fixes: be3dd0dc2fd9 ("pci: pcie-rcar-gen4: Add Renesas R-Car Gen4 DW PCIe controller driver") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-07-14pci: Assign a default value on reads on errorAndrew Goodbody
Many callers of PCI read functions do not check the return value for error before using the variable that should contain the value read were there not to be an error. However in the error case this variable is never assigned to and so will contain uninitialised data. To provide some certainty as to behaviour in the error case assign a default value of all bits set. This issue found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-06-27pci: pcie-rcar-gen4: Add Renesas R-Car Gen4 DW PCIe controller driverMarek Vasut
Add R-Car Gen4 PCIe controller support for host mode. This controller is based on Synopsys DesignWare PCIe. However, this particular controller has a number of vendor-specific registers, and as such, requires initialization code, including PHY firmware loading. The PHY firmware loading is implemented in an entirely generic manner, by calling a firmware loading script, which the user can configure in a way they require. This provides the user with flexibility of loading the PCIe firmware from whichever storage device they need to load it from. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-06-27pci: pcie_dw_rockchip: Use dw_pcie_link_set_max_link_width()Marek Vasut
Use dw_pcie_link_set_max_link_width() instead of local implementation of the same functionality. This does change the behavior slightly, as the dw_pcie_link_set_max_link_width() implementation also programs the LNKCAP register MLW, this should however be correct and is now aligned with Linux kernel behavior. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-06-27pci: pcie_dw_qcom: Use dw_pcie_link_set_max_link_width()Marek Vasut
Use dw_pcie_link_set_max_link_width() instead of local implementation of the same functionality. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-06-27pci: pcie_dw_meson: Use dw_pcie_link_set_max_link_width()Marek Vasut
Use dw_pcie_link_set_max_link_width() instead of local implementation of the same functionality. This does change the behavior slightly, as the dw_pcie_link_set_max_link_width() implementation also programs the LNKCAP register MLW, this should however be correct and is now aligned with Linux kernel behavior. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-06-27drivers: pci: pcie_dw_common: Add dw_pcie_link_set_max_link_width()Marek Vasut
Add dw_pcie_link_set_max_link_width() implementation ported from Linux kernel as of commit 89db0793c9f2 ("PCI: dwc: Add missing PCI_EXP_LNKCAP_MLW handling"). This is common code which is already duplicated in multiple drivers. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-06-02pci: zynqmp: Fix the pcireg baseVenkatesh Yadav Abbarapu
The pcireg base is not assigned to any address, reading the pcireg base with PS_LINKUP_OFFSET which is incorrect and giving random values. So update the pcireg base from devicetree so that we can read the valid PCIE link status and PHY ready status. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Reviewed-by: Stefan Roese <sr@denx.de> Link: https://lore.kernel.org/r/20250516092314.939424-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-04-24Merge patch series "Add PCIe support for TI AM64 SoC"Tom Rini
Hrushikesh Salunke <h-salunke@ti.com> says: TI's AM64 SoC has a single instance of Cadence PCIe Controller. This series enables support for PCIe in AM64 SoC and to configure it in Root-Complex mode of operation. Link: https://lore.kernel.org/r/20250416120830.138965-1-h-salunke@ti.com
2025-04-24pci: pcie_cdns_ti: Enable PCIe root-complex mode in AM64 SoCHrushikesh Salunke
TI's AM64 SoC has single instance of PCIe Controller namely PCIe0 which is Cadence PCIe Controller. Add support to configure PCIe0 in Root- Complex mode of operation. Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com> Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
2025-04-24pci: pcie_cdns_ti: Include linux/sizes.h headerHrushikesh Salunke
Driver uses macro SZ_4G to configure inbound base address register. The macro is used without including the header file in which it is defined. Fix this. Fixes: 59ad5480098 ("pci: Add TI K3 Cadence PCIe Controller") Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com> Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
2025-04-22Merge patch series "MIPS: Boston: Various enhancements"Tom Rini
Jiaxun Yang <jiaxun.yang@flygoat.com> says: This is a huge series which promoted MIPS/Boston target into a usable state, with fixes to drivers and general framework issues I found in this process. I also converted the target to OF_UPSTREAM. This target is covered by QEMU, to test on QEMU: ``` make boston64r6el_defconfig make qemu-system-mips64el -M boston -cpu I6500 -bios ./u-boot.bin -nographic ``` Link: https://lore.kernel.org/r/20240517-boston-v3-0-1ea7d23f4a1d@flygoat.com
2025-04-22pci: Enable PCI_MAP_SYSTEM_MEMORY when ARCH_MAP_SYSMEM is not setJiaxun Yang
For MIPS we are always looking gd->dram in virtual address so PCI_MAP_SYSTEM_MEMORY should always be enabled. If in future we ever want to make it physical we have to set ARCH_MAP_SYSMEM. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2025-04-22pci: auto: Reduce bridge mem alignment boundary for bostonJiaxun Yang
Boston has a very limited memory range for PCI controllers, where 1MB can't easily fit into it. Make alignment boundary of PCI memory resource allocation a Kconfig option and default to 0x10000 for boston. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2025-04-22pci: xilinx: Handle size of ecam region properlyJiaxun Yang
Probe size of ecam from devicetree properly and cap accessible bus number accorading to ecam region size to ensure we don't go beyond hardware address space. Also disable all interrupts to ensure errors are handled silently. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2025-03-12pci_auto: Downgrade prefetch if necessaryPatrick Rudolph
Legacy PCI devices, like qemu's Bochs VGA device, are allowed to have prefetchable 32-bit BARs, while PCIe devices are not allowed to have 32-bit prefetchable BARs. Typically prefetchable BARs are 64-bit and typically the prefetch MMIO window is also 64-bit and placed above 4GiB, as it's the case on qemu sbsa-ref. Currently the U-Boot code assumes that prefetchable BARs are 64-bit BARs and always tries to assign them into the prefetch MMIO window. When a 32-bit BAR is marked as prefetch, but the prefetch area is not within the first 4GiB of the address space, then downgrade the BAR and place it in the non-prefetch MMIO window. For prefetch BARs there's no downside on being placed in non prefetch MMIO areas, besides the possible slower performance when a driver tries to map it Write-Combine. TEST: Fixes pci_auto on QEMU sbsa-ref fails to autoconfigure BAR0. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2025-01-23pci: mediatek: add support for multiple ports in mediatek pcie gen3 driverWeijie Gao
One MediaTek PCIe Gen3 controller has only one port, where PCI bus 0 on this port represents the controller itself and bus 1 represents the external PCIe device. If multiple PCIe controllers are probed in U-Boot, U-Boot will use bus numbers greater than 2 as input parameters. Therefore, we should convert the BDF bus number to either 0 or 1 by subtracting the offset by controller->seq_. Signed-off-by: Sam Shih <sam.shih@mediatek.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2025-01-22Merge patch series "upl: Prerequite patches for updated spec"Tom Rini
Simon Glass <sjg@chromium.org> says: The current UPL spec[1] has been tidied up and improved over the last year, since U-Boot's original UPL support was written. This series includes some prerequisite patches needed for the real UPL patches. It is split from [2] [1] https://github.com/UniversalPayload/spec/tree/3f1450d [2] https://patchwork.ozlabs.org/project/uboot/list/?series=438574&state=* Link: https://lore.kernel.org/r/20250111000029.245022-1-sjg@chromium.org
2025-01-22pci: video: Set up the pixel-format fieldSimon Glass
Add this information to the handoff structure so that it is available to U-Boot proper. Update bochs and the video handoff. Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-22pci: Add support for Qualcomm PCIe controllerNeil Armstrong
Add support for the PCIe busses on Qualcomm platforms, by using the pcie_dw_common infrastructure. The driver is based on the Linux driver but only supporting the "1_9_0" and compatible platforms like: - sa8540p - sc7280 - sc8180x - sc8280xp - sdm845 - sdx55 - sm8150 - sm8250 - sm8350 - sm8450 - sm8550 - sm8650 - x1e80100 But it has only been tested on: - sc7280 - sm8550 - sm8650 - x1e80100 It supports setting the IOMMU SID table for supported platforms. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20241125-topic-pcie-controller-v1-2-45c20070dd53@linaro.org Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-01-22pci: pcie_dw_common: introduce pcie_dw_find_capability()Neil Armstrong
Add PCIe config space capability search function specific for the host controller, which are bridges *to* PCI devices but are not PCI devices themselves. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20241125-topic-pcie-controller-v1-1-45c20070dd53@linaro.org Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-12-25Merge tag 'v2025.01-rc5' into nextTom Rini
Prepare v2025.01-rc5
2024-12-18pcie: starfive: Make the driver compatible with upstream DTHal Feng
There are difference between upstream DT and the old DT in terms of reg base, reset gpio and syscon. Make the driver compatible with upstream DT. Tested-by: Anand Moon <linux.amoon@gmail.com> Tested-by: E Shattow <lucent@gmail.com> Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
2024-12-11pci: renesas: Fix R-Car spellingMarek Vasut
The correct spelling is R-Car, including the dash, update the usage. Kconfig strings and comment changes only, no functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-10-27Merge patch series "Implement ACPI on aarch64"Tom Rini
Patrick Rudolph <patrick.rudolph@9elements.com> says: Based on the existing work done by Simon Glass this series adds support for booting aarch64 devices using ACPI only. As first target QEMU SBSA support is added, which relies on ACPI only to boot an OS. As secondary target the Raspberry Pi4 was used, which is broadly available and allows easy testing of the proposed solution. The series is split into ACPI cleanups and code movements, adding Arm specific ACPI tables and finally SoC and mainboard related changes to boot a Linux on the QEMU SBSA and RPi4. Currently only the mandatory ACPI tables are supported, allowing to boot into Linux without errors. The QEMU SBSA support is feature complete and provides the same functionality as the EDK2 implementation. The changes were tested on real hardware as well on QEMU v9.0: qemu-system-aarch64 -machine sbsa-ref -nographic -cpu cortex-a57 \ -pflash secure-world.rom \ -pflash unsecure-world.rom qemu-system-aarch64 -machine raspi4b -kernel u-boot.bin -cpu cortex-a72 \ -smp 4 -m 2G -drive file=raspbian.img,format=raw,index=0 \ -dtb bcm2711-rpi-4-b.dtb -nographic Tested against FWTS V24.03.00. Known issues: - The QEMU rpi4 support is currently limited as it doesn't emulate PCI, USB or ethernet devices! - The SMP bringup doesn't work on RPi4, but works in QEMU (Possibly cache related). - PCI on RPI4 isn't working on real hardware since the pcie_brcmstb Linux kernel module doesn't support ACPI yet. Link: https://lore.kernel.org/r/20241023132116.970117-1-patrick.rudolph@9elements.com
2024-10-27arm: mach-bcm283x: Bring in some header files from tianocoreSimon Glass
These header files presumably duplicate things already in the U-Boot devicetree. For now, bring them in to get the ASL code and ACPI table code to compile. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Matthias Brugger <mbrugger@suse.com> Cc: Matthias Brugger <mbrugger@suse.com> Cc: Peter Robinson <pbrobinson@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2024-10-21pci: Add TI K3 Cadence PCIe ControllerSiddharth Vadapalli
Add support for the Cadence PCIe Controller present on TI's K3 SoCs. This driver is an adaptation of the Linux driver. Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-10-11xpl: Rename spl_phase() to xpl_phase()Simon Glass
Rename this function to indicate that it refers to any xPL phase. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-27pci: mediatek: add support for upstream split PCIe nodeChristian Marangi
Add support for upstream linux split PCIe node. Upstream linux have an alternative way to declare PCIe nodes that splits them in dedicated nodes for each line instead of putting them all in one node. Detect this by checking if the mediatek,generic-pciecfg node is passed as it's used to reference the common address for all the PCIe lines. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-22drivers: pci: Remove duplicate newlinesMarek Vasut
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-07-08pci: mediatek: make pcie-phy optional for gen3Christian Marangi
Set pcie-phy optional for PCIe gen3. MT7988 doesn't require it and making it mandatory prevent the driver to correctly probe. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-07-08pci: mediatek: add PCIe controller support for filogic siliconJohn Crispin
Add MediaTek GEN3 PCIe controller support for filogic silicon. This is adapted from the Linux version of the driver. Signed-off-by: John Crispin <john@phrozen.org> [ fix minor problems, fix checkpatch errors ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-07pci: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-04-20pci: dw_imx: add support for IMX8MMTim Harvey
Add support for the IMX8MM SoC by adding driver data with the compatible string of the GPR controller. Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2024-03-24pcie_imx: Update header to describe it as a legacy driverSumit Garg
Since now we have the modern pcie_dw_imx.c driver for iMX SoCs, encourage people to switch to that for any further new iMX SoC support or even for the older iMX6 SoCs too. Suggested-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Marek Vasut <marex@denx.de>
2024-03-24pci: Add DW PCIe controller support for iMX8MP SoCSumit Garg
pcie_imx doesn't seem to share any useful code for iMX8 SoC and it is tied to quite old port of pcie_designware driver from Linux which suffices only iMX6 specific needs. But currently we have the common DWC specific bits which alligns pretty well with DW PCIe controller on iMX8MP SoC. So lets reuse those common bits instead as a new driver for iMX8 SoCs. It should be fairly easy to add support for other iMX8 variants to this driver. iMX8MP SoC also comes up with standalone PCIe PHY support, so hence we can reuse the generic PHY infrastructure to power on PCIe PHY. Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice* Tested-by: Adam Ford <aford173@gmail.com> #imx8mp-beacon-kit Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2024-03-02pci-host-ecam-generic: Convert to ofnode functionsMaksim Kiselev
FDT functions is not working when OF_LIVE is enabled. Convert fdt parsing functions to ofnode parsing functions Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
2024-01-18drivers: pci: Fix dm_pci_map_bar() to support 64b BARsMoritz Fischer
This enables 64b BARs if CONFIG_SYS_PCI_64BIT is enabled. Reviewed-by: Philip Oberfichtner <pro@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Moritz Fischer <moritzf@google.com>
2023-12-21global: Drop common.h inclusionTom Rini
In order to make it easier to move on to dropping common.h from code directly, remove common.h inclusion from the rest of the header file which had been including it. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2023-12-13pci: xilinx: Enable MMIO regionMayuresh Chitale
The host bridge MMIO region is disabled by default due to which MMIO accesses cause an exception. Fix it by setting the bridge enable bit. This change is ported from the linux pcie-xilinx driver. Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com> Reviewed-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/20231116165103.140968-3-mchitale@ventanamicro.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-12-13pci: xilinx: Fix "reg" not found errorMayuresh Chitale
Fix the driver to use the dev_read_addr_size API to fetch the reg property from the DT. Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com> Link: https://lore.kernel.org/r/20231116165103.140968-2-mchitale@ventanamicro.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2023-10-08Merge tag 'u-boot-rockchip-20231007' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-rockchip - Add Board: rk3568 Bananapi R2Pro; - Update pcie bifurcation support; - dwc_eth_qos controller support for rk3568 and rk3588; - Compressed binary support for U-Boot on rockchip platform; - dts and config updates for different board and soc; [ trini: Fix conflict on include/spl.h ] Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-07pci: pcie_dw_rockchip: Configure number of lanes and link width speedJonas Karlman
Set number of lanes and link width speed control register based on the num-lanes property. Code imported almost 1:1 from dw_pcie_setup in mainline linux. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-10-06pci: serial: Support reading PCI-register size with baseSimon Glass
The PCI helpers read only the base address for a PCI region. In some cases the size is needed as well, e.g. to pass along to a driver which needs to know the size of its register area. Update the functions to allow the size to be returned. For serial, record the information and provided it with the serial_info() call. A limitation still exists in that the size is not available when OF_LIVE is enabled, so take account of that in the tests. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-24common: Drop linux/printk.h from common headerSimon Glass
This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-30pci: pcie-brcmstb: do not rely on CLKREQ# signalSam Edwards
When the Broadcom STB PCIe controller is initialized, it must be set into one of three CLKREQ# modes: "none"/"aspm"/"l1ss". The Linux driver, through today, hard-codes "aspm" since the vast majority of boards using this driver have a fixed PCIe bus with the CLKREQ# signal wired up. The Raspberry Pi CM4, however, can be connected to a plethora of PCIe devices, some of which do not connect the CLKREQ# line (they just leave it floating). So "aspm" mode is no longer appropriate in all cases. In Linux, there is a proposed patchset [1] to determine the proper mode. This doesn't really make sense in U-Boot's case, so we just change the assumption from "aspm" to "none" (which is always safe). This patch DOES resolve a real-world crash that occurs when U-Boot is running on a Raspberry Pi CM4 installed in slot 3 of a Turing Pi 2 cluster board. [1]: https://lore.kernel.org/all/20230428223500.23337-1-jim2101024@gmail.com/ Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2023-08-30pci: pcie-brcmstb: bring over some robustness improvements from LinuxSam Edwards
Since the initial U-Boot driver was ported here from Linux, the latter has had a few changes for robustness/stability. This patch brings over two of them: - Do not attempt to access the configuration space of a PCIe device if the link has gone down, as that will result in an asynchronous SError interrupt which will crash U-Boot. - Wait for the recommended 100ms after PERST# is deasserted. I sent this patch while debugging a crash involving PCIe, but these are unrelated improvements. I do not believe that this patch fixes any real-world bug. Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2023-08-21Merge tag 'v2023.10-rc3' into nextTom Rini
Prepare v2023.10-rc3 Signed-off-by: Tom Rini <trini@konsulko.com>