htc-memul: new device (HTC One Mini 2) (!641)

[ci:skip-build]: alraedy built successfully in CI
This commit is contained in:
Luca Weiss 2019-09-21 14:16:51 +02:00 committed by Oliver Smith
parent c6e3000931
commit 3362660cae
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
11 changed files with 4034 additions and 0 deletions

View file

@ -0,0 +1,31 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-htc-memul"
pkgdesc="HTC One Mini 2"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-htc-memul mkbootimg mesa-dri-swrast"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo
initfs-hook.sh"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="Firmware for WiFi, etc."
depends="firmware-htc-memul-wcnss wcnss-wlan"
mkdir "$subpkgdir"
}
sha512sums="519832a9c6a51998e327bc50587e7d6c09c47ccd9d184379b19f132cd11ae5dae0b26fbce070ae4674a3f4bf0ce4906364b266f9b6412e134311c6271d142df4 deviceinfo
765abaad5fda0dfda5e62e1e48414d3eea822198f39d0792171a04d73f86f6273a6e562afab430cbfcdd084412568a0ad03d012e9c40c5564f5cd1b9c0f181eb initfs-hook.sh"

View file

@ -0,0 +1,33 @@
# 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 One Mini 2"
deviceinfo_manufacturer="HTC"
deviceinfo_codename="htc-memul"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armv7"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="720"
deviceinfo_screen_height="1280"
deviceinfo_dev_touchscreen="/dev/input/event6"
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=none androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 zcache buildvariant=userdebug"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x02008000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x01e00000"
deviceinfo_flash_pagesize="2048"

View file

@ -0,0 +1,4 @@
#!/bin/sh
# set usb properties
echo 4 > /sys/devices/platform/android_usb/usb_function_switch

View file

