samsung-j3nxlte: new device (Samsung Galaxy J3 (2016)) (!653)

Display and touchscreen (with a kernel driver patch) working.

[ci:skip-build]: already built successfully in CI
This commit is contained in:
Alastair Horn 2019-09-30 23:18:31 +01:00 committed by Oliver Smith
parent af386c96fe
commit 61ca6a1fdf
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
9 changed files with 3947 additions and 0 deletions

View file

@ -0,0 +1,23 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-samsung-j3nxlte"
pkgdesc="Samsung Galaxy J3"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-samsung-j3nxlte mkbootimg mesa-dri-swrast"
makedepends="devicepkg-dev"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="56da31a8f2ed7061ab2e569e52bd74285aaa2438bd60b05d145c5c325af1622df8c75a8ca27ee9626ddb32d9493730d89abb15a0125ec228a74c6f24065bfa48 deviceinfo"

View file

@ -0,0 +1,36 @@
# 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 J3"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-j3nxlte"
deviceinfo_date=""
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armv7"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="false"
deviceinfo_screen_width="720"
deviceinfo_screen_height="1280"
deviceinfo_dev_touchscreen="/dev/input/event3"
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_flash_sparse="true"
deviceinfo_kernel_cmdline="console=ttyS1,115200n8"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="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="2048"
deviceinfo_flash_heimdall_partition_kernel=""
deviceinfo_flash_heimdall_partition_system=""

View file

@ -0,0 +1,79 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/j3xnlte_defconfig
pkgname="linux-samsung-j3nxlte"
pkgver=3.10.100
pkgrel=0
pkgdesc="Samsung Galaxy J3 kernel fork"
arch="armv7"
_carch="arm"
_flavor="samsung-j3nxlte"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps"
makedepends="mkbootimg perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev dtbtool"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="android_kernel_samsung_sharkls"
_commit="e3381e42b00e1ff977815b365cea53f18afff7a8"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/djeman/${_repository}/archive/${_commit}.tar.gz
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
fix_recordmcount.patch
qcom,msm-id_fix.patch
fix_touchscreen.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() {
# kernel.release
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
# zImage (find the right one)
cd "$builddir/arch/$_carch/boot"
_target="$pkgdir/boot/vmlinuz-$_flavor"
for _zimg in 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
# Master DTB (deviceinfo_bootimg_qcdt)
install -Dm644 "$builddir/arch/arm/boot/dt.img" \
"$pkgdir/boot/dt.img"
}
sha512sums="733f04dee55effcbbd8c28b9b2b84b05ca9e95d538bd10177edc40f36ee640cd260f080c50497d28828a441c9c96046debdf1085453a4d8871ac8a3ef300380f linux-samsung-j3nxlte-e3381e42b00e1ff977815b365cea53f18afff7a8.tar.gz
28a23904560b29d23037b3c74fc4f00c240a43199ee171b15a70583cd95668e923103d1ddb9c1ee75954b1b3962d238f4fb6019fa38264f4403aa05a9b9dde12 config-samsung-j3nxlte.armv7
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
6aa11a75f422ac5c20cddfce23bff81940e61e65bc86fe1070c60714a6ccf631b2da70bff20e2b88e723706f0f233eb03540a8d9389adffd495592e8ab6bd82a fix_recordmcount.patch
dd6e3113ad7d87da76e92d5a656a683e735e1b18e6217c1beb4238ad60f48b1bc429c9e62dc9752b7242201610e95990dafc13f499aa09c74a26079022ae17ec qcom,msm-id_fix.patch
54eb205043b9e1b12f4f88d8163611e6769a702490045f5704483c92b17c9297250fde7d257b6d0e82d0cdbaed88d52d85137aeafcd4c4b138cecfffc921857e fix_touchscreen.patch"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,61 @@
From 84f8a24ade96a8c1499823b160a0591199cf9d12 Mon Sep 17 00:00:00 2001
From: Laura Abbott <labbott@redhat.com>
Date: Fri, 8 Jul 2016 12:18:50 -0700
Subject: [PATCH] ftrace/recordmcount: Work around for addition of metag magic
but not relocations
commit b2e1c26f0b62531636509fbcb6dab65617ed8331 upstream.
glibc recently did a sync up (94e73c95d9b5 "elf.h: Sync with the gabi
webpage") that added a #define for EM_METAG but did not add relocations
This triggers build errors:
scripts/recordmcount.c: In function 'do_file':
scripts/recordmcount.c:466:28: error: 'R_METAG_ADDR32' undeclared (first use in this function)
case EM_METAG: reltype = R_METAG_ADDR32;
^~~~~~~~~~~~~~
scripts/recordmcount.c:466:28: note: each undeclared identifier is reported only once for each function it appears in
scripts/recordmcount.c:468:20: error: 'R_METAG_NONE' undeclared (first use in this function)
rel_type_nop = R_METAG_NONE;
^~~~~~~~~~~~
Work around this change with some more #ifdefery for the relocations.
Fedora Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1354034
Link: http://lkml.kernel.org/r/1468005530-14757-1-git-send-email-labbott@redhat.com
Cc: James Hogan <james.hogan@imgtec.com>
Fixes: 00512bdd4573 ("metag: ftrace support")
Reported-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
scripts/recordmcount.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index e167592793a7..42396a74405d 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -33,10 +33,17 @@
#include <string.h>
#include <unistd.h>
+/*
+ * glibc synced up and added the metag number but didn't add the relocations.
+ * Work around this in a crude manner for now.
+ */
#ifndef EM_METAG
-/* Remove this when these make it to the standard system elf.h. */
#define EM_METAG 174
+#endif
+#ifndef R_METAG_ADDR32
#define R_METAG_ADDR32 2
+#endif
+#ifndef R_METAG_NONE
#define R_METAG_NONE 3
#endif

View file

@ -0,0 +1,13 @@
diff --git a/drivers/input/touchscreen/ist30xxc/ist30xxc.c b/drivers/input/touchscreen/ist30xxc/ist30xxc.c
index 6732c409..db81baa3 100755
--- a/drivers/input/touchscreen/ist30xxc/ist30xxc.c
+++ b/drivers/input/touchscreen/ist30xxc/ist30xxc.c
@@ -1446,7 +1446,7 @@ static int ist30xx_probe(struct i2c_client *client,
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR,
0, data->pdata->max_w, 0, 0);
#if IST30XX_JIG_MODE
- input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, 0, 0, 0);
+ //input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, 0, 0, 0);
#endif
#if IST30XX_USE_KEY

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,78 @@
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev00.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev00.dts
index 6d277064..ffad458c 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev00.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev00.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 0 0x20000>;
+ qcom,msm-id = <9830 0 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev01.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev01.dts
index 45b86b00..4f0e95ba 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev01.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev01.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 1 0x20000>;
+ qcom,msm-id = <9830 1 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev02.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev02.dts
index cd10c56c..e2d50b43 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev02.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev02.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 2 0x20000>;
+ qcom,msm-id = <9830 2 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev03.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev03.dts
index b38713ce..3bf64b03 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev03.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev03.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 3 0x20000>;
+ qcom,msm-id = <9830 3 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev04.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev04.dts
index 393d2db1..c339ceae 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev04.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev04.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 4 0x20000>;
+ qcom,msm-id = <9830 4 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
diff --git a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev05.dts b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev05.dts
index 5611b8bb..bb1d2d3a 100755
--- a/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev05.dts
+++ b/arch/arm/boot/dts/sprd-scx35l_sharkls_j3xnlte_rev05.dts
@@ -34,7 +34,7 @@
/ {
model = "Spreadtrum SP8835EB board";
compatible = "sprd,sp8835eb";
- sprd,sc-id = <9830 5 0x20000>;
+ qcom,msm-id = <9830 5 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;