18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci==================================
48c2ecf20Sopenharmony_ciDevice Tree Dynamic Resolver Notes
58c2ecf20Sopenharmony_ci==================================
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciThis document describes the implementation of the in-kernel
88c2ecf20Sopenharmony_ciDevice Tree resolver, residing in drivers/of/resolver.c
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciHow the resolver works
118c2ecf20Sopenharmony_ci----------------------
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciThe resolver is given as an input an arbitrary tree compiled with the
148c2ecf20Sopenharmony_ciproper dtc option and having a /plugin/ tag. This generates the
158c2ecf20Sopenharmony_ciappropriate __fixups__ & __local_fixups__ nodes.
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciIn sequence the resolver works by the following steps:
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci1. Get the maximum device tree phandle value from the live tree + 1.
208c2ecf20Sopenharmony_ci2. Adjust all the local phandles of the tree to resolve by that amount.
218c2ecf20Sopenharmony_ci3. Using the __local__fixups__ node information adjust all local references
228c2ecf20Sopenharmony_ci   by the same amount.
238c2ecf20Sopenharmony_ci4. For each property in the __fixups__ node locate the node it references
248c2ecf20Sopenharmony_ci   in the live tree. This is the label used to tag the node.
258c2ecf20Sopenharmony_ci5. Retrieve the phandle of the target of the fixup.
268c2ecf20Sopenharmony_ci6. For each fixup in the property locate the node:property:offset location
278c2ecf20Sopenharmony_ci   and replace it with the phandle value.
28