All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Chen-Yu Tsai <wens@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>, Vinod Koul <vkoul@kernel.org>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-sound@vger.kernel.org,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/7] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616
Date: Thu, 25 Jan 2024 15:09:42 +0000	[thread overview]
Message-ID: <20240125150942.2535a228@donnerap.manchester.arm.com> (raw)
In-Reply-To: <CAGb2v66UmLuWyLvvULZeW6MKFauM-xAMPAO9W_TPAByXYqKCBg@mail.gmail.com>

On Thu, 25 Jan 2024 22:37:34 +0800
Chen-Yu Tsai <wens@kernel.org> wrote:

Hi,

> On Tue, Jan 23, 2024 at 8:41 AM Andre Przywara <andre.przywara@arm.com> wrote:
> >
> > On Tue, 23 Jan 2024 01:05:15 +0800
> > Chen-Yu Tsai <wens@kernel.org> wrote:
> >
> > Hi,
> >  
> > > From: Chen-Yu Tsai <wens@csie.org>
> > >
> > > The DMA controllers found on the H616 and H618 are the same as the one
> > > found on the H6. The only difference is the DMA endpoint (DRQ) layout.  
> >
> > That does not seem to be entirely true: The H616 encodes the two lowest
> > bits in DMA_DESC_ADDR_REG differently: on the H6 they must be 0 (word
> > aligned), on the H616 these contain bits [33:32] of the address of the
> > DMA descriptor. The manual doesn't describe the descriptor format in
> > much detail, but ec31c5c59492 suggests that those two bits are put in
> > the "para" word of the descriptor.  
> 
> Good catch. So, same as the A100 I believe?

Yes, that's what I got as well.

> > The good thing it that this encoding is backwards compatible, so I
> > think the fallback string still holds: Any driver just implementing the
> > H6 encoding would be able to drive the H616.
> >
> > I think the A100 was mis-described, as mentioned here:
> > https://lore.kernel.org/linux-arm-kernel/29e575b6-14cb-73f1-512d-9f0f934490ea@arm.com/
> > I think we should:
> > - make the A100 use: "allwinner,sun50i-a100-dma", "sun50i-h6-dma"
> > - make the H616 use: "allwinner,sun50i-h616-dma", "allwinner,sun50i-a100-dma", "sun50i-h6-dma"
> >
> > Does that make sense?  
> 
> I wouldn't call that exactly backward compatible. Say the driver forgot to
> clear the two bits. It would work fine on the H6, but the accessed address
> could be way off on the A100 and H616.

I don't know the exact boundaries of "compatible" here, but the H6 manual
pretty clearly states "The descriptor address must be word-aligned."
But since the A100 compatible is known and supported for a while, that
doesn't really matter, practically speaking, I guess.

One could check how the H6 DMA controller reacts to those bits not being
0, not sure if I find the time, though.

Cheers,
Andre.

> > Cheers,
> > Andre
> >  
> > > Since the number of channels and endpoints are described with additional
> > > generic properties, just add a new H616-specific compatible string and
> > > fallback to the H6 one.
> > >
> > > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > > ---
> > >  .../bindings/dma/allwinner,sun50i-a64-dma.yaml    | 15 +++++++++++----
> > >  1 file changed, 11 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> > > index ec2d7a789ffe..e5693be378bd 100644
> > > --- a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> > > +++ b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> > > @@ -28,6 +28,9 @@ properties:
> > >        - items:
> > >            - const: allwinner,sun8i-r40-dma
> > >            - const: allwinner,sun50i-a64-dma
> > > +      - items:
> > > +          - const: allwinner,sun50i-h616-dma
> > > +          - const: allwinner,sun50i-h6-dma
> > >
> > >    reg:
> > >      maxItems: 1
> > > @@ -59,10 +62,14 @@ required:
> > >  if:
> > >    properties:
> > >      compatible:
> > > -      enum:
> > > -        - allwinner,sun20i-d1-dma
> > > -        - allwinner,sun50i-a100-dma
> > > -        - allwinner,sun50i-h6-dma
> > > +      oneOf:
> > > +        - enum:
> > > +            - allwinner,sun20i-d1-dma
> > > +            - allwinner,sun50i-a100-dma
> > > +            - allwinner,sun50i-h6-dma
> > > +        - items:
> > > +            - const: allwinner,sun50i-h616-dma
> > > +            - const: allwinner,sun50i-h6-dma
> > >
> > >  then:
> > >    properties:  
> >  
> 


WARNING: multiple messages have this Message-ID (diff)
From: Andre Przywara <andre.przywara@arm.com>
To: Chen-Yu Tsai <wens@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>, Vinod Koul <vkoul@kernel.org>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-sound@vger.kernel.org,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/7] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616
Date: Thu, 25 Jan 2024 15:09:42 +0000	[thread overview]
Message-ID: <20240125150942.2535a228@donnerap.manchester.arm.com> (raw)
In-Reply-To: <CAGb2v66UmLuWyLvvULZeW6MKFauM-xAMPAO9W_TPAByXYqKCBg@mail.gmail.com>

On Thu, 25 Jan 2024 22:37:34 +0800
Chen-Yu Tsai <wens@kernel.org> wrote:

Hi,

> On Tue, Jan 23, 2024 at 8:41 AM Andre Przywara <andre.przywara@arm.com> wrote:
> >
> > On Tue, 23 Jan 2024 01:05:15 +0800
> > Chen-Yu Tsai <wens@kernel.org> wrote:
> >
> > Hi,
> >  
> > > From: Chen-Yu Tsai <wens@csie.org>
> > >
> > > The DMA controllers found on the H616 and H618 are the same as the one
> > > found on the H6. The only difference is the DMA endpoint (DRQ) layout.  
> >
> > That does not seem to be entirely true: The H616 encodes the two lowest
> > bits in DMA_DESC_ADDR_REG differently: on the H6 they must be 0 (word
> > aligned), on the H616 these contain bits [33:32] of the address of the
> > DMA descriptor. The manual doesn't describe the descriptor format in
> > much detail, but ec31c5c59492 suggests that those two bits are put in
> > the "para" word of the descriptor.  
> 
> Good catch. So, same as the A100 I believe?

Yes, that's what I got as well.

> > The good thing it that this encoding is backwards compatible, so I
> > think the fallback string still holds: Any driver just implementing the
> > H6 encoding would be able to drive the H616.
> >
> > I think the A100 was mis-described, as mentioned here:
> > https://lore.kernel.org/linux-arm-kernel/29e575b6-14cb-73f1-512d-9f0f934490ea@arm.com/
> > I think we should:
> > - make the A100 use: "allwinner,sun50i-a100-dma", "sun50i-h6-dma"
> > - make the H616 use: "allwinner,sun50i-h616-dma", "allwinner,sun50i-a100-dma", "sun50i-h6-dma"
> >
> > Does that make sense?  
> 
> I wouldn't call that exactly backward compatible. Say the driver forgot to
> clear the two bits. It would work fine on the H6, but the accessed address
> could be way off on the A100 and H616.

I don't know the exact boundaries of "compatible" here, but the H6 manual
pretty clearly states "The descriptor address must be word-aligned."
But since the A100 compatible is known and supported for a while, that
doesn't really matter, practically speaking, I guess.

One could check how the H6 DMA controller reacts to those bits not being
0, not sure if I find the time, though.

Cheers,
Andre.

