From ac7fc0276bfbec6fd78e1ffce142aa9666255fac Mon Sep 17 00:00:00 2001 From: Affe Null Date: Tue, 27 Dec 2022 15:13:04 +0100 Subject: [PATCH] nokia-leo: new device (MR 3768) Initial port using msm8916-mainline kernel --- .../00-nokia-leo-display.files | 1 + device/testing/device-nokia-leo/APKBUILD | 58 ++++++++++++++++ device/testing/device-nokia-leo/deviceinfo | 37 ++++++++++ .../nokia,leo-gc9305-hlt-24-panel.txt | 69 +++++++++++++++++++ 4 files changed, 165 insertions(+) create mode 100644 device/testing/device-nokia-leo/00-nokia-leo-display.files create mode 100644 device/testing/device-nokia-leo/APKBUILD create mode 100644 device/testing/device-nokia-leo/deviceinfo create mode 100644 device/testing/device-nokia-leo/nokia,leo-gc9305-hlt-24-panel.txt diff --git a/device/testing/device-nokia-leo/00-nokia-leo-display.files b/device/testing/device-nokia-leo/00-nokia-leo-display.files new file mode 100644 index 000000000..e69c09615 --- /dev/null +++ b/device/testing/device-nokia-leo/00-nokia-leo-display.files @@ -0,0 +1 @@ +/lib/firmware/nokia,leo-gc9305-hlt-24-panel.bin diff --git a/device/testing/device-nokia-leo/APKBUILD b/device/testing/device-nokia-leo/APKBUILD new file mode 100644 index 000000000..da7ed6798 --- /dev/null +++ b/device/testing/device-nokia-leo/APKBUILD @@ -0,0 +1,58 @@ +# Reference: +pkgname=device-nokia-leo +pkgdesc="Nokia 6300 4G" +pkgver=1 +pkgrel=0 +url="https://postmarketos.org" +license="GPL-2.0-only" +arch="armv7" +options="!check !archcheck" +depends=" + linux-postmarketos-qcom-msm8916 + mkbootimg + postmarketos-base + soc-qcom-msm8909 + soc-qcom-msm8916-rproc +" +_pmb_select="soc-qcom-msm8916-rproc" +subpackages="$pkgname-nonfree-firmware:nonfree_firmware" +makedepends="devicepkg-dev mipi-dbi-cmd" +_panel="nokia,leo-gc9305-hlt-24-panel" +source=" + $_panel.txt + 00-nokia-leo-display.files + deviceinfo + " + +build() { + devicepkg_build $startdir $pkgname + mkdir -p "$builddir" + mipi-dbi-cmd "$builddir"/"$_panel".bin \ + "$srcdir"/"$_panel".txt +} + +package() { + devicepkg_package $startdir $pkgname + # Package display init sequence + install -Dm644 "$builddir"/"$_panel".bin -t \ + "$pkgdir"/lib/firmware/ + install -Dm644 "$srcdir"/00-nokia-leo-display.files -t \ + "$pkgdir"/etc/postmarketos-mkinitfs/files/ +} + +nonfree_firmware() { + pkgdesc="GPU/WiFi/BT/Modem/Video firmware" + depends=" + firmware-qcom-adreno-a300 + msm-firmware-loader + firmware-nokia-sparkler-venus + firmware-nokia-sparkler-wcnss-nv + " + mkdir "$subpkgdir" +} + +sha512sums=" +8583c7d5a97c4efedff3ec554cf682d815fd7b83140c2cab9eec4b6e2e735ce3c012bc3bd97f8bc75adc3483f76ce83a5bf1090d4f3e73a327efc64ca9eca5a7 nokia,leo-gc9305-hlt-24-panel.txt +c9985232e5e64ddb0906b053e5024c87fa62cc1bcb254260e1ef6afb43d384196e09d41287143bcba61dff616dd6b562a5ca335dbe592fcd8c954642b8085f38 00-nokia-leo-display.files +29b261a4c9d8a6101ef91898e725ae92372416a743a8dd895bace543ddd06b727237f4ea411d56b5e3f3e9c7d5c726876a802bcec86db0a851653e8f0f6bf717 deviceinfo +" diff --git a/device/testing/device-nokia-leo/deviceinfo b/device/testing/device-nokia-leo/deviceinfo new file mode 100644 index 000000000..82fbfeb50 --- /dev/null +++ b/device/testing/device-nokia-leo/deviceinfo @@ -0,0 +1,37 @@ +# Reference: +# Please use double quotes only. You can source this file in shell +# scripts. + +deviceinfo_format_version="0" +deviceinfo_name="Nokia 6300 4G" +deviceinfo_manufacturer="Nokia" +deviceinfo_codename="nokia-leo" +deviceinfo_year="2020" +deviceinfo_dtb="qcom-msm8909-nokia-leo" +deviceinfo_append_dtb="true" +deviceinfo_arch="armv7" +deviceinfo_modules_initfs="pm8916-lbc pm8916-bms-vm panel-mipi-dbi" +deviceinfo_swap_size_recommended="512" + +# Device related +deviceinfo_chassis="handset" +deviceinfo_keyboard="true" +deviceinfo_external_storage="true" +deviceinfo_screen_width="240" +deviceinfo_screen_height="320" + +# Bootloader related +deviceinfo_flash_method="fastboot" +deviceinfo_kernel_cmdline="earlycon console=ttyMSM0,115200" +deviceinfo_generate_bootimg="true" +deviceinfo_bootimg_qcdt="false" +deviceinfo_bootimg_mtk_mkimage="false" +deviceinfo_bootimg_dtb_second="false" +deviceinfo_flash_pagesize="2048" +deviceinfo_header_version="0" +deviceinfo_flash_offset_base="0x80000000" +deviceinfo_flash_offset_kernel="0x00008000" +deviceinfo_flash_offset_ramdisk="0x02700000" +deviceinfo_flash_offset_second="0x00f00000" +deviceinfo_flash_offset_tags="0x02500000" +deviceinfo_flash_sparse="true" diff --git a/device/testing/device-nokia-leo/nokia,leo-gc9305-hlt-24-panel.txt b/device/testing/device-nokia-leo/nokia,leo-gc9305-hlt-24-panel.txt new file mode 100644 index 000000000..5b5622420 --- /dev/null +++ b/device/testing/device-nokia-leo/nokia,leo-gc9305-hlt-24-panel.txt @@ -0,0 +1,69 @@ +# Based on arch/arm64/boot/dts/qcom/spi-panel-gc9305-hlt-24-qvga-cmd.dtsi from +# the downstream kernel, which is: +# Copyright (c) 2017, 2020, The Linux Foundation. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 and +# only version 2 as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +command 0xfe +command 0xfe +command 0xef +command 0x35 0x00 +command 0x36 0x48 +command 0x3a 0x05 +command 0x20 +command 0x38 +command 0x13 +command 0xa4 0x44 0x44 +command 0xa5 0x42 0x42 +command 0xa6 0x2a 0x2a +command 0xa7 0x2b 0x2b +command 0xa8 0x18 0x18 +command 0xa9 0x2a 0x2a +command 0xaa 0x88 0x88 +command 0xac 0x00 +command 0xaf 0x55 +command 0xe1 0x10 0x26 +command 0xe3 0x01 0x10 +command 0xe8 0x11 0x77 +command 0xe0 0x0f +command 0xe4 0x00 +command 0xe5 0x00 +command 0xe6 0x00 +command 0xe7 0x00 0x00 +command 0xea 0x51 0x95 0x00 0x00 0x00 0x00 0x00 +command 0xeb 0x30 +command 0xec 0x33 0x22 0x88 +command 0xed 0x18 0x08 +command 0xee 0x00 +command 0xa0 0x00 +command 0xa1 0x00 +command 0xa2 0x00 +command 0xa3 0x00 +command 0xab 0x00 0x00 +command 0xad 0x33 +command 0xae 0x2b +command 0xde 0x00 +command 0xff 0x61 +command 0xdf 0x08 +command 0xb6 0x00 0x80 0x27 +command 0xf0 0x02 0x01 0x00 0x00 0x03 0x07 +command 0xf1 0x01 0x01 0x00 0x02 0x06 0x0e +command 0xf2 0x08 0x06 0x32 0x03 0x04 0x46 +command 0xf3 0x10 0x0c 0x3e 0x06 0x03 0x4f +command 0xf4 0x0b 0x16 0x15 0x1d 0x1e 0x0f +command 0xf5 0x08 0x15 0x15 0x1b 0x1c 0x0f +command 0xfd 0x00 +command 0x2a 0x00 0x00 0x00 0xef +command 0x2b 0x00 0x00 0x01 0x3f +command 0x44 0x00 0x40 + +command 0x11 # exit sleep mode +delay 120 +command 0x29 # display on