device-kobo-clara: split out downstream build as unmaintained (MR 4550)

Near-mainline kernel is feature-complete since quite some time, so lets
use that as a default also to simplify boot process, since downstream kernel
depends on various blobs loaded into memory by the bootloader.
Get rid of quirks required in boot process for mainline kernels
also by using a near-mainline u-boot.
Prepare for handling rev b devices.
Keep Downstream kernel to be able to optimize/compare EPD operation
This commit is contained in:
Andreas Kemnade 2023-11-11 12:42:31 +01:00 committed by Pablo Correa Gómez
parent a83cb87b70
commit 3531702772
No known key found for this signature in database
GPG key ID: C88B2C25B3576FE8
20 changed files with 150 additions and 62 deletions

View file

@ -1,13 +1,15 @@
# Maintainer: Andreas Kemnade <andreas@kemnade.info>
# Reference: <https://postmarketos.org/devicepkg> # Reference: <https://postmarketos.org/devicepkg>
pkgname=device-kobo-clara pkgname=device-kobo-clara
pkgdesc="Kobo Clara HD" pkgdesc="Kobo Clara HD"
pkgver=0.7 pkgver=0.7
pkgrel=5 pkgrel=6
url="https://postmarketos.org" url="https://postmarketos.org"
license="MIT" license="MIT"
arch="armv7" arch="armv7"
options="!check !archcheck" options="!check !archcheck"
depends=" depends="
linux-kobo-clara-mainline
kobo-epdc-extractor kobo-epdc-extractor
perl perl
postmarketos-base postmarketos-base
@ -15,16 +17,10 @@ depends="
u-boot-tools u-boot-tools
" "
makedepends="devicepkg-dev" makedepends="devicepkg-dev"
subpackages="
$pkgname-kernel-downstream:kernel_downstream
$pkgname-kernel-mainline:kernel_mainline
$pkgname-nonfree-firmware:nonfree_firmware
"
source=" source="
deviceinfo deviceinfo
modules-initfs.mainline modules-initfs
uboot-script-downstream.cmd uboot-script.cmd
uboot-script-mainline.cmd
" "
build() { build() {
@ -33,37 +29,13 @@ build() {
package() { package() {
devicepkg_package $startdir $pkgname devicepkg_package $startdir $pkgname
}
kernel_downstream() {
pkgdesc="Downstream kernel"
depends="linux-kobo-clara"
devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
mkimage -A arm -O linux -T script -n postmarketOS \ mkimage -A arm -O linux -T script -n postmarketOS \
-d "$srcdir"/uboot-script-downstream.cmd "$srcdir/boot-downstream.scr" -d "$srcdir/uboot-script.cmd" "$srcdir/boot.scr"
install -Dm644 "$srcdir/boot-downstream.scr" "$subpkgdir/boot/boot.scr" install -Dm644 "$srcdir/boot.scr" "$pkgdir/boot/boot.scr"
}
kernel_mainline() {
pkgdesc="Close to mainline kernel"
depends="linux-kobo-clara-mainline"
devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
mkimage -A arm -O linux -T script -n postmarketOS \
-d "$srcdir/uboot-script-mainline.cmd" "$srcdir/boot-mainline.scr"
install -Dm644 "$srcdir/boot-mainline.scr" "$subpkgdir/boot/boot.scr"
}
nonfree_firmware() {
pkgdesc="Kobo Clara HD firmware"
depends="firmware-kobo-clara"
mkdir "$subpkgdir"
} }
sha512sums=" sha512sums="
bdc2528bd09f164870a368caf0b06a6c816b883536c3033384060bcf480ddf987daf38db4b523406e1e591f9cea86c9bb97276d88ebc3b05e2ae6bb53adb4ba8 deviceinfo c1eb7552f3163a6a48b699a6c99010914b75fd84b36b1d1a4ffb83d19cc1bbc3355bbe9b1a568ea2a6c2d0e4a87c4a22b7330c454c215b8f8b1edb2b2bac170d deviceinfo
5d53ee902538e53c4fe79eaef8e3800b9d3f73ec70d2a9887ddb11a6715ca76ce17128e3c02c2b6f2f575fb86f15c2415c24466d4b1a031f7a346d0db186dcb1 modules-initfs.mainline 5d53ee902538e53c4fe79eaef8e3800b9d3f73ec70d2a9887ddb11a6715ca76ce17128e3c02c2b6f2f575fb86f15c2415c24466d4b1a031f7a346d0db186dcb1 modules-initfs
4bfc2714a2670efc451860bd97d36ba12559e00aed41afdde1ac3e01b41458390358ac7f6bc96a6dee6be6a34f534da52d845b02df0566b25f4868774ef69b1d uboot-script-downstream.cmd 7bd9c0aa73b67520b8563b9d4453acafa29adcfed1575d96aea3b0d2e2023cbe9cd7d252b97786efb920a6f05e17a913079353ba481428f16c97d82b42051a2c uboot-script.cmd
9f624e90df6bc6acbd6db03d4319a778443b270e5756a2bc78002df8da19d23a3ea652f3d8da15257552a7381646b83553f794d24f6ef31479d3a16af9ae5e0b uboot-script-mainline.cmd
" "

View file

@ -8,8 +8,7 @@ deviceinfo_manufacturer="Kobo"
deviceinfo_codename="kobo-clara" deviceinfo_codename="kobo-clara"
deviceinfo_year="2018" deviceinfo_year="2018"
deviceinfo_arch="armv7" deviceinfo_arch="armv7"
deviceinfo_dtb_downstream="imx6sll-e60k02" deviceinfo_dtb="imx6sll-kobo-clarahd"
deviceinfo_dtb_mainline="imx6sll-kobo-clarahd"
# Device related # Device related
deviceinfo_chassis="tablet" deviceinfo_chassis="tablet"
@ -26,5 +25,4 @@ deviceinfo_generate_legacy_uboot_initfs="true"
deviceinfo_no_framebuffer="true" deviceinfo_no_framebuffer="true"
deviceinfo_sd_embed_firmware_step_size="512" deviceinfo_sd_embed_firmware_step_size="512"
deviceinfo_sd_embed_firmware_downstream="u-boot/kobo-clara/u-boot.imx:2,firmware/kobo-clara/hwcfg+header.bin:1023,firmware/kobo-clara/ntxfw-E60K00+header.bin:1029,u-boot/kobo-clara/u-boot-env.bin:1536" deviceinfo_sd_embed_firmware="u-boot/kobo-clara/u-boot.imx:2,u-boot/kobo-clara/u-boot-env.bin:1536"
deviceinfo_sd_embed_firmware_mainline="u-boot/kobo-clara/u-boot.imx:2,firmware/kobo-clara/hwcfg+header.bin:1023,u-boot/kobo-clara/u-boot-env.bin:1536"

View file

@ -1,9 +1,5 @@
setenv bootargs console=ttymxc0,115200 setenv bootargs console=ttymxc0,115200
# This must be called first, otherwise bootz does not work correctly.
# The actual kernel is loaded over this below.
load_ntxkernel
echo Loading kernel echo Loading kernel
load mmc 0:1 0x80800000 vmlinuz load mmc 0:1 0x80800000 vmlinuz

View file

@ -1,36 +1,43 @@
# Maintainer: Andreas Kemnade <andreas@kemnade.info>
# Reference: <https://postmarketos.org/devicepkg> # Reference: <https://postmarketos.org/devicepkg>
pkgname=u-boot-kobo-clara pkgname=u-boot-kobo-clara
pkgver=2016.03 pkgver=2023.10
pkgrel=0 pkgrel=0
pkgdesc="U-Boot for Kobo Clara HD" pkgdesc="U-Boot for Kobo Clara HD"
arch="armv7" arch="armv7"
_carch="arm" _carch="arm"
license="GPL-2.0" license="GPL-2.0"
url="https://github.com/pmsourcedump/kobo_clara_uboot" url="https://github.com/akemnade/u-boot-fslc"
options="!check" makedepends="bash bc dtc bison flex openssl-dev"
options="!check !tracedeps pmb:cross-native"
_repository="kobo_clara_uboot" _repository="u-boot-fslc"
_commit="5af329fef886e21b777426d7bf5c6162e2317de7" _commit="a3816f6b51b5dc9083af4142ca5f3a4e4a235336"
source=" source="
$pkgname-$_commit.tar.gz::https://github.com/pmsourcedump/$_repository/archive/$_commit.tar.gz $pkgname-$_commit.tar.gz::https://github.com/akemnade/$_repository/archive/$_commit.tar.gz
u-boot-env.txt u-boot-env.txt
" "
builddir="$srcdir/$_repository-$_commit" builddir="$srcdir/$_repository-$_commit"
build() { build() {
make ARCH="$_carch" mx6sll_ntx_lpddr2_512m_config make ARCH="$_carch" mx6sllclarahd_defconfig
scripts/config --set-str BOOTCOMMAND "detect_clara_rev ; run distro_bootcmd ; fastboot 0"
scripts/config -e ENV_IS_IN_EXT4
scripts/config -d ENV_IS_IN_MMC
scripts/config --set-str ENV_EXT4_INTERFACE "mmc"
scripts/config --set-str ENV_EXT4_DEVICE_AND_PART "0:1"
scripts/config --set-str ENV_EXT4_FILE "/uboot.env"
make ARCH="$_carch" make ARCH="$_carch"
tools/mkenvimage -p 0 -s 8192 -o u-boot-env.bin "$srcdir/u-boot-env.txt" tools/mkenvimage -p 0 -s 8192 -o u-boot-env.bin "$srcdir/u-boot-env.txt"
} }
package() { package() {
install -D -m644 "$builddir/u-boot.bin" "$pkgdir/usr/share/u-boot/kobo-clara/u-boot.bin" install -D -m644 "$builddir/u-boot-dtb.imx" "$pkgdir/usr/share/u-boot/kobo-clara/u-boot.imx"
install -D -m644 "$builddir/u-boot.imx" "$pkgdir/usr/share/u-boot/kobo-clara/u-boot.imx"
install -D -m644 "$builddir/u-boot-env.bin" "$pkgdir/usr/share/u-boot/kobo-clara/u-boot-env.bin" install -D -m644 "$builddir/u-boot-env.bin" "$pkgdir/usr/share/u-boot/kobo-clara/u-boot-env.bin"
} }
sha512sums=" sha512sums="
1712f5a922b44a8b80e49e00969f0948cd62864adedfb419d9d2f6ccf765b432f8632787f7c6d1502ec0aa6afb7b27bf4193733c2345ff4a0378b43b5b10643a u-boot-kobo-clara-5af329fef886e21b777426d7bf5c6162e2317de7.tar.gz d1db014fa889e76aeb83099f7573f5ec89c8e6f69a6273b9528fd485ffcbe34e102ee0c492554807e160a5bd669bf799db2b5a906045fea35b16c0677a377989 u-boot-kobo-clara-a3816f6b51b5dc9083af4142ca5f3a4e4a235336.tar.gz
43c006f8198ac61e5c73dd4a2d583c5ab1da76b76492be9bee385096bdf33e3a42c8058707e8c2f61342faae152ba57f5046909d9ed403f74589d6604f77eb0d u-boot-env.txt ca8237a86da93dfea62355cfbb8dbe4104c2f3aea71b4c36d5418e6aef6ead32e9d23e4731b8ff64b4a73ca563b0323087384de10d4946afd657dce4cc7c6fee u-boot-env.txt
" "

View file

@ -1,2 +1,2 @@
# Load actual boot script from the boot partition # Load actual boot script from the boot partition
bootcmd=load mmc 0:1 0x80800000 boot.scr ; source bootcmd=load mmc 0:1 0x80800000 boot.scr ; source 0x80800000

View file

@ -0,0 +1,46 @@
# Unmaintained: Downstream port, maybe useful for EPDC performance improvement
# needs special userspace to show up anything
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-kobo-clara-downstream
pkgdesc="Kobo Clara HD downstream"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
postmarketos-base
u-boot-kobo-clara-downstream
u-boot-tools
linux-kobo-clara-downstream
"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="
deviceinfo
uboot-script-downstream.cmd
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
mkimage -A arm -O linux -T script -n postmarketOS \
-d "$srcdir"/uboot-script-downstream.cmd "$srcdir/boot-downstream.scr"
install -Dm644 "$srcdir/boot-downstream.scr" "$pkgdir/boot/boot.scr"
}
nonfree_firmware() {
pkgdesc="Kobo Clara HD firmware"
depends="firmware-kobo-clara-downstream"
mkdir "$subpkgdir"
}
sha512sums="
84b9e5385b7fd77af6891b31d7e95ec424645f741d54168d3d38f6f703071d622829d9f7cf5a29136bf6eb9ec5b2a50a05efe76ddc3e047bb4a69e197fbfde24 deviceinfo
4bfc2714a2670efc451860bd97d36ba12559e00aed41afdde1ac3e01b41458390358ac7f6bc96a6dee6be6a34f534da52d845b02df0566b25f4868774ef69b1d uboot-script-downstream.cmd
"

View file

@ -0,0 +1,28 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Kobo Clara HD"
deviceinfo_manufacturer="Kobo"
deviceinfo_codename="kobo-clara-downstream"
deviceinfo_year="2018"
deviceinfo_arch="armv7"
deviceinfo_dtb="imx6sll-e60k02"
# Device related
deviceinfo_chassis="tablet"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1072"
deviceinfo_screen_height="1448"
# Bootloader related
deviceinfo_flash_method="none"
deviceinfo_boot_part_start="49152"
deviceinfo_getty="ttymxc0;115200"
deviceinfo_generate_legacy_uboot_initfs="true"
deviceinfo_no_framebuffer="true"
deviceinfo_sd_embed_firmware_step_size="512"
deviceinfo_sd_embed_firmware="u-boot/kobo-clara/u-boot.imx:2,firmware/kobo-clara/hwcfg+header.bin:1023,firmware/kobo-clara/ntxfw-E60K00+header.bin:1029,u-boot/kobo-clara/u-boot-env.bin:1536"

View file

@ -1,4 +1,5 @@
pkgname=firmware-kobo-clara # Unmaintained: not needed by mainline kernel, describes only the hardware
pkgname=firmware-kobo-clara-downstream
pkgver=4.26.16704 pkgver=4.26.16704
pkgrel=0 pkgrel=0
pkgdesc="Kobo Clara firmware" pkgdesc="Kobo Clara firmware"

View file

@ -1,9 +1,10 @@
# Unmaintained: Mainline kernel is mature, only interesting for EPDC optimization
# Reference: <https://postmarketos.org/vendorkernel> # Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/imx_v7_kobo_defconfig # Kernel config based on: arch/arm/configs/imx_v7_kobo_defconfig
pkgname=linux-kobo-clara pkgname=linux-kobo-clara-downstream
pkgver=4.1.15 pkgver=4.1.15
pkgrel=4 pkgrel=0
pkgdesc="Kobo Clara HD kernel fork" pkgdesc="Kobo Clara HD kernel fork"
arch="armv7" arch="armv7"
_carch="arm" _carch="arm"
@ -55,7 +56,7 @@ package() {
} }
sha512sums=" sha512sums="
0c937767d7700eb2fde8caadc67ed2dda73969dbff8806c3811e2d05d423b51bc8219643d9ff6f09fc02787a9cbac6b4ee8cf75ea6e39cceba6a067b6370329d linux-kobo-clara-b912467581644d7b8b22cefc1e1bfc3231264979.tar.bz2 0c937767d7700eb2fde8caadc67ed2dda73969dbff8806c3811e2d05d423b51bc8219643d9ff6f09fc02787a9cbac6b4ee8cf75ea6e39cceba6a067b6370329d linux-kobo-clara-downstream-b912467581644d7b8b22cefc1e1bfc3231264979.tar.bz2
abc6e18adfca4b472f79e5877f8b6b4651a9ee01c0c5213e48007119e034d76e41ae193192065824fcd0c36adf8e024f14c17f50748c19c92c5335586dd47ba6 config-kobo-clara.armv7 abc6e18adfca4b472f79e5877f8b6b4651a9ee01c0c5213e48007119e034d76e41ae193192065824fcd0c36adf8e024f14c17f50748c19c92c5335586dd47ba6 config-kobo-clara.armv7
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch 77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch 197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch

View file

@ -0,0 +1,37 @@
# Unmaintained: does weird things, not needed for mainline kernels
# Reference: <https://postmarketos.org/devicepkg>
pkgname=u-boot-kobo-clara-downstream
pkgver=2016.03
pkgrel=0
pkgdesc="U-Boot for Kobo Clara HD"
arch="armv7"
_carch="arm"
license="GPL-2.0"
url="https://github.com/pmsourcedump/kobo_clara_uboot"
options="!check"
_repository="kobo_clara_uboot"
_commit="5af329fef886e21b777426d7bf5c6162e2317de7"
source="
$pkgname-$_commit.tar.gz::https://github.com/pmsourcedump/$_repository/archive/$_commit.tar.gz
u-boot-env.txt
"
builddir="$srcdir/$_repository-$_commit"
build() {
make ARCH="$_carch" mx6sll_ntx_lpddr2_512m_config
make ARCH="$_carch"
tools/mkenvimage -p 0 -s 8192 -o u-boot-env.bin "$srcdir/u-boot-env.txt"
}
package() {
install -D -m644 "$builddir/u-boot.bin" "$pkgdir/usr/share/u-boot/kobo-clara/u-boot.bin"
install -D -m644 "$builddir/u-boot.imx" "$pkgdir/usr/share/u-boot/kobo-clara/u-boot.imx"
install -D -m644 "$builddir/u-boot-env.bin" "$pkgdir/usr/share/u-boot/kobo-clara/u-boot-env.bin"
}
sha512sums="
1712f5a922b44a8b80e49e00969f0948cd62864adedfb419d9d2f6ccf765b432f8632787f7c6d1502ec0aa6afb7b27bf4193733c2345ff4a0378b43b5b10643a u-boot-kobo-clara-downstream-5af329fef886e21b777426d7bf5c6162e2317de7.tar.gz
43c006f8198ac61e5c73dd4a2d583c5ab1da76b76492be9bee385096bdf33e3a42c8058707e8c2f61342faae152ba57f5046909d9ed403f74589d6604f77eb0d u-boot-env.txt
"

View file

@ -0,0 +1,2 @@
# Load actual boot script from the boot partition
bootcmd=load mmc 0:1 0x80800000 boot.scr ; source