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.8k stars 1.87k forks source link

mgv3000(s905l3) 带蓝牙rtl8761btv 可正常驱动使用 #639

Closed imzlh closed 1 year ago

imzlh commented 1 year ago

最近刷了一台mgv3000机器,s905l3的cpu,带蓝牙rtl8761btv,这款芯片很容易驱动,就想着能否修改dtb增加蓝牙串口驱动蓝牙播放音乐什么的。 最开始clone了unifreq的kernel,照着dtsi一顿修改,然后用dtc编译,结果搞了半天还是没搞定问题,是include写法太无语了。。。自己还特地写了两个脚本把它都替换掉,但是还是没有成功 最后我还是选择了反编译,照着cm311-1a的dtb修改了一些,可是最后还是没有显示出/dev/ttyAML1。后来在网上冲浪也没有找到相关的资料,只能来这里碰碰运气了 您是怎么修改的呢?能否教教我?感激不尽! 最后附上我改的和原先的安卓dtb:https://imzlh.top/www.zip

lovelylain commented 1 year ago

在m401a盒子5.15.75内核测试了各种组合,结果如下: bluetooth部分只需要一行:compatible = "realtek,rtl8723bs-bt"; 其它内容都没有任何作用,reboot问题只能靠gpioset来解决。

max-speed = <2000000>; 把速率调低点试试,重启是否可以使用。

enable-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 这个值是盲猜的,不一定是对的,看看安卓里的值是多少。gpio是需要原理图确认的,或者是把cpu拆下来一台用万用表量。弄对了重启也可以。

你可以编译内核吧,能打上https://github.com/unifreq/linux-5.15.y/pull/24 这个补丁编译一下吗?

ophub commented 1 year ago

你可以fork内核仓库,编译内核指向自己的仓库,测试一下

xcray commented 1 year ago

在m401a盒子5.15.75内核测试了各种组合,结果如下: bluetooth部分只需要一行:compatible = "realtek,rtl8723bs-bt"; 其它内容都没有任何作用,reboot问题只能靠gpioset来解决。

max-speed = <2000000>; 把速率调低点试试,重启是否可以使用。

enable-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 这个值是盲猜的,不一定是对的,看看安卓里的值是多少。gpio是需要原理图确认的,或者是把cpu拆下来一台用万用表量。弄对了重启也可以。

盲猜的???那也太神奇了吧!经过对编译后的dtb反编译和实际验证,这个值确实是对的。 至于速率,感觉和这个问题关系不大,再说2m已经是一个比较保守的数值了——针对音乐播放需求来说。系统原有的不能用的config文件中的速率是1.5m

imzlh commented 1 year ago

观察了一周,运行挺稳定的,稳定跑docker和网站。dtb除了没有蓝牙没有显示都正常的,故希望能将其添加到安装菜单中,方便安装使用,感谢你:) 附上安卓的bootloader和我改制的安装文件: data.zip

ophub commented 1 year ago

你的压缩包里是2个安装sh文件和一个安卓的img文件?你的安装文件似乎没有使用这个bootloader文件,也没划分分区跳过的不安全区域大小?

https://github.com/ophub/amlogic-s9xxx-armbian/blob/9369fdd96f84772a93080fbb7840dad6015e235e/build-armbian/common-files/rootfs/etc/amlogic_model_database.conf#L53 和这行配置有什么区别?

你是使用的哪个dtb?哪个u-boot?哪个分区表?你的安装配置信息那行是怎么写的? 贴你的盒子的外观照片,主板正反两面的照片,短接点救砖标识位置,安卓系统原厂固件有没?

livelier commented 1 year ago

压缩包里的脚本,与此链接相似。@imzlh 建议写完整。 https://github.com/yangxuan8282/phicomm-n1/blob/master/scripts/install-arch.sh

imzlh commented 1 year ago

你的压缩包里是2个安装sh文件和一个安卓的img文件?你的安装文件似乎没有使用这个bootloader文件,也没划分分区跳过的不安全区域大小?

https://github.com/ophub/amlogic-s9xxx-armbian/blob/9369fdd96f84772a93080fbb7840dad6015e235e/build-armbian/common-files/rootfs/etc/amlogic_model_database.conf#L53

