if (model && !strcmp(model, "SUNW,simba")) return0;
/* Do not do PCI specific frobbing if the *PCIbridgelacksarangesproperty.We *wanttopassitthroughuptothenext *parentas-is,notwiththePCItranslate *methodwhichchopsoffthetopaddresscell.
*/ if (!of_property_present(np, "ranges")) return0;
if (model && !strcmp(model, "SUNW,simba")) return1;
/* Treat PCI busses lacking ranges property just like *simba.
*/ if (of_node_name_eq(np, "pci")) { if (!of_property_present(np, "ranges")) return1;
}
return0;
}
staticint of_bus_simba_map(u32 *addr, const u32 *range, int na, int ns, int pna)
{ return0;
}
staticvoid of_bus_pci_count_cells(struct device_node *np, int *addrc, int *sizec)
{ if (addrc)
*addrc = 3; if (sizec)
*sizec = 2;
}
staticint of_bus_pci_map(u32 *addr, const u32 *range, int na, int ns, int pna)
{
u32 result[OF_MAX_ADDR_CELLS]; int i;
/* Check address type match */ if (!((addr[0] ^ range[0]) & 0x03000000)) goto type_match;
/* Special exception, we can map a 64-bit address into *a32-bitrange.
*/ if ((addr[0] & 0x03000000) == 0x03000000 &&
(range[0] & 0x03000000) == 0x02000000) goto type_match;
return -EINVAL;
type_match: if (of_out_of_range(addr + 1, range + 1, range + na + pna,
na - 1, ns)) return -EINVAL;
/* Start with the parent range base. */
memcpy(result, range + na, pna * 4);
/* Add in the child address offset, skipping high cell. */ for (i = 0; i < na - 1; i++)
result[pna - 1 - i] +=
(addr[na - 1 - i] -
range[na - 1 - i]);
staticstruct of_bus *of_match_bus(struct device_node *np)
{ int i;
for (i = 0; i < ARRAY_SIZE(of_busses); i ++) if (!of_busses[i].match || of_busses[i].match(np)) return &of_busses[i];
BUG(); return NULL;
}
staticint __init build_one_resource(struct device_node *parent, struct of_bus *bus, struct of_bus *pbus,
u32 *addr, int na, int ns, int pna)
{ const u32 *ranges; int rone, rlen;
ranges = of_get_property(parent, "ranges", &rlen); if (ranges == NULL || rlen == 0) {
u32 result[OF_MAX_ADDR_CELLS]; int i;
memset(result, 0, pna * 4); for (i = 0; i < na; i++)
result[pna - 1 - i] =
addr[na - 1 - i];
memcpy(addr, result, pna * 4); return0;
}
/* Now walk through the ranges */
rlen /= 4;
rone = na + pna + ns; for (; rlen >= rone; rlen -= rone, ranges += rone) { if (!bus->map(addr, ranges, na, ns, pna)) return0;
}
/* When we miss an I/O space match on PCI, just pass it up *tothenextPCIbridgeand/orcontroller.
*/ if (!strcmp(bus->name, "pci") &&
(addr[0] & 0x03000000) == 0x01000000) return0;
return1;
}
staticint __init use_1to1_mapping(struct device_node *pp)
{ /* If we have a ranges property in the parent, use it. */ if (of_property_present(pp, "ranges")) return0;
/* If the parent is the dma node of an ISA bus, pass *thetranslationuptotheroot. * *SomeSBUSdevicesuseintermediatenodestoexpress *hierarchywithinthedeviceitself.Thesearen't *realbusnodes,anddon'thavea'ranges'property. *But,weshouldstillpassthetranslationworkup *totheSBUSitself.
*/ if (of_node_name_eq(pp, "dma") ||
of_node_name_eq(pp, "espdma") ||
of_node_name_eq(pp, "ledma") ||
of_node_name_eq(pp, "lebuffer")) return0;
/* Similarly for all PCI bridges, if we get this far *itlacksarangesproperty,andthiswillinclude *caseslikeSimba.
*/ if (of_node_name_eq(pp, "pci")) return0;
next:
imap += (na + 3);
} if (i == imlen) { /* Psycho and Sabre PCI controllers can have 'interrupt-map' *propertiesthatdonotincludetheon-boarddevice *interrupts.Instead,thedevice's'interrupts'property *isalreadyafullyspecifiedINOvalue. * *Handlethisbydecidingthat,ifwedidn'tgeta *matchintheparent's'interrupt-map',andthe *parentisanIRQtranslator,thenusetheparentas *ourIRQcontroller.
*/ if (pp->irq_trans) return pp;
ret = (bus | slot | irq);
} else { /* Going through a PCI-PCI bridge that lacks a set of *interrupt-mapandinterrupt-map-maskproperties.
*/
ret = ((irq - 1 + (slot & 3)) & 3) + 1;
}
if (dp->irq_trans) {
irq = dp->irq_trans->irq_build(dp, irq,
dp->irq_trans->data);
if (of_irq_verbose)
printk("%pOF: direct translate %x --> %x\n",
dp, orig_irq, irq);
goto out;
}
/* Something more complicated. Walk up to the root, applying *interrupt-maporbusspecifictranslations,untilwehit *anIRQtranslator. * *Ifwehitabustypeorsituationwecannothandle,we *stopandassumethattheoriginalIRQnumberwasina *formatwhichhasspecialmeaningtoitsimmediateparent.
*/
pp = dp->parent;
ip = NULL; while (pp) { constvoid *imap, *imsk; int imlen;
irq = of_get_property(dp, "interrupts", &len); if (irq) {
op->archdata.num_irqs = len / 4;
/* Prevent overrunning the op->irqs[] array. */ if (op->archdata.num_irqs > PROMINTR_MAX) {
printk(KERN_WARNING "%pOF: Too many irqs (%d), " "limiting to %d.\n",
dp, op->archdata.num_irqs, PROMINTR_MAX);
op->archdata.num_irqs = PROMINTR_MAX;
}
memcpy(op->archdata.irqs, irq, op->archdata.num_irqs * 4);
} else {
op->archdata.num_irqs = 0;
}
build_device_resources(op, parent); for (i = 0; i < op->archdata.num_irqs; i++)
op->archdata.irqs[i] = build_one_device_irq(op, parent, op->archdata.irqs[i]);
staticint __init of_debug(char *str)
{ int val = 0;
get_option(&str, &val); if (val & 1)
of_resource_verbose = 1; if (val & 2)
of_irq_verbose = 1; return1;
}
__setup("of_debug=", of_debug);
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.14Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.