]> Git Repo - linux.git/blob - drivers/pci/controller/dwc/pcie-designware.h
Merge tag 'mips_6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
[linux.git] / drivers / pci / controller / dwc / pcie-designware.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Synopsys DesignWare PCIe host controller driver
4  *
5  * Copyright (C) 2013 Samsung Electronics Co., Ltd.
6  *              https://www.samsung.com
7  *
8  * Author: Jingoo Han <[email protected]>
9  */
10
11 #ifndef _PCIE_DESIGNWARE_H
12 #define _PCIE_DESIGNWARE_H
13
14 #include <linux/bitfield.h>
15 #include <linux/dma-mapping.h>
16 #include <linux/irq.h>
17 #include <linux/msi.h>
18 #include <linux/pci.h>
19
20 #include <linux/pci-epc.h>
21 #include <linux/pci-epf.h>
22
23 /* DWC PCIe IP-core versions (native support since v4.70a) */
24 #define DW_PCIE_VER_365A                0x3336352a
25 #define DW_PCIE_VER_460A                0x3436302a
26 #define DW_PCIE_VER_470A                0x3437302a
27 #define DW_PCIE_VER_480A                0x3438302a
28 #define DW_PCIE_VER_490A                0x3439302a
29 #define DW_PCIE_VER_520A                0x3532302a
30
31 #define __dw_pcie_ver_cmp(_pci, _ver, _op) \
32         ((_pci)->version _op DW_PCIE_VER_ ## _ver)
33
34 #define dw_pcie_ver_is(_pci, _ver) __dw_pcie_ver_cmp(_pci, _ver, ==)
35
36 #define dw_pcie_ver_is_ge(_pci, _ver) __dw_pcie_ver_cmp(_pci, _ver, >=)
37
38 #define dw_pcie_ver_type_is(_pci, _ver, _type) \
39         (__dw_pcie_ver_cmp(_pci, _ver, ==) && \
40          __dw_pcie_ver_cmp(_pci, TYPE_ ## _type, ==))
41
42 #define dw_pcie_ver_type_is_ge(_pci, _ver, _type) \
43         (__dw_pcie_ver_cmp(_pci, _ver, ==) && \
44          __dw_pcie_ver_cmp(_pci, TYPE_ ## _type, >=))
45
46 /* Parameters for the waiting for link up routine */
47 #define LINK_WAIT_MAX_RETRIES           10
48 #define LINK_WAIT_USLEEP_MIN            90000
49 #define LINK_WAIT_USLEEP_MAX            100000
50
51 /* Parameters for the waiting for iATU enabled routine */
52 #define LINK_WAIT_MAX_IATU_RETRIES      5
53 #define LINK_WAIT_IATU                  9
54
55 /* Synopsys-specific PCIe configuration registers */
56 #define PCIE_PORT_AFR                   0x70C
57 #define PORT_AFR_N_FTS_MASK             GENMASK(15, 8)
58 #define PORT_AFR_N_FTS(n)               FIELD_PREP(PORT_AFR_N_FTS_MASK, n)
59 #define PORT_AFR_CC_N_FTS_MASK          GENMASK(23, 16)
60 #define PORT_AFR_CC_N_FTS(n)            FIELD_PREP(PORT_AFR_CC_N_FTS_MASK, n)
61 #define PORT_AFR_ENTER_ASPM             BIT(30)
62 #define PORT_AFR_L0S_ENTRANCE_LAT_SHIFT 24
63 #define PORT_AFR_L0S_ENTRANCE_LAT_MASK  GENMASK(26, 24)
64 #define PORT_AFR_L1_ENTRANCE_LAT_SHIFT  27
65 #define PORT_AFR_L1_ENTRANCE_LAT_MASK   GENMASK(29, 27)
66
67 #define PCIE_PORT_LINK_CONTROL          0x710
68 #define PORT_LINK_DLL_LINK_EN           BIT(5)
69 #define PORT_LINK_FAST_LINK_MODE        BIT(7)
70 #define PORT_LINK_MODE_MASK             GENMASK(21, 16)
71 #define PORT_LINK_MODE(n)               FIELD_PREP(PORT_LINK_MODE_MASK, n)
72 #define PORT_LINK_MODE_1_LANES          PORT_LINK_MODE(0x1)
73 #define PORT_LINK_MODE_2_LANES          PORT_LINK_MODE(0x3)
74 #define PORT_LINK_MODE_4_LANES          PORT_LINK_MODE(0x7)
75 #define PORT_LINK_MODE_8_LANES          PORT_LINK_MODE(0xf)
76
77 #define PCIE_PORT_DEBUG0                0x728
78 #define PORT_LOGIC_LTSSM_STATE_MASK     0x1f
79 #define PORT_LOGIC_LTSSM_STATE_L0       0x11
80 #define PCIE_PORT_DEBUG1                0x72C
81 #define PCIE_PORT_DEBUG1_LINK_UP                BIT(4)
82 #define PCIE_PORT_DEBUG1_LINK_IN_TRAINING       BIT(29)
83
84 #define PCIE_LINK_WIDTH_SPEED_CONTROL   0x80C
85 #define PORT_LOGIC_N_FTS_MASK           GENMASK(7, 0)
86 #define PORT_LOGIC_SPEED_CHANGE         BIT(17)
87 #define PORT_LOGIC_LINK_WIDTH_MASK      GENMASK(12, 8)
88 #define PORT_LOGIC_LINK_WIDTH(n)        FIELD_PREP(PORT_LOGIC_LINK_WIDTH_MASK, n)
89 #define PORT_LOGIC_LINK_WIDTH_1_LANES   PORT_LOGIC_LINK_WIDTH(0x1)
90 #define PORT_LOGIC_LINK_WIDTH_2_LANES   PORT_LOGIC_LINK_WIDTH(0x2)
91 #define PORT_LOGIC_LINK_WIDTH_4_LANES   PORT_LOGIC_LINK_WIDTH(0x4)
92 #define PORT_LOGIC_LINK_WIDTH_8_LANES   PORT_LOGIC_LINK_WIDTH(0x8)
93
94 #define PCIE_MSI_ADDR_LO                0x820
95 #define PCIE_MSI_ADDR_HI                0x824
96 #define PCIE_MSI_INTR0_ENABLE           0x828
97 #define PCIE_MSI_INTR0_MASK             0x82C
98 #define PCIE_MSI_INTR0_STATUS           0x830
99
100 #define GEN3_RELATED_OFF                        0x890
101 #define GEN3_RELATED_OFF_GEN3_ZRXDC_NONCOMPL    BIT(0)
102 #define GEN3_RELATED_OFF_RXEQ_RGRDLESS_RXTS     BIT(13)
103 #define GEN3_RELATED_OFF_GEN3_EQ_DISABLE        BIT(16)
104 #define GEN3_RELATED_OFF_RATE_SHADOW_SEL_SHIFT  24
105 #define GEN3_RELATED_OFF_RATE_SHADOW_SEL_MASK   GENMASK(25, 24)
106
107 #define PCIE_PORT_MULTI_LANE_CTRL       0x8C0
108 #define PORT_MLTI_UPCFG_SUPPORT         BIT(7)
109
110 #define PCIE_VERSION_NUMBER             0x8F8
111 #define PCIE_VERSION_TYPE               0x8FC
112
113 /*
114  * iATU inbound and outbound windows CSRs. Before the IP-core v4.80a each
115  * iATU region CSRs had been indirectly accessible by means of the dedicated
116  * viewport selector. The iATU/eDMA CSRs space was re-designed in DWC PCIe
117  * v4.80a in a way so the viewport was unrolled into the directly accessible
118  * iATU/eDMA CSRs space.
119  */
120 #define PCIE_ATU_VIEWPORT               0x900
121 #define PCIE_ATU_REGION_DIR_IB          BIT(31)
122 #define PCIE_ATU_REGION_DIR_OB          0
123 #define PCIE_ATU_VIEWPORT_BASE          0x904
124 #define PCIE_ATU_UNROLL_BASE(dir, index) \
125         (((index) << 9) | ((dir == PCIE_ATU_REGION_DIR_IB) ? BIT(8) : 0))
126 #define PCIE_ATU_VIEWPORT_SIZE          0x2C
127 #define PCIE_ATU_REGION_CTRL1           0x000
128 #define PCIE_ATU_INCREASE_REGION_SIZE   BIT(13)
129 #define PCIE_ATU_TYPE_MEM               0x0
130 #define PCIE_ATU_TYPE_IO                0x2
131 #define PCIE_ATU_TYPE_CFG0              0x4
132 #define PCIE_ATU_TYPE_CFG1              0x5
133 #define PCIE_ATU_TD                     BIT(8)
134 #define PCIE_ATU_FUNC_NUM(pf)           ((pf) << 20)
135 #define PCIE_ATU_REGION_CTRL2           0x004
136 #define PCIE_ATU_ENABLE                 BIT(31)
137 #define PCIE_ATU_BAR_MODE_ENABLE        BIT(30)
138 #define PCIE_ATU_FUNC_NUM_MATCH_EN      BIT(19)
139 #define PCIE_ATU_LOWER_BASE             0x008
140 #define PCIE_ATU_UPPER_BASE             0x00C
141 #define PCIE_ATU_LIMIT                  0x010
142 #define PCIE_ATU_LOWER_TARGET           0x014
143 #define PCIE_ATU_BUS(x)                 FIELD_PREP(GENMASK(31, 24), x)
144 #define PCIE_ATU_DEV(x)                 FIELD_PREP(GENMASK(23, 19), x)
145 #define PCIE_ATU_FUNC(x)                FIELD_PREP(GENMASK(18, 16), x)
146 #define PCIE_ATU_UPPER_TARGET           0x018
147 #define PCIE_ATU_UPPER_LIMIT            0x020
148
149 #define PCIE_MISC_CONTROL_1_OFF         0x8BC
150 #define PCIE_DBI_RO_WR_EN               BIT(0)
151
152 #define PCIE_MSIX_DOORBELL              0x948
153 #define PCIE_MSIX_DOORBELL_PF_SHIFT     24
154
155 #define PCIE_PL_CHK_REG_CONTROL_STATUS                  0xB20
156 #define PCIE_PL_CHK_REG_CHK_REG_START                   BIT(0)
157 #define PCIE_PL_CHK_REG_CHK_REG_CONTINUOUS              BIT(1)
158 #define PCIE_PL_CHK_REG_CHK_REG_COMPARISON_ERROR        BIT(16)
159 #define PCIE_PL_CHK_REG_CHK_REG_LOGIC_ERROR             BIT(17)
160 #define PCIE_PL_CHK_REG_CHK_REG_COMPLETE                BIT(18)
161
162 #define PCIE_PL_CHK_REG_ERR_ADDR                        0xB28
163
164 /*
165  * iATU Unroll-specific register definitions
166  * From 4.80 core version the address translation will be made by unroll
167  */
168 #define PCIE_ATU_UNR_REGION_CTRL1       0x00
169 #define PCIE_ATU_UNR_REGION_CTRL2       0x04
170 #define PCIE_ATU_UNR_LOWER_BASE         0x08
171 #define PCIE_ATU_UNR_UPPER_BASE         0x0C
172 #define PCIE_ATU_UNR_LOWER_LIMIT        0x10
173 #define PCIE_ATU_UNR_LOWER_TARGET       0x14
174 #define PCIE_ATU_UNR_UPPER_TARGET       0x18
175 #define PCIE_ATU_UNR_UPPER_LIMIT        0x20
176
177 /*
178  * RAS-DES register definitions
179  */
180 #define PCIE_RAS_DES_EVENT_COUNTER_CONTROL      0x8
181 #define EVENT_COUNTER_ALL_CLEAR         0x3
182 #define EVENT_COUNTER_ENABLE_ALL        0x7
183 #define EVENT_COUNTER_ENABLE_SHIFT      2
184 #define EVENT_COUNTER_EVENT_SEL_MASK    GENMASK(7, 0)
185 #define EVENT_COUNTER_EVENT_SEL_SHIFT   16
186 #define EVENT_COUNTER_EVENT_Tx_L0S      0x2
187 #define EVENT_COUNTER_EVENT_Rx_L0S      0x3
188 #define EVENT_COUNTER_EVENT_L1          0x5
189 #define EVENT_COUNTER_EVENT_L1_1        0x7
190 #define EVENT_COUNTER_EVENT_L1_2        0x8
191 #define EVENT_COUNTER_GROUP_SEL_SHIFT   24
192 #define EVENT_COUNTER_GROUP_5           0x5
193
194 #define PCIE_RAS_DES_EVENT_COUNTER_DATA         0xc
195
196 /*
197  * The default address offset between dbi_base and atu_base. Root controller
198  * drivers are not required to initialize atu_base if the offset matches this
199  * default; the driver core automatically derives atu_base from dbi_base using
200  * this offset, if atu_base not set.
201  */
202 #define DEFAULT_DBI_ATU_OFFSET (0x3 << 20)
203
204 #define MAX_MSI_IRQS                    256
205 #define MAX_MSI_IRQS_PER_CTRL           32
206 #define MAX_MSI_CTRLS                   (MAX_MSI_IRQS / MAX_MSI_IRQS_PER_CTRL)
207 #define MSI_REG_CTRL_BLOCK_SIZE         12
208 #define MSI_DEF_NUM_VECTORS             32
209
210 /* Maximum number of inbound/outbound iATUs */
211 #define MAX_IATU_IN                     256
212 #define MAX_IATU_OUT                    256
213
214 struct dw_pcie;
215 struct dw_pcie_rp;
216 struct dw_pcie_ep;
217
218 enum dw_pcie_device_mode {
219         DW_PCIE_UNKNOWN_TYPE,
220         DW_PCIE_EP_TYPE,
221         DW_PCIE_LEG_EP_TYPE,
222         DW_PCIE_RC_TYPE,
223 };
224
225 struct dw_pcie_host_ops {
226         int (*host_init)(struct dw_pcie_rp *pp);
227         void (*host_deinit)(struct dw_pcie_rp *pp);
228         int (*msi_host_init)(struct dw_pcie_rp *pp);
229 };
230
231 struct dw_pcie_rp {
232         bool                    has_msi_ctrl:1;
233         bool                    cfg0_io_shared:1;
234         u64                     cfg0_base;
235         void __iomem            *va_cfg0_base;
236         u32                     cfg0_size;
237         resource_size_t         io_base;
238         phys_addr_t             io_bus_addr;
239         u32                     io_size;
240         int                     irq;
241         const struct dw_pcie_host_ops *ops;
242         int                     msi_irq[MAX_MSI_CTRLS];
243         struct irq_domain       *irq_domain;
244         struct irq_domain       *msi_domain;
245         dma_addr_t              msi_data;
246         struct irq_chip         *msi_irq_chip;
247         u32                     num_vectors;
248         u32                     irq_mask[MAX_MSI_CTRLS];
249         struct pci_host_bridge  *bridge;
250         raw_spinlock_t          lock;
251         DECLARE_BITMAP(msi_irq_in_use, MAX_MSI_IRQS);
252 };
253
254 struct dw_pcie_ep_ops {
255         void    (*ep_init)(struct dw_pcie_ep *ep);
256         int     (*raise_irq)(struct dw_pcie_ep *ep, u8 func_no,
257                              enum pci_epc_irq_type type, u16 interrupt_num);
258         const struct pci_epc_features* (*get_features)(struct dw_pcie_ep *ep);
259         /*
260          * Provide a method to implement the different func config space
261          * access for different platform, if different func have different
262          * offset, return the offset of func. if use write a register way
263          * return a 0, and implement code in callback function of platform
264          * driver.
265          */
266         unsigned int (*func_conf_select)(struct dw_pcie_ep *ep, u8 func_no);
267 };
268
269 struct dw_pcie_ep_func {
270         struct list_head        list;
271         u8                      func_no;
272         u8                      msi_cap;        /* MSI capability offset */
273         u8                      msix_cap;       /* MSI-X capability offset */
274 };
275
276 struct dw_pcie_ep {
277         struct pci_epc          *epc;
278         struct list_head        func_list;
279         const struct dw_pcie_ep_ops *ops;
280         phys_addr_t             phys_base;
281         size_t                  addr_size;
282         size_t                  page_size;
283         u8                      bar_to_atu[PCI_STD_NUM_BARS];
284         phys_addr_t             *outbound_addr;
285         unsigned long           *ib_window_map;
286         unsigned long           *ob_window_map;
287         void __iomem            *msi_mem;
288         phys_addr_t             msi_mem_phys;
289         struct pci_epf_bar      *epf_bar[PCI_STD_NUM_BARS];
290 };
291
292 struct dw_pcie_ops {
293         u64     (*cpu_addr_fixup)(struct dw_pcie *pcie, u64 cpu_addr);
294         u32     (*read_dbi)(struct dw_pcie *pcie, void __iomem *base, u32 reg,
295                             size_t size);
296         void    (*write_dbi)(struct dw_pcie *pcie, void __iomem *base, u32 reg,
297                              size_t size, u32 val);
298         void    (*write_dbi2)(struct dw_pcie *pcie, void __iomem *base, u32 reg,
299                               size_t size, u32 val);
300         int     (*link_up)(struct dw_pcie *pcie);
301         int     (*start_link)(struct dw_pcie *pcie);
302         void    (*stop_link)(struct dw_pcie *pcie);
303 };
304
305 struct dw_pcie {
306         struct device           *dev;
307         void __iomem            *dbi_base;
308         void __iomem            *dbi_base2;
309         void __iomem            *atu_base;
310         size_t                  atu_size;
311         u32                     num_ib_windows;
312         u32                     num_ob_windows;
313         u32                     region_align;
314         u64                     region_limit;
315         struct dw_pcie_rp       pp;
316         struct dw_pcie_ep       ep;
317         const struct dw_pcie_ops *ops;
318         u32                     version;
319         u32                     type;
320         int                     num_lanes;
321         int                     link_gen;
322         u8                      n_fts[2];
323         bool                    iatu_unroll_enabled: 1;
324 };
325
326 #define to_dw_pcie_from_pp(port) container_of((port), struct dw_pcie, pp)
327
328 #define to_dw_pcie_from_ep(endpoint)   \
329                 container_of((endpoint), struct dw_pcie, ep)
330
331 void dw_pcie_version_detect(struct dw_pcie *pci);
332
333 u8 dw_pcie_find_capability(struct dw_pcie *pci, u8 cap);
334 u16 dw_pcie_find_ext_capability(struct dw_pcie *pci, u8 cap);
335
336 int dw_pcie_read(void __iomem *addr, int size, u32 *val);
337 int dw_pcie_write(void __iomem *addr, int size, u32 val);
338
339 u32 dw_pcie_read_dbi(struct dw_pcie *pci, u32 reg, size_t size);
340 void dw_pcie_write_dbi(struct dw_pcie *pci, u32 reg, size_t size, u32 val);
341 void dw_pcie_write_dbi2(struct dw_pcie *pci, u32 reg, size_t size, u32 val);
342 int dw_pcie_link_up(struct dw_pcie *pci);
343 void dw_pcie_upconfig_setup(struct dw_pcie *pci);
344 int dw_pcie_wait_for_link(struct dw_pcie *pci);
345 int dw_pcie_prog_outbound_atu(struct dw_pcie *pci, int index, int type,
346                               u64 cpu_addr, u64 pci_addr, u64 size);
347 int dw_pcie_prog_ep_outbound_atu(struct dw_pcie *pci, u8 func_no, int index,
348                                  int type, u64 cpu_addr, u64 pci_addr, u64 size);
349 int dw_pcie_prog_inbound_atu(struct dw_pcie *pci, u8 func_no, int index,
350                              int type, u64 cpu_addr, u8 bar);
351 void dw_pcie_disable_atu(struct dw_pcie *pci, u32 dir, int index);
352 void dw_pcie_setup(struct dw_pcie *pci);
353 void dw_pcie_iatu_detect(struct dw_pcie *pci);
354
355 static inline void dw_pcie_writel_dbi(struct dw_pcie *pci, u32 reg, u32 val)
356 {
357         dw_pcie_write_dbi(pci, reg, 0x4, val);
358 }
359
360 static inline u32 dw_pcie_readl_dbi(struct dw_pcie *pci, u32 reg)
361 {
362         return dw_pcie_read_dbi(pci, reg, 0x4);
363 }
364
365 static inline void dw_pcie_writew_dbi(struct dw_pcie *pci, u32 reg, u16 val)
366 {
367         dw_pcie_write_dbi(pci, reg, 0x2, val);
368 }
369
370 static inline u16 dw_pcie_readw_dbi(struct dw_pcie *pci, u32 reg)
371 {
372         return dw_pcie_read_dbi(pci, reg, 0x2);
373 }
374
375 static inline void dw_pcie_writeb_dbi(struct dw_pcie *pci, u32 reg, u8 val)
376 {
377         dw_pcie_write_dbi(pci, reg, 0x1, val);
378 }
379
380 static inline u8 dw_pcie_readb_dbi(struct dw_pcie *pci, u32 reg)
381 {
382         return dw_pcie_read_dbi(pci, reg, 0x1);
383 }
384
385 static inline void dw_pcie_writel_dbi2(struct dw_pcie *pci, u32 reg, u32 val)
386 {
387         dw_pcie_write_dbi2(pci, reg, 0x4, val);
388 }
389
390 static inline void dw_pcie_dbi_ro_wr_en(struct dw_pcie *pci)
391 {
392         u32 reg;
393         u32 val;
394
395         reg = PCIE_MISC_CONTROL_1_OFF;
396         val = dw_pcie_readl_dbi(pci, reg);
397         val |= PCIE_DBI_RO_WR_EN;
398         dw_pcie_writel_dbi(pci, reg, val);
399 }
400
401 static inline void dw_pcie_dbi_ro_wr_dis(struct dw_pcie *pci)
402 {
403         u32 reg;
404         u32 val;
405
406         reg = PCIE_MISC_CONTROL_1_OFF;
407         val = dw_pcie_readl_dbi(pci, reg);
408         val &= ~PCIE_DBI_RO_WR_EN;
409         dw_pcie_writel_dbi(pci, reg, val);
410 }
411
412 static inline int dw_pcie_start_link(struct dw_pcie *pci)
413 {
414         if (pci->ops && pci->ops->start_link)
415                 return pci->ops->start_link(pci);
416
417         return 0;
418 }
419
420 static inline void dw_pcie_stop_link(struct dw_pcie *pci)
421 {
422         if (pci->ops && pci->ops->stop_link)
423                 pci->ops->stop_link(pci);
424 }
425
426 #ifdef CONFIG_PCIE_DW_HOST
427 irqreturn_t dw_handle_msi_irq(struct dw_pcie_rp *pp);
428 int dw_pcie_setup_rc(struct dw_pcie_rp *pp);
429 int dw_pcie_host_init(struct dw_pcie_rp *pp);
430 void dw_pcie_host_deinit(struct dw_pcie_rp *pp);
431 int dw_pcie_allocate_domains(struct dw_pcie_rp *pp);
432 void __iomem *dw_pcie_own_conf_map_bus(struct pci_bus *bus, unsigned int devfn,
433                                        int where);
434 #else
435 static inline irqreturn_t dw_handle_msi_irq(struct dw_pcie_rp *pp)
436 {
437         return IRQ_NONE;
438 }
439
440 static inline int dw_pcie_setup_rc(struct dw_pcie_rp *pp)
441 {
442         return 0;
443 }
444
445 static inline int dw_pcie_host_init(struct dw_pcie_rp *pp)
446 {
447         return 0;
448 }
449
450 static inline void dw_pcie_host_deinit(struct dw_pcie_rp *pp)
451 {
452 }
453
454 static inline int dw_pcie_allocate_domains(struct dw_pcie_rp *pp)
455 {
456         return 0;
457 }
458 static inline void __iomem *dw_pcie_own_conf_map_bus(struct pci_bus *bus,
459                                                      unsigned int devfn,
460                                                      int where)
461 {
462         return NULL;
463 }
464 #endif
465
466 #ifdef CONFIG_PCIE_DW_EP
467 void dw_pcie_ep_linkup(struct dw_pcie_ep *ep);
468 int dw_pcie_ep_init(struct dw_pcie_ep *ep);
469 int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep);
470 void dw_pcie_ep_init_notify(struct dw_pcie_ep *ep);
471 void dw_pcie_ep_exit(struct dw_pcie_ep *ep);
472 int dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, u8 func_no);
473 int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no,
474                              u8 interrupt_num);
475 int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no,
476                              u16 interrupt_num);
477 int dw_pcie_ep_raise_msix_irq_doorbell(struct dw_pcie_ep *ep, u8 func_no,
478                                        u16 interrupt_num);
479 void dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar);
480 struct dw_pcie_ep_func *
481 dw_pcie_ep_get_func_from_ep(struct dw_pcie_ep *ep, u8 func_no);
482 #else
483 static inline void dw_pcie_ep_linkup(struct dw_pcie_ep *ep)
484 {
485 }
486
487 static inline int dw_pcie_ep_init(struct dw_pcie_ep *ep)
488 {
489         return 0;
490 }
491
492 static inline int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep)
493 {
494         return 0;
495 }
496
497 static inline void dw_pcie_ep_init_notify(struct dw_pcie_ep *ep)
498 {
499 }
500
501 static inline void dw_pcie_ep_exit(struct dw_pcie_ep *ep)
502 {
503 }
504
505 static inline int dw_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep, u8 func_no)
506 {
507         return 0;
508 }
509
510 static inline int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no,
511                                            u8 interrupt_num)
512 {
513         return 0;
514 }
515
516 static inline int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no,
517                                            u16 interrupt_num)
518 {
519         return 0;
520 }
521
522 static inline int dw_pcie_ep_raise_msix_irq_doorbell(struct dw_pcie_ep *ep,
523                                                      u8 func_no,
524                                                      u16 interrupt_num)
525 {
526         return 0;
527 }
528
529 static inline void dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar)
530 {
531 }
532
533 static inline struct dw_pcie_ep_func *
534 dw_pcie_ep_get_func_from_ep(struct dw_pcie_ep *ep, u8 func_no)
535 {
536         return NULL;
537 }
538 #endif
539 #endif /* _PCIE_DESIGNWARE_H */
This page took 0.069836 seconds and 4 git commands to generate.