Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3081463pxb; Mon, 25 Jan 2021 06:33:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7amkBTwqx5t3szf01AdmexErt8LmGciAENR+C1sQrXQxsp6Vk4pujJDkTshRQiFJQjT/h X-Received: by 2002:aa7:d401:: with SMTP id z1mr675181edq.213.1611585189999; Mon, 25 Jan 2021 06:33:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611585189; cv=none; d=google.com; s=arc-20160816; b=uZF013Ia9Ea9cUdoPwv329qh33qUkzBvR93HrdulsHdqU6LLHta83DkI08SPB/1vVZ zy+iB0qJvSPtz0odtQQJi9rJ3OKqX520TkMSUuGii2uFSPVdvMACOfxGJrPrutBwo8FJ OQQtVgW4rGngu7JZy4YSHJixfJTaqvOFAXry4bXBxGJiDC9NSiGVVImwd2vMsncavh5u DxsvbYFcXV0npRKPg/nHlgxZHCRaaE9Aa003zN4Xsef4viG01MlN8y0fezdCPbOyxaog 2GCqixQNdBgGeWOceP26IBTxHM/7PMr0/SU2eU50toos8Gn0a3JCz3wP5CBX/mV4rv+j EY2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=o4KyYlby3ix9gWsgIE+54GAeLjjtUdHgSTrB2Z0eyrw=; b=DXnOFPRlT6QcdBRthXFvuH28XX7jdj74kJD59qhPiR9Y9c9EReDvFy+8Pw2kaviyoL FPOlR1fGf6EoCNU9/QoLW6knVWV6YsU++ZoU8e2m7F6SIWHaUXC6hm7Um2YagZYYZaqV CtUiWPshsvc3RPVcEFoEshyAFigU9UsDEthKY8znYnFHQSnCbkMa4cQYrCTHgGj1gXG7 WQBgaPKw340wgkMXskxvJim9bI+eQIg/5wLrGNPlR86obIy6yIr6rBpnLNasz/kxglbJ VrT8kvobB6k2WRR8hnIeMDqloCqCKgQdiTcteHrIVqQdxnqpYKIhBDPwaEKnfLDRsDwA 2h9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si1340324ejr.748.2021.01.25.06.32.35; Mon, 25 Jan 2021 06:33:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729450AbhAYOZq (ORCPT + 99 others); Mon, 25 Jan 2021 09:25:46 -0500 Received: from mail-oi1-f174.google.com ([209.85.167.174]:41040 "EHLO mail-oi1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729391AbhAYOVq (ORCPT ); Mon, 25 Jan 2021 09:21:46 -0500 Received: by mail-oi1-f174.google.com with SMTP id m13so6948588oig.8; Mon, 25 Jan 2021 06:21:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o4KyYlby3ix9gWsgIE+54GAeLjjtUdHgSTrB2Z0eyrw=; b=LI+ZX9dcYzclLN2m7h7CjvAWfO329p94IC60huk3tMyZpe78aVF1K5vX79OmnJ8QtY UFr+OlVYYVKacZs4rLbZd+rRa733PJwthJUvyXGkcglWekwxLH1fwsWx+N+cd2RrlDjH 1sc25Dizvu1ItjNyQtd6Am2vjp6Sldsoa4kaHakvZ5QxGUEZ4sN8ws01hByRBwV7HCxW sZlXYpWptwCHxqTsC01bZFsaDU0cOzC8y3pj94WcrI68dyazZoPI5QlSVZsMG3Ny4iNh P6IKR8TQKcOphBC/a/BYyT2BoZOavTXPKkH0nsoX9fkVDArKa9AAgnVU3Dt4hJejHC2f 9RbQ== X-Gm-Message-State: AOAM531oSouNuHHMd+XxkZ9J2ZKiAQAK6/xvKMTgFpOVhevLke7bJ+re c7nmAbIjwGej/ERAFbK79rHZA30eH0T/CrKyTSw= X-Received: by 2002:aca:1219:: with SMTP id 25mr274231ois.54.1611584449552; Mon, 25 Jan 2021 06:20:49 -0800 (PST) MIME-Version: 1.0 References: <20210107181524.1947173-1-geert+renesas@glider.be> <20210107181524.1947173-5-geert+renesas@glider.be> <20210112103648.GL2771@vkoul-mobl> <20210112170415.GU2771@vkoul-mobl> In-Reply-To: <20210112170415.GU2771@vkoul-mobl> From: Geert Uytterhoeven Date: Mon, 25 Jan 2021 15:20:38 +0100 Message-ID: Subject: Re: [PATCH 4/4] dmaengine: rcar-dmac: Add support for R-Car V3U To: Vinod Koul Cc: Rob Herring , Dan Williams , Yoshihiro Shimoda , Phong Hoang , dmaengine , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinod, On Tue, Jan 12, 2021 at 6:04 PM Vinod Koul wrote: > On 12-01-21, 16:54, Geert Uytterhoeven wrote: > > On Tue, Jan 12, 2021 at 11:36 AM Vinod Koul wrote: > > > On 07-01-21, 19:15, Geert Uytterhoeven wrote: > > > > The DMACs (both SYS-DMAC and RT-DMAC) on R-Car V3U differ slightly from > > > > the DMACs on R-Car Gen2 and other R-Car Gen3 SoCs: > > > > 1. The per-channel registers are located in a second register block. > > > > Add support for mapping the second block, using the appropriate > > > > offsets and stride. > > > > 2. The common Channel Clear Register (DMACHCLR) was replaced by a > > > > per-channel register. > > > > Update rcar_dmac_chan_clear{,_all}() to handle this. > > > > As rcar_dmac_init() needs to clear the status before the individual > > > > channels are probed, channel index and base address initialization > > > > are moved forward. > > > > > > > > Inspired by a patch in the BSP by Phong Hoang > > > > . > > > > > > > > Signed-off-by: Geert Uytterhoeven > > > > > > --- a/drivers/dma/sh/rcar-dmac.c > > > > +++ b/drivers/dma/sh/rcar-dmac.c > > > > @@ -189,7 +189,7 @@ struct rcar_dmac_chan { > > > > * struct rcar_dmac - R-Car Gen2 DMA Controller > > > > * @engine: base DMA engine object > > > > * @dev: the hardware device > > > > - * @iomem: remapped I/O memory base > > > > + * @iomem: remapped I/O memory bases (second is optional) > > > > * @n_channels: number of available channels > > > > * @channels: array of DMAC channels > > > > * @channels_mask: bitfield of which DMA channels are managed by this driver > > > > @@ -198,7 +198,7 @@ struct rcar_dmac_chan { > > > > struct rcar_dmac { > > > > struct dma_device engine; > > > > struct device *dev; > > > > - void __iomem *iomem; > > > > + void __iomem *iomem[2]; > > > > > > do you forsee many more memory regions, if not then why not add second > > > > No I don't. TBH, I didn't foresee this change either; you never know > > what the hardware people have on their mind for the next SoC ;-) > > > > > region, that way changes in this patch will be lesser..? > > > > I did consider that option. However, doing so would imply that (a) the > > code to map the memory regions can no longer be a loop, but has to be > > unrolled manually, and (b) rcar_dmac_of_data.chan_reg_block can no > > longer be used to index iomem[], but needs a conditional expression or > > statement. > > > > > and it would be better to refer to a region by its name rather than > > > iomem[1].. > > > > - * @iomem: remapped I/O memory base > > + * @common_base: remapped common or combined I/O memory base > > + * @channel_base: remapped optional channel I/O memory base > > > > - void __iomem *iomem; > > + void __iomem *common_base; > > + void __iomem *channel_base; > > > > If you still think this is worthwhile, I can make these changes. > > Either way suits me, TBH it is not a deal breaker, so i would leave it > upto you :) I managed to use named regions at the expense of only 6 more lines of source code, even reducing the resulting binary size. So stay ready for v2 ;-) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds