<DC-IRC> <adeepv> i think this is error in dts file for bpi-cm4. https://github.com/armbian/build/pull/5273#issuecomment-1573203519
<DC-IRC> <c0rnelius> @adeepv Right I agree. My first thought was adding a reset in UART_A under BLUETOOTH, but that went no where. I then reviewed the vendor DTS and saw they also used a reset there. I played around with your suggestion, among others, but all of that also ended up accomplishing nothing. It wasn't till I added the reset into the sdio-pwrsec that bluetooth would come back every time.
<DC-IRC> <adeepv> hmm. can you try remove all links to GPIOX_19 and try manual do gpio reset for BT? maybe too small timeout in Bluetooth-hci_h5-Add-power-reset-via-gpio-in-h5_btrt.patch
<DC-IRC> <adeepv> I am also confused by the use of GPIO_ACTIVE_LOW in sdio_pwrseq and GPIO_ACTIVE_HIGH in the bluetooth section. is there an error in the bluetooth section?
<DC-IRC> <c0rnelius> yeah it's weird isn't it?
<DC-IRC> <adeepv> The 8822cs module often gets stuck on reboot and requires a separate reset on the BT_PWREN line. I experimented a lot with manual resets and settled on a 100ms timeout, which gives a working bluetooth in 95% of cases
<DC-IRC> <adeepv> After adding the Bluetooth-hci_h5-Add-power-reset-via-gpio-in-h5_btrt.patch, users stopped complaining about bluetooth not working after a hot reboot.
<DC-IRC> <c0rnelius> I have an X96-AIR which also uses the 8822cs and the bluetooth also gets stuck on it. I found you can unbind and bind serial0-0 with a service and the bluetooth will come back everytime. This of course doesn't work on the CM4. ```
<DC-IRC> <c0rnelius> echo -n "serial0-0" > /sys/bus/serial/drivers/hci_uart_h5/unbind
<DC-IRC> <c0rnelius> sleep .50
<DC-IRC> <c0rnelius> echo -n "serial0-0" > /sys/bus/serial/drivers/hci_uart_h5/bind
<DC-IRC> <c0rnelius> ``` I played around with this patch `Bluetooth-hci_h5-Add-power-reset-via-gpio-in-h5_btrt.patch` but in my testing it didn't go anywhere.
<DC-IRC> <adeepv> i think we need to search right bluetooth section links to GPIO
<DC-IRC> <adeepv> it seems that binding/unbinding the driver simply resets the GPIO when the driver starts. And it doesn't work on CM4 because of errors in DTS
<DC-IRC> <c0rnelius> Yeah there is something very off in the DTS. It almost seems like it is backwards with the gpio HIGH and LOW in places.
<DC-IRC> <c0rnelius> @adeepv I was 100% sure I had tried this before, but I guess not. This appears to do the job ```
<DC-IRC> <c0rnelius> enable-gpios = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>;
<DC-IRC> <c0rnelius> //host-wake-gpios = <&gpio GPIOX_19 GPIO_ACTIVE_HIGH>;
<DC-IRC> <c0rnelius> device-wake-gpios = <&gpio GPIOX_18 GPIO_ACTIVE_HIGH>;
<DC-IRC> <c0rnelius> ``` Since we are on the topic of bluetooth, have you tried the latest upstream bluetooth firmware `rtl_bt/rtl8822cs_fw.bin` `rtl_bt/rtl8822cs_config.bin`? In my testing it seems to be more agreeable.
<DC-IRC> <adeepv> i prefer armbian-firmware. it uses different speed for uart port. it works on my devices