MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / fdt_io_addr_cells

Function fdt_io_addr_cells

components/drivers/ofw/raw.c:84–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82#undef FDT_RAW_GET_VAL_FLAG
83
84int fdt_io_addr_cells(void *fdt, int nodeoffset)
85{
86 int cells = -1;
87 int parentoffset = fdt_parent_offset(fdt, nodeoffset);
88
89 for (; parentoffset >= 0 ; parentoffset = fdt_parent_offset(fdt, parentoffset))
90 {
91 const fdt32_t *cells_tmp = fdt_getprop(fdt, parentoffset, "#address-cells", NULL);
92
93 if (cells_tmp)
94 {
95 cells = fdt32_to_cpu(*cells_tmp);
96 }
97 }
98
99 if (cells < 0)
100 {
101 cells = fdt_address_cells(fdt, nodeoffset);
102 }
103
104 return cells;
105}
106
107int fdt_io_size_cells(void *fdt, int nodeoffset)
108{

Callers 3

fdt_install_initrdFunction · 0.85
rt_fdt_translate_addressFunction · 0.85

Calls 4

fdt_parent_offsetFunction · 0.50
fdt_getpropFunction · 0.50
fdt32_to_cpuFunction · 0.50
fdt_address_cellsFunction · 0.50

Tested by

no test coverage detected