samsung-j7elte: new device (Samsung Galaxy J7) (MR 3715)
[ci:skip-build] already built successfully in CI
This commit is contained in:
parent
fd90572c61
commit
891109adce
10 changed files with 4318 additions and 0 deletions
28
device/testing/device-samsung-j7elte/APKBUILD
Normal file
28
device/testing/device-samsung-j7elte/APKBUILD
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# Reference: <https://postmarketos.org/devicepkg>
|
||||||
|
pkgname=device-samsung-j7elte
|
||||||
|
pkgdesc="Samsung Galaxy J7"
|
||||||
|
pkgver=0.1
|
||||||
|
pkgrel=0
|
||||||
|
url="https://postmarketos.org"
|
||||||
|
license="MIT"
|
||||||
|
arch="aarch64"
|
||||||
|
options="!check !archcheck"
|
||||||
|
depends="
|
||||||
|
linux-samsung-j7elte
|
||||||
|
mkbootimg
|
||||||
|
postmarketos-base
|
||||||
|
"
|
||||||
|
makedepends="devicepkg-dev"
|
||||||
|
source="deviceinfo"
|
||||||
|
|
||||||
|
build() {
|
||||||
|
devicepkg_build $startdir $pkgname
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
devicepkg_package $startdir $pkgname
|
||||||
|
}
|
||||||
|
|
||||||
|
sha512sums="
|
||||||
|
c5fae735cfa092040dc9028649fe043bb76c3faeb0fd7ad60cba6164dea03b95421c6171f2d4f3a73b607ebba77146ba257cc6aef13b1a89aaccdbf46bd4bac9 deviceinfo
|
||||||
|
"
|
32
device/testing/device-samsung-j7elte/deviceinfo
Normal file
32
device/testing/device-samsung-j7elte/deviceinfo
Normal 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="Samsung Galaxy J7"
|
||||||
|
deviceinfo_manufacturer="Samsung"
|
||||||
|
deviceinfo_codename="samsung-j7elte"
|
||||||
|
deviceinfo_year="2015"
|
||||||
|
deviceinfo_arch="aarch64"
|
||||||
|
|
||||||
|
# Device related
|
||||||
|
deviceinfo_chassis="handset"
|
||||||
|
deviceinfo_keyboard="false"
|
||||||
|
deviceinfo_external_storage="true"
|
||||||
|
deviceinfo_screen_width="720"
|
||||||
|
deviceinfo_screen_height="1280"
|
||||||
|
|
||||||
|
# Bootloader related
|
||||||
|
deviceinfo_flash_method="heimdall-bootimg"
|
||||||
|
deviceinfo_generate_bootimg="true"
|
||||||
|
deviceinfo_bootimg_qcdt="true"
|
||||||
|
deviceinfo_bootimg_mtk_mkimage="false"
|
||||||
|
deviceinfo_bootimg_dtb_second="false"
|
||||||
|
deviceinfo_flash_pagesize="2048"
|
||||||
|
deviceinfo_flash_offset_base="0x10000000"
|
||||||
|
deviceinfo_flash_offset_kernel="0x00008000"
|
||||||
|
deviceinfo_flash_offset_ramdisk="0x11000000"
|
||||||
|
deviceinfo_flash_offset_second="0x00f00000"
|
||||||
|
deviceinfo_flash_offset_tags="0x10000100"
|
||||||
|
deviceinfo_flash_heimdall_partition_kernel="BOOT"
|
||||||
|
deviceinfo_flash_heimdall_partition_system="SYSTEM"
|
74
device/testing/linux-samsung-j7elte/APKBUILD
Normal file
74
device/testing/linux-samsung-j7elte/APKBUILD
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
# Reference: <https://postmarketos.org/vendorkernel>
|
||||||
|
# Kernel config based on: arch/arm64/configs/defconfig
|
||||||
|
|
||||||
|
pkgname=linux-samsung-j7elte
|
||||||
|
pkgver=3.10.108
|
||||||
|
pkgrel=0
|
||||||
|
pkgdesc="Samsung Galaxy J7 kernel fork"
|
||||||
|
arch="aarch64"
|
||||||
|
_carch="arm64"
|
||||||
|
_flavor="samsung-j7elte"
|
||||||
|
url="https://kernel.org"
|
||||||
|
license="GPL-2.0-only"
|
||||||
|
options="!strip !check !tracedeps pmb:cross-native"
|
||||||
|
makedepends="
|
||||||
|
bash
|
||||||
|
bc
|
||||||
|
bison
|
||||||
|
devicepkg-dev
|
||||||
|
dtbtool-exynos
|
||||||
|
flex
|
||||||
|
openssl-dev
|
||||||
|
perl
|
||||||
|
linux-headers
|
||||||
|
"
|
||||||
|
|
||||||
|
# Source
|
||||||
|
_repository="android_kernel_samsung_universal7580"
|
||||||
|
_commit="2a746c1bc1a41eae05988c153f527c8a5dc72d07"
|
||||||
|
_config="config-$_flavor.$arch"
|
||||||
|
source="
|
||||||
|
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/$_repository/archive/$_commit.tar.gz
|
||||||
|
$_config
|
||||||
|
gcc8-fix-put-user.patch
|
||||||
|
gcc10-extern_YYLOC_global_declaration.patch
|
||||||
|
fix-vmm-blob-include.patch
|
||||||
|
create-a-file-platform.h-which-is-a-symlink.patch
|
||||||
|
fix-argb.patch
|
||||||
|
samsung-usb-ethaddr.patch
|
||||||
|
"
|
||||||
|
builddir="$srcdir/$_repository-$_commit"
|
||||||
|
_outdir="out"
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
default_prepare
|
||||||
|
. downstreamkernel_prepare
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
unset LDFLAGS
|
||||||
|
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
|
||||||
|
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
|
||||||
|
|
||||||
|
# Master DTB (deviceinfo_bootimg_qcdt)
|
||||||
|
dtbTool-exynos -o "$_outdir/arch/$_carch/boot"/dt.img \
|
||||||
|
$(find "$_outdir/arch/$_carch/boot/dts/" -name *j7elte*.dtb)
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" \
|
||||||
|
"$_flavor" "$_outdir"
|
||||||
|
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img \
|
||||||
|
"$pkgdir"/boot/dt.img
|
||||||
|
}
|
||||||
|
|
||||||
|
sha512sums="
|
||||||
|
b01b78378bb072ab42f6e2c0751a052b99b06c4516d32df4551d97614717be4a30c24ba0b8ddc3cb043b6f04b3c2d408ede490e48402d1ad497831bb0830dbe7 linux-samsung-j7elte-2a746c1bc1a41eae05988c153f527c8a5dc72d07.tar.gz
|
||||||
|
23e49e4993a98684717beaca7ea44f2cd4e0079460e573acc93237aa8b1d55115c72a22c0f16f3b8638c5b82ab57ea71ee8c043bf61d89f7cb190711e87d0156 config-samsung-j7elte.aarch64
|
||||||
|
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
|
||||||
|
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
|
||||||
|
23bf8ef0ad38b38ffa9ddfdee76a32c43b021169c6db6f5b733fd6434169f7c7bb27cdb1232be89475f34f9053211d943e13f5fba565c928256b92b18d636130 fix-vmm-blob-include.patch
|
||||||
|
b2b8020948dfa4dc24eec4402aa7c2845ba56e844b2cfb591b4326b372a7748063c9e67d54bf70d841141c7a9203c25766538522d1a6a08e3ca3b8054eface43 create-a-file-platform.h-which-is-a-symlink.patch
|
||||||
|
aff2f127c44de0fc3e523834766a5851b48ade0e5cd95f594b36fc17adf3fb0549c70e4cba34a4bbea272fca80d61e0f4615a7195662f38794a1cd96213c7ca2 fix-argb.patch
|
||||||
|
bfd0332076724bea2d10e96c81fae41eefb60bfc19f7a21ec849cf2a6b48e4cada694ed6b389ed600e182755d6fdb96f12dcbe81c8e691a2b4602f432fae165a samsung-usb-ethaddr.patch
|
||||||
|
"
|
4043
device/testing/linux-samsung-j7elte/config-samsung-j7elte.aarch64
Normal file
4043
device/testing/linux-samsung-j7elte/config-samsung-j7elte.aarch64
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,13 @@
|
||||||
|
Create a symlink to platform.h. Fixes errors regarding about a missing
|
||||||
|
platform.h file.
|
||||||
|
diff --git a/drivers/gud/gud-exynos7580/MobiCoreDriver/platform.h b/drivers/gud/gud-exynos7580/MobiCoreDriver/platform.h
|
||||||
|
new file mode 120000
|
||||||
|
index 00000000..526bc961
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/drivers/gud/gud-exynos7580/MobiCoreDriver/platform.h
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+platforms/EXYNOS_7580_STD/platform.h
|
||||||
|
\ No newline at end of file
|
||||||
|
--
|
||||||
|
2.32.0
|
||||||
|
|
19
device/testing/linux-samsung-j7elte/fix-argb.patch
Normal file
19
device/testing/linux-samsung-j7elte/fix-argb.patch
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
Based on Error1001's patch, 02-fix-video-argb-setting.patch
|
||||||
|
diff --git a/drivers/video/exynos/decon_7580/decon-int_drv.c b/drivers/video/exynos/decon_7580/decon-int_drv.c
|
||||||
|
index c37ec143..27375b6f 100755
|
||||||
|
--- a/drivers/video/exynos/decon_7580/decon-int_drv.c
|
||||||
|
+++ b/drivers/video/exynos/decon_7580/decon-int_drv.c
|
||||||
|
@@ -453,11 +453,11 @@ int decon_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
|
||||||
|
case 24:
|
||||||
|
/* our 24bpp is unpacked, so 32bpp */
|
||||||
|
var->bits_per_pixel = 32;
|
||||||
|
- var->red.offset = 16;
|
||||||
|
+ var->red.offset = 0;
|
||||||
|
var->red.length = 8;
|
||||||
|
var->green.offset = 8;
|
||||||
|
var->green.length = 8;
|
||||||
|
- var->blue.offset = 0;
|
||||||
|
+ var->blue.offset = 16;
|
||||||
|
var->blue.length = 8;
|
||||||
|
break;
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/init/_vmm.S b/init/_vmm.S
|
||||||
|
index b2ef92fa..1a1d898f 100755
|
||||||
|
--- a/init/_vmm.S
|
||||||
|
+++ b/init/_vmm.S
|
||||||
|
@@ -19,7 +19,7 @@
|
||||||
|
|
||||||
|
#include <linux/vmm.h>
|
||||||
|
|
||||||
|
-#define vmm_ELF_PATH "init/vmm.elf"
|
||||||
|
+#define vmm_ELF_PATH "../init/vmm.elf"
|
||||||
|
|
||||||
|
#define SMC_64BIT_RET_MAGIC 0xC2000401
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
Based on https://lkml.org/lkml/2020/4/1/1206. In original patch, YYLOC declaration was removed.
|
||||||
|
However, using original patch, which removes yylloc declaration on 3.18.14 kernel version results in 'yylloc not declared' error.
|
||||||
|
See part of the original description below:
|
||||||
|
|
||||||
|
gcc 10 will default to -fno-common, which causes this error at link
|
||||||
|
time:
|
||||||
|
|
||||||
|
(.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here
|
||||||
|
|
||||||
|
This is because both dtc-lexer as well as dtc-parser define the same
|
||||||
|
global symbol yyloc. Before with -fcommon those were merged into one
|
||||||
|
defintion. The proper solution would be to to mark this as "extern",
|
||||||
|
|
||||||
|
diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
|
||||||
|
index 3b41bfca636..9b9c29e6f31 100644
|
||||||
|
--- a/scripts/dtc/dtc-lexer.l
|
||||||
|
+++ b/scripts/dtc/dtc-lexer.l
|
||||||
|
@@ -39,7 +39,7 @@ LINECOMMENT "//".*\n
|
||||||
|
#include "srcpos.h"
|
||||||
|
#include "dtc-parser.tab.h"
|
||||||
|
|
||||||
|
-YYLTYPE yylloc;
|
||||||
|
+extern YYLTYPE yylloc;
|
||||||
|
|
||||||
|
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
|
||||||
|
#define YY_USER_ACTION \
|
||||||
|
diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
|
||||||
|
index 2d30f41778b..d0eb405cb81 100644
|
||||||
|
--- a/scripts/dtc/dtc-lexer.lex.c_shipped
|
||||||
|
+++ b/scripts/dtc/dtc-lexer.lex.c_shipped
|
||||||
|
@@ -637,7 +637,7 @@ char *yytext;
|
||||||
|
#include "srcpos.h"
|
||||||
|
#include "dtc-parser.tab.h"
|
||||||
|
|
||||||
|
-YYLTYPE yylloc;
|
||||||
|
+extern YYLTYPE yylloc;
|
||||||
|
|
||||||
|
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
|
||||||
|
#define YY_USER_ACTION \
|
39
device/testing/linux-samsung-j7elte/gcc8-fix-put-user.patch
Normal file
39
device/testing/linux-samsung-j7elte/gcc8-fix-put-user.patch
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
From 8c8187d41b99acd4f2078d0fff6807e0eeb47407 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Arnd Bergmann <arnd@arndb.de>
|
||||||
|
Date: Thu, 26 Jul 2018 10:13:23 +0200
|
||||||
|
Subject: [PATCH] ARM: fix put_user() for gcc-8
|
||||||
|
|
||||||
|
Building kernels before linux-4.7 with gcc-8 results in many build failures
|
||||||
|
when gcc triggers a check that was meant to catch broken compilers:
|
||||||
|
|
||||||
|
/tmp/ccCGMQmS.s:648: Error: .err encountered
|
||||||
|
|
||||||
|
According to the discussion in the gcc bugzilla, a local "register
|
||||||
|
asm()" variable is still supposed to be the correct way to force an
|
||||||
|
inline assembly to use a particular register, but marking it 'const'
|
||||||
|
lets the compiler do optimizations that break that, i.e the compiler is
|
||||||
|
free to treat the variable as either 'const' or 'register' in that case.
|
||||||
|
|
||||||
|
Upstream commit 9f73bd8bb445 ("ARM: uaccess: remove put_user() code
|
||||||
|
duplication") fixed this problem in linux-4.8 as part of a larger change,
|
||||||
|
but seems a little too big to be backported to 4.4.
|
||||||
|
|
||||||
|
Let's take the simplest fix and change only the one broken line in the
|
||||||
|
same way as newer kernels.
|
||||||
|
|
||||||
|
Suggested-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
|
||||||
|
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85745
|
||||||
|
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
|
||||||
|
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||||
|
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||||
|
---
|
||||||
|
arch/arm/include/asm/uaccess.h | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
|
||||||
|
index b04850fdeb5..f8ad54b24ac 100644
|
||||||
|
--- a/arch/arm/include/asm/uaccess.h
|
||||||
|
+++ b/arch/arm/include/asm/uaccess.h
|
||||||
|
@@ -162 +162 @@ extern int __put_user_8(void *, unsigned long long);
|
||||||
|
- register const typeof(*(p)) __r2 asm("r2") = (x); \
|
||||||
|
+ register typeof(*(p)) __r2 asm("r2") = (x); \
|
|
@ -0,0 +1,18 @@
|
||||||
|
Based on ../../.shared-patches/linux/samsung-usb-ethaddr.patch
|
||||||
|
|
||||||
|
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
|
||||||
|
index 80294f32..d7268e50 100755
|
||||||
|
--- a/drivers/usb/gadget/u_ether.c
|
||||||
|
+++ b/drivers/usb/gadget/u_ether.c
|
||||||
|
@@ -1193,7 +1193,7 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
|
||||||
|
if (get_ether_addr(dev_addr, net->dev_addr))
|
||||||
|
dev_warn(&g->dev,
|
||||||
|
"using random %s ethernet address\n", "self");
|
||||||
|
-#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
|
||||||
|
+#if 0
|
||||||
|
memcpy(dev->host_mac, ethaddr, ETH_ALEN);
|
||||||
|
printk(KERN_DEBUG "usb: set unique host mac\n");
|
||||||
|
#else
|
||||||
|
--
|
||||||
|
2.32.0
|
||||||
|
|
Loading…
Reference in a new issue