samsung-j8y18lte: new device (Samsung Galaxy J8 (2018)) (MR 3426)

[ci:skip-build]: already built successfully in CI
This commit is contained in:
lucasredelive 2022-09-12 15:19:54 +00:00 committed by Oliver Smith
parent 2e4f21edaf
commit 8982682ea6
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
14 changed files with 5580 additions and 0 deletions

View file

@ -0,0 +1,6 @@
/lib/firmware/postmarketos/a506_zap.b00
/lib/firmware/postmarketos/a506_zap.b01
/lib/firmware/postmarketos/a506_zap.b02
/lib/firmware/postmarketos/a506_zap.mdt
/lib/firmware/postmarketos/a530_pfp.fw
/lib/firmware/postmarketos/a530_pm4.fw

View file

@ -0,0 +1,47 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-j8y18lte
pkgdesc="Samsung Galaxy J8 (2018)"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-samsung-j8y18lte
mdss-fb-init-hack
mesa-dri-gallium
mkbootimg
msm-fb-refresher
postmarketos-base
"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="deviceinfo initfs-hook.sh directfbrc fb.modes 30-gpu-firmware.files"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
install -Dm644 "$srcdir"/fb.modes -t "$pkgdir"/etc
install -Dm644 "$srcdir"/directfbrc -t "$pkgdir"/etc
}
nonfree_firmware() {
pkgdesc="WiFi, Bluetooth, ADSP, Venus and GPU Firmware"
depends="firmware-samsung-j8y18lte wcnss-wlan linux-firmware-qcom"
mkdir "$subpkgdir"
install -Dm644 "$srcdir/30-gpu-firmware.files" -t \
"$subpkgdir/etc/postmarketos-mkinitfs/files"
}
sha512sums="
01058aec404bf98a10949c99ba0da4586ec2224d0bd82419dd005e1fc0c9b8aa6b6fbeb80f443d24eb90e70b477c6c97f09b4b143926d86a7446d5eb8f395104 deviceinfo
a6d2541ae1a1bf1c74ddbe40d821e450ab1c02b3dd8c5228491616a92a73c181207460e4657473e0e5272472513a2cd92382147355c9ce150b223cdb1f21d396 initfs-hook.sh
3db3ec596e159be926ea2b5b2496c18e9bc7be24a64a232a56c89a0c9ee710aa2efb2b6fa9fc08efa34759e8242e6c629d08a4ce688ec8aa125830717c191515 directfbrc
070eb0e3716d1a13517667d6cc6db720cc865f56f7619b1d4d864157567656128523cfa935236fff30a211a011b5c53b66d0cc28c256ba115a86aac82f4dffe9 fb.modes
302c0bec754bb79ef561c1a8d4ff34ba52b904c853bce6a15a79ba7b5b7a3d02c1c75bbe86d59be7b608a6dc744dd3e3c638eaa4539c53d20fa55fa5ea397d74 30-gpu-firmware.files
"

View file

@ -0,0 +1,32 @@
# 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 J8 (2018)"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-j8y18lte"
deviceinfo_year="2018"
deviceinfo_arch="aarch64"
# Device related
gpu_accelerated=true
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="720"
deviceinfo_screen_height="1480"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=30 msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 firmware_class.path=/vendor/firmware_mnt/image loop.max_part=7 vmalloc=400M buildvariant=user"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="2048"
deviceinfo_flash_offset_base="0x80000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x02000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x01e00000"

View file

@ -0,0 +1 @@
pixelformat=ARGB

View file

@ -0,0 +1,7 @@
mode "720x1480-60"
# D: 156.104 MHz, H: 131.180 kHz, V: 60.009 Hz
geometry 720 1480 720 1480 16
timings 6406 53 53 24 1 4 1
accel false
rgba 8/0,8/8,8/16,8/24
endmode

View file

@ -0,0 +1,10 @@
#!/bin/sh
# enable touchscreen
echo 1 > /sys/devices/soc/78b7000.i2c/i2c-3/3-0020/drv_irq
# fixes the "boot to black screen" issue
echo 0 0 > /sys/class/graphics/fb0/pan
# Start Panel
startx

View file

