samsung-v1awifi: new device (MR 2671)

[ci:skip-build]: already built successfully in CI
This commit is contained in:
Antoni Aloy Torrens 2021-11-09 23:22:56 +01:00 committed by Oliver Smith
parent 70be414133
commit f5ee783b74
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
9 changed files with 3919 additions and 0 deletions

View file

@ -0,0 +1,35 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-v1awifi
pkgdesc="Samsung Galaxy Note Pro 12.2 WiFi"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
makedepends="devicepkg-dev"
depends="postmarketos-base linux-samsung-v1awifi mkbootimg mesa-dri-swrast msm-fb-refresher"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
# Disable v4l udev rules, because if enabled the device will fail to boot
# when VIDEO_EXYNOS_FIMC_IS is enabled.
mkdir -p "$pkgdir"/etc/udev/rules.d
ln -s /dev/null "$pkgdir"/etc/udev/rules.d/60-persistent-v4l.rules
}
nonfree_firmware() {
pkgdesc="Non-free firmware for the Samsung Galaxy Note Pro 12.2 WiFi"
depends="firmware-samsung-v1awifi"
mkdir "$subpkgdir"
}
sha512sums="
ee0381d5c49e6207b27a2ef9d0444b417a1fb98f7745c2c10e4f2192496cd619656433653ee03bb7a43562e36a4370d98ecf402ad475b7ac3118082ccff5fa29 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 Note Pro 12.2 Wi-Fi"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-v1awifi"
deviceinfo_year="2014"
deviceinfo_arch="armv7"
# Device related
deviceinfo_chassis="tablet"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="2560"
deviceinfo_screen_height="1600"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_append_seandroidenforce="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,38 @@
pkgname=firmware-samsung-v1awifi
pkgver=1
pkgrel=0
pkgdesc="Firmware for Samsung Galaxy Tab Pro 12.2 (samsung-v1awifi)"
url="https://github.com/exynos5420/android_vendor_samsung_v1a-common"
arch="armv7"
license="proprietary"
_commit="2bf0fc3da1fe95e188fcf78f6d80cff56375778a"
source="$pkgname-$pkgver.tar.gz::https://github.com/exynos5420/android_vendor_samsung_v1a-common/archive/$_commit.tar.gz"
options="!check !strip !archcheck !spdx !tracedeps pmb:cross-native"
# All the files are picked from proprietary/etc/wifi, so put this path instead of the root directory
builddir="$srcdir/android_vendor_samsung_v1a-common-$_commit/proprietary/etc/wifi"
package() {
install -Dm644 "$builddir"/bcmdhd_apsta.bin_4354_a1 \
"$pkgdir"/lib/firmware/postmarketos/bcmdhd_apsta.bin_4354_a1
install -Dm644 "$builddir"/bcmdhd_ibss.bin_4354_a1 \
"$pkgdir"/lib/firmware/postmarketos/bcmdhd_ibss.bin_4354_a1
install -Dm644 "$builddir"/bcmdhd_mfg.bin_4354_a1 \
"$pkgdir"/lib/firmware/postmarketos/bcmdhd_mfg.bin_4354_a1
install -Dm644 "$builddir"/bcmdhd_sta.bin_4354_a1 \
"$pkgdir"/lib/firmware/postmarketos/bcmdhd_sta.bin_4354_a1
install -Dm644 "$builddir"/cred.conf \
"$pkgdir"/lib/firmware/postmarketos/cred.conf
install -Dm644 "$builddir"/nvram_mfg.txt_4354_a1 \
"$pkgdir"/lib/firmware/postmarketos/nvram_mfg.txt_4354_a1
install -Dm644 "$builddir"/nvram_net.txt_4354_a1 \
"$pkgdir"/lib/firmware/postmarketos/nvram_net.txt_4354_a1
}
sha512sums="
f95569da626e30755866e131d485b8c1882164883289cd2ed3ed1cad172b8d7da03b2a760bc2e4c138e419215b37c7fcbe6921c8c3d0bf97fcad6afb913410d2 firmware-samsung-v1awifi-1.tar.gz
"

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,62 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/lineageos_v1awifi_defconfig
pkgname=linux-samsung-v1awifi
pkgver=3.4.113
pkgrel=0
pkgdesc="Samsung Galaxy Note Pro 12.2 Wi-Fi kernel fork"
arch="armv7"
_carch="arm"
_flavor="samsung-v1awifi"
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="875b08faaa1a395c233388b4048e4b20bf971db3"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/exynos5420/$_repository/archive/$_commit.tar.gz
$_config
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
"
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="
807e43b896d83f0a633aa417ad7ffd0a8af3aa5da2c4b1134b604fdadb26b590f04ff24131b3ee2b60b0479ce2e6ba81e3e19e50e0e772d9785b96d60aa65c33 linux-samsung-v1awifi-875b08faaa1a395c233388b4048e4b20bf971db3.tar.gz
028c97dba02b6ec55015e9b822ca017095a98d562e4f75124cb3317313b7062798dbc71e98223e4e1948e5d8ed17c8749313072fb7b9ff37b51d439efdc049d9 config-samsung-v1awifi.armv7
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
"

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