New device: htc-flounder (#1309)

This commit is contained in:
Alexandroid99 2018-04-04 02:27:11 +02:00 committed by Oliver Smith
parent 63f921fbac
commit fc18a8cf75
6 changed files with 4652 additions and 0 deletions

View file

@ -0,0 +1,27 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-htc-flounder"
pkgdesc="Google Nexus 9"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="gpl-v3"
arch="aarch64"
options="!check"
depends="postmarketos-base linux-htc-flounder mkbootimg mesa-dri-swrast libsparse"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="Firmware"
depends="linux-firmware-brcm firmware-htc-flounder"
mkdir "$subpkgdir"
}
sha512sums="48be91a584861fb2db3d10577b718a1b9daa9ad4fe531c5b79946fe52e89cfecf16559ea4558b4fd736f1e04d4df43c79256c29165d08457507ac2c315bd3cfb deviceinfo"

View file

@ -0,0 +1,32 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="Google Nexus 9"
deviceinfo_manufacturer="HTC"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="aarch64"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="false"
deviceinfo_screen_width="2048"
deviceinfo_screen_height="1536"
deviceinfo_dev_touchscreen="/dev/input/event2"
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="no_console_suspend=1 tegra_wdt.enable_on_probe=1 tegra_wdt.heartbeat=120 androidboot.hardware=flounder androidboot.selinux=permissive selinux=0"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_flash_offset_base="0x10000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"
deviceinfo_flash_sparse=true

View file

@ -0,0 +1,82 @@
# Kernel config based on: arch/arm64/configs/lineage_flounder_defconfig
pkgname="linux-htc-flounder"
pkgver=3.10.103
pkgrel=0
pkgdesc="Google Nexus 9 kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="htc-flounder"
url="https://kernel.org"
license="GPL2"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev"
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="android_kernel_htc_flounder"
_commit="a8f66d78789d66906c886fd6818fb648d0a84a2a"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/${_repository}/archive/${_commit}.tar.gz
$_config
compiler-gcc6.h
"
builddir="$srcdir/${_repository}-${_commit}"
prepare() {
default_prepare
# gcc6 support
cp -v "$srcdir/compiler-gcc6.h" "$builddir/include/linux/"
# Remove -Werror from all makefiles
local i
local makefiles="$(find . -type f -name Makefile)
$(find . -type f -name Kbuild)"
for i in $makefiles; do
sed -i 's/-Werror-/-W/g' "$i"
sed -i 's/-Werror//g' "$i"
done
# Prepare kernel config ('yes ""' for kernels lacking olddefconfig)
cp "$srcdir"/$_config "$builddir"/.config
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
# kernel.release
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
# zImage (find the right one)
cd "$builddir/arch/$_carch/boot"
_target="$pkgdir/boot/vmlinuz-$_flavor"
for _zimg in zImage-dtb Image.gz-dtb *zImage Image; do
[ -e "$_zimg" ] || continue
msg "zImage found: $_zimg"
install -Dm644 "$_zimg" "$_target"
break
done
if ! [ -e "$_target" ]; then
error "Could not find zImage in $PWD!"
return 1
fi
}
sha512sums="b9ee4b14b0466e0b19d869810ceb852dd70399a90cdb081b902177685b87d242e11284bb0f619ea103b30ef5544f06a88c0131d028024ad8aa45809697e070fa linux-htc-flounder-a8f66d78789d66906c886fd6818fb648d0a84a2a.tar.gz
e5a0b2c37ee5fa7dc6b66bbe2addf7f5c76f873a72ffbf9f7b8526efe3dc1f88bea7df47f6a34c36120005253a6926975733f6709e2947fb2d2f57d74c964804 config-htc-flounder.aarch64
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h"

View file

@ -0,0 +1,69 @@
// 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

View file

