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

Function rt_fdt_scan_root

components/drivers/ofw/fdt.c:169–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169rt_err_t rt_fdt_scan_root(void)
170{
171 rt_err_t err = RT_EOK;
172 int root = fdt_path_offset(_fdt, "/");
173
174 if (root >= 0)
175 {
176 const fdt32_t *prop;
177
178 _root_addr_cells = OFW_ROOT_NODE_ADDR_CELLS_DEFAULT;
179 _root_size_cells = OFW_ROOT_NODE_SIZE_CELLS_DEFAULT;
180
181 if ((prop = fdt_getprop(_fdt, root, "#address-cells", RT_NULL)))
182 {
183 _root_addr_cells = fdt32_to_cpu(*prop);
184 }
185
186 if ((prop = fdt_getprop(_fdt, root, "#size-cells", RT_NULL)))
187 {
188 _root_size_cells = fdt32_to_cpu(*prop);
189 }
190 }
191 else
192 {
193 err = -RT_EEMPTY;
194 }
195
196 return err;
197}
198
199static rt_err_t fdt_reserved_mem_check_root(int nodeoffset)
200{

Callers 1

rt_fdt_prefetchFunction · 0.85

Calls 3

fdt_path_offsetFunction · 0.50
fdt_getpropFunction · 0.50
fdt32_to_cpuFunction · 0.50

Tested by

no test coverage detected