From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Thu, 7 Feb 2019 18:47:45 +0100 Subject: [U-Boot] [PATCH 1/2] fdt: Allow indicating a node is for U-Boot proper only In-Reply-To: <0e9b24dbc05f49308306a4bf9db948a7@SFHDAG6NODE3.st.com> References: <1549275292-3134-1-git-send-email-patrick.delaunay@st.com> <53f1641f-7c55-9a34-8655-7bc41bc01d26@denx.de> <0e9b24dbc05f49308306a4bf9db948a7@SFHDAG6NODE3.st.com> Message-ID: <13efb4ac-ef65-ea70-d2a1-47a804091efa@denx.de> 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 On 2/7/19 6:40 PM, Patrick DELAUNAY wrote: > Hi Marek, >=20 >> From: Marek Vasut >> Sent: mardi 5 f=C3=A9vrier 2019 09:55 >> >> 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. >> >> 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 b= it of >> space too. I wonder if we can even use /omit-if-no-ref/ DTC syntax someh= ow. >=20 > If I correctly understood the new feature of dtc "/omit-if-no-ref/", in = kernel dtc since 4.18, > dtc remove node when nobody use reference on this node, so it is useful f= or U-Boot > nodes when they are used as reference : for example pincontrol nodes. > cf: https://elinux.org/Device_Tree_Source_Undocumented >=20 > U-Boot dtb use dtc to compile dts files , so it can be used here. >=20 > But for SPL / TPL the parsing in done in fdtgrep, on dtb > And the tags "/omit-if-no-ref/" are already removed in dtb. Maybe we need feature which is similar, not the same. > NB: we could also remove the tags u-boot,dm-pre-reloc/u-boot,dm-spl : we= can gain place in spl dtb > These tags are not needed as binding is mandatory in SPL build for= ALL node present in SPL device tree=20 > others node are cleaned by fdtgrep (but impact in SPL code)=20 >=20 > PS: a other boring point: if we need to tag all the tree to have one sub-= node in SPL > For me spl tag on the children should be enough ... Indeed, referencing the child node with a phandle from some chosen node would be much better than adding u-boot,dm-... throughout the tree. > But is perhaps difficult in ftdgrep (need to parse all the fathers = node) >=20 > 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; > }; > }; > }; I still like using the phandle better than the u-boot,dm-spl all over the place. --=20 Best regards, Marek Vasut