> > Cheers,
> > Andre
> >  
> > > Since the number of channels and endpoints are described with additional
> > > generic properties, just add a new H616-specific compatible string and
> > > fallback to the H6 one.
> > >
> > > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > > ---
> > >  .../bindings/dma/allwinner,sun50i-a64-dma.yaml    | 15 +++++++++++----
> > >  1 file changed, 11 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> > > index ec2d7a789ffe..e5693be378bd 100644
> > > --- a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> > > +++ b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
> > > @@ -28,6 +28,9 @@ properties:
> > >        - items:
> > >            - const: allwinner,sun8i-r40-dma
> > >            - const: allwinner,sun50i-a64-dma
> > > +      - items:
> > > +          - const: allwinner,sun50i-h616-dma
> > > +          - const: allwinner,sun50i-h6-dma
> > >
> > >    reg:
> > >      maxItems: 1
> > > @@ -59,10 +62,14 @@ required:
> > >  if:
> > >    properties:
> > >      compatible:
> > > -      enum:
> > > -        - allwinner,sun20i-d1-dma
> > > -        - allwinner,sun50i-a100-dma
> > > -        - allwinner,sun50i-h6-dma
> > > +      oneOf:
> > > +        - enum:
> > > +            - allwinner,sun20i-d1-dma
> > > +            - allwinner,sun50i-a100-dma
> > > +            - allwinner,sun50i-h6-dma
> > > +        - items:
> > > +            - const: allwinner,sun50i-h616-dma
> > > +            - const: allwinner,sun50i-h6-dma
> > >
> > >  then:
> > >    properties:  
> >  
> 


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

  reply	other threads:[~2024-01-25 15:09 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 17:05 [PATCH 0/7] arm64: sun50i-h616: Add DMA and SPDIF controllers Chen-Yu Tsai
2024-01-22 17:05 ` Chen-Yu Tsai
2024-01-22 17:05 ` [PATCH 1/7] dt-bindings: sound: sun4i-spdif: Fix requirements for H6 Chen-Yu Tsai
2024-01-22 17:05   ` Chen-Yu Tsai
2024-01-22 18:18   ` Conor Dooley
2024-01-22 18:18     ` Conor Dooley
2024-01-23 17:48   ` Jernej Škrabec
2024-01-23 17:48     ` Jernej Škrabec
2024-01-22 17:05 ` [PATCH 2/7] dt-bindings: sound: sun4i-spdif: Add Allwinner H616 compatible Chen-Yu Tsai
2024-01-22 17:05   ` Chen-Yu Tsai
2024-01-22 18:19   ` Conor Dooley
2024-01-22 18:19     ` Conor Dooley
2024-01-23 17:49   ` Jernej Škrabec
2024-01-23 17:49     ` Jernej Škrabec
2024-01-22 17:05 ` [PATCH 3/7] ASoC: sunxi: sun4i-spdif: Add support for Allwinner H616 Chen-Yu Tsai
2024-01-22 17:05   ` Chen-Yu Tsai
2024-01-23  0:38   ` Andre Przywara
2024-01-23  0:38     ` Andre Przywara
2024-01-23 17:50   ` Jernej Škrabec
2024-01-23 17:50     ` Jernej Škrabec
2024-01-22 17:05 ` [PATCH 4/7] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616 Chen-Yu Tsai
2024-01-22 17:05   ` Chen-Yu Tsai
2024-01-22 18:18   ` Conor Dooley
2024-01-22 18:18     ` Conor Dooley
2024-01-25 14:31     ` Chen-Yu Tsai
2024-01-25 14:31       ` Chen-Yu Tsai
2024-01-23  0:40   ` Andre Przywara
2024-01-23  0:40     ` Andre Przywara
2024-01-25 14:37     ` Chen-Yu Tsai
2024-01-25 14:37       ` Chen-Yu Tsai
2024-01-25 15:09       ` Andre Przywara [this message]
2024-01-25 15:09         ` Andre Przywara
2024-01-25 15:45         ` Chen-Yu Tsai
2024-01-25 15:45           ` Chen-Yu Tsai
2024-01-22 17:05 ` [PATCH 5/7] arm64: dts: allwinner: h6: Add RX DMA channel for SPDIF Chen-Yu Tsai
2024-01-22 17:05   ` Chen-Yu Tsai
2024-01-23  0:39   ` Andre Przywara
2024-01-23  0:39     ` Andre Przywara
2024-01-23 17:52   ` Jernej Škrabec
2024-01-23 17:52     ` Jernej Škrabec
2024-01-22 17:05 ` [PATCH 6/7] arm64: dts: allwinner: h616: Add DMA controller and DMA channels Chen-Yu Tsai
2024-01-22 17:05   ` Chen-Yu Tsai
2024-01-23  0:41   ` Andre Przywara
2024-01-23  0:41     ` Andre Przywara
2024-01-22 17:05 ` [PATCH 7/7] arm64: dts: allwinner: h616: Add SPDIF device node Chen-Yu Tsai
2024-01-22 17:05   ` Chen-Yu Tsai
2024-01-23  0:43   ` Andre Przywara
2024-01-23  0:43     ` Andre Przywara
2024-01-23 17:53   ` Jernej Škrabec
2024-01-23 17:53     ` Jernej Škrabec

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=20240125150942.2535a228@donnerap.manchester.arm.com \
    --to=andre.przywara@arm.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=samuel@sholland.org \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    --cc=wens@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.