oneplus-kebab: new device (MR 2420)

[ci:skip-build] already built successfully in CI
This commit is contained in:
afeuerstein 2021-08-09 21:46:34 +02:00 committed by Clayton Craft
parent c15140f695
commit c96633004a
No known key found for this signature in database
GPG key ID: 7A3461CA187CEA54
12 changed files with 6743 additions and 0 deletions

View file

@ -0,0 +1,43 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-oneplus-kebab
pkgdesc="OnePlus 8T"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-oneplus-kebab
mesa-dri-gallium
mkbootimg
postmarketos-base
"
makedepends="devicepkg-dev"
subpackages="$pkgname-weston"
source="
deviceinfo
weston.ini
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
weston() {
install_if="$pkgname weston"
# weston use drm backend, 2x dpi, don't use virtual output
install -Dm644 "$srcdir"/weston.ini \
"$subpkgdir"/etc/xdg/weston/weston.ini
}
sha512sums="
4847d72bf7364f4d5565f28d6f79a2b4566e63cc735e4614a86743f7c28c133be0b2dcae5febe03bb546cd897c912ec32cace35cd08be1a606eb081ee9f5129a deviceinfo
4fdc188f9cd5c0316959322568916a6e36e67ff316e90fa7bd7c7b642cb137a9ff7002b0475728c6ba53abcbfe8c50d82112e4943460ee424aee4bbfd0efecfe weston.ini
"

View file

@ -0,0 +1,39 @@
# 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 8T"
deviceinfo_manufacturer="OnePlus"
deviceinfo_codename="oneplus-kebab"
deviceinfo_year="2020"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="false"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="2400"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x237 service_locator.enable=1 androidboot.usbcontroller=a600000.dwc3 swiotlb=2048 loop.max_part=7 cgroup.memory=nokmem,nosocket reboot=panic_warm"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="4096"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0x00000000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_rootfs_image_sector_size="4096"
deviceinfo_flash_fastboot_partition_system="super"
deviceinfo_flash_fastboot_partition_dtbo="dtbo"
# pmOS related
deviceinfo_no_framebuffer="true"

View file

@ -0,0 +1,16 @@
[core]
xwayland=true
backend=drm-backend.so
idle-time=0
[shell]
background-image=/usr/share/wallpapers/postmarketos.jpg
[output]
name=DSI-1
mode=preferred
scale=2
[output]
name=Virtual-1
mode=off

View file

@ -0,0 +1,96 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: extracted from LineageOS. a similar (working) config can be found at arch/arm64/configs/vendor/kona-perf_defconfig
pkgname=linux-oneplus-kebab
pkgver=4.19.110
pkgrel=0
pkgdesc="OnePlus 8T kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="oneplus-kebab"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
android-mkdtimg
bash
bc
bison
devicepkg-dev
dtc
flex
linux-headers
openssl-dev
perl
xz
"
# Source
_repository="android_kernel_oneplus_sm8250"
_commit="0c1bed1067131a0bd3e56c1cbdd3473606c5a48a"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/$_repository/archive/$_commit.tar.gz
$_config
linux4.17-gcc10-extern_YYLOC_global_declaration.patch
Remove-gcc-python-wrapper.patch
Remove-dangerous-flags.patch
Remove-inline-from-external-functions.patch
Suppress-error-about-static-buffer-overflow.patch
Fix-dangerous-relocation.patch
Fix-touchscreen-driver.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
prepare() {
default_prepare
REPLACE_GCCH=0
. downstreamkernel_prepare
}
build() {
unset LDFLAGS
make O="$_outdir" DTC_EXT="/usr/bin/dtc" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
downstreamkernel_package \
"$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
dtbodir="$builddir/$_outdir/arch/arm64/boot/dts/vendor/qcom"
mkdtimg create "$pkgdir/boot/dtbo.img" --page_size=4096 \
"$dtbodir/kebab-overlay.dtbo" \
"$dtbodir/instantnoodle-overlay-dvt.dtbo" \
"$dtbodir/instantnoodle-overlay-evt1.dtbo" \
"$dtbodir/instantnoodle-overlay-t0.dtbo" \
"$dtbodir/instantnoodlep-overlay-dvt.dtbo" \
"$dtbodir/instantnoodlep-overlay-evb.dtbo" \
"$dtbodir/instantnoodlep-overlay-evt1.dtbo" \
"$dtbodir/instantnoodlep-overlay-t0.dtbo" \
"$dtbodir/instantnoodlev-overlay-dvt.dtbo" \
"$dtbodir/instantnoodlev-overlay-evt1.dtbo" \
"$dtbodir/instantnoodlev-overlay-t0.dtbo"
install -Dm644 "$_outdir/arch/arm64/boot/Image-dtb" \
"$pkgdir/boot/vmlinuz-$_flavor"
make O="$_outdir" \
ARCH="$_carch" \
INSTALL_MOD_STRIP=1 \
INSTALL_MOD_PATH="$pkgdir" \
modules_install
}
sha512sums="
146dc2c324e3985a3347419e624db61aec26e121729c768fbabea56852153cf9d81eb4f070524631e78ea5f8987cd52fd9f356e777f3a557bc91008cab11013c linux-oneplus-kebab-0c1bed1067131a0bd3e56c1cbdd3473606c5a48a.tar.gz
6c8db0f96eb7efe9413af197e80e9151fa06bafc99fa816c4141dec975f562b31423816aeaa1d071ca437f23640078c6af6f9c0c905f2ed628c4655276e48ad8 config-oneplus-kebab.aarch64
27827877040007fc1c4c719f7e2e19e5c272d44972415cfc53feba0313d87e4074f8204bdb13cbc5fe21ea61bf595314b68f10c081e7b7bac3c888b60f008acf linux4.17-gcc10-extern_YYLOC_global_declaration.patch
359f619b7aac5bab061311f0806018ed04ce96a2233584a507b14c50ce616dfbc1681dd465ca3f0182165a6fc6c7b87435615bd1bd93efe174b95deba071f5fc Remove-gcc-python-wrapper.patch
74a98e0719e5f7f0741eb5760c2f8e4bdce7cfc2880d5c203bcaa0140ad8ca5ca1484b543230227406ec197c5da3e7b2c652a21816237473a762a7031c1faf84 Remove-dangerous-flags.patch
aba7ae12986a2df81c6993f369390c6b3f5586fa70ab747e03d59aaf08cb79482a44eab723aed4469e98cadea0f70912f4e67caaf67cc279e1dc85e485b93a0f Remove-inline-from-external-functions.patch
4e7a73a1c6e8424a34d317899525ca3d783de1a5e65cc0ecdf6334bbb233d165b476107e599cbd86868ed91a5a60d2ef0eff975861d61cb2c403b572314b4a94 Suppress-error-about-static-buffer-overflow.patch
39007dd285b502633c7bbf398acd6841a14fb6f5e0a3ad8570d31be77763b537b2352401701d67c53d36ddbf4068ee32446bf3b4ef9aa20c39f052ca491d2be4 Fix-dangerous-relocation.patch
56abd497ce82b40b8669476bd6522813e832944e5a96362fc162c5acd97eeab642778c5d3e70ca7aeac1ce61781cb700d63157da244dff04ab4863887e32bef0 Fix-touchscreen-driver.patch
"