@ -0,0 +1,25 @@
pkgname=firmware-samsung-j8y18lte
pkgver=1
pkgrel=0
pkgdesc="Firmware files for Samsung Galaxy J8 (2018)"
url="https://github.com/lucasredelive/firmware-samsung-j8y18lte"
arch="aarch64"
license="proprietary"
options="!strip !check !archcheck !spdx !tracedeps pmb:cross-native"
# Source
_commit="d3574f77a5492a5fb36e1fe3c5257a597500d207"
builddir="$srcdir/firmware-samsung-j8y18lte-$_commit"
source="$pkgname.tar.gz::$url/archive/$_commit/$pkgname-$_commit.tar.gz
firmware.files"
package() {
for i in $(cat "$srcdir"/firmware.files); do
install -Dm644 "$i" "$pkgdir/$i"
done
}
sha512sums="
2d55450e7b841c45a68f571000287d17beeb351d3c5f361263cff85702123c3af843c8387346ee8c8103ce85210ce2738e5da985156c3bb26d96d4cc48d5c5a0 firmware-samsung-j8y18lte.tar.gz
2f9bea448bdeff6b408bba46dccbb3324d7d38de8b63a5571d392a85bdb33895c74a3f2576a37835312e017e2e398c463e133277fa6a7de34583654276d1ee03 firmware.files
"

View file

@ -0,0 +1,63 @@
./lib/firmware/postmarketos/a506_zap.b00
./lib/firmware/postmarketos/a506_zap.b01
./lib/firmware/postmarketos/a506_zap.b02
./lib/firmware/postmarketos/a506_zap.mdt
./lib/firmware/postmarketos/a530_pfp.fw
./lib/firmware/postmarketos/a530_pm4.fw
./lib/firmware/postmarketos/adsp.b00
./lib/firmware/postmarketos/adsp.b01
./lib/firmware/postmarketos/adsp.b02
./lib/firmware/postmarketos/adsp.b03
./lib/firmware/postmarketos/adsp.b04
./lib/firmware/postmarketos/adsp.b05
./lib/firmware/postmarketos/adsp.b06
./lib/firmware/postmarketos/adsp.b07
./lib/firmware/postmarketos/adsp.b08
./lib/firmware/postmarketos/adsp.b09
./lib/firmware/postmarketos/adsp.b10
./lib/firmware/postmarketos/adsp.b11
./lib/firmware/postmarketos/adsp.b12
./lib/firmware/postmarketos/adsp.b13
./lib/firmware/postmarketos/adsp.b14
./lib/firmware/postmarketos/adsp.mdt
./lib/firmware/postmarketos/mba.mbn
./lib/firmware/postmarketos/modem.b00
./lib/firmware/postmarketos/modem.b01
./lib/firmware/postmarketos/modem.b02
./lib/firmware/postmarketos/modem.b04
./lib/firmware/postmarketos/modem.b05
./lib/firmware/postmarketos/modem.b06
./lib/firmware/postmarketos/modem.b07
./lib/firmware/postmarketos/modem.b08
./lib/firmware/postmarketos/modem.b09
./lib/firmware/postmarketos/modem.b10
./lib/firmware/postmarketos/modem.b11
./lib/firmware/postmarketos/modem.b12
./lib/firmware/postmarketos/modem.b13
./lib/firmware/postmarketos/modem.b16
./lib/firmware/postmarketos/modem.b17
./lib/firmware/postmarketos/modem.b18
./lib/firmware/postmarketos/modem.b19
./lib/firmware/postmarketos/modem.b20
./lib/firmware/postmarketos/modem.mdt
./lib/firmware/postmarketos/qdsp6m.qdb
./lib/firmware/postmarketos/venus.b00
./lib/firmware/postmarketos/venus.b01
./lib/firmware/postmarketos/venus.b02
./lib/firmware/postmarketos/venus.b03
./lib/firmware/postmarketos/venus.b04
./lib/firmware/postmarketos/venus.mdt
./lib/firmware/postmarketos/wcnss.b00
./lib/firmware/postmarketos/wcnss.b01
./lib/firmware/postmarketos/wcnss.b02
./lib/firmware/postmarketos/wcnss.b04
./lib/firmware/postmarketos/wcnss.b06
./lib/firmware/postmarketos/wcnss.b09
./lib/firmware/postmarketos/wcnss.b10
./lib/firmware/postmarketos/wcnss.b11
./lib/firmware/postmarketos/wcnss.b12
./lib/firmware/postmarketos/wcnss.mdt
./lib/firmware/postmarketos/wlan/prima/WCNSS_qcom_wlan_nv.bin
./lib/firmware/postmarketos/wlan/prima/WCNSS_cfg.dat
./lib/firmware/postmarketos/wlan/prima/WCNSS_qcom_cfg.ini
./lib/firmware/postmarketos/wlan/prima/grippower.info

