New device: Galaxy Tab S 8.4 LTE samsung-klimtlte [MR 2084]

Almost identical to packages for chagallwifi, but kernel requires
config changes.

[ci:skip-build] already built successfully in CI
This commit is contained in:
Henrik Grimler 2021-02-19 21:52:54 +01:00 committed by Clayton Craft
parent 1a0e054c76
commit 3f51f87c72
No known key found for this signature in database
GPG key ID: 7A3461CA187CEA54
12 changed files with 4157 additions and 0 deletions

View file

@ -0,0 +1,36 @@
# Maintainer: Henrik Grimler <henrik@grimler.se>
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-klimtlte
pkgdesc="Samsung Galaxy Tab S 8.4 LTE"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
linux-samsung-klimtlte
mesa-dri-gallium
mkbootimg
postmarketos-base
msm-fb-refresher
"
makedepends="devicepkg-dev"
source="deviceinfo"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="Non-free firmware for the Samsung Galaxy Tab S"
depends="firmware-samsung-klimt"
mkdir "$subpkgdir"
}
sha512sums="b3ccb88021887be5f76183e339642e9c3863f17b9c50f068f906a644edd444346ed12f2b539d1ac9ef32d40340ae74b935030173f932018f7a180c96d00966f4 deviceinfo"

View 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 Tab S 8.4 LTE"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-klimtlte"
deviceinfo_year="2014"
deviceinfo_arch="armv7"
# Device related
deviceinfo_chassis="tablet"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1600"
deviceinfo_screen_height="2560"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_offset_base="0x10000000"
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="BOOT"
deviceinfo_flash_heimdall_partition_system="SYSTEM"

View file

@ -0,0 +1,43 @@
pkgname=firmware-samsung-klimt
pkgver=1
pkgrel=0
pkgdesc="Firmware for Samsung klimtwifi and klimtlte"
url="https://github.com/exynos5420/android_vendor_samsung_klimt-common"
arch="armv7"
license="proprietary"
options="!check !strip !archcheck !spdx"
# Source
_klimt_commit="cedd082ae12290218c2c33ffd31bbecc713b7cd9"
_klimt_url="https://github.com/exynos5420/android_vendor_samsung_klimt-common/raw/$_klimt_commit"
_klimt_wifi_files="
bcmdhd_apsta.bin
bcmdhd_ibss.bin
bcmdhd_mfg.bin
bcmdhd_sta.bin
cred.conf
nvram_mfg.txt
nvram_net.txt
"
for _i in $_klimt_wifi_files; do
source="$source $pkgname-$_klimt_commit-$_i::$_klimt_url/proprietary/etc/wifi/$_i";
done
package() {
# Wifi
local file
for file in $_klimt_wifi_files; do
install -Dm644 "$srcdir/$pkgname-$_klimt_commit-$file" \
"$pkgdir/lib/firmware/postmarketos/$file"
done
}
sha512sums="4449d14eafe81afe2b3a8f81b00af1fd36e493cfde8892d83a9853b9ee9fc8551970b363f7e73d4a98640a043856e1374deabea5ec06dc46e86312d6e3687d35 firmware-samsung-klimt-cedd082ae12290218c2c33ffd31bbecc713b7cd9-bcmdhd_apsta.bin
755810fc6a72860a21a3392c6fa1070382877e6c1bccea353dd808e5ed2c1741d5c67481465252857b1f86bb1928cf4d9014e6e88063d156afeb7d278149c202 firmware-samsung-klimt-cedd082ae12290218c2c33ffd31bbecc713b7cd9-bcmdhd_ibss.bin
712d9fa7b823383fcd586419dbd54eb824bf23cab17d352a39032d304ff0768cc29f47d2fcd0a9c819e18c55f688b32984f9514e775358f6299caacefa5e668f firmware-samsung-klimt-cedd082ae12290218c2c33ffd31bbecc713b7cd9-bcmdhd_mfg.bin
e382700c6af5f592ebb10c4eca038289ae09a3de36a3f330b81c2c6322b75a85d1bbe1e3061f4c2d889bf32e9cf92f17e3474c324e166aa89847bd401aa902df firmware-samsung-klimt-cedd082ae12290218c2c33ffd31bbecc713b7cd9-bcmdhd_sta.bin
16ee43800bf7c05f550a14036ef1d648999568996854c72c1ef3965a8fd18eabfda284266fa2e2a0fee8c5fec01fd9a7e22b11b6723797742b5a6260e0b44096 firmware-samsung-klimt-cedd082ae12290218c2c33ffd31bbecc713b7cd9-cred.conf
1a6cdc436f467fb2727532c9a997be80cb1505faec4ca1c57681dc353a10a0696430ce48b578bd1411e0d14e2a9748072a584b901ae14b9470a6b28d2f351351 firmware-samsung-klimt-cedd082ae12290218c2c33ffd31bbecc713b7cd9-nvram_mfg.txt
54f5aa17d79fd352bab2bc036937a72c63f37fa49e8a182a061dfd2bdaab621ed91429b6de8a9e255d1c64d15f846f9dc41ba6bb8421b36947beac3bdfd5fd95 firmware-samsung-klimt-cedd082ae12290218c2c33ffd31bbecc713b7cd9-nvram_net.txt"

