alcatel-pop7lte: new device (Alcatel OneTouch Pop 7S) (!1072)

This commit adds support for the Alcatel OneTouch Pop 7S (pop7lte),
a 2014 MSM8226-based tablet, using manufacturer's downstream kernel.

Currently working: display, USB networking, Weston

Firmware is packaged for WiFi and audio but the downstream kernel tree
doesn't seem to include drivers for the qcom wlan chip, only wcnss.

Additionally, audio mixer config is missing as I haven't been able to
find it in the stock Android 4.2.x ROM's filesystem yet.

Please note that this commit adds support *only* for model P330X,
which is not to be confused with similarly-named incompatible devices,
the Pop 7 (also 2014 w/ MT8312) and the Pop 7 LTE (2016 w/ MSM8909).

Signed-off-by: Lauren Kelly <lauren.kelly@msn.com>
This commit is contained in:
Lauren Kelly 2020-03-15 12:45:07 +00:00 committed by Alexey Min
parent 796f2d097d
commit 16e73360dc
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
12 changed files with 4053 additions and 0 deletions

View file

@ -0,0 +1,38 @@
# Contributor: Lauren Kelly <lauren.kelly@msn.com>
# Maintainer: Lauren Kelly <lauren.kelly@msn.com>
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-alcatel-pop7lte"
pkgdesc="Alcatel OneTouch Pop 7S"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-alcatel-pop7lte mkbootimg mesa-dri-swrast msm-fb-refresher mdss-fb-init-hack"
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="Audio/WiFi/BT firmware"
depends="firmware-alcatel-pop7lte-adsp firmware-alcatel-pop7lte-wcnss"
mkdir "$subpkgdir"
}
sha512sums="b772d6414a1aaacbe86d90f8852a186d8ab100fab4590290daa0d65a6012d46e084b996e7f5e1852d531d05e32f058c0e1165446d18ee289a499b3154f94a9ce deviceinfo
117a02c9301a340837452d9743c8e716909e0e82c0e4d6c4fdef012dcdbd509a3d1c23cb511c646dfc90945d7bc22c02e97ce31bdd8fac8924d9bc05b24d5b29 initfs-hook.sh"

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="Alcatel OneTouch Pop 7S"
deviceinfo_manufacturer="Alcatel"
deviceinfo_codename="alcatel-pop7lte"
deviceinfo_year="2014"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armv7"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1024"
deviceinfo_screen_height="600"
deviceinfo_dev_touchscreen="/dev/input/event0"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 androidboot.bootloader=L4AOB0B0BE00"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x02000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x01e00000"
deviceinfo_flash_pagesize="2048"

View file

@ -0,0 +1,6 @@
#!/bin/sh
# Blank and set brightness (fixes blank screen after boot splash)
echo 0 > /sys/class/graphics/fb0/blank
echo 255 > /sys/devices/fd900000.qcom,mdss_mdp/qcom,mdss_fb_primary.139/leds/lcd-backlight/brightness

View file

@ -0,0 +1,91 @@
From a23d549c51e38ad9fc481859326a786bc00baad8 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] 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 835f6fc9687..a598cbd72dc 100644
--- a/drivers/video/msm/mdss/mdss_fb.c
+++ b/drivers/video/msm/mdss/mdss_fb.c
@@ -1767,16 +1767,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;
@@ -1786,16 +1786,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;
@@ -2723,15 +2723,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;
@@ -2821,7 +2821,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.21.0

View file

@ -0,0 +1,45 @@
From 63a3f603413ffe82ad775f2d62a5afff87fd94a0 Mon Sep 17 00:00:00 2001
From: "H. Peter Anvin" <hpa@linux.intel.com>
Date: Thu, 7 Feb 2013 17:14:08 -0800
Subject: [PATCH] timeconst.pl: Eliminate Perl warning
defined(@array) is deprecated in Perl and gives off a warning.
Restructure the code to remove that warning.
[ hpa: it would be interesting to revert to the timeconst.bc script.
It appears that the failures reported by akpm during testing of
that script was due to a known broken version of make, not a problem
with bc. The Makefile rules could probably be restructured to avoid
the make bug, or it is probably old enough that it doesn't matter. ]
Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Gustavo Zacarias <gustavo.zacarias@free-electrons.com>
---
Patch status: upstream
kernel/timeconst.pl | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
index eb51d76..3f42652 100644
--- a/kernel/timeconst.pl
+++ b/kernel/timeconst.pl
@@ -369,10 +369,8 @@ if ($hz eq '--can') {
die "Usage: $0 HZ\n";
}
- @val = @{$canned_values{$hz}};
- if (!defined(@val)) {
- @val = compute_values($hz);
- }
+ $cv = $canned_values{$hz};
+ @val = defined($cv) ? @$cv : compute_values($hz);
output($hz, @val);
}
exit 0;
--
2.4.10

