samsung-n2awifi: new device (MR 5233)

[ci:skip-build]: already built successfully in CI
This commit is contained in:
Eisenbahnfan 2024-06-17 21:04:56 +02:00 committed by Clayton Craft
parent cc4c164c58
commit e2bf43b9e1
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
11 changed files with 3967 additions and 0 deletions

View file

@ -0,0 +1,30 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-n2awifi
pkgdesc="Samsung Galaxy Tab PRO 10.1 (WiFi)"
pkgver=0
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
linux-samsung-n2awifi
mkbootimg
postmarketos-base
postmarketos-base-downstream-disable-udev-v4l
"
_pmb_recommends="firmware-samsung-n2awifi"
makedepends="devicepkg-dev"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="
73f64db74ef7a55f82e8a8ca8568f5569eb6c21c183f53cb2aeb2f37f2825c6948843d1b9b94bd639af8e0cc142d686fdc6009f5504fa152ad55fd799b571376 deviceinfo
"

View file

@ -0,0 +1,31 @@
# 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 PRO 10.1 (WiFi)"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-n2awifi"
deviceinfo_year="2014"
deviceinfo_arch="armv7"
# Device related
deviceinfo_chassis="tablet"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_kernel_cmdline="buildvariant=userdebug"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="2048"
deviceinfo_header_version="0"
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_heimdall_partition_kernel="BOOT"
deviceinfo_flash_heimdall_partition_rootfs="SYSTEM"

View file

