linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Gatien CHEVALLIER <gatien.chevallier@foss.st.com>
To: Krzysztof Kozlowski <krzk@kernel.org>,
	<alexandre.torgue@foss.st.com>, <robh+dt@kernel.org>,
	<Oleksii_Moisieiev@epam.com>, <linus.walleij@linaro.org>,
	<gregkh@linuxfoundation.org>
Cc: <linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <loic.pallardy@st.com>,
	<devicetree@vger.kernel.org>, <mark.rutland@arm.com>,
	<arnd@arndb.de>
Subject: Re: [RFC PATCH 3/7] dt-bindings: bus: add STM32MP15 ETZPC firewall bus bindings
Date: Mon, 16 Jan 2023 15:06:06 +0100	[thread overview]
Message-ID: <b90e4b78-d84d-3a63-1aef-e7214d4b29d9@foss.st.com> (raw)
In-Reply-To: <f169d05a-7a07-aedf-bad2-30cb4a88fc16@kernel.org>

Hello Krzysztof,

On 1/11/23 13:32, Krzysztof Kozlowski wrote:
> On 09/01/2023 12:54, Gatien CHEVALLIER wrote:
>>>>> Then why do you define them in bindings? Use raw numbers. Do you see
>>>>> anywhere in arm/arm64 bindings for GIC_SPI interrupt numbers?
>>>>>
>>>>
>>>> What would you think of simply removing the comments that state that IDs
>>>> are reserved, mimicking the way it is for qcom bindings? Fundamentally,
>>>> they are indeed only IDs and could be raw numbers.
>>>
>>> If these are IDs then there are no reserved numbers and they are
>>> continuous from 0 to X. Without gaps.
>>>
>>>> IMO, this makes reading the device tree harder. Because you'd have to
>>>> look what the raw number corresponds to.
>>>
>>> Sure, but that's not the reason to put numbers to the bindings... You
>>> mix defines with bindings.
>>>
>>>> To take an example, it has already been done for SCMI clocks and I find
>>>> it eases comprehension.
>>>
>>> You need to be a bit more specific...
>>
>> Please see include/dt-bindings/clock/stm32mp1-clks.h, where there are
>> various clock IDs defined, some of them not contiguous.
> 
> These are pretty often added to accommodate space for exposing these
> clocks in the future. IOW, these might be IDs just not all are shared
> via header. There are such platforms and it is OK.
> 
>>
>> Errata: for SCMI clocks they are indeed contiguous but not clock IDs.
>>
>>>
>>> Anyway, IDs should be placed in bindings. Some mapping of
>>> internal/hardware ports, registers, offsets, values - usually not.
>>>
>>> I don't know where exactly your case fits, but when some IDs are
>>> reserved it is a clear sign that these are not IDs (again - IDs start
>>> from 0 and go incrementally by one, without gaps).
>>>
>>
>> I do agree with your statement that IDs should not be reserved.
>>
>> I think I've missed something to better highlight my point of view: It
>> would be perfectly fine using numbers that are not described in this
>> bindings file. It would just not correspond to an ID of a peripheral
>> described in the SoC reference manual, thus making no sense to use them.
>> Stating that they are reserved was incorrect, it's just that peripherals
>> get a firewall ID, depending on the platform.
> 
> Why peripheral ID should be put into the bindings? Why bindings is a
> place for it? Interrupt numbers, GPIO indices/numbers, register offsets,
> IOMMU ports - none of these are suitable for bindings.
> 
>>
>> I think it should be okay not describing IDs that are not relevant, what
>> do you think? I found that in include/dt-bindings/arm/qcom,ids.h, IDs
>> are not continuous. Not mentioning an ID could be used for deprecation.
> 
> These are not IDs of clocks. These are unique identifiers assigned by
> vendor and used by different pieces: firmware/bootloaders, DTS and Linux
> driver. We have no control of them but they exist. They also do not
> represent any hardware number.
> 
> You bring some examples as an argument, but these examples are not
> always related to your case. To be clear - we talk here about bindings,
> so they bind different interfaces of software components (e.g. Linux
> kernel with DTS). Now, what is the different interface here in your
> case? If you say your peripheral hardware ID, then answer is no - this
> is not software interface.