和这行配置有什么区别? 你是使用的哪个dtb?哪个u-boot?哪个分区表?你的安装配置信息那行是怎么写的? 贴你的盒子的外观照片,主板正反两面的照片,短接点救砖标识位置,安卓系统原厂固件有没?

那就算了,我不知道选项已经加好了,一直用的都是5.15.68的版本。 我的这个bootloader开机自动转绿灯(原厂的bootloader不行),不需要设置gpio73,而且我的安装文件的确跳过了不安全分区以及用了这个bootloader。那就这样吧 3949C616-F401-45F7-B988-5BE4FC620462 刷机包我收集到了两个,都可以使用:dl.imzlh.top:7297/镜像/S905/L3 (请使用ipv6访问) 主板: F2C85780-896B-491A-AAB2-420F8D2BA974 短接点刷机包里有 %B6%CC%BD%D3%CD%BC%CA%BE

imzlh commented 1 year ago

压缩包里的脚本,与此链接相似。@imzlh 建议写完整。 https://github.com/yangxuan8282/phicomm-n1/blob/master/scripts/install-arch.sh

正常,是抄150大神在s9xx镜像包里的安装文件

121592512 commented 1 year ago

把你的mgv3000的产品外观,盒子底部的型号描述信息,盒子主板正面、反面,都拍个照片发上来。 有这个设备的安卓系统镜像没?发个链接我备份到下载专区里。 你这设备有线和蓝牙都工作正常了,我给添加个安装序号。

请问大佬, 有安卓镜像了吗,下载专区没找到么

alanfans commented 1 year ago

把你的mgv3000的产品外观,盒子底部的型号描述信息,盒子主板正面、反面,都拍个照片发上来。 有这个设备的安卓系统镜像没?发个链接我备份到下载专区里。 你这设备有线和蓝牙都工作正常了,我给添加个安装序号。

请问大佬, 有安卓镜像了吗,下载专区没找到么

盒子刷机固件合集大全: 链接: https://pan.baidu.com/s/1qSmtBgSEbKs6ZFm-yCr-XQ 提取码: nnw3

121592512 commented 1 year ago

把你的mgv3000的产品外观,盒子底部的型号描述信息,盒子主板正面、反面,都拍个照片发上来。 有这个设备的安卓系统镜像没?发个链接我备份到下载专区里。 你这设备有线和蓝牙都工作正常了,我给添加个安装序号。

请问大佬, 有安卓镜像了吗,下载专区没找到么

盒子刷机固件合集大全: 链接: https://pan.baidu.com/s/1qSmtBgSEbKs6ZFm-yCr-XQ 提取码: nnw3

这个里面的mgv3000固件,打开ADB了吗

alanfans commented 1 year ago

把你的mgv3000的产品外观,盒子底部的型号描述信息,盒子主板正面、反面,都拍个照片发上来。 有这个设备的安卓系统镜像没?发个链接我备份到下载专区里。 你这设备有线和蓝牙都工作正常了,我给添加个安装序号。

请问大佬, 有安卓镜像了吗,下载专区没找到么

盒子刷机固件合集大全: 链接: https://pan.baidu.com/s/1qSmtBgSEbKs6ZFm-yCr-XQ 提取码: nnw3

这个里面的mgv3000固件,打开ADB了吗

我没有这个型号的盒子,我没有刷过,不太清楚 我只知道adb是连按安卓版本号就能打开开发者,里面打开debug就有adb了

xiayang0521 commented 1 year ago

https://github.com/unifreq/linux-5.15.y/blob/3f1f0123b98c9defe0f540b40065a8e88ccbed81/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt#L15-L19 用reset-gpios试试,看他下面的30-33行的代码示例。

增加reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 不行; 改成reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; 还是不行; 删掉enable-gpios只保留reset-gpios(ACTIVE_LOW不变);仍然不行; 改成reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 继续不行;

感觉rfkill就没有尝试做任何动作。 删掉enable只保留reset,倒是可以在命令行用gpioset操作了,重启后执行,先低后高,蓝牙自动恢复

