From d7a7acf9320923f8ed0854d3dad534982f11a1d4 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 8 Jan 2025 22:46:54 -0500 Subject: [PATCH] pmos/device-pine64-pinenote: new aport --- .../50-touchscreen.conf | 11 +++ .../81-libinput-pinenote.rules | 9 +++ .../82-ebc-rockchip.rules | 2 + pmos/device-pine64-pinenote/APKBUILD | 81 +++++++++++++++++++ pmos/device-pine64-pinenote/blacklist.conf | 3 + pmos/device-pine64-pinenote/deviceinfo | 37 +++++++++ .../local-overrides.quirks | 5 ++ pmos/device-pine64-pinenote/modules-initfs | 5 ++ pmos/device-pine64-pinenote/panfrost.conf | 2 + pmos/device-pine64-pinenote/phoc.ini | 6 ++ pmos/device-pine64-pinenote/rockchip_ebc.conf | 1 + 11 files changed, 162 insertions(+) create mode 100644 pmos/device-pine64-pinenote/50-touchscreen.conf create mode 100644 pmos/device-pine64-pinenote/81-libinput-pinenote.rules create mode 100644 pmos/device-pine64-pinenote/82-ebc-rockchip.rules create mode 100644 pmos/device-pine64-pinenote/APKBUILD create mode 100644 pmos/device-pine64-pinenote/blacklist.conf create mode 100644 pmos/device-pine64-pinenote/deviceinfo create mode 100644 pmos/device-pine64-pinenote/local-overrides.quirks create mode 100644 pmos/device-pine64-pinenote/modules-initfs create mode 100644 pmos/device-pine64-pinenote/panfrost.conf create mode 100644 pmos/device-pine64-pinenote/phoc.ini create mode 100644 pmos/device-pine64-pinenote/rockchip_ebc.conf diff --git a/pmos/device-pine64-pinenote/50-touchscreen.conf b/pmos/device-pine64-pinenote/50-touchscreen.conf new file mode 100644 index 0000000..f2d643b --- /dev/null +++ b/pmos/device-pine64-pinenote/50-touchscreen.conf @@ -0,0 +1,11 @@ +Section "InputClass" + Identifier "evdev touchscreen" + MatchProduct "tt21000" + MatchIsTouchscreen "on" + Driver "evdev" +EndSection +Section "InputClass" + Identifier "RotateTouch" + MatchProduct "w9013" + Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1" +EndSection diff --git a/pmos/device-pine64-pinenote/81-libinput-pinenote.rules b/pmos/device-pine64-pinenote/81-libinput-pinenote.rules new file mode 100644 index 0000000..700c71c --- /dev/null +++ b/pmos/device-pine64-pinenote/81-libinput-pinenote.rules @@ -0,0 +1,9 @@ +ACTION=="remove", GOTO="libinput_device_group_end" +KERNEL!="event[0-9]*", GOTO="libinput_device_group_end" + +ATTRS{phys}=="?*", ATTRS{name}=="cyttsp5", ENV{LIBINPUT_DEVICE_GROUP}="pinenotetouch" +ATTRS{phys}=="?*", ATTRS{name}=="w9013 2D1F:0095 Stylus", ENV{LIBINPUT_DEVICE_GROUP}="pinenotetouch" + +ATTRS{phys}=="?*", ATTRS{name}=="cyttsp5", ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1" + +LABEL="libinput_device_group_end" diff --git a/pmos/device-pine64-pinenote/82-ebc-rockchip.rules b/pmos/device-pine64-pinenote/82-ebc-rockchip.rules new file mode 100644 index 0000000..56c673d --- /dev/null +++ b/pmos/device-pine64-pinenote/82-ebc-rockchip.rules @@ -0,0 +1,2 @@ +SUBSYSTEM=="module", KERNEL=="rockchip_ebc", RUN+="/bin/chgrp video /sys/module/%k/parameters/dclk_select /sys/module/%k/parameters/auto_refresh /sys/module/%k/parameters/bw_dither_invert /sys/module/%k/parameters/bw_threshold /sys/module/%k/parameters/bw_mode /sys/module/%k/parameters/diff_mode /sys/module/%k/parameters/direct_mode /sys/module/%k/parameters/limit_fb_blits /sys/module/%k/parameters/panel_reflection /sys/module/%k/parameters/refresh_threshold /sys/module/%k/parameters/refresh_waveform /sys/module/%k/parameters/skip_reset /sys/module/%k/parameters/split_area_limit /sys/module/%k/parameters/default_waveform", RUN+="/bin/chmod g+w /sys/module/%k/parameters/bw_threshold /sys/module/%k/parameters/bw_mode /sys/module/%k/parameters/default_waveform /sys/module/%k/parameters/diff_mode /sys/module/%k/parameters/direct_mode /sys/module/%k/parameters/limit_fb_blits /sys/module/%k/parameters/panel_reflection /sys/module/%k/parameters/refresh_threshold /sys/module/%k/parameters/refresh_waveform /sys/module/%k/parameters/skip_reset /sys/module/%k/parameters/auto_refresh /sys/module/%k/parameters/bw_dither_invert /sys/module/%k/parameters/split_area_limit" +DRIVER=="rockchip-ebc", RUN+="/bin/chgrp video /sys/%p/power/control", RUN+="/bin/chmod g+w /sys/%p/power/control" diff --git a/pmos/device-pine64-pinenote/APKBUILD b/pmos/device-pine64-pinenote/APKBUILD new file mode 100644 index 0000000..d58c79f --- /dev/null +++ b/pmos/device-pine64-pinenote/APKBUILD @@ -0,0 +1,81 @@ +# Maintainer: Petr Hodina +pkgname=device-pine64-pinenote +pkgdesc="Pine64 PineNote" +pkgver=2 +pkgrel=8 +url="https://postmarketos.org" +license="MIT" +arch="aarch64" +options="!check !archcheck" +depends=" + u-boot-pine64-pinenote + linux-pine64-pinenote + postmarketos-base +" +makedepends="devicepkg-dev" +source=" + deviceinfo + modules-initfs + phoc.ini + local-overrides.quirks + 50-touchscreen.conf + 81-libinput-pinenote.rules + 82-ebc-rockchip.rules + blacklist.conf + panfrost.conf + rockchip_ebc.conf +" +subpackages=" + $pkgname-nonfree-firmware:nonfree_firmware + $pkgname-phosh +" + +build() { + devicepkg_build $startdir $pkgname +} + +package() { + devicepkg_package $startdir $pkgname + + install -Dm644 "$srcdir"/local-overrides.quirks \ + -t "$pkgdir"/etc/libinput/ + install -Dm644 "$srcdir"/50-touchscreen.conf \ + -t "$pkgdir"/etc/X11/xorg.conf.d + install -Dm644 "$srcdir"/81-libinput-pinenote.rules \ + -t "$pkgdir"/usr/lib/udev/rules.d + install -Dm644 "$srcdir"/82-ebc-rockchip.rules \ + "$pkgdir"/usr/lib/udev/rules.d + install -Dm644 "$srcdir"/blacklist.conf.conf \ + -t "$pkgdir"/etc/modprobe.d + install -Dm644 "$srcdir"/panfrost.conf \ + "$pkgdir"/etc/modprobe.d + install -Dm644 "$srcdir"/rockchip_ebc.conf \ + "$pkgdir"/etc/modprobe.d +} + +phosh() { + install_if="$pkgname=$pkgver-r$pkgrel phosh" + depends="postmarketos-theme" + + install -Dm644 "$srcdir"/phoc.ini \ + -t "$subpkgdir"/etc/phosh +} + +nonfree_firmware() { + pkgdesc="WiFi, Bluetooth and display firmware" + depends="firmware-pine64-pinenote linux-firmware" + mkdir "$subpkgdir" +} + +sha512sums=" +5829b9b52206a7520066e4bb3c08c2535d98002a3940664a0239344f5e7522fe7b6a9cb0c0074f9846c7e42c40746f2991f6aeeefeba8efa9140c16630b2893e deviceinfo +473accb3497244742dd9fd15f8a02957a13e08fa4d4393fec185ecbb27f1f17726e4b5ece22da861151f9d358d3266206c647def8aa75adb672b6f1f1904c66f modules-initfs +4bf5158fbd53274a7429e825bb66225001f2403a4851e2d6803323b77d9095738ee3e5340ac85baf3e86bb4f47d38af8cbd78d8a5055c59a62f5b06e722e19cb phoc.ini +1123720962c9c8fec3c50302ca6a3dd56e2907dc9eea361a7b8eb4201b042476633d41a0ee4f6ab61d9c60eeccc894f83491ba9fa309a9bce2f1db0b0341d79d local-overrides.quirks +ac433eebbc35a48561837495997aee4e55510b979bc0d8e3bafb761bc1be5b4bdeed2f456369dcbc582688aefd07c63966b0d72b6ffa99e84cfd868e677f02c8 50-touchscreen.conf +2bc51f200baefc37abfaaad368a911244999e906bdca4b728ac233f49a8fb3ae7206ee3c95cdb20d7dceae2a31d25a57f4e1da4fd67057fd64724b8232e42aed 81-libinput-pinenote.rules +19e922eec89dba419798c4e1dc9b39c040db33986d0969a39a8220c642fa081763f15ff2418115d5a748af4054a1be0784927d1712ea79942c2b237ebab47728 82-ebc-rockchip.rules +aed87c0f0ef9ed8ac0b4c96591cf712d8f34c7b3bfc58aaa738c7baf6d095c8cdd2914c47c7f0caccb90cdb3a540abaa077ec8cd30198fcdfced8d964f0c1072 blacklist.conf +6ba6638754e00908243de2f73ed6898dac03638a200dcf7b7cd9684757355ee1eb0ac874af0f971ad2e054c1a8c471867bdaea4d9aaf7eea6d3cf81ac7dd73a2 panfrost.conf +8f01d9662c064cd6dd9eb0fe6ca36b7cf4304d1860f094c2c9c9f22ffdcfc2fde1040b5eeed016cb77a91d5b73382046e51a0b7a58334fcd7486befbf9fed7f0 rockchip_ebc.conf +" diff --git a/pmos/device-pine64-pinenote/blacklist.conf b/pmos/device-pine64-pinenote/blacklist.conf new file mode 100644 index 0000000..58a1553 --- /dev/null +++ b/pmos/device-pine64-pinenote/blacklist.conf @@ -0,0 +1,3 @@ +# rockchip-rga will crash the kernel on unload at the moment +blacklist rockchip-rga +blacklist ws8100_pen diff --git a/pmos/device-pine64-pinenote/deviceinfo b/pmos/device-pine64-pinenote/deviceinfo new file mode 100644 index 0000000..22b6d1c --- /dev/null +++ b/pmos/device-pine64-pinenote/deviceinfo @@ -0,0 +1,37 @@ +# Reference: +# Please use double quotes only. You can source this file in shell +# scripts. + +deviceinfo_format_version="0" +deviceinfo_name="Pine64 PineNote" +deviceinfo_manufacturer="Pine64" +deviceinfo_codename="pine64-pinenote" +deviceinfo_year="2021" +deviceinfo_dtb="rockchip/rk3566-pinenote-v1.2" +deviceinfo_arch="aarch64" +deviceinfo_gpu_accelerated="true" + +# Device related +deviceinfo_chassis="tablet" +deviceinfo_keyboard="false" +deviceinfo_external_storage="false" +deviceinfo_screen_width="1404" +deviceinfo_screen_height="1872" +deviceinfo_getty="ttyS2;1500000" + +# initfs + +# Bootloader related +deviceinfo_flash_method="rkdeveloptool" +deviceinfo_flash_sparse="true" + +deviceinfo_boot_part_start="65536" + +deviceinfo_sd_embed_firmware="u-boot/pine64-pinenote/u-boot-rockchip.bin:1" +deviceinfo_sd_embed_firmware_step_size="32768" + +deviceinfo_flash_rk_partition_kernel="boot" +deviceinfo_flash_rk_partition_rootfs="os1" + +deviceinfo_generate_extlinux_config="true" +deviceinfo_kernel_cmdline="drm.debug=0x0 vt.color=0xf earlycon console=tty0 console=ttyS2,1500000n8 PMOS_FORCE_PARTITION_RESIZE" diff --git a/pmos/device-pine64-pinenote/local-overrides.quirks b/pmos/device-pine64-pinenote/local-overrides.quirks new file mode 100644 index 0000000..030ca8b --- /dev/null +++ b/pmos/device-pine64-pinenote/local-overrides.quirks @@ -0,0 +1,5 @@ +[PineNote] +MatchName=cyttsp5 +AttrPalmPressureThreshold=28 +AttrThumbPressureThreshold=27 +AttrSizeHint=210x157 diff --git a/pmos/device-pine64-pinenote/modules-initfs b/pmos/device-pine64-pinenote/modules-initfs new file mode 100644 index 0000000..1b49e53 --- /dev/null +++ b/pmos/device-pine64-pinenote/modules-initfs @@ -0,0 +1,5 @@ +tps65185-regulator +rockchip_ebc +drm_kms_helper +drm_shmem_helper +pvi_waveform diff --git a/pmos/device-pine64-pinenote/panfrost.conf b/pmos/device-pine64-pinenote/panfrost.conf new file mode 100644 index 0000000..31a1750 --- /dev/null +++ b/pmos/device-pine64-pinenote/panfrost.conf @@ -0,0 +1,2 @@ +softdep panfrost pre: rockchip_ebc +# blacklist rockchip_ebc diff --git a/pmos/device-pine64-pinenote/phoc.ini b/pmos/device-pine64-pinenote/phoc.ini new file mode 100644 index 0000000..90d53d8 --- /dev/null +++ b/pmos/device-pine64-pinenote/phoc.ini @@ -0,0 +1,6 @@ +# /etc/phosh/phoc.ini +# Overwrites values set in /usr/share/phosh/phoc.ini + +# e-ink is an "Unknown" display type for now in mainline +[output:Unknown-1] +scale = 2.0 diff --git a/pmos/device-pine64-pinenote/rockchip_ebc.conf b/pmos/device-pine64-pinenote/rockchip_ebc.conf new file mode 100644 index 0000000..f3904c2 --- /dev/null +++ b/pmos/device-pine64-pinenote/rockchip_ebc.conf @@ -0,0 +1 @@ +options rockchip_ebc direct_mode=0 auto_refresh=1 refresh_threshold=60 split_area_limit=0 panel_reflection=1 prepare_prev_before_a2=0 dclk_select=0