drm/xe/huc: Extract version and binary offset from new HuC headers
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Wed, 25 Oct 2023 17:57:42 +0000 (10:57 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 21 Dec 2023 16:43:22 +0000 (11:43 -0500)
commit484ecffac91067e44273afa727fb1b9855058c9a
tree06dd4cbb91bd8be997cf1ec40e55684512b8c656
parenta9a95523c84957b7863796b5d1df2f3f5dca4519
drm/xe/huc: Extract version and binary offset from new HuC headers

The GSC-enabled HuC binary starts with a GSC header, which is followed
by the legacy-style CSS header and the binary itself. We can parse the
GSC headers to find the HuC version and the location of the binary to
be used for the DMA transfer.

The parsing function has been designed to be re-used for the GSC binary,
so the entry names are external parameters (because the GSC uses
different ones) and the CSS entry is optional (because the GSC doesn't
have it).

v2: move new code to uc_fw.c, better comments and error checking, split
    old code move to separate patch (Lucas), move headers and
    documentation to uc_fw_abi.h.

v3: use 2 separate loops, rework marker check (Lucas)

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Documentation/gpu/xe/xe_firmware.rst
drivers/gpu/drm/xe/xe_uc_fw.c
drivers/gpu/drm/xe/xe_uc_fw.h
drivers/gpu/drm/xe/xe_uc_fw_abi.h
drivers/gpu/drm/xe/xe_uc_fw_types.h