修改/lib/systemd/system/bluetooth.server、在[Service]部分加一句? ExecStopPost=/usr/bin/env gpioset 0 82=0 反正这么弄很好用,重启了几次都没问题,我先这么用着了

简单学习了一下,这种方式比在用户空间运行rtk_hciattach要好——那种是陈旧的方法、这种是被称作serdev的“现代化”方式,虽然还没找到完美的方法,但值得采用。

请求帮忙编译一个meson-g12a-s905l3a-cm311.dtb 同样加入rtl8761b的驱动,目前只在从dtb反编译的dts里加了, bluetooth { compatible = "realtek,rtl8723bs-bt"; }; 加入相关配置文件 https://gitee.com/xiayang0521/set_bluetooth 蓝牙可用 ,但是reboot之后不行, 所以请你帮忙参照你的处理办法在源码的dts里加reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>,编一个meson-g12a-s905l3a-cm311.dtb (我不知道咋操作。。。)

alanfans commented 1 year ago

https://github.com/unifreq/linux-5.15.y/blob/3f1f0123b98c9defe0f540b40065a8e88ccbed81/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt#L15-L19 用reset-gpios试试,看他下面的30-33行的代码示例。

增加reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 不行; 改成reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; 还是不行; 删掉enable-gpios只保留reset-gpios(ACTIVE_LOW不变);仍然不行; 改成reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 继续不行; 感觉rfkill就没有尝试做任何动作。 删掉enable只保留reset,倒是可以在命令行用gpioset操作了,重启后执行,先低后高,蓝牙自动恢复 修改/lib/systemd/system/bluetooth.server、在[Service]部分加一句? ExecStopPost=/usr/bin/env gpioset 0 82=0 反正这么弄很好用,重启了几次都没问题,我先这么用着了 简单学习了一下,这种方式比在用户空间运行rtk_hciattach要好——那种是陈旧的方法、这种是被称作serdev的“现代化”方式,虽然还没找到完美的方法,但值得采用。

请求帮忙编译一个meson-g12a-s905l3a-cm311.dtb 同样加入rtl8761b的驱动,目前只在从dtb反编译的dts里加了, bluetooth { compatible = "realtek,rtl8723bs-bt"; }; 加入相关配置文件 https://gitee.com/xiayang0521/set_bluetooth 蓝牙可用 ,但是reboot之后不行, 所以请你帮忙参照你的处理办法在源码的dts里加reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>,编一个meson-g12a-s905l3a-cm311.dtb (我不知道咋操作。。。)

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/documents/README.cn.md#1213-%E5%A6%82%E4%BD%95%E5%8F%8D%E7%BC%96%E8%AF%91-dtb-%E6%96%87%E4%BB%B6 这里都有写如何编译与反编译dtb

xiayang0521 commented 1 year ago

https://github.com/unifreq/linux-5.15.y/blob/3f1f0123b98c9defe0f540b40065a8e88ccbed81/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt#L15-L19 用reset-gpios试试,看他下面的30-33行的代码示例。

增加reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 不行; 改成reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; 还是不行; 删掉enable-gpios只保留reset-gpios(ACTIVE_LOW不变);仍然不行; 改成reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 继续不行; 感觉rfkill就没有尝试做任何动作。 删掉enable只保留reset,倒是可以在命令行用gpioset操作了,重启后执行,先低后高,蓝牙自动恢复 修改/lib/systemd/system/bluetooth.server、在[Service]部分加一句? ExecStopPost=/usr/bin/env gpioset 0 82=0 反正这么弄很好用,重启了几次都没问题,我先这么用着了 简单学习了一下,这种方式比在用户空间运行rtk_hciattach要好——那种是陈旧的方法、这种是被称作serdev的“现代化”方式,虽然还没找到完美的方法,但值得采用。