View file

@ -0,0 +1,70 @@
# Contributor: Lauren Kelly <lauren.kelly@msn.com>
# Maintainer: Lauren Kelly <lauren.kelly@msn.com>
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/pop7lte_defconfig
pkgname="linux-alcatel-pop7lte"
pkgver=3.4.0
pkgrel=0
pkgdesc="Alcatel OneTouch Pop 7S kernel fork"
arch="armv7"
_carch="arm"
_flavor="alcatel-pop7lte"
url="https://github.com/thejsa/android_kernel_alcatel_pop7lte"
license="GPL-2.0-only"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev dtbtool gcc4"
# Compiler: GCC 4 (doesn't compile with newer versions)
if [ "${CC:0:5}" != "gcc4-" ]; then
CC="gcc4-$CC"
HOSTCC="gcc4-gcc"
CROSS_COMPILE="gcc4-$CROSS_COMPILE"
fi
# Source
_repository="android_kernel_alcatel_pop7lte"
_commit="675e8a12526fad083d93e3d2ddab65e2b2be7861"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/thejsa/$_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
01_timeconst.patch
fix-fdinfo-file-handling.patch
0001-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 -s 2048 -p "scripts/dtc/" -o "arch/arm/boot/dt.img" "arch/arm/boot/"
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor"
# Master DTB (deviceinfo_bootimg_qcdt)
install -Dm644 "$builddir/arch/arm/boot/dt.img" \
"$pkgdir/boot/dt.img"
}
sha512sums="88a01001f63faa49518cf8cb5654e41560702c1bfa356b6bbc0d324e0054a20a1915ff2100cff1947751a8582af376a60735197d62a6b9073a35bd08e34cfd60 linux-alcatel-pop7lte-675e8a12526fad083d93e3d2ddab65e2b2be7861.tar.gz
5008ff3dd32e596e45585c7593cd6ac7dc4b93699ef10859b5391359fe9d69d3321fe8f4575ab3f18d583070b6f8826d101bca23eb0762ee4a410b3f19e8b212 config-alcatel-pop7lte.armv7
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch
a2bb98fb8d988bbb659cae00fbaca360828300e9b98b90aed5ee0dd839c3f740696df4094a9021b813cbada06820d115aabed581a47cdd2c947e8d853c20b145 01_timeconst.patch
93f7870b2063d4ddb1f35dc4de4b213d83e0f54f59511b3050e880763f2374b3816ac0c879de76fe8a0b61d62c1753c5dda7326961164a8fcbfc8a9232309569 fix-fdinfo-file-handling.patch
a48336bbfead6ad0c84d2fce0c40a3f5530aebdff356a6835cceaf59a50a6f860d2f8027703a92927955fbb18857ba78788e010d017bf67730f069b36e96fe87 0001-fix-video-argb-setting.patch"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,81 @@
From 25437b2a54dd619a96e268ecaf303b089aa785e4 Mon Sep 17 00:00:00 2001
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Mon, 4 Jun 2012 11:00:45 -0700
Subject: [PATCH] vfs: Fix /proc/<tid>/fdinfo/<fd> file handling
commit 0640113be25d283e0ff77a9f041e1242182387f0 upstream.
Cyrill Gorcunov reports that I broke the fdinfo files with commit
30a08bf2d31d ("proc: move fd symlink i_mode calculations into
tid_fd_revalidate()"), and he's quite right.
The tid_fd_revalidate() function is not just used for the <tid>/fd
symlinks, it's also used for the <tid>/fdinfo/<fd> files, and the
permission model for those are different.
So do the dynamic symlink permission handling just for symlinks, making
the fdinfo files once more appear as the proper regular files they are.
Of course, Al Viro argued (probably correctly) that we shouldn't do the
symlink permission games at all, and make the symlinks always just be
the normal 'lrwxrwxrwx'. That would have avoided this issue too, but
since somebody noticed that the permissions had changed (which was the
reason for that original commit 30a08bf2d31d in the first place), people
do apparently use this feature.
[ Basically, you can use the symlink permission data as a cheap "fdinfo"
replacement, since you see whether the file is open for reading and/or
writing by just looking at st_mode of the symlink. So the feature
does make sense, even if the pain it has caused means we probably
shouldn't have done it to begin with. ]
Change-Id: I6499a97dc8993b3dd6b4df5af2724990ee91fd3b
Reported-and-tested-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/proc/base.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 2f198dad12c5..c8cb15dcca08 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1838,7 +1838,7 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
rcu_read_lock();
file = fcheck_files(files, fd);
if (file) {
- unsigned i_mode, f_mode = file->f_mode;
+ unsigned f_mode = file->f_mode;
rcu_read_unlock();
put_files_struct(files);
@@ -1854,12 +1854,14 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
inode->i_gid = 0;
}
- i_mode = S_IFLNK;
- if (f_mode & FMODE_READ)
- i_mode |= S_IRUSR | S_IXUSR;
- if (f_mode & FMODE_WRITE)
- i_mode |= S_IWUSR | S_IXUSR;
- inode->i_mode = i_mode;
+ if (S_ISLNK(inode->i_mode)) {
+ unsigned i_mode = S_IFLNK;
+ if (f_mode & FMODE_READ)
+ i_mode |= S_IRUSR | S_IXUSR;
+ if (f_mode & FMODE_WRITE)
+ i_mode |= S_IWUSR | S_IXUSR;
+ inode->i_mode = i_mode;
+ }
security_task_to_inode(task, inode);
put_task_struct(task);
@@ -1894,6 +1896,7 @@ static struct dentry *proc_fd_instantiate(struct inode *dir,
ei = PROC_I(inode);
ei->fd = fd;
+ inode->i_mode = S_IFLNK;
inode->i_op = &proc_pid_link_inode_operations;
inode->i_size = 64;
ei->op.proc_get_link = proc_fd_link;

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,37 @@
# Contributor: Lauren Kelly <lauren.kelly@msn.com>
# Maintainer: Lauren Kelly <lauren.kelly@msn.com>
pkgname=firmware-alcatel-pop7lte
pkgver=1
pkgrel=0
_commit="0f0e5d3036d0554e967ddca84708c2717cae83a6"
pkgdesc="Firmware files for Alcatel OneTouch Pop 7S"
url="https://postmarketos.org"
subpackages="$pkgname-adsp $pkgname-wcnss"
arch="armv7"
license="proprietary"
source="$pkgname-$_commit.tar.gz::https://github.com/thejsa/vendor_alcatel_pop7lte/archive/$_commit.tar.gz"
options="!check !strip !archcheck !spdx"
builddir="$srcdir/vendor_alcatel_pop7lte-$_commit"
_fwdir="/lib/firmware/postmarketos"
package() {
# parent package is empty
mkdir -p "$pkgdir"
}
adsp() {
depends="adsp-audio"
pkgdesc="Alcatel OneTouch Pop 7S (pop7lte) audio firmware"
install -Dm644 "$builddir"/adsp.* -t "$subpkgdir/$_fwdir"
}
wcnss() {
depends="wcnss-wlan"
pkgdesc="Alcatel OneTouch Pop 7S (pop7lte) WiFi/BT firmware"
install -Dm644 "$builddir"/wcnss.* -t "$subpkgdir/$_fwdir"
install -Dm644 "$builddir"/wlan/prima/WCNSS_* -t "$subpkgdir/$_fwdir"/wlan/prima
}
sha512sums="739fb907606a246cef8084079ea58a5836e3d93d53a38e4e8b5e6f1e458d3dea542b90cf3f7bd647399d4eeab8578f195e8c7b384e90da6bf677aecb391b091c firmware-alcatel-pop7lte-0f0e5d3036d0554e967ddca84708c2717cae83a6.tar.gz"