samsung-dream: new device (Samsung Galaxy S8/S8+) (MR 1725)

This commit is contained in:
Daniele Debernardi 2020-11-11 01:51:19 +01:00 committed by Alexey Min
parent 33b79866a4
commit 99438870d6
No known key found for this signature in database
GPG Key ID: 0B19D2A65870B448
11 changed files with 5701 additions and 0 deletions

View File

@ -0,0 +1,46 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-dream
pkgdesc="Samsung Galaxy S8/S8+"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="postmarketos-base mkbootimg mesa-dri-gallium msm-fb-refresher"
makedepends="devicepkg-dev"
source="deviceinfo initfs-hook.sh"
subpackages="
$pkgname-kernel-dreamlte:kernel_dreamlte
$pkgname-kernel-dream2lte:kernel_dream2lte
$pkgname-nonfree-firmware:nonfree_firmware
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
kernel_dreamlte() {
pkgdesc="Kernel for the Samsung Galaxy S8"
depends="$pkgname linux-samsung-dreamlte"
mkdir "$subpkgdir"
}
kernel_dream2lte() {
pkgdesc="Kernel for the Samsung Galaxy S8+"
depends="$pkgname linux-samsung-dream2lte"
mkdir "$subpkgdir"
}
nonfree_firmware() {
pkgdesc="Non-free firmware for the Samsung Galaxy S8/S8+"
depends="firmware-samsung-dream"
mkdir "$subpkgdir"
}
sha512sums="8fdfb5715a3eb4d757c53995875841b1fe6d9e98878b97a30e0ec8a86e8486487cf88c4d068448d1004eeec10c6196a387d113b490856b45336b27d431c374f9 deviceinfo
36868de8bbdcad55413ca455580c42848ba4ce07814b140eece2241e9656adfed4986da0aa0ec6ed04d478aeeab417be583b0fbcc79c90557798004c99e25d0e initfs-hook.sh"

View File

@ -0,0 +1,39 @@
# 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 S8/S8+"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-dream"
deviceinfo_year="2017"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1440"
deviceinfo_screen_height="2960"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_kernel_cmdline="buildvariant=eng"
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="USERDATA"
# USB related
deviceinfo_usb_idVendor="0x04e8" # Samsung Electronics Co., Ltd
deviceinfo_usb_idProduct="0x6860" # Galaxy (MTP)

View File

@ -0,0 +1,7 @@
#!/bin/sh
# shellcheck disable=SC1091
. /etc/deviceinfo
. ./init_functions.sh
# Device requires usb network initialization through configfs first
setup_usb_network_configfs

View File

@ -0,0 +1,29 @@
pkgname=firmware-samsung-dream
pkgver=1
pkgrel=0
pkgdesc="Firmware for the Samsung Galaxy S8/S8+"
url="https://github.com/exynos8895/android_vendor_samsung_universal8895-common"
arch="noarch"
license="proprietary"
options="!check !archcheck !strip !spdx"
# Source
_commit="2c1ff7083c728465386a1978279aa79d1dec086d"
_wifi_files="bcmdhd_sta.bin_b0 bcmdhd_clm.blob nvram.txt_r02j_b0"
for _file in $_wifi_files; do
source="$source $pkgname-$_commit-$_file::$url/raw/$_commit/proprietary/vendor/etc/wifi/$_file"
done
package() {
# Wifi
local file
for file in $_wifi_files; do
install -Dm644 "$srcdir/$pkgname-$_commit-$file" \
"$pkgdir/lib/firmware/postmarketos/$file"
done
}
sha512sums="64ee00df378c92fed8750dea1773107a1cbb1678bdcd481569f4af0f6b8f78a82fe0d886ea02be44f7df4ddfeaee763cf7407b4fa769f4a5e78b0e7b9ed2492c firmware-samsung-dream-2c1ff7083c728465386a1978279aa79d1dec086d-bcmdhd_sta.bin_b0
4f38b161ffdf720ddf8d82c831b0f0c3902668d78e9a078a04e92038000e49dcca9b0a792fb76f219a49f365351c9865c663f17607684a26f2ed933bf997f077 firmware-samsung-dream-2c1ff7083c728465386a1978279aa79d1dec086d-bcmdhd_clm.blob
ee72ac08334406d5d4166a879e6830613b7740f258ac421f7d6a353bd966cfa177fc9864732791121f73bc5169f64148ff07d3bb4687cca4e45341fc7e447868 firmware-samsung-dream-2c1ff7083c728465386a1978279aa79d1dec086d-nvram.txt_r02j_b0"

View File