@ -0,0 +1,45 @@
pkgname=firmware-samsung-n2awifi
pkgver=0
pkgrel=0
pkgdesc="Firmware for Samsung n2awifi"
url="https://github.com/exynos5420/android_vendor_samsung_n2a-common"
arch="armv7"
license="proprietary"
options="!check !strip !archcheck !spdx !tracedeps pmb:cross-native"
# Source
_n2awifi_commit="81dc97e9d3798e1975c9dfa518f9dc573d9e101b"
_n2awifi_url="https://github.com/exynos5420/android_vendor_samsung_n2a-common/raw/$_n2awifi_commit"
_n2awifi_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 $_n2awifi_wifi_files; do
source="$source $pkgname-$_n2awifi_commit-$_i::$_n2awifi_url/proprietary/etc/wifi/$_i";
done
package() {
# Wifi
local file
for file in $_n2awifi_wifi_files; do
install -Dm644 "$srcdir/$pkgname-$_n2awifi_commit-$file" \
"$pkgdir/lib/firmware/postmarketos/$file"
done
}
sha512sums="
a96731cb93938dbf9c3e9deed3725140f4b814f2eb719701076b5b4ef097f20e044a447afe84b4c14ed2fb263f92d08a856a92b9816440fa309c9407af0d2761 firmware-samsung-n2awifi-81dc97e9d3798e1975c9dfa518f9dc573d9e101b-bcmdhd_apsta.bin
1885041ec2ec2c593537fffa13a678bf79df1ecaa50be06dda53acc0196e565e30917a01301898153bbcd81cbaf26770f39bb00e0e4e0d9a6a792585dce328a3 firmware-samsung-n2awifi-81dc97e9d3798e1975c9dfa518f9dc573d9e101b-bcmdhd_ibss.bin
107cfdbef9b35f2bb31cd526dd6b8eedcb4fa0c6702766f7a352a761444ec87e6db31c1e1e761c1a2333dac83d4ee38e24070d19d7f5ccc2c87497b61b3f7b0a firmware-samsung-n2awifi-81dc97e9d3798e1975c9dfa518f9dc573d9e101b-bcmdhd_mfg.bin
a93b3b6bd1bf88b4edd2321693d0d426c7cf607703f3faf82ffc16a822e66e98e623eedbad0e4ef7399224a27283c0e541c02985aaac45d53449382cee3071f2 firmware-samsung-n2awifi-81dc97e9d3798e1975c9dfa518f9dc573d9e101b-bcmdhd_sta.bin
16ee43800bf7c05f550a14036ef1d648999568996854c72c1ef3965a8fd18eabfda284266fa2e2a0fee8c5fec01fd9a7e22b11b6723797742b5a6260e0b44096 firmware-samsung-n2awifi-81dc97e9d3798e1975c9dfa518f9dc573d9e101b-cred.conf
d8815923fee3246f34b9f6aefdcd56120237d842bcafc43a51c871d35d1bddc63154233fb6d7f4afd53583e42a5c4bbbc502e053df4a061a07aa52f9fc078b86 firmware-samsung-n2awifi-81dc97e9d3798e1975c9dfa518f9dc573d9e101b-nvram_mfg.txt
b8e92981cda6f73a877137de3081a4989b4a0a2f824c55c1b2e281489e70ad5cc5ae6e3394555e42ea083bc8ebf95656326bdba523073cbd527bfc329c1e452a firmware-samsung-n2awifi-81dc97e9d3798e1975c9dfa518f9dc573d9e101b-nvram_net.txt
"

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,37 @@
From 50088414b5eacfa0a2345f26448fd27dc28bc245 Mon Sep 17 00:00:00 2001
From: Henrik Grimler <henrik@grimler.se>
Date: Mon, 1 Jan 2024 09:04:29 +0100
Subject: [PATCH] drivers: psmouse: add guard for Finger Sensing Pad code
To fix errors like:
armv7-alpine-linux-musleabihf-ld: drivers/built-in.o: in function `psmouse_extensions':
psmouse-base.c:(.text+0x22f0c8): undefined reference to `fsp_detect'
armv7-alpine-linux-musleabihf-ld: psmouse-base.c:(.text+0x22f398): undefined reference to `fsp_detect'
---
drivers/input/mouse/psmouse-base.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 22fe2547e169..d4ec99d8cc84 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -818,6 +818,7 @@ static int psmouse_extensions(struct psmouse *psmouse,
return PSMOUSE_TOUCHKIT_PS2;
}
+#ifdef CONFIG_MOUSE_PS2_SENTELIC
/*
* Try Finger Sensing Pad. We do it here because its probe upsets
* Trackpoint devices (causing TP_READ_ID command to time out).
@@ -833,7 +834,7 @@ static int psmouse_extensions(struct psmouse *psmouse,
max_proto = PSMOUSE_IMEX;
}
}
-
+#endif
/*
* Reset to defaults in case the device got confused by extended
* protocol probes. Note that we follow up with full reset because
--
2.43.0

View file

@ -0,0 +1,68 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/lineageos_n2awifi_defconfig
pkgname=linux-samsung-n2awifi
pkgver=3.4.113
pkgrel=0
pkgdesc="Samsung Galaxy Tab PRO 10.1 (WiFi) kernel fork"
arch="armv7"
_carch="arm"
_flavor="samsung-n2awifi"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
bash
bc
bison
devicepkg-dev
findutils
flex
openssl-dev
perl
xz
"
# Source
_repository="android_kernel_samsung_exynos5420"
_commit="fed1690ca92e33cc6a5febe2e45dd909b9090d37"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/exynos5420/$_repository/archive/$_commit.tar.gz
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
gcc10-extern_YYLOC_global_declaration.patch
linux3.4-ARM-8933-1-replace-Sun-Solaris-style-flag-on-section.patch
01-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
02-drivers-psmouse-add-guard-for-Finger-Sensing-Pad-cod.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="
c10c0b457a37ca89172203d83b0c5efd3b4fd4a9e4ff5b64328737275cfc4b19d4a316eab61aa5561943f29f70bb2bebac0efba54854e01553b90b8dd639d4bd linux-samsung-n2awifi-fed1690ca92e33cc6a5febe2e45dd909b9090d37.tar.gz
abcc8c1c889fc546a51bd09edd4f786bb7120262d3cefcda8a987c012ebd8ee43fdb1bc2c8624c2150ef247c68e83f6322fbe682fe26ff34529f909a5b7f96f1 config-samsung-n2awifi.armv7
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
9e3b067fa1b19ad02500c4fce1b6142051df3845c508e615788beb650c4f953683107ac2d80670c4e3df38f532e0e91060d2d13ec04c9ec985abd2dfa82e900b linux3.4-ARM-8933-1-replace-Sun-Solaris-style-flag-on-section.patch
5fad0940e90da71277b70b6e72fbb75fcc5e12625e65f827ae896d448628b252b3312539f9c184b26ffe5ca3b343a56b388ea6addb7fe446c7d1ae2aefb4b51e 01-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
a3df24c8d9116a3ad3559aac5ce126049e9123df633990ec72facd64ef538ed773e3ac0da233f2e04d99164d590340d598cfb3da3bbea502cf7c2cd3ef08cf24 02-drivers-psmouse-add-guard-for-Finger-Sensing-Pad-cod.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 @@
../../.shared-patches/linux/linux3.4-ARM-8933-1-replace-Sun-Solaris-style-flag-on-section.patch