samsung-i9100: add mainline kernel (MR 1598)

This commit is contained in:
timbz 2020-09-23 09:00:35 +02:00 committed by Oliver Smith
parent c64f29713f
commit ffd5fd8b2b
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
6 changed files with 6020 additions and 5 deletions

View file

@ -1,20 +1,24 @@
# Reference: <https://postmarketos.org/devicepkg> # Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-i9100 pkgname=device-samsung-i9100
pkgver=1 pkgver=2
pkgrel=29 pkgrel=0
pkgdesc="Samsung Galaxy SII" pkgdesc="Samsung Galaxy SII"
url="https://postmarketos.org" url="https://postmarketos.org"
arch="armv7" arch="armv7"
license="MIT" license="MIT"
depends="postmarketos-base linux-samsung-i9100 libsamsung-ipc mesa-dri-swrast" depends="postmarketos-base libsamsung-ipc"
makedepends="devicepkg-dev" makedepends="devicepkg-dev"
install="$pkgname.post-install" install="$pkgname.post-install"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware" options="!check !archcheck"
subpackages="
$pkgname-kernel-downstream:kernel_downstream
$pkgname-kernel-mainline:kernel_mainline
$pkgname-nonfree-firmware:nonfree_firmware
"
source=" source="
deviceinfo deviceinfo
90-android-touch-dev.rules 90-android-touch-dev.rules
" "
options="!check !archcheck"
build() { build() {
devicepkg_build $startdir $pkgname devicepkg_build $startdir $pkgname
@ -26,6 +30,18 @@ package() {
"$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rules "$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rules
} }
kernel_downstream() {
pkgdesc="Downstream kernel"
depends="linux-samsung-i9100 mesa-dri-swrast"
devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}
kernel_mainline() {
pkgdesc="Close to mainline kernel"
depends="linux-samsung-i9100-mainline mesa-dri-gallium"
devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}
nonfree_firmware() { nonfree_firmware() {
pkgdesc="Wifi firmware" pkgdesc="Wifi firmware"
depends="firmware-samsung-i9100" depends="firmware-samsung-i9100"

View file

@ -0,0 +1,34 @@
From 2a6027178ae40c1d3baa965fe21b19cbf09493ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <arve@android.com>
Date: Fri, 30 Nov 2012 17:05:40 -0800
Subject: [PATCH] ARM: decompressor: Flush tlb before swiching domain 0 to
client mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If the bootloader used a page table that is incompatible with domain 0
in client mode, and boots with the mmu on, then swithing domain 0 to
client mode causes a fault if we don't flush the tlb after updating
the page table pointer.
v2: Add ISB before loading dacr.
Signed-off-by: Arve Hjønnevåg <arve@android.com>
---
arch/arm/boot/compressed/head.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 434a16982e344..d6f6a58ba931b 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -883,6 +883,8 @@ __armv7_mmu_cache_on:
bic r6, r6, #1 << 31 @ 32-bit translation system
bic r6, r6, #(7 << 0) | (1 << 4) @ use only ttbr0
mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer
+ mcrne p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
+ mcr p15, 0, r0, c7, c5, 4 @ ISB
mcrne p15, 0, r1, c3, c0, 0 @ load domain access control
mcrne p15, 0, r6, c2, c0, 2 @ load ttb control
#endif

View file

@ -0,0 +1,65 @@
pkgname=linux-samsung-i9100-mainline
pkgver=5.8.12
pkgrel=0
pkgdesc="Samsung Galaxy SII mainline kernel"
arch="armv7"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="perl sed flex bison openssl-dev installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev busybox-static-$arch"
_carch="arm"
_flavor="samsung-i9100"
_config="config-$_flavor.$arch"
source="
$pkgname-$pkgver.tar.xz::https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$pkgver.tar.xz
$_config
init
initramfs.list
01_flush_tlb.patch
"
builddir="$srcdir/linux-$pkgver"
prepare_isorec() {
_initramfsdir="$builddir/usr/i9100"
mkdir -p "$_initramfsdir"
cp -v /usr/$(arch_to_hostspec $arch)/bin/busybox.static "$_initramfsdir"
cp -v "$srcdir"/init "$_initramfsdir"
cp -v "$srcdir"/initramfs.list "$_initramfsdir"
}
prepare() {
default_prepare
prepare_isorec
cp -v "$srcdir"/$_config .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \
LOADADDR=0x40008000
}
package() {
cat "$builddir/arch/arm/boot/zImage" \
"$builddir/arch/arm/boot/dts/exynos4210-i9100.dtb" \
> "$builddir/arch/arm/boot/zImage-dtb"
install -Dm644 "$builddir/arch/arm/boot/zImage-dtb" \
"$pkgdir/boot/vmlinuz-$_flavor"
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
make modules_install \
ARCH="$_carch" \
INSTALL_MOD_STRIP=1 \
INSTALL_MOD_PATH="$pkgdir"
}
sha512sums="c1daa20dcdaa2cb805e7a973b684ea40327088d8fadf0cf44f4c73284923363397b12f2e1958d64d6a0ff348198366d46b59a5301a72d3431389d319a4bde489 linux-samsung-i9100-mainline-5.8.12.tar.xz
f09d6c61f6f5573fc7512bab4b6b8ccf66ce6edf2c3783fbc05ab8aff142aae2b3fe0b8ad1085b8412f0664d0601362a79b43a502ff5e98de9de756b7b88a979 config-samsung-i9100.armv7
1181e84aec07a1eb2d9f1491581893b1de8535abf784115ea5666891653b3c2f4ed062a4a9cf80e07731bc1553d30ff72601c64d966b33b669cc569f70d61610 init
6a9a629805b5601db0183a796b13baae0fb2344ad24ef8ea55ea47ede8ee50a299c131d1862e15ed2bd3709aaf97f4f05633635b5764a83f4564c75cd5941967 initramfs.list
f1368045393d9be596154099ef08833e8640005a88cbefb741e57be29440de263bf63bf9645a176bce6d3fd4e3ac7daf11433ee937064f792f61dd54d7339f06 01_flush_tlb.patch"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,16 @@
#!/bin/busybox sh
echo "### isorec initramfs ###"
busybox mount -t proc proc /proc
busybox mount -t sysfs sysfs /sys
# Load the "isorec"-style lzop compressed
# initramfs from the recovery partition.
load_image=/isorec.cpio
busybox lzop -dc /dev/block/mmcblk0p6 > ${load_image}
busybox cpio -iu < ${load_image}
busybox rm ${load_image}
busybox umount /sys
busybox umount /proc
exec /init

View file

@ -0,0 +1,21 @@
dir /dev 755 0 0
dir /dev/block 755 0 0
nod /dev/block/mmcblk0 600 0 0 b 179 0
nod /dev/block/mmcblk0p1 600 0 0 b 179 1
nod /dev/block/mmcblk0p2 600 0 0 b 179 2
nod /dev/block/mmcblk0p3 600 0 0 b 179 3
nod /dev/block/mmcblk0p4 600 0 0 b 179 4
nod /dev/block/mmcblk0p5 600 0 0 b 179 5
nod /dev/block/mmcblk0p6 600 0 0 b 179 6
nod /dev/block/mmcblk0p7 600 0 0 b 179 7
nod /dev/block/mmcblk0p8 600 0 0 b 179 8
nod /dev/block/mmcblk0p9 600 0 0 b 179 9
nod /dev/block/mmcblk0p10 600 0 0 b 179 10
nod /dev/block/mmcblk0p11 600 0 0 b 179 11
nod /dev/block/mmcblk0p12 600 0 0 b 179 12
nod /dev/console 0600 0 0 c 5 1
dir /bin 755 0 0
dir /proc 755 0 0
dir /sys 755 0 0
file /bin/busybox usr/i9100/busybox.static 755 0 0
file /init usr/i9100/init 755 0 0