Lines Matching +full:bus +full:- +full:range
1 // SPDX-License-Identifier: GPL-2.0
11 #include <linux/range.h>
14 #include <asm/pci-direct.h>
23 u32 bus; member
38 const struct range *r1 = x1; in cmp_range()
39 const struct range *r2 = x2; in cmp_range()
42 start1 = r1->start >> 32; in cmp_range()
43 start2 = r2->start >> 32; in cmp_range()
45 return start1 - start2; in cmp_range()
49 #define MMCONF_MASK (~(MMCONF_UNIT - 1))
57 unsigned bus; in get_fam10h_pci_mmconf_base() local
67 struct range range[8]; in get_fam10h_pci_mmconf_base() local
82 bus = pci_probes[i].bus; in get_fam10h_pci_mmconf_base()
84 id = read_pci_config(bus, slot, 0, PCI_VENDOR_ID); in get_fam10h_pci_mmconf_base()
113 base = (tom2 + 2 * MMCONF_UNIT - 1) & MMCONF_MASK; in get_fam10h_pci_mmconf_base()
116 * need to check if the range is in the high mmio range that is in get_fam10h_pci_mmconf_base()
124 reg = read_pci_config(bus, slot, 1, 0x80 + (i << 3)); in get_fam10h_pci_mmconf_base()
129 reg = read_pci_config(bus, slot, 1, 0x84 + (i << 3)); in get_fam10h_pci_mmconf_base()
135 range[hi_mmio_num].start = start; in get_fam10h_pci_mmconf_base()
136 range[hi_mmio_num].end = end; in get_fam10h_pci_mmconf_base()
143 /* sort the range */ in get_fam10h_pci_mmconf_base()
144 sort(range, hi_mmio_num, sizeof(struct range), cmp_range, NULL); in get_fam10h_pci_mmconf_base()
146 if (range[hi_mmio_num - 1].end < base) in get_fam10h_pci_mmconf_base()
148 if (range[0].start > base + MMCONF_SIZE) in get_fam10h_pci_mmconf_base()
152 base = (range[0].start & MMCONF_MASK) - MMCONF_UNIT; in get_fam10h_pci_mmconf_base()
155 base = (range[hi_mmio_num - 1].end + MMCONF_UNIT) & MMCONF_MASK; in get_fam10h_pci_mmconf_base()
160 base = (range[i - 1].end + MMCONF_UNIT) & MMCONF_MASK; in get_fam10h_pci_mmconf_base()
161 val = range[i].start & MMCONF_MASK; in get_fam10h_pci_mmconf_base()