From df62747456d37bce48cfe1d1a3446ffec9a16dbc Mon Sep 17 00:00:00 2001 From: Leandro Friedrich Date: Mon, 22 Aug 2022 22:19:07 +0200 Subject: [PATCH] samsung-a52q: new device (MR 3379) --- device/testing/device-samsung-a52q/APKBUILD | 48 +++++++++ device/testing/device-samsung-a52q/deviceinfo | 38 ++++++++ device/testing/firmware-samsung-a52q/APKBUILD | 97 +++++++++++++++++++ 3 files changed, 183 insertions(+) create mode 100644 device/testing/device-samsung-a52q/APKBUILD create mode 100644 device/testing/device-samsung-a52q/deviceinfo create mode 100644 device/testing/firmware-samsung-a52q/APKBUILD diff --git a/device/testing/device-samsung-a52q/APKBUILD b/device/testing/device-samsung-a52q/APKBUILD new file mode 100644 index 000000000..fcedcae5b --- /dev/null +++ b/device/testing/device-samsung-a52q/APKBUILD @@ -0,0 +1,48 @@ +# Maintainer: Leandro Friedrich +# Reference: +pkgname=device-samsung-a52q +pkgdesc="Samsung Galaxy A52" +pkgver=1 +pkgrel=0 +url="https://postmarketos.org" +license="MIT" +arch="aarch64" +options="!check !archcheck" +depends=" + linux-postmarketos-qcom-sm7125 + mesa-dri-gallium + mkbootimg + postmarketos-base + soc-qcom-sm7125 + alsa-ucm-conf-samsung-sm7125 +" +makedepends="devicepkg-dev" +source="deviceinfo" +subpackages="$pkgname-nonfree-firmware:nonfree_firmware" + +build() { + devicepkg_build $startdir $pkgname +} + +package() { + devicepkg_package $startdir $pkgname +} + +nonfree_firmware() { + pkgdesc="Firmware for GPU, Audio, Modem, WiFi, etc." + depends=" + firmware-samsung-a52q-adreno + firmware-samsung-a52q-adsp + firmware-samsung-a52q-cdsp + firmware-samsung-a52q-ipa + firmware-samsung-a52q-modem + firmware-samsung-a52q-wlan + firmware-samsung-a52q-bluetooth + firmware-samsung-a52q-venus + " + mkdir "$subpkgdir" +} + +sha512sums=" +ebbba971a0c250627bf12f8b0922b44720875e3e1987c2ad5da25b258af684e01e349c392c0706003a9104fbea9cd5c623ae80cc731c52b581713d3d68dc01e5 deviceinfo +" diff --git a/device/testing/device-samsung-a52q/deviceinfo b/device/testing/device-samsung-a52q/deviceinfo new file mode 100644 index 000000000..76f2b7cb0 --- /dev/null +++ b/device/testing/device-samsung-a52q/deviceinfo @@ -0,0 +1,38 @@ +# Reference: +# Please use double quotes only. You can source this file in shell +# scripts. + +deviceinfo_format_version="0" +deviceinfo_name="Samsung Galaxy A52" +deviceinfo_manufacturer="Samsung" +deviceinfo_codename="samsung-a52q" +deviceinfo_year="2021" +deviceinfo_dtb="qcom/sm7125-samsung-a52q" +deviceinfo_append_dtb="true" +deviceinfo_arch="aarch64" +deviceinfo_gpu_accelerated="true" + +# Device related +deviceinfo_chassis="handset" +deviceinfo_keyboard="false" +deviceinfo_external_storage="true" +deviceinfo_screen_width="1080" +deviceinfo_screen_height="2400" + +# Bootloader related +deviceinfo_flash_method="heimdall-bootimg" +deviceinfo_kernel_cmdline="console=null" +deviceinfo_generate_bootimg="true" +deviceinfo_bootimg_qcdt="false" +deviceinfo_bootimg_mtk_mkimage="false" +deviceinfo_bootimg_dtb_second="false" +deviceinfo_flash_pagesize="4096" +deviceinfo_flash_offset_base="0x00000000" +deviceinfo_flash_offset_kernel="0x00008000" +deviceinfo_flash_offset_ramdisk="0x02000000" +deviceinfo_flash_offset_second="0x00000000" +deviceinfo_flash_offset_tags="0x01e00000" +deviceinfo_flash_heimdall_partition_kernel="BOOT" +deviceinfo_flash_heimdall_partition_system="SUPER" +deviceinfo_rootfs_image_sector_size="4096" +deviceinfo_flash_sparse="true" diff --git a/device/testing/firmware-samsung-a52q/APKBUILD b/device/testing/firmware-samsung-a52q/APKBUILD new file mode 100644 index 000000000..1a3821dab --- /dev/null +++ b/device/testing/firmware-samsung-a52q/APKBUILD @@ -0,0 +1,97 @@ +# Maintainer: Leandro Friedrich +pkgname=firmware-samsung-a52q +pkgver=20220820 +pkgrel=0 +pkgdesc="Firmware for Samsung Galaxy A52" +subpackages=" + $pkgname-adreno + $pkgname-adsp + $pkgname-cdsp + $pkgname-ipa + $pkgname-modem + $pkgname-venus + $pkgname-wlan + $pkgname-bluetooth + " +url="https://github.com/budderbrot/a52q-firmware" +arch="aarch64" +license="proprietary" +options="!check !strip !archcheck !tracedeps pmb:cross-native" +_commit="3ec32aecf7837a34240702955f5d01a336cf0c2c" +source="https://github.com/budderbrot/a52q-firmware/archive/$_commit/a52q-firmware-$_commit.tar.gz" +builddir="$srcdir/a52q-firmware-$_commit" + +package() { + # parent package is empty + mkdir -p "$pkgdir" +} + +adreno() { + pkgdesc="Samsung Galaxy A52 adreno firmware" + + install -Dm644 "$builddir"/a6* -t \ + "$subpkgdir/lib/firmware/qcom/" +} + +adsp() { + pkgdesc="Samsung Galaxy A52 adsp firmware" + + install -Dm644 "$builddir"/adsp* -t \ + "$subpkgdir/lib/firmware/qcom/sm7125/a52q/" +} + +cdsp() { + pkgdesc="Samsung Galaxy A52 cdsp firmware" + + install -Dm644 "$builddir"/cdsp* -t \ + "$subpkgdir/lib/firmware/qcom/sm7125/a52q/" +} + +ipa() { + pkgdesc="Samsung Galaxy A52 ipa firmware" + + install -Dm644 "$builddir"/ipa_fws.* -t \ + "$subpkgdir/lib/firmware/qcom/sm7125/a52q/" +} + +modem() { + pkgdesc="Samsung Galaxy A52 modem firmware" + + # cp because of the modem_pr directory + mkdir -p "$subpkgdir/lib/firmware/qcom/sm7125/a52q/" + cp -r "$builddir"/modem* \ + "$subpkgdir/lib/firmware/qcom/sm7125/a52q/" + find "$subpkgdir/lib/firmware/qcom/sm7125/a52q/" \ + -type f -exec chmod 0644 {} \; +} + +venus() { + pkgdesc="Samsung Galaxy A52 venus firmware" + + install -Dm644 "$builddir"/venus.* -t \ + "$subpkgdir/lib/firmware/qcom/sm7125/a52q/" +} + +wlan() { + pkgdesc="Samsung Galaxy A52 wlan firmware" + + install -Dm644 "$builddir"/board-2.bin -t \ + "$subpkgdir/lib/firmware/ath10k/WCN3990/hw1.0/" + install -Dm644 "$builddir"/firmware-5.bin -t \ + "$subpkgdir/lib/firmware/ath10k/WCN3990/hw1.0/" + install -Dm644 "$builddir"/wlanmdsp.mbn -t \ + "$subpkgdir/lib/firmware/qcom/sm7125/a52q/" +} + +bluetooth() { + pkgdesc="Samsung Galaxy A52 bluetooth firmware" + + install -Dm644 "$builddir"/crbtfw21.tlv -t \ + "$subpkgdir/lib/firmware/qca/" + install -Dm644 "$builddir"/crnv21.* -t \ + "$subpkgdir/lib/firmware/qca/sm7125/a52q/" +} + +sha512sums=" +fbd93fc61903d16489f531c8431e8e1a4d5c21c0ada0c998c619c3b5193506c2fc6b6b56d6dd3002f834955e5d884dd80519eee260a04c96319b125ffad4b60a a52q-firmware-3ec32aecf7837a34240702955f5d01a336cf0c2c.tar.gz +"