[U-Boot] [PATCH 1/2] fdt: Allow indicating a node is for U-Boot proper only
Marek Vasut
marex at denx.de
Thu Feb 7 17:47:45 UTC 2019
On 2/7/19 6:40 PM, Patrick DELAUNAY wrote:
> Hi Marek,
>
>> From: Marek Vasut <marex at denx.de>
>> Sent: mardi 5 février 2019 09:55
>>
>> On 2/4/19 3:40 PM, Simon Glass wrote:
>>> On Mon, 4 Feb 2019 at 03:15, Patrick Delaunay <patrick.delaunay at st.com>
>> 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 <patrick.delaunay at st.com>
>>>
>>> Reviewed-by: Simon Glass <sjg at chromium.org>
>>>
>>> There was discussion some time ago about using a property instead:
>>>
>>> chosen {
>>> u-boot,dm-spl = <&node1 &node2>;
>>> u-boot,dm-tpl = <&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 bit of
>> space too. I wonder if we can even use /omit-if-no-ref/ DTC syntax somehow.
>
> 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 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.
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
> others node are cleaned by fdtgrep (but impact in SPL code)
>
> 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)
>
> For example to have pins1 and pins2,
> we have to also tag qspi-bk2-0 and pin-controller
>
> 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.
--
Best regards,
Marek Vasut
More information about the U-Boot
mailing list