samsung-on7xelte: new device (MR 4220)

[ci:skip-build]: already built successfully in CI
This commit is contained in:
methanal 2023-07-03 16:02:49 +00:00 committed by Dylan Van Assche
parent d49c15000f
commit 58690846bb
No known key found for this signature in database
GPG key ID: 8642571587897EA1
14 changed files with 5028 additions and 0 deletions

View file

@ -0,0 +1,46 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-on7xelte
pkgdesc="Samsung Galaxy J7 Prime"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-samsung-on7xelte
mkbootimg
msm-fb-refresher
postmarketos-base
"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware $pkgname-lightdm"
makedepends="devicepkg-dev"
source="
deviceinfo
lightdm.conf
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="Proprietary Firmware blobs"
depends="firmware-samsung-on7xelte"
mkdir "$subpkgdir"
}
lightdm() {
install_if="$pkgname=$pkgver-r$pkgrel lightdm"
install -Dm644 lightdm.conf \
"$subpkgdir"/etc/lightdm/lightdm.conf.d/00-on7xelte.conf
}
sha512sums="
ce87c75f3b16ed56aea5577d9b1da96b90a22d8778639db80636fd5d9ee0f3633c814ae3280542385f6c7ce4fbd0eafbd4c98776aa5e657f4331b8e0b2fadff2 deviceinfo
baee319b6d2f49a15680b0f322ec3e398a071d73fbf7713d14f26a1d027f8950457a482ac3f019605af3dfcf25bbb33ebaa0ffde181f7f96d911d56251c81eef lightdm.conf
"

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 J7 Prime"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-on7xelte"
deviceinfo_year="2016"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="1920"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_kernel_cmdline="androidboot.selinux=permissive androidboot.selinux=permissive"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="2048"
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_system="SYSTEM"

View file

@ -0,0 +1,2 @@
[LightDM]
logind-check-graphical=false

View file

@ -0,0 +1,42 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=firmware-samsung-on7xelte
pkgver=1
pkgrel=0
pkgdesc="Samsung Galaxy J7 Prime Firmware"
url="https://github.com/DevOtag-Open-Source/android_vendor_samsung_on7xelte"
arch="aarch64"
license="proprietary"
options="!check !archcheck !tracedeps pmb:cross-native"
_commit="51b221e521ff93e51c40366f0245d6815248f817"
_repo="https://raw.githubusercontent.com/DevOtag-Open-Source/android_vendor_samsung_on7xelte/eleven/proprietary/"
_prefix=$pkgname-$_commit
_files_etc="bcmdhd_sta.bin nvram_net.txt"
_files_vendor="mfc_fw.bin fimc_is_lib.bin bcm43438A1_V0068.0286.hcd setfile_4h5yc.bin setfile_imx258.bin"
for _file in $_files_etc; do
source="$source $_prefix-$_file::$_repo/etc/wifi/$_file"
done
for _file in $_files_vendor; do
source="$source $_prefix-$_file::$_repo/vendor/firmware/$_file"
done
package() {
local file
for file in $_files_etc $_files_vendor; do
install -Dm644 "$srcdir/$_prefix-$file" \
"$pkgdir/lib/firmware/postmarketos/$file"
done
}
sha512sums="
fa250eecbbea53e0a5dbe8317e9a40ee189d4f016122fedff93d299cd799b8f95761643ce4042709a83705189348cf5d5b5bcf74acbeb7d84dc30ec3a62ee6c5 firmware-samsung-on7xelte-51b221e521ff93e51c40366f0245d6815248f817-bcmdhd_sta.bin
183fa0fc0bb87602154d23b6fcaf699f0556919b4a9625ff83df4ba2514beb79a1abcb4fb7d2d18e2d57bc726caea579715c377225c7efffb03a65fa5aa2ab56 firmware-samsung-on7xelte-51b221e521ff93e51c40366f0245d6815248f817-nvram_net.txt
ef58a1c6bfebd7ef43cc16de834a8446cc373a3e304dac279c6d7f061bda80f96a9f5b9e2b6d21de7eb53f4abfddeb597306bbf2eed579b1441a247e29bf888e firmware-samsung-on7xelte-51b221e521ff93e51c40366f0245d6815248f817-mfc_fw.bin
2eacf2bac885578d1619978b33a9cf14357dda024705c7a88449b460aec08d94e499d5c5ff7f96862591dbf667729a3b0f772a3f00c0c06ebe07f9d227d89086 firmware-samsung-on7xelte-51b221e521ff93e51c40366f0245d6815248f817-fimc_is_lib.bin
a86e5021f8c3e8fd4f568a412ae9052e70ada65cbf8cf46b7d6c27ec8ef6e925d0eeff843214451959e783b04a06803ed5bb39e064fbbaae7421e41dbb93d19e firmware-samsung-on7xelte-51b221e521ff93e51c40366f0245d6815248f817-bcm43438A1_V0068.0286.hcd
4da1d0b5cfd608a5d22d1b8b35c4b7bc6915a2da3a999d9d4c1a38404686c9aefb9508e90b4c84c7d88b6a715ff71b8de04c8959f7cc830c82cb45485ad152fc firmware-samsung-on7xelte-51b221e521ff93e51c40366f0245d6815248f817-setfile_4h5yc.bin
29d8601d4f77fe49a38ec974d7ad432f1815e55a7f9d011fcdaa45580653c395a7f89debdea7588f693a111043f9dee286948ed1e4fbb1b1b4807ec6799ba34f firmware-samsung-on7xelte-51b221e521ff93e51c40366f0245d6815248f817-setfile_imx258.bin
"

