Lines Matching full:bar

40 				   enum pci_barno bar, int flags)  in __dw_pcie_ep_reset_bar()  argument
45 reg = PCI_BASE_ADDRESS_0 + (4 * bar); in __dw_pcie_ep_reset_bar()
57 * dw_pcie_ep_reset_bar - Reset endpoint BAR
59 * @bar: BAR number of the endpoint
61 void dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar) in dw_pcie_ep_reset_bar() argument
68 __dw_pcie_ep_reset_bar(pci, func_no, bar, 0); in dw_pcie_ep_reset_bar()
143 dma_addr_t parent_bus_addr, enum pci_barno bar, in dw_pcie_ep_inbound_atu() argument
150 if (!ep->bar_to_atu[bar]) in dw_pcie_ep_inbound_atu()
153 free_win = ep->bar_to_atu[bar] - 1; in dw_pcie_ep_inbound_atu()
161 parent_bus_addr, bar, size); in dw_pcie_ep_inbound_atu()
171 ep->bar_to_atu[bar] = free_win + 1; in dw_pcie_ep_inbound_atu()
206 enum pci_barno bar = epf_bar->barno; in dw_pcie_ep_clear_bar() local
207 u32 atu_index = ep->bar_to_atu[bar] - 1; in dw_pcie_ep_clear_bar()
209 if (!ep->bar_to_atu[bar]) in dw_pcie_ep_clear_bar()
212 __dw_pcie_ep_reset_bar(pci, func_no, bar, epf_bar->flags); in dw_pcie_ep_clear_bar()
216 ep->epf_bar[bar] = NULL; in dw_pcie_ep_clear_bar()
217 ep->bar_to_atu[bar] = 0; in dw_pcie_ep_clear_bar()
221 enum pci_barno bar) in dw_pcie_ep_get_rebar_offset() argument
237 if (bar_index == bar) in dw_pcie_ep_get_rebar_offset()
248 enum pci_barno bar = epf_bar->barno; in dw_pcie_ep_set_bar_resizable() local
251 u32 reg = PCI_BASE_ADDRESS_0 + (4 * bar); in dw_pcie_ep_set_bar_resizable()
256 rebar_offset = dw_pcie_ep_get_rebar_offset(pci, bar); in dw_pcie_ep_set_bar_resizable()
267 * A BAR mask should not be written for a resizable BAR. The BAR mask in dw_pcie_ep_set_bar_resizable()
269 * size" bits are updated, see "Figure 3-26 Resizable BAR Example for in dw_pcie_ep_set_bar_resizable()
271 * BIT(0) to set the BAR enable bit. in dw_pcie_ep_set_bar_resizable()
292 * updated when writing PCI_REBAR_CAP, see "Figure 3-26 Resizable BAR in dw_pcie_ep_set_bar_resizable()
306 enum pci_barno bar = epf_bar->barno; in dw_pcie_ep_set_bar_programmable() local
309 u32 reg = PCI_BASE_ADDRESS_0 + (4 * bar); in dw_pcie_ep_set_bar_programmable()
327 enum pci_barno bar) in dw_pcie_ep_get_bar_type() argument
336 return epc_features->bar[bar].type; in dw_pcie_ep_get_bar_type()
344 enum pci_barno bar = epf_bar->barno; in dw_pcie_ep_set_bar() local
351 * DWC does not allow BAR pairs to overlap, e.g. you cannot combine BARs in dw_pcie_ep_set_bar()
352 * 1 and 2 to form a 64-bit BAR. in dw_pcie_ep_set_bar()
354 if ((flags & PCI_BASE_ADDRESS_MEM_TYPE_64) && (bar & 1)) in dw_pcie_ep_set_bar()
358 * Certain EPF drivers dynamically change the physical address of a BAR in dw_pcie_ep_set_bar()
360 * calling clear_bar() would clear the BAR's PCI address assigned by the in dw_pcie_ep_set_bar()
363 if (ep->epf_bar[bar]) { in dw_pcie_ep_set_bar()
365 * We can only dynamically change a BAR if the new BAR size and in dw_pcie_ep_set_bar()
366 * BAR flags do not differ from the existing configuration. in dw_pcie_ep_set_bar()
368 if (ep->epf_bar[bar]->barno != bar || in dw_pcie_ep_set_bar()
369 ep->epf_bar[bar]->size != size || in dw_pcie_ep_set_bar()
370 ep->epf_bar[bar]->flags != flags) in dw_pcie_ep_set_bar()
374 * When dynamically changing a BAR, skip writing the BAR reg, as in dw_pcie_ep_set_bar()
375 * that would clear the BAR's PCI address assigned by the host. in dw_pcie_ep_set_bar()
380 bar_type = dw_pcie_ep_get_bar_type(ep, bar); in dw_pcie_ep_set_bar()
384 * There is no need to write a BAR mask for a fixed BAR (except in dw_pcie_ep_set_bar()
385 * to write 1 to the LSB of the BAR mask register, to enable the in dw_pcie_ep_set_bar()
386 * BAR). Write the BAR mask regardless. (The fixed bits in the in dw_pcie_ep_set_bar()
387 * BAR mask register will be read-only anyway.) in dw_pcie_ep_set_bar()
398 dev_err(pci->dev, "Invalid BAR type\n"); in dw_pcie_ep_set_bar()
411 ret = dw_pcie_ep_inbound_atu(ep, func_no, type, epf_bar->phys_addr, bar, in dw_pcie_ep_set_bar()
416 ep->epf_bar[bar] = epf_bar; in dw_pcie_ep_set_bar()
843 enum pci_barno bar; in dw_pcie_ep_init_non_sticky_registers() local
857 * for 1 MB BAR size only. in dw_pcie_ep_init_non_sticky_registers()
859 * For a BAR that has been configured via dw_pcie_ep_set_bar(), in dw_pcie_ep_init_non_sticky_registers()
873 bar = FIELD_GET(PCI_REBAR_CTRL_BAR_IDX, val); in dw_pcie_ep_init_non_sticky_registers()
874 if (ep->epf_bar[bar]) in dw_pcie_ep_init_non_sticky_registers()
875 pci_epc_bar_size_to_rebar_cap(ep->epf_bar[bar]->size, &val); in dw_pcie_ep_init_non_sticky_registers()