@ -0,0 +1,15 @@
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 414e8b11..d66fd851 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4150,8 +4150,8 @@ cantfind_ext4:
/* for debugging, sangwoo2.lee */
/* If you wanna use the flag 'MS_SILENT', call */
/* 'print_bh' function within below 'if'. */
- printk(KERN_ERR "printing data of superblock-bh\n");
- print_bh(sb, bh, 0, EXT4_BLOCK_SIZE(sb));
+ //printk(KERN_ERR "printing data of superblock-bh\n");
+ //print_bh(sb, bh, 0, EXT4_BLOCK_SIZE(sb));
/* for debugging */
if (!silent)

View File

@ -0,0 +1,22 @@
From f1b806dd501eeca56d591da1b668d874e8e843c5 Mon Sep 17 00:00:00 2001
From: Daniele Debernardi <drebrez@gmail.com>
Date: Wed, 4 Nov 2020 01:50:15 +0100
Subject: [PATCH] Fix decon_reg.c
---
drivers/video/fbdev/exynos/dpu/decon_reg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/exynos/dpu/decon_reg.c b/drivers/video/fbdev/exynos/dpu/decon_reg.c
index 589d79f8fed8..226e601cc8a0 100644
--- a/drivers/video/fbdev/exynos/dpu/decon_reg.c
+++ b/drivers/video/fbdev/exynos/dpu/decon_reg.c
@@ -2588,7 +2588,7 @@ u32 decon_reg_get_height(u32 id, int dsi_mode)
return (FORMATTER_HEIGHT_GET(val));
}
-const double decon_clocks_table[][CLK_ID_MAX] = {
+const unsigned long decon_clocks_table[][CLK_ID_MAX] = {
/* VCLK, ECLK, ACLK, PCLK, DISP_PLL, resolution, MIC_ratio, DSC count */
{ 71, 168, 400, 66, 71, 1080 * 1920, MIC_COMP_BYPASS, 0},
{ 63, 168, 400, 66, 63, 1440 * 2560, MIC_COMP_RATIO_1_2, 0},

View File

@ -0,0 +1,25 @@
diff --git a/arch/arm64/boot/dts/exynos/Makefile b/arch/arm64/boot/dts/exynos/Makefile
index 4c7b0e624cd1..77a728a4ee47 100644
--- a/arch/arm64/boot/dts/exynos/Makefile
+++ b/arch/arm64/boot/dts/exynos/Makefile
@@ -1,17 +1,17 @@
# SPDX-License-Identifier: GPL-2.0
-dtb-$(CONFIG_CAMERA_DREAM) += exynos8895-dreamlte_eur_open_05.dtb \
+dtb-$(CONFIG_SOC_EXYNOS8895) += exynos8895-dreamlte_eur_open_05.dtb \
exynos8895-dreamlte_eur_open_07.dtb \
exynos8895-dreamlte_eur_open_08.dtb \
exynos8895-dreamlte_eur_open_09.dtb \
exynos8895-dreamlte_eur_open_10.dtb
-dtb-$(CONFIG_CAMERA_DREAM2) += exynos8895-dream2lte_eur_open_07.dtb \
+dtb-$(CONFIG_SOC_EXYNOS8895) += exynos8895-dream2lte_eur_open_07.dtb \
exynos8895-dream2lte_eur_open_08.dtb \
exynos8895-dream2lte_eur_open_09.dtb \
exynos8895-dream2lte_eur_open_10.dtb
-dtb-$(CONFIG_CAMERA_GREAT) += exynos8895-greatlte_eur_open_02.dtb \
+dtb-$(CONFIG_SOC_EXYNOS8895) += exynos8895-greatlte_eur_open_02.dtb \
exynos8895-greatlte_eur_open_06.dtb
always := $(dtb-y) $(dtbo-y)

View File

@ -0,0 +1,22 @@
diff --git a/drivers/net/wireless/bcmdhd4361/dhd.h b/drivers/net/wireless/bcmdhd4361/dhd.h
index df9f668aa1c8..6aa707fb5945 100644
--- a/drivers/net/wireless/bcmdhd4361/dhd.h
+++ b/drivers/net/wireless/bcmdhd4361/dhd.h
@@ -376,7 +376,7 @@ enum dhd_op_flags {
#if defined(CUSTOMER_HW4) && defined(PLATFORM_SLP)
#define CONFIG_BCMDHD_CLM_PATH "/lib/firmware/bcmdhd_clm.blob"
#else
-#define CONFIG_BCMDHD_CLM_PATH "/etc/wifi/bcmdhd_clm.blob"
+#define CONFIG_BCMDHD_CLM_PATH "/lib/firmware/postmarketos/bcmdhd_clm.blob"
#endif /* CUSTOMER_HW4 && PLATFORM_SLP */
#endif /* CONFIG_BCMDHD_CLM_PATH */
#define WL_CCODE_NULL_COUNTRY "#n"
@@ -2369,7 +2369,7 @@ extern char fw_path2[MOD_PARAM_PATHLEN];
#elif (ANDROID_PLATFORM_VERSION == 7)
#define VENDOR_PATH "/system"
#elif (ANDROID_PLATFORM_VERSION >= 8)
-#define VENDOR_PATH "/vendor"
+#define VENDOR_PATH ""
#endif /* ANDROID_PLATFORM_VERSION < 7 */
#else
#define VENDOR_PATH ""

View File

@ -0,0 +1,85 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/exynos8895-dreamlte_defconfig
pkgname=linux-samsung-dream
pkgver=4.4.111
pkgrel=0
pkgdesc="Meta package for Samsung Galaxy S8/S8+ kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="samsung-dream"
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-exynos"
subpackages="
${pkgname}lte:kernel_dreamlte
${pkgname}2lte:kernel_dream2lte
"
# Source
_repository="android_kernel_samsung_universal8895"
_commit="abd876b3b5fc80dc302183cd372067bab40efab5"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/exynos8895/$_repository/archive/$_commit.tar.gz
$_config
01-disable-ext4-debug.patch
02-fix-decon_reg.patch
03-change-dtb-config-var.patch
04-firmware-path.patch
linux4.2-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"
# Master DTB dreamlte (deviceinfo_bootimg_qcdt)
dtbTool-exynos --pagesize 2048 \
--platform 0x50a6 \
--subtype 0x217584da \
-o "$_outdir/arch/$_carch/boot/dt_dreamlte.img" \
$(find "$_outdir/arch/$_carch/boot/dts/" -name *dreamlte*.dtb)
# Master DTB dream2lte (deviceinfo_bootimg_qcdt)
dtbTool-exynos --pagesize 2048 \
--platform 0x50a6 \
--subtype 0x217584da \
-o "$_outdir/arch/$_carch/boot/dt_dream2lte.img" \
$(find "$_outdir/arch/$_carch/boot/dts/" -name *dream2lte*.dtb)
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
}
kernel_dreamlte() {
pkgdesc="Kernel for the Samsung Galaxy S8"
depends="$pkgname"
install -Dm644 "$builddir/$_outdir/arch/$_carch/boot/dt_dreamlte.img" \
"$subpkgdir"/boot/dt.img
}
kernel_dream2lte() {
pkgdesc="Kernel for the Samsung Galaxy S8+"
depends="$pkgname"
install -Dm644 "$builddir/$_outdir/arch/$_carch/boot/dt_dream2lte.img" \
"$subpkgdir"/boot/dt.img
}
sha512sums="a7c6d55d12ec5ef2bb388fae4106c63eb89ea0d4f8a682f45a0e15899484b633883cd40138eb2d36ef040b49301e48e3fdb44be92ecbfa20a7bbcda35f326a9c linux-samsung-dream-abd876b3b5fc80dc302183cd372067bab40efab5.tar.gz
1149f18147d54e1d35e5a0f186a1a15c7939712d76fa15479996255bcb654d42cf18e4de13dc436e3be1199dcb85dc10bfea1272a94caf7a479335aaa20336fc config-samsung-dream.aarch64
1779761fd276e3edc083d5d823c254da0606824157c353a52c35a81ca95b3ce5741fc42cd5cf9b5846ca9f2c823e207c97fc2c970254ee8d9c83c0e240b2ba6b 01-disable-ext4-debug.patch
939b2f5b569c3c9d8e088762e394edc6f4eae4a0f08e8c428f687e4e559bb278cefdd377023271487b6c937a6c5421050d7821cefa34c10d44e7cd904fd12b9a 02-fix-decon_reg.patch
6ad12c90f66b10e6b58e161e44841cbbb73e0aef22e4a32fa390ac664451287c253501c9cf84b87aeac41c13fa29b1d8330df3dd58f890567d8a8543a2432505 03-change-dtb-config-var.patch
18082be5bcb4eec18b4916a116a40653826e45ccc52b6cc364790c37ba9056f383c82ae2027a613b9f1973463ea9dfc09ea2d3e19c0cccb16e65507b42931ec9 04-firmware-path.patch
eaf2e61fcb508cdd239b8fed209d2a09ecac77287f6b46d003918fdf1c6fa2ee63f7390f3ff7c49029b8ed6cbcdd81c7e9a4b1ece9f5060b6fc84e322bd47f41 linux4.2-gcc10-extern_YYLOC_global_declaration.patch"

File diff suppressed because it is too large Load Diff

View File

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