View file

@ -0,0 +1,101 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/on7xelteswa_00_defconfig
pkgname=linux-samsung-on7xelte
pkgver=3.18.14
pkgrel=0
pkgdesc="Samsung Galaxy J7 Prime kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="samsung-on7xelte"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
bash
bc
bison
devicepkg-dev
dtbtool-exynos
findutils
flex
gcc4
openssl-dev
perl
"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
# Compiler: GCC 4 (doesn't boot when compiled with newer versions)
if [ "${CC:0:5}" != "gcc4-" ]; then
CC="gcc4-$CC"
HOSTCC="gcc4-gcc"
CROSS_COMPILE="gcc4-$CROSS_COMPILE"
fi
# Source
_repository="linux-downstream-on7xelte"
_commit="9932b75127e6363e40a00b6bc6f5ec71ac7fea32"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://gitlab.com/linuxforexynos/$_repository/-/archive/$_commit/$_repository-$_commit.tar.gz
$_config
gcc10-extern_YYLOC_global_declaration.patch
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
generate-device-dtbs.patch
disable-fimc-is2.patch
fix-usb-gadget-random-mac.patch
disable-charging-bootmode.patch
decon-fb-colors.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
prepare() {
default_prepare
. downstreamkernel_prepare
}
build() {
unset LDFLAGS
# Samsung's kernels are built in-tree.
# Copy some missing files to the output directory.
mkdir -p "$_outdir/init/"
mkdir -p "$_outdir/firmware/"
cp init/vmm.elf "$_outdir/init/vmm.elf"
cp firmware/gnss_firmware.bin "$_outdir/firmware/gnss_firmware.bin"
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
# Master DTB (deviceinfo_bootimg_qcdt)
dtbTool-exynos -o "$_outdir/arch/$_carch/boot"/dt.img \
$(find "$_outdir/arch/$_carch/boot/dts/" -name *exynos7870*.dtb)
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" \
"$_flavor" "$_outdir"
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img \
"$pkgdir"/boot/dt.img
}
nonfree_firmware() {
pkgdesc="Proprietary Firmware Blobs"
depends="firmware-samsung-on7xelte"
mkdir "$subpkgdir"
}
sha512sums="
a988ccbd860dfc0147387ca1f2045534d9ccc82d94213abc586b9556c93c99025ed3d7e0658d41ac2bc4803093cd9352f98611c9a08438fae16a2139e799ec47 linux-samsung-on7xelte-9932b75127e6363e40a00b6bc6f5ec71ac7fea32.tar.gz
96360349f21f39ffdfd05d5f8d16daf067941b66e412b4d4366ac5c79746e06d2a4abf68b9b1d4031e78e06f5dcc9d40972dfbb6186dc1d693dd2f607668a422 config-samsung-on7xelte.aarch64
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
ecfdee788bdfd5bf7c6a740f06a0f43b485e6b4d839f821082e5c734b97ca57396498f7467533afb10c2c32f86c217ec23772845d1dfed36c7d05b57b1f9131d generate-device-dtbs.patch
f429f40a8195e81d1c3ef86a5736bb29e09f3daaa2f415b9a992fb4dc8011c961c7b48fc97e08c3180ebacf8c2b97a5560022a9340eb44464e8ef98f3758e19e disable-fimc-is2.patch
0d56ba508408dc31961ad688f7fd960b0008851fd5729088658095417781b99962740e0c64d162a26f8389e4b4dc88e291252e7935e896fc70bf73c23150caea fix-usb-gadget-random-mac.patch
32e51c6171bcb72b15f5f11a9c9b3279e03e630f2ea6d14b66fbfdd8a8c1587bdb7e88698197e9a81e05c47dba08d13c1ff4a5e4692d14b042f07dd2006c1cc0 disable-charging-bootmode.patch
5bd204239a5daff9f990757178398707ae5ec64f823ed9ec72a8d50ebe6d5f0a3cc9743e0d775094da4b3a7566f1ccceb56f39f3b0234d08ca05e537d86271ec decon-fb-colors.patch
"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
diff --git a/drivers/video/fbdev/exynos/decon_7870/decon-int_drv.c b/drivers/video/fbdev/exynos/decon_7870/decon-int_drv.c
index 15e7e22b..29f1dc49 100644
--- a/drivers/video/fbdev/exynos/decon_7870/decon-int_drv.c
+++ b/drivers/video/fbdev/exynos/decon_7870/decon-int_drv.c
@@ -335,7 +335,7 @@ static u32 wincon(u32 bits_per_pixel, u32 transp_length)
case 32:
if (transp_length > 0) {
data |= WINCON_BLD_PIX;
- data |= WINCON_BPPMODE_ABGR8888;
+ data |= WINCON_BPPMODE_ARGB8888;
} else {
data |= WINCON_BPPMODE_XRGB8888;
}

