From: Patrick DELAUNAY Date: Thu, 7 Feb 2019 17:40:08 +0000 Subject: [U-Boot] [PATCH 1/2] fdt: Allow indicating a node is for U-Boot proper only In-Reply-To: <53f1641f-7c55-9a34-8655-7bc41bc01d26@denx.de> References: <1549275292-3134-1-git-send-email-patrick.delaunay@st.com> <53f1641f-7c55-9a34-8655-7bc41bc01d26@denx.de> Message-ID: <0e9b24dbc05f49308306a4bf9db948a7@SFHDAG6NODE3.st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de Hi Marek, > From: Marek Vasut > Sent: mardi 5 f=C3=A9vrier 2019 09:55 >=20 > On 2/4/19 3:40 PM, Simon Glass wrote: > > On Mon, 4 Feb 2019 at 03:15, Patrick Delaunay > wrote: > >> > >> This add missing parts for previous commit 06f94461a9f4 > >> ("fdt: Allow indicating a node is for U-Boot proper only") > >> > >> At present it is not possible to specify that a node should be used > >> before relocation (in U-Boot proper) without it also ending up in SPL > >> and TPL device trees. Add a new "u-boot,dm-pre-proper" boolean property > for this. > >> > >> > >> Signed-off-by: Patrick Delaunay > > > > Reviewed-by: Simon Glass > > > > There was discussion some time ago about using a property instead: > > > > chosen { > > u-boot,dm-spl =3D <&node1 &node2>; > > u-boot,dm-tpl =3D <&node1>; > > }; > > > > At the time I decided that this was more painful since it separates > > out the tag from its node. > > > > I wonder if that is still true? We do now in fact generally use a > > u-boot.dtsi file to hold these tags. > > > > I'm not suggesting a change, just raising the question. >=20 > It's a good suggestion. In fact, you can then use some tool to walk back = up the > tree and only retain the branches which are referenced by phandle from u- > boot,dm-spl/tpl node for U-Boot SPL/TPL DTs. I think that could save a bi= t of > space too. I wonder if we can even use /omit-if-no-ref/ DTC syntax someho= w. If I correctly understood the new feature of dtc "/omit-if-no-ref/", in ke= rnel dtc since 4.18, dtc remove node when nobody use reference on this node, so it is useful for= U-Boot nodes when they are used as reference : for example pincontrol nodes. cf: https://elinux.org/Device_Tree_Source_Undocumented U-Boot dtb use dtc to compile dts files , so it can be used here. But for SPL / TPL the parsing in done in fdtgrep, on dtb And the tags "/omit-if-no-ref/" are already removed in dtb. NB: we could also remove the tags u-boot,dm-pre-reloc/u-boot,dm-spl : we c= an gain place in spl dtb These tags are not needed as binding is mandatory in SPL build for A= LL node present in SPL device tree=20 others node are cleaned by fdtgrep (but impact in SPL code)=20 PS: a other boring point: if we need to tag all the tree to have one sub-no= de in SPL For me spl tag on the children should be enough ... But is perhaps difficult in ftdgrep (need to parse all the fathers no= de) For example to have pins1 and pins2, we have to also tag qspi-bk2-0 and pin-controller =20 pin-controller at 50002000 { u-boot,dm-pre-reloc; qspi-bk2-0 { u-boot,dm-spl; pins1 { u-boot,dm-spl; }; pins2 { u-boot,dm-spl; }; }; }; > -- > Best regards, > Marek Vasut