%global debug_package %{nil} Name: uke-adreno732-acd-check Version: 1.0.0 Release: 1%{?dist} Summary: Validate the fitted Adreno 732 ACD operating point table License: GPL-2.0-only OR BSD-2-Clause Source0: adreno-accepted.dtsi Source1: adreno-acd.dtsi Source2: acd-levels.tsv BuildRequires: dtc bash gawk ExclusiveArch: aarch64 %description Check the precise inherited table, compile its full nine-OPP fragment and read back each OEM ACD value from the device tree blob. %prep %setup -q -c -T sed '/^[[:space:]]*qcom,opp-acd-level = /d' "%{SOURCE1}" | cmp "%{SOURCE0}" - %build test "$(uname -m)" = aarch64 { printf '/dts-v1/;\n/ {\n' awk '/^\tuke_gpu_lab_opp: opp-table {/ {p=1} p {print} p && /^\t};/ {exit}' "%{SOURCE1}" printf '};\n' } > acd-check.dts dtc -I dts -O dtb -o acd-check.dtb acd-check.dts [[ $(fdtget -l acd-check.dtb /opp-table | wc -l) -eq 9 ]] while IFS=$'\t' read -r frequency expected; do [[ $frequency =~ ^[0-9]+$ && $expected =~ ^[0-9a-f]{8}$ ]] node=/opp-table/opp-$frequency [[ $(fdtget -t x acd-check.dtb "$node" opp-hz) == "0 $(printf '%%x' "$frequency")" ]] actual=$(fdtget -t x acd-check.dtb "$node" qcom,opp-acd-level) [[ $actual == "$expected" ]] printf 'verified_opp_hz=%%s acd=%%s\n' "$frequency" "$actual" done <"%{SOURCE2}" >qualification.txt [[ $(wc -l