asus-grouper: bump to mainline + firmware adaptation (!933)

- use mesa-git (until we have functional mesa-grate-git)

Works:
- USB
- WiFi (tested with IWD) + Bluetooth
- Touchscreen
- Phosh rotation (rootston.ini)
- IIO Light sensor
- NFC

Not works:
- 3D
- GPS
- GSM (tilapia)
- Camera

Signed-off-by: David Heidelberg <david@ixit.cz>

[ci:skip-build]: already built successfully in CI
This commit is contained in:
David Heidelberg 2019-12-22 18:23:03 +01:00 committed by Oliver Smith
parent aee07e792f
commit 6ed77fd5fd
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
13 changed files with 5253 additions and 3588 deletions

View file

@ -1,18 +1,18 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: David Heidelberg <david@ixit.cz>
pkgname="device-asus-grouper"
pkgdesc="Google Nexus 7 2012 Wifi"
pkgdesc="Google Nexus 7 2012 (grouper/tilapia)"
pkgver=2
pkgrel=2
pkgrel=3
url="https://postmarketos.org"
license="MIT"
arch="armhf"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-asus-grouper mkbootimg mesa-dri-swrast"
depends="postmarketos-base linux-asus-grouper mkbootimg mesa-git-dri-gallium"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
subpackages="$pkgname-phosh
$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo
pointercal
nvram.txt"
rootston.ini"
build() {
devicepkg_build $startdir $pkgname
@ -20,18 +20,20 @@ build() {
package() {
devicepkg_package $startdir $pkgname
install -D -m644 "$srcdir"/pointercal \
"$pkgdir"/etc/pointercal
}
phosh() {
install_if="$pkgname postmarketos-ui-phosh"
install -Dm644 "$srcdir"/rootston.ini \
"$subpkgdir"/etc/phosh/rootston.ini
}
nonfree_firmware() {
pkgdesc="Google Nexus 7 (2012) wifi firmware"
depends="firmware-aosp-broadcom-wlan"
pkgdesc="Google Nexus 7 (2012) WiFi & BT firmware"
depends="firmware-asus-grouper firmware-aosp-broadcom-wlan-mainline"
install="$pkgname-nonfree_firmware.post-install $pkgname-nonfree_firmware.pre-deinstall"
mkdir "$subpkgdir"
install -D -m644 "$srcdir"/nvram.txt \
"$subpkgdir"/lib/firmware/postmarketos/bcmdhd/bcm4330/fw_bcm4330_bg.txt
}
sha512sums="a374e9681fbeaff5047820f8b7a9c249195232730a412208415243ea8bf7a87cdc4399ab86b1c08448be279f5c9dedcb47d03ac83587f908a4c51e442a97da50 deviceinfo
ae9c145ffd745c83c73edbc486d3b9d22c6cbb8c57827b6f1ba87b6449a17a73a443be7daa0ab87de8df2dd9594e624364652c84ec1e7b536d37f52449a5a58c pointercal
093a615250689f83c43af18a195d66d89e4b56584069a3903652e68e9da42568d2e176aa77cf23e1f23b3cb869f5c639fb1c8cdfc8af9fc6d17abe17cad7e821 nvram.txt"
sha512sums="241db05f63f914f82f5c40062d174a4140f635e95ec9dd260b4866478f11e93c711679a2eccde42791d3c34b37befd8d0c89094e1133b0611607199185fb9173 deviceinfo
6ec993e278d2a73c72fb96f001716ded63543d99183847d22d172cd81ac410791c79370ecf391d0c24822c975d91b84dc1db296e1b28dbf66d5c227bff8d4011 rootston.ini"

View file

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

View file

@ -0,0 +1,3 @@
#!/bin/sh
rc-update del bluetooth default

View file

@ -6,16 +6,17 @@ deviceinfo_name="Google Nexus 7 2012 Wifi"
deviceinfo_manufacturer="Asus"
deviceinfo_codename="asus-grouper"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_dtb="tegra30-grouper-bach"
deviceinfo_append_dtb="true"
deviceinfo_modules_initfs=""
deviceinfo_arch="armhf"
deviceinfo_arch="armv7"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="false"
deviceinfo_screen_width="800"
deviceinfo_screen_height="1280"
deviceinfo_dev_touchscreen="/dev/input/event0"
deviceinfo_dev_touchscreen="/dev/input/event1"
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""

View file

@ -0,0 +1,8 @@
#[core]
#xwayland=false
[cursor:seat0]
map-to-output:LVDS-1
[output:LVDS-1]
scale = 1

View file

@ -1,87 +1,36 @@
# APKBUILD based on linux-vanilla aport. Changes:
# - disabled module installation
# - add !check !tracedeps
# - package: just install zimage and kernel.release, because the kernel config
# does not generate modules or dtb files
# - do not create -dev subpackage (makes no sense without module support)
#
# Kernel config based on: arch/arm/configs/lineageos_grouper_defconfig
# Changes:
# - enable devtmpfs (needed for udev -> touch support in weston)
# - disable ANDROID_PARANOID_NETWORK (removes network restrictions)
_vendor=asus
# Maintainer: David Heidelberg <david@ixit.cz>
_flavor=asus-grouper
_hash="953e26f2709dfe0c185c3c99c50b0c9d56d473a4"
_config="config-${_flavor}.armhf"
_commit="45a3363d0770af62325410c03535c51b73b0a38f"
_config="config-$_flavor.armv7"
pkgname=linux-${_flavor}
pkgver=3.4.0
case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
esac
pkgrel=11
arch="armhf"
pkgdesc="Nexus 7 (2012) kernel from LineageOS"
url="https://github.com/LineageOS/android_kernel_asus_grouper"
depends=""
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev gcc6"
pkgname=linux-asus-grouper
pkgver=5.6.0_rc1
pkgrel=0
arch="armv7"
pkgdesc="Nexus 7 grouper/tilapia (2012) mainline kernel"
url="https://postmarketos.org"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev
devicepkg-dev bison flex openssl-dev xz"
options="!strip !check !tracedeps"
install=
source="
$pkgname-$_hash.tar.gz::https://github.com/LineageOS/android_kernel_asus_grouper/archive/${_hash}.tar.gz
$pkgname-$_commit.tar.gz::https://github.com/okias/linux/archive/$_commit.tar.gz
$_config
compiler-gcc6.h
duplicate-return-address-definition.patch
"
subpackages=""
license="GPL2"
license="GPL-2.0-only"
_abi_release=${pkgver}
_carch="arm"
# Compiler: this kernel was only tested with GCC6. Feel free to make a merge
# request if you find out that it is booting working with newer GCCs as
# well. See <https://postmarketos.org/vendorkernel> for instructions.
if [ "${CC:0:5}" != "gcc6-" ]; then
CC="gcc6-$CC"
HOSTCC="gcc6-gcc"
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
fi
# Compiler: latest GCC from Alpine
_hostcc="${CC:-gcc}"
_hostcc="${_hostcc#${CROSS_COMPILE}}"
ksrcdir="$srcdir/android_kernel_asus_grouper-${_hash}"
_ksrcdir="$srcdir/linux-$_commit"
prepare() {
local _patch_failed=
cd "$ksrcdir"
# first apply patches in specified order
for i in $source; do
case $i in
*.patch)
msg "Applying $i..."
if ! patch -s -p1 -N -i "$srcdir"/$i; then
echo $i >>failed
_patch_failed=1
fi
;;
esac
done
if ! [ -z "$_patch_failed" ]; then
error "The following patches failed:"
cat failed
return 1
fi
# gcc6 support
cp -v "$srcdir/compiler-gcc6.h" "$ksrcdir/include/linux/"
mkdir -p "$srcdir"/build
cp "$srcdir"/$_config "$srcdir"/build/.config
make -C "$ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" \
silentoldconfig
cp -v "$srcdir"/$_config "$srcdir"/build/.config
make -C "$_ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$_hostcc" \
olddefconfig
}
build() {
@ -92,14 +41,24 @@ build() {
}
package() {
install -Dm644 "$srcdir/build/arch/arm/boot/zImage" \
install -Dm644 "$srcdir/build/arch/$_carch/boot/"*zImage \
"$pkgdir/boot/vmlinuz-$_flavor"
install -D "$srcdir/build/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
}
sha512sums="11ba20986552a0b913de2a7d756d31ad9f4f67561cb88988737bba07997f00b7574604d1c19f6d890502208f12a21d48d4044edc5a8db5174b2a49d4a87573e3 linux-asus-grouper-953e26f2709dfe0c185c3c99c50b0c9d56d473a4.tar.gz
769a9b12dc1f42f0e625852875b3f094a1c618a1de7e6b1a2e55a223a8289f204f8181dc3cb4a75bde1e5102db0e6e2d132a31ede0641510c12e6f4eb3335542 config-asus-grouper.armhf
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
9b15bf1f6cb66f54c785b0af6c9db8a7d63257e6fa3eeb0cbf47284334166aa6a7ff93e1b64ab69206c8047d64641199c0f5fcbc257bbe039263252fff45118e duplicate-return-address-definition.patch"
cd "$srcdir"/build
local _install
case "$CARCH" in
aarch64*|arm*) _install="modules_install dtbs_install" ;;
*) _install="modules_install" ;;
esac
make -j1 $_install \
ARCH="$_carch" \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_DTBS_PATH="$pkgdir/usr/share/dtb"
}
sha512sums="681bb00a75cdae677468ffd50463534fd5c03730c433f5243bfc245c50bd023d1b163dfd45ada53374b361ba9221e4cb4b76f26bddc3e04f0a0693266aa1ed6b linux-asus-grouper-45a3363d0770af62325410c03535c51b73b0a38f.tar.gz
d4fb13567df269c147a4a5d427fdf85999b37898765f7260a0e6c47d717fde3b24e3f743d2bf47ea9c67a4855bbd6a7b3e0cd388c13e0bd896835ae6be05a1bf config-asus-grouper.armv7"

