Home
last modified time | relevance | path

Searched refs:bar (Results 1 – 25 of 68) sorted by relevance

123

/linux-4.19.296/lib/
Dpci_iomap.c29 int bar, in pci_iomap_range() argument
33 resource_size_t start = pci_resource_start(dev, bar); in pci_iomap_range()
34 resource_size_t len = pci_resource_len(dev, bar); in pci_iomap_range()
35 unsigned long flags = pci_resource_flags(dev, bar); in pci_iomap_range()
69 int bar, in pci_iomap_wc_range() argument
73 resource_size_t start = pci_resource_start(dev, bar); in pci_iomap_wc_range()
74 resource_size_t len = pci_resource_len(dev, bar); in pci_iomap_wc_range()
75 unsigned long flags = pci_resource_flags(dev, bar); in pci_iomap_wc_range()
111 void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) in pci_iomap() argument
113 return pci_iomap_range(dev, bar, 0, maxlen); in pci_iomap()
[all …]
/linux-4.19.296/drivers/xen/xen-pciback/
Dconf_space_header.c138 struct pci_bar_info *bar = data; in rom_write() local
140 if (unlikely(!bar)) { in rom_write()
150 bar->which = 1; in rom_write()
154 if (tmpval != bar->val && value == bar->val) { in rom_write()
156 pci_write_config_dword(dev, offset, bar->val); in rom_write()
158 bar->which = 0; in rom_write()
172 struct pci_bar_info *bar = data; in bar_write() local
177 if (unlikely(!bar)) { in bar_write()
193 bar->which = 1; in bar_write()
197 if (tmpval != bar->val && value == bar->val) { in bar_write()
[all …]
/linux-4.19.296/drivers/pci/
Dmmap.c22 int pci_mmap_page_range(struct pci_dev *pdev, int bar, in pci_mmap_page_range() argument
28 pci_resource_to_user(pdev, bar, &pdev->resource[bar], &start, &end); in pci_mmap_page_range()
32 return pci_mmap_resource_range(pdev, bar, vma, mmap_state, in pci_mmap_page_range()
43 int pci_mmap_resource_range(struct pci_dev *pdev, int bar, in pci_mmap_resource_range() argument
50 size = ((pci_resource_len(pdev, bar) - 1) >> PAGE_SHIFT) + 1; in pci_mmap_resource_range()
60 ret = pci_iobar_pfn(pdev, bar, vma); in pci_mmap_resource_range()
64 vma->vm_pgoff += (pci_resource_start(pdev, bar) >> PAGE_SHIFT); in pci_mmap_resource_range()
81 int pci_mmap_resource_range(struct pci_dev *pdev, int bar, in pci_mmap_resource_range() argument
92 pci_resource_to_user(pdev, bar, &pdev->resource[bar], &start, &end); in pci_mmap_resource_range()
94 return pci_mmap_page_range(pdev, bar, vma, mmap_state, write_combine); in pci_mmap_resource_range()
/linux-4.19.296/drivers/pci/endpoint/
Dpci-epf-core.c91 void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar) in pci_epf_free_space() argument
98 dma_free_coherent(dev, epf->bar[bar].size, addr, in pci_epf_free_space()
99 epf->bar[bar].phys_addr); in pci_epf_free_space()
101 epf->bar[bar].phys_addr = 0; in pci_epf_free_space()
102 epf->bar[bar].size = 0; in pci_epf_free_space()
103 epf->bar[bar].barno = 0; in pci_epf_free_space()
104 epf->bar[bar].flags = 0; in pci_epf_free_space()
115 void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar) in pci_epf_alloc_space() argument
131 epf->bar[bar].phys_addr = phys_addr; in pci_epf_alloc_space()
132 epf->bar[bar].size = size; in pci_epf_alloc_space()
[all …]
/linux-4.19.296/include/linux/
Dpnp.h60 unsigned int bar) in pnp_port_start() argument
62 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); in pnp_port_start()
70 unsigned int bar) in pnp_port_end() argument
72 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); in pnp_port_end()
80 unsigned int bar) in pnp_port_flags() argument
82 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); in pnp_port_flags()
89 static inline int pnp_port_valid(struct pnp_dev *dev, unsigned int bar) in pnp_port_valid() argument
91 return pnp_resource_valid(pnp_get_resource(dev, IORESOURCE_IO, bar)); in pnp_port_valid()
95 unsigned int bar) in pnp_port_len() argument
97 struct resource *res = pnp_get_resource(dev, IORESOURCE_IO, bar); in pnp_port_len()
[all …]
Dpci-epf.h120 struct pci_epf_bar bar[6]; member
152 void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar);
153 void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar);
/linux-4.19.296/include/asm-generic/
Dpci_iomap.h13 extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
14 extern void __iomem *pci_iomap_wc(struct pci_dev *dev, int bar, unsigned long max);
15 extern void __iomem *pci_iomap_range(struct pci_dev *dev, int bar,
18 extern void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar,
32 static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) in pci_iomap() argument
37 static inline void __iomem *pci_iomap_wc(struct pci_dev *dev, int bar, unsigned long max) in pci_iomap_wc() argument
41 static inline void __iomem *pci_iomap_range(struct pci_dev *dev, int bar, in pci_iomap_range() argument
47 static inline void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar, in pci_iomap_wc_range() argument
/linux-4.19.296/drivers/misc/
Dpci_endpoint_test.c108 void __iomem *bar[6]; member
139 int bar, int offset) in pci_endpoint_test_bar_readl() argument
141 return readl(test->bar[bar] + offset); in pci_endpoint_test_bar_readl()
145 int bar, u32 offset, u32 value) in pci_endpoint_test_bar_writel() argument
147 writel(value, test->bar[bar] + offset); in pci_endpoint_test_bar_writel()
272 if (!test->bar[barno]) in pci_endpoint_test_bar()
599 enum pci_barno bar; in pci_endpoint_test_ioctl() local
610 bar = arg; in pci_endpoint_test_ioctl()
611 if (bar < 0 || bar > 5) in pci_endpoint_test_ioctl()
613 if (is_am654_pci_dev(pdev) && bar == BAR_0) in pci_endpoint_test_ioctl()
[all …]
/linux-4.19.296/drivers/pci/endpoint/functions/
Dpci-epf-test.c382 int bar; in pci_epf_test_unbind() local
386 for (bar = BAR_0; bar <= BAR_5; bar++) { in pci_epf_test_unbind()
387 epf_bar = &epf->bar[bar]; in pci_epf_test_unbind()
389 if (epf_test->reg[bar]) { in pci_epf_test_unbind()
390 pci_epf_free_space(epf, epf_test->reg[bar], bar); in pci_epf_test_unbind()
398 int bar; in pci_epf_test_set_bar() local
406 for (bar = BAR_0; bar <= BAR_5; bar++) { in pci_epf_test_set_bar()
407 epf_bar = &epf->bar[bar]; in pci_epf_test_set_bar()
415 pci_epf_free_space(epf, epf_test->reg[bar], bar); in pci_epf_test_set_bar()
416 dev_err(dev, "Failed to set BAR%d\n", bar); in pci_epf_test_set_bar()
[all …]
/linux-4.19.296/drivers/isdn/hardware/eicon/
Dos_pri.c84 a->xdi_adapter.sdram_bar = a->resources.pci.bar[0]; in diva_pri_set_addresses()
98 int bar = 0; in diva_pri_init_card() local
123 for (bar = 0; bar < 5; bar++) { in diva_pri_init_card()
124 a->resources.pci.bar[bar] = in diva_pri_init_card()
126 a->resources.pci.func, bar, in diva_pri_init_card()
128 if (!a->resources.pci.bar[bar] in diva_pri_init_card()
129 || (a->resources.pci.bar[bar] == 0xFFFFFFF0)) { in diva_pri_init_card()
130 DBG_ERR(("A: invalid bar[%d]=%08x", bar, in diva_pri_init_card()
131 a->resources.pci.bar[bar])) in diva_pri_init_card()
147 for (bar = 0; bar < 5; bar++) { in diva_pri_init_card()
[all …]
Dos_4bri.c147 int bar, i; in diva_4bri_init_card() local
197 for (bar = 0; bar < 4; bar++) { in diva_4bri_init_card()
198 a->resources.pci.bar[bar] = in diva_4bri_init_card()
200 a->resources.pci.func, bar, in diva_4bri_init_card()
202 if (!a->resources.pci.bar[bar] in diva_4bri_init_card()
203 || (a->resources.pci.bar[bar] == 0xFFFFFFF0)) { in diva_4bri_init_card()
205 ("A: invalid bar[%d]=%08x", bar, in diva_4bri_init_card()
206 a->resources.pci.bar[bar])) in diva_4bri_init_card()
219 a->xdi_adapter.sdram_bar = a->resources.pci.bar[2]; in diva_4bri_init_card()
224 for (bar = 0; bar < 4; bar++) { in diva_4bri_init_card()
[all …]
Dos_bri.c78 int bar; in diva_bri_init_card() local
94 for (bar = 0; bar < 3; bar++) { in diva_bri_init_card()
95 a->resources.pci.bar[bar] = in diva_bri_init_card()
97 a->resources.pci.func, bar, in diva_bri_init_card()
99 if (!a->resources.pci.bar[bar]) { in diva_bri_init_card()
100 DBG_ERR(("A: can't get BAR[%d]", bar)) in diva_bri_init_card()
149 divasa_remap_pci_bar(a, 0, a->resources.pci.bar[0], in diva_bri_init_card()
159 if (diva_os_register_io_port(a, 1, a->resources.pci.bar[1], in diva_bri_init_card()
165 a->resources.pci.addr[1] = (void *) (unsigned long) a->resources.pci.bar[1]; in diva_bri_init_card()
168 if (diva_os_register_io_port(a, 1, a->resources.pci.bar[2], in diva_bri_init_card()
[all …]
Ddiva_pci.h9 unsigned long bar,
11 void divasa_unmap_pci_bar(void __iomem *bar);
16 int bar, void *pci_dev_handle);
/linux-4.19.296/drivers/pci/hotplug/
Dibmphp_pci.c332 u32 bar[6]; in configure_device() local
372 pci_bus_read_config_dword(ibmphp_pci_bus, devfn, address[count], &bar[count]); in configure_device()
374 if (!bar[count]) /* This BAR is not implemented */ in configure_device()
377 debug("Device %x BAR %d wants %x\n", func->device, count, bar[count]); in configure_device()
379 if (bar[count] & PCI_BASE_ADDRESS_SPACE_IO) { in configure_device()
383 len[count] = bar[count] & 0xFFFFFFFC; in configure_device()
410 pci_bus_read_config_dword(ibmphp_pci_bus, devfn, address[count], &bar[count]); in configure_device()
411 debug("after writing.... the start address is %x\n", bar[count]); in configure_device()
416 if (bar[count] & PCI_BASE_ADDRESS_MEM_PREFETCH) { in configure_device()
420 len[count] = bar[count] & 0xFFFFFFF0; in configure_device()
[all …]
/linux-4.19.296/drivers/pci/controller/
Dpcie-cadence.h161 #define CDNS_PCIE_AT_IB_RP_BAR_ADDR0(bar) \ argument
162 (CDNS_PCIE_AT_BASE + 0x0800 + (bar) * 0x0008)
166 #define CDNS_PCIE_AT_IB_RP_BAR_ADDR1(bar) \ argument
167 (CDNS_PCIE_AT_BASE + 0x0804 + (bar) * 0x0008)
179 #define CDNS_PCIE_AT_IB_EP_FUNC_BAR_ADDR0(fn, bar) \ argument
180 (CDNS_PCIE_AT_BASE + 0x0840 + (fn) * 0x0040 + (bar) * 0x0008)
181 #define CDNS_PCIE_AT_IB_EP_FUNC_BAR_ADDR1(fn, bar) \ argument
182 (CDNS_PCIE_AT_BASE + 0x0844 + (fn) * 0x0040 + (bar) * 0x0008)
Dpcie-cadence-ep.c86 enum pci_barno bar = epf_bar->barno; in cdns_pcie_ep_set_bar() local
106 if (is_64bits && (bar & 1)) in cdns_pcie_ep_set_bar()
124 cdns_pcie_writel(pcie, CDNS_PCIE_AT_IB_EP_FUNC_BAR_ADDR0(fn, bar), in cdns_pcie_ep_set_bar()
126 cdns_pcie_writel(pcie, CDNS_PCIE_AT_IB_EP_FUNC_BAR_ADDR1(fn, bar), in cdns_pcie_ep_set_bar()
129 if (bar < BAR_4) { in cdns_pcie_ep_set_bar()
131 b = bar; in cdns_pcie_ep_set_bar()
134 b = bar - BAR_4; in cdns_pcie_ep_set_bar()
152 enum pci_barno bar = epf_bar->barno; in cdns_pcie_ep_clear_bar() local
155 if (bar < BAR_4) { in cdns_pcie_ep_clear_bar()
157 b = bar; in cdns_pcie_ep_clear_bar()
[all …]
Dpcie-rockchip-ep.c169 enum pci_barno bar = epf_bar->barno; in rockchip_pcie_ep_set_bar() local
190 if (is_64bits && (bar & 1)) in rockchip_pcie_ep_set_bar()
205 if (bar < BAR_4) { in rockchip_pcie_ep_set_bar()
207 b = bar; in rockchip_pcie_ep_set_bar()
210 b = bar - BAR_4; in rockchip_pcie_ep_set_bar()
224 ROCKCHIP_PCIE_AT_IB_EP_FUNC_BAR_ADDR0(fn, bar)); in rockchip_pcie_ep_set_bar()
226 ROCKCHIP_PCIE_AT_IB_EP_FUNC_BAR_ADDR1(fn, bar)); in rockchip_pcie_ep_set_bar()
237 enum pci_barno bar = epf_bar->barno; in rockchip_pcie_ep_clear_bar() local
239 if (bar < BAR_4) { in rockchip_pcie_ep_clear_bar()
241 b = bar; in rockchip_pcie_ep_clear_bar()
[all …]
/linux-4.19.296/drivers/uwb/
Dwhci.c96 int bar, err; in whci_add_cap() local
104 bar = UWBCAPDATA_TO_BAR(capdata) << 1; in whci_add_cap()
111 umc->bar = bar; in whci_add_cap()
112 umc->resource.start = pci_resource_start(card->pci, bar) in whci_add_cap()
117 umc->resource.flags = card->pci->resource[bar].flags; in whci_add_cap()
118 umc->resource.parent = &card->pci->resource[bar]; in whci_add_cap()
/linux-4.19.296/drivers/virtio/
Dvirtio_pci_modern.c74 u8 bar; in map_capability() local
79 bar), in map_capability()
80 &bar); in map_capability()
125 minlen + offset > pci_resource_len(dev, bar)) { in map_capability()
130 bar, (unsigned long)pci_resource_len(dev, bar)); in map_capability()
134 p = pci_iomap_range(dev, bar, offset, length); in map_capability()
138 length, offset, bar); in map_capability()
497 u8 type, bar; in virtio_pci_find_capability() local
502 bar), in virtio_pci_find_capability()
503 &bar); in virtio_pci_find_capability()
[all …]
/linux-4.19.296/drivers/misc/ocxl/
Dpci.c159 static int reserve_fn_bar(struct ocxl_fn *fn, int bar) in reserve_fn_bar() argument
164 if (bar != 0 && bar != 2 && bar != 4) in reserve_fn_bar()
167 idx = bar >> 1; in reserve_fn_bar()
169 rc = pci_request_region(dev, bar, "ocxl"); in reserve_fn_bar()
176 static void release_fn_bar(struct ocxl_fn *fn, int bar) in release_fn_bar() argument
181 if (bar != 0 && bar != 2 && bar != 4) in release_fn_bar()
184 idx = bar >> 1; in release_fn_bar()
186 pci_release_region(dev, bar); in release_fn_bar()
/linux-4.19.296/drivers/pci/controller/dwc/
Dpcie-designware-ep.c22 static void __dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar, in __dw_pcie_ep_reset_bar() argument
27 reg = PCI_BASE_ADDRESS_0 + (4 * bar); in __dw_pcie_ep_reset_bar()
38 void dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar) in dw_pcie_ep_reset_bar() argument
40 __dw_pcie_ep_reset_bar(pci, bar, 0); in dw_pcie_ep_reset_bar()
101 static int dw_pcie_ep_inbound_atu(struct dw_pcie_ep *ep, enum pci_barno bar, in dw_pcie_ep_inbound_atu() argument
115 ret = dw_pcie_prog_inbound_atu(pci, free_win, bar, cpu_addr, in dw_pcie_ep_inbound_atu()
122 ep->bar_to_atu[bar] = free_win; in dw_pcie_ep_inbound_atu()
154 enum pci_barno bar = epf_bar->barno; in dw_pcie_ep_clear_bar() local
155 u32 atu_index = ep->bar_to_atu[bar]; in dw_pcie_ep_clear_bar()
157 __dw_pcie_ep_reset_bar(pci, bar, epf_bar->flags); in dw_pcie_ep_clear_bar()
[all …]
Dpcie-designware-plat.c74 enum pci_barno bar; in dw_plat_pcie_ep_init() local
76 for (bar = BAR_0; bar <= BAR_5; bar++) in dw_plat_pcie_ep_init()
77 dw_pcie_ep_reset_bar(pci, bar); in dw_plat_pcie_ep_init()
/linux-4.19.296/drivers/i2c/busses/
Di2c-pxa-pci.c24 static struct platform_device *add_i2c_device(struct pci_dev *dev, int bar) in add_i2c_device() argument
37 res[0].start = pci_resource_start(dev, bar); in add_i2c_device()
38 res[0].end = pci_resource_end(dev, bar); in add_i2c_device()
68 bar); in add_i2c_device()
/linux-4.19.296/drivers/ntb/hw/amd/
Dntb_hw_amd.c98 int bar; in amd_ntb_mw_get_align() local
103 bar = ndev_mw_to_bar(ndev, idx); in amd_ntb_mw_get_align()
104 if (bar < 0) in amd_ntb_mw_get_align()
105 return bar; in amd_ntb_mw_get_align()
114 *size_max = pci_resource_len(ndev->ntb.pdev, bar); in amd_ntb_mw_get_align()
127 int bar; in amd_ntb_mw_set_trans() local
132 bar = ndev_mw_to_bar(ndev, idx); in amd_ntb_mw_set_trans()
133 if (bar < 0) in amd_ntb_mw_set_trans()
134 return bar; in amd_ntb_mw_set_trans()
136 mw_size = pci_resource_len(ntb->pdev, bar); in amd_ntb_mw_set_trans()
[all …]
/linux-4.19.296/drivers/ntb/hw/mscc/
Dntb_hw_switchtec.c260 int bar = sndev->peer_direct_mw_to_bar[idx]; in switchtec_ntb_mw_clr_direct() local
263 ctl_val = ioread32(&ctl->bar_entry[bar].ctl); in switchtec_ntb_mw_clr_direct()
265 iowrite32(ctl_val, &ctl->bar_entry[bar].ctl); in switchtec_ntb_mw_clr_direct()
266 iowrite32(0, &ctl->bar_entry[bar].win_size); in switchtec_ntb_mw_clr_direct()
267 iowrite64(sndev->self_partition, &ctl->bar_entry[bar].xlate_addr); in switchtec_ntb_mw_clr_direct()
281 int bar = sndev->peer_direct_mw_to_bar[idx]; in switchtec_ntb_mw_set_direct() local
285 ctl_val = ioread32(&ctl->bar_entry[bar].ctl); in switchtec_ntb_mw_set_direct()
288 iowrite32(ctl_val, &ctl->bar_entry[bar].ctl); in switchtec_ntb_mw_set_direct()
289 iowrite32(xlate_pos | size, &ctl->bar_entry[bar].win_size); in switchtec_ntb_mw_set_direct()
291 &ctl->bar_entry[bar].xlate_addr); in switchtec_ntb_mw_set_direct()
[all …]

123