In the AllWinner MR536 Tina5 Linux system environment, the commonly used debugging commands on the board are as follows:1. Mount debugfs (the /sys/kernel/debug directory will depend on this)
mount -t debugfs none /sys/kernel/debug
2. Get DDR frequency
cat /sys/kernel/debug/clk/clk_summary | grep ddr
After execution, it may return the following content:
pll-ddr 5 5 0 2784000000 0 0 50000 Y
This indicates that the DDR clock frequency is 2784000000/2=1392MHz, meaning the clock frequency is half of the transfer rate.3. Get and set NPU frequency
cat /sys/kernel/debug/clk/clk_summary | grep npu
After execution, it will return the following content:
npu 0 0 0 696000000 0 0 50000 N
This indicates that the NPU frequency is 696000000=696MHz. When we load the NPU driver vipcore.ko, the corresponding /sys/kernel/debug/viplite directory will appear, and at this point, the above command will return the following content:
npu 0 1 0 864000000 0 0 50000 N
When the NPU driver version is v2.0.3 or a newer version, the NPU frequency can be read and set using the following commands:Read:
cat /sys/kernel/debug/viplite/clk_freq
Set:
echo 328000000 > /sys/kernel/debug/viplite/clk_freq
4. Read NPU Loading data
cat /sys/kernel/debug/viplite/core_loading
5. Additional Information1) The relevant descriptions for AllWinner NPU are as follows:
The model for the V85x and R853s platforms is VIP9000PICO_PID0XEE
The model for the MR527, AI985, and T527 platforms is VIP9000NANOSI_PLUS_PID0X10000016
The model for the MR536 and T536 platforms is VIP9000NANODI_PLUS_PID0X1000003B
2) The printed information when loading vipcore.ko is as follows:
/lib/modules/5.15.147 # insmod vipcore.ko[ 5038.716931] npu[6243][6243] vipcore, platform driver init[ 5038.717602] npu[6243][6243] vipcore, insmod param cpu_physical=0x0[ 5038.718346] npu[6243][6243] vipcore, insmod param cpu_physical=0x0[ 5038.719089] npu[6243][6243] vipcore, insmod param cpu_physical=0x0[ 5038.719832] npu[6243][6243] vipcore, insmod param cpu_physical=0x0[ 5038.720591] npu[6243][6243] vipcore, platform device compatible=allwinner,npu[ 5038.721693] npu[6243][6243] vipcore, platform driver device=0xffffff800153bc10[ 5038.722582] npu[6243][6243] vipcore irq number is 102.[ 5038.723202] vipdrv_drv_adjust_param 825 SUCCESS[ 5038.723759] NPU AXI CLK NULL[ 5038.724108] NPU AHB CLK NULL[ 5038.725127] npu[6243][6243] EXTRA: 0xf05a, SID: 0x0, max_freq: 1000000000, default_freq: 1000000000[ 5038.726440] npu[6243][6243] current vf index: 0[ 5038.728033] npu[6243][6243] Supported vf list:[ 5038.729152] npu[6243][6243] freq: 480000000, vol: 920000[ 5038.729862] npu[6243][6243] freq: 492000000, vol: 1000000[ 5038.732073] npu[6243][6243] freq: 648000000, vol: 1000000[ 5038.732760] npu[6243][6243] freq: 864000000, vol: 1150000[ 5038.733451] npu[6243][6243] NPU Use VF0000, use freq 864 MHz[ 5038.734227] npu[6243][6243] Want set pclk rate(864000000) support(864000000) real(864000000)[ 5038.735222] npu[6243][6243] Want set mclk rate(864000000) support(864000000) real(864000000)[ 5038.742916] npu[6243][6243] Want set npu vol(1150000) now vol(1150000)[ 5038.742935] npu[6243][6243] vipcore, device_cnt=1, core_cnt=1[ 5038.744728] npu[6243][6243] core_0, request irqline=102, name=vipcore_0[ 5038.745580] npu[6243][6243] vipcore, allocate page for video memory, size: 0x400000 bytes[ 5038.746589] npu[6243][6243] vipcore, heap_cnt=0, reserved video memory cpu_phy=0x44000000, vip_phy=0x44000000, size=0x400000[ 5038.748006] npu[6243][6243] VIPLite driver version 2.0.3.1-AW-2024-08-08