View file

@ -0,0 +1,59 @@
commit 611c7138d2812827c3a62940576bf62c61cd8515
Author: Henrik Grimler <henrik@grimler.se>
Date: Fri Nov 27 18:01:34 2020 +0100
Fix so that FIMC IS can be disabled
* mach-exynos: don't set EXYNOS5_{DEV,SETUP}_FIMC_IS for universal5420
* board-universal5420-media: add ifdef guard to fix compilation error
* pm_domains: always init exynos54xx_pd_isp to prevent null pointer dereference
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 2aed1a4dfbac..9667d665363d 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -883,8 +883,6 @@ config MACH_UNIVERSAL5420
select EXYNOS5_SETUP_HSI2C4
select EXYNOS5_SETUP_HSI2C5
select EXYNOS5_SETUP_HSI2C6
- select EXYNOS5_DEV_FIMC_IS
- select EXYNOS5_SETUP_FIMC_IS
help
Machine support for Universal board based on EXYNOS5420
endif
diff --git a/arch/arm/mach-exynos/board-universal5420-media.c b/arch/arm/mach-exynos/board-universal5420-media.c
index 91677b04f9e8..4e461819fa68 100644
--- a/arch/arm/mach-exynos/board-universal5420-media.c
+++ b/arch/arm/mach-exynos/board-universal5420-media.c
@@ -1166,6 +1166,7 @@ void __init exynos5_universal5420_media_init(void)
sizeof(s5p_mipi_csis1_default_data), &s5p_device_mipi_csis1);
#endif
+#ifdef CONFIG_VISION_MODE
#ifdef CONFIG_VIDEO_EXYNOS_FIMC_LITE
#if !defined(CONFIG_V1A) && !defined(CONFIG_V2A)
s3c_i2c1_set_platdata(NULL);
@@ -1178,6 +1179,7 @@ void __init exynos5_universal5420_media_init(void)
s3c_set_platdata(&exynos_flite2_default_data,
sizeof(exynos_flite2_default_data), &exynos_device_flite2);
#endif
+#endif /* CONFIG_VISION_MODE */
/* camera */
#ifdef CONFIG_VIDEO_EXYNOS5_FIMC_IS
diff --git a/arch/arm/mach-exynos/pm_domains5.c b/arch/arm/mach-exynos/pm_domains5.c
index 3220333bed94..2599bb756958 100644
--- a/arch/arm/mach-exynos/pm_domains5.c
+++ b/arch/arm/mach-exynos/pm_domains5.c
@@ -1224,8 +1224,8 @@ static int exynos5420_pm_domain_init(void)
exynos_pm_add_clk(&exynos5420_spd_mscl1, NULL, "mscl");
exynos_pm_add_clk(&exynos5420_spd_mscl2, NULL, "mscl");
#endif
-#ifdef CONFIG_EXYNOS5_DEV_FIMC_IS
exynos_pm_powerdomain_init(&exynos54xx_pd_isp);
+#ifdef CONFIG_EXYNOS5_DEV_FIMC_IS
exynos_pm_add_platdev(&exynos54xx_pd_isp, &exynos5_device_fimc_is);
exynos_pm_add_platdev(&exynos54xx_pd_isp, &s3c64xx_device_spi3);
exynos_pm_add_clk(&exynos54xx_pd_isp, &exynos5_device_fimc_is.dev, "gscl_wrap0");

