Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: missing timer in dts: how to deal ?



sys/stand/efiboot/efifdt.c has some examples. An easy one is in efi_fdt_gop (starting on L371) which creates a /chosen/framebuffer node:

1) Get a handle to the parent node:

   chosen = efi_fdt_chosen();

2) Add a child node, storing the handle:

   fb = fdt_add_subnode(fdt_data, chosen, "framebuffer@fe000000");

3) Set properties on the node using fdt_appendprop_*

Happy to help review any changes you want to make here, feel free to reach out to me off list.

Take care,
Jared


On Sat, 6 May 2023, Manuel Bouyer wrote:

On Fri, May 05, 2023 at 06:55:35PM -0300, Jared McNeill wrote:
Hi Manuel --

The fp_bootstrap callback for i.mx6sx should be able to deal with this.
Either make a fake device_t + softc and call the attach function directly
(no need for this to be an actual device), or create a node programatically
describing the device and add it to the fdt using libfdt.h.

Try to make the code smart enough to only do this if a device with that
compatible string does not already exist in the device tree, in case it is
added in the future.

thanks
I think the fdt node is the way to go, as this also needs an interrupt and
it may not be so easy to do without a node.

Do you have an example of a node created in the kernel using libfdt.h ?
I had a quick look at libfdt.h and it doesn't look obvious ...

--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
    NetBSD: 26 ans d'experience feront toujours la difference
--



Home | Main Index | Thread Index | Old Index