代码拉取完成,页面将自动刷新
分析dtparam/dtoverlay本质,为什么能够动态改变设备与驱动的match
DTOVERLAY[debug]: using platform 'bcm2711'
DTOVERLAY[debug]: overlay map loaded
run_cmd: which dtoverlay-pre >/dev/null 2>&1 && dtoverlay-pre
run_cmd: dtc -I fs -O dtb -o '/tmp/.dtoverlays/base.dtb' /proc/device-tree 1>/dev/null 2>&1
DTOVERLAY[debug]: loading file '/tmp/.dtoverlays/base.dtb'
DTOVERLAY[debug]: found override i2c_arm
DTOVERLAY[debug]: override i2c_arm: string target 'status'
DTOVERLAY[debug]: wrote 162 bytes to '/tmp/.dtoverlays/0_dtparam.dtbo'
DTOVERLAY[debug]: wrote 174 bytes to '/sys/kernel/config/device-tree/overlays/0_dtparam/dtbo'
run_cmd: which dtoverlay-post >/dev/null 2>&1 && dtoverlay-post
0_dtparam.dtbo base.dtb
/dts-v1/;
/ {
fragment-0 {
target = < 0x32 >;
__overlay__ {
status = "okay";
};
};
};
* __symbols__
* i2c1 = "/soc/i2c@7e804000";
* i2c_arm = "/soc/i2c@7e804000";
* soc
* i2c@7e804000
* phandle = < 0x32 >;
* __overrides__
* i2c1 = "\0\0\02status";
* i2c_arm = "\0\0\02status";
i2c_arm
这个字段内容,可能在一些配置中添加的lrwxrwxrwx 1 root root 21 Jan 8 15:26 /usr/bin/dtparam -> /opt/vc/bin/dtoverlay
lrwxrwxrwx 1 root root 21 Jan 8 15:26 /usr/bin/dtoverlay -> /opt/vc/bin/dtoverlay
lrwxrwxrwx 1 pi pi 9 Feb 15 00:24 dtparam -> dtoverlay
DTOVERLAY[debug]: using platform 'bcm2711'
DTOVERLAY[debug]: overlay map loaded
run_cmd: which dtoverlay-pre >/dev/null 2>&1 && dtoverlay-pre
run_cmd: dtc -I fs -O dtb -o '/tmp/.dtoverlays/base.dtb' /proc/device-tree 1>/dev/null 2>&1
DTOVERLAY[debug]: loading file '/tmp/.dtoverlays/base.dtb'
DTOVERLAY[debug]: found override i2c_arm
DTOVERLAY[debug]: override i2c_arm: string target 'status'
DTOVERLAY[debug]: wrote 162 bytes to '/tmp/.dtoverlays/0_dtparam.dtbo'
DTOVERLAY[debug]: wrote 174 bytes to '/sys/kernel/config/device-tree/overlays/0_dtparam/dtbo'
run_cmd: which dtoverlay-post >/dev/null 2>&1 && dtoverlay-post
DTOVERLAY[debug]: found override i2c_arm
/* Returns a pointer to the override data and (through data_len) its length.
On error, sets *data_len to be the error code. */
const char *dtoverlay_find_override(DTBLOB_T *dtb, const char *override_name,
int *data_len)
{
int overrides_off;
const char *data;
int len;
// Find the table of overrides
overrides_off = fdt_path_offset(dtb->fdt, "/__overrides__");
if (overrides_off < 0)
{
dtoverlay_debug("/__overrides__ node not found");
*data_len = overrides_off;
return NULL;
}
// Locate the property
data = fdt_getprop(dtb->fdt, overrides_off, override_name, &len);
*data_len = len;
if (data)
dtoverlay_debug("found override %s", override_name);
else
dtoverlay_debug("/__overrides__ has no %s property", override_name);
return data;
}
config OF_OVERLAY
bool "Device Tree overlays"
select OF_DYNAMIC
select OF_FLATTREE
select OF_RESOLVE
help
Overlays are a method to dynamically modify part of the kernel's
device tree with dynamically loaded data.
While this option is selected automatically when needed, you can
enable it manually to improve device tree unit test coverage.
0_dtparam
dtbo path status
sudo dtparam -v i2c_arm=on
的基础上
disabled
okay
disabled
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。