请求帮忙编译一个meson-g12a-s905l3a-cm311.dtb 同样加入rtl8761b的驱动,目前只在从dtb反编译的dts里加了, bluetooth { compatible = "realtek,rtl8723bs-bt"; }; 加入相关配置文件 https://gitee.com/xiayang0521/set_bluetooth 蓝牙可用 ,但是reboot之后不行, 所以请你帮忙参照你的处理办法在源码的dts里加reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>,编一个meson-g12a-s905l3a-cm311.dtb (我不知道咋操作。。。)

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/documents/README.cn.md#1213-%E5%A6%82%E4%BD%95%E5%8F%8D%E7%BC%96%E8%AF%91-dtb-%E6%96%87%E4%BB%B6 这里都有写如何编译与反编译dtb

谢谢,dtb先反编译改后编译这方法我会,只是里面这里修改不能直接加入reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>。

不过根据他的思路,我就通过启动后查看cat /sys/kernel/debug/gpio信息, root@armbian:~# cat /sys/kernel/debug/gpio gpiochip1: GPIOs 412-426, parent: platform/ff800000.sys-ctrl:pinctrl@14, aobus-banks: gpio-421 ( |net_led ) out hi ACTIVE LOW gpio-422 ( |remote_led ) out hi ACTIVE LOW gpio-423 ( |power_led ) out lo ACTIVE LOW

gpiochip0: GPIOs 427-511, parent: platform/ff634400.bus:pinctrl@40, periphs-banks: gpio-449 ( |regulator-usb_pwr_en) out hi gpio-451 ( |regulator-vcc_5v ) out hi gpio-464 ( |reset ) out hi ACTIVE LOW gpio-474 ( |cd ) in hi ACTIVE LOW 猜测蓝牙由ff634400.bus:pinctrl@40控制,查看dts中,gpio的phandle 应该是0x39,pinctrl@40对应的phandle = <0x17>,感觉GPIOX_17的值就对应0x17,我在反编译的dts中加入了 reset-gpios = <0x39 0x17 0x01>;
编译回去之后,实测可用,reboot之后也不会出问题了。 当然这里面的值应该不通用,从源码去改才通用吧。

。。。。 好吧 怪我不懂GPIO 哈哈 才反应过来GPIOX_17里面就是17嘛 不是巧合吧

alanfans commented 1 year ago

https://github.com/unifreq/linux-5.15.y/blob/3f1f0123b98c9defe0f540b40065a8e88ccbed81/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt#L15-L19 用reset-gpios试试,看他下面的30-33行的代码示例。

增加reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 不行; 改成reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; 还是不行; 删掉enable-gpios只保留reset-gpios(ACTIVE_LOW不变);仍然不行; 改成reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 继续不行; 感觉rfkill就没有尝试做任何动作。 删掉enable只保留reset,倒是可以在命令行用gpioset操作了,重启后执行,先低后高,蓝牙自动恢复 修改/lib/systemd/system/bluetooth.server、在[Service]部分加一句? ExecStopPost=/usr/bin/env gpioset 0 82=0 反正这么弄很好用,重启了几次都没问题,我先这么用着了 简单学习了一下,这种方式比在用户空间运行rtk_hciattach要好——那种是陈旧的方法、这种是被称作serdev的“现代化”方式,虽然还没找到完美的方法,但值得采用。

请求帮忙编译一个meson-g12a-s905l3a-cm311.dtb 同样加入rtl8761b的驱动,目前只在从dtb反编译的dts里加了, bluetooth { compatible = "realtek,rtl8723bs-bt"; }; 加入相关配置文件 https://gitee.com/xiayang0521/set_bluetooth 蓝牙可用 ,但是reboot之后不行, 所以请你帮忙参照你的处理办法在源码的dts里加reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>,编一个meson-g12a-s905l3a-cm311.dtb (我不知道咋操作。。。)

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/documents/README.cn.md#1213-%E5%A6%82%E4%BD%95%E5%8F%8D%E7%BC%96%E8%AF%91-dtb-%E6%96%87%E4%BB%B6 这里都有写如何编译与反编译dtb

谢谢,dtb先反编译改后编译这方法我会,只是里面这里修改不能直接加入reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>。