View file

@ -0,0 +1,69 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/j8y18lte_defconfig
pkgname=linux-samsung-j8y18lte
pkgver=3.18.124
pkgrel=0
pkgdesc="Samsung Galaxy J8 (2018) kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="samsung-j8y18lte"
url="https://github.com/lucasredelive/android_kernel_samsung_j8y18lte"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
bash
bc
bison
devicepkg-dev
flex
gcc6
openssl-dev
perl
"
# Compiler: GCC 6 (doesn't boot when compiled with newer versions)
if [ "${CC:0:5}" != "gcc6-" ]; then
CC="gcc6-$CC"
HOSTCC="gcc6-gcc"
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
fi
# Source
_repository="android_kernel_samsung_j8y18lte"
_commit="7d93ba0a0e4a9e03d2e51da327391b76d8e26d58"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/lucasredelive/$_repository/archive/$_commit.tar.gz
$_config
fix_mdp_ctrl_off.patch
fix_fb.patch
fix_fb_h.patch
fix_mdss_overlay.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="
af23d3c8dd3b220a25f1308c3eb099cdc93fc8afa3e8fdc91c0bcfadeea3cdfa1d8bd89faf597097c5204befd45b7e2b2b9d6db768cfe0e4be65f4322a9d9e88 linux-samsung-j8y18lte-7d93ba0a0e4a9e03d2e51da327391b76d8e26d58.tar.gz
d523589c66cf835d4c1ee00b7c12ad3e3240b5ecdfe1144e1bf44ade177a0a0ad7a294309bc0333da10210b2b0291d2058a0940a16591dd002eb846b72563dec config-samsung-j8y18lte.aarch64
3ccfaf591befba3b67d24134a516352173767cac0479d3011f077866e02a792f3581e50d05110375a8f84876213823d37d3791c4cb82f19f212bc4bee57934c8 fix_mdp_ctrl_off.patch
cb7edd7bf9642400276ccb1ddf38cc4ed6fd934c0f0fbc43839903dfd9a3d433121d7624f53be309a10e1703024079d25b369016ccadc870dfd31d988dc22b77 fix_fb.patch
3532faa75cbdbe034082420491abbf61c4a0a744b5d5c676ee9e1de971655dfac77129932baf78ad45ff0f01c3fa139253d1a3ff8461671536a9aebc5d16586a fix_fb_h.patch
eb183307dd0b79407c0b6c92cdc9898d2834a8309938e1af14708e94a375c1c68b5f63c0096bae7e29f28d9191dd73c33d0bbf0686fb722daa37bcabc92dea3f fix_mdss_overlay.patch
"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,76 @@
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
@@ -2130,7 +2130,7 @@
if (is_panel_split(mfd) && pdata->next)
mdss_fb_validate_split(pdata->panel_info.xres,
pdata->next->panel_info.xres, mfd);
- mdss_panelinfo_to_fb_var(panel_info, var);
+ mdss_panelinfo_to_fb_var(mfd);
if (mdss_fb_send_panel_event(mfd, MDSS_EVENT_CHECK_PARAMS,
panel_info))
pr_err("Failed to send panel event CHECK_PARAMS\n");
@@ -2274,7 +2274,7 @@
* programmed in the controller.
* Update this info in the upstream structs.
*/
- mdss_panelinfo_to_fb_var(panel_info, var);
+ mdss_panelinfo_to_fb_var(mfd);
/* Start the work thread to signal idle time */
if (mfd->idle_time)
@@ -3018,7 +3018,7 @@
return ret;
}
- mdss_panelinfo_to_fb_var(panel_info, var);
+ mdss_panelinfo_to_fb_var(mfd);
fix->type = panel_info->is_3d_panel;
if (mfd->mdp.fb_stride)
@@ -3729,7 +3729,7 @@
}
var->xres_virtual = var->xres;
var->yres_virtual = pinfo->yres * mfd->fb_page;
- mdss_panelinfo_to_fb_var(pinfo, var);
+ mdss_panelinfo_to_fb_var(mfd);
}
int mdss_fb_atomic_commit(struct fb_info *info,
@@ -3951,9 +3951,14 @@
pinfo->mipi.dsi_pclk_rate = pinfo->clk_rate;
}
-void mdss_panelinfo_to_fb_var(struct mdss_panel_info *pinfo,
- struct fb_var_screeninfo *var)
+void mdss_panelinfo_to_fb_var(struct msm_fb_data_type *mfd)
{
+ if (!mfd)
+ return -EINVAL;
+
+ struct mdss_panel_info *pinfo = mfd->panel_info;
+ struct fb_info *fbi = mfd->fbi;
+ struct fb_var_screeninfo *var = &fbi->var;
u32 frame_rate;
var->xres = mdss_fb_get_panel_xres(pinfo);
@@ -3989,7 +3994,14 @@
if (pinfo->physical_height)
var->height = pinfo->physical_height;
- pr_debug("ScreenInfo: res=%dx%d [%d, %d] [%d, %d]\n",
+ //Hack to update current fbi->mode according to fbi->var when var is updated from panel info
+ if (fbi->mode) {
+ printk("Updating mdss fb mode from fb var\n");
+ fb_var_to_videomode(fbi->mode, var);
+ }
+
+ printk("ScreenInfo: res=%dx%d [%d, %d] [%d, %d]\n",
+
var->xres, var->yres, var->left_margin,
var->right_margin, var->upper_margin,
var->lower_margin);
@@ -5562,4 +5574,4 @@
mfd->fps_info.last_sampled_time_us = current_time_us;
mfd->fps_info.frame_count = 0;
}
-}
+}

