Lines Matching full:bar

185 	 * Set the root complex BAR configuration register:  in cdns_pcie_host_init_root_port()
219 enum cdns_pcie_rp_bar bar, in cdns_pcie_host_bar_ib_config() argument
226 if (!rc->avail_ib_bar[bar]) in cdns_pcie_host_bar_ib_config()
229 rc->avail_ib_bar[bar] = false; in cdns_pcie_host_bar_ib_config()
235 cdns_pcie_writel(pcie, CDNS_PCIE_AT_IB_RP_BAR_ADDR0(bar), addr0); in cdns_pcie_host_bar_ib_config()
236 cdns_pcie_writel(pcie, CDNS_PCIE_AT_IB_RP_BAR_ADDR1(bar), addr1); in cdns_pcie_host_bar_ib_config()
238 if (bar == RP_NO_BAR) in cdns_pcie_host_bar_ib_config()
242 value &= ~(LM_RC_BAR_CFG_CTRL_MEM_64BITS(bar) | in cdns_pcie_host_bar_ib_config()
243 LM_RC_BAR_CFG_CTRL_PREF_MEM_64BITS(bar) | in cdns_pcie_host_bar_ib_config()
244 LM_RC_BAR_CFG_CTRL_MEM_32BITS(bar) | in cdns_pcie_host_bar_ib_config()
245 LM_RC_BAR_CFG_CTRL_PREF_MEM_32BITS(bar) | in cdns_pcie_host_bar_ib_config()
246 LM_RC_BAR_CFG_APERTURE(bar, bar_aperture_mask[bar] + 2)); in cdns_pcie_host_bar_ib_config()
249 value |= LM_RC_BAR_CFG_CTRL_MEM_64BITS(bar); in cdns_pcie_host_bar_ib_config()
250 value |= LM_RC_BAR_CFG_CTRL_PREF_MEM_64BITS(bar); in cdns_pcie_host_bar_ib_config()
253 value |= LM_RC_BAR_CFG_CTRL_MEM_32BITS(bar); in cdns_pcie_host_bar_ib_config()
254 value |= LM_RC_BAR_CFG_CTRL_PREF_MEM_32BITS(bar); in cdns_pcie_host_bar_ib_config()
257 value |= LM_RC_BAR_CFG_APERTURE(bar, aperture); in cdns_pcie_host_bar_ib_config()
266 enum cdns_pcie_rp_bar bar, sel_bar; in cdns_pcie_host_find_min_bar() local
269 for (bar = RP_BAR0; bar <= RP_NO_BAR; bar++) { in cdns_pcie_host_find_min_bar()
270 if (!rc->avail_ib_bar[bar]) in cdns_pcie_host_find_min_bar()
273 if (size <= bar_max_size[bar]) { in cdns_pcie_host_find_min_bar()
275 sel_bar = bar; in cdns_pcie_host_find_min_bar()
279 if (bar_max_size[bar] < bar_max_size[sel_bar]) in cdns_pcie_host_find_min_bar()
280 sel_bar = bar; in cdns_pcie_host_find_min_bar()
290 enum cdns_pcie_rp_bar bar, sel_bar; in cdns_pcie_host_find_max_bar() local
293 for (bar = RP_BAR0; bar <= RP_NO_BAR; bar++) { in cdns_pcie_host_find_max_bar()
294 if (!rc->avail_ib_bar[bar]) in cdns_pcie_host_find_max_bar()
297 if (size >= bar_max_size[bar]) { in cdns_pcie_host_find_max_bar()
299 sel_bar = bar; in cdns_pcie_host_find_max_bar()
303 if (bar_max_size[bar] > bar_max_size[sel_bar]) in cdns_pcie_host_find_max_bar()
304 sel_bar = bar; in cdns_pcie_host_find_max_bar()
317 enum cdns_pcie_rp_bar bar; in cdns_pcie_host_bar_config() local
334 * Try to find a minimum BAR whose size is greater than in cdns_pcie_host_bar_config()
338 * If a minimum BAR is found, IB ATU will be configured and in cdns_pcie_host_bar_config()
341 bar = cdns_pcie_host_find_min_bar(rc, size); in cdns_pcie_host_bar_config()
342 if (bar != RP_BAR_UNDEFINED) { in cdns_pcie_host_bar_config()
343 ret = cdns_pcie_host_bar_ib_config(rc, bar, cpu_addr, in cdns_pcie_host_bar_config()
346 dev_err(dev, "IB BAR: %d config failed\n", bar); in cdns_pcie_host_bar_config()
352 * resource_entry size cannot be fitted in a single BAR. So we in cdns_pcie_host_bar_config()
353 * find a maximum BAR whose size is less than or equal to the in cdns_pcie_host_bar_config()
356 * BAR. The remaining size would be fitted during the next in cdns_pcie_host_bar_config()
358 * If a maximum BAR is not found, there is no way we can fit in cdns_pcie_host_bar_config()
361 bar = cdns_pcie_host_find_max_bar(rc, size); in cdns_pcie_host_bar_config()
362 if (bar == RP_BAR_UNDEFINED) { in cdns_pcie_host_bar_config()
363 dev_err(dev, "No free BAR to map cpu_addr %llx\n", in cdns_pcie_host_bar_config()
368 winsize = bar_max_size[bar]; in cdns_pcie_host_bar_config()
369 ret = cdns_pcie_host_bar_ib_config(rc, bar, cpu_addr, winsize, in cdns_pcie_host_bar_config()
372 dev_err(dev, "IB BAR: %d config failed\n", bar); in cdns_pcie_host_bar_config()
409 of_property_read_u32(np, "cdns,no-bar-match-nbits", in cdns_pcie_host_map_dma_ranges()
414 dev_err(dev, "IB BAR: %d config failed\n", RP_NO_BAR); in cdns_pcie_host_map_dma_ranges()
529 enum cdns_pcie_rp_bar bar; in cdns_pcie_host_setup() local
563 for (bar = RP_BAR0; bar <= RP_NO_BAR; bar++) in cdns_pcie_host_setup()
564 rc->avail_ib_bar[bar] = true; in cdns_pcie_host_setup()