View file

@ -0,0 +1,14 @@
diff --git a/drivers/staging/samsung/sec_batt.c b/drivers/staging/samsung/sec_batt.c
index 89960640..5de0b91e 100644
--- a/drivers/staging/samsung/sec_batt.c
+++ b/drivers/staging/samsung/sec_batt.c
@@ -20,9 +20,6 @@ EXPORT_SYMBOL(lpcharge);
static int sec_bat_is_lpm_check(char *str)
{
- if (strncmp(str, "charger", 7) == 0)
- lpcharge = 1;
-
pr_info("%s: Low power charging mode: %d\n", __func__, lpcharge);
return lpcharge;

View file

@ -0,0 +1,30 @@
diff --git a/drivers/leds/leds-s2mu005.c b/drivers/leds/leds-s2mu005.c
index 1e8c0b70..d7d6ac3d 100644
--- a/drivers/leds/leds-s2mu005.c
+++ b/drivers/leds/leds-s2mu005.c
@@ -24,7 +24,9 @@
#include <linux/platform_device.h>
#include <linux/sec_batt.h>
+#ifdef CONFIG_VIDEO_EXYNOS_FIMC_IS2
extern struct class *camera_class;
+#endif
struct device *flash_dev;
bool assistive_light = false;
#ifdef CONFIG_LEDS_SUPPORT_FRONT_FLASH
@@ -1139,6 +1141,7 @@ int create_flash_sysfs(void)
{
int err = -ENODEV;
+#ifdef CONFIG_VIDEO_EXYNOS_FIMC_IS2
if (IS_ERR_OR_NULL(camera_class)) {
pr_err("flash_sysfs: error, camera class not exist");
return -ENODEV;
@@ -1149,6 +1152,7 @@ int create_flash_sysfs(void)
pr_err("flash_sysfs: failed to create device(flash)\n");
return -ENODEV;
}
+#endif
err = device_create_file(flash_dev, &dev_attr_rear_flash);
if (unlikely(err < 0)) {

View file

@ -0,0 +1,24 @@
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index 2502ce1d..c6028edc 100755
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -1262,18 +1262,13 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
if (get_ether_addr(dev_addr, net->dev_addr))
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");
-
-#else
if (get_ether_addr(host_addr, dev->host_mac))
dev_warn(&g->dev,
"using random %s ethernet address\n", "host");
if (ethaddr)
memcpy(ethaddr, dev->host_mac, ETH_ALEN);
-#endif
+
net->netdev_ops = &eth_netdev_ops;
net->ethtool_ops = &ops;

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,12 @@
diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
index b45f462b..f0031b4a 100644
--- a/arch/arm64/boot/dts/Makefile
+++ b/arch/arm64/boot/dts/Makefile
@@ -4,6 +4,7 @@ dtb-$(CONFIG_ARCH_XGENE) += apm-mustang.dtb
dtb-$(CONFIG_SOC_EXYNOS8890) += exynos8890-espresso8890.dtb exynos8890-espresso8890_rev01.dtb exynos8890-universal8890.dtb exynos8890-smdk8890.dtb
dtb-$(CONFIG_SOC_EXYNOS8890) += exynos8890-evt1-smdk8890.dtb
dtb-$(CONFIG_SOC_EXYNOS7870) += exynos7870-smdk7870.dtb exynos7870-universal7870.dtb exynos7870-universal7870_rev01.dtb exynos7870-universal7870_rev01_treble_off.dtb
+dtb-$(CONFIG_SOC_EXYNOS7870) += exynos7870-on7xelte_swa_open_00.dtb exynos7870-on7xelte_swa_open_01.dtb exynos7870-on7xelte_swa_open_02.dtb
targets += dtbs