I am building a kernel module for PCIe device on Linux v5.15.60 on x86. This module connects to my FPGA (containing multiple soft cores) and creates a platform_device. For an other driver to use it.
The FPGA embed its own device tree blob in a memory region read by my kernel module. I would like to use __unflatten_device_tree, or of_fdt_unflatten_tree kernel functions to parse the blob and create new device_nodes associated with the created platform_device.
Unfortunately I can't access __unflatten_device_tree, and of_fdt_unflatten_tree would require the user to recompile the kernel with CONFIG_OF=y.
Is there any other kernel function than of_fdt_unflatten_tree to do this? I just need to parse a new blob but not to overlay the current device tree.
Edit: Once I have my device tree root in a struct device_node, can I create a list of struct devices or structe platform_devices automatically?