Lines Matching +full:string +full:- +full:array +full:- +full:property

1 #include <linux/string.h>
18 unsigned long ret = res->start + offset; in of_ioremap()
21 if (res->flags & IORESOURCE_MEM) in of_ioremap()
34 if (res->flags & IORESOURCE_MEM) in of_iounmap()
47 if (!strcmp(np->name, "pci")) { in of_bus_pci_match()
54 * PCI bridge lacks a ranges property. We in of_bus_pci_match()
56 * parent as-is, not with the PCI translate in of_bus_pci_match()
75 /* Treat PCI busses lacking ranges property just like in of_bus_simba_match()
78 if (!strcmp(np->name, "pci")) { in of_bus_simba_match()
111 /* Special exception, we can map a 64-bit address into in of_bus_pci_map()
112 * a 32-bit range. in of_bus_pci_map()
118 return -EINVAL; in of_bus_pci_map()
122 na - 1, ns)) in of_bus_pci_map()
123 return -EINVAL; in of_bus_pci_map()
129 for (i = 0; i < na - 1; i++) in of_bus_pci_map()
130 result[pna - 1 - i] += in of_bus_pci_map()
131 (addr[na - 1 - i] - in of_bus_pci_map()
132 range[na - 1 - i]); in of_bus_pci_map()
163 * This is just needed to hard-code the address and size cell
164 * counts. 'fhc' and 'central' nodes lack the #address-cells and
165 * #size-cells properties, and if you walk to the root on such
166 * Enterprise boxes all you'll get is a #size-cells of 2 which is
171 return !strcmp(np->name, "fhc") || in of_bus_fhc_match()
172 !strcmp(np->name, "central"); in of_bus_fhc_match()
178 * Array of bus specific translators
185 .addr_prop_name = "assigned-addresses",
194 .addr_prop_name = "assigned-addresses",
256 result[pna - 1 - i] = in build_one_resource()
257 addr[na - 1 - i]; in build_one_resource()
266 for (; rlen >= rone; rlen -= rone, ranges += rone) { in build_one_resource()
267 if (!bus->map(addr, ranges, na, ns, pna)) in build_one_resource()
274 if (!strcmp(bus->name, "pci") && in build_one_resource()
283 /* If we have a ranges property in the parent, use it. */ in use_1to1_mapping()
292 * real bus nodes, and don't have a 'ranges' property. in use_1to1_mapping()
296 if (!strcmp(pp->name, "dma") || in use_1to1_mapping()
297 !strcmp(pp->name, "espdma") || in use_1to1_mapping()
298 !strcmp(pp->name, "ledma") || in use_1to1_mapping()
299 !strcmp(pp->name, "lebuffer")) in use_1to1_mapping()
303 * it lacks a ranges property, and this will include in use_1to1_mapping()
306 if (!strcmp(pp->name, "pci")) in use_1to1_mapping()
327 bus = of_match_bus(p_op->dev.of_node); in build_device_resources()
328 bus->count_cells(op->dev.of_node, &na, &ns); in build_device_resources()
330 preg = of_get_property(op->dev.of_node, bus->addr_prop_name, &num_reg); in build_device_resources()
334 /* Convert to num-cells. */ in build_device_resources()
337 /* Convert to num-entries. */ in build_device_resources()
340 /* Prevent overrunning the op->resources[] array. */ in build_device_resources()
344 op->dev.of_node->full_name, num_reg, PROMREG_MAX); in build_device_resources()
348 op->resource = op->archdata.resource; in build_device_resources()
349 op->num_resources = num_reg; in build_device_resources()
351 struct resource *r = &op->resource[index]; in build_device_resources()
354 struct device_node *dp = op->dev.of_node; in build_device_resources()
355 struct device_node *pp = p_op->dev.of_node; in build_device_resources()
365 flags = bus->get_flags(addr, 0); in build_device_resources()
378 pp = dp->parent; in build_device_resources()
385 pbus->count_cells(dp, &pna, &pns); in build_device_resources()
391 flags = pbus->get_flags(addr, flags); in build_device_resources()
402 printk("%s reg[%d] -> %llx\n", in build_device_resources()
403 op->dev.of_node->full_name, index, in build_device_resources()
410 r->start = result; in build_device_resources()
411 r->end = result + size - 1; in build_device_resources()
412 r->flags = flags; in build_device_resources()
414 r->name = op->dev.of_node->name; in build_device_resources()
431 bus->count_cells(dp, &na, NULL); in apply_interrupt_map()
456 /* Psycho and Sabre PCI controllers can have 'interrupt-map' in apply_interrupt_map()
457 * properties that do not include the on-board device in apply_interrupt_map()
458 * interrupts. Instead, the device's 'interrupts' property in apply_interrupt_map()
462 * match in the parent's 'interrupt-map', and the in apply_interrupt_map()
466 if (pp->irq_trans) in apply_interrupt_map()
492 bus = (regs->phys_hi >> 16) & 0xff; in pci_irq_swizzle()
493 devfn = (regs->phys_hi >> 8) & 0xff; in pci_irq_swizzle()
496 if (pp->irq_trans) { in pci_irq_swizzle()
497 /* Derived from Table 8-3, U2P User's Manual. This branch in pci_irq_swizzle()
499 * interrupt-map and interrupt-map-mask properties. The in pci_irq_swizzle()
500 * Ultra-E450 is one example. in pci_irq_swizzle()
504 * D: 2-bit slot number, derived from PCI device number as in pci_irq_swizzle()
505 * (dev - 1) for bus A, or (dev - 2) for bus B in pci_irq_swizzle()
506 * L: 2-bit line number in pci_irq_swizzle()
509 /* PBM-A */ in pci_irq_swizzle()
511 slot = (slot - 1) << 2; in pci_irq_swizzle()
513 /* PBM-B */ in pci_irq_swizzle()
515 slot = (slot - 2) << 2; in pci_irq_swizzle()
517 irq -= 1; in pci_irq_swizzle()
521 /* Going through a PCI-PCI bridge that lacks a set of in pci_irq_swizzle()
522 * interrupt-map and interrupt-map-mask properties. in pci_irq_swizzle()
524 ret = ((irq - 1 + (slot & 3)) & 3) + 1; in pci_irq_swizzle()
536 struct device_node *dp = op->dev.of_node; in build_one_device_irq()
544 if (dp->irq_trans) { in build_one_device_irq()
545 irq = dp->irq_trans->irq_build(dp, irq, in build_one_device_irq()
546 dp->irq_trans->data); in build_one_device_irq()
549 printk("%s: direct translate %x --> %x\n", in build_one_device_irq()
550 dp->full_name, orig_irq, irq); in build_one_device_irq()
556 * interrupt-map or bus specific translations, until we hit in build_one_device_irq()
563 pp = dp->parent; in build_one_device_irq()
569 imap = of_get_property(pp, "interrupt-map", &imlen); in build_one_device_irq()
570 imsk = of_get_property(pp, "interrupt-map-mask", NULL); in build_one_device_irq()
580 printk("%s: Apply [%s:%x] imap --> [%s:%x]\n", in build_one_device_irq()
581 op->dev.of_node->full_name, in build_one_device_irq()
582 pp->full_name, this_orig_irq, in build_one_device_irq()
583 (iret ? iret->full_name : "NULL"), irq); in build_one_device_irq()
588 if (iret->irq_trans) { in build_one_device_irq()
593 if (!strcmp(pp->name, "pci")) { in build_one_device_irq()
599 "%x --> %x\n", in build_one_device_irq()
600 op->dev.of_node->full_name, in build_one_device_irq()
601 pp->full_name, this_orig_irq, in build_one_device_irq()
606 if (pp->irq_trans) { in build_one_device_irq()
612 pp = pp->parent; in build_one_device_irq()
617 irq = ip->irq_trans->irq_build(op->dev.of_node, irq, in build_one_device_irq()
618 ip->irq_trans->data); in build_one_device_irq()
620 printk("%s: Apply IRQ trans [%s] %x --> %x\n", in build_one_device_irq()
621 op->dev.of_node->full_name, ip->full_name, orig_irq, irq); in build_one_device_irq()
625 if (nid != -1) { in build_one_device_irq()
646 sd = &op->dev.archdata; in scan_one_device()
647 sd->op = op; in scan_one_device()
649 op->dev.of_node = dp; in scan_one_device()
653 op->archdata.num_irqs = len / 4; in scan_one_device()
655 /* Prevent overrunning the op->irqs[] array. */ in scan_one_device()
656 if (op->archdata.num_irqs > PROMINTR_MAX) { in scan_one_device()
659 dp->full_name, op->archdata.num_irqs, PROMINTR_MAX); in scan_one_device()
660 op->archdata.num_irqs = PROMINTR_MAX; in scan_one_device()
662 memcpy(op->archdata.irqs, irq, op->archdata.num_irqs * 4); in scan_one_device()
664 op->archdata.num_irqs = 0; in scan_one_device()
668 for (i = 0; i < op->archdata.num_irqs; i++) in scan_one_device()
669 op->archdata.irqs[i] = build_one_device_irq(op, parent, op->archdata.irqs[i]); in scan_one_device()
671 op->dev.parent = parent; in scan_one_device()
672 op->dev.bus = &platform_bus_type; in scan_one_device()
674 dev_set_name(&op->dev, "root"); in scan_one_device()
676 dev_set_name(&op->dev, "%08x", dp->phandle); in scan_one_device()
680 dp->full_name); in scan_one_device()
694 scan_tree(dp->child, &op->dev); in scan_tree()
696 dp = dp->sibling; in scan_tree()
709 scan_tree(root->child, &parent->dev); in scan_of_devices()