samsung-j5y17lte: new device (MR 4797)

[ci:skip-build]: Already built successfully in CI.
This commit is contained in:
Andras Sebok 2024-02-07 20:43:03 +01:00 committed by Stefan Hansson
parent 497374e290
commit 0bc724b8ba
No known key found for this signature in database
GPG key ID: 8A700086A9FE41FD
12 changed files with 5147 additions and 0 deletions

View file

@ -46,6 +46,8 @@ device/*/device-samsung-coreprimevelte/ @legolivesmatter @balejk
device/*/linux-samsung-coreprimevelte/ @legolivesmatter @balejk
device/*/linux-postmarketos-allwinner/ @Arnavion
device/*/u-boot-pinephone/ @Arnavion
device/*/device-samsung-j5y17lte/ @andrisas
device/*/linux-samsung-j5y17lte/ @andrisas
main/postmarketos-update-depthcharge-kernel/ @jenneron
main/postmarketos-ui-plasma-mobile/ @bshah

View file

@ -0,0 +1,34 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: andrisas <sebokandris2009@gmail.com>
pkgname=device-samsung-j5y17lte
pkgdesc="Samsung Galaxy J5 (2017)"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-samsung-j5y17lte
mkbootimg
postmarketos-base
postmarketos-base-downstream
msm-fb-refresher
"
makedepends="devicepkg-dev"
source="
deviceinfo
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="
adf750c15f4697e38e4b7d879991e917591fe0f0d1bafd006e35e5fdd0198d47420aa1afc73c1c7b3e21f678745a876bab0e7f0c5268035e72bc627e5d9f031c deviceinfo
"

View file

@ -0,0 +1,27 @@
# 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 J5 (2017)"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-j5y17lte"
deviceinfo_year="2017"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="true"
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"

View file

