如何解析内核模块中的新设备树 BLOB?

问题描述 投票:0回答:0

我正在 x86 上的

Linux-5.15.60
上为 PCIe 设备构建内核模块。该模块连接到我的 FPGA(包含多个软核)并创建一个
platform_device
。供其他司机使用。

FPGA 将自己的设备树 blob 嵌入到我的内核模块读取的内存区域中。我想使用

__unflatten_device_tree
of_fdt_unflatten_tree
内核函数来解析 blob 并创建新的
device_nodes
与创建的
platform_device
.

不幸的是我无法访问

__unflatten_device_tree
,而
of_fdt_unflatten_tree
会要求用户用
CONFIG_OF=y
重新编译内核。

除了

of_fdt_unflatten_tree
还有其他内核函数可以做到这一点吗?我只需要解析一个新的 blob,而不是覆盖当前的设备树。

linux-kernel kernel kernel-module device-tree pci
© www.soinside.com 2019 - 2024. All rights reserved.