linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space
@ 2025-07-22 12:10 Ivaylo Ivanov
  2025-07-22 12:10 ` [PATCH v1 2/2] dt-bindings: soc: samsung: usi: add samsung,exynos2200-usi compatible Ivaylo Ivanov
  2025-07-23  8:15 ` [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space Krzysztof Kozlowski
  0 siblings, 2 replies; 10+ messages in thread
From: Ivaylo Ivanov @ 2025-07-22 12:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Sam Protsenko, Rob Herring,
	Conor Dooley
  Cc: linux-samsung-soc, devicetree, linux-arm-kernel, linux-kernel

Some device trees, like the exynos2200 one, configure the root node
with #address-cells and #size-cells set to 2. However, the usi binding
expects 32 bit address space only. Allow these determining properties to
be set as 1 or 2 instead of a constant 1.

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
 Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
index cb2263709..4ce871676 100644
--- a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
+++ b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
@@ -57,10 +57,10 @@ properties:
   ranges: true
 
   "#address-cells":
-    const: 1
+    enum: [1, 2]
 
   "#size-cells":
-    const: 1
+    enum: [1, 2]
 
   samsung,sysreg:
     $ref: /schemas/types.yaml#/definitions/phandle-array
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v1 2/2] dt-bindings: soc: samsung: usi: add samsung,exynos2200-usi compatible
  2025-07-22 12:10 [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space Ivaylo Ivanov
@ 2025-07-22 12:10 ` Ivaylo Ivanov
  2025-07-24  2:24   ` Sam Protsenko
  2025-07-23  8:15 ` [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space Krzysztof Kozlowski
  1 sibling, 1 reply; 10+ messages in thread
From: Ivaylo Ivanov @ 2025-07-22 12:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Sam Protsenko, Rob Herring,
	Conor Dooley
  Cc: linux-samsung-soc, devicetree, linux-arm-kernel, linux-kernel

Add samsung,exynos2200-usi dedicated compatible for representing the USI
of Samsung Exynos 2200 SoC.

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
 Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
index 4ce871676..bbf6d3b2f 100644
--- a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
+++ b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
@@ -36,6 +36,7 @@ properties:
       - items:
           - enum:
               - google,gs101-usi
+              - samsung,exynos2200-usi
               - samsung,exynosautov9-usi
               - samsung,exynosautov920-usi
           - const: samsung,exynos850-usi
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space
  2025-07-22 12:10 [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space Ivaylo Ivanov
  2025-07-22 12:10 ` [PATCH v1 2/2] dt-bindings: soc: samsung: usi: add samsung,exynos2200-usi compatible Ivaylo Ivanov
@ 2025-07-23  8:15 ` Krzysztof Kozlowski
  2025-07-23  8:21   ` Ivaylo Ivanov
  1 sibling, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-23  8:15 UTC (permalink / raw)
  To: Ivaylo Ivanov
  Cc: Krzysztof Kozlowski, Alim Akhtar, Sam Protsenko, Rob Herring,
	Conor Dooley, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-kernel

On Tue, Jul 22, 2025 at 03:10:36PM +0300, Ivaylo Ivanov wrote:
> Some device trees, like the exynos2200 one, configure the root node
> with #address-cells and #size-cells set to 2. However, the usi binding
> expects 32 bit address space only. Allow these determining properties to

So if USI expects 32 bit, then why do we allow 64?

Switching this to 2 means you use 64-bit addressing for children and
allowing DMA for >32 bit. This should be the true reason - what is the
address space and DMA range for children?

Best regards,
Krzysztof



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space
  2025-07-23  8:15 ` [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space Krzysztof Kozlowski
@ 2025-07-23  8:21   ` Ivaylo Ivanov
  2025-07-24  3:02     ` Sam Protsenko
  2025-07-24  6:56     ` Krzysztof Kozlowski
  0 siblings, 2 replies; 10+ messages in thread
From: Ivaylo Ivanov @ 2025-07-23  8:21 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, Alim Akhtar, Sam Protsenko, Rob Herring,
	Conor Dooley, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-kernel

On 7/23/25 11:15, Krzysztof Kozlowski wrote:
> On Tue, Jul 22, 2025 at 03:10:36PM +0300, Ivaylo Ivanov wrote:
>> Some device trees, like the exynos2200 one, configure the root node
>> with #address-cells and #size-cells set to 2. However, the usi binding
>> expects 32 bit address space only. Allow these determining properties to
> So if USI expects 32 bit, then why do we allow 64?
>
> Switching this to 2 means you use 64-bit addressing for children

I don't, but the main point was to avoid defining ranges for every single usi
node, because they are a lot.

Best regards,
Ivaylo

>  and
> allowing DMA for >32 bit. This should be the true reason - what is the
> address space and DMA range for children?
>
> Best regards,
> Krzysztof
>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 2/2] dt-bindings: soc: samsung: usi: add samsung,exynos2200-usi compatible
  2025-07-22 12:10 ` [PATCH v1 2/2] dt-bindings: soc: samsung: usi: add samsung,exynos2200-usi compatible Ivaylo Ivanov
@ 2025-07-24  2:24   ` Sam Protsenko
  0 siblings, 0 replies; 10+ messages in thread
