Message ID | 20240122170518.3090814-5-wens@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-33743-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp2731148dyb; Mon, 22 Jan 2024 09:44:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHBb9guIerAtTTlG4YonOkltJpl4LgysOkSk/YdUY0nCTHY2oMK6jYvWZMU3B5iMZg3TIq X-Received: by 2002:ac8:7f84:0:b0:42a:4586:7ae9 with SMTP id z4-20020ac87f84000000b0042a45867ae9mr1158878qtj.57.1705945492817; Mon, 22 Jan 2024 09:44:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705945492; cv=pass; d=google.com; s=arc-20160816; b=XWN2IIaM3OhEtCOnVan54sVFX1r8vtr0PJp+eA3h8jTUU10pigF1wU3TNWhVavcMjI BQ5vEi3M/4xDnAPTq7tZ+ArcfZCAxf5PzxNoY17Fu2P8uUjYXy9Wph34sHgjTHdaMq/7 EZjRm83F7NNU3SnV7XSomGA3LredYpJwnYHZYfNHirOJSg3pxHGpeffW+hz+cg46wwhN 1S9HriGfG4/FvM0cLsS1MSFmwOVHUasKV9QB+dxsvgWL7KF/FNlwWifZNuW5BBgSnAiw JuPluJuKXLjv0UJJgMl9b9k0Zjj8pyM860QbGZcm/0bIX+maMs6y21nKgo2bj3Le4GfZ iWDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=c8CVW0zwAC4l9tz3jGaX6dHHyhaSBQYLOCqdWa3qKeY=; fh=m1+VV4HTiGNm18uZzn/d6hCG96aBwlw9t3UKL+x124s=; b=TGpATeBuNS1i3TAFRldhlCw9hlc1L5TF3xjOlZMg1YSNyXzG3EVvHtGnNA9iPbWfvL oVsCTJJGFVJZMMUFIcZP8o9GIjRq11RdR5l8Psl/umj71tlE//uYLcwBuWecDpJuJESC 8KJ0cDwHU8pqd0e3/Scr4mY16x6gf7qY9ZdNwKpv9cDU0cVacfo/Rkm5C38pBtvqp5Ye PgVmy2VGFHGyU22CT9PIw74IOUJQmdbbQx94gqqdLtw82Zq9r3Vn0qXPnm7kKUZZa33O LUn5GsZOP8uoA0jLaOwQBJe+BRlt2m2nj+wQXgK7jEk17tAKcPhC2gcZGw1ttPxJvKCZ a7CA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=We0IU1KN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33743-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33743-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f3-20020a05622a104300b0042a468c55edsi1145135qte.38.2024.01.22.09.44.52 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 09:44:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33743-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=We0IU1KN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33743-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33743-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9BCFD1C27571 for <ouuuleilei@gmail.com>; Mon, 22 Jan 2024 17:44:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB1575D743; Mon, 22 Jan 2024 17:05:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="We0IU1KN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CDEB3D990; Mon, 22 Jan 2024 17:05:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705943133; cv=none; b=nQ/nO1M0cHzn05oUl17dTLv0Q2E/Eqgi0UA2e2ITLwhJxXWqex1dCUlE7Sf3RDp2A2FZGMAha+9mx3lmseqgHSgLYxcDzCbcuEFEughPI2lLmTtlRD+P55bmsg/6JMj3P4YJv/qt8Or0IIgLp8yNNFLQb4fBhlkNVcK7+CnPPSU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705943133; c=relaxed/simple; bh=S1UkfK4/p0h181iT92j9rPEO3r0iRuL3QMMsPwiuSjY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iqQDlhH2w/n1h0DAXaGyB5Ah02UHJTKhnj/EI+G4ETAbUdf14S0e8NHwBY5+DkHFrITgtmIM2SPzGxfVSWeAyHF9nARNO+mWlyb5oAS0fP3D+/tHXRcUb/LQO8ZVh5aAyKxULXTle4pMlAWBOxDXDM8mQOsFW8cXQOckNEen99o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=We0IU1KN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98346C433A6; Mon, 22 Jan 2024 17:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705943132; bh=S1UkfK4/p0h181iT92j9rPEO3r0iRuL3QMMsPwiuSjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=We0IU1KNz5olxvNKbzGISxymnsCBPYNEmHnBPYe0KSnaa6SFlpW03oES+JnMoq8YC juiRstM9skTINNEATDvPHQnKam5PnTYkgPkjl75W4Uwc+hLPU5ivjvbKSei7e86HMd cZkSDUKl1F8DszivK2iiyOZ6e5c/AnwfwjECbGHRMXOfWGblEi5xvJbOMcq2UEW+PO KMJhRu7hoeT9sdEsnob11MVrjW48vsZA4IhXI8XEIL3mvpUIfrxnHmH8yD/HluAjzN p//aoMFPhYpwaUDmbEdrAfJpIDSz7ZsmyknDJAECmzoscNByaRjXo/2foseJm8Okxs Zf7i0qWj3zg/A== Received: by wens.tw (Postfix, from userid 1000) id F13F66001C; Tue, 23 Jan 2024 01:05:29 +0800 (CST) From: Chen-Yu Tsai <wens@kernel.org> To: 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> Cc: Chen-Yu Tsai <wens@csie.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: [PATCH 4/7] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616 Date: Tue, 23 Jan 2024 01:05:15 +0800 Message-Id: <20240122170518.3090814-5-wens@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240122170518.3090814-1-wens@kernel.org> References: <20240122170518.3090814-1-wens@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788813500835096677 X-GMAIL-MSGID: 1788813500835096677 |
Series |
arm64: sun50i-h616: Add DMA and SPDIF controllers
|
|
Commit Message
Chen-Yu Tsai
Jan. 22, 2024, 5:05 p.m. UTC
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. 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(-)
Comments
On Tue, Jan 23, 2024 at 01:05:15AM +0800, Chen-Yu Tsai wrote: > 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. > > 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 Instead of introducing this complexity, could you instead use "contains" here? Unless I am missing soemthing, you can achieve the same thing here with: |if: | properties: | compatible: | constains: | enum: | - allwinner,sun20i-d1-dma | - allwinner,sun50i-a100-dma | - allwinner,sun50i-h6-dma
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. 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? 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:
On Tue, Jan 23, 2024 at 2:18 AM Conor Dooley <conor@kernel.org> wrote: > > On Tue, Jan 23, 2024 at 01:05:15AM +0800, Chen-Yu Tsai wrote: > > 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. > > > > 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 > > Instead of introducing this complexity, could you instead use "contains" > here? Unless I am missing soemthing, you can achieve the same thing here > with: > |if: > | properties: > | compatible: > | constains: > | enum: > | - allwinner,sun20i-d1-dma > | - allwinner,sun50i-a100-dma > | - allwinner,sun50i-h6-dma Thank you for the reminder. I had a vague impression that something simpler worked, but couldn't remember what exactly. ChenYu
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? > 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. ChenYu > 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: >
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: > > >
On Thu, Jan 25, 2024 at 11:09 PM Andre Przywara <andre.przywara@armcom> wrote: > > 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. I'd say that makes the descriptor address register backward compatible, > One could check how the H6 DMA controller reacts to those bits not being > 0, not sure if I find the time, though. but no idea about the parameter field in the descriptor. So for now I think we should just be cautious. Since as you mentioned the A100 is already supported and listed separately, lets just keep that for now. ChenYu [...]
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: