Lines Matching +full:cfg +full:- +full:space

1 // SPDX-License-Identifier: GPL-2.0
3 * mmconfig.c - Low-level direct PCI config space access via MMCONFIG
6 * space mapped. This allows lockless config space operation.
21 struct pci_mmcfg_region *cfg = pci_mmconfig_lookup(seg, bus); in pci_dev_base() local
23 if (cfg && cfg->virt) in pci_dev_base()
24 return cfg->virt + (PCI_MMCFG_BUS_OFFSET(bus) | (devfn << 12)); in pci_dev_base()
33 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ in pci_mmcfg_read()
35 err: *value = -1; in pci_mmcfg_read()
36 return -EINVAL; in pci_mmcfg_read()
67 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ in pci_mmcfg_write()
69 return -EINVAL; in pci_mmcfg_write()
75 return -EINVAL; in pci_mmcfg_write()
99 static void __iomem *mcfg_ioremap(struct pci_mmcfg_region *cfg) in mcfg_ioremap() argument
105 start = cfg->address + PCI_MMCFG_BUS_OFFSET(cfg->start_bus); in mcfg_ioremap()
106 num_buses = cfg->end_bus - cfg->start_bus + 1; in mcfg_ioremap()
110 addr -= PCI_MMCFG_BUS_OFFSET(cfg->start_bus); in mcfg_ioremap()
116 struct pci_mmcfg_region *cfg; in pci_mmcfg_arch_init() local
118 list_for_each_entry(cfg, &pci_mmcfg_list, list) in pci_mmcfg_arch_init()
119 if (pci_mmcfg_arch_map(cfg)) { in pci_mmcfg_arch_init()
131 struct pci_mmcfg_region *cfg; in pci_mmcfg_arch_free() local
133 list_for_each_entry(cfg, &pci_mmcfg_list, list) in pci_mmcfg_arch_free()
134 pci_mmcfg_arch_unmap(cfg); in pci_mmcfg_arch_free()
137 int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg) in pci_mmcfg_arch_map() argument
139 cfg->virt = mcfg_ioremap(cfg); in pci_mmcfg_arch_map()
140 if (!cfg->virt) { in pci_mmcfg_arch_map()
141 pr_err(PREFIX "can't map MMCONFIG at %pR\n", &cfg->res); in pci_mmcfg_arch_map()
142 return -ENOMEM; in pci_mmcfg_arch_map()
148 void pci_mmcfg_arch_unmap(struct pci_mmcfg_region *cfg) in pci_mmcfg_arch_unmap() argument
150 if (cfg && cfg->virt) { in pci_mmcfg_arch_unmap()
151 iounmap(cfg->virt + PCI_MMCFG_BUS_OFFSET(cfg->start_bus)); in pci_mmcfg_arch_unmap()
152 cfg->virt = NULL; in pci_mmcfg_arch_unmap()