soc: intel_adsp: tools: add cavstool.py fallback for PCI class

If no PCI device with DSP capability is reported, also try to
find compatible devices using PCI_CLASS=40300. This is mostly
useful on preproduction systems where incorrect PCI class data
is reported.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2025-01-03 16:16:34 +02:00 committed by Benjamin Cabé
commit 76dc24ba0a

View file

@ -211,7 +211,11 @@ def adsp_mem_window_config():
return (base, stride)
def map_regs(log_only):
try:
p = runx(f"grep -iEl 'PCI_CLASS=40(10|38)0' /sys/bus/pci/devices/*/uevent")
except subprocess.CalledProcessError:
# if no device found, also try 40300 class no-DSP devices
p = runx(f"grep -iEl 'PCI_CLASS=40300' /sys/bus/pci/devices/*/uevent")
pcidir = os.path.dirname(p)
# Platform/quirk detection. ID lists cribbed from the SOF kernel driver