aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 19:17:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 19:17:07 -0400
commit6dd53aa4563a2c69e80a24d2cc68d484b5ea2891 (patch)
tree0cca9f65984b524527910960d972fc6ef85fac88 /include
parentf14121ab35912e3d2e57ac9a4ce1f9d4b7baeffb (diff)
parent63b96f7baeba71966c723912c3f8f0274577f877 (diff)
Merge tag 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI changes from Bjorn Helgaas: "Host bridge hotplug: - Add MMCONFIG support for hot-added host bridges (Jiang Liu) Device hotplug: - Move fixups from __init to __devinit (Sebastian Andrzej Siewior) - Call FINAL fixups for hot-added devices, too (Myron Stowe) - Factor out generic code for P2P bridge hot-add (Yinghai Lu) - Remove all functions in a slot, not just those with _EJx (Amos Kong) Dynamic resource management: - Track bus number allocation (struct resource tree per domain) (Yinghai Lu) - Make P2P bridge 1K I/O windows work with resource reassignment (Bjorn Helgaas, Yinghai Lu) - Disable decoding while updating 64-bit BARs (Bjorn Helgaas) Power management: - Add PCIe runtime D3cold support (Huang Ying) Virtualization: - Add VFIO infrastructure (ACS, DMA source ID quirks) (Alex Williamson) - Add quirks for devices with broken INTx masking (Jan Kiszka) Miscellaneous: - Fix some PCI Express capability version issues (Myron Stowe) - Factor out some arch code with a weak, generic, pcibios_setup() (Myron Stowe)" * tag 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (122 commits) PCI: hotplug: ensure a consistent return value in error case PCI: fix undefined reference to 'pci_fixup_final_inited' PCI: build resource code for M68K architecture PCI: pciehp: remove unused pciehp_get_max_lnk_width(), pciehp_get_cur_lnk_width() PCI: reorder __pci_assign_resource() (no change) PCI: fix truncation of resource size to 32 bits PCI: acpiphp: merge acpiphp_debug and debug PCI: acpiphp: remove unused res_lock sparc/PCI: replace pci_cfg_fake_ranges() with pci_read_bridge_bases() PCI: call final fixups hot-added devices PCI: move final fixups from __init to __devinit x86/PCI: move final fixups from __init to __devinit MIPS/PCI: move final fixups from __init to __devinit PCI: support sizing P2P bridge I/O windows with 1K granularity PCI: reimplement P2P bridge 1K I/O windows (Intel P64H2) PCI: disable MEM decoding while updating 64-bit MEM BARs PCI: leave MEM and IO decoding disabled during 64-bit BAR sizing, too PCI: never discard enable/suspend/resume_early/resume fixups PCI: release temporary reference in __nv_msi_ht_cap_quirk() PCI: restructure 'pci_do_fixups()' ...
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acnames.h1
-rw-r--r--include/acpi/acpi_bus.h7
-rw-r--r--include/linux/pci-acpi.h1
-rw-r--r--include/linux/pci.h82
-rw-r--r--include/linux/pci_regs.h122
-rw-r--r--include/linux/sfi_acpi.h4
6 files changed, 189 insertions, 28 deletions
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index 38f508816e4a..b177f97f53b6 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -62,6 +62,7 @@
62#define METHOD_NAME__AEI "_AEI" 62#define METHOD_NAME__AEI "_AEI"
63#define METHOD_NAME__PRW "_PRW" 63#define METHOD_NAME__PRW "_PRW"
64#define METHOD_NAME__SRS "_SRS" 64#define METHOD_NAME__SRS "_SRS"
65#define METHOD_NAME__CBA "_CBA"
65 66
66/* Method names - these methods must appear at the namespace root */ 67/* Method names - these methods must appear at the namespace root */
67 68
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 18fd41033e03..01e2925523ea 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -396,6 +396,7 @@ struct acpi_pci_root {
396 396
397 u32 osc_support_set; /* _OSC state of support bits */ 397 u32 osc_support_set; /* _OSC state of support bits */
398 u32 osc_control_set; /* _OSC state of control bits */ 398 u32 osc_control_set; /* _OSC state of control bits */
399 phys_addr_t mcfg_addr;
399}; 400};
400 401
401/* helper */ 402/* helper */
@@ -409,13 +410,13 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
409int acpi_disable_wakeup_device_power(struct acpi_device *dev); 410int acpi_disable_wakeup_device_power(struct acpi_device *dev);
410 411
411#ifdef CONFIG_PM 412#ifdef CONFIG_PM
412int acpi_pm_device_sleep_state(struct device *, int *); 413int acpi_pm_device_sleep_state(struct device *, int *, int);
413#else 414#else
414static inline int acpi_pm_device_sleep_state(struct device *d, int *p) 415static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
415{ 416{
416 if (p) 417 if (p)
417 *p = ACPI_STATE_D0; 418 *p = ACPI_STATE_D0;
418 return ACPI_STATE_D3; 419 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0;
419} 420}
420#endif 421#endif
421 422
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 44623500f419..248fba2af98a 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -17,6 +17,7 @@ extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev);
17extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev, 17extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev,
18 struct pci_dev *pci_dev); 18 struct pci_dev *pci_dev);
19extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev); 19extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev);
20extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle);
20 21
21static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) 22static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
22{ 23{
diff --git a/include/linux/pci.h b/include/linux/pci.h
index d8c379dba6ad..5faa8310eec9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -132,9 +132,10 @@ static inline const char *pci_power_name(pci_power_t state)
132 return pci_power_names[1 + (int) state]; 132 return pci_power_names[1 + (int) state];
133} 133}
134 134
135#define PCI_PM_D2_DELAY 200 135#define PCI_PM_D2_DELAY 200
136#define PCI_PM_D3_WAIT 10 136#define PCI_PM_D3_WAIT 10
137#define PCI_PM_BUS_WAIT 50 137#define PCI_PM_D3COLD_WAIT 100
138#define PCI_PM_BUS_WAIT 50
138 139
139/** The pci_channel state describes connectivity between the CPU and 140/** The pci_channel state describes connectivity between the CPU and
140 * the pci device. If some PCI bus between here and the pci device 141 * the pci device. If some PCI bus between here and the pci device
@@ -278,11 +279,18 @@ struct pci_dev {
278 unsigned int pme_poll:1; /* Poll device's PME status bit */ 279 unsigned int pme_poll:1; /* Poll device's PME status bit */
279 unsigned int d1_support:1; /* Low power state D1 is supported */ 280 unsigned int d1_support:1; /* Low power state D1 is supported */
280 unsigned int d2_support:1; /* Low power state D2 is supported */ 281 unsigned int d2_support:1; /* Low power state D2 is supported */
281 unsigned int no_d1d2:1; /* Only allow D0 and D3 */ 282 unsigned int no_d1d2:1; /* D1 and D2 are forbidden */
283 unsigned int no_d3cold:1; /* D3cold is forbidden */
284 unsigned int d3cold_allowed:1; /* D3cold is allowed by user */
282 unsigned int mmio_always_on:1; /* disallow turning off io/mem 285 unsigned int mmio_always_on:1; /* disallow turning off io/mem
283 decoding during bar sizing */ 286 decoding during bar sizing */
284 unsigned int wakeup_prepared:1; 287 unsigned int wakeup_prepared:1;
288 unsigned int runtime_d3cold:1; /* whether go through runtime
289 D3cold, not set for devices
290 powered on/off by the
291 corresponding bridge */
285 unsigned int d3_delay; /* D3->D0 transition time in ms */ 292 unsigned int d3_delay; /* D3->D0 transition time in ms */
293 unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */
286 294
287#ifdef CONFIG_PCIEASPM 295#ifdef CONFIG_PCIEASPM
288 struct pcie_link_state *link_state; /* ASPM link state. */ 296 struct pcie_link_state *link_state; /* ASPM link state. */
@@ -324,6 +332,8 @@ struct pci_dev {
324 unsigned int is_hotplug_bridge:1; 332 unsigned int is_hotplug_bridge:1;
325 unsigned int __aer_firmware_first_valid:1; 333 unsigned int __aer_firmware_first_valid:1;
326 unsigned int __aer_firmware_first:1; 334 unsigned int __aer_firmware_first:1;
335 unsigned int broken_intx_masking:1;
336 unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */
327 pci_dev_flags_t dev_flags; 337 pci_dev_flags_t dev_flags;
328 atomic_t enable_cnt; /* pci_enable_device has been called */ 338 atomic_t enable_cnt; /* pci_enable_device has been called */
329 339
@@ -368,6 +378,8 @@ static inline int pci_channel_offline(struct pci_dev *pdev)
368 return (pdev->error_state != pci_channel_io_normal); 378 return (pdev->error_state != pci_channel_io_normal);
369} 379}
370 380
381extern struct resource busn_resource;
382
371struct pci_host_bridge_window { 383struct pci_host_bridge_window {
372 struct list_head list; 384 struct list_head list;
373 struct resource *res; /* host bridge aperture (CPU address) */ 385 struct resource *res; /* host bridge aperture (CPU address) */
@@ -419,6 +431,7 @@ struct pci_bus {
419 struct list_head slots; /* list of slots on this bus */ 431 struct list_head slots; /* list of slots on this bus */
420 struct resource *resource[PCI_BRIDGE_RESOURCE_NUM]; 432 struct resource *resource[PCI_BRIDGE_RESOURCE_NUM];
421 struct list_head resources; /* address space routed to this bus */ 433 struct list_head resources; /* address space routed to this bus */
434 struct resource busn_res; /* bus numbers routed to this bus */
422 435
423 struct pci_ops *ops; /* configuration access functions */ 436 struct pci_ops *ops; /* configuration access functions */
424 void *sysdata; /* hook for sys-specific extension */ 437 void *sysdata; /* hook for sys-specific extension */
@@ -426,8 +439,6 @@ struct pci_bus {
426 439
427 unsigned char number; /* bus number */ 440 unsigned char number; /* bus number */
428 unsigned char primary; /* number of primary bridge */ 441 unsigned char primary; /* number of primary bridge */
429 unsigned char secondary; /* number of secondary bridge */
430 unsigned char subordinate; /* max number of subordinate buses */
431 unsigned char max_bus_speed; /* enum pci_bus_speed */ 442 unsigned char max_bus_speed; /* enum pci_bus_speed */
432 unsigned char cur_bus_speed; /* enum pci_bus_speed */ 443 unsigned char cur_bus_speed; /* enum pci_bus_speed */
433 444
@@ -474,6 +485,32 @@ static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false;
474#define PCIBIOS_SET_FAILED 0x88 485#define PCIBIOS_SET_FAILED 0x88
475#define PCIBIOS_BUFFER_TOO_SMALL 0x89 486#define PCIBIOS_BUFFER_TOO_SMALL 0x89
476 487
488/*
489 * Translate above to generic errno for passing back through non-pci.
490 */
491static inline int pcibios_err_to_errno(int err)
492{
493 if (err <= PCIBIOS_SUCCESSFUL)
494 return err; /* Assume already errno */
495
496 switch (err) {
497 case PCIBIOS_FUNC_NOT_SUPPORTED:
498 return -ENOENT;
499 case PCIBIOS_BAD_VENDOR_ID:
500 return -EINVAL;
501 case PCIBIOS_DEVICE_NOT_FOUND:
502 return -ENODEV;
503 case PCIBIOS_BAD_REGISTER_NUMBER:
504 return -EFAULT;
505 case PCIBIOS_SET_FAILED:
506 return -EIO;
507 case PCIBIOS_BUFFER_TOO_SMALL:
508 return -ENOSPC;
509 }
510
511 return -ENOTTY;
512}
513
477/* Low-level architecture-dependent routines */ 514/* Low-level architecture-dependent routines */
478 515
479struct pci_ops { 516struct pci_ops {
@@ -642,6 +679,7 @@ extern int no_pci_devices(void);
642 679
643void pcibios_fixup_bus(struct pci_bus *); 680void pcibios_fixup_bus(struct pci_bus *);
644int __must_check pcibios_enable_device(struct pci_dev *, int mask); 681int __must_check pcibios_enable_device(struct pci_dev *, int mask);
682/* Architecture specific versions may override this (weak) */
645char *pcibios_setup(char *str); 683char *pcibios_setup(char *str);
646 684
647/* Used only when drivers/pci/setup.c is used */ 685/* Used only when drivers/pci/setup.c is used */
@@ -668,6 +706,9 @@ struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
668struct pci_bus *pci_create_root_bus(struct device *parent, int bus, 706struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
669 struct pci_ops *ops, void *sysdata, 707 struct pci_ops *ops, void *sysdata,
670 struct list_head *resources); 708 struct list_head *resources);
709int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax);
710int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax);
711void pci_bus_release_busn_res(struct pci_bus *b);
671struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus, 712struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
672 struct pci_ops *ops, void *sysdata, 713 struct pci_ops *ops, void *sysdata,
673 struct list_head *resources); 714 struct list_head *resources);
@@ -714,8 +755,6 @@ enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *dev);
714int pci_find_capability(struct pci_dev *dev, int cap); 755int pci_find_capability(struct pci_dev *dev, int cap);
715int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); 756int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap);
716int pci_find_ext_capability(struct pci_dev *dev, int cap); 757int pci_find_ext_capability(struct pci_dev *dev, int cap);
717int pci_bus_find_ext_capability(struct pci_bus *bus, unsigned int devfn,
718 int cap);
719int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); 758int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);
720int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); 759int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap);
721struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 760struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
@@ -777,6 +816,14 @@ static inline int pci_write_config_dword(const struct pci_dev *dev, int where,
777 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val); 816 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val);
778} 817}
779 818
819/* user-space driven config access */
820int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val);
821int pci_user_read_config_word(struct pci_dev *dev, int where, u16 *val);
822int pci_user_read_config_dword(struct pci_dev *dev, int where, u32 *val);
823int pci_user_write_config_byte(struct pci_dev *dev, int where, u8 val);
824int pci_user_write_config_word(struct pci_dev *dev, int where, u16 val);
825int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val);
826
780int __must_check pci_enable_device(struct pci_dev *dev); 827int __must_check pci_enable_device(struct pci_dev *dev);
781int __must_check pci_enable_device_io(struct pci_dev *dev); 828int __must_check pci_enable_device_io(struct pci_dev *dev);
782int __must_check pci_enable_device_mem(struct pci_dev *dev); 829int __must_check pci_enable_device_mem(struct pci_dev *dev);
@@ -875,7 +922,6 @@ enum pci_obff_signal_type {
875int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); 922int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
876void pci_disable_obff(struct pci_dev *dev); 923void pci_disable_obff(struct pci_dev *dev);
877 924
878bool pci_ltr_supported(struct pci_dev *dev);
879int pci_enable_ltr(struct pci_dev *dev); 925int pci_enable_ltr(struct pci_dev *dev);
880void pci_disable_ltr(struct pci_dev *dev); 926void pci_disable_ltr(struct pci_dev *dev);
881int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns); 927int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns);
@@ -1332,6 +1378,9 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1332static inline int pci_domain_nr(struct pci_bus *bus) 1378static inline int pci_domain_nr(struct pci_bus *bus)
1333{ return 0; } 1379{ return 0; }
1334 1380
1381static inline struct pci_dev *pci_dev_get(struct pci_dev *dev)
1382{ return NULL; }
1383
1335#define dev_is_pci(d) (false) 1384#define dev_is_pci(d) (false)
1336#define dev_is_pf(d) (false) 1385#define dev_is_pf(d) (false)
1337#define dev_num_vf(d) (0) 1386#define dev_num_vf(d) (0)
@@ -1486,9 +1535,20 @@ enum pci_fixup_pass {
1486 1535
1487#ifdef CONFIG_PCI_QUIRKS 1536#ifdef CONFIG_PCI_QUIRKS
1488void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); 1537void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);
1538struct pci_dev *pci_get_dma_source(struct pci_dev *dev);
1539int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags);
1489#else 1540#else
1490static inline void pci_fixup_device(enum pci_fixup_pass pass, 1541static inline void pci_fixup_device(enum pci_fixup_pass pass,
1491 struct pci_dev *dev) {} 1542 struct pci_dev *dev) {}
1543static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev)
1544{
1545 return pci_dev_get(dev);
1546}
1547static inline int pci_dev_specific_acs_enabled(struct pci_dev *dev,
1548 u16 acs_flags)
1549{
1550 return -ENOTTY;
1551}
1492#endif 1552#endif
1493 1553
1494void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); 1554void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
@@ -1591,7 +1651,9 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
1591} 1651}
1592 1652
1593void pci_request_acs(void); 1653void pci_request_acs(void);
1594 1654bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags);
1655bool pci_acs_path_enabled(struct pci_dev *start,
1656 struct pci_dev *end, u16 acs_flags);
1595 1657
1596#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */ 1658#define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */
1597#define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT) 1659#define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT)
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 4b608f543412..53274bff5773 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -26,6 +26,7 @@
26 * Under PCI, each device has 256 bytes of configuration address space, 26 * Under PCI, each device has 256 bytes of configuration address space,
27 * of which the first 64 bytes are standardized as follows: 27 * of which the first 64 bytes are standardized as follows:
28 */ 28 */
29#define PCI_STD_HEADER_SIZEOF 64
29#define PCI_VENDOR_ID 0x00 /* 16 bits */ 30#define PCI_VENDOR_ID 0x00 /* 16 bits */
30#define PCI_DEVICE_ID 0x02 /* 16 bits */ 31#define PCI_DEVICE_ID 0x02 /* 16 bits */
31#define PCI_COMMAND 0x04 /* 16 bits */ 32#define PCI_COMMAND 0x04 /* 16 bits */
@@ -125,7 +126,8 @@
125#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */ 126#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */
126#define PCI_IO_RANGE_TYPE_16 0x00 127#define PCI_IO_RANGE_TYPE_16 0x00
127#define PCI_IO_RANGE_TYPE_32 0x01 128#define PCI_IO_RANGE_TYPE_32 0x01
128#define PCI_IO_RANGE_MASK (~0x0fUL) 129#define PCI_IO_RANGE_MASK (~0x0fUL) /* Standard 4K I/O windows */
130#define PCI_IO_1K_RANGE_MASK (~0x03UL) /* Intel 1K I/O windows */
129#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ 131#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */
130#define PCI_MEMORY_BASE 0x20 /* Memory range behind */ 132#define PCI_MEMORY_BASE 0x20 /* Memory range behind */
131#define PCI_MEMORY_LIMIT 0x22 133#define PCI_MEMORY_LIMIT 0x22
@@ -209,9 +211,12 @@
209#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ 211#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */
210#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */ 212#define PCI_CAP_ID_SSVID 0x0D /* Bridge subsystem vendor/device ID */
211#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */ 213#define PCI_CAP_ID_AGP3 0x0E /* AGP Target PCI-PCI bridge */
214#define PCI_CAP_ID_SECDEV 0x0F /* Secure Device */
212#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ 215#define PCI_CAP_ID_EXP 0x10 /* PCI Express */
213#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ 216#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */
217#define PCI_CAP_ID_SATA 0x12 /* SATA Data/Index Conf. */
214#define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */ 218#define PCI_CAP_ID_AF 0x13 /* PCI Advanced Features */
219#define PCI_CAP_ID_MAX PCI_CAP_ID_AF
215#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ 220#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */
216#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ 221#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */
217#define PCI_CAP_SIZEOF 4 222#define PCI_CAP_SIZEOF 4
@@ -276,6 +281,7 @@
276#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */ 281#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */
277#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */ 282#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */
278#define PCI_VPD_DATA 4 /* 32-bits of data returned here */ 283#define PCI_VPD_DATA 4 /* 32-bits of data returned here */
284#define PCI_CAP_VPD_SIZEOF 8
279 285
280/* Slot Identification */ 286/* Slot Identification */
281 287
@@ -297,8 +303,10 @@
297#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ 303#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
298#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ 304#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
299#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */ 305#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */
306#define PCI_MSI_PENDING_32 16 /* Pending intrs for 32-bit devices */
300#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ 307#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
301#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ 308#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */
309#define PCI_MSI_PENDING_64 20 /* Pending intrs for 64-bit devices */
302 310
303/* MSI-X registers */ 311/* MSI-X registers */
304#define PCI_MSIX_FLAGS 2 312#define PCI_MSIX_FLAGS 2
@@ -308,6 +316,7 @@
308#define PCI_MSIX_TABLE 4 316#define PCI_MSIX_TABLE 4
309#define PCI_MSIX_PBA 8 317#define PCI_MSIX_PBA 8
310#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) 318#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
319#define PCI_CAP_MSIX_SIZEOF 12 /* size of MSIX registers */
311 320
312/* MSI-X entry's format */ 321/* MSI-X entry's format */
313#define PCI_MSIX_ENTRY_SIZE 16 322#define PCI_MSIX_ENTRY_SIZE 16
@@ -338,6 +347,7 @@
338#define PCI_AF_CTRL_FLR 0x01 347#define PCI_AF_CTRL_FLR 0x01
339#define PCI_AF_STATUS 5 348#define PCI_AF_STATUS 5
340#define PCI_AF_STATUS_TP 0x01 349#define PCI_AF_STATUS_TP 0x01
350#define PCI_CAP_AF_SIZEOF 6 /* size of AF registers */
341 351
342/* PCI-X registers */ 352/* PCI-X registers */
343 353
@@ -374,6 +384,10 @@
374#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */ 384#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */
375#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ 385#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */
376#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ 386#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */
387#define PCI_X_ECC_CSR 8 /* ECC control and status */
388#define PCI_CAP_PCIX_SIZEOF_V0 8 /* size of registers for Version 0 */
389#define PCI_CAP_PCIX_SIZEOF_V1 24 /* size for Version 1 */
390#define PCI_CAP_PCIX_SIZEOF_V2 PCI_CAP_PCIX_SIZEOF_V1 /* Same for v2 */
377 391
378/* PCI Bridge Subsystem ID registers */ 392/* PCI Bridge Subsystem ID registers */
379 393
@@ -462,6 +476,7 @@
462#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */ 476#define PCI_EXP_LNKSTA_DLLLA 0x2000 /* Data Link Layer Link Active */
463#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */ 477#define PCI_EXP_LNKSTA_LBMS 0x4000 /* Link Bandwidth Management Status */
464#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */ 478#define PCI_EXP_LNKSTA_LABS 0x8000 /* Link Autonomous Bandwidth Status */
479#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V1 20 /* v1 endpoints end here */
465#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ 480#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
466#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */ 481#define PCI_EXP_SLTCAP_ABP 0x00000001 /* Attention Button Present */
467#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */ 482#define PCI_EXP_SLTCAP_PCP 0x00000002 /* Power Controller Present */
@@ -507,6 +522,12 @@
507#define PCI_EXP_RTSTA 32 /* Root Status */ 522#define PCI_EXP_RTSTA 32 /* Root Status */
508#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ 523#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */
509#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ 524#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */
525/*
526 * Note that the following PCI Express 'Capability Structure' registers
527 * were introduced with 'Capability Version' 0x2 (v2). These registers
528 * do not exist on devices with Capability Version 1. Use pci_pcie_cap2()
529 * to use these fields safely.
530 */
510#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ 531#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
511#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ 532#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */
512#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */ 533#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */
@@ -521,6 +542,7 @@
521#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ 542#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */
522#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ 543#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */
523#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ 544#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */
545#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */
524#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ 546#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
525#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ 547#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
526 548
@@ -529,23 +551,43 @@
529#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf) 551#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
530#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) 552#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
531 553
532#define PCI_EXT_CAP_ID_ERR 1 554#define PCI_EXT_CAP_ID_ERR 0x01 /* Advanced Error Reporting */
533#define PCI_EXT_CAP_ID_VC 2 555#define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel Capability */
534#define PCI_EXT_CAP_ID_DSN 3 556#define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */
535#define PCI_EXT_CAP_ID_PWR 4 557#define PCI_EXT_CAP_ID_PWR 0x04 /* Power Budgeting */
536#define PCI_EXT_CAP_ID_VNDR 11 558#define PCI_EXT_CAP_ID_RCLD 0x05 /* Root Complex Link Declaration */
537#define PCI_EXT_CAP_ID_ACS 13 559#define PCI_EXT_CAP_ID_RCILC 0x06 /* Root Complex Internal Link Control */
538#define PCI_EXT_CAP_ID_ARI 14 560#define PCI_EXT_CAP_ID_RCEC 0x07 /* Root Complex Event Collector */
539#define PCI_EXT_CAP_ID_ATS 15 561#define PCI_EXT_CAP_ID_MFVC 0x08 /* Multi-Function VC Capability */
540#define PCI_EXT_CAP_ID_SRIOV 16 562#define PCI_EXT_CAP_ID_VC9 0x09 /* same as _VC */
541#define PCI_EXT_CAP_ID_PRI 19 563#define PCI_EXT_CAP_ID_RCRB 0x0A /* Root Complex RB? */
542#define PCI_EXT_CAP_ID_LTR 24 564#define PCI_EXT_CAP_ID_VNDR 0x0B /* Vendor Specific */
543#define PCI_EXT_CAP_ID_PASID 27 565#define PCI_EXT_CAP_ID_CAC 0x0C /* Config Access - obsolete */
566#define PCI_EXT_CAP_ID_ACS 0x0D /* Access Control Services */
567#define PCI_EXT_CAP_ID_ARI 0x0E /* Alternate Routing ID */
568#define PCI_EXT_CAP_ID_ATS 0x0F /* Address Translation Services */
569#define PCI_EXT_CAP_ID_SRIOV 0x10 /* Single Root I/O Virtualization */
570#define PCI_EXT_CAP_ID_MRIOV 0x11 /* Multi Root I/O Virtualization */
571#define PCI_EXT_CAP_ID_MCAST 0x12 /* Multicast */
572#define PCI_EXT_CAP_ID_PRI 0x13 /* Page Request Interface */
573#define PCI_EXT_CAP_ID_AMD_XXX 0x14 /* reserved for AMD */
574#define PCI_EXT_CAP_ID_REBAR 0x15 /* resizable BAR */
575#define PCI_EXT_CAP_ID_DPA 0x16 /* dynamic power alloc */
576#define PCI_EXT_CAP_ID_TPH 0x17 /* TPH request */
577#define PCI_EXT_CAP_ID_LTR 0x18 /* latency tolerance reporting */
578#define PCI_EXT_CAP_ID_SECPCI 0x19 /* Secondary PCIe */
579#define PCI_EXT_CAP_ID_PMUX 0x1A /* Protocol Multiplexing */
580#define PCI_EXT_CAP_ID_PASID 0x1B /* Process Address Space ID */
581#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PASID
582
583#define PCI_EXT_CAP_DSN_SIZEOF 12
584#define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
544 585
545/* Advanced Error Reporting */ 586/* Advanced Error Reporting */
546#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ 587#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
547#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */ 588#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
548#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ 589#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */
590#define PCI_ERR_UNC_SURPDN 0x00000020 /* Surprise Down */
549#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ 591#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */
550#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ 592#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */
551#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ 593#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */
@@ -555,6 +597,11 @@
555#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ 597#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */
556#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ 598#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */
557#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ 599#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */
600#define PCI_ERR_UNC_ACSV 0x00200000 /* ACS Violation */
601#define PCI_ERR_UNC_INTN 0x00400000 /* internal error */
602#define PCI_ERR_UNC_MCBTLP 0x00800000 /* MC blocked TLP */
603#define PCI_ERR_UNC_ATOMEG 0x01000000 /* Atomic egress blocked */
604#define PCI_ERR_UNC_TLPPRE 0x02000000 /* TLP prefix blocked */
558#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ 605#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */
559 /* Same bits as above */ 606 /* Same bits as above */
560#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ 607#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */
@@ -565,6 +612,9 @@
565#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ 612#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */
566#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ 613#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */
567#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ 614#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */
615#define PCI_ERR_COR_ADV_NFAT 0x00002000 /* Advisory Non-Fatal */
616#define PCI_ERR_COR_INTERNAL 0x00004000 /* Corrected Internal */
617#define PCI_ERR_COR_LOG_OVER 0x00008000 /* Header Log Overflow */
568#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ 618#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */
569 /* Same bits as above */ 619 /* Same bits as above */
570#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ 620#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */
@@ -596,12 +646,18 @@
596 646
597/* Virtual Channel */ 647/* Virtual Channel */
598#define PCI_VC_PORT_REG1 4 648#define PCI_VC_PORT_REG1 4
649#define PCI_VC_REG1_EVCC 0x7 /* extended vc count */
599#define PCI_VC_PORT_REG2 8 650#define PCI_VC_PORT_REG2 8
651#define PCI_VC_REG2_32_PHASE 0x2
652#define PCI_VC_REG2_64_PHASE 0x4
653#define PCI_VC_REG2_128_PHASE 0x8
600#define PCI_VC_PORT_CTRL 12 654#define PCI_VC_PORT_CTRL 12
601#define PCI_VC_PORT_STATUS 14 655#define PCI_VC_PORT_STATUS 14
602#define PCI_VC_RES_CAP 16 656#define PCI_VC_RES_CAP 16
603#define PCI_VC_RES_CTRL 20 657#define PCI_VC_RES_CTRL 20
604#define PCI_VC_RES_STATUS 26 658#define PCI_VC_RES_STATUS 26
659#define PCI_CAP_VC_BASE_SIZEOF 0x10
660#define PCI_CAP_VC_PER_VC_SIZEOF 0x0C
605 661
606/* Power Budgeting */ 662/* Power Budgeting */
607#define PCI_PWR_DSR 4 /* Data Select Register */ 663#define PCI_PWR_DSR 4 /* Data Select Register */
@@ -614,6 +670,7 @@
614#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ 670#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */
615#define PCI_PWR_CAP 12 /* Capability */ 671#define PCI_PWR_CAP 12 /* Capability */
616#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ 672#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */
673#define PCI_EXT_CAP_PWR_SIZEOF 16
617 674
618/* 675/*
619 * Hypertransport sub capability types 676 * Hypertransport sub capability types
@@ -646,6 +703,8 @@
646#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ 703#define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */
647#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */ 704#define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */
648#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */ 705#define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */
706#define HT_CAP_SIZEOF_LONG 28 /* slave & primary */
707#define HT_CAP_SIZEOF_SHORT 24 /* host & secondary */
649 708
650/* Alternative Routing-ID Interpretation */ 709/* Alternative Routing-ID Interpretation */
651#define PCI_ARI_CAP 0x04 /* ARI Capability Register */ 710#define PCI_ARI_CAP 0x04 /* ARI Capability Register */
@@ -656,6 +715,7 @@
656#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */ 715#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */
657#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ 716#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */
658#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ 717#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */
718#define PCI_EXT_CAP_ARI_SIZEOF 8
659 719
660/* Address Translation Service */ 720/* Address Translation Service */
661#define PCI_ATS_CAP 0x04 /* ATS Capability Register */ 721#define PCI_ATS_CAP 0x04 /* ATS Capability Register */
@@ -665,6 +725,7 @@
665#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ 725#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */
666#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ 726#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */
667#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ 727#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */
728#define PCI_EXT_CAP_ATS_SIZEOF 8
668 729
669/* Page Request Interface */ 730/* Page Request Interface */
670#define PCI_PRI_CTRL 0x04 /* PRI control register */ 731#define PCI_PRI_CTRL 0x04 /* PRI control register */
@@ -676,6 +737,7 @@
676#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */ 737#define PCI_PRI_STATUS_STOPPED 0x100 /* PRI Stopped */
677#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */ 738#define PCI_PRI_MAX_REQ 0x08 /* PRI max reqs supported */
678#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */ 739#define PCI_PRI_ALLOC_REQ 0x0c /* PRI max reqs allowed */
740#define PCI_EXT_CAP_PRI_SIZEOF 16
679 741
680/* PASID capability */ 742/* PASID capability */
681#define PCI_PASID_CAP 0x04 /* PASID feature register */ 743#define PCI_PASID_CAP 0x04 /* PASID feature register */
@@ -685,6 +747,7 @@
685#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */ 747#define PCI_PASID_CTRL_ENABLE 0x01 /* Enable bit */
686#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */ 748#define PCI_PASID_CTRL_EXEC 0x02 /* Exec permissions Enable */
687#define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */ 749#define PCI_PASID_CTRL_PRIV 0x04 /* Priviledge Mode Enable */
750#define PCI_EXT_CAP_PASID_SIZEOF 8
688 751
689/* Single Root I/O Virtualization */ 752/* Single Root I/O Virtualization */
690#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ 753#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
@@ -716,12 +779,14 @@
716#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */ 779#define PCI_SRIOV_VFM_MI 0x1 /* Dormant.MigrateIn */
717#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ 780#define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */
718#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ 781#define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */
782#define PCI_EXT_CAP_SRIOV_SIZEOF 64
719 783
720#define PCI_LTR_MAX_SNOOP_LAT 0x4 784#define PCI_LTR_MAX_SNOOP_LAT 0x4
721#define PCI_LTR_MAX_NOSNOOP_LAT 0x6 785#define PCI_LTR_MAX_NOSNOOP_LAT 0x6
722#define PCI_LTR_VALUE_MASK 0x000003ff 786#define PCI_LTR_VALUE_MASK 0x000003ff
723#define PCI_LTR_SCALE_MASK 0x00001c00 787#define PCI_LTR_SCALE_MASK 0x00001c00
724#define PCI_LTR_SCALE_SHIFT 10 788#define PCI_LTR_SCALE_SHIFT 10
789#define PCI_EXT_CAP_LTR_SIZEOF 8
725 790
726/* Access Control Service */ 791/* Access Control Service */
727#define PCI_ACS_CAP 0x04 /* ACS Capability Register */ 792#define PCI_ACS_CAP 0x04 /* ACS Capability Register */
@@ -732,7 +797,38 @@
732#define PCI_ACS_UF 0x10 /* Upstream Forwarding */ 797#define PCI_ACS_UF 0x10 /* Upstream Forwarding */
733#define PCI_ACS_EC 0x20 /* P2P Egress Control */ 798#define PCI_ACS_EC 0x20 /* P2P Egress Control */
734#define PCI_ACS_DT 0x40 /* Direct Translated P2P */ 799#define PCI_ACS_DT 0x40 /* Direct Translated P2P */
800#define PCI_ACS_EGRESS_BITS 0x05 /* ACS Egress Control Vector Size */
735#define PCI_ACS_CTRL 0x06 /* ACS Control Register */ 801#define PCI_ACS_CTRL 0x06 /* ACS Control Register */
736#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ 802#define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */
737 803
804#define PCI_VSEC_HDR 4 /* extended cap - vendor specific */
805#define PCI_VSEC_HDR_LEN_SHIFT 20 /* shift for length field */
806
807/* sata capability */
808#define PCI_SATA_REGS 4 /* SATA REGs specifier */
809#define PCI_SATA_REGS_MASK 0xF /* location - BAR#/inline */
810#define PCI_SATA_REGS_INLINE 0xF /* REGS in config space */
811#define PCI_SATA_SIZEOF_SHORT 8
812#define PCI_SATA_SIZEOF_LONG 16
813
814/* resizable BARs */
815#define PCI_REBAR_CTRL 8 /* control register */
816#define PCI_REBAR_CTRL_NBAR_MASK (7 << 5) /* mask for # bars */
817#define PCI_REBAR_CTRL_NBAR_SHIFT 5 /* shift for # bars */
818
819/* dynamic power allocation */
820#define PCI_DPA_CAP 4 /* capability register */
821#define PCI_DPA_CAP_SUBSTATE_MASK 0x1F /* # substates - 1 */
822#define PCI_DPA_BASE_SIZEOF 16 /* size with 0 substates */
823
824/* TPH Requester */
825#define PCI_TPH_CAP 4 /* capability register */
826#define PCI_TPH_CAP_LOC_MASK 0x600 /* location mask */
827#define PCI_TPH_LOC_NONE 0x000 /* no location */
828#define PCI_TPH_LOC_CAP 0x200 /* in capability */
829#define PCI_TPH_LOC_MSIX 0x400 /* in MSI-X */
830#define PCI_TPH_CAP_ST_MASK 0x07FF0000 /* st table mask */
831#define PCI_TPH_CAP_ST_SHIFT 16 /* st table shift */
832#define PCI_TPH_BASE_SIZEOF 12 /* size with no st table */
833
738#endif /* LINUX_PCI_REGS_H */ 834#endif /* LINUX_PCI_REGS_H */
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h
index c4a5a8cd4469..631af63af42d 100644
--- a/include/linux/sfi_acpi.h
+++ b/include/linux/sfi_acpi.h
@@ -66,7 +66,7 @@ extern int sfi_acpi_table_parse(char *signature, char *oem_id,
66 char *oem_table_id, 66 char *oem_table_id,
67 int (*handler)(struct acpi_table_header *)); 67 int (*handler)(struct acpi_table_header *));
68 68
69static inline int acpi_sfi_table_parse(char *signature, 69static inline int __init acpi_sfi_table_parse(char *signature,
70 int (*handler)(struct acpi_table_header *)) 70 int (*handler)(struct acpi_table_header *))
71{ 71{
72 if (!acpi_table_parse(signature, handler)) 72 if (!acpi_table_parse(signature, handler))
@@ -83,7 +83,7 @@ static inline int sfi_acpi_table_parse(char *signature, char *oem_id,
83 return -1; 83 return -1;
84} 84}
85 85
86static inline int acpi_sfi_table_parse(char *signature, 86static inline int __init acpi_sfi_table_parse(char *signature,
87 int (*handler)(struct acpi_table_header *)) 87 int (*handler)(struct acpi_table_header *))
88{ 88{
89 return acpi_table_parse(signature, handler); 89 return acpi_table_parse(signature, handler);