From 2770d39f1052dcc9bb1ac4c103bcfcd5042558e0 Mon Sep 17 00:00:00 2001 From: Anton Bambura Date: Wed, 1 Nov 2023 03:54:36 +0200 Subject: [PATCH] soc-qcom-sc7180: set non-strict iommu for eMMC, SD card and USB (MR 4526) [ci:skip-build]: already built successfully in CI --- .../00-sc7180-nonstrict-iommu.sh | 18 ++++++++++++++++++ device/community/soc-qcom-sc7180/APKBUILD | 9 ++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 device/community/soc-qcom-sc7180/00-sc7180-nonstrict-iommu.sh diff --git a/device/community/soc-qcom-sc7180/00-sc7180-nonstrict-iommu.sh b/device/community/soc-qcom-sc7180/00-sc7180-nonstrict-iommu.sh new file mode 100644 index 000000000..af491c259 --- /dev/null +++ b/device/community/soc-qcom-sc7180/00-sc7180-nonstrict-iommu.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# This script relaxes iommu for the devices, relaxing memory +# protection, but we consider it a fine tradeoff because those +# hardware blocks don't have firmware on them. + +# It Increases eMMC speed by 15% according to gnome disks benchmark +# with sample size 1000 MiB and number of samples 2. + +iommus=" + /sys/devices/platform/soc@0/7c4000.mmc/iommu_group/type + /sys/devices/platform/soc@0/8804000.mmc/iommu_group/type + /sys/devices/platform/soc@0/a6f8800.usb/a600000.usb/iommu_group/type +" + +for iommu in $iommus; do + [ -f "$iommu" ] && echo "DMA-FQ" > "$iommu" +done diff --git a/device/community/soc-qcom-sc7180/APKBUILD b/device/community/soc-qcom-sc7180/APKBUILD index fe5b437e4..97568020d 100644 --- a/device/community/soc-qcom-sc7180/APKBUILD +++ b/device/community/soc-qcom-sc7180/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Jenneron pkgname=soc-qcom-sc7180 pkgdesc="Common package for Qualcomm Snapdragon 7cx devices" -pkgver=1 +pkgver=1.1 pkgrel=0 url="https://postmarketos.org" license="BSD-3-Clause" @@ -11,9 +11,13 @@ subpackages=" $pkgname-nonfree-firmware:nonfree_firmware $pkgname-vulkan " +source="00-sc7180-nonstrict-iommu.sh" package() { mkdir -p "$pkgdir" + + install -Dm755 "$srcdir"/00-sc7180-nonstrict-iommu.sh \ + -t "$pkgdir"/usr/share/mkinitfs/hooks } nonfree_firmware() { @@ -30,3 +34,6 @@ vulkan() { mkdir "$subpkgdir" } +sha512sums=" +8d76fc3ed580e5950bcb8561c08bf56c52b8693605dee04f174a49154e270b5ac6d4303bc00499864f30c352e9a0c06c449253e0b8ba974e3d85554f306c84fc 00-sc7180-nonstrict-iommu.sh +"