Re: [PATCH 4/6] soc: qcom: geni-se: Define the QSPI firmware protocol
From: Jyothi Kumar Seerapu
Date: Tue Nov 17 2026 - 12:28:47 EST
On 11/12/2026 7:26 PM, Krzysztof Kozlowski wrote:
On 12/11/2026 14:48, Jyothi Kumar Seerapu wrote:
You miss the point. This is just a table for Linux driver, not what is
On 11/11/2026 6:10 PM, Krzysztof Kozlowski wrote:
On Mon, Nov 09, 2026 at 08:13:33PM +0530, Jyothi Kumar Seerapu wrote:Hi Krzysztof,
And it should be 6. Just look at uses of this.Hi Krzysztof,-static const char * const protocol_name[] = { "None", "SPI", "UART", "I2C", "I3C", "SPI SLAVE" };Why are you creating holes in this array?
+static const char * const protocol_name[] = {
+ "None", "SPI", "UART", "I2C", "I3C", "SPI SLAVE",
+ [GENI_SE_QSPI] = "QSPI",
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.
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.
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?
GENI_SE_QSPI is also compared directly with the firmware header's
protocol field and GENI_FW_REVISION_RO, where QSPI is encoded as 9.
I therefore propose retaining 9 for those comparisons, without
using it as an array index.
Can I replace the sparse array with a switch-based helper that
returns the name for each supported protocol and rejects unknown
IDs. This avoids holes and remains independent of the numerical
protocol values.
Best regards,
Krzysztof