不过根据他的思路,我就通过启动后查看cat /sys/kernel/debug/gpio信息, root@armbian:~# cat /sys/kernel/debug/gpio gpiochip1: GPIOs 412-426, parent: platform/ff800000.sys-ctrl:pinctrl@14, aobus-banks: gpio-421 ( |net_led ) out hi ACTIVE LOW gpio-422 ( |remote_led ) out hi ACTIVE LOW gpio-423 ( |power_led ) out lo ACTIVE LOW

gpiochip0: GPIOs 427-511, parent: platform/ff634400.bus:pinctrl@40, periphs-banks: gpio-449 ( |regulator-usb_pwr_en) out hi gpio-451 ( |regulator-vcc_5v ) out hi gpio-464 ( |reset ) out hi ACTIVE LOW gpio-474 ( |cd ) in hi ACTIVE LOW 猜测蓝牙由ff634400.bus:pinctrl@40控制,查看dts中,gpio的phandle 应该是0x39,pinctrl@40对应的phandle = <0x17>,感觉GPIOX_17的值就对应0x17,我在反编译的dts中加入了 reset-gpios = <0x39 0x17 0x01>; 编译回去之后,实测可用,reboot之后也不会出问题了。 当然这里面的值应该不通用,从源码去改才通用吧。

。。。。 好吧 怪我不懂GPIO 哈哈 才反应过来GPIOX_17里面就是17嘛 不是巧合吧

兄弟,esp32 点灯玩起来

xiayang0521 commented 1 year ago

esp32点灯是嘛 哈哈

---原始邮件--- 发件人: @.> 发送时间: 2023年2月26日(周日) 下午4:53 收件人: @.>; 抄送: @.**@.>; 主题: Re: [ophub/amlogic-s9xxx-armbian] mgv3000(s905l3) 带蓝牙rtl8761btv 可正常驱动使用 (Issue #639)

兄弟,esp32 点灯玩起来

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

uncle-wong commented 1 year ago

我的蓝牙报这个错误,mgv3000盒子。dmesg | grep Bluetooth [ 11.119142] Bluetooth: Core ver 2.22 [ 11.119200] Bluetooth: Starting self testing [ 11.154349] Bluetooth: ECDH test passed in 30654 usecs [ 11.172871] Bluetooth: SMP test passed in 17946 usecs [ 11.172971] Bluetooth: Finished self testing [ 11.220916] Bluetooth: HCI device and connection manager initialized [ 11.235495] Bluetooth: HCI socket layer initialized [ 11.235560] Bluetooth: L2CAP socket layer initialized [ 11.241280] Bluetooth: SCO socket layer initialized [ 11.377480] Bluetooth: HCI UART driver ver 2.3 [ 11.377548] Bluetooth: HCI UART protocol H4 registered [ 11.385643] Bluetooth: HCI UART protocol BCSP registered [ 11.386783] Bluetooth: HCI UART protocol LL registered [ 11.398884] Bluetooth: HCI UART protocol ATH3K registered [ 11.399085] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 11.577610] Bluetooth: HCI UART protocol Intel registered [ 11.617825] Bluetooth: HCI UART protocol Broadcom registered [ 11.644064] Bluetooth: HCI UART protocol QCA registered [ 11.648060] Bluetooth: HCI UART protocol AG6XX registered [ 11.653423] Bluetooth: HCI UART protocol Marvell registered [ 12.035585] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761 [ 12.045343] Bluetooth: hci0: RTL: rom_version status=0 version=1 [ 12.053243] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761b_fw.bin [ 12.064089] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761b_config.bin [ 12.091611] Bluetooth: hci0: RTL: cfg_sz 81, total sz 30005 [ 14.134866] Bluetooth: hci0: command 0xfc20 tx timeout [ 18.962651] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 18.962717] Bluetooth: BNEP filters: protocol multicast [ 18.967634] Bluetooth: BNEP socket layer initialized [ 22.241562] Bluetooth: hci0: RTL: download fw command failed (-110) [49245.635919] Bluetooth: hci0: command 0x1001 tx timeout [49253.742659] Bluetooth: hci0: RTL: HCI_OP_READ_LOCAL_VERSION failed (-110)

uncle-wong commented 1 year ago