View file

@ -1,69 +0,0 @@
// SOURCE:
// https://github.com/NextThingCo/CHIP-u-boot/issues/10#issuecomment-287515505
#ifndef __LINUX_COMPILER_H
#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
#endif
#define __used __attribute__((__used__))
#define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
/* Mark functions as cold. gcc will assume any path leading to a call
to them will be unlikely. This means a lot of manual unlikely()s
are unnecessary now for any paths leading to the usual suspects
like BUG(), printk(), panic() etc. [but let's keep them for now for
older compilers]
Early snapshots of gcc 4.3 don't support this and we can't detect this
in the preprocessor, but we can live with this because they're unreleased.
Maketime probing would be overkill here.
gcc also has a __attribute__((__hot__)) to move hot functions into
a special section, but I don't see any sense in this right now in
the kernel context */
#define __cold __attribute__((__cold__))
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
#ifndef __CHECKER__
# define __compiletime_warning(message) __attribute__((warning(message)))
# define __compiletime_error(message) __attribute__((error(message)))
#endif /* __CHECKER__ */
/*
* Mark a position in code as unreachable. This can be used to
* suppress control flow warnings after asm blocks that transfer
* control elsewhere.
*
* Early snapshots of gcc 4.5 don't support this and we can't detect
* this in the preprocessor, but we can live with this because they're
* unreleased. Really, we need to have autoconf for the kernel.
*/
#define unreachable() __builtin_unreachable()
/* Mark a function definition as prohibited from being cloned. */
#define __noclone __attribute__((__noclone__))
/*
* Tell the optimizer that something else uses this function or variable.
*/
#define __visible __attribute__((externally_visible))
/*
* GCC 'asm goto' miscompiles certain code sequences:
*
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
*
* Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
*
* (asm goto is automatically volatile - the naming reflects this.)
*/
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
#define __HAVE_BUILTIN_BSWAP32__
#define __HAVE_BUILTIN_BSWAP64__
#define __HAVE_BUILTIN_BSWAP16__
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,50 +0,0 @@
From aeea3592a13bf12861943e44fc48f1f270941f8d Mon Sep 17 00:00:00 2001
From: Behan Webster <behanw@converseincode.com>
Date: Wed, 24 Sep 2014 01:06:46 +0100
Subject: [PATCH] ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h
With compilers which follow the C99 standard (like modern versions of gcc and
clang), "extern inline" does the wrong thing (emits code for an externally
linkable version of the inline function). In this case using static inline
and removing the NULL version of return_address in return_address.c does
the right thing.
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/include/asm/ftrace.h | 2 +-
arch/arm/kernel/return_address.c | 5 -----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
index 39eb16b0066f2..bfe2a2f5a644e 100644
--- a/arch/arm/include/asm/ftrace.h
+++ b/arch/arm/include/asm/ftrace.h
@@ -45,7 +45,7 @@ void *return_address(unsigned int);
#else
-extern inline void *return_address(unsigned int level)
+static inline void *return_address(unsigned int level)
{
return NULL;
}
diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c
index fafedd86885dd..f6aa84d5b93c9 100644
--- a/arch/arm/kernel/return_address.c
+++ b/arch/arm/kernel/return_address.c
@@ -63,11 +63,6 @@ void *return_address(unsigned int level)
#warning "TODO: return_address should use unwind tables"
#endif
-void *return_address(unsigned int level)
-{
- return NULL;
-}
-
#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */
EXPORT_SYMBOL_GPL(return_address);

