New device: google-crosshatch (Google Pixel 3 XL) (!83)
A lot of patching was necessary, see the merge request and device wiki page for details. Thanks to opendata26 for helping with the port. https://wiki.postmarketos.org/wiki/Google_Pixel_3_XL_(google-crosshatch) [skip ci]: this hits the compile timeout
This commit is contained in:
parent
017376be29
commit
e735c3f008
9 changed files with 5729 additions and 0 deletions
23
device/device-google-crosshatch/APKBUILD
Normal file
23
device/device-google-crosshatch/APKBUILD
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Reference: <https://postmarketos.org/devicepkg>
|
||||
pkgname="device-google-crosshatch"
|
||||
pkgdesc="Google Pixel 3 XL"
|
||||
pkgver=0.1
|
||||
pkgrel=0
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="aarch64"
|
||||
options="!check !archcheck"
|
||||
depends="postmarketos-base linux-google-crosshatch mkbootimg mesa-dri-swrast"
|
||||
makedepends="devicepkg-dev"
|
||||
source="deviceinfo"
|
||||
|
||||
build() {
|
||||
devicepkg_build $startdir $pkgname
|
||||
}
|
||||
|
||||
package() {
|
||||
devicepkg_package $startdir $pkgname
|
||||
}
|
||||
|
||||
|
||||
sha512sums="44fb4321e619ede8de66221a16e2264b5ae9960230167a6d4e52cf6e957c31bc2b87a6dce6a752e5a0c9b29392696b03f76ef7d5e1e97c42dc79c224f3a96e8c deviceinfo"
|
35
device/device-google-crosshatch/deviceinfo
Normal file
35
device/device-google-crosshatch/deviceinfo
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Reference: <https://postmarketos.org/deviceinfo>
|
||||
# Please use double quotes only. You can source this file in shell scripts.
|
||||
|
||||
deviceinfo_format_version="0"
|
||||
deviceinfo_name="Google Pixel 3 XL"
|
||||
deviceinfo_manufacturer="Google"
|
||||
deviceinfo_date=""
|
||||
deviceinfo_dtb=""
|
||||
deviceinfo_modules_initfs=""
|
||||
deviceinfo_arch="aarch64"
|
||||
|
||||
# Device related
|
||||
deviceinfo_keyboard="false"
|
||||
deviceinfo_external_storage="false"
|
||||
deviceinfo_screen_width="1440"
|
||||
deviceinfo_screen_height="2960"
|
||||
deviceinfo_dev_touchscreen=""
|
||||
deviceinfo_dev_touchscreen_calibration=""
|
||||
deviceinfo_dev_keyboard=""
|
||||
|
||||
# Bootloader related
|
||||
deviceinfo_flash_method="fastboot"
|
||||
deviceinfo_kernel_cmdline="console=ttyMSM0,115200n8 printk.devkmsg=on msm_rtb.filter=0x237 ehci-hcd.park=3 service_locator.enable=1 cgroup.memory=nokmem lpm_levels.sleep_disabled=1 usbcore.autosuspend=7 buildvariant=user"
|
||||
deviceinfo_generate_bootimg="true"
|
||||
deviceinfo_flash_offset_base="0x00000000"
|
||||
deviceinfo_flash_offset_kernel="0x00008000"
|
||||
deviceinfo_flash_offset_ramdisk="0x01000000"
|
||||
deviceinfo_flash_offset_second="0x00f00000"
|
||||
deviceinfo_flash_offset_tags="0x00000100"
|
||||
deviceinfo_flash_pagesize="4096"
|
||||
# Pixel 3 XL uses 4096 byte per sector UFS flash, unlike most devices.
|
||||
# fdisk -l shows "Note: sector size is 4096 (not 512)"
|
||||
deviceinfo_rootfs_image_sector_size="4096"
|
||||
# Framebuffer doesn't work yet. For now, avoid waiting for a nonexistent framebuffer.
|
||||
deviceinfo_no_framebuffer="true"
|
74
device/linux-google-crosshatch/APKBUILD
Normal file
74
device/linux-google-crosshatch/APKBUILD
Normal file
|
@ -0,0 +1,74 @@
|
|||
# Reference: <https://postmarketos.org/vendorkernel>
|
||||
# Kernel config based on: arch/arm64/configs/b1c1_defconfig
|
||||
|
||||
pkgname="linux-google-crosshatch"
|
||||
pkgver=4.9.96
|
||||
pkgrel=0
|
||||
pkgdesc="Google Pixel 3 XL kernel fork"
|
||||
arch="aarch64"
|
||||
_carch="arm64"
|
||||
_flavor="google-crosshatch"
|
||||
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 openssl-dev lz4 dtc"
|
||||
|
||||
# Compiler: latest GCC from Alpine
|
||||
HOSTCC="${CC:-gcc}"
|
||||
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
|
||||
|
||||
# Source
|
||||
_repository="android_kernel_google_crosshatch"
|
||||
# AOSP December 2018.1 from android-msm-bluecross-4.9-pie-qpr1 branch
|
||||
_commit="641303def9a59cbf05c4068df5c30f0bb538dee0"
|
||||
_config="config-${_flavor}.${arch}"
|
||||
source="
|
||||
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/${_repository}/archive/${_commit}.tar.gz
|
||||
$_config
|
||||
clk-qcom-mdss-fix-in-tree-build.patch
|
||||
init-initramfs-disable-do_skip_initramfs.patch
|
||||
arm64-boot-disable-building-DTBO-images.patch
|
||||
init-ignore-dm-parameter.patch
|
||||
sec_ts-disable-touchscreen-firmware-upgrade.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"
|
||||
}
|
||||
|
||||
package() {
|
||||
# kernel.release
|
||||
install -D "$builddir/include/config/kernel.release" \
|
||||
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
|
||||
|
||||
# zImage (find the right one)
|
||||
# Pixel 3 XL uses lz4 to compress kernel.
|
||||
cd "$builddir/arch/$_carch/boot"
|
||||
_target="$pkgdir/boot/vmlinuz-$_flavor"
|
||||
for _zimg in Image.lz4-dtb 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="21098a14515f5d4f2415950fbced8152607d47e0021d867a54450f2914e95a8ab862d18be6487723dd4c9f179eb691e7a734a173df94fc94f46341b1ee74a478 linux-google-crosshatch-641303def9a59cbf05c4068df5c30f0bb538dee0.tar.gz
|
||||
77569c52862efc83ecf9b28bdc6ce7357185014a947e86c3805b50204bb86ebb04669ccb193b9b240f1e05f4eb0d86afb39b2313b8b3f485806da2685dfb455f config-google-crosshatch.aarch64
|
||||
720c5856b7d1d8b3cb20f77507818b7fe1b4950d444f7ed20cb02d255987d8860d5ed293e81ea326f147af13004b524886c733123794ac62978fda13689a5189 clk-qcom-mdss-fix-in-tree-build.patch
|
||||
0f536e5acd0f5e6d6774918d8e226ae1f4edc486596fc5c93a110b4eb2555e0f1281f460065928a7f7a272b886f61f7967fe60cc4952ed1f4b37143bd2a28962 init-initramfs-disable-do_skip_initramfs.patch
|
||||
43b1c1bcdd653366a5d0196bf6171f67914c3c417eeba04f4f071e095e8b3191e67ec8e03b1ed1701a9a0efe5b3e134ed7fb464439e9a389aafdcf0064f20a10 arm64-boot-disable-building-DTBO-images.patch
|
||||
66ac924e2619994dad71a88223d62e911cc90c20f578eb1b0544f115de8367ea9767e7955245c70699f7af040bb8c42f9fa7aff60d4638f1e568a3b3662d30a6 init-ignore-dm-parameter.patch
|
||||
7c941332085c6a2372ad083400e354c61f38752c2706d07592a7ce6a72aa5d8bb9cb10521fe0c941ac4e49aa3dbd2f9473c42ed2a10ec66b1b50b65e8ad1e0a8 sec_ts-disable-touchscreen-firmware-upgrade.patch"
|
|
@ -0,0 +1,27 @@
|
|||
From 7de8975359d95634f7ce16ed115a30ba1fdc8d0e Mon Sep 17 00:00:00 2001
|
||||
From: Zhuowei Zhang <linux@worthdoingbadly.com>
|
||||
Date: Sat, 1 Dec 2018 00:10:38 -0800
|
||||
Subject: [PATCH] arm64: boot: disable building DTBO images
|
||||
|
||||
postmarketOS doesn't flash the DTBO partition, and doesn't package
|
||||
the dtbo tools yet. Just don't build them.
|
||||
---
|
||||
arch/arm64/boot/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile
|
||||
index dfafe9101f78..8bb4b634a7ff 100644
|
||||
--- a/arch/arm64/boot/Makefile
|
||||
+++ b/arch/arm64/boot/Makefile
|
||||
@@ -68,7 +68,7 @@ $(obj)/Image.lz4-dtb: $(obj)/Image.lz4 $(DTB_OBJS) FORCE
|
||||
$(call if_changed,cat)
|
||||
|
||||
$(obj)/dtbo.img: $(obj)/dts/dtboimg.cfg $(DTBO_OBJS) FORCE
|
||||
- $(call if_changed,mkdtimg,4096) # align dtbo.img to 4kB
|
||||
+ # $(call if_changed,mkdtimg,4096) # align dtbo.img to 4kB
|
||||
|
||||
install:
|
||||
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
|
||||
--
|
||||
2.17.1
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
From 371415e897a4cab4fd823a8d496eb5867591dd91 Mon Sep 17 00:00:00 2001
|
||||
From: Zhuowei Zhang <linux@worthdoingbadly.com>
|
||||
Date: Tue, 27 Nov 2018 14:22:17 -0800
|
||||
Subject: [PATCH 1/2] clk: qcom: mdss: fix in-tree build
|
||||
|
||||
Without an explicit include path, when doing an in-tree build, I get
|
||||
|
||||
```
|
||||
In file included from drivers/clk/qcom/mdss/mdss_pll_trace.h:116,
|
||||
from drivers/clk/qcom/mdss/mdss-dsi-pll-10nm.c:24:
|
||||
./include/trace/define_trace.h:88:42: fatal error: ./mdss_pll_trace.h: No such file or directory
|
||||
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
|
||||
```
|
||||
|
||||
Adding the full path fixes this.
|
||||
---
|
||||
drivers/clk/qcom/mdss/mdss_pll_trace.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/clk/qcom/mdss/mdss_pll_trace.h b/drivers/clk/qcom/mdss/mdss_pll_trace.h
|
||||
index cd4fda6c7d30..1c7225a46b23 100644
|
||||
--- a/drivers/clk/qcom/mdss/mdss_pll_trace.h
|
||||
+++ b/drivers/clk/qcom/mdss/mdss_pll_trace.h
|
||||
@@ -112,5 +112,5 @@ TRACE_EVENT(mdss_pll_trace_counter,
|
||||
|
||||
/* This part must be outside protection */
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/clk/qcom/mdss
|
||||
#include <trace/define_trace.h>
|
||||
--
|
||||
2.17.1
|
||||
|
5416
device/linux-google-crosshatch/config-google-crosshatch.aarch64
Normal file
5416
device/linux-google-crosshatch/config-google-crosshatch.aarch64
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,34 @@
|
|||
From 9eb681bb5e4166553fee08c2ff2aebae76f0e727 Mon Sep 17 00:00:00 2001
|
||||
From: Zhuowei Zhang <linux@worthdoingbadly.com>
|
||||
Date: Sat, 8 Dec 2018 00:42:49 -0800
|
||||
Subject: [PATCH] init: ignore dm= parameter
|
||||
|
||||
The commit "CHROMIUM: dm: boot time specification of dm="
|
||||
(a058da83727d9f3df84c956d9b29d775a2a9d45f) added a new boot
|
||||
parameter for specifying dm partitions. This breaks postmarketOS's
|
||||
root partition mounting.
|
||||
|
||||
Change the boot parameter to something the bootloader doesn't know
|
||||
about.
|
||||
|
||||
Thanks to opendata26 for figuring this out.
|
||||
---
|
||||
init/do_mounts_dm.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/init/do_mounts_dm.c b/init/do_mounts_dm.c
|
||||
index 7760705faffe..628b6a0c66d8 100644
|
||||
--- a/init/do_mounts_dm.c
|
||||
+++ b/init/do_mounts_dm.c
|
||||
@@ -459,7 +459,7 @@ static void __init dm_setup_drives(void)
|
||||
dm_setup_cleanup(devices);
|
||||
}
|
||||
|
||||
-__setup("dm=", dm_setup);
|
||||
+__setup("dm_IGNORE=", dm_setup);
|
||||
|
||||
void __init dm_run_setup(void)
|
||||
{
|
||||
--
|
||||
2.17.1
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
From 75dedb7524818dfa9904417fe1e5ac0c40291d89 Mon Sep 17 00:00:00 2001
|
||||
From: Zhuowei Zhang <linux@worthdoingbadly.com>
|
||||
Date: Tue, 27 Nov 2018 14:24:17 -0800
|
||||
Subject: [PATCH 2/2] init: initramfs: disable do_skip_initramfs
|
||||
|
||||
On Android devices with A/B partition scheme, the initramfs is
|
||||
ignored when booting into the operating system. This breaks
|
||||
postmarketOS, which requires the initramfs.
|
||||
|
||||
This reverts the change so the initramfs is always used.
|
||||
|
||||
Based on a patch by erfanoabdi.
|
||||
---
|
||||
init/initramfs.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/init/initramfs.c b/init/initramfs.c
|
||||
index bf3af10c500a..34af892143b2 100644
|
||||
--- a/init/initramfs.c
|
||||
+++ b/init/initramfs.c
|
||||
@@ -622,11 +622,13 @@ static int __init populate_rootfs(void)
|
||||
{
|
||||
char *err;
|
||||
|
||||
+ /*
|
||||
if (do_skip_initramfs) {
|
||||
if (initrd_start)
|
||||
free_initrd();
|
||||
return default_rootfs();
|
||||
}
|
||||
+ */
|
||||
|
||||
err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
|
||||
if (err)
|
||||
--
|
||||
2.17.1
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
From 6ffc61edfe8d986cd64eb85c2aa6e3ab86ecc720 Mon Sep 17 00:00:00 2001
|
||||
From: Zhuowei Zhang <linux@worthdoingbadly.com>
|
||||
Date: Mon, 10 Dec 2018 22:17:57 -0800
|
||||
Subject: [PATCH] sec_ts: disable touchscreen firmware upgrade
|
||||
|
||||
The firmware upgrade function causes two issues on postmarketOS:
|
||||
|
||||
- USB breaks if the driver is built directly into the kernel.
|
||||
- 60 second boot delay if the driver is built as a module, then loaded
|
||||
in the initramfs without the firmware file.
|
||||
|
||||
Disable the firmware upgrade functionality to avoid these problems.
|
||||
|
||||
This patch is based on TWRP's patch by bigbiff and SultanXDA:
|
||||
|
||||
https://github.com/TeamWin/android_kernel_google_crosshatch/commit/52654c7693f2d10b12803ab1f757a217936982ad
|
||||
---
|
||||
drivers/input/touchscreen/sec_ts/sec_ts.c | 2 +-
|
||||
drivers/input/touchscreen/sec_ts/sec_ts.h | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/input/touchscreen/sec_ts/sec_ts.c b/drivers/input/touchscreen/sec_ts/sec_ts.c
|
||||
index 2f76de3df874..5813a444c813 100644
|
||||
--- a/drivers/input/touchscreen/sec_ts/sec_ts.c
|
||||
+++ b/drivers/input/touchscreen/sec_ts/sec_ts.c
|
||||
@@ -2339,7 +2339,7 @@ static void sec_ts_read_info_work(struct work_struct *work)
|
||||
input_log_fix();
|
||||
}
|
||||
|
||||
-static void sec_ts_fw_update_work(struct work_struct *work)
|
||||
+static void __maybe_unused sec_ts_fw_update_work(struct work_struct *work)
|
||||
{
|
||||
struct sec_ts_data *ts = container_of(work, struct sec_ts_data,
|
||||
work_fw_update);
|
||||
diff --git a/drivers/input/touchscreen/sec_ts/sec_ts.h b/drivers/input/touchscreen/sec_ts/sec_ts.h
|
||||
index be99d36b426e..2e564dd3eb58 100644
|
||||
--- a/drivers/input/touchscreen/sec_ts/sec_ts.h
|
||||
+++ b/drivers/input/touchscreen/sec_ts/sec_ts.h
|
||||
@@ -125,7 +125,7 @@
|
||||
#define SEC_TS_FW_HEADER_SIGN 0x53494654
|
||||
#define SEC_TS_FW_CHUNK_SIGN 0x53434654
|
||||
|
||||
-#define SEC_TS_FW_UPDATE_ON_PROBE
|
||||
+//#define SEC_TS_FW_UPDATE_ON_PROBE
|
||||
|
||||
#define AMBIENT_CAL 0
|
||||
#define OFFSET_CAL_SDC 1
|
||||
--
|
||||
2.17.1
|
||||
|
Loading…
Reference in a new issue