- Use memcpy_fromio()/memcpy_toio() instead of plain memcpy() in PCI endpoint framework (Wen Yang) - Add interface to discover supported endpoint features to replace a bitfield that wasn't flexible enough (Kishon Vijay Abraham I) - Implement the new supported-feature interface for designware-plat, dra7xx, rockchip, cadence (Kishon Vijay Abraham I) - Fix issues with 64-bit BAR in endpoints (Kishon Vijay Abraham I) - Add layerscape endpoint mode support (Xiaowei Bao) * remotes/lorenzo/pci/endpoint: misc: pci_endpoint_test: Add the layerscape EP device support PCI: layerscape: Add EP mode support arm64: dts: Add the PCIE EP node in dts dt-bindings: add DT binding for the layerscape PCIe controller with EP mode PCI: endpoint: Remove features member in struct pci_epc PCI: designware-plat: Remove setting epc->features in Designware plat EP driver PCI: rockchip: Remove pci_epf_linkup() from Rockchip EP driver PCI: cadence: Remove pci_epf_linkup() from Cadence EP driver PCI: pci-epf-test: Use pci_epc_get_features() to get EPC features PCI: pci-epf-test: Do not allocate next BARs memory if current BAR is 64Bit PCI: pci-epf-test: Remove setting epf_bar flags in function driver PCI: endpoint: Fix pci_epf_alloc_space() to set correct MEM TYPE flags PCI: endpoint: Add helper to get first unreserved BAR PCI: cadence: Populate ->get_features() cdns_pcie_epc_ops PCI: rockchip: Populate ->get_features() dw_pcie_ep_ops PCI: pci-dra7xx: Populate ->get_features() dw_pcie_ep_ops PCI: designware-plat: Populate ->get_features() dw_pcie_ep_ops PCI: dwc: Add ->get_features() callback function to dw_pcie_ep_ops PCI: endpoint: Add new pci_epc_ops to get EPC features PCI: endpoint: functions: Use memcpy_fromio()/memcpy_toio()
Showing the changes to include/linux (1 of 15 files). Show all
Unified · Split
| @@ -59,6 +59,8 @@ struct pci_epc_ops { · 58 unmodified lines | |||
| 59 | enum pci_epc_irq_type type, u16 interrupt_num); | 59 | enum pci_epc_irq_type type, u16 interrupt_num); |
| 60 | int (*start)(struct pci_epc *epc); | 60 | int (*start)(struct pci_epc *epc); |
| 61 | void (*stop)(struct pci_epc *epc); | 61 | void (*stop)(struct pci_epc *epc); |
| 62 | const struct pci_epc_features* (*get_features)(struct pci_epc *epc, | ||
| 63 | u8 func_no); | ||
| 62 | struct module *owner; | 64 | struct module *owner; |
| 63 | }; | 65 | }; |
| 64 | 66 | ||
| @@ -97,16 +99,25 @@ struct pci_epc { · 32 unmodified lines | |||
| 97 | struct config_group *group; | 99 | struct config_group *group; |
| 98 | /* spinlock to protect against concurrent access of EP controller */ | 100 | /* spinlock to protect against concurrent access of EP controller */ |
| 99 | spinlock_t lock; | 101 | spinlock_t lock; |
| 100 | unsigned int features; | ||
| 101 | }; | 102 | }; |
| 102 | 103 | ||
| 103 | #define EPC_FEATURE_NO_LINKUP_NOTIFIER BIT(0) | 104 | /** |
| 104 | #define EPC_FEATURE_BAR_MASK (BIT(1) | BIT(2) | BIT(3)) | 105 | * struct pci_epc_features - features supported by a EPC device per function |
| 105 | #define EPC_FEATURE_MSIX_AVAILABLE BIT(4) | 106 | * @linkup_notifier: indicate if the EPC device can notify EPF driver on link up |
| 106 | #define EPC_FEATURE_SET_BAR(features, bar) \ | 107 | * @msi_capable: indicate if the endpoint function has MSI capability |
| 107 | (features |= (EPC_FEATURE_BAR_MASK & (bar << 1))) | 108 | * @msix_capable: indicate if the endpoint function has MSI-X capability |
| 108 | #define EPC_FEATURE_GET_BAR(features) \ | 109 | * @reserved_bar: bitmap to indicate reserved BAR unavailable to function driver |
| 109 | ((features & EPC_FEATURE_BAR_MASK) >> 1) | 110 | * @bar_fixed_64bit: bitmap to indicate fixed 64bit BARs |
| 111 | * @bar_fixed_size: Array specifying the size supported by each BAR | ||
| 112 | */ | ||
| 113 | struct pci_epc_features { | ||
| 114 | unsigned int linkup_notifier : 1; | ||
| 115 | unsigned int msi_capable : 1; | ||
| 116 | unsigned int msix_capable : 1; | ||
| 117 | u8 reserved_bar; | ||
| 118 | u8 bar_fixed_64bit; | ||
| 119 | u64 bar_fixed_size[BAR_5 + 1]; | ||
| 120 | }; | ||
| 110 | 121 | ||
| 111 | #define to_pci_epc(device) container_of((device), struct pci_epc, dev) | 122 | #define to_pci_epc(device) container_of((device), struct pci_epc, dev) |
| 112 | 123 | ||
| @@ -158,6 +169,10 @@ int pci_epc_raise_irq(struct pci_epc *epc, u8 func_no, · 45 unmodified lines | |||
| 158 | enum pci_epc_irq_type type, u16 interrupt_num); | 169 | enum pci_epc_irq_type type, u16 interrupt_num); |
| 159 | int pci_epc_start(struct pci_epc *epc); | 170 | int pci_epc_start(struct pci_epc *epc); |
| 160 | void pci_epc_stop(struct pci_epc *epc); | 171 | void pci_epc_stop(struct pci_epc *epc); |
| 172 | const struct pci_epc_features *pci_epc_get_features(struct pci_epc *epc, | ||
| 173 | u8 func_no); | ||
| 174 | unsigned int pci_epc_get_first_free_bar(const struct pci_epc_features | ||
| 175 | *epc_features); | ||
| 161 | struct pci_epc *pci_epc_get(const char *epc_name); | 176 | struct pci_epc *pci_epc_get(const char *epc_name); |
| 162 | void pci_epc_put(struct pci_epc *epc); | 177 | void pci_epc_put(struct pci_epc *epc); |
| 163 | 178 | ||