diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-01-10 15:46:36 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-05-11 18:18:48 -0400 |
commit | 48a92a8179b3e677fac07db7bd109e68f020468c (patch) | |
tree | a0d43c7fc33fd5c899ce81103097117c27dd3e60 /include | |
parent | b48d4425b602f5f4978299474743dbea130d940d (diff) |
PCI: add OBFF enable/disable support
OBFF (optimized buffer flush/fill), where supported, can help improve
energy efficiency by giving devices information about when interrupts
and other activity will have a reduced power impact. It requires
support from both the device and system (i.e. not only does the device
need to respond to OBFF messages, but the platform must be capable of
generating and routing them to the end point).
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pci.h | 16 | ||||
-rw-r--r-- | include/linux/pci_regs.h | 6 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 551ddcb5f940..45a035cccd93 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -833,6 +833,13 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | |||
833 | void pci_enable_ido(struct pci_dev *dev, unsigned long type); | 833 | void pci_enable_ido(struct pci_dev *dev, unsigned long type); |
834 | void pci_disable_ido(struct pci_dev *dev, unsigned long type); | 834 | void pci_disable_ido(struct pci_dev *dev, unsigned long type); |
835 | 835 | ||
836 | enum pci_obff_signal_type { | ||
837 | PCI_EXP_OBFF_SIGNAL_L0, | ||
838 | PCI_EXP_OBFF_SIGNAL_ALWAYS, | ||
839 | }; | ||
840 | int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); | ||
841 | void pci_disable_obff(struct pci_dev *dev); | ||
842 | |||
836 | /* For use by arch with custom probe code */ | 843 | /* For use by arch with custom probe code */ |
837 | void set_pcie_port_type(struct pci_dev *pdev); | 844 | void set_pcie_port_type(struct pci_dev *pdev); |
838 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); | 845 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); |
@@ -1220,6 +1227,15 @@ static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type) | |||
1220 | { | 1227 | { |
1221 | } | 1228 | } |
1222 | 1229 | ||
1230 | static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type) | ||
1231 | { | ||
1232 | return 0; | ||
1233 | } | ||
1234 | |||
1235 | static inline void pci_disable_obff(struct pci_dev *dev) | ||
1236 | { | ||
1237 | } | ||
1238 | |||
1223 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) | 1239 | static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) |
1224 | { | 1240 | { |
1225 | return -EIO; | 1241 | return -EIO; |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index d9acf9b99814..aa420261843d 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -508,10 +508,16 @@ | |||
508 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ | 508 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ |
509 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ | 509 | #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ |
510 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ | 510 | #define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ |
511 | #define PCI_EXP_OBFF_MASK 0xc0000 /* OBFF support mechanism */ | ||
512 | #define PCI_EXP_OBFF_MSG 0x40000 /* New message signaling */ | ||
513 | #define PCI_EXP_OBFF_WAKE 0x80000 /* Re-use WAKE# for OBFF */ | ||
511 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ | 514 | #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ |
512 | #define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */ | 515 | #define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */ |
513 | #define PCI_EXP_IDO_REQ_EN 0x100 /* ID-based ordering request enable */ | 516 | #define PCI_EXP_IDO_REQ_EN 0x100 /* ID-based ordering request enable */ |
514 | #define PCI_EXP_IDO_CMP_EN 0x200 /* ID-based ordering completion enable */ | 517 | #define PCI_EXP_IDO_CMP_EN 0x200 /* ID-based ordering completion enable */ |
518 | #define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ | ||
519 | #define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ | ||
520 | #define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ | ||
515 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ | 521 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ |
516 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ | 522 | #define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ |
517 | 523 | ||