Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3218467pxb; Tue, 12 Jan 2021 09:07:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzM/ksMUdVELSSdK7qoUhvrG704Pvo7+PAcDYR7qVJwh2JQs6XeKBabMj4jsTA87YZ4XsrH X-Received: by 2002:a17:907:41e3:: with SMTP id nb3mr3956685ejb.378.1610471237509; Tue, 12 Jan 2021 09:07:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610471237; cv=none; d=google.com; s=arc-20160816; b=Zdm181HIssbcBikLwAH2yjQzTXCv4U4fsuNPKArP4bnKxhhn6eVLMkdAji5lTGArNW yIQdvMdv1mP0AEX2EL5e+EG7qURRxdpAElCUBgchhl3jyL6wEjyMSHmtucB+fRSNDEpF bBd18286IX5WHHrtzbbAg+pzLmb4NHDFnDG3K9bswLrLrZzURfe8g/717TqsTykKsMa8 bX6osl+Du82XvtU1yz8uI7Vv/+Pux3QlCyBZk4r/oUkKXXlVmNZc+7z0/FFPG6OqLaiE ZNaY56ciKpPhG1HHSd+mudqPAydeZ4WOtrgEjddqQs0BtdoTzFlbtxiN6LLWCPZCL+xD 85oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GYhz8nC5T3E4+mQVU2s0WZsvoTSvMCsJ5hPRFlWAdGc=; b=xE4qljiAeEpctiVmbXeK7ub0keI3NMVa4W2fv/Kp5PwwAJxMy5qbPuPAsSjyJ6bA2i P+vZsIKBkMbZgn38K7BvDJupQIEYPPhUXd1CT8m25z+pieBiuPDsshwSC47fToG4cu5j rXosLma0vsduM8sJZCyHB86kbCGUXdQqvA72NCdsNX2AWPniLJ8Os/9tLQNYwOj6SIA+ TV94AqBkUFJ1Uh5R3cH0O7gJz8pGV8oNJCKDtJYZA7CizBoC+2cARDPhtSyuqyq6+Mqk 99t3b8ckwXiUc2VeIWskdvtces34jXjOHLIPZfvNSZNTWLdocRj22WAHCbKqcBai6N76 3C+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cA8e9J2T; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si1687026edc.387.2021.01.12.09.06.37; Tue, 12 Jan 2021 09:07:17 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cA8e9J2T; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392217AbhALRFD (ORCPT + 99 others); Tue, 12 Jan 2021 12:05:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:48170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392195AbhALRFC (ORCPT ); Tue, 12 Jan 2021 12:05:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB7AD2311B; Tue, 12 Jan 2021 17:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610471062; bh=3zLZTJjl+cuqKALn9XVgoMNl2Si0kGfx+HWjg+6BsW8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cA8e9J2Ta/8Zow76R90Gf5BL0OA6nZNVk+UnrY+OJ2C5mHzNz55DH0t1DiEn7iq5G DpsDx9a0DXu6H1Dbbo5R1asGhuhHpXMy1lpa9JsxjV/dmysg1VEZwaCh5HJixD4p/N ar2wEixOa34S9qt1uYLi5UpEHT1XNF+SPPvir71myHYLo7YvAFm3gNVEruJEsYTw5B b0MVKE3/x6koT+bWHe5J8NYOPRYHWZIUJCeFh8CHrLa6gU3kOEh//RRohMgBzmPTfF uIYt1ySIkGEtf4PKwBJADl8q60Rd11QWJJD4Ffz1STmryalvYUjljXh62DizRPZ/97 Pb9rpLih4uQWw== Date: Tue, 12 Jan 2021 22:34:15 +0530 From: Vinod Koul To: Geert Uytterhoeven Cc: Rob Herring , Dan Williams , Yoshihiro Shimoda , Phong Hoang , dmaengine , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List Subject: Re: [PATCH 4/4] dmaengine: rcar-dmac: Add support for R-Car V3U Message-ID: <20210112170415.GU2771@vkoul-mobl> References: <20210107181524.1947173-1-geert+renesas@glider.be> <20210107181524.1947173-5-geert+renesas@glider.be> <20210112103648.GL2771@vkoul-mobl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12-01-21, 16:54, Geert Uytterhoeven wrote: > Hi Vinod, > > 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 :) -- ~Vinod