[PATCH] ARM: dts: stm32: Fill GPIO line names on AV96

Christoph Niedermaier cniedermaier at dh-electronics.com
Mon Mar 15 18:58:33 GMT 2021


From: Marek Vasut <marex at denx.de>
Sent: Monday, March 15, 2021 3:26 PM
> To: Christoph Niedermaier <cniedermaier at dh-electronics.com>; linux-arm-
> kernel at lists.infradead.org; linus.walleij at linaro.org
> Cc: Alexandre Torgue <alexandre.torgue at st.com>; Patrice Chotard
> <patrice.chotard at st.com>; Patrick Delaunay <patrick.delaunay at st.com>;
> Maxime Coquelin <mcoquelin.stm32 at gmail.com>; linux-stm32 at st-md-
> mailman.stormreply.com
> Subject: Re: [PATCH] ARM: dts: stm32: Fill GPIO line names on AV96
> 
> ACHTUNG: Diese E-Mail kommt aus dem Internet und nicht aus unserem
> Firmennetzwerk!
> 
> 
> 
> On 3/15/21 12:41 PM, Christoph Niedermaier wrote:
> 
> [...]
> 
>>>>>>>>> Fill in the custom GPIO line names used by DH.
>>>>>>>>>
>>>>>>>> [...]
>>>>>>>>> +&gpioa {
>>>>>>>>> +       gpio-line-names = "", "", "", "",
>>>>>>>>> +                         "", "", "", "",
>>>>>>>>> +                         "", "", "", "DH-GPIO-K",
>>>>>>>>> +                         "DH-GPIO-I", "", "DH-GPIO-A", "";
>>>>>>>>> +};
>>>>>>>>> +
>>>>>>>> [...]
>>>>>>>>
>>>>>>>> We have been using the GPIO names at DH electronics for some time and also
>>>>>>>> on other SOMs, but have not yet streamed them. We started with the naming
>>>>>>>> only with a capital letter "A-W" since then without problems. To avoid a
>>>>>>>> hard cut or patching for us and our customers it would be good if we could
>>>>>>>> use the same naming in the mainline kernel as well. Marek, we would be
>>>>>>>> happy if you would adopt our valued GPIO naming in your patch.
>>>>>>>
>>>>>>> My counter-argument to this is that the naming should be unique and
>>>>>>> provide a hint where those GPIO lines come from, so maybe even DH-GPIO-n
>>>>>>> should rather be DHCOM-n . I can't say I'm particularly fond of the
>>>>>>> plain 'n' naming of GPIO lines, because then the GPIO label (and e.g.
>>>>>>> listing in libgpiod tools) does not give any hint what the GPIO is or
>>>>>>> where it comes from. Also, I worry a plain 'n' naming might clash with
>>>>>>> other GPIO IPs easily, while a more unique name can not.
>>>>>>
>>>>>> Hello Marek,
>>>>>>
>>>>>> after an internal discussion, we decided the following:
>>>>>>
>>>>>> Could you update the patch for the Avenger96 to the GPIO naming "AV96-n".
>>>>>>
>>>>>> Moreover for the SOM layer (stm32mp15xx-dhcom-som.dtsi) we would prefer
>>>>>> "DHCOM-n". It would be nice if you could create a patch for it.
>>>>>
>>>>> I don't think we should have any SoM-side gpio-line-names, because once
>>>>> you plug the SoM into new carrier board, the gpio-lane-names will no
>>>>> longer make sense. So, I think all the gpio-line-names should be
>>>>> implemented in the carrier board DTS.
>>>>
>>>> The idea is to define the GPIO names on the SOM layer and then
>>>> overwrite them on the carrier board DTS if needed. If there is no
>>>> naming on the carrier board, at least you have access via the DHCOM
>>>> GPIO names. The DHCOM GPIO names are standardized, so that you can
>>>> be sure that the assignment to a pin always fits.
>>>
>>> So I'll pose another question here to the GPIO maintainers.
>>>
>>> Is it OK to define gpio-line-names in SoM DTSI even for pins which will
>>> not be used as GPIOs e.g. because they are muxed differently in the
>>> carrier board DTS ?
>>>
>>> If that is OK, then the above approach is then also OK.
>>
>> In our case, we cannot mux the GPIO pins in the carrier board DTS
>> to another functions, because then we break our SOM standard (DHCOM).
> 
> You can, assume you take two of the SoM GPIO-X and GPIO-Y signals which
> are present e.g. on the PDK2 jumper header and connect I2C EEPROM to
> those two pins. Then you mux those two pins as I2C bus. And that happens
> on the carrier board level (or a DTO, but that's out of scope here).

This is a very absurd example, because we have I2C on the PDK2 board
and if you want to use I2C use our given I2C buses. We don't want that
a costumer uses a GPIO pin as I2C, because it breaks our SOM standard
(DHCOM) and we cannot exchange the SOM module without breaking the
function. A GPIO is intended to be a GPIO and we don't want to have a
carrier board upstream, that breaks your standard. So if we label the
GPIOs on the SOM layer, it will never be wrong.
 
>> So in the case we relabel a GPIO in the carrier board e.g. "DHCOM-I"
>> becomes "LED1" the mux function have to be GPIO.
> 
> In the above example, the mux function becomes i2c in the carrier board
> DT and the gpio-line-names remains the same since its included from the
> SoM DTSI. I would like to know whether this is OK or whether we need to
> patch the gpio-line-names in the carrier board DT and remove the GPIO-X
> and GPIO-Y from the gpio-line-names there.

In the carrier board the GPIO becomes an input, output, led, button, etc.,
but the function is still GPIO. So the labeling on the SOM layer is never
been wrong. A relabeling on the carrier board then improves it to the real
usage, but it is not mandatory.


Regards
Christoph


More information about the linux-arm-kernel mailing list