I see what you want to avoid,

These bindings are indeed presented as pure helpers here. They are not 
used by the firewall bus driver on Linux except for the value that they 
represent, thus your comment.
However, they will be shared between different boot chain components. I 
do not have an upstreamed example to give but please see that we might 
use them in OP-TEE:

[1] 
https://github.com/STMicroelectronics/optee_os/blob/3.16.0-stm32mp/core/include/dt-bindings/soc/stm32mp13-etzpc.h

They could be used and used differently depending on the software 
component (e.g: lock of secure configuration for a particular 
peripheral, ...). This change is here for consistency between those.

> 
> Best regards,
> Krzysztof
> 

Best regards,
Gatien

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-01-16 14:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21 17:30 [RFC PATCH 0/7] Introduce STM32 system bus Gatien Chevallier
2022-12-21 17:30 ` [RFC PATCH 1/7] dt-bindings: Document common device controller bindings Gatien Chevallier
2022-12-22 10:22   ` Krzysztof Kozlowski
2022-12-22 13:01     ` Gatien CHEVALLIER
2022-12-22 13:51       ` Krzysztof Kozlowski
2022-12-21 17:30 ` [RFC PATCH 2/7] dt-bindings: bus: add STM32 System Bus Gatien Chevallier
2022-12-21 20:09   ` Rob Herring
2022-12-22 10:24   ` Krzysztof Kozlowski
2022-12-22 13:39     ` Gatien CHEVALLIER
2022-12-22 13:55       ` Krzysztof Kozlowski
2022-12-21 17:30 ` [RFC PATCH 3/7] dt-bindings: bus: add STM32MP15 ETZPC firewall bus bindings Gatien Chevallier
2022-12-22 10:26   ` Krzysztof Kozlowski
2022-12-22 13:51     ` Gatien CHEVALLIER
2022-12-22 13:57       ` Krzysztof Kozlowski
2023-01-04 13:43         ` Gatien CHEVALLIER
2023-01-05 21:53           ` Krzysztof Kozlowski
2023-01-09 11:54             ` Gatien CHEVALLIER
2023-01-11 12:32               ` Krzysztof Kozlowski
2023-01-16 14:06                 ` Gatien CHEVALLIER [this message]
2022-12-21 17:30 ` [RFC PATCH 4/7] dt-bindings: bus: add STM32MP13 " Gatien Chevallier
2022-12-22 10:26   ` Krzysztof Kozlowski
2022-12-22 13:53     ` Gatien CHEVALLIER
2022-12-21 17:30 ` [RFC PATCH 5/7] bus: stm32_sys_bus: add support for STM32MP15 and STM32MP13 system bus Gatien Chevallier
2022-12-22 10:28   ` Krzysztof Kozlowski
2022-12-22 14:30     ` Gatien CHEVALLIER
2022-12-22 15:19       ` Krzysztof Kozlowski
2022-12-21 17:30 ` [RFC PATCH 6/7] ARM: dts: stm32: add ETZPC as a system bus for STM32MP15x boards Gatien Chevallier
2022-12-22 10:30   ` Krzysztof Kozlowski
2022-12-22 14:42     ` Gatien CHEVALLIER
2022-12-22 15:21       ` Krzysztof Kozlowski
2022-12-22 15:57         ` Gatien CHEVALLIER
2022-12-22 16:00           ` Krzysztof Kozlowski
2022-12-21 17:30 ` [RFC PATCH 7/7] ARM: dts: stm32: add ETZPC as a system bus for STM32MP13x boards Gatien Chevallier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b90e4b78-d84d-3a63-1aef-e7214d4b29d9@foss.st.com \
    --to=gatien.chevallier@foss.st.com \
    --cc=Oleksii_Moisieiev@epam.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=loic.pallardy@st.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).