Received: by 2002:a05:7412:aaaa:b0:fc:8d27:76e1 with SMTP id p42csp201771rde; Thu, 25 Jan 2024 06:38:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFz+2wNvHErd9lIB0p2HrrztaVEDkGiYUx7SgOhX6G0ReLJBUtmOhMPIoDcjFYfdloDLSb5 X-Received: by 2002:a17:907:d50d:b0:a2c:8dba:eb1b with SMTP id wb13-20020a170907d50d00b00a2c8dbaeb1bmr446095ejc.112.1706193485584; Thu, 25 Jan 2024 06:38:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706193485; cv=pass; d=google.com; s=arc-20160816; b=cK46Uz+7p/XZQ015x8T6Miu9YsyE+r8jcvXymKTw9Vvo21DSWsdU6wzGAXtuPzYhUS P6yu2lHy5njtrO7ZR4ZQfFYP0pyIk+2kBQXsppi91nAeqJmx7D7+Vc0jERfEEa/Fg1r4 QZxU3cYR3LMR1urQmbTKSdDk1wHDMdzTEEmspBITiVgNo15Nz5honM3LQ2sX6Bjtq4XG 3xpS0MiEG7aB0ccJqmYRfBRi0F5gJHs+2uk4vFwVj6R2QdL5XLXbU25X3mA4HwpOPlsc jmg5relcme5gSyrR0JbF8LP12HLc1hq278lpH73ATV2OWnHHtMDjV4Ku+UBiAR9XKpd4 qOYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=EN/0FgG9t4gA+/0JwkBgzpa6eTBU/T9B6Th5n/ba/ks=; fh=BKl0JoTBiRvcLIRwkwnICWZSPKLN1H6ucBBoGKCjmH0=; b=hQJM6WLNbHjPDnXXXn0rSj2N8eFUYIJnpuDGkbW7qdZyFMP5A4y/8P/Uzz0Y+OlBYL 47i8RJVwODkA/PB0cTV1ogqnmhxpetXy+nkMX/G4CP18z0H47p6cSLs8lSDsH5qx1Tlh cHNR76I7vB1CKicBC4Zh2HjfS2CuCXRccBzr3IAMcFLkkkz95fSVxFb2KTxOVGT5GlGx J7+UJD+HMaNk5sfoxx9a4ay+Vs68L5x6p1awzF0g05N8hC+qFMN0Lj88IbGtsXwXyR58 JcypfU7q9yoKhF7jKxlSXUwIpK686+lHZw3YMdSoTz1BbPAwwsW1lGPwynZAm5T3c1Yu /ZQA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AyNb4R1O; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38731-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a17-20020a1709065f9100b00a31898cdf7bsi483672eju.136.2024.01.25.06.38.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:38:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AyNb4R1O; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38731-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 426631F24E0F for ; Thu, 25 Jan 2024 14:38:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70B316E2D0; Thu, 25 Jan 2024 14:37:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AyNb4R1O" 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 8603E4F218; Thu, 25 Jan 2024 14:37:46 +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=1706193466; cv=none; b=cTZ1LdjFUY1UN5xMuYvM7Nreg6giyucRWWrpriYFIRmuAVbVcBFYeDVOXsonQQ2Hsnp2aB8HCKeTOI3cg6Shph/tcJNHrWfkaxbMpJ5w5FMqQS+YkSdQIBTv7ZAFMt8T7lbGQyQ5u/MOW1fu5bQzQW5qgSMhQ+mEX6A3Lv7aW9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706193466; c=relaxed/simple; bh=YAJ84nFqDAAULU1LrFi+Bod6RZHD93P1gKfDzYnewtE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=BfhRTvw59D5I/VM4DJ/fngE9qlABrRwm4z1jF0iSv6Xgv/4uY2VVSpgOi9227W932u0yevgoSmQWW71k6UpLf6OuVxoi5ycaYrPkH3Nfpo7Fj3UlGgrn3lvqTnrcm+8g+/uKu7TdIjw2DpwFRojsQ3uZ0W/XxLou6mtT85KOmq8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AyNb4R1O; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15BA8C43390; Thu, 25 Jan 2024 14:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706193466; bh=YAJ84nFqDAAULU1LrFi+Bod6RZHD93P1gKfDzYnewtE=; h=References:In-Reply-To:Reply-To:From:Date:Subject:To:Cc:From; b=AyNb4R1Ox5Sv2XDBewRnHPFjArH3pt/MhCM8kNlYk9WkiHcEteOyf0pd2LTXukMPx rYrcrzhgbjYoAeElb3dPQHnCbRmPRmpWVx+sz4KgHLcN/bc0R+Y8kNBIXrvnvFcPNF +qVAsIFvC8zTMU+dl7NNYyjepXSp14gk+vDTuipT51iBWRsihoZacfckqZm8mSCzvn dWQ9BDdLV2mOX0SmDkF37brPI4Qwn6AMiHaJkqOrYrnc5ab/ve0FHrULTNMndADKUJ nfdVSrh0fBPJkTJIhd91uYfy92B9KYbpt5rM3OSG7OpF91X8Ti+iXgBjAhbl/g/g4p R0fq1xCMR5s9A== Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-5cddfe0cb64so3625355a12.0; Thu, 25 Jan 2024 06:37:46 -0800 (PST) X-Gm-Message-State: AOJu0YxBPzsFVTo3TvPt3TO5Fzv9hwGWkBBwFlP42cgTVO6Ok2A5K1Lh SHeftDQDCZKwI7uPngltTtXuxaVdVW9Jy0gY9hscZSU5AKPwCKwADuXCmgDzlqqrhqtCj+FRp+y ATkbFJUj9eKxZo3sXKiAkrIYh6Eg= X-Received: by 2002:a17:90b:b85:b0:28c:a9d0:33ff with SMTP id bd5-20020a17090b0b8500b0028ca9d033ffmr645889pjb.62.1706193465678; Thu, 25 Jan 2024 06:37:45 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240122170518.3090814-1-wens@kernel.org> <20240122170518.3090814-5-wens@kernel.org> <20240123004010.59cac5ad@minigeek.lan> In-Reply-To: <20240123004010.59cac5ad@minigeek.lan> Reply-To: wens@kernel.org From: Chen-Yu Tsai Date: Thu, 25 Jan 2024 22:37:34 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/7] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatible for H616 To: Andre Przywara Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jernej Skrabec , Samuel Holland , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Vinod Koul , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 23, 2024 at 8:41=E2=80=AFAM Andre Przywara wrote: > > On Tue, 23 Jan 2024 01:05:15 +0800 > Chen-Yu Tsai wrote: > > Hi, > > > From: Chen-Yu Tsai > > > > 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-9f0f9344= 90ea@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 additiona= l > > generic properties, just add a new H616-specific compatible string and > > fallback to the H6 one. > > > > Signed-off-by: Chen-Yu Tsai > > --- > > .../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.ya= ml > > +++ b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.ya= ml > > @@ -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: >