Re: [PATCH 2/2] media: iris: Enable Gen2 HFI on SC7280

From: Dmitry Baryshkov

Date: Sun Feb 22 2026 - 20:18:58 EST


On Fri, Feb 20, 2026 at 11:50:35AM +0530, Dikshita Agarwal wrote:
>
>
> On 2/17/2026 5:50 PM, Konrad Dybcio wrote:
> > On 2/17/26 8:40 AM, Dikshita Agarwal wrote:
> >>
> >> Due to these constraints, I think, the only possible way is to extract the
> >> version from the firmware binary blob itself.
> >
> > Looks like both gens use the same iris_hfi_queue_write() logic for issuing
> > packets and they both use the largely common iris_hfi_queue_dbg_read() logic
> >
> > So, knowing that e.g. HFI_CMD_SYS_INIT (0x10001) and HFI_CMD_INIT (0x01000001)
> > seem not to conflict, we should be able to issue say a gen1 command and check
> > if we get a timeout, no?
>
> The two HFI generations do share some lower‑level queue infrastructure, but
> the command formats and packet layouts for Gen1 and Gen2 differ.
>
> Because of this, sending a Gen1 HFI_CMD_SYS_INIT into a Gen2 firmware (or
> vice‑versa) is not safe. The firmware will interpret the buffer strictly
> according to its own expected packet layout, and since there is no
> protocol‑level version discriminator, it has no way to recognize that the
> host used the wrong HFI format.
>
> Additionally, using a timeout as a discriminator is unreliable. If we issue
> a command and receive no response, we cannot differentiate whether it due
> to using the wrong HFI generation, or due to a genuine sys_init failure.
>
> So, I will proceed with implementing the solution based on reading the
> firmware blob, extracting the version string, and switching between Gen1
> and Gen2 HFI accordingly. This avoids protocol ambiguity and does not
> require the firmware to support any additional detection mechanism.

Ack. Please proceed with this idea.

--
With best wishes
Dmitry