[PATCH 0/3] dm: core: Avoid multiple calls to fdt_parent_offset()

Jonas Karlman jonas at kwiboo.se
Sun Aug 4 17:05:48 CEST 2024


Use of fdt_parent_offset() is very expensive as detailed by the function
documentation:

  NOTE: This function is expensive, as it must scan the device tree
  structure from the start to nodeoffset, *twice*.

This series remove multiple calls to fdt_parent_offset() or
ofnode_get_parent() when instead a single call can be made and the
returned value can be reused.

This series help reduce boot time by around:
- ~137ms on a Radxa ROCK Pi 4 (RK3399)
- ~33ms on a Radxa ZERO 3W (RK3566)

Jonas Karlman (3):
  dm: core: fdtaddr: Avoid multiple calls to fdt_parent_offset()
  dm: core: ofnode: Avoid multiple calls to ofnode_get_parent()
  dm: core: regmap: Avoid multiple calls to ofnode_get_parent()

 drivers/core/fdtaddr.c | 24 +++++++++++++++++-------
 drivers/core/ofnode.c  |  5 +++--
 drivers/core/regmap.c  | 14 ++++++++++----
 3 files changed, 30 insertions(+), 13 deletions(-)

-- 
2.45.2



More information about the U-Boot mailing list