New device: oneplus oneplus2 (#1366)

Based on work by @NotKit, thanks!
This commit is contained in:
Lionel Duboeuf 2018-03-28 23:10:12 +02:00 committed by Oliver Smith
parent 491ee6b1c1
commit b65c04b3ce
7 changed files with 4336 additions and 0 deletions

View File

@ -0,0 +1,28 @@
pkgname="device-oneplus-oneplus2"
pkgdesc="OnePlus 2"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="noarch"
options="!check"
depends="postmarketos-base linux-oneplus-oneplus2 mkbootimg mesa-dri-swrast msm-fb-refresher"
makedepends="devicepkg-dev"
source="deviceinfo
initfs-hook.sh
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
install -Dm644 "$srcdir"/deviceinfo \
"$pkgdir"/etc/deviceinfo
install -D -m644 "$srcdir"/initfs-hook.sh \
"$pkgdir"/etc/postmarketos-mkinitfs/hooks/00-${pkgname}.sh
devicepkg_package $startdir $pkgname
}
sha512sums="c473372edda7405de3a27f555300e8511d722d1996cff822b540f776cd92dbc8afbe0a508e09aa78e822cfc759965728846a2e6136d1e334f619b092a3c9bc8a deviceinfo
abf299888a7a2eafc483a0077b0a60ff04a9c85e54c09758896a15d5d4fe0359765d078797d6791acd0ca5ede2f46dac2674fadbbbf0905d81e9a01e97d8b470 initfs-hook.sh"

View File

@ -0,0 +1,31 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="OnePlus 2"
deviceinfo_manufacturer="OnePlus"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="aarch64"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="false"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="1920"
deviceinfo_msm_refresher="true"
deviceinfo_dev_touchscreen="/dev/input/event6"
deviceinfo_dev_keyboard=""
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-3"
deviceinfo_generate_bootimg="true"
# deviceinfo_bootimg_qcdt="false"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x10008000"
deviceinfo_flash_offset_ramdisk="0x11000000"
deviceinfo_flash_offset_second="0x10f00000"
deviceinfo_flash_offset_tags="0x10000100"
deviceinfo_flash_pagesize="2048"

View File

@ -0,0 +1,6 @@
#!/bin/sh
# set framebuffer resolution
echo 1080,3840 > /sys/class/graphics/fb0/virtual_size

View File

@ -0,0 +1,12 @@
diff --git a/drivers/input/touchscreen/synaptics_driver_s3320.c b/drivers/input/touchscreen/synaptics_driver_s3320.c
index 79b184a..f3d3872 100644
--- a/drivers/input/touchscreen/synaptics_driver_s3320.c
+++ b/drivers/input/touchscreen/synaptics_driver_s3320.c
@@ -2105,7 +2105,6 @@ static int synaptics_input_init(struct synaptics_ts_data *ts)
set_bit(EV_ABS, ts->input_dev->evbit);
set_bit(EV_KEY, ts->input_dev->evbit);
set_bit(ABS_MT_TOUCH_MAJOR, ts->input_dev->absbit);
- set_bit(ABS_MT_WIDTH_MAJOR,ts->input_dev->absbit);
set_bit(ABS_MT_POSITION_X, ts->input_dev->absbit);
set_bit(ABS_MT_POSITION_Y, ts->input_dev->absbit);
set_bit(INPUT_PROP_DIRECT, ts->input_dev->propbit);

View File

@ -0,0 +1,83 @@
# Kernel config based on: arch/arm64/configs/oneplus2_defconfig
pkgname="linux-oneplus-oneplus2"
pkgver=3.10.108
pkgrel=0
pkgdesc="OnePlus 2 kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="oneplus-oneplus2"
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_oneplus_msm8994"
_commit="91bca269f649061eb5a54510f466d06c3b5ca1fb"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/${_repository}/archive/${_commit}.tar.gz
$_config
compiler-gcc6.h
00_mt_width_major_params.patch
"
builddir="$srcdir/${_repository}-${_commit}"
prepare() {
default_prepare
# gcc6 support
cp -v "$srcdir/compiler-gcc6.h" "$builddir/include/linux/"
# Remove -Werror from all makefiles
find . -type f -name Makefile -print0 | \
xargs -0 sed -i 's/-Werror-/-W/g'
find . -type f -name Makefile -print0 | \
xargs -0 sed -i 's/-Werror//g'
sed -i 's/-Werror//g' drivers/staging/qcacld-2.0/Kbuild
# 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="4eadeaef50e141b3664552ade094dfc35e3422d3e1614832d007a1a043eada8a84a8101f8d199afce59d6379338d9df82d62b6af32d89fe6275130263cf4daab linux-oneplus-oneplus2-91bca269f649061eb5a54510f466d06c3b5ca1fb.tar.gz
04a7ffa09de824d117be7412e6b35b21a65d83a54b01c8ee76429a5015b3d123e0ed45399e9c68acfe4dd20d2000fb1af5b2e07401f4bac4280a15583ca01928 config-oneplus-oneplus2.aarch64
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
d4eff67f99708e091499ce033a0709ba6765d83ed74c7411bd7d8ec72ce822db4e7c3bc8e7f51ccc8610486546ea9d9485a7cb93a761c8307b94283b337da726 00_mt_width_major_params.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