@ -0,0 +1,78 @@
pkgname=firmware-htc-flounder
pkgver=1.0
pkgrel=0
pkgdesc="Firmware for the HTC Google Nexus 9"
_commit="27024f568d1eee70c4a12f3f46aec33f6ee2f225"
url="https://github.com/Alexandroid99/vendor_htc_flounder"
arch="aarch64"
license="proprietary"
makedepends="git"
install=""
source=""
options="!check !strip"
# Sources
_files1="bcm20795_firmware.ncd bcm4350b1.hcd bcm4350c0.hcd bcm4354.hcd bcmdhd.cal
fw_bcmdhd.bin fw_bcmdhd_apsta.bin maxim_fp35.bin nvavp_aacdec_ucode.bin
nvavp_aud_ucode.bin nvavp_mp3dec_ucode.bin nvavp_os_0ff00000.bin
nvavp_os_8ff00000.bin nvavp_os_eff00000.bin nvavp_os_f7e00000.bin
nvavp_vid_ucode_alt.bin rt5677_elf_vad sar0_CY8C.img sar1_CY8C.img
sensor_hub.img synaptics.img touch_fusion.cfg"
_files2="NETB_img.bin fecs.bin gpccs.bin gpmu_ucode.bin nvhost_msenc031.fw
nvhost_tsec.fw vic03_ucode.bin"
_url1="https://github.com/Alexandroid99/vendor_htc_flounder/raw/$_commit/firmware"
_url2="https://github.com/Alexandroid99/vendor_htc_flounder/raw/$_commit/firmware/tegra13x"
source=""
for _i in $_files1; do
source="$source $pkgname-$_commit-$_i::$_url1/$_i";
done
for _i in $_files2; do
source="$source $pkgname-$_commit-$_i::$_url2/$_i";
done
package() {
cd "$srcdir"
for _i in $_files1; do
install -Dm644 "$srcdir/$pkgname-$_commit-$_i" \
"$pkgdir/lib/firmware/postmarketos/$_i"
done
for _i in $_files2; do
install -Dm644 "$srcdir/$pkgname-$_commit-$_i" \
"$pkgdir/lib/firmware/postmarketos/tegra13x/$_i"
done
}
sha512sums="b39189fbf7782015a1fa254ba3731bb49cfaca48474c279d3ab02ffc9b9244c278fbae9c673a28175cb00dd28b5349c84f9f0558ff5db04a2a544726abe3b9e1 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-bcm20795_firmware.ncd
4da941f23182f41be587517f53934560185a413224ba0e14cf90746ada83c39a28efa80ef403f0c290f8b72482d65122b55caef06ab5a276a2b96b0ac557ff81 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-bcm4350b1.hcd
948e7ba28c8a9ded5f755150b08862d37f489fb5473311979417c123254609e220c1809e71b2dbe041732997905fafe3900853e001d8f70be45c05c265e0eba4 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-bcm4350c0.hcd
3d8386ff4a573d4aad7e08c36f764e7ac145c7b0772c47913ac583b2b874e43c464488e55457581f4ad0d9b24c5c7514260a08bc84921c5b5ea83b464d2ba8d9 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-bcm4354.hcd
787a199215280278279cc9520a75447d01d707cb1eacb0bb16ebc09618c09e3932066e4060f5b98cc3667d9d54c1b19c12cbc883b488a5b002f7cf745b041ab1 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-bcmdhd.cal
1ae8fdbe633782fba23ddf3843c3b5baaabceb2d8d6f75517356884762f972829c5fd5deac3956e2183d49469823df9a9c2fbbdd5221f6863e45292c1c6f1a6b firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-fw_bcmdhd.bin
1031b74b35ed9619e60e693af214d4ab2eac40505220ef765882e28e68108b8915e7847bfd64cbc20abc7708341d3a77060ab3d36494bd0f0b6ee8a159c71741 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-fw_bcmdhd_apsta.bin
b47c56b56967222dc3db53b3ccb66d856855bd30ac91350faed22ae7ff71906ff090faeffdb1d247ada0f6f5bc75f762717cc433b7b724b4274f1c52994bb88a firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-maxim_fp35.bin
a1afa34d40bdcb92805c9a054800d223a340d5d032de44b7774cbd5ae599c52e3c03bb1d260d7dbc5f592f0ca22a4ba88f9bb50af479f60f482dac40b1c72a46 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_aacdec_ucode.bin
50f655500bc4545f57d91e5b6259c41728ede8873b490f2c758f5e6d1be0c652cae6b6b8ec459eaa4465fb6701aef4d49772092865306e60348b2d2ec9105c49 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_aud_ucode.bin
e5fc4fb733fdb3d01ef6207d3e8c4276938707d2bfee6a1577c8ca350649ff7fdeba29fb62b405101db395c1d5ae9f87c3e7cbd1660a6b6b0e5287e0cb26879e firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_mp3dec_ucode.bin
d29187d8d0023bff50d164885e46c4d819d8655ed50b4d77079b2aed3af24ea53cfa7950380c39f6309f5f9bba57b94dedee8e27a6a4b57dba48b4452b06c75e firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_os_0ff00000.bin
7df371b6b364e2aef6125795211badd557c886fb47a34486df054ee26d13b5d98500395a5b233c4b851564e0fae7d4a9a1a94a5f0d1813381fa86690a07f4c92 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_os_8ff00000.bin
b7c266a049f513c50ab0706e7be8d11ca66f247a384d19320f47ed34ab3deb3089d386902057dd42eaec5b7ea6e34d2ed7a4c5951b3bd576270c5ca5c8cfd5fd firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_os_eff00000.bin
15aceb3948df89859fbb0451a567bd9e209d716ebf514acb47c991c5a88b8393d2895567b5587e396b977366e8b99fbfd8f1a0e927f1b637b53660e5fa37ca91 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_os_f7e00000.bin
ff972014d437d19b71c292436ce283f5853463aced6fdd51f6ae67571a266dd4fb52b182950843f30f63e9bcadfdce64c263913465f2d15a6b70ab0a9b6e56d9 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvavp_vid_ucode_alt.bin
b0404fd81ecde5ed67dabb72790956b04cae836ac53b3059e24cd1a0af610430e355739bf8b9977e3af711556efea44e6b1cbea57849e3e96765fb121174c971 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-rt5677_elf_vad
df41978f1ed7e016ba4a8040791a1e90312d287bf471de7095175799b7a393b46b0fa3fa57c965b122c2993c5bafb9aa7945dec561cb7d2c2c8644d2c91922d7 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-sar0_CY8C.img
8c5dae7faed05de2ad604e58a08732a313dffbdf007b7214c497db63a16ba8b9f50edc35d537c85376df21c00cd71b51c76f2f4cc2688044d020e5efe80b87ed firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-sar1_CY8C.img
be590c9330af0792115855e630dd7a518c2cb048ad7b9ac0f40913c6de1d6704dc11ed32b8f122f60ec35d3fd52e592a116527ac40d0f33eb6308556d772921e firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-sensor_hub.img
6bbe26aaae4a1ba91cef34a29548dfab4be1c4a17ae8c80ab18b02ddf01c6b31a988a8787cc66c404cc7fa89dde55bb14eafed0c9f4a6a54c2516bc10db34237 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-synaptics.img
c68ea2cd48959162cfc9f8b33cbe5b67e360ceede122bba9e353ea3918176d51c75b1b4fc942b21efa8485fd609e21c40f5be982e15e0cbe2994d568796c5ce6 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-touch_fusion.cfg
ad9dc955eea76c7fe0e4a94db27c6cdced89705e7908752a0720b3c76f31d0b4f3596d1ae26e57d88ab8d85f1fa9c9017c430e8c75f59b9af3dddcb67370e7fa firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-NETB_img.bin
dc976598dd1d6053efc98fd858f1208b9ef95447ff8dac415c5e7b024954288d96a26bbca42ca594aad0ddaa7113a6fe671b7346ff32dd81c2748998fc2c39af firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-fecs.bin
bf1979bd878185a137d3fdf79e30cdcd9ed0b753e81de0dfb225271d9318c28333d425990c00ef79b7ad21fe587c1260b57762f819f4bb86d3d882a6cca51fae firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-gpccs.bin
abde15cfedb81fc585fbb0ab6449bea871a83461df6d46ada90ea146ced0ff8fdd5857e4e309df38db41a0c706cb7867a75b9433a1dd1facb7b64956ce1868a2 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-gpmu_ucode.bin
fdde81ce53cf4325be9e80b5196fe79ad0081b7f9253cb89b511eb4a9db05fb7a65d26c04a6fdf814e1fd29a70faf5f0772b42bfc570c36817b0c92ec62cc10c firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvhost_msenc031.fw
f30374332b2b5fc1c12e58759d5f9e1b9550b1c07b4386ea757a298b0f2688638db404aeeda396f77b188057cf2a377eecd2daa4200a2c562a7ea7a81cb3ff3e firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-nvhost_tsec.fw
bd5861310fb0e37fc88bb8f5831b4188b53b193139cd4fed6dbdb194b962b7953fb5b83e4435ec0d657b10bf75713422f0ee2af43b50f79203ce975d058cdf40 firmware-htc-flounder-27024f568d1eee70c4a12f3f46aec33f6ee2f225-vic03_ucode.bin"