ophub / amlogic-s9xxx-armbian

Support for Armbian in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.
GNU General Public License v2.0
5.45k stars 1.74k forks source link

CM311-1a dtb添加无线驱动问题 #607

Closed Jencken-Wang closed 1 year ago

Jencken-Wang commented 1 year ago

你好大佬 我给cm311-1a换了板载网卡rtl8822cs,换完才发现armbian有无线无法识别问题,看完很多issu后都无法解决。 想折腾一下大佬说的在dtb中添加驱动,大佬标注的x96max+的dts文件内容复制到cm311-1a的dts文件,但dts文件编译都无法成功。因为未从事过类似开发,想尝试内容替换是否能解决,希望大佬指点指点。

我的操作过程:

  1. U盘安装启动Armbian_22.08.0_Aml_s905l3a_jammy_5.15.57_server_2022.07.25.img.gz
  2. 下载cm311 dts源码meson-g12a-s905l3a-cm311.dts
  3. 复制x96max+ dts中标注部分到cm311的dts &uart_A{}标签中 复制内容: bluetooth: bluetooth { compatible = "realtek,rtl8822cs-bt"; interrupt-parent = <&gpio_intc>; interrupts = <95 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "host-wakeup"; shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; max-speed = <2000000>; clocks = <&wifi32k>; clock-names = "lpo"; vbat-supply = <&vddao_3v3>; vddio-supply = <&vddio_ao1v8>; status = "disabled"; };
  4. 执行dtc -I dts -O dtb -o meson-g12a-s905l3a-cm311-wlan.dtb meson-g12a-s905l3a-cm311.dts 执行后报错: root@armbian:/home/test# dtc -I dts -O dtb -o meson-g12a-s905l3a-cm311-wlan.dtb meson-g12a-s905l3a-cm311.dts Error: meson-g12a-s905l3a-cm311.dts:9.1-9 syntax error FATAL ERROR: Unable to parse input tree
ophub commented 1 year ago

你的思路是正确的,但是rtl8822cs一直是一个痛,只有少量用户可以正常使用(印尼的用户第一次提供了这个驱动,并且在他的openwrt里成功驱动了无线,他是社区开发者,用户们测试也可以使用),但是有很多同学反馈不能用(在x96max+里是这个芯片),最近不久前有同学提供了最新驱动,在集成中只有5.4内核可以通过,目前最新的内核库里的5.4就集成了这个驱动。

tx3(s905x3)盒子的无线就挺好的,你动手能力强,吹下来换个有稳定驱动的无线芯片。

Snip20221008_3

ophub commented 1 year ago

只编译dtb用5分钟就搞定了。

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/compile-kernel/README.cn.md

ophub commented 1 year ago

https://github.com/unifreq/linux-5.15.y/blob/dbce84eb69e528b01c0b24782940682fccea9ac5/arch/arm64/boot/dts/amlogic/meson-g12a-s905l3a-cm311.dts#L74

来源码里添加

&uart_A {
    status = "okay";
    pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
    uart-has-rtscts;
    pinctrl-names = "default";

    bluetooth {
        compatible = "realtek,rtl8822cs-bt";
        enable-gpios  = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
        host-wake-gpios = <&gpio GPIOX_18 GPIO_ACTIVE_HIGH>;
       };
};
univerioiln233 commented 1 year ago

你的思路是正确的,但是rtl8822cs一直是一个痛,只有少量用户可以正常使用(印尼的用户第一次提供了这个驱动,并且在他的openwrt里成功驱动了无线,他是社区开发者,用户们测试也可以使用),但是有很多同学反馈不能用(在x96max+里是这个芯片),最近不久前有同学提供了最新驱动,在集成中只有5.4内核可以通过,目前最新的内核库里的5.4就集成了这个驱动。

tx3(s905x3)盒子的无线就挺好的,你动手能力强,吹下来换个有稳定驱动的无线芯片。

Snip20221008_3

tx3(s905x3)盒子 现在的网卡芯片型号是?这款产品从来没更换过wifi芯片吗?这样的话值得购买。

ophub commented 1 year ago

tx3:

https://github.com/unifreq/linux-5.15.y/blob/main/arch/arm64/boot/dts/amlogic/meson-sm1-tx3-qz.dts#L191

ophub commented 1 year ago

你改下8822cs蓝牙代码再编译一下,使用源码编译。

Jencken-Wang commented 1 year ago

你改下8822cs蓝牙代码再编译一下,使用源码编译。

感谢大佬回复,在源码里面添加后单独编译dtb成功了(内核5.15.72),替换dtb启动的时候出现了蓝牙相关信息,但都是失败。系统里面还是没有识别到无线 IMG_20221008_150842

root@armbian:/boot# modprobe 88x2cs root@armbian:/boot# iwconfig lo no wireless extensions. sit0 no wireless extensions. ip6tnl0 no wireless extensions. eth0 no wireless extensions.

想再尝试一下直接更新5.4内核,dtb可以沿用这个吗还是需要重新编译5.4内核的

ophub commented 1 year ago

https://github.com/unifreq/linux-5.4.y/commit/27fab380a16f072efa04d6d60ab42b87600be273

这几个版本的内核里都有rtl8822cs的驱动,其中5.4的是10几天前刚更新的最新版(但是也不一定能驱动起来)

https://github.com/unifreq/linux-5.4.y/blob/main/arch/arm64/boot/dts/amlogic/meson-g12a-s905l3a-cm311.dts

你在5.4的内核仓库里添加,同路径同名文件,然后编译5.4的内核的dtbs,这个生成的cm311才是你添加了8822cs驱动的,编译好的dtb替换到你当前系统里

Jencken-Wang commented 1 year ago

谢谢大佬,刚试了还是不行,打算放弃了

allonmymind commented 1 year ago

我的s905d2+rtl8822bs网卡用5.15内核的固件输入wifi密码按回车直接死机,用5.10内核固件就完全正常。不知道cs和bs通用不

Jencken-Wang commented 1 year ago

我的s905d2+rtl8822bs网卡用5.15内核的固件输入wifi密码按回车直接死机,用5.10内核固件就完全正常。不知道cs和bs通用不

估计不通用,5.10刷了也没反应。8822bs在armbian中蓝牙运行正常吗,有试过其他系统中wifi和蓝牙能运行吗?比如安卓tv或Coreelec

ruleechen commented 2 months ago

我的s905d2+rtl8822bs网卡用5.15内核的固件输入wifi密码按回车直接死机,用5.10内核固件就完全正常。不知道cs和bs通用不

估计不通用,5.10刷了也没反应。8822bs在armbian中蓝牙运行正常吗,有试过其他系统中wifi和蓝牙能运行吗?比如安卓tv或Coreelec

刚试了这里的CoreELEC:“4月16日更新21.0-1版”,WIFI和蓝牙都可用 https://www.right.com.cn/forum/thread-8281656-1-1.html