我跟随官方教程进行了NPU启动的操作,在系统版本为Linux radxa-zero3 5.10.160-39-rk356x #3a8f7930a SMP Tue Dec 31 07:03:59 UTC 2024 aarch64 GNU/Linux时,使用rsetup中的overlay启用NPU并重启多次失败,尝试在/boot/dtbo路径下直接操作dtbo文件以启用NPU,在删去rk3568-npu-enable.dtbo.disable的disable后缀后重新启用U-Boot,重启后执行以下命令
radxa@radxa-zero3:~$ sudo dmesg | grep “Initialized rknpu”
[ 14.495806] [drm] Initialized rknpu 0.8.8 20230428 for fde40000.npu on minor 1
正确查找到驱动,但是查找日志发现dtbo文件未配置相应的供电与内存分配代码,查找报错如下:
radxa@radxa-zero3:~$ sudo dmesg | grep -i “npu|rknpu”
[sudo] password for radxa:
[ 11.707601] OF: reserved mem: initialized node rknpu, compatible id shared-dma-pool
[ 12.243791] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up npu-supply from device tree
[ 12.243833] rockchip-pm-domain fdd90000.power-management:power-controller: Looking up npu-supply property in node /power-management@fdd90000/power-controller failed
[ 14.385866] input: rk805 pwrkey as /devices/platform/fdd40000.i2c/i2c-0/0-0020/rk805-pwrkey/input/input0
[ 14.427722] rockchip,bus bus-npu: Looking up bus-supply from device tree
[ 14.427949] rockchip,bus bus-npu: bin=0
[ 14.427962] rockchip,bus bus-npu: Failed to get leakage
[ 14.428065] rockchip,bus bus-npu: pvtm = 88810, from nvmem
[ 14.428080] rockchip,bus bus-npu: pvtm-volt-sel=1
[ 14.428394] rockchip,bus bus-npu: avs=0
[ 14.493410] RKNPU fde40000.npu: Adding to iommu group 0
[ 14.494287] RKNPU fde40000.npu: RKNPU: rknpu iommu is enabled, using iommu mode
[ 14.494367] RKNPU fde40000.npu: Looking up rknpu-supply from device tree
[ 14.494657] RKNPU fde40000.npu: Looking up mem-supply from device tree
[ 14.494684] RKNPU fde40000.npu: Looking up mem-supply property in node /npu@fde40000 failed
[ 14.494766] RKNPU fde40000.npu: can’t request region for resource [mem 0xfde40000-0xfde4ffff]
[ 14.495806] [drm] Initialized rknpu 0.8.8 20230428 for fde40000.npu on minor 1
[ 14.496110] RKNPU fde40000.npu: Looking up rknpu-supply from device tree
[ 14.496151] vdd_gpu: could not add device link fde40000.npu: -EEXIST
[ 14.496197] RKNPU fde40000.npu: bin=0
[ 14.496414] RKNPU fde40000.npu: leakage=4
[ 14.496459] RKNPU fde40000.npu: pvtm = 88810, from nvmem
[ 14.496479] RKNPU fde40000.npu: pvtm-volt-sel=2
[ 14.497457] RKNPU fde40000.npu: avs=0
[ 14.497774] RKNPU fde40000.npu: l=0 h=2147483647 hyst=5000 l_limit=0 h_limit=0 h_table=0
[ 14.498425] RKNPU fde40000.npu: failed to find power_model node
[ 14.498501] RKNPU fde40000.npu: RKNPU: failed to initialize power model
[ 14.498523] RKNPU fde40000.npu: RKNPU: failed to get dynamic-coefficient
[ 15.749690] input: dw_hdmi as /devices/platform/fe0a0000.hdmi/rc/rc0/input1
[ 15.750933] input: hdmi_cec_key as /devices/platform/fe0a0000.hdmi/dw-hdmi-cec.1.auto/input/input2
查询rk3568-npu-enable.dtbo文件如下:
radxa@radxa-zero3:/boot/dtbo$ cat npu-overlay.dts
/dts-v1/;
/ {
metadata {
title = "Enable NPU";
compatible = "radxa,rock-3a\0radxa,rock-3b\0radxa,rock-3c\0radxa,cm3-io\0radxa,cm3-rpi-cm4-io\0radxa,e23\0radxa,e25\0radxa,cm3i-io\0radxa,zero3";
category = "misc";
exclusive = "rknpu";
description = "Enable NPU.";
};
fragment@0 {
target = <0xffffffff>;
__overlay__ {
bus-supply = <0xffffffff>;
pvtm-supply = <0xffffffff>;
status = "okay";
};
};
fragment@1 {
target = <0xffffffff>;
__overlay__ {
memory-region = <0x01>;
status = "okay";
};
};
fragment@2 {
target = <0xffffffff>;
__overlay__ {
status = "okay";
};
};
fragment@3 {
target = <0xffffffff>;
__overlay__ {
rknpu {
compatible = "shared-dma-pool";
inactive;
reusable;
size = <0x00 0x8000000>;
alignment = <0x00 0x1000>;
phandle = <0x01>;
};
};
};
__symbols__ {
rknpu_reserved = "/fragment@3/__overlay__/rknpu";
};
__fixups__ {
bus_npu = "/fragment@0:target:0";
vdd_logic = "/fragment@0/__overlay__:bus-supply:0";
vdd_cpu = "/fragment@0/__overlay__:pvtm-supply:0";
rknpu = "/fragment@1:target:0";
rknpu_mmu = "/fragment@2:target:0";
reserved_memory = "/fragment@3:target:0";
};
__local_fixups__ {
fragment@1 {
__overlay__ {
memory-region = <0x00>;
};
};
};
};
请问应如何配置dtbo文件以便正确启用NPU?感谢!