126853a24SMauro Carvalho Chehab.. SPDX-License-Identifier: GPL-2.0 226853a24SMauro Carvalho Chehab 3*7248213cSRob Herring================================= 4*7248213cSRob HerringDevicetree Dynamic Resolver Notes 5*7248213cSRob Herring================================= 626853a24SMauro Carvalho Chehab 726853a24SMauro Carvalho ChehabThis document describes the implementation of the in-kernel 826853a24SMauro Carvalho ChehabDeviceTree resolver, residing in drivers/of/resolver.c 926853a24SMauro Carvalho Chehab 1026853a24SMauro Carvalho ChehabHow the resolver works 1126853a24SMauro Carvalho Chehab---------------------- 1226853a24SMauro Carvalho Chehab 1326853a24SMauro Carvalho ChehabThe resolver is given as an input an arbitrary tree compiled with the 1426853a24SMauro Carvalho Chehabproper dtc option and having a /plugin/ tag. This generates the 1526853a24SMauro Carvalho Chehabappropriate __fixups__ & __local_fixups__ nodes. 1626853a24SMauro Carvalho Chehab 1726853a24SMauro Carvalho ChehabIn sequence the resolver works by the following steps: 1826853a24SMauro Carvalho Chehab 1926853a24SMauro Carvalho Chehab1. Get the maximum device tree phandle value from the live tree + 1. 2026853a24SMauro Carvalho Chehab2. Adjust all the local phandles of the tree to resolve by that amount. 2126853a24SMauro Carvalho Chehab3. Using the __local__fixups__ node information adjust all local references 2226853a24SMauro Carvalho Chehab by the same amount. 2326853a24SMauro Carvalho Chehab4. For each property in the __fixups__ node locate the node it references 2426853a24SMauro Carvalho Chehab in the live tree. This is the label used to tag the node. 2526853a24SMauro Carvalho Chehab5. Retrieve the phandle of the target of the fixup. 2626853a24SMauro Carvalho Chehab6. For each fixup in the property locate the node:property:offset location 2726853a24SMauro Carvalho Chehab and replace it with the phandle value. 28