根据网友的经验,有2种方法可解决此问题
1.反编译dtb文件修改:
apt install device-tree-compiler
dtc -I dtb -O dts -o n1.dts dtb.img
修改soc->bus@c1100000->interrupt-controller@9880:
sed -i 's/phandle = <0x22>/#phandle = <0x22>/' n1.dts
再编译回dtb文件:
dtc -I dts -O dtb -o n1.dtb n1.dts
2.修改内核dts源码并编译,x64下配置arm64交叉编译环境:
wget https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
tar -Jxf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
export ARCH=arm64
export CROSS_COMPILE=/root/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
获取内核源码并修改,之前balbes150已修复,不知为何后面又删除了。
git clone https://github.com/150balbes/Amlogic_s905-kernel.git
cd Amlogic_s905-kernel/
sed -i 's/interrupts = <29/interrupts = <25/' arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
使用balbes150 armbian内核配置文件编译dtb:
cp config-5.8.7-arm-64 .config
make dtbs
cp arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts meson-gxl-s905d-p230.dts ./
使用过程中发现内核提示以下错误:
WARNING: CPU: 0 PID: 113 at kernel/time/hrtimer.c:928 hrtimer_forward+0x88/0xc0
[ 342.080941] Modules linked in: xt_REDIRECT xt_nat xt_owner ip6table_nat ip6_tables wireguard ....
[ 342.081711] CPU: 0 PID: 113 Comm: kworker/u8:1 Tainted: G WC 5.8.7-arm-64 #20.09
[ 342.081738] Hardware name: Phicomm N1 (DT)
[ 342.081817] Workqueue: events_freezable_power_ thermal_zone_device_check
[ 342.081886] pstate: 20000085 (nzCv daIf -PAN -UAO BTYPE=--)
[ 342.081944] pc : hrtimer_forward+0x88/0xc0
[ 342.081997] lr : txdone_hrtimer+0xf4/0x110
使用5.4或5.3内核 dtb文件正常。
参考:
https://forum.armbian.com/topic/13211-fix-dtb-of-aml-s905d-phicomm-n1-box/
https://www.right.com.cn/forum/thread-2841496-1-1.html
https://www.right.com.cn/forum/thread-3271482-1-1.html
标签:none
后面的内核高精度计时器的问题使用5.4或者5.3的dtb会正常吗?我也发现有这个日志出现。感觉这个修复中断高负载的方法很迷,没有靠谱的文档讲根因.
换回了5.3内核,5.8用5.3 dtb虽然能开机且负载正常,但也有其它问题,不建议使用。