Biktorgj / quectel_eg25_recovery

Stock firmware recovery packages for Quectel EG25-G
78 stars 15 forks source link

Unable to `adb reload edl` probably due to modem-power driver #13

Closed sergei-mironov closed 2 years ago

sergei-mironov commented 2 years ago

Hi. I have an 1.2 Pinephone with old 01.001.10 stock modem firmware. The OS is MobileNixos with the Megi's kernel. So I wanted to update the firmware by following the manual in this repo. I have successfully unlocked the ADB by sending the right AT commands, and now it can see the device. But every time I am trying to reboot it to edl I see the following dmesg log:

[  436.282460] modem-power serial1-0: AT command 'AT+QCFG="fast/poweroff"' returned ERROR
[  436.314499] modem-power serial1-0: powered up in 19930 ms

# <now the adb reboot edl is called>

[  587.851125] usb 2-1: USB disconnect, device number 6
[  587.851903] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[  587.852026] option 2-1:1.0: device disconnected
[  587.852871] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[  587.853008] option 2-1:1.1: device disconnected
[  587.861082] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[  587.861250] option 2-1:1.2: device disconnected
[  587.882457] option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
[  587.882621] option 2-1:1.3: device disconnected
[  587.883037] qmi_wwan 2-1:1.4 wwan0: unregister 'qmi_wwan' usb-1c1b000.usb-1, WWAN/QMI device
[  588.063766] modem-power serial1-0: powering down
[  588.253394] usb 2-1: new high-speed USB device number 7 using ehci-platform
[  588.921503] modem-power serial1-0: STATUS signal is high too soon during powerdown. Modem is already off?
[  588.921571] modem-power serial1-0: powered down in 857 ms
[  588.970821] usb 2-1: USB disconnect, device number 7

I conclude that the modem-power panics and turns the modem off! The modem is indeed left unpowered:

[root@nixos:~]# cat /sys/class/modem-power/modem-power/device/powered
0

If I power it up again it starts in normal mode so I can try booting to edl again with the same result. What can I do to disable the driver of maybe bypass it somehow? ** Edit: the driver is built into kernel, so I can't just unload it. Accessing the u-boot command line is also complicated. Is there a way to e.g. disable it temporary using sysfs?

sergei-mironov commented 2 years ago

Note, the kernel is 5.13.7 rev b1f383fd3c70e21a8062fdc3f59403d2a26edc9f

sergei-mironov commented 2 years ago

In the end, we found a way to disable the Megi's power-driver by not writing 1 to /sys/class/modem-power/modem-power/device/powered at the system startup. After that, the update succeeded. Edit Forgot to add, if I remember correctly, I enabled the modem manually by writing 2 to the .../powered (dumb mode).