Skip to contentSkip to conversation

PCI: Add power sequencing driver for PCI slots

PATCH Superseded Sean Anderson 2 participants 2 messages Jan 8 PCI

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 PCI: Add power sequencing driver for PCI slots

Extend the PCI bridge driver to enable resources associated with PCI slots like clocks, power rails, and resets. This is modeled off of the PCI power control subsystem in Linux. The traditional compatible for PCI slots in U-Boot is pci-bridge, but Linux uses the more-systematic pciclass,0604 so add that as an option.

---

Changes in v2:
- Return early if there's not PERST GPIO
- Only mdelay if we need to
- Use CONFIG_IS_ENABLED to set .probe directly

 drivers/pci/Kconfig      |  8 ++++++
 drivers/pci/pci-uclass.c | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
drivers/pci/Kconfig +8 -0
index ea9868425d0..efac18b33f6 100644
@@ -100,6 +100,14 @@ config PCI_ENHANCED_ALLOCATION
 	  Enable support for Enhanced Allocation which can be used by supported
 	  devices in place of traditional BARS for allocation of resources.
 
+config PCI_PWRCTRL_SLOT
+	bool "PCI slot power control"
+	help
+	  This is a generic driver that controls the power state of different
+	  PCI slots. The clocks and resets for the PCI slots are expected to be
+	  defined in the devicetree node of the PCI bridge. Say N if your PCI
+	  busses don't have software-controlled clocks or power rails.
+
 config PCI_ARID
         bool "Enable Alternate Routing-ID support for PCI"
         help
drivers/pci/pci-uclass.c +55 -0

80 lines not on this page · raw message

Signature · 4 lines
2.35.1.1320.gc452695387.dirty

base-commit: 141be72e2a9d43aa4e3d1a6a6e0ab8f9eb8784c6
branch: pci_pwrseq
Reviewed-by on v2 1/1
#1 lore raw

Hi Sean,

Quoted 10 lines · Sean Anderson

Extend the PCI bridge driver to enable resources associated with PCI slots like clocks, power rails, and resets. This is modeled off of the PCI power control subsystem in Linux. The traditional compatible for PCI slots in U-Boot is pci-bridge, but Linux uses the more-systematic pciclass,0604 so add that as an option.

---

Quoted 8 lines

Changes in v2:
- Return early if there's not PERST GPIO
- Only mdelay if we need to
- Use CONFIG_IS_ENABLED to set .probe directly

 drivers/pci/Kconfig      |  8 ++++++
 drivers/pci/pci-uclass.c | 55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)

You should be able to add a test for this.

Regards,
Simon