ofnode.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. /*
  2. * Copyright (c) 2017 Google, Inc
  3. * Written by Simon Glass <sjg@chromium.org>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef _DM_OFNODE_H
  8. #define _DM_OFNODE_H
  9. /* TODO(sjg@chromium.org): Drop fdtdec.h include */
  10. #include <fdtdec.h>
  11. #include <dm/of.h>
  12. /* Enable checks to protect against invalid calls */
  13. #undef OF_CHECKS
  14. struct resource;
  15. /**
  16. * ofnode - reference to a device tree node
  17. *
  18. * This union can hold either a straightforward pointer to a struct device_node
  19. * in the live device tree, or an offset within the flat device tree. In the
  20. * latter case, the pointer value is just the integer offset within the flat DT.
  21. *
  22. * Thus we can reference nodes in both the live tree (once available) and the
  23. * flat tree (until then). Functions are available to translate between an
  24. * ofnode and either an offset or a struct device_node *.
  25. *
  26. * The reference can also hold a null offset, in which case the pointer value
  27. * here is NULL. This corresponds to a struct device_node * value of
  28. * NULL, or an offset of -1.
  29. *
  30. * There is no ambiguity as to whether ofnode holds an offset or a node
  31. * pointer: when the live tree is active it holds a node pointer, otherwise it
  32. * holds an offset. The value itself does not need to be unique and in theory
  33. * the same value could point to a valid device node or a valid offset. We
  34. * could arrange for a unique value to be used (e.g. by making the pointer
  35. * point to an offset within the flat device tree in the case of an offset) but
  36. * this increases code size slightly due to the subtraction. Since it offers no
  37. * real benefit, the approach described here seems best.
  38. *
  39. * For now these points use constant types, since we don't allow writing
  40. * the DT.
  41. *
  42. * @np: Pointer to device node, used for live tree
  43. * @of_offset: Pointer into flat device tree, used for flat tree. Note that this
  44. * is not a really a pointer to a node: it is an offset value. See above.
  45. */
  46. typedef union ofnode_union {
  47. const struct device_node *np; /* will be used for future live tree */
  48. long of_offset;
  49. } ofnode;
  50. struct ofnode_phandle_args {
  51. ofnode node;
  52. int args_count;
  53. uint32_t args[OF_MAX_PHANDLE_ARGS];
  54. };
  55. /**
  56. * _ofnode_to_np() - convert an ofnode to a live DT node pointer
  57. *
  58. * This cannot be called if the reference contains an offset.
  59. *
  60. * @node: Reference containing struct device_node * (possibly invalid)
  61. * @return pointer to device node (can be NULL)
  62. */
  63. static inline const struct device_node *ofnode_to_np(ofnode node)
  64. {
  65. #ifdef OF_CHECKS
  66. if (!of_live_active())
  67. return NULL;
  68. #endif
  69. return node.np;
  70. }
  71. /**
  72. * ofnode_to_offset() - convert an ofnode to a flat DT offset
  73. *
  74. * This cannot be called if the reference contains a node pointer.
  75. *
  76. * @node: Reference containing offset (possibly invalid)
  77. * @return DT offset (can be -1)
  78. */
  79. static inline int ofnode_to_offset(ofnode node)
  80. {
  81. #ifdef OF_CHECKS
  82. if (of_live_active())
  83. return -1;
  84. #endif
  85. return node.of_offset;
  86. }
  87. /**
  88. * ofnode_valid() - check if an ofnode is valid
  89. *
  90. * @return true if the reference contains a valid ofnode, false if it is NULL
  91. */
  92. static inline bool ofnode_valid(ofnode node)
  93. {
  94. if (of_live_active())
  95. return node.np != NULL;
  96. else
  97. return node.of_offset != -1;
  98. }
  99. /**
  100. * offset_to_ofnode() - convert a DT offset to an ofnode
  101. *
  102. * @of_offset: DT offset (either valid, or -1)
  103. * @return reference to the associated DT offset
  104. */
  105. static inline ofnode offset_to_ofnode(int of_offset)
  106. {
  107. ofnode node;
  108. if (of_live_active())
  109. node.np = NULL;
  110. else
  111. node.of_offset = of_offset;
  112. return node;
  113. }
  114. /**
  115. * np_to_ofnode() - convert a node pointer to an ofnode
  116. *
  117. * @np: Live node pointer (can be NULL)
  118. * @return reference to the associated node pointer
  119. */
  120. static inline ofnode np_to_ofnode(const struct device_node *np)
  121. {
  122. ofnode node;
  123. node.np = np;
  124. return node;
  125. }
  126. /**
  127. * ofnode_is_np() - check if a reference is a node pointer
  128. *
  129. * This function associated that if there is a valid live tree then all
  130. * references will use it. This is because using the flat DT when the live tree
  131. * is valid is not permitted.
  132. *
  133. * @node: reference to check (possibly invalid)
  134. * @return true if the reference is a live node pointer, false if it is a DT
  135. * offset
  136. */
  137. static inline bool ofnode_is_np(ofnode node)
  138. {
  139. #ifdef OF_CHECKS
  140. /*
  141. * Check our assumption that flat tree offsets are not used when a
  142. * live tree is in use.
  143. */
  144. assert(!ofnode_valid(node) ||
  145. (of_live_active() ? _ofnode_to_np(node)
  146. : _ofnode_to_np(node)));
  147. #endif
  148. return of_live_active() && ofnode_valid(node);
  149. }
  150. /**
  151. * ofnode_equal() - check if two references are equal
  152. *
  153. * @return true if equal, else false
  154. */
  155. static inline bool ofnode_equal(ofnode ref1, ofnode ref2)
  156. {
  157. /* We only need to compare the contents */
  158. return ref1.of_offset == ref2.of_offset;
  159. }
  160. /**
  161. * ofnode_null() - Obtain a null ofnode
  162. *
  163. * This returns an ofnode which points to no node. It works both with the flat
  164. * tree and livetree.
  165. */
  166. static inline ofnode ofnode_null(void)
  167. {
  168. ofnode node;
  169. if (of_live_active())
  170. node.np = NULL;
  171. else
  172. node.of_offset = -1;
  173. return node;
  174. }
  175. /**
  176. * ofnode_read_u32() - Read a 32-bit integer from a property
  177. *
  178. * @ref: valid node reference to read property from
  179. * @propname: name of the property to read from
  180. * @outp: place to put value (if found)
  181. * @return 0 if OK, -ve on error
  182. */
  183. int ofnode_read_u32(ofnode node, const char *propname, u32 *outp);
  184. /**
  185. * ofnode_read_s32() - Read a 32-bit integer from a property
  186. *
  187. * @ref: valid node reference to read property from
  188. * @propname: name of the property to read from
  189. * @outp: place to put value (if found)
  190. * @return 0 if OK, -ve on error
  191. */
  192. static inline int ofnode_read_s32(ofnode node, const char *propname,
  193. s32 *out_value)
  194. {
  195. return ofnode_read_u32(node, propname, (u32 *)out_value);
  196. }
  197. /**
  198. * ofnode_read_u32_default() - Read a 32-bit integer from a property
  199. *
  200. * @ref: valid node reference to read property from
  201. * @propname: name of the property to read from
  202. * @def: default value to return if the property has no value
  203. * @return property value, or @def if not found
  204. */
  205. int ofnode_read_u32_default(ofnode ref, const char *propname, u32 def);
  206. /**
  207. * ofnode_read_s32_default() - Read a 32-bit integer from a property
  208. *
  209. * @ref: valid node reference to read property from
  210. * @propname: name of the property to read from
  211. * @def: default value to return if the property has no value
  212. * @return property value, or @def if not found
  213. */
  214. int ofnode_read_s32_default(ofnode node, const char *propname, s32 def);
  215. /**
  216. * ofnode_read_string() - Read a string from a property
  217. *
  218. * @ref: valid node reference to read property from
  219. * @propname: name of the property to read
  220. * @return string from property value, or NULL if there is no such property
  221. */
  222. const char *ofnode_read_string(ofnode node, const char *propname);
  223. /**
  224. * ofnode_read_u32_array() - Find and read an array of 32 bit integers
  225. *
  226. * @node: valid node reference to read property from
  227. * @propname: name of the property to read
  228. * @out_values: pointer to return value, modified only if return value is 0
  229. * @sz: number of array elements to read
  230. *
  231. * Search for a property in a device node and read 32-bit value(s) from
  232. * it. Returns 0 on success, -EINVAL if the property does not exist,
  233. * -ENODATA if property does not have a value, and -EOVERFLOW if the
  234. * property data isn't large enough.
  235. *
  236. * The out_values is modified only if a valid u32 value can be decoded.
  237. */
  238. int ofnode_read_u32_array(ofnode node, const char *propname,
  239. u32 *out_values, size_t sz);
  240. /**
  241. * ofnode_read_bool() - read a boolean value from a property
  242. *
  243. * @node: valid node reference to read property from
  244. * @propname: name of property to read
  245. * @return true if property is present (meaning true), false if not present
  246. */
  247. bool ofnode_read_bool(ofnode node, const char *propname);
  248. /**
  249. * ofnode_find_subnode() - find a named subnode of a parent node
  250. *
  251. * @node: valid reference to parent node
  252. * @subnode_name: name of subnode to find
  253. * @return reference to subnode (which can be invalid if there is no such
  254. * subnode)
  255. */
  256. ofnode ofnode_find_subnode(ofnode node, const char *subnode_name);
  257. /**
  258. * ofnode_first_subnode() - find the first subnode of a parent node
  259. *
  260. * @node: valid reference to a valid parent node
  261. * @return reference to the first subnode (which can be invalid if the parent
  262. * node has no subnodes)
  263. */
  264. ofnode ofnode_first_subnode(ofnode node);
  265. /**
  266. * ofnode_next_subnode() - find the next sibling of a subnode
  267. *
  268. * @node: valid reference to previous node (sibling)
  269. * @return reference to the next subnode (which can be invalid if the node
  270. * has no more siblings)
  271. */
  272. ofnode ofnode_next_subnode(ofnode node);
  273. /**
  274. * ofnode_get_parent() - get the ofnode's parent (enclosing ofnode)
  275. *
  276. * @node: valid node to look up
  277. * @return ofnode reference of the parent node
  278. */
  279. ofnode ofnode_get_parent(ofnode node);
  280. /**
  281. * ofnode_get_name() - get the name of a node
  282. *
  283. * @node: valid node to look up
  284. * @return name or node
  285. */
  286. const char *ofnode_get_name(ofnode node);
  287. /**
  288. * ofnode_get_by_phandle() - get ofnode from phandle
  289. *
  290. * @phandle: phandle to look up
  291. * @return ofnode reference to the phandle
  292. */
  293. ofnode ofnode_get_by_phandle(uint phandle);
  294. /**
  295. * ofnode_read_size() - read the size of a property
  296. *
  297. * @node: node to check
  298. * @propname: property to check
  299. * @return size of property if present, or -EINVAL if not
  300. */
  301. int ofnode_read_size(ofnode node, const char *propname);
  302. /**
  303. * ofnode_get_addr_index() - get an address from a node
  304. *
  305. * This reads the register address from a node
  306. *
  307. * @node: node to read from
  308. * @index: Index of address to read (0 for first)
  309. * @return address, or FDT_ADDR_T_NONE if not present or invalid
  310. */
  311. phys_addr_t ofnode_get_addr_index(ofnode node, int index);
  312. /**
  313. * ofnode_get_addr() - get an address from a node
  314. *
  315. * This reads the register address from a node
  316. *
  317. * @node: node to read from
  318. * @return address, or FDT_ADDR_T_NONE if not present or invalid
  319. */
  320. phys_addr_t ofnode_get_addr(ofnode node);
  321. /**
  322. * ofnode_stringlist_search() - find a string in a string list and return index
  323. *
  324. * Note that it is possible for this function to succeed on property values
  325. * that are not NUL-terminated. That's because the function will stop after
  326. * finding the first occurrence of @string. This can for example happen with
  327. * small-valued cell properties, such as #address-cells, when searching for
  328. * the empty string.
  329. *
  330. * @node: node to check
  331. * @propname: name of the property containing the string list
  332. * @string: string to look up in the string list
  333. *
  334. * @return:
  335. * the index of the string in the list of strings
  336. * -ENODATA if the property is not found
  337. * -EINVAL on some other error
  338. */
  339. int ofnode_stringlist_search(ofnode node, const char *propname,
  340. const char *string);
  341. /**
  342. * ofnode_read_string_index() - obtain an indexed string from a string list
  343. *
  344. * Note that this will successfully extract strings from properties with
  345. * non-NUL-terminated values. For example on small-valued cell properties
  346. * this function will return the empty string.
  347. *
  348. * If non-NULL, the length of the string (on success) or a negative error-code
  349. * (on failure) will be stored in the integer pointer to by lenp.
  350. *
  351. * @node: node to check
  352. * @propname: name of the property containing the string list
  353. * @index: index of the string to return
  354. * @lenp: return location for the string length or an error code on failure
  355. *
  356. * @return:
  357. * length of string, if found or -ve error value if not found
  358. */
  359. int ofnode_read_string_index(ofnode node, const char *propname, int index,
  360. const char **outp);
  361. /**
  362. * ofnode_read_string_count() - find the number of strings in a string list
  363. *
  364. * @node: node to check
  365. * @propname: name of the property containing the string list
  366. * @return:
  367. * number of strings in the list, or -ve error value if not found
  368. */
  369. int ofnode_read_string_count(ofnode node, const char *property);
  370. /**
  371. * ofnode_parse_phandle_with_args() - Find a node pointed by phandle in a list
  372. *
  373. * This function is useful to parse lists of phandles and their arguments.
  374. * Returns 0 on success and fills out_args, on error returns appropriate
  375. * errno value.
  376. *
  377. * Caller is responsible to call of_node_put() on the returned out_args->np
  378. * pointer.
  379. *
  380. * Example:
  381. *
  382. * phandle1: node1 {
  383. * #list-cells = <2>;
  384. * }
  385. *
  386. * phandle2: node2 {
  387. * #list-cells = <1>;
  388. * }
  389. *
  390. * node3 {
  391. * list = <&phandle1 1 2 &phandle2 3>;
  392. * }
  393. *
  394. * To get a device_node of the `node2' node you may call this:
  395. * ofnode_parse_phandle_with_args(node3, "list", "#list-cells", 0, 1, &args);
  396. *
  397. * @node: device tree node containing a list
  398. * @list_name: property name that contains a list
  399. * @cells_name: property name that specifies phandles' arguments count
  400. * @cells_count: Cell count to use if @cells_name is NULL
  401. * @index: index of a phandle to parse out
  402. * @out_args: optional pointer to output arguments structure (will be filled)
  403. * @return 0 on success (with @out_args filled out if not NULL), -ENOENT if
  404. * @list_name does not exist, -EINVAL if a phandle was not found,
  405. * @cells_name could not be found, the arguments were truncated or there
  406. * were too many arguments.
  407. */
  408. int ofnode_parse_phandle_with_args(ofnode node, const char *list_name,
  409. const char *cells_name, int cell_count,
  410. int index,
  411. struct ofnode_phandle_args *out_args);
  412. /**
  413. * ofnode_count_phandle_with_args() - Count number of phandle in a list
  414. *
  415. * This function is useful to count phandles into a list.
  416. * Returns number of phandle on success, on error returns appropriate
  417. * errno value.
  418. *
  419. * @node: device tree node containing a list
  420. * @list_name: property name that contains a list
  421. * @cells_name: property name that specifies phandles' arguments count
  422. * @return number of phandle on success, -ENOENT if @list_name does not
  423. * exist, -EINVAL if a phandle was not found, @cells_name could not
  424. * be found.
  425. */
  426. int ofnode_count_phandle_with_args(ofnode node, const char *list_name,
  427. const char *cells_name);
  428. /**
  429. * ofnode_path() - find a node by full path
  430. *
  431. * @path: Full path to node, e.g. "/bus/spi@1"
  432. * @return reference to the node found. Use ofnode_valid() to check if it exists
  433. */
  434. ofnode ofnode_path(const char *path);
  435. /**
  436. * ofnode_get_chosen_prop() - get the value of a chosen property
  437. *
  438. * This looks for a property within the /chosen node and returns its value
  439. *
  440. * @propname: Property name to look for
  441. */
  442. const char *ofnode_get_chosen_prop(const char *propname);
  443. /**
  444. * ofnode_get_chosen_node() - get the chosen node
  445. *
  446. * @return the chosen node if present, else ofnode_null()
  447. */
  448. ofnode ofnode_get_chosen_node(const char *name);
  449. struct display_timing;
  450. /**
  451. * ofnode_decode_display_timing() - decode display timings
  452. *
  453. * Decode display timings from the supplied 'display-timings' node.
  454. * See doc/device-tree-bindings/video/display-timing.txt for binding
  455. * information.
  456. *
  457. * @node 'display-timing' node containing the timing subnodes
  458. * @index Index number to read (0=first timing subnode)
  459. * @config Place to put timings
  460. * @return 0 if OK, -FDT_ERR_NOTFOUND if not found
  461. */
  462. int ofnode_decode_display_timing(ofnode node, int index,
  463. struct display_timing *config);
  464. /**
  465. * ofnode_get_property()- - get a pointer to the value of a node property
  466. *
  467. * @node: node to read
  468. * @propname: property to read
  469. * @lenp: place to put length on success
  470. * @return pointer to property, or NULL if not found
  471. */
  472. const void *ofnode_get_property(ofnode node, const char *propname, int *lenp);
  473. /**
  474. * ofnode_is_available() - check if a node is marked available
  475. *
  476. * @node: node to check
  477. * @return true if node's 'status' property is "okay" (or is missing)
  478. */
  479. bool ofnode_is_available(ofnode node);
  480. /**
  481. * ofnode_get_addr_size() - get address and size from a property
  482. *
  483. * This does no address translation. It simply reads an property that contains
  484. * an address and a size value, one after the other.
  485. *
  486. * @node: node to read from
  487. * @propname: property to read
  488. * @sizep: place to put size value (on success)
  489. * @return address value, or FDT_ADDR_T_NONE on error
  490. */
  491. phys_addr_t ofnode_get_addr_size(ofnode node, const char *propname,
  492. phys_size_t *sizep);
  493. /**
  494. * ofnode_read_u8_array_ptr() - find an 8-bit array
  495. *
  496. * Look up a property in a node and return a pointer to its contents as a
  497. * byte array of given length. The property must have at least enough data
  498. * for the array (count bytes). It may have more, but this will be ignored.
  499. * The data is not copied.
  500. *
  501. * @node node to examine
  502. * @propname name of property to find
  503. * @sz number of array elements
  504. * @return pointer to byte array if found, or NULL if the property is not
  505. * found or there is not enough data
  506. */
  507. const uint8_t *ofnode_read_u8_array_ptr(ofnode node, const char *propname,
  508. size_t sz);
  509. /**
  510. * ofnode_read_pci_addr() - look up a PCI address
  511. *
  512. * Look at an address property in a node and return the PCI address which
  513. * corresponds to the given type in the form of fdt_pci_addr.
  514. * The property must hold one fdt_pci_addr with a lengh.
  515. *
  516. * @node node to examine
  517. * @type pci address type (FDT_PCI_SPACE_xxx)
  518. * @propname name of property to find
  519. * @addr returns pci address in the form of fdt_pci_addr
  520. * @return 0 if ok, -ENOENT if the property did not exist, -EINVAL if the
  521. * format of the property was invalid, -ENXIO if the requested
  522. * address type was not found
  523. */
  524. int ofnode_read_pci_addr(ofnode node, enum fdt_pci_space type,
  525. const char *propname, struct fdt_pci_addr *addr);
  526. /**
  527. * ofnode_read_addr_cells() - Get the number of address cells for a node
  528. *
  529. * This walks back up the tree to find the closest #address-cells property
  530. * which controls the given node.
  531. *
  532. * @node: Node to check
  533. * @return number of address cells this node uses
  534. */
  535. int ofnode_read_addr_cells(ofnode node);
  536. /**
  537. * ofnode_read_size_cells() - Get the number of size cells for a node
  538. *
  539. * This walks back up the tree to find the closest #size-cells property
  540. * which controls the given node.
  541. *
  542. * @node: Node to check
  543. * @return number of size cells this node uses
  544. */
  545. int ofnode_read_size_cells(ofnode node);
  546. /**
  547. * ofnode_read_simple_addr_cells() - Get the address cells property in a node
  548. *
  549. * This function matches fdt_address_cells().
  550. *
  551. * @np: Node pointer to check
  552. * @return value of #address-cells property in this node, or 2 if none
  553. */
  554. int ofnode_read_simple_addr_cells(ofnode node);
  555. /**
  556. * ofnode_read_simple_size_cells() - Get the size cells property in a node
  557. *
  558. * This function matches fdt_size_cells().
  559. *
  560. * @np: Node pointer to check
  561. * @return value of #size-cells property in this node, or 2 if none
  562. */
  563. int ofnode_read_simple_size_cells(ofnode node);
  564. /**
  565. * ofnode_pre_reloc() - check if a node should be bound before relocation
  566. *
  567. * Device tree nodes can be marked as needing-to-be-bound in the loader stages
  568. * via special device tree properties.
  569. *
  570. * Before relocation this function can be used to check if nodes are required
  571. * in either SPL or TPL stages.
  572. *
  573. * After relocation and jumping into the real U-Boot binary it is possible to
  574. * determine if a node was bound in one of SPL/TPL stages.
  575. *
  576. * There are 3 settings currently in use
  577. * -
  578. * - u-boot,dm-pre-reloc: legacy and indicates any of TPL or SPL
  579. * Existing platforms only use it to indicate nodes needed in
  580. * SPL. Should probably be replaced by u-boot,dm-spl for
  581. * new platforms.
  582. *
  583. * @node: node to check
  584. * @eturns true if node is needed in SPL/TL, false otherwise
  585. */
  586. bool ofnode_pre_reloc(ofnode node);
  587. int ofnode_read_resource(ofnode node, uint index, struct resource *res);
  588. int ofnode_read_resource_byname(ofnode node, const char *name,
  589. struct resource *res);
  590. /**
  591. * ofnode_for_each_subnode() - iterate over all subnodes of a parent
  592. *
  593. * @node: child node (ofnode, lvalue)
  594. * @parent: parent node (ofnode)
  595. *
  596. * This is a wrapper around a for loop and is used like so:
  597. *
  598. * ofnode node;
  599. *
  600. * ofnode_for_each_subnode(node, parent) {
  601. * Use node
  602. * ...
  603. * }
  604. *
  605. * Note that this is implemented as a macro and @node is used as
  606. * iterator in the loop. The parent variable can be a constant or even a
  607. * literal.
  608. */
  609. #define ofnode_for_each_subnode(node, parent) \
  610. for (node = ofnode_first_subnode(parent); \
  611. ofnode_valid(node); \
  612. node = ofnode_next_subnode(node))
  613. /**
  614. * ofnode_translate_address() - Tranlate a device-tree address
  615. *
  616. * Translate an address from the device-tree into a CPU physical address. This
  617. * function walks up the tree and applies the various bus mappings along the
  618. * way.
  619. *
  620. * @ofnode: Device tree node giving the context in which to translate the
  621. * address
  622. * @in_addr: pointer to the address to translate
  623. * @return the translated address; OF_BAD_ADDR on error
  624. */
  625. u64 ofnode_translate_address(ofnode node, const fdt32_t *in_addr);
  626. #endif