dmesg |grep -i fail [ 4.928948] genirq: Setting trigger mode 3 for irq 47 failed (meson_gpio_irq_set_type+0x0/0x140) [ 5.113909] meson-drm d0100000.vpu: failed to bind c883a000.hdmi-tx (ops 0xffffffc00a336460): -19 [ 5.128614] meson-drm d0100000.vpu: master bind failed: -19 [ 5.880761] hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19) [ 8.827199] systemd[423]: /usr/lib/systemd/system-generators/netplan failed with exit status 1. [ 9.480818] systemd[1]: Failed to listen on Network Service Netlink Socket. [ 21.814695] Bluetooth: hci0: RTL: download fw command failed (-110) 应该是驱动不对,下载不成功,另外io口也不是gpio 0 82

asdasdasdaf commented 1 month ago

https://github.com/unifreq/linux-5.15.y/blob/3f1f0123b98c9defe0f540b40065a8e88ccbed81/Documentation/devicetree/bindings/net/rtl8723bs-bluetooth.txt#L15-L19 用reset-gpios试试,看他下面的30-33行的代码示例。

增加reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 不行; 改成reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; 还是不行; 删掉enable-gpios只保留reset-gpios(ACTIVE_LOW不变);仍然不行; 改成reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 继续不行; 感觉rfkill就没有尝试做任何动作。 删掉enable只保留reset,倒是可以在命令行用gpioset操作了,重启后执行,先低后高,蓝牙自动恢复 修改/lib/systemd/system/bluetooth.server、在[Service]部分加一句? ExecStopPost=/usr/bin/env gpioset 0 82=0 反正这么弄很好用,重启了几次都没问题,我先这么用着了 简单学习了一下,这种方式比在用户空间运行rtk_hciattach要好——那种是陈旧的方法、这种是被称作serdev的“现代化”方式,虽然还没找到完美的方法,但值得采用。

请求帮忙编译一个meson-g12a-s905l3a-cm311.dtb 同样加入rtl8761b的驱动,目前只在从dtb反编译的dts里加了, bluetooth { compatible = "realtek,rtl8723bs-bt"; }; 加入相关配置文件 https://gitee.com/xiayang0521/set_bluetooth 蓝牙可用 ,但是reboot之后不行, 所以请你帮忙参照你的处理办法在源码的dts里加reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>,编一个meson-g12a-s905l3a-cm311.dtb (我不知道咋操作。。。)

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/documents/README.cn.md#1213-%E5%A6%82%E4%BD%95%E5%8F%8D%E7%BC%96%E8%AF%91-dtb-%E6%96%87%E4%BB%B6 这里都有写如何编译与反编译dtb

谢谢,dtb先反编译改后编译这方法我会,只是里面这里修改不能直接加入reset-gpios= <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>。

不过根据他的思路,我就通过启动后查看cat /sys/kernel/debug/gpio信息, root@armbian:~# cat /sys/kernel/debug/gpio gpiochip1: GPIOs 412-426, parent: platform/ff800000.sys-ctrl:pinctrl@14, aobus-banks: gpio-421 ( |net_led ) out hi ACTIVE LOW gpio-422 ( |remote_led ) out hi ACTIVE LOW gpio-423 ( |power_led ) out lo ACTIVE LOW

gpiochip0: GPIOs 427-511, parent: platform/ff634400.bus:pinctrl@40, periphs-banks: gpio-449 ( |regulator-usb_pwr_en) out hi gpio-451 ( |regulator-vcc_5v ) out hi gpio-464 ( |reset ) out hi ACTIVE LOW gpio-474 ( |cd ) in hi ACTIVE LOW 猜测蓝牙由ff634400.bus:pinctrl@40控制,查看dts中,gpio的phandle 应该是0x39,pinctrl@40对应的phandle = <0x17>,感觉GPIOX_17的值就对应0x17,我在反编译的dts中加入了 reset-gpios = <0x39 0x17 0x01>; 编译回去之后,实测可用,reboot之后也不会出问题了。 当然这里面的值应该不通用,从源码去改才通用吧。

。。。。 好吧 怪我不懂GPIO 哈哈 才反应过来GPIOX_17里面就是17嘛 不是巧合吧

大佬你编辑的dts可以提供一下么?