samsung-gta7litewifi: new device (MR 4627)

[ci:skip-build] already built successfully in CI
This commit is contained in:
hexaheximal 2023-12-13 00:03:04 -05:00 committed by Clayton Craft
parent 865a0c2e54
commit 4daab00319
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
8 changed files with 6181 additions and 0 deletions

View file

@ -0,0 +1,30 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-gta7litewifi
pkgdesc="Samsung Galaxy Tab A7 Lite"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-samsung-gta7litewifi
mkbootimg
postmarketos-base
"
makedepends="devicepkg-dev"
source="
deviceinfo
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="
2008c6bf8567f72f0dd8bc93d807fe9857a1ea16ebb3f26f5a886fa6b487379579e373adb537cc28439ce39c6a88dc89be8ffbb22d168c977b6bbaf7ae579d34 deviceinfo
"

View 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="Samsung Galaxy Tab A7 Lite"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-gta7litewifi"
deviceinfo_year="2021"
deviceinfo_dtb="mediatek/mt6765"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="tablet"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="800"
deviceinfo_screen_height="1340"
# Bootloader related
deviceinfo_flash_method="mtkclient"
deviceinfo_kernel_cmdline="bootopt=64S3,32N2,64N2 androidboot.tag=TabA7lite_Huaqin_BSP_20210408174009 loop.max_part=7"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="2048"
deviceinfo_header_version="2"
deviceinfo_append_dtb="false"
deviceinfo_flash_offset_dtb="0x07808000"
deviceinfo_flash_offset_base="0x40078000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x11a88000"
deviceinfo_flash_offset_second="0xbff88000"
deviceinfo_flash_offset_tags="0x07808000"

View file

