Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm/mv/mv_common.c
Show First 20 Lines • Show All 2,274 Lines • ▼ Show 20 Lines | #endif | ||||
debugf("sram: base = 0x%0lx size = 0x%0lx\n", sram_base, sram_size); | debugf("sram: base = 0x%0lx size = 0x%0lx\n", sram_base, sram_size); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
fdt_win_setup(void) | fdt_win_setup(void) | ||||
{ | { | ||||
phandle_t node, child; | phandle_t node, child, sb; | ||||
struct soc_node_spec *soc_node; | struct soc_node_spec *soc_node; | ||||
u_long size, base; | u_long size, base; | ||||
int err, i; | int err, i; | ||||
sb = 0; | |||||
node = OF_finddevice("/"); | node = OF_finddevice("/"); | ||||
if (node == -1) | if (node == -1) | ||||
panic("fdt_win_setup: no root node"); | panic("fdt_win_setup: no root node"); | ||||
/* | /* | ||||
* Traverse through all children of root and simple-bus nodes. | * Traverse through all children of root and simple-bus nodes. | ||||
* For each found device retrieve decode windows data (if applicable). | * For each found device retrieve decode windows data (if applicable). | ||||
*/ | */ | ||||
Show All 25 Lines | while (child != 0) { | ||||
} | } | ||||
/* | /* | ||||
* Once done with root-level children let's move down to | * Once done with root-level children let's move down to | ||||
* simple-bus and its children. | * simple-bus and its children. | ||||
*/ | */ | ||||
child = OF_peer(child); | child = OF_peer(child); | ||||
if ((child == 0) && (node == OF_finddevice("/"))) { | if ((child == 0) && (node == OF_finddevice("/"))) { | ||||
node = fdt_find_compatible(node, "simple-bus", 0); | sb = node = fdt_find_compatible(node, "simple-bus", 0); | ||||
if (node == 0) | if (node == 0) | ||||
return (ENXIO); | return (ENXIO); | ||||
child = OF_child(node); | child = OF_child(node); | ||||
} | } | ||||
/* | /* | ||||
* Next, move one more level down to internal-regs node (if | * Next, move one more level down to internal-regs node (if | ||||
* it is present) and its children. This node also have | * it is present) and its children. This node also have | ||||
* "simple-bus" compatible. | * "simple-bus" compatible. | ||||
*/ | */ | ||||
if ((child == 0) && (node == OF_finddevice("simple-bus"))) { | if ((child == 0) && (node == sb)) { | ||||
node = fdt_find_compatible(node, "simple-bus", 0); | node = fdt_find_compatible(node, "simple-bus", 0); | ||||
if (node == 0) | if (node == 0) | ||||
return (0); | return (0); | ||||
child = OF_child(node); | child = OF_child(node); | ||||
} | } | ||||
} | } | ||||
return (0); | return (0); | ||||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |