samsung-gtelwifi: new device (MR 1355)

This patch adds basic support for the Samsung Galaxy Tab E 9.6" (SM-T560).
Current status: Kernel builds successfully, flashing boot.img works along with ssh.
This commit is contained in:
atipls 2020-06-21 10:11:11 +02:00 committed by Oliver Smith
parent 178558cb3d
commit 34f8efd1bc
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
12 changed files with 4052 additions and 0 deletions

View file

@ -0,0 +1,30 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-gtelwifi
pkgdesc="Samsung Galaxy Tab E 9.6"
pkgver=0
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="postmarketos-base linux-samsung-gtelwifi mkbootimg mesa-dri-gallium msm-fb-refresher"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="Wifi firmware"
depends="firmware-samsung-gtelwifi-wifi"
mkdir "$subpkgdir"
}
sha512sums="662ba186385ae40817bbeeeddcc8ad7808d1e364463677d613afae81dce0dccea19e6081226bb83c58b65bdd24a48f253a2b233426fc2d7c3c5b803f13161e2c deviceinfo"

View file

@ -0,0 +1,33 @@
# 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 E 9.6"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-gtelwifi"
deviceinfo_year="2015"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armv7"
# Device related
deviceinfo_chassis="tablet"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="800"
deviceinfo_screen_height="1280"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_kernel_cmdline="buildvariant=userdebug"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
deviceinfo_bootimg_dtb_second="false"
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,36 @@
pkgname=firmware-samsung-gtelwifi
pkgdesc="Firmware for Samsung Galaxy Tab E 9.6"
pkgver=0
pkgrel=0
url="https://github.com/gtelwifi/android_vendor_samsung_gtelwifi"
subpackages="$pkgname-wifi"
arch="armv7"
license="proprietary"
options="!check !strip !archcheck"
_commit_blob="c055948ee6aa329ebea6dc1337eca9e362e502ef"
_commit_config="63c27055bd8e6688f2595077a8196336cfabb315"
source="
$pkgname-blob-$_commit_blob.tar.gz::https://github.com/gtelwifi/android_vendor_samsung_gtelwifi/archive/$_commit_blob.tar.gz
$pkgname-config-$_commit_config.tar.gz::https://github.com/gtelwifi/android_device_samsung_gtelwifi/archive/$_commit_config.tar.gz
"
package() {
# parent package is empty
mkdir -p "$pkgdir"
}
wifi() {
pkgdesc="Wifi firmware"
depends="firmware-aosp-broadcom-wlan"
cd "$srcdir"
install -Dm644 "android_vendor_samsung_gtelwifi-$_commit_blob/proprietary/etc/wifi/bcmdhd_mfg.bin" -t "$subpkgdir"/lib/firmware/postmarketos/bcm4343
install -Dm644 "android_device_samsung_gtelwifi-$_commit_config/configs/wifi/nvram_mfg.txt" -t "$subpkgdir"/lib/firmware/postmarketos/bcm4343
}
sha512sums="fd87407a42642853c5ac608512a60f7dc91d991d28da675d4b6f4e38e0f9494749c00dc63394b09d0df6922f3407c6ba4310cb0a28fef4425190246fe5618c2e firmware-samsung-gtelwifi-blob-c055948ee6aa329ebea6dc1337eca9e362e502ef.tar.gz
3d8917e7b6a5d4f2610dc623f4c52917024b055a70908ab86994a4171eddca4580fdca3e13769ae5b77a23c69345062a3e92ca9a9cc3122b49ddf8f9e619238d firmware-samsung-gtelwifi-config-63c27055bd8e6688f2595077a8196336cfabb315.tar.gz"

View file

@ -0,0 +1,61 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/gtelwifi-dt_hw07_defconfig
pkgname=linux-samsung-gtelwifi
pkgver=3.10.17
pkgrel=0
pkgdesc="Samsung Galaxy Tab E 9.6 kernel fork"
arch="armv7"
_carch="arm"
_flavor="samsung-gtelwifi"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="bash bc bison devicepkg-dev flex openssl-dev perl dtbtool linux-headers installkernel"
# Source
_repository="linux-samsung-sm-t560"
_commit="e81e8d5094db8f10ff44cc95f55939c90df35e51"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/pmsourcedump/$_repository/archive/$_commit.tar.gz
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
kernel-use-the-gnu89-standard-explicitly.patch
fix-recordmcount.patch
fix-dtb_qcom,msm-id.patch
sprdfb-check-for-buffering.patch
sprdfb-fix-swapped-colors.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"
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
# Master DTB (deviceinfo_bootimg_qcdt)
dtbTool -p scripts/dtc/ -o "$_outdir/arch/$_carch/boot"/dt.img "$_outdir/arch/$_carch/boot/"
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img "$pkgdir"/boot/dt.img
}
sha512sums="1d951c9e33d79250513665a617867816d81df866e869ba20664c9f4b2f05845e6ff7c667ba0ef11f9287109e6716d1b45164848a750e36202c4f95665759a2aa linux-samsung-gtelwifi-e81e8d5094db8f10ff44cc95f55939c90df35e51.tar.gz
5e42374348cc3e3ad7ba3e46c60ec86b3bf68e2aabbd4ce17782386b188662014bfb658c14b19f1eaf52ee416183e5f7c66d9b4017e2da0f393d98c89ce6cf04 config-samsung-gtelwifi.armv7
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch
32911549f0c89972d06af838954978ee90fb2eabacc1393c0bffa12deb9d80ddec5322f859df772d90afea733965bd669e85d5e90657d4f69995ae9fc25dd4f3 fix-recordmcount.patch
e8137de3cc4d49d5447cad6c299f0f88c2d2e60e012168bc857f4898ebc1da5c88c679927227c8675211af079d5a56b5b1baef4a3dbc86cb4e921c14d3f93357 fix-dtb_qcom,msm-id.patch
c985b4a320904c0c66fb976a4f66dd2671f21d7b86ea98c019684efc41b5801f4b9c23012f4aa37bc5ce3efd70a30523c9c78fcd6e5fbbcff172ff19d11a6579 sprdfb-check-for-buffering.patch
f1b7fcf323241361ac0574964afe50821e18f56b2c036d22a0312af00fc8ce446a3ff82162cba950de7b16a5452d4f37848e5c250005dafdfbe8dd2a57a32ab5 sprdfb-fix-swapped-colors.patch"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,226 @@
This patch fixes "No valid dtbs found"
as described in:
https://wiki.postmarketos.org/wiki/QCDT#Fixing_.22No_valid_dtbs_found.22
diff --git a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev02.dts b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev02.dts
index 56ffac7d..9c10cae1 100755
--- a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev02.dts
+++ b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev02.dts
@@ -28,6 +28,7 @@
/ {
model = "Spreadtrum SP7730G board";
sprd,sc-id = <8830 2 0x20000>;
+ qcom,msm-id = <8830 2 0x20000>;
chosen {
bootargs = "init=/init root=/dev/ram0 rw";
linux,initrd-start = <0x85500000>;
@@ -388,7 +389,7 @@
pin-name = "lcd_3v3_en";
pin-type = <EXT_PIN_GPIO>;
pin-gpio = <&d_gpio_gpio 152 GPIO_ACTIVE_HIGH>;
- };
+ };
};
gen_panel: gen-panel {};
};
@@ -421,7 +422,7 @@
rustproof_por_src_flag = <1>;
};
-
+
sprd-hotplug {
log_enable = <0>;
};
@@ -670,4 +671,3 @@
clock-names = "clk_gpu_axi","clk_gpu","clk_153m6","clk_208m","clk_256m","clk_312m","clk_384m","clk_384m";
clocks = <&clk_gpu_axi>,<&clk_gpu>,<&clk_153m6>,<&clk_208m>,<&clk_256m>,<&clk_312m>,<&clk_384m>,<&clk_384m>;
};
-
diff --git a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev03.dts b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev03.dts
index 1e012662..33126012 100755
--- a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev03.dts
+++ b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev03.dts
@@ -28,6 +28,7 @@
/ {
model = "Spreadtrum SP7730G board";
sprd,sc-id = <8830 3 0x20000>;
+ qcom,msm-id = <8830 3 0x20000>;
chosen {
bootargs = "init=/init root=/dev/ram0 rw";
linux,initrd-start = <0x85500000>;
@@ -388,7 +389,7 @@
pin-name = "lcd_3v3_en";
pin-type = <EXT_PIN_GPIO>;
pin-gpio = <&d_gpio_gpio 152 GPIO_ACTIVE_HIGH>;
- };
+ };
};
gen_panel: gen-panel {};
};
@@ -420,7 +421,7 @@
sprd-rustproof {
rustproof_por_src_flag = <1>;
};
-
+
sprd-hotplug {
log_enable = <0>;
};
@@ -669,4 +670,3 @@
clock-names = "clk_gpu_axi","clk_gpu","clk_153m6","clk_208m","clk_256m","clk_312m","clk_384m","clk_384m";
clocks = <&clk_gpu_axi>,<&clk_gpu>,<&clk_153m6>,<&clk_208m>,<&clk_256m>,<&clk_312m>,<&clk_384m>,<&clk_384m>;
};
-
diff --git a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev04.dts b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev04.dts
index 0f2d80d1..904ae705 100755
--- a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev04.dts
+++ b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev04.dts
@@ -28,6 +28,7 @@
/ {
model = "Spreadtrum SP7730G board";
sprd,sc-id = <8830 4 0x20000>;
+ qcom,msm-id = <8830 4 0x20000>;
chosen {
bootargs = "init=/init root=/dev/ram0 rw";
linux,initrd-start = <0x85500000>;
@@ -388,7 +389,7 @@
pin-name = "lcd_3v3_en";
pin-type = <EXT_PIN_GPIO>;
pin-gpio = <&d_gpio_gpio 152 GPIO_ACTIVE_HIGH>;
- };
+ };
};
gen_panel: gen-panel {};
};
@@ -420,7 +421,7 @@
sprd-rustproof {
rustproof_por_src_flag = <1>;
};
-
+
sprd-hotplug {
log_enable = <0>;
};
@@ -669,4 +670,3 @@
clock-names = "clk_gpu_axi","clk_gpu","clk_153m6","clk_208m","clk_256m","clk_312m","clk_384m","clk_384m";
clocks = <&clk_gpu_axi>,<&clk_gpu>,<&clk_153m6>,<&clk_208m>,<&clk_256m>,<&clk_312m>,<&clk_384m>,<&clk_384m>;
};
-
diff --git a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev05.dts b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev05.dts
index 670be258..53787821 100755
--- a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev05.dts
+++ b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev05.dts
@@ -28,6 +28,7 @@
/ {
model = "Spreadtrum SP7730G board";
sprd,sc-id = <8830 5 0x20000>;
+ qcom,msm-id = <8830 5 0x20000>;
chosen {
bootargs = "init=/init root=/dev/ram0 rw";
linux,initrd-start = <0x85500000>;
@@ -388,7 +389,7 @@
pin-name = "lcd_3v3_en";
pin-type = <EXT_PIN_GPIO>;
pin-gpio = <&d_gpio_gpio 152 GPIO_ACTIVE_HIGH>;
- };
+ };
};
gen_panel: gen-panel {};
};
@@ -421,7 +422,7 @@
rustproof_por_src_flag = <1>;
};
-
+
sprd-hotplug {
log_enable = <0>;
};
@@ -670,4 +671,3 @@
clock-names = "clk_gpu_axi","clk_gpu","clk_153m6","clk_208m","clk_256m","clk_312m","clk_384m","clk_384m";
clocks = <&clk_gpu_axi>,<&clk_gpu>,<&clk_153m6>,<&clk_208m>,<&clk_256m>,<&clk_312m>,<&clk_384m>,<&clk_384m>;
};
-
diff --git a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev06.dts b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev06.dts
index 28314e6e..7228cbd9 100755
--- a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev06.dts
+++ b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev06.dts
@@ -28,6 +28,7 @@
/ {
model = "Spreadtrum SP7730G board";
sprd,sc-id = <8830 6 0x20000>;
+ qcom,msm-id = <8830 6 0x20000>;
chosen {
bootargs = "init=/init root=/dev/ram0 rw";
linux,initrd-start = <0x85500000>;
@@ -388,7 +389,7 @@
pin-name = "lcd_3v3_en";
pin-type = <EXT_PIN_GPIO>;
pin-gpio = <&d_gpio_gpio 152 GPIO_ACTIVE_HIGH>;
- };
+ };
};
gen_panel: gen-panel {};
};
@@ -421,7 +422,7 @@
rustproof_por_src_flag = <1>;
};
-
+
sprd-hotplug {
log_enable = <0>;
};
@@ -665,5 +666,3 @@
spi-max-frequency = <19200000>;
};
};
-
-
diff --git a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev09.dts b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev09.dts
index 6cbb373e..d97b035e 100755
--- a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev09.dts
+++ b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev09.dts
@@ -28,6 +28,7 @@
/ {
model = "Spreadtrum SP7730G board";
sprd,sc-id = <8830 9 0x20000>;
+ qcom,msm-id = <8830 9 0x20000>;
chosen {
bootargs = "init=/init root=/dev/ram0 rw";
linux,initrd-start = <0x85500000>;
@@ -661,4 +662,3 @@
spi-max-frequency = <19200000>;
};
};
-
diff --git a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev10.dts b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev10.dts
index 7758d647..0cf7c90c 100755
--- a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev10.dts
+++ b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev10.dts
@@ -28,6 +28,7 @@
/ {
model = "Spreadtrum SP7730G board";
sprd,sc-id = <8830 10 0x20000>;
+ qcom,msm-id = <8830 10 0x20000>;
chosen {
bootargs = "init=/init root=/dev/ram0 rw";
linux,initrd-start = <0x85500000>;
@@ -661,4 +662,3 @@
spi-max-frequency = <19200000>;
};
};
-
diff --git a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev11.dts b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev11.dts
index 96319452..a7a9b08e 100755
--- a/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev11.dts
+++ b/arch/arm/boot/dts/sprd-scx35_gtelwifi_rev11.dts
@@ -28,6 +28,7 @@
/ {
model = "Spreadtrum SP7730G board";
sprd,sc-id = <8830 11 0x20000>;
+ qcom,msm-id = <8830 11 0x20000>;
chosen {
bootargs = "init=/init root=/dev/ram0 rw";
linux,initrd-start = <0x85500000>;

View file

@ -0,0 +1,37 @@
This patch fixes the `R_METAG_NONE` error.
Found at: https://lore.kernel.org/patchwork/patch/696647/
The error message:
recordmcount.c: In function 'do_file':
scripts/recordmcount.c:351:28: error: 'R_METAG_ADDR32' undeclared (first use in this function)
351 | case EM_METAG: reltype = R_METAG_ADDR32;
| ^~~~~~~~~~~~~~
scripts/recordmcount.c:351:28: note: each undeclared identifier is reported only once for each function it appears in
scripts/recordmcount.c:353:20: error: 'R_METAG_NONE' undeclared (first use in this function); did you mean 'R_MIPS_NONE'?
353 | rel_type_nop = R_METAG_NONE;
| ^~~~~~~~~~~~
| R_MIPS_NONE
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index e1675927..42396a7 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 @@
../../.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 @@
../../.shared-patches/linux/kernel-use-the-gnu89-standard-explicitly.patch

View file

@ -0,0 +1,24 @@
sprdfb_check_var() has two problems:
I) it is not buffering-aware, which all Spreadtrum devices use;
II) it checks values that are already in yres_virtual, not those that we
are trying to overwrite.
Those problems stop X11 and charging-sdl from working properly.
X11 error:
(EE) FBDEV(0): FBIOPUT_VSCREENINFO: Invalid argument
This patch fixes first problem, however, the correct way is fixing
the second one, as this might have less side effects.
diff --git a/drivers/video/sprdfb/sprdfb_main.c b/drivers/video/sprdfb/sprdfb_main.c
index 9d572f0d..264c1650 100755
--- a/drivers/video/sprdfb/sprdfb_main.c
+++ b/drivers/video/sprdfb/sprdfb_main.c
@@ -435,7 +435,8 @@ static int sprdfb_check_var(struct fb_var_screeninfo *var, struct fb_info *fb)
if ((var->xres != fb->var.xres) ||
(var->yres != fb->var.yres) ||
(var->xres_virtual != fb->var.xres_virtual) ||
- (var->yres_virtual != fb->var.yres_virtual) ||
+ //(var->yres_virtual != fb->var.yres_virtual) ||
+ (fb->var.yres_virtual % var->yres_virtual != 0) ||
(var->xoffset != fb->var.xoffset) ||
#ifndef BIT_PER_PIXEL_SURPPORT
(var->bits_per_pixel != fb->var.bits_per_pixel) ||

View file

@ -0,0 +1,15 @@
By default, color channels on Spreadtrum devices are swapped. This patch makes kernel use BGR565, which has normal color channels.
diff --git a/drivers/video/sprdfb/sprdfb_main.c b/drivers/video/sprdfb/sprdfb_main.c
index 3e6c70d..80fceb9 100644
--- a/drivers/video/sprdfb/sprdfb_main.c
+++ b/drivers/video/sprdfb/sprdfb_main.c
@@ -51,7 +51,7 @@ enum{
SPRD_IN_DATA_TYPE_LIMIT
};
-#define SPRDFB_IN_DATA_TYPE SPRD_IN_DATA_TYPE_ABGR888
+#define SPRDFB_IN_DATA_TYPE SPRD_IN_DATA_TYPE_BGR565
#ifdef CONFIG_FB_TRIPLE_FRAMEBUFFER
#define FRAMEBUFFER_NR (3)