Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/fdt/fdt_common.c
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | fdt_immr_addr(vm_offset_t immr_va) | ||||
phandle_t node; | phandle_t node; | ||||
u_long base, size; | u_long base, size; | ||||
int r; | int r; | ||||
/* | /* | ||||
* Try to access the SOC node directly i.e. through /aliases/. | * Try to access the SOC node directly i.e. through /aliases/. | ||||
*/ | */ | ||||
if ((node = OF_finddevice("soc")) != 0) | if ((node = OF_finddevice("soc")) != 0) | ||||
if (fdt_is_compatible_strict(node, "simple-bus")) | if (fdt_is_compatible(node, "simple-bus")) | ||||
goto moveon; | goto moveon; | ||||
/* | /* | ||||
* Find the node the long way. | * Find the node the long way. | ||||
*/ | */ | ||||
if ((node = OF_finddevice("/")) == 0) | if ((node = OF_finddevice("/")) == 0) | ||||
return (ENXIO); | return (ENXIO); | ||||
if ((node = fdt_find_compatible(node, "simple-bus", 1)) == 0) | if ((node = fdt_find_compatible(node, "simple-bus", 0)) == 0) | ||||
return (ENXIO); | return (ENXIO); | ||||
moveon: | moveon: | ||||
if ((r = fdt_get_range(node, 0, &base, &size)) == 0) { | if ((r = fdt_get_range(node, 0, &base, &size)) == 0) { | ||||
fdt_immr_pa = base; | fdt_immr_pa = base; | ||||
fdt_immr_va = immr_va; | fdt_immr_va = immr_va; | ||||
fdt_immr_size = size; | fdt_immr_size = size; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 492 Lines • Show Last 20 Lines |