View file

@ -1,17 +1,18 @@
# Contributor:
# Maintainer: David Heidelberg <david@ixit.cz>
pkgname=firmware-aosp-broadcom-wlan
pkgver=1
pkgrel=2
pkgrel=3
pkgdesc="Broadcom Wi-Fi firmware from AOSP"
url="https://android.googlesource.com/platform/hardware/broadcom/wlan/+/android-8.0.0_r12"
arch="armhf armv7 aarch64"
license="proprietary"
license="custom:proprietary"
options="!check !strip !archcheck !spdx"
# Sources
_commit="6c8ef5b600cec5d36a54a0276fe8c97b9ab8d6bb"
source="$pkgname-$_commit.tar.gz::https://github.com/zhuowei/android_hardware_broadcom_wlan/archive/$_commit.tar.gz"
builddir="$srcdir/android_hardware_broadcom_wlan-$_commit"
subpackages="$pkgname-mainline:mainline"
package() {
cd bcmdhd/firmware
@ -21,4 +22,10 @@ package() {
done
}
mainline() {
cd "$srcdir/android_hardware_broadcom_wlan-$_commit/bcmdhd/firmware"
install -Dm644 bcm4330/fw_bcm4330_apsta_bg.bin \
"$subpkgdir"/lib/firmware/postmarketos/brcm/brcmfmac4330-sdio.bin
}
sha512sums="ffd125833076a257b6ad4bf9d3f1cb262331e0ce5b1a15b12b6a5b375fa82ea37c17876dada4cab8fe74c4c66dfc499bd9a00526c1a9c31664add3d4e45d5cf0 firmware-aosp-broadcom-wlan-6c8ef5b600cec5d36a54a0276fe8c97b9ab8d6bb.tar.gz"

View file

@ -0,0 +1,28 @@
# Maintainer: David Heidelberg <david@ixit.cz>
pkgname=firmware-asus-grouper
pkgver=1
pkgrel=0
pkgdesc="Firmware for Nexus 7 (asus-grouper/tilapia)"
url="https://github.com/OpenELEC/wlan-firmware"
arch="armv7"
license="custom:proprietary"
options="!check !strip !archcheck !spdx"
# Sources
_commit="3be9d8274352e36073c635991e7f29063bdf2c53"
_url="https://github.com/OpenELEC/wlan-firmware"
source="$pkgname-bt-$_commit.tar.gz::$_url/archive/$_commit.tar.gz
brcmfmac4330-sdio.asus,tilapia.txt"
package() {
# Bluetooth
cd "$srcdir/wlan-firmware-$_commit/firmware/brcm/"
install -Dm644 bcm4330.hcd \
"$pkgdir"/lib/firmware/postmarketos/brcm/BCM4330B1.hcd
# Wi-Fi
install -D -m644 "$srcdir"/brcmfmac4330-sdio.asus,tilapia.txt \
"$pkgdir"/lib/firmware/postmarketos/brcm/brcmfmac4330-sdio.asus,tilapia.txt
}
sha512sums="daf910bd0ae542a1a598ab0abcc5bd58a5c30a0033ce3e1a9db60f85120b46a460810f5608c3e197d5aabb38d6666dc838a0bd63a39c9c9318724c6088c6581b firmware-asus-grouper-bt-3be9d8274352e36073c635991e7f29063bdf2c53.tar.gz
093a615250689f83c43af18a195d66d89e4b56584069a3903652e68e9da42568d2e176aa77cf23e1f23b3cb869f5c639fb1c8cdfc8af9fc6d17abe17cad7e821 brcmfmac4330-sdio.asus,tilapia.txt"

View file

@ -0,0 +1,47 @@
# Azurewave Release 2011/12/29
# NH665 bgn+BT+FM
manfid=0x2d0
prodid=0x0552
vendid=0x14e4
devid=0x4360
boardtype=0x0552
boardrev=0x11
# this design has 2.4GHz SP3T switch
boardflags=0x00081200
nocrc=1
xtalfreq=37400
boardnum=22
#macaddr=00:11:22:33:44:55
#nvram_override=1
cckdigfilttype=20 #20~26
ag0=255
aa2g=3
ccode=XY
regrev=4
#pa0b0=0x13e1
#pa0b1=0xfdab
#pa0b2=0xff66
rssismf2g=0xa
rssismc2g=0x3
rssisav2g=0x7
maxp2ga0=0x46
sromrev=3
#il0macaddr=00:11:22:33:44:55
wl0id=0x431b
cckPwrOffset=5
#ofdmdigfilttype2g=4
ofdm2gpo=0x44444444
mcs2gpo0=0x6666
mcs2gpo1=0x6666
swctrlmap_2g=0x44844484,0x4a8a4282,0x42824282,0x818a82,0x1ff
rfreg033=0x19
rfreg033_cck=0x1f
dacrate2g=160
txalpfbyp2g=1
bphyscale=17
cckPwrIdxCorr=-15
pacalidx2g=45
txgaintbl=1
muxenab=0x10
#triso2g=9