07-19-2020, 07:15 AM
(This post was last modified: 07-19-2020, 09:16 AM by jrobin28260.)
Just for information by the way, about using official Debian with a compatible kernel
I used Mobian Kernel with arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dtb (as my phone is UBport Edition / Community Edition, which is supposed to be 1.2, if I'm right). By the way, KVM is working on it (opened 2 KVM running in parallel! Will probably install Windows 10 arm64 soon or late just for fun ).
Even when using a compatible kernels, appart from WiFi, it seems to need some tweaks to have everything working.
--------------------------------------------------------------------------
WiFi (2.4 GHz) is performing well, about 50 Mbps on 20MHz bandwidth and about 100 Mbps on 40 MHz bandwidth.
Used network-manager-gnome (which is working fine on both IPv4 and IPv6 settings), but I guess others network managers can be used.
--------------------------------------------------------------------------
For information, I got bluetooth working by adding to Debian rootfs and initrd the following files :
/lib/firmware/rtl_bt/rtl8723cs_xx_fw.bin
/lib/firmware/rtl_bt/rtl8723cs_xx_config-pinebook.bin
Because I saw in dmesg some errors about those files missing. Took them from Ubuntu Touch, as they weren't included into "apt install firmware-realtek".
Using "blueman" as bluetooth manager for connecting mouse and keyboard, now works fine into Debian 10 / LXDE
--------------------------------------------------------------------------
Still with Mobian kernel, looks like the USB C driver (anx7688) is included, making "port0" available into /sys/class/typec/
But according to https://xnux.eu/devices/feature/anx7688.html, an EEPROM should be flashed with a working firmware before being able to use it on the pinephone.
Did so by downloading https://xff.cz/git/linux-firmware/plain/anx7688-fw.bin to /lib/firmware and running echo 1 > /sys/class/typec/port0/device/flash_eeprom
As I didn't reworked the defective hardware conception grounding "CC" signal (see this tutorial https://xnux.eu/devices/pp-usbc-fix.jpg), in order to connect an USB-C hub, I would need to manually ask software to become "host" but I had no success in doing so :
According to linux kernel source file "#include <uapi/linux/errno.h>", Unknown error 524 is #define ENOTSUPP 524 /* Operation is not supported */
But may be another command should be used, I don't know.
--------------------------------------------------------------------------
Modem :
I still have a problem with it.
On Ubuntu Touch, after 20 seconds, something makes a new USB device visible, which is the modem :
Then "modem-manager" (which I run using ssh -X root@Phone_IP) is able to play with it.
But from Debian, I still don't know what is used to trigger this apparition (is this a pinephone hardware specific i2c message sent by ubuntu touch to wake something, or something else ?)
I guess the answer may be available somewhere into https://gitlab.com/mobian1/mobian-recipes (thanks a-wai for the link)
EDIT : looks like into Ubuntu Touch, the "oFono" service used to interract with the modem and modem-manager, (which is available into Debian), has a customized boot script for the pinephone, containing really clear things : the modem needs to be powered on from GPIO signals.
But I read somewhere that this modem needs some attention at poweroff to avoid corruption of the internal memory. Will try to find back all needed information before trying anything.
According to : https://wiki.pine64.org/PinePhone#Modem_...er_Support
here* : https://megous.com/dl/tmp/modem.txt
And here : https://xnux.eu/devices/feature/modem-pp.html
--------------------------------------------------------------------------
And audio is still not working (visible outputs and inputs aren't working, even when disabling mute and moving volume up) so a pinephone specific tweak is probably needed here too.
I used Mobian Kernel with arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dtb (as my phone is UBport Edition / Community Edition, which is supposed to be 1.2, if I'm right). By the way, KVM is working on it (opened 2 KVM running in parallel! Will probably install Windows 10 arm64 soon or late just for fun ).
Even when using a compatible kernels, appart from WiFi, it seems to need some tweaks to have everything working.
--------------------------------------------------------------------------
WiFi (2.4 GHz) is performing well, about 50 Mbps on 20MHz bandwidth and about 100 Mbps on 40 MHz bandwidth.
Used network-manager-gnome (which is working fine on both IPv4 and IPv6 settings), but I guess others network managers can be used.
--------------------------------------------------------------------------
For information, I got bluetooth working by adding to Debian rootfs and initrd the following files :
/lib/firmware/rtl_bt/rtl8723cs_xx_fw.bin
/lib/firmware/rtl_bt/rtl8723cs_xx_config-pinebook.bin
Because I saw in dmesg some errors about those files missing. Took them from Ubuntu Touch, as they weren't included into "apt install firmware-realtek".
Using "blueman" as bluetooth manager for connecting mouse and keyboard, now works fine into Debian 10 / LXDE
--------------------------------------------------------------------------
Still with Mobian kernel, looks like the USB C driver (anx7688) is included, making "port0" available into /sys/class/typec/
But according to https://xnux.eu/devices/feature/anx7688.html, an EEPROM should be flashed with a working firmware before being able to use it on the pinephone.
Did so by downloading https://xff.cz/git/linux-firmware/plain/anx7688-fw.bin to /lib/firmware and running echo 1 > /sys/class/typec/port0/device/flash_eeprom
As I didn't reworked the defective hardware conception grounding "CC" signal (see this tutorial https://xnux.eu/devices/pp-usbc-fix.jpg), in order to connect an USB-C hub, I would need to manually ask software to become "host" but I had no success in doing so :
Code:
root@pinecrobe:/sys/class/typec/port0# echo device > /sys/class/typec/port0/data_role
bash: echo: write error: Unknown error 524
root@pinecrobe:/sys/class/typec/port0# echo host > /sys/class/typec/port0/data_role
bash: echo: write error: Unknown error 524
According to linux kernel source file "#include <uapi/linux/errno.h>", Unknown error 524 is #define ENOTSUPP 524 /* Operation is not supported */
But may be another command should be used, I don't know.
--------------------------------------------------------------------------
Modem :
I still have a problem with it.
On Ubuntu Touch, after 20 seconds, something makes a new USB device visible, which is the modem :
Code:
[ 20.366175] usb 3-1: new high-speed USB device number 2 using ehci-platform
[ 20.577030] usbcore: registered new interface driver option
[ 20.577084] usbserial: USB Serial support registered for GSM modem (1-port)
[ 20.577431] option 3-1:1.0: GSM modem (1-port) converter detected
[ 20.581267] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 20.581643] option 3-1:1.1: GSM modem (1-port) converter detected
[ 20.590260] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 20.590797] option 3-1:1.2: GSM modem (1-port) converter detected
[ 20.594813] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 20.595147] option 3-1:1.3: GSM modem (1-port) converter detected
[ 20.601957] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB3
Then "modem-manager" (which I run using ssh -X root@Phone_IP) is able to play with it.
But from Debian, I still don't know what is used to trigger this apparition (is this a pinephone hardware specific i2c message sent by ubuntu touch to wake something, or something else ?)
I guess the answer may be available somewhere into https://gitlab.com/mobian1/mobian-recipes (thanks a-wai for the link)
EDIT : looks like into Ubuntu Touch, the "oFono" service used to interract with the modem and modem-manager, (which is available into Debian), has a customized boot script for the pinephone, containing really clear things : the modem needs to be powered on from GPIO signals.
Code:
description "oFono Mobile telephony stack"
start on started dbus
stop on stopping dbus
pre-start script
echo "Enabling EG25 WWAN module"
# GPIO35 is PWRKEY
# GPIO68 is RESET_N
# GPIO232 is W_DISABLE#
for i in 35 68 232
do
[ -e /sys/class/gpio/gpio$i ] && continue
echo $i > /sys/class/gpio/export || return 1
echo out > /sys/class/gpio/gpio$i/direction || return 1
done
echo 0 > /sys/class/gpio/gpio68/value || return 1
echo 0 > /sys/class/gpio/gpio232/value || return 1
( echo 1 > /sys/class/gpio/gpio35/value && sleep 2 && echo 0 > /sys/class/gpio/gpio35/value ) || return 1
end script
post-start script
/usr/bin/enable-modem
end script
post-stop script
echo "Disabling EG25 WWAN module"
echo 1 > /sys/class/gpio/gpio68/value
echo 1 > /sys/class/gpio/gpio232/value
echo 1 > /sys/class/gpio/gpio35/value && sleep 2 && echo 0 > /sys/class/gpio/gpio35/value
end script
expect fork
respawn
exec ofonod
But I read somewhere that this modem needs some attention at poweroff to avoid corruption of the internal memory. Will try to find back all needed information before trying anything.
According to : https://wiki.pine64.org/PinePhone#Modem_...er_Support
Quote:There is a document about using the modem from January 18th 2020 by user megi here*. The script at the end to disable the modem before power off is pretty essential to avoid corrupting your modem's flash memory.
here* : https://megous.com/dl/tmp/modem.txt
And here : https://xnux.eu/devices/feature/modem-pp.html
Quote:Via sysfs (since 5.6):
# request powerup
echo 1 > /sys/devices/platform/modem/powered
# request powerdown
echo 0 > /sys/devices/platform/modem/powered
# read power status (changes only after power state transition is complete)
cat /sys/devices/platform/modem/powered
# It's also possible to change the powerdown safety delay (in ms):
cat /sys/devices/platform/modem/powerdown_safety_delay
echo 10000 > /sys/devices/platform/modem/powerdown_safety_delay
--------------------------------------------------------------------------
And audio is still not working (visible outputs and inputs aren't working, even when disabling mute and moving volume up) so a pinephone specific tweak is probably needed here too.