Re: [PATCH 4/6] soc: qcom: geni-se: Define the QSPI firmware protocol
From: Krzysztof Kozlowski
Date: Thu Nov 12 2026 - 09:05:58 EST
On 12/11/2026 14:48, Jyothi Kumar Seerapu wrote:
>
>
> On 11/11/2026 6:10 PM, Krzysztof Kozlowski wrote:
>> On Mon, Nov 09, 2026 at 08:13:33PM +0530, Jyothi Kumar Seerapu wrote:
>>>>> -static const char * const protocol_name[] = { "None", "SPI", "UART", "I2C", "I3C", "SPI SLAVE" };
>>>>> +static const char * const protocol_name[] = {
>>>>> + "None", "SPI", "UART", "I2C", "I3C", "SPI SLAVE",
>>>>> + [GENI_SE_QSPI] = "QSPI",
>>>>
>>>> Why are you creating holes in this array?
>>>
>>> Hi Krzysztof,
>>> The array is indexed by the GENI protocol ID. QSPI uses ID 9, while the
>>> existing entries cover IDs 0–5, so the designated initializer leaves entries
>>> 6–8 empty.
>>> The added NULL check rejects these unused entries before accessing the
>>> protocol name. Appending "QSPI" directly would incorrectly associate it with
>>> ID 6.
>>
>> And it should be 6. Just look at uses of this.
>
> Hi Krzysztof,
>
> The QUP Hardware Programming Guide assigns protocol ID 9 to QSPI.
> This enum represents the serial engine's protocol IDs,
> rather than consecutive indices for the name table.
>
> The SPI/QSPI driver uses this ID to request the appropriate firmware
> and validate the protocol read from GENI_FW_REVISION_RO. The firmware
> loader also matches this ID against the firmware header's protocol
> field. Changing QSPI to 6 would make these checks expect a different
> protocol ID.
You miss the point. This is just a table for Linux driver, not what is
programmed. So please explain me, if firmware comes with new protocol,
e.g. OSPI with id 10000000, are you going to use that as an index?
Really, why are we discussing this?
Best regards,
Krzysztof