From: Sam Protsenko @ 2025-07-24  2:24 UTC (permalink / raw)
  To: Ivaylo Ivanov
  Cc: Krzysztof Kozlowski, Alim Akhtar, Rob Herring, Conor Dooley,
	linux-samsung-soc, devicetree, linux-arm-kernel, linux-kernel

On Tue, Jul 22, 2025 at 7:11 AM Ivaylo Ivanov
<ivo.ivanov.ivanov1@gmail.com> wrote:
>
> Add samsung,exynos2200-usi dedicated compatible for representing the USI
> of Samsung Exynos 2200 SoC.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---

Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>

>  Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
> index 4ce871676..bbf6d3b2f 100644
> --- a/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
> +++ b/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
> @@ -36,6 +36,7 @@ properties:
>        - items:
>            - enum:
>                - google,gs101-usi
> +              - samsung,exynos2200-usi
>                - samsung,exynosautov9-usi
>                - samsung,exynosautov920-usi
>            - const: samsung,exynos850-usi
> --
> 2.43.0
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space
  2025-07-23  8:21   ` Ivaylo Ivanov
@ 2025-07-24  3:02     ` Sam Protsenko
  2025-07-24  7:24       ` Ivaylo Ivanov
  2025-07-24  6:56     ` Krzysztof Kozlowski
  1 sibling, 1 reply; 10+ messages in thread
From: Sam Protsenko @ 2025-07-24  3:02 UTC (permalink / raw)
  To: Ivaylo Ivanov
  Cc: Krzysztof Kozlowski, Krzysztof Kozlowski, Alim Akhtar,
	Rob Herring, Conor Dooley, linux-samsung-soc, devicetree,
	linux-arm-kernel, linux-kernel

On Wed, Jul 23, 2025 at 3:21 AM Ivaylo Ivanov
<ivo.ivanov.ivanov1@gmail.com> wrote:
>
> On 7/23/25 11:15, Krzysztof Kozlowski wrote:
> > On Tue, Jul 22, 2025 at 03:10:36PM +0300, Ivaylo Ivanov wrote:
> >> Some device trees, like the exynos2200 one, configure the root node
> >> with #address-cells and #size-cells set to 2. However, the usi binding
> >> expects 32 bit address space only. Allow these determining properties to
> > So if USI expects 32 bit, then why do we allow 64?
> >
> > Switching this to 2 means you use 64-bit addressing for children
>
> I don't, but the main point was to avoid defining ranges for every single usi
> node, because they are a lot.
>

If all MMIO addresses in your SoC are 32-bit (they probably are), I
think it'd be neater to just make the entire "soc" bus 32-bit (so both
address and size cells = <1>), and map it to the root node's address
space with "ranges", like this:

    soc: soc@0 {
        compatible = "simple-bus";
        #address-cells = <1>;
        #size-cells = <1>;
        ranges = <0x0 0x0 0x0 0x20000000>;
        ...

That's how it's done in exynos850 and gs101 dts for example. This way
you could drop all those extra "reg = <0x0 ...>" in the child nodes,
also avoid declaring "ranges" arrays in each USI node (just "ranges;"
would be enough), and this patch won't be needed. Maybe I'm missing
some details though?

> Best regards,
> Ivaylo
>
> >  and
> > allowing DMA for >32 bit. This should be the true reason - what is the
> > address space and DMA range for children?
> >
> > Best regards,
> > Krzysztof
> >
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space
  2025-07-23  8:21   ` Ivaylo Ivanov
  2025-07-24  3:02     ` Sam Protsenko
@ 2025-07-24  6:56     ` Krzysztof Kozlowski
  2025-07-24  7:02       ` Ivaylo Ivanov
  1 sibling, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-24  6:56 UTC (permalink / raw)
  To: Ivaylo Ivanov
  Cc: Krzysztof Kozlowski, Alim Akhtar, Sam Protsenko, Rob Herring,
	Conor Dooley, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-kernel

On 23/07/2025 10:21, Ivaylo Ivanov wrote:
> On 7/23/25 11:15, Krzysztof Kozlowski wrote:
>> On Tue, Jul 22, 2025 at 03:10:36PM +0300, Ivaylo Ivanov wrote:
>>> Some device trees, like the exynos2200 one, configure the root node
>>> with #address-cells and #size-cells set to 2. However, the usi binding
>>> expects 32 bit address space only. Allow these determining properties to
>> So if USI expects 32 bit, then why do we allow 64?
>>
>> Switching this to 2 means you use 64-bit addressing for children
> 
> I don't, but the main point was to avoid defining ranges for every single usi

I do not understand your "I don't", because you do. You change the child
address space to 64 bit and switch to 36/64 bit DMA. That's the meaning
of address cells 2.


Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space
  2025-07-24  6:56     ` Krzysztof Kozlowski
@ 2025-07-24  7:02       ` Ivaylo Ivanov
  2025-07-25  7:37         ` Krzysztof Kozlowski
  0 siblings, 1 reply; 10+ messages in thread
From: Ivaylo Ivanov @ 2025-07-24  7:02 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Krzysztof Kozlowski, Alim Akhtar, Sam Protsenko, Rob Herring,
	Conor Dooley, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-kernel

On 7/24/25 09:56, Krzysztof Kozlowski wrote:
> On 23/07/2025 10:21, Ivaylo Ivanov wrote:
>> On 7/23/25 11:15, Krzysztof Kozlowski wrote:
>>> On Tue, Jul 22, 2025 at 03:10:36PM +0300, Ivaylo Ivanov wrote:
>>>> Some device trees, like the exynos2200 one, configure the root node
>>>> with #address-cells and #size-cells set to 2. However, the usi binding
>>>> expects 32 bit address space only. Allow these determining properties to
>>> So if USI expects 32 bit, then why do we allow 64?
>>>
>>> Switching this to 2 means you use 64-bit addressing for children
>> I don't, but the main point was to avoid defining ranges for every single usi
> I do not understand your "I don't", because you do.

I meant it in the "I don't _need_ to explicitly use that, but it's _nice_ to have"
way, so I don't have to clutter the nodes with address translations in ranges.

Best regards,
Ivaylo

>  You change the child
> address space to 64 bit and switch to 36/64 bit DMA. That's the meaning
> of address cells 2.
>
>
> Best regards,
> Krzysztof



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space
  2025-07-24  3:02     ` Sam Protsenko
@ 2025-07-24  7:24       ` Ivaylo Ivanov
  0 siblings, 0 replies; 10+ messages in thread
From: Ivaylo Ivanov @ 2025-07-24  7:24 UTC (permalink / raw)
  To: Sam Protsenko
  Cc: Krzysztof Kozlowski, Krzysztof Kozlowski, Alim Akhtar,
	Rob Herring, Conor Dooley, linux-samsung-soc, devicetree,
	linux-arm-kernel, linux-kernel

On 7/24/25 06:02, Sam Protsenko wrote:
> On Wed, Jul 23, 2025 at 3:21 AM Ivaylo Ivanov
> <ivo.ivanov.ivanov1@gmail.com> wrote:
>> On 7/23/25 11:15, Krzysztof Kozlowski wrote:
>>> On Tue, Jul 22, 2025 at 03:10:36PM +0300, Ivaylo Ivanov wrote:
>>>> Some device trees, like the exynos2200 one, configure the root node
>>>> with #address-cells and #size-cells set to 2. However, the usi binding
>>>> expects 32 bit address space only. Allow these determining properties to
>>> So if USI expects 32 bit, then why do we allow 64?
>>>
>>> Switching this to 2 means you use 64-bit addressing for children
>> I don't, but the main point was to avoid defining ranges for every single usi
>> node, because they are a lot.
>>
> If all MMIO addresses in your SoC are 32-bit (they probably are), I
> think it'd be neater to just make the entire "soc" bus 32-bit (so both
> address and size cells = <1>), and map it to the root node's address
> space with "ranges", like this:
>
>     soc: soc@0 {
>         compatible = "simple-bus";
>         #address-cells = <1>;
>         #size-cells = <1>;
>         ranges = <0x0 0x0 0x0 0x20000000>;
>         ...
>
> That's how it's done in exynos850 and gs101 dts for example. This way
> you could drop all those extra "reg = <0x0 ...>" in the child nodes,
> also avoid declaring "ranges" arrays in each USI node (just "ranges;"
> would be enough), and this patch won't be needed.

Yeah, but then we'll have one more DT patch that is way bigger, changing
every single "reg =" in /soc. And the device tree for the SoC is merged already.

I do think that the neatest option is to avoid that and set an enum in the
binding, as otherwise we'd be making a stylistic change that has no
impact on functionality.

If we want the device tree to model hardware identically to how it is, then
we'd want to define IPs per bus (which I cannot really do on my own, I don't
even have TRMs).

I'll leave it up to Krzysztof to decide what is best.

Best regards,
Ivaylo

> Maybe I'm missing
> some details though?
>
>> Best regards,
>> Ivaylo
>>
>>>  and
>>> allowing DMA for >32 bit. This should be the true reason - what is the
>>> address space and DMA range for children?
>>>
>>> Best regards,
>>> Krzysztof
>>>



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space
  2025-07-24  7:02       ` Ivaylo Ivanov
@ 2025-07-25  7:37         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2025-07-25  7:37 UTC (permalink / raw)
  To: Ivaylo Ivanov
  Cc: Krzysztof Kozlowski, Alim Akhtar, Sam Protsenko, Rob Herring,
	Conor Dooley, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-kernel

On 24/07/2025 09:02, Ivaylo Ivanov wrote:
> On 7/24/25 09:56, Krzysztof Kozlowski wrote:
>> On 23/07/2025 10:21, Ivaylo Ivanov wrote:
>>> On 7/23/25 11:15, Krzysztof Kozlowski wrote:
>>>> On Tue, Jul 22, 2025 at 03:10:36PM +0300, Ivaylo Ivanov wrote:
>>>>> Some device trees, like the exynos2200 one, configure the root node
>>>>> with #address-cells and #size-cells set to 2. However, the usi binding
>>>>> expects 32 bit address space only. Allow these determining properties to
>>>> So if USI expects 32 bit, then why do we allow 64?
>>>>
>>>> Switching this to 2 means you use 64-bit addressing for children
>>> I don't, but the main point was to avoid defining ranges for every single usi
>> I do not understand your "I don't", because you do.
> 
> I meant it in the "I don't _need_ to explicitly use that, but it's _nice_ to have"
> way, so I don't have to clutter the nodes with address translations in ranges.

It is not nice to have. The address space should not grow above the
device limits or even above the needs (sometime ago Rob explicitly asked
for that). Changing to 64-bit just because you do not want to add ranges
property is not correct, because it misses the main point: what is the
address space?

Changing to 64-bit because that's the address space would be fine, but
that was not argued here.

I did not check in the datasheets, but I assume these devices want
32-bit address space and that's how it should stay.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-07-25  7:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22 12:10 [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space Ivaylo Ivanov
2025-07-22 12:10 ` [PATCH v1 2/2] dt-bindings: soc: samsung: usi: add samsung,exynos2200-usi compatible Ivaylo Ivanov
2025-07-24  2:24   ` Sam Protsenko
2025-07-23  8:15 ` [PATCH v1 1/2] dt-bindings: soc: samsung: usi: allow 64-bit address space Krzysztof Kozlowski
2025-07-23  8:21   ` Ivaylo Ivanov
2025-07-24  3:02     ` Sam Protsenko
2025-07-24  7:24       ` Ivaylo Ivanov
2025-07-24  6:56     ` Krzysztof Kozlowski
2025-07-24  7:02       ` Ivaylo Ivanov
2025-07-25  7:37         ` Krzysztof Kozlowski

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).