Verified Commit 4c0ec94e authored by st s's avatar st s Committed by Oliver Smith
Browse files

samsung-zeroltexx: new device Samsung Galaxy S6 edge (G925F) (MR 2105)

Port based on an unofficial LineageOS port
from https://www.los-legacy.de/17.1/zerofltexx, using kernel from
https://github.com/Exynos7420/android_kernel_samsung_exynos7420/

What works:
- Kernel boots
- Display and touch input (tested with Weston)
- USB networking
- Wifi

For now only including Wifi drivers, as I wasn't yet able to
successfully test audio and camera subsystems (but I intentionally left
these firmware files commented out in the APKBUILD file).

[ci:skip-build]: already built successfully in CI
parent d7bcaece
Pipeline #317266945 passed with stages
in 2 minutes
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-zeroltexx
pkgdesc="Samsung Galaxy S6 edge"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="postmarketos-base linux-samsung-zeroltexx mkbootimg mesa-dri-gallium msm-fb-refresher"
makedepends="devicepkg-dev"
source="deviceinfo
udev/60-persistent-v4l.rules
"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
install="$pkgname.post-install"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
install -Dm644 "$srcdir"/60-persistent-v4l.rules \
"$pkgdir"/etc/udev/rules.d/60-persistent-v4l.rules
}
nonfree_firmware() {
pkgdesc="Non-free firmware for the Samsung Galaxy S6 edge"
depends="firmware-samsung-zero"
mkdir "$subpkgdir"
}
sha512sums="0dc3899d396587d90d03b31932c14debe67b7fe1b10be0308720f6382748ecaaf5338fccae4c239fb3aa877f835e769b65a15d641fcdd77258f3a80410072dd8 deviceinfo
b8bf2e3ec166af6acbbfaaa2b57b053473c0b12df007090eecf7a885aee2e3cd5d982819e2ee73e2817e5266b9875dc9240389bca409d5523f3cfa8037fa7870 60-persistent-v4l.rules"
#!/bin/sh
# enable deferred-initcalls script by default (from postmarketos-base package)
rc-update add deferred-initcalls default
# 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 S6 edge"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-zeroltexx"
deviceinfo_year="2015"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="false"
deviceinfo_screen_width="1440"
deviceinfo_screen_height="2560"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
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"
# This file is intentionally empty, to disable the default rule with the same name.
# You can find the default rule in /lib/udev/rules.d/60-persistent-v4l.rules.
#
# See https://gitlab.com/postmarketOS/pmaports/-/merge_requests/1160 for why this is needed.
pkgname=firmware-samsung-zero
pkgver=1
pkgrel=0
pkgdesc="Firmware for the Samsung Galaxy S6 / S6 edge (zerofltexx/zeroltexx)"
url="https://github.com/Exynos7420/proprietary_vendor_samsung_zero-common"
arch="noarch"
license="proprietary"
options="!check !archcheck !strip !spdx"
# Source
_commit="9ff5ecfd76e05e7b8fd2210675af51f3acf2eb95"
_vendor_files_wifi="
bcmdhd_sta.bin
nvram_net.txt
"
for _file in $_vendor_files_wifi; do
source="$source $pkgname-$_commit-$_file::$url/raw/nx-10.0/proprietary/system/vendor/etc/wifi/$_file"
done
package() {
local file
for file in $_vendor_files_wifi; do
install -Dm644 "$srcdir/$pkgname-$_commit-$file" \
"$pkgdir/lib/firmware/postmarketos/$file"
done
}
sha512sums="3b7f4bcc544762bb632cb4f47c73550f78d7d06e82503eae761a063b2f8871f177f03f9ee54b79297a798fd9c41868d99b985b38de23396a470dbf4e76bfb266 firmware-samsung-zero-9ff5ecfd76e05e7b8fd2210675af51f3acf2eb95-bcmdhd_sta.bin
8db9cb1c2ff6e659b8a3689758ae564785b840062864a71286176cf9f51a0e0a85bf081a9c3dfdcd1990bfb3dbf824a51c857ed459ff3fcbeb1e756cdd6add46 firmware-samsung-zero-9ff5ecfd76e05e7b8fd2210675af51f3acf2eb95-nvram_net.txt"
From 2e32a401ea5df22ab899f4da3e5e1b448b2df51a Mon Sep 17 00:00:00 2001
From: Alexey Min <alexey.min@gmail.com>
Date: Thu, 7 Mar 2019 17:25:48 +0300
Subject: [PATCH 5/6] usb_gadget: set random rndis host MAC address to prevent
zero address
This fixes zero host MAC:
rndis0: MAC f6:45:91:9b:4e:43
rndis0: HOST MAC 00:00:00:00:00:00
and allows devive to automatically obtain IP addrest on PC host side
zero MAC address prevented interface from autoconfiguring
---
drivers/usb/gadget/function/u_ether.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index bf8b64d904c..9ce3ab6de34 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -1224,8 +1224,16 @@
dev_warn(&g->dev,
"using random %s ethernet address\n", "self");
#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
- memcpy(dev->host_mac, ethaddr, ETH_ALEN);
- printk(KERN_DEBUG "usb: set unique host mac\n");
+ 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);
#else
if (get_ether_addr(host_addr, dev->host_mac))
dev_warn(&g->dev,
--- a/drivers/video/exynos/decon/decon-int_drv.c
+++ b/drivers/video/exynos/decon/decon-int_drv.c
@@ -600,11 +600,11 @@
case 24:
/* our 24bpp is unpacked, so 32bpp */
var->bits_per_pixel = 32;
- var->red.offset = 16;
+ var->red.offset = 0;
var->red.length = 8;
var->green.offset = 8;
var->green.length = 8;
- var->blue.offset = 0;
+ var->blue.offset = 16;
var->blue.length = 8;
break;
--- a/drivers/net/wireless/bcmdhd4358/dhd.h
+++ b/drivers/net/wireless/bcmdhd4358/dhd.h
@@ -1468,13 +1468,7 @@
extern int dhdpcie_set_suspend_resume(struct pci_dev *dev, bool state);
#endif /* DHD_USE_IDLECOUNT && BCMPCIE */
-#ifdef DHD_LEGACY_FILE_PATH
-#define PLATFORM_PATH "/data/"
-#elif defined(PLATFORM_SLP)
-#define PLATFORM_PATH "/opt/etc/"
-#else
-#define PLATFORM_PATH "/data/misc/conn/"
-#endif /* DHD_LEGACY_FILE_PATH */
+#define PLATFORM_PATH "/lib/firmware/postmarketos/"
/*
* Enable this macro if you want to track the calls to wake lock
--- a/drivers/net/wireless/bcmdhd4359/dhd.h
+++ b/drivers/net/wireless/bcmdhd4359/dhd.h
@@ -1830,14 +1830,8 @@
extern bool dhd_query_bus_erros(dhd_pub_t *dhdp);
-#ifdef DHD_LEGACY_FILE_PATH
-#define PLATFORM_PATH "/data/"
-#elif defined(PLATFORM_SLP)
-#define PLATFORM_PATH "/opt/etc/"
-#else
-#define PLATFORM_PATH "/data/misc/conn/"
-#endif /* DHD_LEGACY_FILE_PATH */
+#define PLATFORM_PATH "/lib/firmware/postmarketos/"
/*
* Enable this macro if you want to track the calls to wake lock
--- a/drivers/media/platform/exynos/fimc-is/fimc-is-sec-define.h
+++ b/drivers/media/platform/exynos/fimc-is/fimc-is-sec-define.h
@@ -103,7 +103,7 @@
#define FIMC_IS_2P2_SETF "setfile_2p2.bin"
#define FIMC_IS_COMPANION_MASTER_SETF "companion_master_setfile.bin"
#define FIMC_IS_COMPANION_MODE_SETF "companion_mode_setfile.bin"
-#define FIMC_IS_FW_PATH "/system/vendor/firmware/"
+#define FIMC_IS_FW_PATH "/lib/firmware/postmarketos/"
#define FIMC_IS_FW_DUMP_PATH "/data/"
#define FIMC_IS_FW_BASE_MASK ((1 << 26) - 1)
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/lineageos_zerofltexx_defconfig
pkgname=linux-samsung-zeroltexx
pkgver=3.10.108
pkgrel=0
pkgdesc="Samsung Galaxy S6 edge kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="samsung-zeroltexx"
url="https://github.com/Exynos7420/android_kernel_samsung_exynos7420"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="bash bc linux-headers installkernel devicepkg-dev dtbtool-exynos"
# Source
_repository="android_kernel_samsung_exynos7420"
_commit="31cf7c95814358c4cd76feacf2f29bebc057fefc"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/Exynos7420/$_repository/archive/$_commit.tar.gz
$_config
01-fix-red-blue.patch
02-fix-wifi-firmware-path.patch
03-fix-fimc-is-firmware-path.patch
Makefile_fix_paths.patch
gcc10-extern_YYLOC_global_declaration.patch
0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.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"
# Master DTB (deviceinfo_bootimg_qcdt)
dtbTool-exynos --pagesize 2048 \
--platform 0x50a6 \
--subtype 0x217584da \
-o "$_outdir/arch/$_carch/boot"/dt.img \
$(find "$_outdir/arch/$_carch/boot/dts/" -name *zerolte_eur_open_*.dtb)
}
package() {
KERNEL_IMAGE_NAME="Image" downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img \
"$pkgdir"/boot/dt.img
}
sha512sums="
1f8917dfaf01865cbc0385579cad1565dcb1ec4445bbeaf3e70d0bd8a6a572a457813c311f54360f54c79b373e621d280982f560cf01091d156c90efcc98067b linux-samsung-zeroltexx-31cf7c95814358c4cd76feacf2f29bebc057fefc.tar.gz
48b7cde7bbd96931486f480c519adac057f3d7c74eff7ae6838f1084ed9b9a2ccb5f61c86d4dd21dc7ed292c5332d2adf4ee0a79476baacfcd47c193c6b84644 config-samsung-zeroltexx.aarch64
f3e4770bb251efefce312986eeec6c5a8a55066c5408cdd10e00ab2657a4bff155da6a19155ceaf39c5f34cc02cbbb7866aa7b4e65c33cdd3cff4590fadba2a4 01-fix-red-blue.patch
9afbb020311f0bf8043f021292d0f05041ff4e29003bf2114dfc31906869f44dbf15ff560170bc9e9baf62d7bb4ed73d58415212fecac6f1bdd6886783b0fcc1 02-fix-wifi-firmware-path.patch
c98a074f46376936493b74285632cf38818bdb9d5e7b70b5b291aa8774711a93f352cb569d856215ebc75a33f819a8ce6cd5ccbee506d0a81141938924cf45e3 03-fix-fimc-is-firmware-path.patch
00aac98cfbaa68bd30c41622b12f38106f6595e2d74ee5cdd05add56f03facb4db45deb43b5df997143b54497d621b9fc5bae7207898c70df0672ebb482c4b46 Makefile_fix_paths.patch
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
8684da1ef7032cb2160c9b071b2bf8cb57a31f5527ee3f6e9e3b58fa485a0ff244e3bc85446c8b09f5b5cec7d1a3f92da681f63495728aaa547438c93eb375d5 0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
"
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -197,11 +197,6 @@
CROSS_COMPILE ?= ../PLATFORM/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
#CROSS_COMPILE ?= /opt/toolchains/aarch64-linux-android-4.9/bin/aarch64-linux-android-
-ifeq ($(shell uname -s),Linux)
- ifeq ($(shell uname -m),x86_64)
- override CROSS_COMPILE := $(srctree)/../../../prebuilts/linaro/linux-x86/aarch64/bin/aarch64-linux-gnu-
- endif
-endif
# Architecture as present in compile.h
UTS_MACHINE := $(ARCH)
../../.shared-patches/linux/gcc10-extern_YYLOC_global_declaration.patch
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment