Working with the TS050 touch panel in linux

It wouldn’t :slight_smile: Killed a couple of hours trying to make TS050 work with mainline kernel. Found a set of errors during build process with Fenix script… By default it doesn’t matter if you set

CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_PANEL_KHADAS_TS050=m
CONFIG_BACKLIGHT_PWM=m

in board config file - everything will be wiped out, because the way config module dependencies are set in mainline
you won’t see this driver in config unless you specify any other driver panel
in my case I just enabled

CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=m

When another panel enabled - I got TS050 panel driver build

However it is still far from the end of the game… A lot of things are missing in mainline to make it work.
I’ve been playing with DTS from Neil Armstrong and even got lcd backlight driver loaded.

I even can mod probe TS050 - only thing I’ve reached - is absolutely black screen (this is even a progress as by default you will get scrambled logo from u-boot). Perhaps I’m missing some more things - as there is no framebuffer device in /dev. section

1 Like

I’m not sure if I’m right, but there isn’t the framebuffer replaced by the DRM in the mainline kernels ?

@OldNavi We have tested before, this configuration under the main line cannot be used

Gave some time to try TS050 on Kernel 5.16.9 and the panel doesn’t come up at all. I was under the impression that it works as it is mainlined.

Sadly it does not. So my TS050 is going back inside the box :frowning:

2 Likes

Is there any update regarding TS050 in mainline yet ?

1 Like

So far - I don’t see any progress with mainlining TS050 into the vanilla kernel. It’s not a problem with panel driver itself - most of the work is related to DRM drivers and so far per patchwork it is not yet finished, @narmstrong was working on that - but seems his last updates for vanilla DRM and MIPI-DSI was 9 months ago.

1 Like

The patchset stalled due to lack of reviewers & testers. I’ll a new version soon and post the link to the patches and a tree here so people can test

4 Likes

That would be wonderful, thank you

Hi @narmstrong

We are glad to test the patches. Thank you. :wink:

1 Like

I would happy to check it out too…

I pushed a branch based on v5.19-rc1:

The branch contains the PHY patches, the DSI controller support, DT changes & a clock fixup.

I send the PHY patches upstream, I’ll resend the DSI controller patches shortly.

Make sure to enable the followinf kernel configs:
CONFIG_DRM_DW_MIPI_DSI=y
CONFIG_DRM_MIPI_DSI=y
CONFIG_PHY_MESON_G12A_MIPI_DPHY_ANALOG=y
CONFIG_PHY_MESON_AXG_MIPI_DPHY=y
CONFIG_DRM_MESON_DW_MIPI_DSI=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_BACKLIGHT_PWM=y
CONFIG_DRM_PANEL_KHADAS_TS050=y

6 Likes

Wow, cool! Thanks Neil, I’ll try to test on my HW

1 Like

So I compiled the kernel with standard upstream defconfig as provided from @narmstrong 's repo
.config here: https://termbin.com/m8gxc

it went well and compiled the vmlinux file, any guidance on how to swap this new kernel file with the one on the default mainline ubuntu image ? @OldNavi

I flashed this image from krescue: vim3-ubuntu-20.04-server-linux-5.17-fenix-1.0.11-220429.img

@Electr1 - I’m afraid it is not an easy step to just swap it out. I assume you’ve just compiled a mainline kernel without Fenix build system.

if it was Fenix - you can just generate kernel deb files and update kernel with dpkg command.

if you have compiled kernel on a board itself - you can go on with make modules_install and make install - I assume

If you was compiling manually using cross compile on x86 machine you have
1/ Build kernel vmlinux image + build all needed kernel modules with make modules
2/ Transfer them
3/ Update ramdisk
4/ Transfer DTBs and copy correct one into /boot/dtb.img
5/ Many other things I may forgot - but perhaps you can build some mainline kernel deb packages using Fenix and take a look what steps are done for correctly installing kernel in a .deb files

Most reliable way is to use Fenix build system with a Neil sources, as Fenix also apply some additional patches to vanilla kernel (but they need to revised for 5.20 kernel) and produce new test 5.20 kernel .deb packages - but this require some time to accomplish, perhaps Artem @hyphop will try this out.

I actually did cross compiling, but it seems for testing it will involve too many steps, I will give it a go by trying to compile on the board,

and yes the prebuilt mainline image was built by fenix, but I complied the mainline kernel from neil’s source without fenix.
I used the

make defconfig

command after adding the additional configs and this resulted in a much more bigger kernel with unnecessary stuff enabled, but It is ok for testing I suppose,

I’ll try the method of compiling on the system and using make modules_install

Then use this as kind of guidance

You can try to create a deb package on SBC with

 make-kpkg
1 Like

Super.

Adding these to our kernel package.

Thanks.

1 Like

I’ve been able to compile the kernel from the given source,

Although I don’t see the screen turning on or showing output…

Just to confirm these were my steps:
fetched source from

git clone https://github.com/superna9999/linux/ --depth 1 --branch amlogic/v5.20/g12-dsi

Compiled with this .config:
https://termbin.com/t68e

installed with:

make modules_install
make install

but it returns:

khadas@Testbench:~/linux$ sudo make install
[sudo] password for khadas: 
  INSTALL /boot
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.19.0-rc2-g26dc88383b14-dirty /boot/vmlinuz-5.19.0-rc2-g26dc88383b14-dirty
update-initramfs: Generating /boot/initrd.img-5.19.0-rc2-g26dc88383b14-dirty
update-initramfs: Converting to u-boot format
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 5.19.0-rc2-g26dc88383b14-dirty /boot/vmlinuz-5.19.0-rc2-g26dc88383b14-dirty
run-parts: executing /etc/kernel/postinst.d/xx-update-initrd-links 5.19.0-rc2-g26dc88383b14-dirty /boot/vmlinuz-5.19.0-rc2-g26dc88383b14-dirty
Failed to create symlink to vmlinuz-5.19.0-rc2-g26dc88383b14-dirty.old: Operation not permitted at /usr/bin/linux-update-symlinks line 64.
run-parts: /etc/kernel/postinst.d/xx-update-initrd-links exited with return code 1
make: *** [arch/arm64/Makefile:167: install] Error 1

Not exactly sure how to proceed here…
guidance appreciated thanks!

It is alive!!! Thank you Neil @narmstrong

Welcome to Fenix 1.0.10 Ubuntu 20.04.4 LTS Linux 5.19.0-rc2  
 _  ___               _            __     _____ __  __ _____ 
| |/ / |__   __ _  __| | __ _ ___  \ \   / /_ _|  \/  |___ / 
| ' /| '_ \ / _` |/ _` |/ _` / __|  \ \ / / | || |\/| | |_ \ 
| . \| | | | (_| | (_| | (_| \__ \   \ V /  | || |  | |___) |
|_|\_\_| |_|\__,_|\__,_|\__,_|___/    \_/  |___|_|  |_|____/ 
                                                             

 * Website:        https://www.khadas.com
 * Documentation:  https://docs.khadas.com
 * Forum:          https://forum.khadas.com

Last login: Mon Jun 20 13:10:37 2022 from fe80::184d:d0c2:1154:dfac%eth0
khadas@fawn-dsp:~$ uname -a
Linux fawn-dsp 5.19.0-rc2 #1.0.10 IRQPIPE Mon Jun 20 13:10:13 MSK 2022 aarch64 aarch64 aarch64 GNU/Linux
khadas@fawn-dsp:~$ 
3 Likes

That’s awesome! Could you share some instructions on the process ? :smiley:

1 Like