View file

@ -0,0 +1,29 @@
commit 80cc1852c7e85441a8fecb35513cb4d33a0d202e
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Tue Jun 19 05:25:46 2012 +0200
netfilter: fix missing symbols if CONFIG_NETFILTER_NETLINK_QUEUE_CT unset
ERROR: "nfqnl_ct_parse" [net/netfilter/nfnetlink_queue.ko] undefined!
ERROR: "nfqnl_ct_seq_adjust" [net/netfilter/nfnetlink_queue.ko] undefined!
ERROR: "nfqnl_ct_put" [net/netfilter/nfnetlink_queue.ko] undefined!
ERROR: "nfqnl_ct_get" [net/netfilter/nfnetlink_queue.ko] undefined!
We have to use CONFIG_NETFILTER_NETLINK_QUEUE_CT in
include/net/netfilter/nfnetlink_queue.h, not CONFIG_NF_CONNTRACK.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
diff --git a/include/net/netfilter/nfnetlink_queue.h b/include/net/netfilter/nfnetlink_queue.h
index 9f8095c108e4..86267a529514 100644
--- a/include/net/netfilter/nfnetlink_queue.h
+++ b/include/net/netfilter/nfnetlink_queue.h
@@ -5,7 +5,7 @@
struct nf_conn;
-#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
+#ifdef CONFIG_NETFILTER_NETLINK_QUEUE_CT
struct nf_conn *nfqnl_ct_get(struct sk_buff *entskb, size_t *size,
enum ip_conntrack_info *ctinfo);
struct nf_conn *nfqnl_ct_parse(const struct sk_buff *skb,

View file

@ -0,0 +1,23 @@
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index 934b8bacfeeb..f41d23c5f5cb 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -1224,8 +1224,17 @@ int gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
dev_warn(&g->dev,
"using random %s ethernet address\n", "self");
#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
+ if ((ethaddr[0] == 0x00) && (ethaddr[1] == 0x00) &&
+ (ethaddr[2] == 0x00) && (ethaddr[3] == 0x00) &&
+ (ethaddr[4] == 0x00) && (ethaddr[5] == 0x00)) {
+ printk(KERN_DEBUG "%s: no unique host MAC was set, generate random\n", __func__);
+ /* we can use random_ether_addr() from include/linux/etherdevice.h */
+ random_ether_addr(ethaddr);
+ } else {
+ printk(KERN_DEBUG "%s: set unique host mac\n", __func__);
+ }
memcpy(dev->host_mac, ethaddr, ETH_ALEN);
- printk(KERN_DEBUG "usb: set unique host mac\n");
+
#else
if (get_ether_addr(host_addr, dev->host_mac))
dev_warn(&g->dev,

View file

@ -0,0 +1,67 @@
# Maintainer: Henrik Grimler <henrik@grimler.se>
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/lineageos_klimtlte_defconfig
pkgname=linux-samsung-klimtlte
pkgver=3.4.113
pkgrel=0
pkgdesc="Samsung Galaxy Tab S 8.4 LTE kernel fork"
arch="armv7"
_carch="arm"
_flavor="samsung-klimtlte"
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
xz
"
# Source
_repository="android_kernel_samsung_exynos5420"
_commit="c1a203cee565eb20a9b5bc2daf1c1b650a420fe5"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/exynos5420/$_repository/archive/$_commit.tar.gz
$_config
01-fix-FIMC-IS-disabling.patch
02-netfilter-symbols.patch
03-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
gcc10-extern_YYLOC_global_declaration.patch
kernel-use-the-gnu89-standard-explicitly.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"
}
sha512sums="38bb1af78097f32ec594d3c7dd393c1fe449c4c892b567b1558a999143049e1bc2fa7375ecd54477be97066534e0dd875c01453e4658b4ae3f91e346e0b3b6ea linux-samsung-klimtlte-c1a203cee565eb20a9b5bc2daf1c1b650a420fe5.tar.gz
6b95d366b2e5f038a0d3770c547560f7d081f949972a50c5e2164d62438711f48152a9215e2992c3e7bdb370404a90c272c35697f62efd03b9a3b527a62ae072 config-samsung-klimtlte.armv7
00c86b897193340ce4e8184e622d830d16efe9a5c10c12357e5f6ab98193a28f69c0006bdfe0d3429f1136a9820b8f8ff262d07b0314e40f4c7b664013e0b8a6 01-fix-FIMC-IS-disabling.patch
5214a850d496bed9e17575bd0b52e9e4415bcbd5a89863f924c5bfed848f684c0a95e8d10c9ef93c0e00149f034cf5e897d1b268be35676a600b3ee6e1917501 02-netfilter-symbols.patch
5fad0940e90da71277b70b6e72fbb75fcc5e12625e65f827ae896d448628b252b3312539f9c184b26ffe5ca3b343a56b388ea6addb7fe446c7d1ae2aefb4b51e 03-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
7488e1b2714bb5771375684b4e27c0e773720da57f6d7b9a74225bfd2b21493f9e20ee219e7c6f8cfb57cda7b17f86fa2bc35a1b26471b1d7cee3f5b5ab6562a kernel-use-the-gnu89-standard-explicitly.patch"

File diff suppressed because it is too large Load diff

View file

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

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,67 @@
From 51b97e354ba9fce1890cf38ecc754aa49677fc89 Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <kirill@shutemov.name>
Date: Mon, 20 Oct 2014 12:23:12 +0300
Subject: kernel: use the gnu89 standard explicitly
From: "Kirill A. Shutemov" <kirill@shutemov.name>
commit 51b97e354ba9fce1890cf38ecc754aa49677fc89 upstream.
Sasha Levin reports:
"gcc5 changes the default standard to c11, which makes kernel build
unhappy
Explicitly define the kernel standard to be gnu89 which should keep
everything working exactly like it was before gcc5"
There are multiple small issues with the new default, but the biggest
issue seems to be that the old - and very useful - GNU extension to
allow a cast in front of an initializer has gone away.
Patch updated by Kirill:
"I'm pretty sure all gcc versions you can build kernel with supports
-std=gnu89. cc-option is redunrant.
We also need to adjust HOSTCFLAGS otherwise allmodconfig fails for me"
Note by Andrew Pinski:
"Yes it was reported and both problems relating to this extension has
been added to gnu99 and gnu11. Though there are other issues with the
kernel dealing with extern inline have different semantics between
gnu89 and gnu99/11"
End result: we may be able to move up to a newer stdc model eventually,
but right now the newer models have some annoying deficiencies, so the
traditional "gnu89" model ends up being the preferred one.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Singed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Makefile | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -245,7 +245,7 @@
HOSTCC = gcc
HOSTCXX = g++
-HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89
HOSTCXXFLAGS = -O2
# Decide whether to build built-in, modular, or both.
@@ -368,7 +368,9 @@
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
-Wno-format-security -Wno-unused \
- -fno-delete-null-pointer-checks
+ -fno-delete-null-pointer-checks \
+ -std=gnu89
+
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS := -D__ASSEMBLY__