device/testing/device-{tolino,kobo}*: use common waveform extractor (MR 3099)

There is no need to duplicate things over and over again.
Also load the waveform in initramfs before loading display
modules. That is early enough to have a working display in
initramfs.
This commit is contained in:
Andreas Kemnade 2022-08-18 20:18:22 +02:00 committed by Newbyte
parent 18efe7b80e
commit 04208c6461
No known key found for this signature in database
GPG key ID: 5873C171C9429CFA
15 changed files with 15 additions and 174 deletions

View file

@ -1,13 +1,14 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-kobo-clara
pkgdesc="Kobo Clara HD"
pkgver=0.4
pkgver=0.5
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
kobo-epdc-extractor
mesa-dri-gallium
perl
postmarketos-base
@ -15,7 +16,6 @@ depends="
u-boot-tools
"
makedepends="devicepkg-dev"
install="$pkgname.post-install"
subpackages="
$pkgname-kernel-downstream:kernel_downstream
$pkgname-kernel-mainline:kernel_mainline
@ -23,8 +23,6 @@ subpackages="
"
source="
deviceinfo
extract-waveform.initd
extract-waveform.pl
uboot-script-downstream.cmd
uboot-script-mainline.cmd
"
@ -35,8 +33,6 @@ build() {
package() {
devicepkg_package $startdir $pkgname
install -Dm755 "$srcdir"/extract-waveform.pl "$pkgdir"/usr/sbin/extract-waveform.pl
install -Dm755 "$srcdir"/extract-waveform.initd "$pkgdir"/etc/init.d/extract-waveform
}
kernel_downstream() {
@ -66,9 +62,7 @@ nonfree_firmware() {
}
sha512sums="
bdc2528bd09f164870a368caf0b06a6c816b883536c3033384060bcf480ddf987daf38db4b523406e1e591f9cea86c9bb97276d88ebc3b05e2ae6bb53adb4ba8 deviceinfo
c68e4e41d73a1f9d08aeed95743d5a3ae6831d36d0259ba96ceca297479fef01b78c2b569c376c5b24b4ee24ea7d3cb44d6e97730f44d81fd67e9f0586c4911a extract-waveform.initd
34475b314e45135c84e4abdc769d3aba9df56e37814c7f689d5e1aca5af060b2e028c01e871c3863534fede0be7c79aaebe0a1ff4f2bfab2ee974489119005cf extract-waveform.pl
cf1537054e6123ccdc803c0ea5f99f2dbea499ea5d6be9f95893744a5dd2400544b5570232fb13009dfa3f9afd3b8dd54d29e645c9e0ff6aa5c845bca186a0b7 deviceinfo
4bfc2714a2670efc451860bd97d36ba12559e00aed41afdde1ac3e01b41458390358ac7f6bc96a6dee6be6a34f534da52d845b02df0566b25f4868774ef69b1d uboot-script-downstream.cmd
9f624e90df6bc6acbd6db03d4319a778443b270e5756a2bc78002df8da19d23a3ea652f3d8da15257552a7381646b83553f794d24f6ef31479d3a16af9ae5e0b uboot-script-mainline.cmd
"

View file

@ -1,3 +0,0 @@
#!/bin/sh
rc-update add extract-waveform default

View file

@ -10,6 +10,7 @@ deviceinfo_year="2018"
deviceinfo_arch="armv7"
deviceinfo_dtb_downstream="imx6sll-e60k02"
deviceinfo_dtb_mainline="imx6sll-kobo-clarahd"
deviceinfo_modules_initfs_mainline="tps6518x_hwmon tps6518x_regulator mxc_epdc_drm"
# Device related
deviceinfo_chassis="tablet"

View file

@ -1,21 +0,0 @@
#!/sbin/openrc-run
description="Extract EPD waveform blob to /lib/firmware"
depend() {
after root
}
start()
{
# Only run once
rm -f /etc/runlevels/*/$RC_SVCNAME
dir="/lib/firmware/imx/epdc"
ebegin "Copying EPD waveform to /lib/firmware..."
mkdir -p "$dir" && cd "$dir" \
&& extract-waveform.pl /dev/mmcblk0 epdc_PENG060D.fw \
&& ln -sf epdc_PENG060D.fw epdc.fw
eend $?
}

View file

@ -1,24 +0,0 @@
#!/usr/bin/env perl
# SPDX-License-Identifier: GPL-2.0+
# (c) 2020, Andreas Kemnade
sub usage {
print "Usage: $0 disk epdc.fw\ndisk is the Kobo/Toline disk (image) containing a waveform\n";
exit(1);
}
&usage unless $#ARGV == 1;
open IMGFILE, '<:raw', @ARGV[0] or die "cannot open @ARGV[0]";
seek IMGFILE, 0x700000-16, 0;
read IMGFILE, $magic, 8;
(unpack("x0 H16", $magic) eq "fff5afff78563412") or die "invalid magic";
seek IMGFILE, 0x700000-8, 0;
read IMGFILE, $lengthbytes, 4;
$length = unpack("x0 V", $lengthbytes) or die "invalid length";
print $length . " bytes\n" ;
seek IMGFILE, 0x700000, 0 or die "seek failed, file too short?";
open OUTFILE, '>:raw', @ARGV[1] or die "cannot open @ARGV[1]";
read IMGFILE, $waveform, $length;
print OUTFILE $waveform;

View file

@ -1,26 +1,24 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-tolino-shine2hd
pkgdesc="Tolino Shine 2 HD"
pkgver=0.1
pkgrel=1
pkgver=0.2
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
kobo-epdc-extractor
linux-kobo-clara-mainline
perl
postmarketos-base
u-boot-tolino-shine2hd
u-boot-tools
linux-kobo-clara-mainline
"
makedepends="devicepkg-dev"
install="$pkgname.post-install"
source="
deviceinfo
extract-waveform.initd
extract-waveform.pl
uboot-script.cmd
"
@ -30,16 +28,12 @@ build() {
package() {
devicepkg_package $startdir $pkgname
install -Dm755 "$srcdir"/extract-waveform.pl "$pkgdir"/usr/sbin/extract-waveform.pl
install -Dm755 "$srcdir"/extract-waveform.initd "$pkgdir"/etc/init.d/extract-waveform
mkimage -A arm -O linux -T script -n postmarketOS \
-d "$srcdir/uboot-script.cmd" "$srcdir/boot.scr"
install -Dm644 "$srcdir/boot.scr" "$pkgdir/boot/boot.scr"
}
sha512sums="
e4888a03a32e4543cb05b6ff1ecc04ad4ab521c11a39207243166e125a6553b373d19b890c09e3787785bc2929ef07d2434a8cc9b2e6def97b2ced96693a53b1 deviceinfo
c68e4e41d73a1f9d08aeed95743d5a3ae6831d36d0259ba96ceca297479fef01b78c2b569c376c5b24b4ee24ea7d3cb44d6e97730f44d81fd67e9f0586c4911a extract-waveform.initd
34475b314e45135c84e4abdc769d3aba9df56e37814c7f689d5e1aca5af060b2e028c01e871c3863534fede0be7c79aaebe0a1ff4f2bfab2ee974489119005cf extract-waveform.pl
525a4cd444cc450b3ea62ade25ba9f807f603a0f2a551e4ae40cc9065d82339ccdf9fd0d0f0625a066a3b83c441d7b5dc24cdd384b7cf5d9cfd8369627768f47 deviceinfo
3b5c33ffa9b81d55451fd4fa0c9ed69149304b88fb85752cead4d34b5467112029cc4883a91e7daa38f8cba55d90a814711b2c55a8d462d115b62f752ce311b7 uboot-script.cmd
"

View file

@ -1,3 +0,0 @@
#!/bin/sh
rc-update add extract-waveform default

View file

@ -29,3 +29,4 @@ deviceinfo_no_framebuffer="true"
deviceinfo_sd_embed_firmware_step_size="512"
deviceinfo_sd_embed_firmware="u-boot/tolino-shine2hd/u-boot.imx:2,u-boot/tolino-shine2hd/u-boot-env.bin:1536"
deviceinfo_modules_initfs="tps6518x_hwmon tps6518x_regulator mxc_epdc_drm"

View file

@ -1,21 +0,0 @@
#!/sbin/openrc-run
description="Extract EPD waveform blob to /lib/firmware"
depend() {
after root
}
start()
{
# Only run once
rm -f /etc/runlevels/*/$RC_SVCNAME
dir="/lib/firmware/imx/epdc"
ebegin "Copying EPD waveform to /lib/firmware..."
mkdir -p "$dir" && cd "$dir" \
&& extract-waveform.pl /dev/mmcblk0 epdc_PENG060D.fw \
&& ln -sf epdc_PENG060D.fw epdc.fw
eend $?
}

View file

@ -1,24 +0,0 @@
#!/usr/bin/env perl
# SPDX-License-Identifier: GPL-2.0+
# (c) 2020, Andreas Kemnade
sub usage {
print "Usage: $0 disk epdc.fw\ndisk is the Kobo/Toline disk (image) containing a waveform\n";
exit(1);
}
&usage unless $#ARGV == 1;
open IMGFILE, '<:raw', @ARGV[0] or die "cannot open @ARGV[0]";
seek IMGFILE, 0x700000-16, 0;
read IMGFILE, $magic, 8;
(unpack("x0 H16", $magic) eq "fff5afff78563412") or die "invalid magic";
seek IMGFILE, 0x700000-8, 0;
read IMGFILE, $lengthbytes, 4;
$length = unpack("x0 V", $lengthbytes) or die "invalid length";
print $length . " bytes\n" ;
seek IMGFILE, 0x700000, 0 or die "seek failed, file too short?";
open OUTFILE, '>:raw', @ARGV[1] or die "cannot open @ARGV[1]";
read IMGFILE, $waveform, $length;
print OUTFILE $waveform;

View file

@ -1,26 +1,24 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-tolino-shine3
pkgdesc="Tolino Shine 3"
pkgver=0.1
pkgver=0.2
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
kobo-epdc-extractor
linux-kobo-clara-mainline
perl
postmarketos-base
u-boot-tolino-shine3
u-boot-tools
linux-kobo-clara-mainline
"
makedepends="devicepkg-dev"
install="$pkgname.post-install"
source="
deviceinfo
extract-waveform.initd
extract-waveform.pl
uboot-script.cmd
"
@ -30,16 +28,12 @@ build() {
package() {
devicepkg_package $startdir $pkgname
install -Dm755 "$srcdir"/extract-waveform.pl "$pkgdir"/usr/sbin/extract-waveform.pl
install -Dm755 "$srcdir"/extract-waveform.initd "$pkgdir"/etc/init.d/extract-waveform
mkimage -A arm -O linux -T script -n postmarketOS \
-d "$srcdir/uboot-script.cmd" "$srcdir/boot.scr"
install -Dm644 "$srcdir/boot.scr" "$pkgdir/boot/boot.scr"
}
sha512sums="
9f58b75c127cb823859dc8bfa4997c58ea3d7192919b257e6c26bc8c1ddec105943cca4193bc2c5058357a64fe1395b99dbb69a0b1a95fe008d710da40b21744 deviceinfo
c68e4e41d73a1f9d08aeed95743d5a3ae6831d36d0259ba96ceca297479fef01b78c2b569c376c5b24b4ee24ea7d3cb44d6e97730f44d81fd67e9f0586c4911a extract-waveform.initd
34475b314e45135c84e4abdc769d3aba9df56e37814c7f689d5e1aca5af060b2e028c01e871c3863534fede0be7c79aaebe0a1ff4f2bfab2ee974489119005cf extract-waveform.pl
fa9be9c58e73dc106852bb6aa9daeeee7fd10c0fe8670be91c4712b36bfc6006593d939ab2a8bdf17dd2132179d889d3074715d056a6d53e831ac879485b11ab deviceinfo
86827d4464def94006105841000ed934326d814d49aa03292937228a37b1120ebb84f04cd23946feaca16c8eb8d847d671bef0ae98f2c5632fd01abb46bb033d uboot-script.cmd
"

View file

@ -1,3 +0,0 @@
#!/bin/sh
rc-update add extract-waveform default

View file

@ -12,6 +12,7 @@ deviceinfo_codename="tolino-shine3"
deviceinfo_year="2018"
deviceinfo_arch="armv7"
deviceinfo_dtb="imx6sl-tolino-shine3"
deviceinfo_modules_initfs="tps6518x_hwmon tps6518x_regulator mxc_epdc_drm"
# Device related
deviceinfo_chassis="tablet"

View file

@ -1,21 +0,0 @@
#!/sbin/openrc-run
description="Extract EPD waveform blob to /lib/firmware"
depend() {
after root
}
start()
{
# Only run once
rm -f /etc/runlevels/*/$RC_SVCNAME
dir="/lib/firmware/imx/epdc"
ebegin "Copying EPD waveform to /lib/firmware..."
mkdir -p "$dir" && cd "$dir" \
&& extract-waveform.pl /dev/mmcblk0 epdc_PENG060D.fw \
&& ln -sf epdc_PENG060D.fw epdc.fw
eend $?
}

View file

@ -1,24 +0,0 @@
#!/usr/bin/env perl
# SPDX-License-Identifier: GPL-2.0+
# (c) 2020, Andreas Kemnade
sub usage {
print "Usage: $0 disk epdc.fw\ndisk is the Kobo/Toline disk (image) containing a waveform\n";
exit(1);
}
&usage unless $#ARGV == 1;
open IMGFILE, '<:raw', @ARGV[0] or die "cannot open @ARGV[0]";
seek IMGFILE, 0x700000-16, 0;
read IMGFILE, $magic, 8;
(unpack("x0 H16", $magic) eq "fff5afff78563412") or die "invalid magic";
seek IMGFILE, 0x700000-8, 0;
read IMGFILE, $lengthbytes, 4;
$length = unpack("x0 V", $lengthbytes) or die "invalid length";
print $length . " bytes\n" ;
seek IMGFILE, 0x700000, 0 or die "seek failed, file too short?";
open OUTFILE, '>:raw', @ARGV[1] or die "cannot open @ARGV[1]";
read IMGFILE, $waveform, $length;
print OUTFILE $waveform;