View file

@ -0,0 +1,10 @@
diff --git a/drivers/video/msm/mdss/mdss_fb.h b/drivers/video/msm/mdss/mdss_fb.h
@@ -471,7 +471,6 @@
u32 mdss_fb_get_mode_switch(struct msm_fb_data_type *mfd);
void mdss_fb_report_panel_dead(struct msm_fb_data_type *mfd);
-void mdss_panelinfo_to_fb_var(struct mdss_panel_info *pinfo,
- struct fb_var_screeninfo *var);
+void mdss_panelinfo_to_fb_var(struct msm_fb_data_type *mfd);
void mdss_fb_calc_fps(struct msm_fb_data_type *mfd);
#endif /* MDSS_FB_H */

View file

@ -0,0 +1,10 @@
diff --git a/drivers/video/msm/mdss/mdp3_ctrl.c b/drivers/video/msm/mdss/mdp3_ctrl.c
@@ -3186,7 +3186,7 @@
frame_rate = mdss_panel_get_framerate(mfd->panel_info,
FPS_RESOLUTION_HZ);
mdp3_interface->on_fnc = mdp3_ctrl_on;
- mdp3_interface->off_fnc = mdp3_ctrl_off;
+ mdp3_interface->off_fnc = NULL;
mdp3_interface->do_histogram = NULL;
mdp3_interface->cursor_update = NULL;
mdp3_interface->dma_fnc = mdp3_ctrl_pan_display;

View file

@ -0,0 +1,10 @@
diff --git a/drivers/video/msm/mdss/mdss_mdp_overlay.c b/drivers/video/msm/mdss/mdss_mdp_overlay.c
@@ -3846,7 +3846,7 @@
* data, so any further call to get the screen
* info has the updated timings.
*/
- mdss_panelinfo_to_fb_var(&pdata->panel_info, var);
+ mdss_panelinfo_to_fb_var(mfd);
MDSS_XLOG(dfps);
mutex_unlock(&mdp5_data->dfps_lock);