Mainline kernel not working (no screen)
#1
Hi all,

I successfully started a Debian 10 ARM64 rootfs + initrd, preinstalled using QEMU with LXDE and autologin. For a touch screen this is not easy to use, but I expect using keyboard and mouse soon Smile

Using the 5.6.0-pine64 kernel which was provided with Ubuntu at delivery few weeks ago, having included the 5.6.0-pine64 modules into the debian's initrd, and having the "fstab" file corrected into rootfs, it boots fine. I customised the U-Boot boot script too.

However, I tried to do the same with a 5.8.0-rc5 kernel, using the config-5.6.0-pine64 as .config file for building the 5.8.0-rc5 kernel.
But I have no screen. I tried disabling "Enable loadable module support" so that every driver is embedded/preloaded into the kernel, but nothing more.

When comparing resulting .config, the following lines are missing after having 5.8.0-rc5 kernel built :

Code:
CONFIG_CC_HAS_WARN_MAYBE_UNINITIALIZED=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_MEMCG_SWAP_ENABLED=y
CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT_VHE=y
CONFIG_ARM64_WORKAROUND_SPECULATIVE_AT_NVHE=y
CONFIG_ARM64_LSE_ATOMICS=y
CONFIG_ARM64_PTR_AUTH=y
CONFIG_PLUGIN_HOSTCC=""
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_TRANSPARENT_HUGE_PAGECACHE=y
CONFIG_VEXPRESS_SYSCFG=y
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_SUN4I_CSI=m
CONFIG_VIDEO_SUN6I_CSI=m
CONFIG_V4L_MEM2MEM_DRIVERS=y
CONFIG_DRM_PANEL_PINEPHONE_JD9365DA=y
CONFIG_DRM_PANEL_XINGBANGDA_XBD599=y
CONFIG_DRM_I2C_ADV7533=y
CONFIG_SND_SOC_EC25=m
CONFIG_USB_CHIPIDEA_OF=m
CONFIG_RTL8723CS_NEW=m
CONFIG_COMMON_CLK_VERSATILE=y
CONFIG_CLK_SP810=y
CONFIG_CLK_VEXPRESS_OSC=y
CONFIG_CLKSRC_MMIO=y
CONFIG_CLKSRC_VERSATILE=y
CONFIG_RPMSG_QCOM_GLINK_NATIVE=y
CONFIG_OPTIMIZE_INLINING=y
CONFIG_UBSAN_ALIGNMENT=y

I guess the fact of having CONFIG_DRM_PANEL_PINEPHONE_JD9365DA missing may be one of the reasons why I have nothing on the screen...

Are you sure that mainline kernel can really be used on the pinephone?

If so, is there some diffconfig or pinephone64-defconfig somewhere?

Thank you in advance!
#2
There are still patches which haven't made it to mainline yet, I don't expect the phone to be fully functional before 5.9 at least.

The main issue regarding the display is that CONFIG_DRM_PANEL_XINGBANGDA_XBD599 (that's the one for v1.1+, the other was for the devkit) has been renamed to CONFIG_DRM_PANEL_SITRONIX_ST7703 since 5.7.
I suggest you start with a 5.7 defconfig, either from Mobian's repo or the one provided by Pine64.

Anyway, based on your defconfig diff, I assume camera, wifi and modem audio won't work at all with mainline (due to the lack of SUN6I_CSI, RTL8723CS_NEW and SND_SOC_EC25).
But you should be able to boot and use most of the features (including mobile data) without these Wink

FWIW, I'm a huge fan of debos when it comes to building custom debian images, I suggest you have a look here, with a few tweaks you'll be able to make a pure Debian image in no time Wink
#3
Thank you for this information, this is exactly what I needed, and even more Smile
#4
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 Wink ).

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.
#5
I strongly suggest you have a look at the various Mobian repos, especially the pinephone-related ones:
- modem scripts for power on/off and modem setup are in, well, pinephone-modem-scripts
- other PP-specific tweaks are in package pinephone-tweaks
- Wifi/BT firmware files are in firmware-rtl8723cs

Still not sure about the anx7688 firmware (we would probably need analogix's permission for that)

EDIT: Oh, and packages/alsa-ucm-conf might help with audio too Wink


Possibly Related Threads…
Thread Author Replies Views Last Post
  firefox-esr stopped working after June 18 update HLing 3 95 4 hours ago
Last Post: dukla2000
  mobile data on mobian not working synaption 1 174 06-02-2021, 03:16 PM
Last Post: Aberts10
  sms app is outside of screen cant send sms right now.. quick fix? temp0rary 2 191 06-02-2021, 02:12 PM
Last Post: temp0rary
  can't get file transfer working. Help, please! quixote 25 1,664 05-28-2021, 06:53 PM
Last Post: Rainer
  vivaldi only uses half the screen for website display motox6 0 198 05-22-2021, 03:49 PM
Last Post: motox6
  Default SMS app send button off screen in vertical orientation motox6 0 168 05-22-2021, 02:55 PM
Last Post: motox6
  chats not working rvh 0 167 05-18-2021, 07:48 AM
Last Post: rvh
  Mobian screen won't wake reliably. StridAst 5 682 05-05-2021, 12:07 PM
Last Post: motox6
  Run Mobian Unstable without risking being stuck without a working phone C0ffeeFreak 3 914 04-23-2021, 01:10 PM
Last Post: RTP
  Anbox apps listed in the launch screen mark1250 1 487 03-17-2021, 02:23 PM
Last Post: tvall

Forum Jump:


Users browsing this thread: 1 Guest(s)