我试图将RTC PCF8563支持的覆盖添加到我的Yocto Raspberry PI 4-构建中。我已经准备好DT覆盖:
/dts-v1/;
/plugin/;
#include <dt-bindings/pinctrl/bcm2835.h>
#include <dt-bindings/gpio/gpio.h>
/ {
compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
fragment@1 {
target = <&i2c0mux>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
};
};
fragment@2 {
target = <&i2c0>;
__overlay__ {
status = "okay";
pcf8563: pcf8563@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
status = "okay";
};
};
};
fragment@3 {
target = <&i2c0if>;
__overlay__ {
status = "okay";
clock-frequency = <50000>;
};
};
fragment@4 {
target = <&i2c1>;
__overlay__ {
status = "okay";
};
};
};
i2c0mux节点是i2c0节点的父节点。
我还启用了以下选项的id Kconfig:
CONFIG_I2C_MUX_PINCTRL=y
CONFIG_RTC_DRV_PCF8563=y
但我得到了一个错误:
root@super-pi-machine:~# dmesg | grep pcf
[ 0.155459] bus: 'i2c': add driver pcf857x
[ 9.003364] bus: 'i2c': add driver rtc-pcf8563
[ 10.419959] bus: 'i2c': __driver_probe_device: matched device 0-0051 with driver rtc-pcf8563
[ 10.419982] bus: 'i2c': really_probe: probing driver rtc-pcf8563 with device 0-0051
[ 10.420022] rtc-pcf8563 0-0051: no pinctrl handle
[ 10.420486] rtc-pcf8563 0-0051: pcf8563_write_block_data: err=-121 addr=0e, data=03
[ 10.428359] rtc-pcf8563 0-0051: pcf8563_probe: write error
[ 10.434098] rtc-pcf8563: probe of 0-0051 failed with error -5
我已经从目标硬件反编译了/sys/ffirmware/base/devicetree,以检查设备树的外观:
i2c0 {
brcm,pins = <0x00 0x01>;
phandle = <0xa7>;
brcm,pull = <0x02>;
brcm,function = <0x04>;
};
. . .
. . .
i2c0mux {
compatible = "i2c-mux-pinctrl";
pinctrl-1 = <0x12>;
status = "okay";
#address-cells = <0x01>;
i2c-parent = <0x10>;
#size-cells = <0x00>;
phandle = <0x35>;
pinctrl-0 = <0xa7>;
pinctrl-names = "default";
i2c@0 {
status = "okay";
#address-cells = <0x01>;
#size-cells = <0x00>;
phandle = <0xb2>;
reg = <0x00>;
pinctrl-0 = <0xa7>;
pinctrl-names = "default";
pcf8563@51 {
compatible = "nxp,pcf8563";
status = "okay";
phandle = <0xec>;
reg = <0x51>;
};
};
i2c@1 {
#address-cells = <0x01>;
#size-cells = <0x00>;
phandle = <0xb3>;
reg = <0x01>;
};
};
缺少什么?