[U-Boot] About convert to LIVE DT

Kever Yang kever.yang at rock-chips.com
Mon Feb 5 01:00:14 UTC 2018



On 02/04/2018 09:40 PM, Simon Glass wrote:
> Hi Kever,
>
> On 4 February 2018 at 00:44, Kever Yang <kever.yang at rock-chips.com> wrote:
>> Hi Simon, Philipp,
>>
>>     When I try to convert to live dt, I fount there are many APIs work
>> in fdt are missing in live dt,
>>
>> do you have any suggestion to add these APIs in live dt quickly? I need:
>>
>> fdtdec_get_addr_size_auto_noparent
> dev_read_addr_size() - not having a parent doesn't happen with livetree
>
>> fdt_alloc_phandle
> We don't support changing the live tree yet.
>
>> fdt_device_is_available
> dev_read_enabled()
>
>> fdt_for_each_subnode
> dev_for_each_subnode()
>
>> fdt_getprop
> dev_read_prop()
>
>> fdt_getprop_u32_default_node
> This is an odd function. Can you first check that the property exists,
> and then use a dev_read_...() function to read it?
>
>> fdt_get_named_resource
> dev_read_resource_byname()
>
>> fdt_get_name
> dev_read_name() - although I see that the comment is wrong
>
>> fdt_get_path
> Not available but you can add it
>
>> fdt_get_phandle
> Why do you need this?

Most of the APIs are used in this file or other files in this folder,
https://github.com/rockchip-linux/u-boot/blob/release/drivers/video/drm/rockchip_display.c
It needs to handle quite complicated dts node for display system in
rockchip drm display driver(not upstream yet):
https://github.com/rockchip-linux/u-boot/blob/release/arch/arm/dts/rk3128.dtsi#L421
https://github.com/rockchip-linux/u-boot/blob/release/arch/arm/dts/rk3126-bnd-d708.dts#L114

Thanks,
- Kever
>
>> fdt_node_depth
>> fdt_node_offset_by_phandle
>> fdt_node_offset_by_phandle_node
> uclass_get_device_by_phandle() or similar?
>
>> fdt_path_offset
> ofnode_path() although it does not return a device. Best avoided.
>
>> fdt_set_phandle
> You can't change the livtree at present.
>
>> fdt_stringlist_get
> dev_read_string_index()
>
>> fdt_stringlist_search
> dev_read_stringlist_search()
>
>> fdt_subnode_offset
> Why do you want that?
>
>> fdt_supernode_atdepth_offset
> This should be found by scanning, generally using separate drivers for
> each DT node.
>
> If you like you could send a patch with the info above, to
> doc/driver-model/livetree.txt to help others.
>
> Regards,
> Simon
>




More information about the U-Boot mailing list