@ -0,0 +1,88 @@
# Reference: <https://postmarketos.org/vendorkernel>
pkgname=linux-samsung-gta7litewifi
pkgver=4.19.191
pkgrel=0
pkgdesc="Samsung Galaxy Tab A7 Lite kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="samsung-gta7litewifi"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
android-tools
bash
bc
bison
devicepkg-dev
findutils
flex
openssl-dev
perl
linux-headers
cpio
gzip
xz
"
# Source
_repository="kernel_samsung_gta7litewifi"
_commit="d7b62c296e4b021c1d3d278034038518a5d88d8c"
_config="config-$_flavor.$arch"
source="
$_repository-$_commit.tar.gz::https://codeberg.org/lowendlibre/kernel_samsung_gta7litewifi/archive/d7b62c296e4b021c1d3d278034038518a5d88d8c.tar.gz
$_config
fix_hardcoded_toolchain.patch
fix_broken_inline_functions.patch
fix_broken_assert_check.patch
fix_struct_names.patch
"
builddir="$srcdir/$_repository"
_outdir="out"
prepare() {
default_prepare
REPLACE_GCCH=0 . downstreamkernel_prepare
}
build() {
unset LDFLAGS
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
# Gzipping the kernel, not as an unpacker program, but as a real gzip archive, is required for it to boot.
# And because of that, we need to remove the uncompressed kernel and replace it with the compressed kernel.
# If you do not do that, you will get a bootloader error like this while trying to boot it:
# [5349] panic (caller 0x48037667): [5349] decompress kernel image fail!!!
if [ -f "$_outdir"/arch/arm64/boot/Image ]
then
rm "$_outdir"/arch/arm64/boot/Image
fi
mv "$_outdir"/arch/arm64/boot/Image.gz "$_outdir"/arch/arm64/boot/Image
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" \
"$_flavor" "$_outdir"
make dtbs_install O="$_outdir" ARCH="$_carch" \
INSTALL_DTBS_PATH="$pkgdir"/boot/dtbs
# We also need to convert the kernel DTB into a proper android dtb image with the 64-byte header
mv "$pkgdir"/boot/dtbs/mediatek/mt6765.dtb "$pkgdir"/boot/dtbs/mediatek/mt6765.dtb.bak
mkdtboimg create "$pkgdir"/boot/dtbs/mediatek/mt6765.dtb "$pkgdir"/boot/dtbs/mediatek/mt6765.dtb.bak
rm "$pkgdir"/boot/dtbs/mediatek/mt6765.dtb.bak
}
sha512sums="
f05a92b19cd521f62f0cac1fcd28405f3e85f3f8edb34ec483ef099f467536fc85baa9734a4f050ca966742a0c1ca651809768405315ea452104ce9817d33dd7 kernel_samsung_gta7litewifi-d7b62c296e4b021c1d3d278034038518a5d88d8c.tar.gz
602e848744624b972cd14fd4f968fd71faf9b202590d514fd3be3223cf6d5244ef328988f233dce6c3465195544c05ed73a51ca5c8e11d7a3e715f971627dcae config-samsung-gta7litewifi.aarch64
d6982a5b955e470ebf99330c391ef8269c0d0c3b54a63e49701eef6031cab5095968ba256eb908832a896ff29498ca2aa7f73771aea5837295aae3ff0cff4001 fix_hardcoded_toolchain.patch
3c45e4748b03164b88780f20a86e21a79e81e5486a0d380226382c5ae40a23a36bd6ccfab4ed221b54a30015203e9ab22ea6876b7c6e166cf6b0c4bc6574ea79 fix_broken_inline_functions.patch
b63051f0a6114827ce4378d59e0eca96f4c9d9d78a105b79ebb6ddc1cb317e908b15a6538414b4f2cac79a066168478868987c1dfc40715b1db9f646513d530b fix_broken_assert_check.patch
f3b85bad2186b5c23177856432c97f08dcb0220e9e68ce14bcab8ab9b6c7b484c6299d8e2610c912dbb8b16a9a70f94d32c03ff6f5284c95a20c22a17ed15409 fix_struct_names.patch
"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,34 @@
--- a/drivers/misc/mediatek/lcm/mt65xx_lcm_list.c
+++ b/drivers/misc/mediatek/lcm/mt65xx_lcm_list.c
@@ -1513,29 +1513,20 @@
#endif
};
-#define LCM_COMPILE_ASSERT(condition) \
- LCM_COMPILE_ASSERT_X(condition, __LINE__)
-#define LCM_COMPILE_ASSERT_X(condition, line) \
- LCM_COMPILE_ASSERT_XX(condition, line)
-#define LCM_COMPILE_ASSERT_XX(condition, line) \
- char assertion_failed_at_line_##line[(condition) ? 1 : -1]
-
-
/*hs14 code for AL6528A-20 by duanyaoming at 20220906 start*/
#ifdef CONFIG_HQ_PROJECT_O22
unsigned int lcm_count =
sizeof(o22_lcm_driver_list) / sizeof(struct LCM_DRIVER *);
-LCM_COMPILE_ASSERT(sizeof(o22_lcm_driver_list) / sizeof(struct LCM_DRIVER *) != 0);
+
/*hs14 code for AL6528A-20 by duanyaoming at 20220906 end*/
/*hs04 code for DEAL6398A-1875 by zhawei at 20221017 start*/
#elif defined CONFIG_HQ_PROJECT_HS04
unsigned int lcm_count = sizeof(hs04_lcm_driver_list) / sizeof(struct LCM_DRIVER *);
-LCM_COMPILE_ASSERT(sizeof(hs04_lcm_driver_list) / sizeof(struct LCM_DRIVER *) != 0);
+
/*hs04 code for DEAL6398A-1875 by zhawei at 20221017 end*/
#else
unsigned int lcm_count =
sizeof(lcm_driver_list) / sizeof(struct LCM_DRIVER *);
-LCM_COMPILE_ASSERT(sizeof(lcm_driver_list) / sizeof(struct LCM_DRIVER *) != 0);
#endif
#if defined(NT35520_HD720_DSI_CMD_TM) | \

View file

