Lines Matching refs:res
558 struct resource *res; in pci_process_bridge_OF_ranges() local
586 res = NULL; in pci_process_bridge_OF_ranges()
617 res = &hose->io_resource; in pci_process_bridge_OF_ranges()
660 res = &hose->mem_resources[memno++]; in pci_process_bridge_OF_ranges()
663 if (res != NULL) { in pci_process_bridge_OF_ranges()
664 res->name = dev->full_name; in pci_process_bridge_OF_ranges()
665 res->flags = range.flags; in pci_process_bridge_OF_ranges()
666 res->start = range.cpu_addr; in pci_process_bridge_OF_ranges()
667 res->end = range.cpu_addr + range.size - 1; in pci_process_bridge_OF_ranges()
668 res->parent = res->child = res->sibling = NULL; in pci_process_bridge_OF_ranges()
707 struct resource *res = dev->resource + i; in pcibios_fixup_resources() local
708 if (!res->flags) in pcibios_fixup_resources()
710 if (res->start == 0) { in pcibios_fixup_resources()
713 (unsigned long long)res->start, in pcibios_fixup_resources()
714 (unsigned long long)res->end, in pcibios_fixup_resources()
715 (unsigned int)res->flags); in pcibios_fixup_resources()
717 res->end -= res->start; in pcibios_fixup_resources()
718 res->start = 0; in pcibios_fixup_resources()
719 res->flags |= IORESOURCE_UNSET; in pcibios_fixup_resources()
725 (unsigned long long)res->start, in pcibios_fixup_resources()
726 (unsigned long long)res->end, in pcibios_fixup_resources()
727 (unsigned int)res->flags); in pcibios_fixup_resources()
738 struct resource *res) in pcibios_uninitialized_bridge_resource() argument
747 if (res->flags & IORESOURCE_MEM) { in pcibios_uninitialized_bridge_resource()
751 if (res->start != hose->pci_mem_offset) in pcibios_uninitialized_bridge_resource()
778 if (((res->start - offset) & 0xfffffffful) != 0) in pcibios_uninitialized_bridge_resource()
801 struct resource *res; in pcibios_fixup_bridge() local
806 pci_bus_for_each_resource(bus, res, i) { in pcibios_fixup_bridge()
807 if (!res) in pcibios_fixup_bridge()
809 if (!res->flags) in pcibios_fixup_bridge()
816 (unsigned long long)res->start, in pcibios_fixup_bridge()
817 (unsigned long long)res->end, in pcibios_fixup_bridge()
818 (unsigned int)res->flags); in pcibios_fixup_bridge()
823 if (pcibios_uninitialized_bridge_resource(bus, res)) { in pcibios_fixup_bridge()
824 res->flags = 0; in pcibios_fixup_bridge()
830 (unsigned long long)res->start, in pcibios_fixup_bridge()
831 (unsigned long long)res->end); in pcibios_fixup_bridge()
899 resource_size_t pcibios_align_resource(void *data, const struct resource *res, in pcibios_align_resource() argument
903 resource_size_t start = res->start; in pcibios_align_resource()
905 if (res->flags & IORESOURCE_IO) { in pcibios_align_resource()
921 struct resource *res) in reparent_resources() argument
927 if (p->end < res->start) in reparent_resources()
929 if (res->end < p->start) in reparent_resources()
931 if (p->start < res->start || p->end > res->end) in reparent_resources()
938 res->parent = parent; in reparent_resources()
939 res->child = *firstpp; in reparent_resources()
940 res->sibling = *pp; in reparent_resources()
941 *firstpp = res; in reparent_resources()
943 for (p = res->child; p != NULL; p = p->sibling) { in reparent_resources()
944 p->parent = res; in reparent_resources()
948 (unsigned long long)p->end, res->name); in reparent_resources()
990 struct resource *res, *pr; in pcibios_allocate_bus_resources() local
995 pci_bus_for_each_resource(bus, res, i) { in pcibios_allocate_bus_resources()
996 if (!res || !res->flags in pcibios_allocate_bus_resources()
997 || res->start > res->end || res->parent) in pcibios_allocate_bus_resources()
1000 pr = (res->flags & IORESOURCE_IO) ? in pcibios_allocate_bus_resources()
1009 pr = pci_find_parent_resource(bus->self, res); in pcibios_allocate_bus_resources()
1010 if (pr == res) { in pcibios_allocate_bus_resources()
1022 (unsigned long long)res->start, in pcibios_allocate_bus_resources()
1023 (unsigned long long)res->end); in pcibios_allocate_bus_resources()
1025 (unsigned int)res->flags, in pcibios_allocate_bus_resources()
1031 if (request_resource(pr, res) == 0) in pcibios_allocate_bus_resources()
1038 if (reparent_resources(pr, res) == 0) in pcibios_allocate_bus_resources()
1049 res->start = res->end = 0; in pcibios_allocate_bus_resources()
1050 res->flags = 0; in pcibios_allocate_bus_resources()
1136 struct resource *res, *pres; in pcibios_reserve_legacy_regions() local
1146 res = kzalloc(sizeof(struct resource), GFP_KERNEL); in pcibios_reserve_legacy_regions()
1147 BUG_ON(res == NULL); in pcibios_reserve_legacy_regions()
1148 res->name = "Legacy IO"; in pcibios_reserve_legacy_regions()
1149 res->flags = IORESOURCE_IO; in pcibios_reserve_legacy_regions()
1150 res->start = offset; in pcibios_reserve_legacy_regions()
1151 res->end = (offset + 0xfff) & 0xfffffffful; in pcibios_reserve_legacy_regions()
1152 pr_debug("Candidate legacy IO: %pR\n", res); in pcibios_reserve_legacy_regions()
1153 if (request_resource(&hose->io_resource, res)) { in pcibios_reserve_legacy_regions()
1155 pci_domain_nr(bus), bus->number, res); in pcibios_reserve_legacy_regions()
1156 kfree(res); in pcibios_reserve_legacy_regions()
1174 res = kzalloc(sizeof(struct resource), GFP_KERNEL); in pcibios_reserve_legacy_regions()
1175 BUG_ON(res == NULL); in pcibios_reserve_legacy_regions()
1176 res->name = "Legacy VGA memory"; in pcibios_reserve_legacy_regions()
1177 res->flags = IORESOURCE_MEM; in pcibios_reserve_legacy_regions()
1178 res->start = 0xa0000 + offset; in pcibios_reserve_legacy_regions()
1179 res->end = 0xbffff + offset; in pcibios_reserve_legacy_regions()
1180 pr_debug("Candidate VGA memory: %pR\n", res); in pcibios_reserve_legacy_regions()
1181 if (request_resource(pres, res)) { in pcibios_reserve_legacy_regions()
1183 pci_domain_nr(bus), bus->number, res); in pcibios_reserve_legacy_regions()
1184 kfree(res); in pcibios_reserve_legacy_regions()
1278 struct resource *res; in pcibios_setup_phb_resources() local
1282 res = &hose->io_resource; in pcibios_setup_phb_resources()
1286 res->start = (res->start + io_offset) & 0xffffffffu; in pcibios_setup_phb_resources()
1287 res->end = (res->end + io_offset) & 0xffffffffu; in pcibios_setup_phb_resources()
1289 if (!res->flags) { in pcibios_setup_phb_resources()
1294 res->start = (unsigned long)hose->io_base_virt - isa_io_base; in pcibios_setup_phb_resources()
1295 res->end = res->start + IO_SPACE_LIMIT; in pcibios_setup_phb_resources()
1296 res->flags = IORESOURCE_IO; in pcibios_setup_phb_resources()
1298 pci_add_resource_offset(resources, res, in pcibios_setup_phb_resources()
1302 (unsigned long long)res->start, in pcibios_setup_phb_resources()
1303 (unsigned long long)res->end, in pcibios_setup_phb_resources()
1304 (unsigned long)res->flags); in pcibios_setup_phb_resources()
1308 res = &hose->mem_resources[i]; in pcibios_setup_phb_resources()
1309 if (!res->flags) { in pcibios_setup_phb_resources()
1317 res->start = hose->pci_mem_offset; in pcibios_setup_phb_resources()
1318 res->end = (resource_size_t)-1LL; in pcibios_setup_phb_resources()
1319 res->flags = IORESOURCE_MEM; in pcibios_setup_phb_resources()
1322 pci_add_resource_offset(resources, res, hose->pci_mem_offset); in pcibios_setup_phb_resources()
1325 i, (unsigned long long)res->start, in pcibios_setup_phb_resources()
1326 (unsigned long long)res->end, in pcibios_setup_phb_resources()
1327 (unsigned long)res->flags); in pcibios_setup_phb_resources()