Lines Matching refs:phandle
75 fdtbus_phandle2offset(int phandle)
79 if (phandle == -1)
80 phandle = dtoff;
82 if (phandle < dtoff)
85 return phandle - dtoff;
97 fdtbus_get_addr_cells(int phandle)
101 if (of_getprop_uint32(phandle, "#address-cells", &addr_cells))
108 fdtbus_get_size_cells(int phandle)
112 if (of_getprop_uint32(phandle, "#size-cells", &size_cells))
119 fdtbus_get_phandle(int phandle, const char *prop)
126 fdtbus_phandle2offset(phandle), prop, &len);
136 fdtbus_get_phandle_with_data(int phandle, const char *prop, const char *cells,
142 const u_int *p = fdtbus_get_prop(phandle, prop, &len);
154 data->phandle = iparent;
172 fdtbus_get_phandle_from_native(int phandle)
174 const int off = fdt_node_offset_by_phandle(fdt_data, phandle);
182 fdtbus_get_path(int phandle, char *buf, size_t buflen)
184 const int off = fdtbus_phandle2offset(phandle);
206 fdtbus_decode_range(int phandle, uint64_t paddr)
208 const int parent = OF_parent(phandle);
219 fdtbus_phandle2offset(phandle), "ranges", &len);
228 const int addr_cells = fdtbus_get_addr_cells(phandle);
229 const int size_cells = fdtbus_get_size_cells(phandle);
244 printf("%s: %s: cba=%#" PRIx64 ", pba=%#" PRIx64 ", cl=%#" PRIx64 "\n", __func__, fdt_get_name(fdtbus_get_data(), fdtbus_phandle2offset(phandle), NULL), cba, pba, cl);
258 fdtbus_get_reg_byname(int phandle, const char *name, bus_addr_t *paddr,
264 error = fdtbus_get_index(phandle, "reg-names", name, &index);
268 return fdtbus_get_reg(phandle, index, paddr, psize);
272 fdtbus_get_reg(int phandle, u_int index, bus_addr_t *paddr, bus_size_t *psize)
277 error = fdtbus_get_reg64(phandle, index, &addr, &size);
293 fdtbus_get_reg64(int phandle, u_int index, uint64_t *paddr, uint64_t *psize)
299 const int addr_cells = fdtbus_get_addr_cells(OF_parent(phandle));
300 const int size_cells = fdtbus_get_size_cells(OF_parent(phandle));
305 fdtbus_phandle2offset(phandle), "reg", &len);
322 *paddr = fdtbus_decode_range(OF_parent(phandle), addr);
325 fdtbus_phandle2offset(phandle), NULL);
337 fdtbus_status_okay(int phandle)
339 const int off = fdtbus_phandle2offset(phandle);
349 fdtbus_get_prop(int phandle, const char *prop, int *plen)
351 const int off = fdtbus_phandle2offset(phandle);
357 fdtbus_get_string(int phandle, const char *prop)
359 const int off = fdtbus_phandle2offset(phandle);
368 fdtbus_get_string_index(int phandle, const char *prop, u_int index)
373 if ((len = OF_getproplen(phandle, prop)) < 0)
376 names = fdtbus_get_string(phandle, prop);
382 fdtbus_get_index(int phandle, const char *prop, const char *name, u_int *idx)
387 p = fdtbus_get_prop(phandle, prop, &len);