diff --git a/soc/mediatek/mt8xxx/mtk_adsp_load.py b/soc/mediatek/mt8xxx/mtk_adsp_load.py index 03efcd2f1cc..42127b75ec5 100755 --- a/soc/mediatek/mt8xxx/mtk_adsp_load.py +++ b/soc/mediatek/mt8xxx/mtk_adsp_load.py @@ -277,7 +277,13 @@ def find_winstream(maps): magic = b'\x74\x5f\x6a\xd0\x79\xe2\x4f\x00\xcd\xb8\xbd\xf9' for m in maps: if "dram" in m: - magoff = maps[m].find(magic) + # Some python versions produce bus errors (!) on the + # hardware when finding a 12 byte substring (maybe a SIMD + # load that the hardware doesn't like?). Do it in two + # chunks. + magoff = maps[m].find(magic[0:8]) + if magoff >= 0: + magoff = maps[m].find(magic[8:], magoff) - 8 if magoff >= 0: addr = le4(maps[m][magoff + 12 : magoff + 16]) return addr