Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/fdt/fdt_common.c
Show First 20 Lines • Show All 342 Lines • ▼ Show 20 Lines | if (len <= 0) | ||||
/* It is OK if no 'status' property. */ | /* It is OK if no 'status' property. */ | ||||
return (1); | return (1); | ||||
/* Anything other than 'okay' means disabled. */ | /* Anything other than 'okay' means disabled. */ | ||||
ena = 0; | ena = 0; | ||||
if (strncmp((char *)stat, "okay", len) == 0) | if (strncmp((char *)stat, "okay", len) == 0) | ||||
ena = 1; | ena = 1; | ||||
free(stat, M_OFWPROP); | OF_prop_free(stat); | ||||
return (ena); | return (ena); | ||||
} | } | ||||
int | int | ||||
fdt_is_type(phandle_t node, const char *typestr) | fdt_is_type(phandle_t node, const char *typestr) | ||||
{ | { | ||||
char type[FDT_TYPE_LEN]; | char type[FDT_TYPE_LEN]; | ||||
▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | debugf("reg addr start = %lx, end = %lx, count = %lx\n", start, | ||||
end, count); | end, count); | ||||
resource_list_add(rl, SYS_RES_MEMORY, i, start, end, | resource_list_add(rl, SYS_RES_MEMORY, i, start, end, | ||||
count); | count); | ||||
} | } | ||||
rv = 0; | rv = 0; | ||||
out: | out: | ||||
free(regptr, M_OFWPROP); | OF_prop_free(regptr); | ||||
return (rv); | return (rv); | ||||
} | } | ||||
int | int | ||||
fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) | fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc) | ||||
{ | { | ||||
phandle_t phy_node; | phandle_t phy_node; | ||||
pcell_t phy_handle, phy_reg; | pcell_t phy_handle, phy_reg; | ||||
▲ Show 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | fdt_get_chosen_bootargs(char *bootargs, size_t max_size) | ||||
phandle_t chosen; | phandle_t chosen; | ||||
chosen = OF_finddevice("/chosen"); | chosen = OF_finddevice("/chosen"); | ||||
if (chosen == -1) | if (chosen == -1) | ||||
return (ENXIO); | return (ENXIO); | ||||
if (OF_getprop(chosen, "bootargs", bootargs, max_size) == -1) | if (OF_getprop(chosen, "bootargs", bootargs, max_size) == -1) | ||||
return (ENXIO); | return (ENXIO); | ||||
return (0); | return (0); | ||||
} | } | ||||
No newline at end of file |