struct device中的fwnode在linux内核中做什么? [英] What does fwnode in struct device do in linux kernel?

查看:431
本文介绍了struct device中的fwnode在linux内核中做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

结构设备的定义中,定义了一个 fwnode 字段,

In the definition of struct device,there is a fwnode field defined,

struct device {
    ...
    struct fwnode_handle    *fwnode; /* firmware device node */
    ...
}

对应的文件位于 include/linux/fwnode.h 中:

struct fwnode_reference_args {
    struct fwnode_handle *fwnode;
    unsigned int nargs;
    unsigned int args[NR_FWNODE_REFERENCE_ARGS];
};
...

然后我在网站上搜索了它,但是找不到内核这部分( fwnode )的详细说明,那是什么意思?它是做什么的?您可以提供参考文件吗?

Then I search it on the website, but can not find the detail explaining of this part (fwnode) of kernel so what does it mean? And what does it do? Can you provide a documentation for reference.

推荐答案

fwnode 指的是一个固件节点,通常表示设备树或 ACPI(通常是 DSDT 表)中的一个条目.设备树和ACPI是定义设备及其属性以及它们之间的互连的两种不同方式.他们都使用树结构来编码此信息.

The fwnode refers to a firmware node usually representing an entry in either Device Tree or ACPI (generally the DSDT table). Device Tree and ACPI are two different ways to define devices and their properties and interconnections between them. They both use tree structures to encode this information.

给定的 struct设备上的fwnode成员是该设备的相应固件表中的节点.ACPI在基于x86/UEFI的系统中很常见,而设备树在ARM系统中很常见.

The fwnode member on a given struct device is the node in the corresponding firmware table for that device. ACPI is common in x86/UEFI based systems and device tree is common in ARM systems.

fwnode可以与接受fwnode句柄的内核API一起使用.V4l2(适用于Linux 2的视频)fwnode API就是这样的API:

fwnode can be used with kernel APIs which accept fwnode handles. One such API is the V4l2 (Video For Linux 2) fwnode API: https://www.kernel.org/doc/html/latest/media/kapi/v4l2-fwnode.html

_DSD图: https://www.kernel.org/doc/Documentation/acpi/dsd/graph.txt

这篇关于struct device中的fwnode在linux内核中做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