@ -0,0 +1,41 @@
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2362,7 +2362,7 @@
extern struct mutex uclamp_mutex;
unsigned long uclamp_eff_value(struct task_struct *p, enum uclamp_id clamp_id);
-inline void uclamp_se_set(struct uclamp_se *uc_se,
+void uclamp_se_set(struct uclamp_se *uc_se,
unsigned int value, bool user_defined);
void
uclamp_update_active_tasks(struct cgroup_subsys_state *css,
--- a/include/linux/blk-crypto.h
+++ b/include/linux/blk-crypto.h
@@ -30,7 +30,7 @@
int blk_crypto_evict_key(struct request_queue *q,
const struct blk_crypto_key *key);
-inline void blk_crypto_flock(struct keyslot_manager *ksm, unsigned int flags);
+void blk_crypto_flock(struct keyslot_manager *ksm, unsigned int flags);
#else /* CONFIG_BLK_INLINE_ENCRYPTION */
@@ -45,7 +45,7 @@
return true;
}
-static inline void blk_crypto_flock(struct keyslot_manager *ksm,
+static void blk_crypto_flock(struct keyslot_manager *ksm,
unsigned int flags) {}
#endif /* CONFIG_BLK_INLINE_ENCRYPTION */
--- a/include/linux/keyslot-manager.h
+++ b/include/linux/keyslot-manager.h
@@ -98,7 +98,7 @@
unsigned int wrapped_key_size,
u8 *secret, unsigned int secret_size);
-inline void ksm_flock(struct keyslot_manager *ksm, unsigned int flags);
+void ksm_flock(struct keyslot_manager *ksm, unsigned int flags);
#endif /* CONFIG_BLK_INLINE_ENCRYPTION */

View file

@ -0,0 +1,49 @@
--- a/Makefile
+++ b/Makefile
@@ -319,8 +319,7 @@
# Alternatively CROSS_COMPILE can be set in the environment.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
-ARCH ?= arm64
-CROSS_COMPILE ?= $(srctree)/toolchain/clang/host/linux-x86/clang-r383902/bin/aarch64-linux-gnu-
+ARCH ?= $(SUBARCH)
# Architecture as present in compile.h
UTS_MACHINE := $(ARCH)
@@ -386,7 +385,7 @@
OBJSIZE = llvm-size
STRIP = llvm-strip
else
-CC = $(srctree)/toolchain/clang/host/linux-x86/clang-r383902/bin/clang
+CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
AR = $(CROSS_COMPILE)ar
NM = $(CROSS_COMPILE)nm
--- a/kernel/gen_kheaders.sh
+++ b/kernel/gen_kheaders.sh
@@ -8,7 +8,6 @@
outdir="$(pwd)"
tarfile=$1
cpio_dir=$outdir/$tarfile.tmp
-cpio=$KBUILD_SRC/tools/build/cpio
dir_list="
include/
@@ -59,7 +58,7 @@
pushd $srctree > /dev/null
for f in $dir_list;
do find "$f" -name "*.h";
-done | $cpio --quiet -pd $cpio_dir
+done | cpio --quiet -pd $cpio_dir
popd > /dev/null
@@ -67,7 +66,7 @@
# happen with out of tree builds. Just silence CPIO for now.
for f in $dir_list;
do find "$f" -name "*.h";
-done | $cpio --quiet -pd $cpio_dir >/dev/null 2>&1
+done | cpio --quiet -pd $cpio_dir >/dev/null 2>&1
# Remove comments except SDPX lines

View file

@ -0,0 +1,21 @@
--- a/drivers/staging/android/mtk_ion/mtk/ion_drv.h
+++ b/drivers/staging/android/mtk_ion/mtk/ion_drv.h
@@ -10,6 +10,8 @@
#include <ion.h>
+#define ion_phys_addr_t phys_addr_t
+
#define BACKTRACE_SIZE 10
#define ION_RECORD_TOTAL_SIZE_SUPPORT
--- a/drivers/staging/android/mtk_ion/ion.h
+++ b/drivers/staging/android/mtk_ion/ion.h
@@ -181,6 +181,6 @@
* holding a reference.
*/
int ion_phys(struct ion_client *client, struct ion_handle *handle,
- ion_phys_addr_t *addr, size_t *len);
+ phys_addr_t *addr, size_t *len);
#endif /* _LINUX_ION_H */