Add device htc-ace to master (#281)

@VictorNine did the port, all credit goes to him (and @drebrez and everyone else who helped him)!

* Added device HTC Ace (#181)

* Add HTC Desire HD (Ace) device-specific and kernel package

* Enable kernel virtual terminal support

* Added touchscreen device rules

* Added linux-firmware pkg. WIFI is now working

* device-htc-ace: Add deviceinfo_flash_offset_base
This commit is contained in:
Oliver Smith 2017-07-28 19:48:58 +00:00 committed by GitHub
parent cade409208
commit c0df586743
8 changed files with 3446 additions and 0 deletions

View file

@ -0,0 +1,6 @@
# Touchscreen (use 'weston-calibrator' to calibrate)
SUBSYSTEM=="input", ATTRS{name}=="synaptics-rmi-touchscreen", \
ENV{ID_INPUT}="1", ENV{ID_INPUT_TOUCHSCREEN}="1", \
ENV{WL_CALIBRATION}="0.963488 0.004947 14.422623 -0.076271 1.026566 -7.303467"

34
device-htc-ace/APKBUILD Normal file
View file

@ -0,0 +1,34 @@
pkgname=device-htc-ace
pkgver=1
pkgrel=2
pkgdesc="HTC Desire HD"
url="https://github.com/postmarketOS"
arch="noarch"
license="MIT"
depends="linux-htc-ace mkbootimg linux-firmware"
makedepends=""
install=""
subpackages=""
source="
deviceinfo
initfs-hook.sh
90-android-touch-dev.rules
"
options="!check"
build() {
return 0
}
package() {
install -D -m644 "$srcdir"/deviceinfo \
"$pkgdir"/etc/deviceinfo
install -D -m644 "$srcdir"/initfs-hook.sh \
"$pkgdir"/etc/postmarketos-mkinitfs/hooks/00-${pkgname}.sh
install -D -m644 "$srcdir"/90-android-touch-dev.rules \
"$pkgdir"/etc/udev/rules.d/90-android-touch-dev.rule
}
sha512sums="204eb01c5cc29d14ccccfebda6ea6a4ad4ad8296cfcdc517456de6afcbaf8072790a5a398a27e0f93a8ac3f4a1b55226f65be4cd3b4734aee4b536445ea85ecf deviceinfo
3ce2d134aa59677e25a160b5985c552fbf048b237169bbeb85e2b8824f734627064b51c097036db10eee0254064d45d804d17372dffcd1ba246938968fe1e225 initfs-hook.sh
ab8fb357bb45ba44723f1ecb01a10db26f8f74b605499673e1ba90c69a9b11a1555983ce90235e3b636d75461c81c81eea0f8318ded06b72dad17f924d8b9901 90-android-touch-dev.rules"

26
device-htc-ace/deviceinfo Normal file
View file

@ -0,0 +1,26 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="HTC Desire HD"
deviceinfo_manufacturer="HTC"
deviceinfo_date=""
deviceinfo_keyboard="false"
deviceinfo_nonfree="????"
deviceinfo_dtb=""
deviceinfo_modules=""
deviceinfo_modules_initfs=""
deviceinfo_external_disk="false"
deviceinfo_external_disk_install="true"
deviceinfo_flash_methods="fastboot"
deviceinfo_arch="armhf"
# Fastboot related
deviceinfo_generate_bootimg="true"
deviceinfo_flash_offset_base="0x04000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_cmdline="no_console_suspend=1 androidboot.selinux=permissive"
deviceinfo_flash_pagesize="2048"

View file

@ -0,0 +1,8 @@
#!/bin/sh
# set framebuffer resolution
echo 16 > /sys/class/graphics/fb0/bits_per_pixel
echo 480,1600 > /sys/class/graphics/fb0/virtual_size
# set usb properties
echo 4 > /sys/devices/platform/android_usb/usb_function_switch

110
linux-htc-ace/APKBUILD Normal file
View file

@ -0,0 +1,110 @@
# APKBUILD based on linux-vanilla aport. Changes:
# - disabled module installation
# - add !check !tracedeps
# - add xz package (necessary to build)
#
# Kernel config based on: arch/arm/configs/ace_defconfig
# Changes:
# - apply patches to compile
# - enable devtmpfs (needed for udev -> touch support in weston)
_vendor=htc
_flavor=htc-ace
_config="config-${_flavor}.armhf"
_hash="887cd64b8361ac89ac56810460947a537112bdc9"
pkgname=linux-${_flavor}
pkgver=3.0.101
case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
esac
pkgrel=1
arch="armhf"
pkgdesc="HTC Desire kernel from OpenDesireProject"
url="https://github.com/OpenDesireProject/android_kernel_htc_msm7x30"
depends="postmarketos-mkinitfs"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev xz"
options="!strip !check !tracedeps"
install=
source="
$pkgname-$_hash.zip::https://github.com/OpenDesireProject/android_kernel_htc_msm7x30/archive/${_hash}.zip
$_config
compiler-gcc6.h
gpu-msm-fix-gcc5-compile.patch
"
subpackages=""
license="GPL2"
_abi_release=${pkgver}
_carch="arm"
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
ksrcdir="$srcdir/android_kernel_htc_msm7x30-${_hash}"
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/" || return 1
mkdir -p "$srcdir"/build
cp "$srcdir"/$_config "$srcdir"/build/.config || return 1
yes "" | make -C "$ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" \
oldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build || return 1
echo "--[ menuconfig ]--"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS
echo "--[ Build kernel + modules ]--"
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" \
|| return 1
}
package() {
echo "--[ Installing kernel ]--"
install -Dm644 "$srcdir/build/arch/arm/boot/zImage" \
"$pkgdir/boot/vmlinuz-$_flavor"
install -D "$srcdir/build/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
}
sha512sums="bf31c470c31326002d6d3ca761777d6fb5f50fea52c303a9dde4a27757864ca0384f710e7fd4d9272cda9c680cb50f301c9de507911c27519fcb463e8a6756c5 linux-htc-ace-887cd64b8361ac89ac56810460947a537112bdc9.zip
7c9e04eb5873b39b1b398cb9c5e29dc4e6c0a80f1cf83abe5cc403e278ae5c850921c2d783b09d21cd46652a581dc4fd9924efdeae4a1add35e803d78f7de6a5 config-htc-ace.armhf
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
2962e853aea3bec3cfea762584a6722023c5c9041994065a7ee75b6c4584121890d6dd1ac74317a2bb8069bff49583a9cccd73cca539665a76713465e05a2cf6 gpu-msm-fix-gcc5-compile.patch"

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,34 @@
From 50284e8b1ef6a51f5f56d05bbf5ff28adc211a97 Mon Sep 17 00:00:00 2001
From: victor9 <victor99@protonmail.com>
Date: Mon, 17 Jul 2017 12:18:56 +0200
Subject: [PATCH] Changed kgsl_iommu_sync to static
---
drivers/gpu/msm/kgsl_iommu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/msm/kgsl_iommu.c b/drivers/gpu/msm/kgsl_iommu.c
index 24690c4..47818c5 100755
--- a/drivers/gpu/msm/kgsl_iommu.c
+++ b/drivers/gpu/msm/kgsl_iommu.c
@@ -926,7 +926,7 @@ static int kgsl_iommu_init_sync_lock(struct kgsl_mmu *mmu)
*
* Return - int - number of commands.
*/
-inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
+static inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
unsigned int *cmds)
{
struct kgsl_device *device = mmu->device;
@@ -984,7 +984,7 @@ inline unsigned int kgsl_iommu_sync_lock(struct kgsl_mmu *mmu,
*
* Return - int - number of commands.
*/
-inline unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu,
+static inline unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu,
unsigned int *cmds)
{
struct kgsl_device *device = mmu->device;
--
2.7.4