@ -0,0 +1,25 @@
From 84df8c9171445d1b908a4b3e5d97bdf053d25a27 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 21 Sep 2019 22:40:55 +0200
Subject: [PATCH 1/2] undefine DIAG_XPST
---
arch/arm/mach-msm/include/mach/usbdiag.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-msm/include/mach/usbdiag.h b/arch/arm/mach-msm/include/mach/usbdiag.h
index 4f9476ad4a6..d8f946f98ac 100644
--- a/arch/arm/mach-msm/include/mach/usbdiag.h
+++ b/arch/arm/mach-msm/include/mach/usbdiag.h
@@ -54,7 +54,7 @@
printk(KERN_DEBUG fmt, ## args)
/* #define SDQXDM_DEBUG */
-#define DIAG_XPST 1
+/* #define DIAG_XPST 1 */
#define DIAG_LEGACY "diag"
#define DIAG_MDM "diag_mdm"
--
2.23.0

View file

@ -0,0 +1,91 @@
From b4c046d4b0a60439b16c5fa4e5e47a57ea721351 Mon Sep 17 00:00:00 2001
From: Federico Amedeo Izzo <federico.izzo42@gmail.com>
Date: Fri, 22 Mar 2019 19:37:07 +0100
Subject: [PATCH 2/2] fix video argb setting
---
drivers/video/msm/mdss/mdss_fb.c | 34 ++++++++++++++++----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
index a826b8b266e..7e79aefc80e 100644
--- a/drivers/video/msm/mdss/mdss_fb.c
+++ b/drivers/video/msm/mdss/mdss_fb.c
@@ -1629,16 +1629,16 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
fix->xpanstep = 1;
fix->ypanstep = 1;
var->vmode = FB_VMODE_NONINTERLACED;
- var->blue.offset = 0;
- var->green.offset = 8;
- var->red.offset = 16;
+ var->blue.offset = 24;
+ var->green.offset = 16;
+ var->red.offset = 8;
var->blue.length = 8;
var->green.length = 8;
var->red.length = 8;
var->blue.msb_right = 0;
var->green.msb_right = 0;
var->red.msb_right = 0;
- var->transp.offset = 24;
+ var->transp.offset = 0;
var->transp.length = 8;
bpp = 4;
break;
@@ -1648,16 +1648,16 @@ static int mdss_fb_register(struct msm_fb_data_type *mfd)
fix->xpanstep = 1;
fix->ypanstep = 1;
var->vmode = FB_VMODE_NONINTERLACED;
- var->blue.offset = 8;
- var->green.offset = 16;
- var->red.offset = 24;
+ var->blue.offset = 16;
+ var->green.offset = 8;
+ var->red.offset = 0;
var->blue.length = 8;
var->green.length = 8;
var->red.length = 8;
var->blue.msb_right = 0;
var->green.msb_right = 0;
var->red.msb_right = 0;
- var->transp.offset = 0;
+ var->transp.offset = 24;
var->transp.length = 8;
bpp = 4;
break;
@@ -2483,15 +2483,15 @@ static int mdss_fb_check_var(struct fb_var_screeninfo *var,
/* Figure out if the user meant RGBA or ARGB
and verify the position of the RGB components */
- if (var->transp.offset == 24) {
- if ((var->blue.offset != 0) ||
- (var->green.offset != 8) ||
- (var->red.offset != 16))
- return -EINVAL;
- } else if (var->transp.offset == 0) {
- if ((var->blue.offset != 8) ||
+ if (var->transp.offset == 0) {
+ if ((var->blue.offset != 24) ||
(var->green.offset != 16) ||
- (var->red.offset != 24))
+ (var->red.offset != 8))
+ return -EINVAL;
+ } else if (var->transp.offset == 24) {
+ if ((var->blue.offset != 16) ||
+ (var->green.offset != 8) ||
+ (var->red.offset != 0))
return -EINVAL;
} else
return -EINVAL;
@@ -2581,7 +2581,7 @@ static int mdss_fb_set_par(struct fb_info *info)
break;
case 32:
- if (var->transp.offset == 24)
+ if (var->transp.offset == 0)
mfd->fb_imgType = MDP_ARGB_8888;
else
mfd->fb_imgType = MDP_RGBA_8888;
--
2.23.0

View file

@ -0,0 +1,79 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/lineageos_memul_defconfig
pkgname="linux-htc-memul"
pkgver=3.4.113
pkgrel=0
pkgdesc="HTC One Mini 2 kernel fork"
arch="armv7"
_carch="arm"
_flavor="htc-memul"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev dtbtool xz"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="android_kernel_htc_msm8974-caf_rebase"
_commit="909c034f8c080b4acbf64921e57a9e4e96322db0"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/nightcore500/${_repository}/archive/${_commit}.tar.gz
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
kernel-use-the-gnu89-standard-explicitly.patch
0001-undefine-DIAG_XPST.patch
0002-fix-video-argb-setting.patch
"
builddir="$srcdir/${_repository}-${_commit}"
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"
# Generate master DTB (deviceinfo_bootimg_qcdt)
dtbTool --dt-tag "htc,project-id" -s 2048 -p "scripts/dtc/" -o "arch/arm/boot/dt.img" "arch/arm/boot/"
}
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
# Master DTB (deviceinfo_bootimg_qcdt)
install -Dm644 "$builddir/arch/arm/boot/dt.img" \
"$pkgdir/boot/dt.img"
}
sha512sums="23e477d471607cbede9632569a05231f480ca47f5d00e8233a8503f40ab01a6a6a7f541d19f653447e14744cad26c9d18ff6e1b94d9154b25fb4cd67dd0c6288 linux-htc-memul-909c034f8c080b4acbf64921e57a9e4e96322db0.tar.gz
5a45633707ffa18023d3bdf359f653dbc0bac4c0b24087875e9a0376eb1df66f350bdf24c993739dc88c5fbfebcde9f0e1f4941595070dabbcccbfae76c4a304 config-htc-memul.armv7
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch
b98c43fd812329b9f3ac6df6810a24fb1a72a4d8476b7dcf2209ce56a3e5b5fe115b97f2e906cdbecdd46d7229688aae8de85932c1308aba6e8a47cb00fd8dda 0001-undefine-DIAG_XPST.patch
173af2c693d986a2892d7afc22568c3c692644a23245c0e55b4835b9c2f1e3731fbb5085183663741408a3ec9e128f9ba5390c92aea471d64b062cff4de3656f 0002-fix-video-argb-setting.patch"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc7-give-up-on-ilog2-const-optimizations.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc8-fix-put-user.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/kernel-use-the-gnu89-standard-explicitly.patch

View file

@ -0,0 +1,61 @@
pkgname=firmware-htc-memul
pkgver=1
pkgrel=0
pkgdesc="Firmware for HTC One Mini 2"
subpackages="$pkgname-adsp $pkgname-modem $pkgname-wcnss"
url="https://postmarketos.org"
arch="armv7"
license="proprietary"
options="!check !strip !archcheck"
# Sources
_fw_commit="d89bafbb77277ccc600a34a2b7533be5bf6b278f"
source="$pkgname-$_fw_commit.tar.gz::https://github.com/FairBlobs/memul-firmware/archive/$_fw_commit.tar.gz"
_dt_commit="38db7981457b45d5e834d05bfff49afbea01c25e"
_wififiles="WCNSS_cfg.dat WCNSS_qcom_cfg.ini WCNSS_qcom_wlan_nv.bin"
for _i in $_wififiles; do
source="$source $pkgname-$_dt_commit-$_i::https://raw.githubusercontent.com/nightcore500/android_device_htc_memul/$_dt_commit/wifi/$_i";
done
builddir="$srcdir/memul-firmware-$_fw_commit"
package() {
# parent package is empty
mkdir -p "$pkgdir"
}
adsp() {
pkgdesc="HTC One Mini 2 aDSP firmware"
cd "$builddir"
for _i in adsp.*; do
install -Dm644 $_i "$subpkgdir"/lib/firmware/postmarketos/$_i
done
}
modem() {
pkgdesc="HTC One Mini 2 modem firmware"
cd "$builddir"
for _i in modem.* mba.*; do
install -Dm644 $_i "$subpkgdir"/lib/firmware/postmarketos/$_i
done
}
wcnss() {
pkgdesc="HTC One Mini 2 Wireless Connectivity Subsystem (WCNSS) firmware"
cd "$builddir"
for _i in wcnss.*; do
install -Dm644 $_i "$subpkgdir"/lib/firmware/postmarketos/$_i
done
for _i in $_wififiles; do
install -Dm644 "$srcdir/$pkgname-$_dt_commit-$_i" \
"$subpkgdir/lib/firmware/postmarketos/wlan/prima/$_i"
done
}
sha512sums="f55a0639b2857754e456268d3497e8b81b5cf29ae0794f52d0e6b1b1248e0352a0dadda9edace9cbb24b68ca06c9341875d78d23aa1823a72d3adf4bc62eead2 firmware-htc-memul-d89bafbb77277ccc600a34a2b7533be5bf6b278f.tar.gz
fb92214f928143228c0683934342ceff11f19bec0581684e98e155262bed03f51c21a21881ec03316f917c127b607a2943efea4847b908f1c02864a1e507fb50 firmware-htc-memul-38db7981457b45d5e834d05bfff49afbea01c25e-WCNSS_cfg.dat
925b9d768d17277135aa4446d37996b0b577ec303569bb2c4f83a3c4a75114e0488dacf6bcbd789f584a376f0192ba19720f2ca4e5d438e4227d437d1fd7bd9e firmware-htc-memul-38db7981457b45d5e834d05bfff49afbea01c25e-WCNSS_qcom_cfg.ini
0dd92b6f97731e84c0aaa01b0cc1651ada0fa55d279ec436128266a76b52ddb1d45961956f06e0cfd59ac96832e4bc68458999400a40998d0e1fb176a4010391 firmware-htc-memul-38db7981457b45d5e834d05bfff49afbea01c25e-WCNSS_qcom_wlan_nv.bin"