@ -0,0 +1,85 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/j5y17lte_defconfig
# Maintainer: andrisas <sebokandris2009@gmail.com>
pkgname=linux-samsung-j5y17lte
pkgver=3.18.91
pkgrel=0
pkgdesc="Samsung Galaxy J5 (2017) kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="samsung-j5y17lte"
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
openssl-dev
perl
xz
curl
"
# Source
_commit="f4287836ad123f50c41e4369ee37d5c913f88108"
_repository="Helios_7870"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.zip::https://github.com/ananjaser1211/$_repository/archive/$_commit.zip
$_config
gcc8-fix-put-user.patch
gcc10-extern_YYLOC_global_declaration.patch
fix-firmware-make.patch
place-cpu_setup-in-text.patch
fix-usb-gadget-random-mac.patch
create_flash_sysfs-return-enodev.patch
allow-building-without-make-mrproper.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
prepare() {
default_prepare
. downstreamkernel_prepare
}
build() {
unset LDFLAGS
mkdir -p "$_outdir/firmware/"
cp firmware/gnss_firmware.bin "$_outdir/firmware/gnss_firmware.bin"
sed -i 's/exynos7870\.dtsi/\.\.\/exynos7870_Oneui.dtsi/g' arch/arm64/boot/dts/*
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 *j5y17lte*.dtb)
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" \
"$_flavor" "$_outdir"
install -Dm644 "$_outdir/arch/$_carch/boot"/dt.img \
"$pkgdir"/boot/dt.img
}
sha512sums="
bb9570ebab2df5625bd068ed64f3ff6e79b5843be25a0d5e6f0cdd4e7afa5f24bde24ef12d6516d9cc5bb6e8f423a0757506773ff7c839140bb28a35f35a3325 linux-samsung-j5y17lte-f4287836ad123f50c41e4369ee37d5c913f88108.zip
0a53965d6e1ddcf2eafbd3d78f7e8c188e7f7e8e21ce3e6f76e982e045095dd0ab24de08112b2c2ff00f48a733c2a5d303b6b440cdf6bcc90d7d604f5ebcf822 config-samsung-j5y17lte.aarch64
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
66af05562023bebc8334db8236655960e306aa4e2ce216129a077a762bcf951b8c2c286e1c3f45c6478296769e3b6a70f88256e909a9c48f2539bfc056ecf312 fix-firmware-make.patch
ef361f4729efeb6442bdd028798a3ba8f34901cbcbedc318ae0788e23e7c897897587cee82f334d2ec5d7954a73d409bd25f1742d53ba704dd2b672a5de80f26 place-cpu_setup-in-text.patch
0d56ba508408dc31961ad688f7fd960b0008851fd5729088658095417781b99962740e0c64d162a26f8389e4b4dc88e291252e7935e896fc70bf73c23150caea fix-usb-gadget-random-mac.patch
45ac6b181474ade6c3056e390ee12791726995835191507ee4bf36a96b40bcd0718d8a5584fe2a9ced556f46737103e94a7b879355cac85b9008e5735fdee6a0 create_flash_sysfs-return-enodev.patch
80fb92f7cf56d37a064032eb29cc3f579bab0078e9354ff9aeee9646d248e2cc7ce519d2c5d879d67370b34afba750e06995f0b320c4039679c3311ebd5c3f47 allow-building-without-make-mrproper.patch
"

View file

@ -0,0 +1,23 @@
diff --git a/Makefile b/Makefile
index 8186b0839..d5adb8bf0 100755
--- a/Makefile
+++ b/Makefile
@@ -1033,14 +1033,7 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
# and if so do:
# 1) Check that make has not been executed in the kernel src $(srctree)
prepare3: include/config/kernel.release
-ifneq ($(KBUILD_SRC),)
- @$(kecho) ' Using $(srctree) as source for kernel'
- $(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
- echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \
- echo >&2 " in the '$(srctree)' directory.";\
- /bin/false; \
- fi;
-endif
+
# prepare2 creates a makefile if using a separate output directory
prepare2: prepare3 outputmakefile asm-generic
--
2.43.0

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,15 @@
diff --git a/drivers/leds/leds-s2mu005.c b/drivers/leds/leds-s2mu005.c
index 05daa6e6f..712ccedba 100755
--- a/drivers/leds/leds-s2mu005.c
+++ b/drivers/leds/leds-s2mu005.c
@@ -1152,6 +1152,7 @@ dt_err:
int create_flash_sysfs(void)
{
int err = -ENODEV;
+ return err;
if (IS_ERR_OR_NULL(camera_class)) {
pr_err("flash_sysfs: error, camera class not exist");
--
2.43.0

View file

@ -0,0 +1,46 @@
diff --git a/firmware/Makefile b/firmware/Makefile
index ea35f1ea..2cf87e7a 100755
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -147,22 +147,6 @@ fw-shipped-$(CONFIG_TOUCHSCREEN_MELFAS_MMS438) += tsp_melfas/mms438_j7x.fw tsp_m
fw-shipped-$(CONFIG_TOUCHSCREEN_ATMEL_MXT1664) += tsp_atmel/mxt1664t_matisse.fw
-TSPFIRMWARE_DIRECTORY = firmware/tsp_stm
-ifeq ($(shell test -d $(TSPFIRMWARE_DIRECTORY) && echo yes),yes)
-fw-shipped-$(CONFIG_TOUCHSCREEN_FTS7) += tsp_stm/matisse.fw tsp_stm/stm_gtaxl.fw tsp_stm/fts1a096_gtaxl_rev03.fw \
- tsp_stm/fts1a096_gtaxl_note.fw
-fw-shipped-$(CONFIG_TOUCHSCREEN_FTS) += tsp_stm/fts8cd56_gtactive2.fw
-fw-shipped-$(CONFIG_TOUCHSCREEN_FTS1BA90A) += tsp_stm/fts1ba90a_gtadv2.fw
-else
-$(warning '$(TSPFIRMWARE_DIRECTORY)' directory dose not exist)
-endif
-TSPFIRMWARE_DIRECTORY = firmware/tsp_zinitix
-ifeq ($(shell test -d $(TSPFIRMWARE_DIRECTORY) && echo yes),yes)
-fw-shipped-$(CONFIG_TOUCHSCREEN_ZINITIX_ZT75XX) += tsp_zinitix/zt7548_degas2.fw tsp_zinitix/zt7538_o7.fw
-fw-shipped-$(CONFIG_TOUCHSCREEN_ZINITIX_ZT75XX_TCLM) += tsp_zinitix/zt7548_a6lte.fw tsp_zinitix/zt7548_j6.fw
-else
-$(warning '$(TSPFIRMWARE_DIRECTORY)' directory dose not exist)
-endif
fw-shipped-$(CONFIG_TOUCHSCREEN_ZINITIX_BT541C) += tsp_zinitix/bt541c_GPPIris.fw
fw-shipped-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_DSX2) += tsp_synaptics/td4300_on7xelte.fw
@@ -182,8 +166,8 @@ fw-shipped-$(CONFIG_KEYBOARD_TC300K) += coreriver/tc350k_j7x.fw coreriver/tc305k
coreriver/tc305k_j7top_kor.fw coreriver/tc305k_j7top_gsm.fw
fw-shipped-$(CONFIG_KEYBOARD_MELFAS_MHS204) += melfas_tk/mhs204g_on7xlte.fw
fw-shipped-$(CONFIG_KEYBOARD_MELFAS_MHS2041) += melfas_tk/mhs204_j5y17.fw melfas_tk/mhs2041_j5y17.fw melfas_tk/mhs2041_j7y17.fw
-fw-shipped-$(CONFIG_KEYBOARD_MELFAS_MHS2041B) += melfas_tk/mhs2041_j5y17.fw melfas_tk/mhs2041B_j5y17.fw melfas_tk/mhs2041B_j5y17_new.fw \
- melfas_tk/mhs2041_j7y17.fw melfas_tk/mhs2041B_j7y17.fw melfas_tk/mhs2041B_j7y17_new.fw \
+fw-shipped-$(CONFIG_KEYBOARD_MELFAS_MHS2041B) += melfas_tk/mhs2041B_j5y17.fw melfas_tk/mhs2041B_j5y17_new.fw \
+ melfas_tk/mhs2041B_j7y17.fw melfas_tk/mhs2041B_j7y17_new.fw \
melfas_tk/mhs2041B_j7y17_ltn.fw melfas_tk/mhs2041B_j7y17_open.fw melfas_tk/melfas_mip4_tk.fw
fw-shipped-$(CONFIG_KEYBOARD_ABOV_TOUCH_FT1804) += abov/abov_a7_max.fw
@@ -201,7 +185,6 @@ fw-shipped-$(CONFIG_SENSORS_SSP_2017A3) += ssp_stmf410_a2017.fw
fw-shipped-$(CONFIG_SENSORS_SSP_A3XPREMIUM) += ssp_stmf410_a3p.fw
fw-shipped-$(CONFIG_SENSORS_SSP_A3Y17PREMIUM) += ssp_stmf410_a2017_p.fw
fw-shipped-$(CONFIG_SENSORS_SSP_STM32) += ssp_crashed.fw
-fw-shipped-$(CONFIG_SENSORS_SSP_STM_V2) += ssp_crashed.fw
# FPGA for IRIS
fw-shipped-$(CONFIG_LEDS_IRIS_FPGA_ICE40XX) += ice40xx/ice40_fpga_iris_V01.fw

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/gcc8-fix-put-user.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/place-cpu_setup-in-text.patch