New device: htc-vision (HTC Desire Z/G2) (!132)
Based on cmdrwgls original work from: https://github.com/postmarketOS/pmbootstrap/pull/810 Fixed to actually boot, compile with GCC-6, and the touch screen is working! [skip ci]: already passed CI
This commit is contained in:
parent
7b3702e2dd
commit
33900c7889
8 changed files with 3162 additions and 0 deletions
3
device/device-htc-vision/90-android.rules
Normal file
3
device/device-htc-vision/90-android.rules
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
SUBSYSTEM=="input", ATTRS{name}=="atmel-touchscreen", \
|
||||||
|
ENV{ID_INPUT}="1", ENV{ID_INPUT_TOUCHSCREEN}="1"
|
||||||
|
|
33
device/device-htc-vision/APKBUILD
Normal file
33
device/device-htc-vision/APKBUILD
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
pkgname=device-htc-vision
|
||||||
|
pkgver=0.1
|
||||||
|
pkgrel=0
|
||||||
|
pkgdesc="HTC Desire Z"
|
||||||
|
url="https://github.com/postmarketOS"
|
||||||
|
arch="armhf"
|
||||||
|
license="MIT"
|
||||||
|
depends="linux-htc-vision mkbootimg postmarketos-base msm-fb-refresher"
|
||||||
|
makedepends=""
|
||||||
|
install=""
|
||||||
|
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
|
||||||
|
source="deviceinfo 90-android.rules
|
||||||
|
initfs-hook.sh"
|
||||||
|
options="!check !archcheck"
|
||||||
|
|
||||||
|
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.rules \
|
||||||
|
"$pkgdir"/etc/udev/rules.d/90-android.rules
|
||||||
|
}
|
||||||
|
|
||||||
|
nonfree_firmware() {
|
||||||
|
pkgdesc="Wifi firmware"
|
||||||
|
depends="firmware-aosp-broadcom-wlan"
|
||||||
|
mkdir "$subpkgdir"
|
||||||
|
}
|
||||||
|
|
||||||
|
sha512sums="bd1b5d685968a2394086727e75766b35dd61404bf5fe0f2009203aa79030366157963380be580281c64bfdb0f5629320d10195c65f56b7a13b5476449e71c81d deviceinfo
|
||||||
|
d1e1da53c641aba2c0a8c5daf1438aabfe88024c940d3062a6a5e123e3c99af67e9917c60159297840aae06e6b9eaec8e050e412fc5570a525a32027665df064 90-android.rules
|
||||||
|
3ce2d134aa59677e25a160b5985c552fbf048b237169bbeb85e2b8824f734627064b51c097036db10eee0254064d45d804d17372dffcd1ba246938968fe1e225 initfs-hook.sh"
|
31
device/device-htc-vision/deviceinfo
Normal file
31
device/device-htc-vision/deviceinfo
Normal 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="HTC Desire Z (vision)"
|
||||||
|
deviceinfo_manufacturer="HTC"
|
||||||
|
deviceinfo_date="2010"
|
||||||
|
deviceinfo_keyboard="true"
|
||||||
|
deviceinfo_nonfree="????"
|
||||||
|
deviceinfo_dtb=""
|
||||||
|
deviceinfo_modules_initfs=""
|
||||||
|
deviceinfo_external_storage="true"
|
||||||
|
deviceinfo_flash_method="fastboot"
|
||||||
|
deviceinfo_arch="armhf"
|
||||||
|
deviceinfo_codename="htc-vision"
|
||||||
|
|
||||||
|
# Splash screen
|
||||||
|
deviceinfo_screen_width="480"
|
||||||
|
deviceinfo_screen_height="800"
|
||||||
|
|
||||||
|
# Fastboot
|
||||||
|
deviceinfo_flash_offset_base="0x04000000"
|
||||||
|
deviceinfo_flash_offset_kernel="0008000"
|
||||||
|
deviceinfo_flash_offset_ramdisk="01000000"
|
||||||
|
deviceinfo_flash_offset_second="00f00000"
|
||||||
|
deviceinfo_flash_offset_tags="00000100"
|
||||||
|
deviceinfo_flash_pagesize="2048"
|
||||||
|
deviceinfo_kernel_cmdline="no_console_suspend=1"
|
||||||
|
deviceinfo_generate_bootimg="true"
|
||||||
|
deviceinfo_bootimg_qcdt="false"
|
||||||
|
|
8
device/device-htc-vision/initfs-hook.sh
Normal file
8
device/device-htc-vision/initfs-hook.sh
Normal 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
|
33
device/linux-htc-vision/02_gpu-msm-fix-gcc5-compile.patch
Normal file
33
device/linux-htc-vision/02_gpu-msm-fix-gcc5-compile.patch
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
source:
|
||||||
|
https://github.com/ShinySide/HispAsian_Lollipop_G6/commit/b7756b6fc4bb728722b14d2dfdbaf1dc843812e9
|
||||||
|
|
||||||
|
* These need to be static to avoid these errors:
|
||||||
|
|
||||||
|
drivers/built-in.o: In function `.LANCHOR1':
|
||||||
|
msm_iommu_sec.c:(.data+0x9298): undefined reference to `kgsl_iommu_sync_lock'
|
||||||
|
msm_iommu_sec.c:(.data+0x929c): undefined reference to `kgsl_iommu_sync_unlock'
|
||||||
|
Makefile:877: recipe for target '.tmp_vmlinux1' failed
|
||||||
|
make: *** [.tmp_vmlinux1] Error 1
|
||||||
|
|
||||||
|
Signed-off-by: Chet Kener <Cl3Kener@gmail.com>
|
||||||
|
|
||||||
|
--- a/drivers/gpu/msm/kgsl_iommu.c
|
||||||
|
+++ b/drivers/gpu/msm/kgsl_iommu.c
|
||||||
|
@@ -1010,7 +1010,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;
|
||||||
|
@@ -1080,7 +1080,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;
|
65
device/linux-htc-vision/APKBUILD
Normal file
65
device/linux-htc-vision/APKBUILD
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
pkgver=3.0.101
|
||||||
|
pkgrel=0
|
||||||
|
pkgdesc="HTC Desire Z kernel from milaq"
|
||||||
|
arch="armhf"
|
||||||
|
_carch="arm"
|
||||||
|
_flavor="htc-vision"
|
||||||
|
_hash="4bc19919f805777947c243e6c2ed41ece530488b"
|
||||||
|
pkgname="linux-${_flavor}"
|
||||||
|
url="https://github.com/milaq/android_kernel_htc_vision"
|
||||||
|
license="GPL-2.0-only"
|
||||||
|
options="!strip !check !tracedeps"
|
||||||
|
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev xz gcc6"
|
||||||
|
|
||||||
|
if [ "${CC:0:5}" != "gcc6-" ]; then
|
||||||
|
CC="gcc6-$CC"
|
||||||
|
HOSTCC="gcc6-gcc"
|
||||||
|
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Source
|
||||||
|
_config="config-${_flavor}.${arch}"
|
||||||
|
source="
|
||||||
|
$pkgname-$_hash.zip::https://github.com/milaq/android_kernel_htc_vision/archive/cm-11.0.zip
|
||||||
|
$_config
|
||||||
|
02_gpu-msm-fix-gcc5-compile.patch
|
||||||
|
fix-boot-gcc5.patch
|
||||||
|
"
|
||||||
|
builddir="$srcdir/android_kernel_htc_vision-cm-11.0"
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
default_prepare
|
||||||
|
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
|
||||||
|
}
|
||||||
|
|
||||||
|
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="5020a534a0f8475666d4d036584ce7279eea3d59c0380dcd2d80367651a02f668aab2eb6177f0f030cc03933800ae1a1b8bcfc063c2f35b4f9cabec276a8c620 linux-htc-vision-4bc19919f805777947c243e6c2ed41ece530488b.zip
|
||||||
|
faf84c4b97d5ec5bedbe971c6f92e9c7d6b81425ff6b0f4276cdf6b7fd9920619814c80ee53b078979c2d1972aa4e0b6a170b88caadf7c73ae9731fec6f5493b config-htc-vision.armhf
|
||||||
|
7be03a9e78b7ac330a54b1f00509caa0621a95c0c55901878ad757f9dd69cc05ba2c8b5ea987063ae1224f92c4d090d515fa5d369e7755181a4871b0d0f82881 02_gpu-msm-fix-gcc5-compile.patch
|
||||||
|
5ea8c150174224791466ae66e13f44b567c447382e348612e2b0f58d85d499a348a6b24cd5bd1f979631e9610cbe490a5dbe213275d13d4376964268ab3d88ea fix-boot-gcc5.patch"
|
2964
device/linux-htc-vision/config-htc-vision.armhf
Normal file
2964
device/linux-htc-vision/config-htc-vision.armhf
Normal file
File diff suppressed because it is too large
Load diff
25
device/linux-htc-vision/fix-boot-gcc5.patch
Normal file
25
device/linux-htc-vision/fix-boot-gcc5.patch
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
diff --git a/include/linux/unaligned/le_byteshift.h b/include/linux/unaligned/le_byteshift.h
|
||||||
|
index be376fb79..ab14cb194 100644
|
||||||
|
--- a/include/linux/unaligned/le_byteshift.h
|
||||||
|
+++ b/include/linux/unaligned/le_byteshift.h
|
||||||
|
@@ -5,17 +5,17 @@
|
||||||
|
|
||||||
|
static inline u16 __get_unaligned_le16(const u8 *p)
|
||||||
|
{
|
||||||
|
- return p[0] | p[1] << 8;
|
||||||
|
+ return p[0] + (p[1] << 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline u32 __get_unaligned_le32(const u8 *p)
|
||||||
|
{
|
||||||
|
- return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
|
||||||
|
+ return p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] << 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline u64 __get_unaligned_le64(const u8 *p)
|
||||||
|
{
|
||||||
|
- return (u64)__get_unaligned_le32(p + 4) << 32 |
|
||||||
|
+ return ((u64)__get_unaligned_le32(p + 4) << 32) +
|
||||||
|
__get_unaligned_le32(p);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue