Lines Matching +full:irqs +full:- +full:map +full:- +full:range
1 // SPDX-License-Identifier: GPL-2.0
12 #include <linux/dma-mapping.h>
29 * parent as-is, not with the PCI translate in of_bus_pci_match()
50 static int of_bus_pci_map(u32 *addr, const u32 *range, in of_bus_pci_map() argument
57 if ((addr[0] ^ range[0]) & 0x03000000) in of_bus_pci_map()
58 return -EINVAL; in of_bus_pci_map()
60 if (of_out_of_range(addr + 1, range + 1, range + na + pna, in of_bus_pci_map()
61 na - 1, ns)) in of_bus_pci_map()
62 return -EINVAL; in of_bus_pci_map()
64 /* Start with the parent range base. */ in of_bus_pci_map()
65 memcpy(result, range + na, pna * 4); in of_bus_pci_map()
68 for (i = 0; i < na - 1; i++) in of_bus_pci_map()
69 result[pna - 1 - i] += in of_bus_pci_map()
70 (addr[na - 1 - i] - in of_bus_pci_map()
71 range[na - 1 - i]); in of_bus_pci_map()
122 static int of_bus_ambapp_map(u32 *addr, const u32 *range, in of_bus_ambapp_map() argument
125 return of_bus_default_map(addr, range, na, ns, pna); in of_bus_ambapp_map()
142 .addr_prop_name = "assigned-addresses",
145 .map = of_bus_pci_map,
154 .map = of_bus_default_map,
163 .map = of_bus_ambapp_map,
172 .map = of_bus_default_map,
205 result[pna - 1 - i] = in build_one_resource()
206 addr[na - 1 - i]; in build_one_resource()
215 for (; rlen >= rone; rlen -= rone, ranges += rone) { in build_one_resource()
216 if (!bus->map(addr, ranges, na, ns, pna)) in build_one_resource()
259 bus = of_match_bus(p_op->dev.of_node); in build_device_resources()
260 bus->count_cells(op->dev.of_node, &na, &ns); in build_device_resources()
262 preg = of_get_property(op->dev.of_node, bus->addr_prop_name, &num_reg); in build_device_resources()
266 /* Convert to num-cells. */ in build_device_resources()
269 /* Conver to num-entries. */ in build_device_resources()
272 op->resource = op->archdata.resource; in build_device_resources()
273 op->num_resources = num_reg; in build_device_resources()
275 struct resource *r = &op->resource[index]; in build_device_resources()
278 struct device_node *dp = op->dev.of_node; in build_device_resources()
279 struct device_node *pp = p_op->dev.of_node; in build_device_resources()
290 flags = bus->get_flags(reg, 0); in build_device_resources()
303 pp = dp->parent; in build_device_resources()
310 pbus->count_cells(dp, &pna, &pns); in build_device_resources()
316 flags = pbus->get_flags(addr, flags); in build_device_resources()
327 printk("%pOF reg[%d] -> %llx\n", in build_device_resources()
328 op->dev.of_node, index, in build_device_resources()
332 r->start = result & 0xffffffff; in build_device_resources()
333 r->end = result + size - 1; in build_device_resources()
334 r->flags = flags | ((result >> 32ULL) & 0xffUL); in build_device_resources()
336 r->name = op->dev.of_node->full_name; in build_device_resources()
351 sd = &op->dev.archdata; in scan_one_device()
352 sd->op = op; in scan_one_device()
354 op->dev.of_node = dp; in scan_one_device()
358 op->archdata.num_irqs = len / sizeof(struct linux_prom_irqs); in scan_one_device()
359 for (i = 0; i < op->archdata.num_irqs; i++) in scan_one_device()
360 op->archdata.irqs[i] = in scan_one_device()
367 op->archdata.num_irqs = len / sizeof(unsigned int); in scan_one_device()
368 for (i = 0; i < op->archdata.num_irqs; i++) in scan_one_device()
369 op->archdata.irqs[i] = in scan_one_device()
372 op->archdata.num_irqs = 0; in scan_one_device()
378 op->dev.parent = parent; in scan_one_device()
379 op->dev.bus = &platform_bus_type; in scan_one_device()
381 dev_set_name(&op->dev, "root"); in scan_one_device()
383 dev_set_name(&op->dev, "%08x", dp->phandle); in scan_one_device()
385 op->dev.coherent_dma_mask = DMA_BIT_MASK(32); in scan_one_device()
386 op->dev.dma_mask = &op->dev.coherent_dma_mask; in scan_one_device()
403 scan_tree(dp->child, &op->dev); in scan_tree()
405 dp = dp->sibling; in scan_tree()
418 scan_tree(root->child, &parent->dev); in scan_of_devices()