Skip to content

freedreno/afuc: Support assembling firmwares on a660 and a7xx

Connor Abbott requested to merge cwabbott0/mesa:review/afuc-a7xx-assemble into main

The main problem with assembling anything newer than a650_sqe.fw has been the multiple sections that need to be assembled and then concatenated together for BV and LPAC firmwares. This adds support for a .section directive and makes the disassembler output it. We also need more flexible jump table handling to support the case where there is data after the jump table or the jump table offset is not at dword 1. It turns out there were some bugs with assembling newer a7xx instructions because it wasn't tested, so this series also fixes those, and an extra modifier was missing which only turned up when reassembling didn't return the same bytes. Finally we add a testcase for testing the new a7xx instructions and section handling.

I've tested that a660_sqe.fw, a730_sqe.fw, and a740_sqe.fw now reassemble to an identical binary, although it looks like there is one unknown instruction on a7xx. Of course, for reassembling you need to add relocations, and I've added a section of the README describing that.

Merge request reports

Loading