View file

@ -0,0 +1,39 @@
From 8ad6ace96fbe7aba0846872cb18120b76a505bf5 Mon Sep 17 00:00:00 2001
From: Iskren Chernev <me@iskren.info>
Date: Thu, 18 Feb 2021 15:05:50 +0200
Subject: [PATCH 2/6] Fix dangerous relocation
Without this fix the linker complains:
WARNING: EXPORT symbol "gsi_write_channel_scratch" [vmlinux] version generation failed, symbol will not be versioned.
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: drivers/platform/msm/gsi/gsi.o: relocation R_AARCH64_ABS32 against `__crc_gsi_write_channel_scratch' can not be used when making a shared object
drivers/platform/msm/gsi/gsi.o:(.data+0x0): dangerous relocation: unsupported relocation
drivers/platform/msm/gsi/gsi.o:(.data+0x28): dangerous relocation: unsupported relocation
drivers/platform/msm/gsi/gsi.o:(.data+0x50): dangerous relocation: unsupported relocation
make[1]: *** [/home/iskren/src/pmos/android_kernel_samsung_msm8974/Makefile:1124: vmlinux] Error 1
The problem is actually that genksyms doesn't understand __packed in
function return type.
Signed-off-by: Iskren Chernev <me@iskren.info>
---
drivers/platform/msm/gsi/gsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/msm/gsi/gsi.c b/drivers/platform/msm/gsi/gsi.c
index 391ff6f0325c0..793d253442f36 100644
--- a/drivers/platform/msm/gsi/gsi.c
+++ b/drivers/platform/msm/gsi/gsi.c
@@ -2620,7 +2620,7 @@ static void __gsi_read_channel_scratch(unsigned long chan_hdl,
gsi_ctx->per.ee));
}
-static union __packed gsi_channel_scratch __gsi_update_mhi_channel_scratch(
+static union gsi_channel_scratch __gsi_update_mhi_channel_scratch(
unsigned long chan_hdl, struct __packed gsi_mhi_channel_scratch mscr)
{
union __packed gsi_channel_scratch scr;
--
2.30.1

View file

@ -0,0 +1,22 @@
From 91b2569e0aa7632f228d2591e3365430cd83b7a7 Mon Sep 17 00:00:00 2001
From: Alexandros Feuerstein <32029275+afeuerstein@users.noreply.github.com>
Date: Sun, 8 Aug 2021 20:57:59 +0200
Subject: [PATCH] Update touchpanel_common_driver.c
---
drivers/oneplus/input/touchscreen/touchpanel_common_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/oneplus/input/touchscreen/touchpanel_common_driver.c b/drivers/oneplus/input/touchscreen/touchpanel_common_driver.c
index 4d7fbedf0fd4..8a24c6906d60 100644
--- a/drivers/oneplus/input/touchscreen/touchpanel_common_driver.c
+++ b/drivers/oneplus/input/touchscreen/touchpanel_common_driver.c
@@ -4156,7 +4156,7 @@ static int init_input_device(struct touchpanel_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_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,25 @@
From 04672e4f79acfb7fb2c7779573c8c769013e88dc Mon Sep 17 00:00:00 2001
From: Alexandros Feuerstein <32029275+afeuerstein@users.noreply.github.com>
Date: Tue, 13 Jul 2021 02:00:31 +0200
Subject: [PATCH] Update Makefile
---
arch/arm64/Makefile | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index c0ad8588b140..86036baab29c 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -49,11 +49,6 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable)
endif
endif
-ifeq ($(cc-name),clang)
-KBUILD_CFLAGS += -mno-implicit-float
-else
-KBUILD_CFLAGS += -mgeneral-regs-only
-endif
KBUILD_CFLAGS += $(lseinstr) $(brokengasinst)
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)

View file

@ -0,0 +1,36 @@
From 966d3ac2409b59f431e1397f5ab8e9ee74ba5ae0 Mon Sep 17 00:00:00 2001
From: Iskren Chernev <me@iskren.info>
Date: Sat, 20 Feb 2021 00:49:45 +0200
Subject: [PATCH 3/6] Remove gcc python wrapper
---
Makefile | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 15a18b3cd15f6..e6a72c1a84fe9 100644
--- a/Makefile
+++ b/Makefile
@@ -370,7 +370,7 @@ KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
# Make variables (CC, etc...)
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
-REAL_CC = $(CROSS_COMPILE)gcc
+CC = $(CROSS_COMPILE)gcc
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
NM = $(CROSS_COMPILE)nm
@@ -389,10 +389,6 @@ PYTHON2 = python2
PYTHON3 = python3
CHECK = sparse
-# Use the wrapper for the compiler. This wrapper scans for new
-# warnings and causes the build to stop upon encountering them
-CC = $(PYTHON) $(srctree)/scripts/gcc-wrapper.py $(REAL_CC)
-
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
NOSTDINC_FLAGS =
--
2.30.1

View file

@ -0,0 +1,51 @@
From c9b57d68eb48b1f9626e82d45313466b4b3e4a15 Mon Sep 17 00:00:00 2001
From: Iskren Chernev <me@iskren.info>
Date: Mon, 22 Feb 2021 19:23:15 +0200
Subject: [PATCH 5/6] Remove inline from external functions
Signed-off-by: Iskren Chernev <me@iskren.info>
---
fs/f2fs/f2fs.h | 4 ++--
fs/f2fs/segment.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 76f02a621ed95..016be262190d2 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -3802,8 +3802,8 @@ static inline bool is_journalled_quota(struct f2fs_sb_info *sbi)
extern int f2fs_odiscard_enable;
-extern inline void wake_up_odiscard_of2fs(struct f2fs_sb_info *sbi);
-extern inline void wake_up_otrim_of2fs(struct f2fs_sb_info *sbi);
+extern void wake_up_odiscard_of2fs(struct f2fs_sb_info *sbi);
+extern void wake_up_otrim_of2fs(struct f2fs_sb_info *sbi);
enum {
F2FS_TRIM_START,
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index bbd60419054f5..f8c95e94a58c1 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -5167,7 +5167,7 @@ static int select_discard_type_of2fs(struct f2fs_sb_info *sbi, int expect_discar
return DPOLICY_BG;
}
-inline void wake_up_odiscard_of2fs(struct f2fs_sb_info *sbi)
+void wake_up_odiscard_of2fs(struct f2fs_sb_info *sbi)
{
struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
@@ -5178,7 +5178,7 @@ inline void wake_up_odiscard_of2fs(struct f2fs_sb_info *sbi)
}
-inline void wake_up_otrim_of2fs(struct f2fs_sb_info *sbi)
+void wake_up_otrim_of2fs(struct f2fs_sb_info *sbi)
{
struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
--
2.30.1

View file

@ -0,0 +1,22 @@
From e950e514cd6b45f8d1512eef1c959769183caf56 Mon Sep 17 00:00:00 2001
From: Alexandros Feuerstein <32029275+afeuerstein@users.noreply.github.com>
Date: Tue, 13 Jul 2021 11:19:58 +0200
Subject: [PATCH] Update ipa_hw_stats.c
---
drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c b/drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c
index 1b900a27173b..d1e40689709a 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_hw_stats.c
@@ -2253,7 +2253,7 @@ static ssize_t ipa_debugfs_enable_disable_drop_stats(struct file *file,
goto bail;
}
- missing = copy_from_user(dbg_buff, ubuf, count);
+ missing = _copy_from_user(dbg_buff, ubuf, count);
if (missing) {
ret = -EFAULT;
goto bail;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
../../.shared-patches/linux/linux4.17-gcc10-extern_YYLOC_global_declaration.patch