diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/memremap.h | 1 | ||||
-rw-r--r-- | include/linux/pci-aspm.h | 36 | ||||
-rw-r--r-- | include/linux/pci-p2pdma.h | 28 | ||||
-rw-r--r-- | include/linux/pci.h | 129 | ||||
-rw-r--r-- | include/linux/pci_hotplug.h | 100 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 3 | ||||
-rw-r--r-- | include/uapi/linux/pci_regs.h | 15 |
7 files changed, 88 insertions, 224 deletions
diff --git a/include/linux/memremap.h b/include/linux/memremap.h index f8a5b2a19945..b459518ce475 100644 --- a/include/linux/memremap.h +++ b/include/linux/memremap.h | |||
@@ -112,7 +112,6 @@ struct dev_pagemap { | |||
112 | struct device *dev; | 112 | struct device *dev; |
113 | enum memory_type type; | 113 | enum memory_type type; |
114 | unsigned int flags; | 114 | unsigned int flags; |
115 | u64 pci_p2pdma_bus_offset; | ||
116 | const struct dev_pagemap_ops *ops; | 115 | const struct dev_pagemap_ops *ops; |
117 | }; | 116 | }; |
118 | 117 | ||
diff --git a/include/linux/pci-aspm.h b/include/linux/pci-aspm.h deleted file mode 100644 index 67064145d76e..000000000000 --- a/include/linux/pci-aspm.h +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | /* | ||
3 | * aspm.h | ||
4 | * | ||
5 | * PCI Express ASPM defines and function prototypes | ||
6 | * | ||
7 | * Copyright (C) 2007 Intel Corp. | ||
8 | * Zhang Yanmin (yanmin.zhang@intel.com) | ||
9 | * Shaohua Li (shaohua.li@intel.com) | ||
10 | * | ||
11 | * For more information, please consult the following manuals (look at | ||
12 | * http://www.pcisig.com/ for how to get them): | ||
13 | * | ||
14 | * PCI Express Specification | ||
15 | */ | ||
16 | |||
17 | #ifndef LINUX_ASPM_H | ||
18 | #define LINUX_ASPM_H | ||
19 | |||
20 | #include <linux/pci.h> | ||
21 | |||
22 | #define PCIE_LINK_STATE_L0S 1 | ||
23 | #define PCIE_LINK_STATE_L1 2 | ||
24 | #define PCIE_LINK_STATE_CLKPM 4 | ||
25 | |||
26 | #ifdef CONFIG_PCIEASPM | ||
27 | int pci_disable_link_state(struct pci_dev *pdev, int state); | ||
28 | int pci_disable_link_state_locked(struct pci_dev *pdev, int state); | ||
29 | void pcie_no_aspm(void); | ||
30 | #else | ||
31 | static inline int pci_disable_link_state(struct pci_dev *pdev, int state) | ||
32 | { return 0; } | ||
33 | static inline void pcie_no_aspm(void) { } | ||
34 | #endif | ||
35 | |||
36 | #endif /* LINUX_ASPM_H */ | ||
diff --git a/include/linux/pci-p2pdma.h b/include/linux/pci-p2pdma.h index bca9bc3e5be7..8318a97c9c61 100644 --- a/include/linux/pci-p2pdma.h +++ b/include/linux/pci-p2pdma.h | |||
@@ -30,8 +30,10 @@ struct scatterlist *pci_p2pmem_alloc_sgl(struct pci_dev *pdev, | |||
30 | unsigned int *nents, u32 length); | 30 | unsigned int *nents, u32 length); |
31 | void pci_p2pmem_free_sgl(struct pci_dev *pdev, struct scatterlist *sgl); | 31 | void pci_p2pmem_free_sgl(struct pci_dev *pdev, struct scatterlist *sgl); |
32 | void pci_p2pmem_publish(struct pci_dev *pdev, bool publish); | 32 | void pci_p2pmem_publish(struct pci_dev *pdev, bool publish); |
33 | int pci_p2pdma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | 33 | int pci_p2pdma_map_sg_attrs(struct device *dev, struct scatterlist *sg, |
34 | enum dma_data_direction dir); | 34 | int nents, enum dma_data_direction dir, unsigned long attrs); |
35 | void pci_p2pdma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, | ||
36 | int nents, enum dma_data_direction dir, unsigned long attrs); | ||
35 | int pci_p2pdma_enable_store(const char *page, struct pci_dev **p2p_dev, | 37 | int pci_p2pdma_enable_store(const char *page, struct pci_dev **p2p_dev, |
36 | bool *use_p2pdma); | 38 | bool *use_p2pdma); |
37 | ssize_t pci_p2pdma_enable_show(char *page, struct pci_dev *p2p_dev, | 39 | ssize_t pci_p2pdma_enable_show(char *page, struct pci_dev *p2p_dev, |
@@ -81,11 +83,17 @@ static inline void pci_p2pmem_free_sgl(struct pci_dev *pdev, | |||
81 | static inline void pci_p2pmem_publish(struct pci_dev *pdev, bool publish) | 83 | static inline void pci_p2pmem_publish(struct pci_dev *pdev, bool publish) |
82 | { | 84 | { |
83 | } | 85 | } |
84 | static inline int pci_p2pdma_map_sg(struct device *dev, | 86 | static inline int pci_p2pdma_map_sg_attrs(struct device *dev, |
85 | struct scatterlist *sg, int nents, enum dma_data_direction dir) | 87 | struct scatterlist *sg, int nents, enum dma_data_direction dir, |
88 | unsigned long attrs) | ||
86 | { | 89 | { |
87 | return 0; | 90 | return 0; |
88 | } | 91 | } |
92 | static inline void pci_p2pdma_unmap_sg_attrs(struct device *dev, | ||
93 | struct scatterlist *sg, int nents, enum dma_data_direction dir, | ||
94 | unsigned long attrs) | ||
95 | { | ||
96 | } | ||
89 | static inline int pci_p2pdma_enable_store(const char *page, | 97 | static inline int pci_p2pdma_enable_store(const char *page, |
90 | struct pci_dev **p2p_dev, bool *use_p2pdma) | 98 | struct pci_dev **p2p_dev, bool *use_p2pdma) |
91 | { | 99 | { |
@@ -111,4 +119,16 @@ static inline struct pci_dev *pci_p2pmem_find(struct device *client) | |||
111 | return pci_p2pmem_find_many(&client, 1); | 119 | return pci_p2pmem_find_many(&client, 1); |
112 | } | 120 | } |
113 | 121 | ||
122 | static inline int pci_p2pdma_map_sg(struct device *dev, struct scatterlist *sg, | ||
123 | int nents, enum dma_data_direction dir) | ||
124 | { | ||
125 | return pci_p2pdma_map_sg_attrs(dev, sg, nents, dir, 0); | ||
126 | } | ||
127 | |||
128 | static inline void pci_p2pdma_unmap_sg(struct device *dev, | ||
129 | struct scatterlist *sg, int nents, enum dma_data_direction dir) | ||
130 | { | ||
131 | pci_p2pdma_unmap_sg_attrs(dev, sg, nents, dir, 0); | ||
132 | } | ||
133 | |||
114 | #endif /* _LINUX_PCI_P2P_H */ | 134 | #endif /* _LINUX_PCI_P2P_H */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index c133579c01fa..deecf3cc17b1 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -6,12 +6,18 @@ | |||
6 | * Copyright 1994, Drew Eckhardt | 6 | * Copyright 1994, Drew Eckhardt |
7 | * Copyright 1997--1999 Martin Mares <mj@ucw.cz> | 7 | * Copyright 1997--1999 Martin Mares <mj@ucw.cz> |
8 | * | 8 | * |
9 | * PCI Express ASPM defines and function prototypes | ||
10 | * Copyright (c) 2007 Intel Corp. | ||
11 | * Zhang Yanmin (yanmin.zhang@intel.com) | ||
12 | * Shaohua Li (shaohua.li@intel.com) | ||
13 | * | ||
9 | * For more information, please consult the following manuals (look at | 14 | * For more information, please consult the following manuals (look at |
10 | * http://www.pcisig.com/ for how to get them): | 15 | * http://www.pcisig.com/ for how to get them): |
11 | * | 16 | * |
12 | * PCI BIOS Specification | 17 | * PCI BIOS Specification |
13 | * PCI Local Bus Specification | 18 | * PCI Local Bus Specification |
14 | * PCI to PCI Bridge Specification | 19 | * PCI to PCI Bridge Specification |
20 | * PCI Express Specification | ||
15 | * PCI System Design Guide | 21 | * PCI System Design Guide |
16 | */ | 22 | */ |
17 | #ifndef LINUX_PCI_H | 23 | #ifndef LINUX_PCI_H |
@@ -145,11 +151,6 @@ static inline const char *pci_power_name(pci_power_t state) | |||
145 | return pci_power_names[1 + (__force int) state]; | 151 | return pci_power_names[1 + (__force int) state]; |
146 | } | 152 | } |
147 | 153 | ||
148 | #define PCI_PM_D2_DELAY 200 | ||
149 | #define PCI_PM_D3_WAIT 10 | ||
150 | #define PCI_PM_D3COLD_WAIT 100 | ||
151 | #define PCI_PM_BUS_WAIT 50 | ||
152 | |||
153 | /** | 154 | /** |
154 | * typedef pci_channel_state_t | 155 | * typedef pci_channel_state_t |
155 | * | 156 | * |
@@ -418,7 +419,6 @@ struct pci_dev { | |||
418 | unsigned int broken_intx_masking:1; /* INTx masking can't be used */ | 419 | unsigned int broken_intx_masking:1; /* INTx masking can't be used */ |
419 | unsigned int io_window_1k:1; /* Intel bridge 1K I/O windows */ | 420 | unsigned int io_window_1k:1; /* Intel bridge 1K I/O windows */ |
420 | unsigned int irq_managed:1; | 421 | unsigned int irq_managed:1; |
421 | unsigned int has_secondary_link:1; | ||
422 | unsigned int non_compliant_bars:1; /* Broken BARs; ignore them */ | 422 | unsigned int non_compliant_bars:1; /* Broken BARs; ignore them */ |
423 | unsigned int is_probed:1; /* Device probing in progress */ | 423 | unsigned int is_probed:1; /* Device probing in progress */ |
424 | unsigned int link_active_reporting:1;/* Device capable of reporting link active */ | 424 | unsigned int link_active_reporting:1;/* Device capable of reporting link active */ |
@@ -649,9 +649,6 @@ static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev) | |||
649 | return dev->bus->self; | 649 | return dev->bus->self; |
650 | } | 650 | } |
651 | 651 | ||
652 | struct device *pci_get_host_bridge_device(struct pci_dev *dev); | ||
653 | void pci_put_host_bridge_device(struct device *dev); | ||
654 | |||
655 | #ifdef CONFIG_PCI_MSI | 652 | #ifdef CONFIG_PCI_MSI |
656 | static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) | 653 | static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) |
657 | { | 654 | { |
@@ -925,6 +922,11 @@ enum { | |||
925 | PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, /* Scan all, not just dev 0 */ | 922 | PCI_SCAN_ALL_PCIE_DEVS = 0x00000040, /* Scan all, not just dev 0 */ |
926 | }; | 923 | }; |
927 | 924 | ||
925 | #define PCI_IRQ_LEGACY (1 << 0) /* Allow legacy interrupts */ | ||
926 | #define PCI_IRQ_MSI (1 << 1) /* Allow MSI interrupts */ | ||
927 | #define PCI_IRQ_MSIX (1 << 2) /* Allow MSI-X interrupts */ | ||
928 | #define PCI_IRQ_AFFINITY (1 << 3) /* Auto-assign affinity */ | ||
929 | |||
928 | /* These external functions are only available when PCI support is enabled */ | 930 | /* These external functions are only available when PCI support is enabled */ |
929 | #ifdef CONFIG_PCI | 931 | #ifdef CONFIG_PCI |
930 | 932 | ||
@@ -995,7 +997,6 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, | |||
995 | int pci_scan_root_bus_bridge(struct pci_host_bridge *bridge); | 997 | int pci_scan_root_bus_bridge(struct pci_host_bridge *bridge); |
996 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, | 998 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, |
997 | int busnr); | 999 | int busnr); |
998 | void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); | ||
999 | struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, | 1000 | struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, |
1000 | const char *name, | 1001 | const char *name, |
1001 | struct hotplug_slot *hotplug); | 1002 | struct hotplug_slot *hotplug); |
@@ -1241,19 +1242,12 @@ int pci_wake_from_d3(struct pci_dev *dev, bool enable); | |||
1241 | int pci_prepare_to_sleep(struct pci_dev *dev); | 1242 | int pci_prepare_to_sleep(struct pci_dev *dev); |
1242 | int pci_back_from_sleep(struct pci_dev *dev); | 1243 | int pci_back_from_sleep(struct pci_dev *dev); |
1243 | bool pci_dev_run_wake(struct pci_dev *dev); | 1244 | bool pci_dev_run_wake(struct pci_dev *dev); |
1244 | bool pci_check_pme_status(struct pci_dev *dev); | ||
1245 | void pci_pme_wakeup_bus(struct pci_bus *bus); | ||
1246 | void pci_d3cold_enable(struct pci_dev *dev); | 1245 | void pci_d3cold_enable(struct pci_dev *dev); |
1247 | void pci_d3cold_disable(struct pci_dev *dev); | 1246 | void pci_d3cold_disable(struct pci_dev *dev); |
1248 | bool pcie_relaxed_ordering_enabled(struct pci_dev *dev); | 1247 | bool pcie_relaxed_ordering_enabled(struct pci_dev *dev); |
1249 | void pci_wakeup_bus(struct pci_bus *bus); | 1248 | void pci_wakeup_bus(struct pci_bus *bus); |
1250 | void pci_bus_set_current_state(struct pci_bus *bus, pci_power_t state); | 1249 | void pci_bus_set_current_state(struct pci_bus *bus, pci_power_t state); |
1251 | 1250 | ||
1252 | /* PCI Virtual Channel */ | ||
1253 | int pci_save_vc_state(struct pci_dev *dev); | ||
1254 | void pci_restore_vc_state(struct pci_dev *dev); | ||
1255 | void pci_allocate_vc_save_buffers(struct pci_dev *dev); | ||
1256 | |||
1257 | /* For use by arch with custom probe code */ | 1251 | /* For use by arch with custom probe code */ |
1258 | void set_pcie_port_type(struct pci_dev *pdev); | 1252 | void set_pcie_port_type(struct pci_dev *pdev); |
1259 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); | 1253 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); |
@@ -1297,8 +1291,6 @@ int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *); | |||
1297 | void pci_release_selected_regions(struct pci_dev *, int); | 1291 | void pci_release_selected_regions(struct pci_dev *, int); |
1298 | 1292 | ||
1299 | /* drivers/pci/bus.c */ | 1293 | /* drivers/pci/bus.c */ |
1300 | struct pci_bus *pci_bus_get(struct pci_bus *bus); | ||
1301 | void pci_bus_put(struct pci_bus *bus); | ||
1302 | void pci_add_resource(struct list_head *resources, struct resource *res); | 1294 | void pci_add_resource(struct list_head *resources, struct resource *res); |
1303 | void pci_add_resource_offset(struct list_head *resources, struct resource *res, | 1295 | void pci_add_resource_offset(struct list_head *resources, struct resource *res, |
1304 | resource_size_t offset); | 1296 | resource_size_t offset); |
@@ -1408,11 +1400,6 @@ resource_size_t pcibios_window_alignment(struct pci_bus *bus, | |||
1408 | int pci_set_vga_state(struct pci_dev *pdev, bool decode, | 1400 | int pci_set_vga_state(struct pci_dev *pdev, bool decode, |
1409 | unsigned int command_bits, u32 flags); | 1401 | unsigned int command_bits, u32 flags); |
1410 | 1402 | ||
1411 | #define PCI_IRQ_LEGACY (1 << 0) /* Allow legacy interrupts */ | ||
1412 | #define PCI_IRQ_MSI (1 << 1) /* Allow MSI interrupts */ | ||
1413 | #define PCI_IRQ_MSIX (1 << 2) /* Allow MSI-X interrupts */ | ||
1414 | #define PCI_IRQ_AFFINITY (1 << 3) /* Auto-assign affinity */ | ||
1415 | |||
1416 | /* | 1403 | /* |
1417 | * Virtual interrupts allow for more interrupts to be allocated | 1404 | * Virtual interrupts allow for more interrupts to be allocated |
1418 | * than the device has interrupts for. These are not programmed | 1405 | * than the device has interrupts for. These are not programmed |
@@ -1517,14 +1504,6 @@ static inline int pci_irq_get_node(struct pci_dev *pdev, int vec) | |||
1517 | } | 1504 | } |
1518 | #endif | 1505 | #endif |
1519 | 1506 | ||
1520 | static inline int | ||
1521 | pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, | ||
1522 | unsigned int max_vecs, unsigned int flags) | ||
1523 | { | ||
1524 | return pci_alloc_irq_vectors_affinity(dev, min_vecs, max_vecs, flags, | ||
1525 | NULL); | ||
1526 | } | ||
1527 | |||
1528 | /** | 1507 | /** |
1529 | * pci_irqd_intx_xlate() - Translate PCI INTx value to an IRQ domain hwirq | 1508 | * pci_irqd_intx_xlate() - Translate PCI INTx value to an IRQ domain hwirq |
1530 | * @d: the INTx IRQ domain | 1509 | * @d: the INTx IRQ domain |
@@ -1565,9 +1544,21 @@ extern bool pcie_ports_native; | |||
1565 | #define pcie_ports_native false | 1544 | #define pcie_ports_native false |
1566 | #endif | 1545 | #endif |
1567 | 1546 | ||
1547 | #define PCIE_LINK_STATE_L0S 1 | ||
1548 | #define PCIE_LINK_STATE_L1 2 | ||
1549 | #define PCIE_LINK_STATE_CLKPM 4 | ||
1550 | |||
1568 | #ifdef CONFIG_PCIEASPM | 1551 | #ifdef CONFIG_PCIEASPM |
1552 | int pci_disable_link_state(struct pci_dev *pdev, int state); | ||
1553 | int pci_disable_link_state_locked(struct pci_dev *pdev, int state); | ||
1554 | void pcie_no_aspm(void); | ||
1569 | bool pcie_aspm_support_enabled(void); | 1555 | bool pcie_aspm_support_enabled(void); |
1570 | #else | 1556 | #else |
1557 | static inline int pci_disable_link_state(struct pci_dev *pdev, int state) | ||
1558 | { return 0; } | ||
1559 | static inline int pci_disable_link_state_locked(struct pci_dev *pdev, int state) | ||
1560 | { return 0; } | ||
1561 | static inline void pcie_no_aspm(void) { } | ||
1571 | static inline bool pcie_aspm_support_enabled(void) { return false; } | 1562 | static inline bool pcie_aspm_support_enabled(void) { return false; } |
1572 | #endif | 1563 | #endif |
1573 | 1564 | ||
@@ -1577,23 +1568,8 @@ bool pci_aer_available(void); | |||
1577 | static inline bool pci_aer_available(void) { return false; } | 1568 | static inline bool pci_aer_available(void) { return false; } |
1578 | #endif | 1569 | #endif |
1579 | 1570 | ||
1580 | #ifdef CONFIG_PCIE_ECRC | ||
1581 | void pcie_set_ecrc_checking(struct pci_dev *dev); | ||
1582 | void pcie_ecrc_get_policy(char *str); | ||
1583 | #else | ||
1584 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { } | ||
1585 | static inline void pcie_ecrc_get_policy(char *str) { } | ||
1586 | #endif | ||
1587 | |||
1588 | bool pci_ats_disabled(void); | 1571 | bool pci_ats_disabled(void); |
1589 | 1572 | ||
1590 | #ifdef CONFIG_PCIE_PTM | ||
1591 | int pci_enable_ptm(struct pci_dev *dev, u8 *granularity); | ||
1592 | #else | ||
1593 | static inline int pci_enable_ptm(struct pci_dev *dev, u8 *granularity) | ||
1594 | { return -EINVAL; } | ||
1595 | #endif | ||
1596 | |||
1597 | void pci_cfg_access_lock(struct pci_dev *dev); | 1573 | void pci_cfg_access_lock(struct pci_dev *dev); |
1598 | bool pci_cfg_access_trylock(struct pci_dev *dev); | 1574 | bool pci_cfg_access_trylock(struct pci_dev *dev); |
1599 | void pci_cfg_access_unlock(struct pci_dev *dev); | 1575 | void pci_cfg_access_unlock(struct pci_dev *dev); |
@@ -1747,11 +1723,6 @@ static inline void pci_release_regions(struct pci_dev *dev) { } | |||
1747 | 1723 | ||
1748 | static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } | 1724 | static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } |
1749 | 1725 | ||
1750 | static inline void pci_block_cfg_access(struct pci_dev *dev) { } | ||
1751 | static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) | ||
1752 | { return 0; } | ||
1753 | static inline void pci_unblock_cfg_access(struct pci_dev *dev) { } | ||
1754 | |||
1755 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) | 1726 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) |
1756 | { return NULL; } | 1727 | { return NULL; } |
1757 | static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, | 1728 | static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, |
@@ -1780,17 +1751,36 @@ static inline const struct pci_device_id *pci_match_id(const struct pci_device_i | |||
1780 | struct pci_dev *dev) | 1751 | struct pci_dev *dev) |
1781 | { return NULL; } | 1752 | { return NULL; } |
1782 | static inline bool pci_ats_disabled(void) { return true; } | 1753 | static inline bool pci_ats_disabled(void) { return true; } |
1754 | |||
1755 | static inline int pci_irq_vector(struct pci_dev *dev, unsigned int nr) | ||
1756 | { | ||
1757 | return -EINVAL; | ||
1758 | } | ||
1759 | |||
1760 | static inline int | ||
1761 | pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, | ||
1762 | unsigned int max_vecs, unsigned int flags, | ||
1763 | struct irq_affinity *aff_desc) | ||
1764 | { | ||
1765 | return -ENOSPC; | ||
1766 | } | ||
1783 | #endif /* CONFIG_PCI */ | 1767 | #endif /* CONFIG_PCI */ |
1784 | 1768 | ||
1769 | static inline int | ||
1770 | pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, | ||
1771 | unsigned int max_vecs, unsigned int flags) | ||
1772 | { | ||
1773 | return pci_alloc_irq_vectors_affinity(dev, min_vecs, max_vecs, flags, | ||
1774 | NULL); | ||
1775 | } | ||
1776 | |||
1785 | #ifdef CONFIG_PCI_ATS | 1777 | #ifdef CONFIG_PCI_ATS |
1786 | /* Address Translation Service */ | 1778 | /* Address Translation Service */ |
1787 | void pci_ats_init(struct pci_dev *dev); | ||
1788 | int pci_enable_ats(struct pci_dev *dev, int ps); | 1779 | int pci_enable_ats(struct pci_dev *dev, int ps); |
1789 | void pci_disable_ats(struct pci_dev *dev); | 1780 | void pci_disable_ats(struct pci_dev *dev); |
1790 | int pci_ats_queue_depth(struct pci_dev *dev); | 1781 | int pci_ats_queue_depth(struct pci_dev *dev); |
1791 | int pci_ats_page_aligned(struct pci_dev *dev); | 1782 | int pci_ats_page_aligned(struct pci_dev *dev); |
1792 | #else | 1783 | #else |
1793 | static inline void pci_ats_init(struct pci_dev *d) { } | ||
1794 | static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; } | 1784 | static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; } |
1795 | static inline void pci_disable_ats(struct pci_dev *d) { } | 1785 | static inline void pci_disable_ats(struct pci_dev *d) { } |
1796 | static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; } | 1786 | static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; } |
@@ -1870,25 +1860,9 @@ static inline const char *pci_name(const struct pci_dev *pdev) | |||
1870 | return dev_name(&pdev->dev); | 1860 | return dev_name(&pdev->dev); |
1871 | } | 1861 | } |
1872 | 1862 | ||
1873 | |||
1874 | /* | ||
1875 | * Some archs don't want to expose struct resource to userland as-is | ||
1876 | * in sysfs and /proc | ||
1877 | */ | ||
1878 | #ifdef HAVE_ARCH_PCI_RESOURCE_TO_USER | ||
1879 | void pci_resource_to_user(const struct pci_dev *dev, int bar, | 1863 | void pci_resource_to_user(const struct pci_dev *dev, int bar, |
1880 | const struct resource *rsrc, | 1864 | const struct resource *rsrc, |
1881 | resource_size_t *start, resource_size_t *end); | 1865 | resource_size_t *start, resource_size_t *end); |
1882 | #else | ||
1883 | static inline void pci_resource_to_user(const struct pci_dev *dev, int bar, | ||
1884 | const struct resource *rsrc, resource_size_t *start, | ||
1885 | resource_size_t *end) | ||
1886 | { | ||
1887 | *start = rsrc->start; | ||
1888 | *end = rsrc->end; | ||
1889 | } | ||
1890 | #endif /* HAVE_ARCH_PCI_RESOURCE_TO_USER */ | ||
1891 | |||
1892 | 1866 | ||
1893 | /* | 1867 | /* |
1894 | * The world is not perfect and supplies us with broken PCI devices. | 1868 | * The world is not perfect and supplies us with broken PCI devices. |
@@ -2030,10 +2004,6 @@ extern unsigned long pci_cardbus_mem_size; | |||
2030 | extern u8 pci_dfl_cache_line_size; | 2004 | extern u8 pci_dfl_cache_line_size; |
2031 | extern u8 pci_cache_line_size; | 2005 | extern u8 pci_cache_line_size; |
2032 | 2006 | ||
2033 | extern unsigned long pci_hotplug_io_size; | ||
2034 | extern unsigned long pci_hotplug_mem_size; | ||
2035 | extern unsigned long pci_hotplug_bus_size; | ||
2036 | |||
2037 | /* Architecture-specific versions may override these (weak) */ | 2007 | /* Architecture-specific versions may override these (weak) */ |
2038 | void pcibios_disable_device(struct pci_dev *dev); | 2008 | void pcibios_disable_device(struct pci_dev *dev); |
2039 | void pcibios_set_master(struct pci_dev *dev); | 2009 | void pcibios_set_master(struct pci_dev *dev); |
@@ -2303,10 +2273,6 @@ int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, | |||
2303 | #ifdef CONFIG_OF | 2273 | #ifdef CONFIG_OF |
2304 | struct device_node; | 2274 | struct device_node; |
2305 | struct irq_domain; | 2275 | struct irq_domain; |
2306 | void pci_set_of_node(struct pci_dev *dev); | ||
2307 | void pci_release_of_node(struct pci_dev *dev); | ||
2308 | void pci_set_bus_of_node(struct pci_bus *bus); | ||
2309 | void pci_release_bus_of_node(struct pci_bus *bus); | ||
2310 | struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus); | 2276 | struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus); |
2311 | int pci_parse_request_of_pci_ranges(struct device *dev, | 2277 | int pci_parse_request_of_pci_ranges(struct device *dev, |
2312 | struct list_head *resources, | 2278 | struct list_head *resources, |
@@ -2316,10 +2282,6 @@ int pci_parse_request_of_pci_ranges(struct device *dev, | |||
2316 | struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus); | 2282 | struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus); |
2317 | 2283 | ||
2318 | #else /* CONFIG_OF */ | 2284 | #else /* CONFIG_OF */ |
2319 | static inline void pci_set_of_node(struct pci_dev *dev) { } | ||
2320 | static inline void pci_release_of_node(struct pci_dev *dev) { } | ||
2321 | static inline void pci_set_bus_of_node(struct pci_bus *bus) { } | ||
2322 | static inline void pci_release_bus_of_node(struct pci_bus *bus) { } | ||
2323 | static inline struct irq_domain * | 2285 | static inline struct irq_domain * |
2324 | pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; } | 2286 | pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; } |
2325 | static inline int pci_parse_request_of_pci_ranges(struct device *dev, | 2287 | static inline int pci_parse_request_of_pci_ranges(struct device *dev, |
@@ -2433,4 +2395,7 @@ void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type); | |||
2433 | #define pci_notice_ratelimited(pdev, fmt, arg...) \ | 2395 | #define pci_notice_ratelimited(pdev, fmt, arg...) \ |
2434 | dev_notice_ratelimited(&(pdev)->dev, fmt, ##arg) | 2396 | dev_notice_ratelimited(&(pdev)->dev, fmt, ##arg) |
2435 | 2397 | ||
2398 | #define pci_info_ratelimited(pdev, fmt, arg...) \ | ||
2399 | dev_info_ratelimited(&(pdev)->dev, fmt, ##arg) | ||
2400 | |||
2436 | #endif /* LINUX_PCI_H */ | 2401 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index f694eb2ca978..b482e42d7153 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
@@ -86,114 +86,14 @@ void pci_hp_deregister(struct hotplug_slot *slot); | |||
86 | #define pci_hp_initialize(slot, bus, nr, name) \ | 86 | #define pci_hp_initialize(slot, bus, nr, name) \ |
87 | __pci_hp_initialize(slot, bus, nr, name, THIS_MODULE, KBUILD_MODNAME) | 87 | __pci_hp_initialize(slot, bus, nr, name, THIS_MODULE, KBUILD_MODNAME) |
88 | 88 | ||
89 | /* PCI Setting Record (Type 0) */ | ||
90 | struct hpp_type0 { | ||
91 | u32 revision; | ||
92 | u8 cache_line_size; | ||
93 | u8 latency_timer; | ||
94 | u8 enable_serr; | ||
95 | u8 enable_perr; | ||
96 | }; | ||
97 | |||
98 | /* PCI-X Setting Record (Type 1) */ | ||
99 | struct hpp_type1 { | ||
100 | u32 revision; | ||
101 | u8 max_mem_read; | ||
102 | u8 avg_max_split; | ||
103 | u16 tot_max_split; | ||
104 | }; | ||
105 | |||
106 | /* PCI Express Setting Record (Type 2) */ | ||
107 | struct hpp_type2 { | ||
108 | u32 revision; | ||
109 | u32 unc_err_mask_and; | ||
110 | u32 unc_err_mask_or; | ||
111 | u32 unc_err_sever_and; | ||
112 | u32 unc_err_sever_or; | ||
113 | u32 cor_err_mask_and; | ||
114 | u32 cor_err_mask_or; | ||
115 | u32 adv_err_cap_and; | ||
116 | u32 adv_err_cap_or; | ||
117 | u16 pci_exp_devctl_and; | ||
118 | u16 pci_exp_devctl_or; | ||
119 | u16 pci_exp_lnkctl_and; | ||
120 | u16 pci_exp_lnkctl_or; | ||
121 | u32 sec_unc_err_sever_and; | ||
122 | u32 sec_unc_err_sever_or; | ||
123 | u32 sec_unc_err_mask_and; | ||
124 | u32 sec_unc_err_mask_or; | ||
125 | }; | ||
126 | |||
127 | /* | ||
128 | * _HPX PCI Express Setting Record (Type 3) | ||
129 | */ | ||
130 | struct hpx_type3 { | ||
131 | u16 device_type; | ||
132 | u16 function_type; | ||
133 | u16 config_space_location; | ||
134 | u16 pci_exp_cap_id; | ||
135 | u16 pci_exp_cap_ver; | ||
136 | u16 pci_exp_vendor_id; | ||
137 | u16 dvsec_id; | ||
138 | u16 dvsec_rev; | ||
139 | u16 match_offset; | ||
140 | u32 match_mask_and; | ||
141 | u32 match_value; | ||
142 | u16 reg_offset; | ||
143 | u32 reg_mask_and; | ||
144 | u32 reg_mask_or; | ||
145 | }; | ||
146 | |||
147 | struct hotplug_program_ops { | ||
148 | void (*program_type0)(struct pci_dev *dev, struct hpp_type0 *hpp); | ||
149 | void (*program_type1)(struct pci_dev *dev, struct hpp_type1 *hpp); | ||
150 | void (*program_type2)(struct pci_dev *dev, struct hpp_type2 *hpp); | ||
151 | void (*program_type3)(struct pci_dev *dev, struct hpx_type3 *hpp); | ||
152 | }; | ||
153 | |||
154 | enum hpx_type3_dev_type { | ||
155 | HPX_TYPE_ENDPOINT = BIT(0), | ||
156 | HPX_TYPE_LEG_END = BIT(1), | ||
157 | HPX_TYPE_RC_END = BIT(2), | ||
158 | HPX_TYPE_RC_EC = BIT(3), | ||
159 | HPX_TYPE_ROOT_PORT = BIT(4), | ||
160 | HPX_TYPE_UPSTREAM = BIT(5), | ||
161 | HPX_TYPE_DOWNSTREAM = BIT(6), | ||
162 | HPX_TYPE_PCI_BRIDGE = BIT(7), | ||
163 | HPX_TYPE_PCIE_BRIDGE = BIT(8), | ||
164 | }; | ||
165 | |||
166 | enum hpx_type3_fn_type { | ||
167 | HPX_FN_NORMAL = BIT(0), | ||
168 | HPX_FN_SRIOV_PHYS = BIT(1), | ||
169 | HPX_FN_SRIOV_VIRT = BIT(2), | ||
170 | }; | ||
171 | |||
172 | enum hpx_type3_cfg_loc { | ||
173 | HPX_CFG_PCICFG = 0, | ||
174 | HPX_CFG_PCIE_CAP = 1, | ||
175 | HPX_CFG_PCIE_CAP_EXT = 2, | ||
176 | HPX_CFG_VEND_CAP = 3, | ||
177 | HPX_CFG_DVSEC = 4, | ||
178 | HPX_CFG_MAX, | ||
179 | }; | ||
180 | |||
181 | #ifdef CONFIG_ACPI | 89 | #ifdef CONFIG_ACPI |
182 | #include <linux/acpi.h> | 90 | #include <linux/acpi.h> |
183 | int pci_acpi_program_hp_params(struct pci_dev *dev, | ||
184 | const struct hotplug_program_ops *hp_ops); | ||
185 | bool pciehp_is_native(struct pci_dev *bridge); | 91 | bool pciehp_is_native(struct pci_dev *bridge); |
186 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge); | 92 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge); |
187 | bool shpchp_is_native(struct pci_dev *bridge); | 93 | bool shpchp_is_native(struct pci_dev *bridge); |
188 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); | 94 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); |
189 | int acpi_pci_detect_ejectable(acpi_handle handle); | 95 | int acpi_pci_detect_ejectable(acpi_handle handle); |
190 | #else | 96 | #else |
191 | static inline int pci_acpi_program_hp_params(struct pci_dev *dev, | ||
192 | const struct hotplug_program_ops *hp_ops) | ||
193 | { | ||
194 | return -ENODEV; | ||
195 | } | ||
196 | |||
197 | static inline int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge) | 97 | static inline int acpi_get_hp_hw_control_from_firmware(struct pci_dev *bridge) |
198 | { | 98 | { |
199 | return 0; | 99 | return 0; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index c842735a4f45..f3130542c752 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2132,6 +2132,7 @@ | |||
2132 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 | 2132 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 |
2133 | 2133 | ||
2134 | #define PCI_VENDOR_ID_MEDIATEK 0x14c3 | 2134 | #define PCI_VENDOR_ID_MEDIATEK 0x14c3 |
2135 | #define PCI_DEVICE_ID_MEDIATEK_7629 0x7629 | ||
2135 | 2136 | ||
2136 | #define PCI_VENDOR_ID_TITAN 0x14D2 | 2137 | #define PCI_VENDOR_ID_TITAN 0x14D2 |
2137 | #define PCI_DEVICE_ID_TITAN_010L 0x8001 | 2138 | #define PCI_DEVICE_ID_TITAN_010L 0x8001 |
@@ -2570,6 +2571,8 @@ | |||
2570 | 2571 | ||
2571 | #define PCI_VENDOR_ID_ASMEDIA 0x1b21 | 2572 | #define PCI_VENDOR_ID_ASMEDIA 0x1b21 |
2572 | 2573 | ||
2574 | #define PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS 0x1c36 | ||
2575 | |||
2573 | #define PCI_VENDOR_ID_CIRCUITCO 0x1cc8 | 2576 | #define PCI_VENDOR_ID_CIRCUITCO 0x1cc8 |
2574 | #define PCI_SUBSYSTEM_ID_CIRCUITCO_MINNOWBOARD 0x0001 | 2577 | #define PCI_SUBSYSTEM_ID_CIRCUITCO_MINNOWBOARD 0x0001 |
2575 | 2578 | ||
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index f28e562d7ca8..29d6e93fd15e 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h | |||
@@ -591,6 +591,7 @@ | |||
591 | #define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */ | 591 | #define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */ |
592 | #define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ | 592 | #define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ |
593 | #define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */ | 593 | #define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */ |
594 | #define PCI_EXP_SLTCTL_ATTN_IND_SHIFT 6 /* Attention Indicator shift */ | ||
594 | #define PCI_EXP_SLTCTL_ATTN_IND_ON 0x0040 /* Attention Indicator on */ | 595 | #define PCI_EXP_SLTCTL_ATTN_IND_ON 0x0040 /* Attention Indicator on */ |
595 | #define PCI_EXP_SLTCTL_ATTN_IND_BLINK 0x0080 /* Attention Indicator blinking */ | 596 | #define PCI_EXP_SLTCTL_ATTN_IND_BLINK 0x0080 /* Attention Indicator blinking */ |
596 | #define PCI_EXP_SLTCTL_ATTN_IND_OFF 0x00c0 /* Attention Indicator off */ | 597 | #define PCI_EXP_SLTCTL_ATTN_IND_OFF 0x00c0 /* Attention Indicator off */ |
@@ -713,7 +714,9 @@ | |||
713 | #define PCI_EXT_CAP_ID_DPC 0x1D /* Downstream Port Containment */ | 714 | #define PCI_EXT_CAP_ID_DPC 0x1D /* Downstream Port Containment */ |
714 | #define PCI_EXT_CAP_ID_L1SS 0x1E /* L1 PM Substates */ | 715 | #define PCI_EXT_CAP_ID_L1SS 0x1E /* L1 PM Substates */ |
715 | #define PCI_EXT_CAP_ID_PTM 0x1F /* Precision Time Measurement */ | 716 | #define PCI_EXT_CAP_ID_PTM 0x1F /* Precision Time Measurement */ |
716 | #define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PTM | 717 | #define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */ |
718 | #define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */ | ||
719 | #define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_16GT | ||
717 | 720 | ||
718 | #define PCI_EXT_CAP_DSN_SIZEOF 12 | 721 | #define PCI_EXT_CAP_DSN_SIZEOF 12 |
719 | #define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40 | 722 | #define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40 |
@@ -1053,4 +1056,14 @@ | |||
1053 | #define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000 /* LTR_L1.2_THRESHOLD_Scale */ | 1056 | #define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000 /* LTR_L1.2_THRESHOLD_Scale */ |
1054 | #define PCI_L1SS_CTL2 0x0c /* Control 2 Register */ | 1057 | #define PCI_L1SS_CTL2 0x0c /* Control 2 Register */ |
1055 | 1058 | ||
1059 | /* Data Link Feature */ | ||
1060 | #define PCI_DLF_CAP 0x04 /* Capabilities Register */ | ||
1061 | #define PCI_DLF_EXCHANGE_ENABLE 0x80000000 /* Data Link Feature Exchange Enable */ | ||
1062 | |||
1063 | /* Physical Layer 16.0 GT/s */ | ||
1064 | #define PCI_PL_16GT_LE_CTRL 0x20 /* Lane Equalization Control Register */ | ||
1065 | #define PCI_PL_16GT_LE_CTRL_DSP_TX_PRESET_MASK 0x0000000F | ||
1066 | #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0 | ||
1067 | #define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4 | ||
1068 | |||
1056 | #endif /* LINUX_PCI_REGS_H */ | 1069 | #endif /* LINUX_PCI_REGS_H */ |