// SPDX-License-Identifier: GPL-2.0-or-later /* * Procedures for creating, accessing and interpreting the device tree. * * Paul Mackerras August 1996. * Copyright (C) 1996-2005 Paul Mackerras. * * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner. * {engebret|bergner}@us.ibm.com * * Adapted for sparc32 by David S. Miller davem@davemloft.net
*/
ret = memblock_alloc_or_panic(size, SMP_CACHE_BYTES);
prom_early_allocated += size;
return ret;
}
/* The following routines deal with the black magic of fully naming a * node. * * Certain well known named nodes are just the simple name string. * * Actual devices have an address specifier appended to the base name * string, like this "foo@addr". The "addr" can be in any number of * formats, and the platform plus the type of the node determine the * format and how it is constructed. * * For children of the ROOT node, the naming convention is fixed and * determined by whether this is a sun4u or sun4v system. * * For children of other nodes, it is bus type specific. So * we walk up the tree until we discover a "device_type" property * we recognize and we go from there.
*/ staticvoid __init sparc32_path_component(struct device_node *dp, char *tmp_buf)
{ constchar *name = of_get_property(dp, "name", NULL); struct linux_prom_registers *regs; struct property *rprop;
rprop = of_find_property(dp, "reg", NULL); if (!rprop) return;
/* In order to get a unique ID in the device tree (multiple AMBA devices * may have the same name) the node number is printed
*/
prop = of_find_property(dp, "reg", NULL); if (!prop) {
reg0 = (unsignedint)dp->phandle;
} else {
regs = prop->value;
reg0 = regs->phys_addr;
}
/* Not all cores have Interrupt */
prop = of_find_property(dp, "interrupts", NULL); if (!prop)
intr = &interrupt; /* IRQ0 does not exist */ else
intr = prop->value;
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.