From patchwork Mon May 28 10:10:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 10430513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E6A9601BE for ; Mon, 28 May 2018 10:11:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7DBE28D4F for ; Mon, 28 May 2018 10:11:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5AFB28E14; Mon, 28 May 2018 10:11:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D72FB28D4F for ; Mon, 28 May 2018 10:10:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:References:To:From:Subject:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JK3sFuktbg9SACipZMjrZT+okadvOs2ml0Hb4wrLRWI=; b=D6DVfsU8GhCkZxTrqOoOlEyMh l9FCMwOJD2EBrND8XYYEQov/0pwqP57D6AMBq23tCWnGLjaCHsueEtqp0+CnmSh9DvFPXePzuWHkx 39iDyi3iJJZ7b2cDoAqE+76I1pfK7C230DDXa7imxCz580YMWs0toPto+3DShrvAbvebhH9TcgB+2 9oRtEKQZJl9NmndXFQZcWOWrcEfVtqFW+e8qBvBh+Oc3qBzDw1l0bG7Ng3RR02n3x7rAcXk5a/Qfl KRI/irpqe+5cALOeXtEgVe8fQMDTp47i6U7+cwHZC/XssQzY1PoS/AOIu6YRef8L8RgLY/a90yOoG V1KsaZN/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNF6h-0001lx-8d; Mon, 28 May 2018 10:10:27 +0000 Received: from mail-eopbgr50125.outbound.protection.outlook.com ([40.107.5.125] helo=EUR03-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNF6c-0000kh-A3; Mon, 28 May 2018 10:10:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentia.se; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TPg91YGuZv8tCPtHJtAWCluIZpwGt17Vxv4/chuvGF4=; b=e2y/iLiXkMER9CefN8MtYjMvzZlgyDNez0Q8bXBRrpTAIWl3kSQmFHUgFex2ltbI16LqTUEauWfmMqc0NPWTYQHnmZejzdUc953GWeOC1+nrUWdHHlfNJ0PEGV+DobV66zI1h8t0CdaixyNJOgq095RfgJd6bZoyqfVSoVL5vUI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Received: from [192.168.13.3] (85.226.244.23) by DB6PR0201MB2454.eurprd02.prod.outlook.com (2603:10a6:4:34::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.797.11; Mon, 28 May 2018 10:10:06 +0000 Subject: Re: [PATCH] mtd: nand: raw: atmel: add module param to avoid using dma From: Peter Rosin To: Tudor Ambarus , Nicolas Ferre , Ludovic Desroches References: <20180329131054.22506-1-peda@axentia.se> <20180329153322.5e2fc1e7@bbrezillon> <20180329154416.5c1a0013@bbrezillon> <20180402142249.7e076a64@bbrezillon> <20180402212843.164d5d21@bbrezillon> <20180402222020.1d344c14@bbrezillon> <20180403091813.5fb5c18c@bbrezillon> <959d826d-1a98-ca22-acee-a4548427fcd3@microchip.com> <024079cb-77ad-9c48-e370-e6e8f2de171b@axentia.se> <9c496531-f7b6-4b9d-dd51-0bfb68ead303@axentia.se> Organization: Axentia Technologies AB Message-ID: Date: Mon, 28 May 2018 12:10:02 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <9c496531-f7b6-4b9d-dd51-0bfb68ead303@axentia.se> Content-Language: en-US X-Originating-IP: [85.226.244.23] X-ClientProxiedBy: HE1PR0102CA0015.eurprd01.prod.exchangelabs.com (2603:10a6:7:14::28) To DB6PR0201MB2454.eurprd02.prod.outlook.com (2603:10a6:4:34::23) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(49563074)(7193020); SRVR:DB6PR0201MB2454; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0201MB2454; 3:cCEZqF4td3AYNjvnK1A6R6xfjPuLSiX9SZxrvI+e83ik5PKkD6oCPzLbDuYWNQ2F4SxNQrHhkfFStNdfY8FSki41SRKWDctQ0kBgnkoKtOaVRyGX6tJr5P1YVSrkpu2ONT8TgVflrXw3xb7p6ReNYREUvxsmlCZyEO1W0Le3PgtHkvD0kVHPSf/hnb0uaUDsF4cRxnu16XIXpozWbiDrEXdq3UhrnO6BDwLw02abh+Sj8MEkFkMGf3+Y0jpbQdTa; 25:HM5rI0QQxomQsEYZf9Wit/uSEAfz2HOLorFKlimyuxYAIKwKWNM/Q8VM9ZcEmQm36XDcKRi7F+TrtXvt6VHrUsDlyr3gnKIky7oQ+eN0AgBGWnFiofoPvrduXOSCgIdo23LSiCtCeKSiY0lqBF2MapwW/dHYV4uW4DC7jGs9zoThM6d9c7Ffd1RSoiTzRLpML5XEFTrDDAuPoTsXdW03RCZgO0PCGRDX5LZWE2W41zeHzF5yDc/7YlHlRj7WU5Pe5eWbbBOYK4xoR1v0Z2nRd/UdniXn3vQj2LD6JvSCAsB+09JQ1UjEIGlYTqQel8LwOhs+DjlcPtBzXxU7v/hn4w==; 31:TPCbDrSxJzNeAurq4r3BzN0uTo/gjN9fme9BItprVqVggIR7+16D+9UC1KCm3WKYcoqiifyn+Yu45acvEChGE9T9HBFLoIdOePTiMzGbKKOoc9C4rsnIyjm/lxJw61+V4K7YXECy1fVAVi3butLLBwxto0+kdXoac/DTZcqxa1QfdKoA6CJ8fhg1hXAml48qg9zyYNsqSW+5CgA9IJb+abJh2OHviRsglvuC7GvMcm8= X-MS-TrafficTypeDiagnostic: DB6PR0201MB2454: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415395)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(2016111802025)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(6043046)(201708071742011)(7699016); SRVR:DB6PR0201MB2454; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0201MB2454; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0201MB2454; 4:qxzcwmAgm88yt8tVvFo3ozCLTsrXhMSi3j3FnF6BqeG3zi/pqIV8t+FBfmIdPydo+Ps0XgWv8SxZ7ZFPJxy/Hu9BBhal7+BsAT1gIzulFmF5QIkezISriI06R3rpYfLGlc1F04o8AZ7XQ+bAaIArJ7R47IrNuyF9zUdwiJld1OcmS9pXU//S4XsAUmdOt7BIG/3FJXWt8EmWIXxRDjFtp3yPAkYtlQxMWbSndTt6oCKCiS+l1LqJnu3eUv751SpogmtNMspG6I+GmrkQZ08C+Q== X-Forefront-PRVS: 06860EDC7B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6049001)(396003)(376002)(366004)(346002)(39830400003)(39380400002)(189003)(199004)(377424004)(74482002)(105586002)(11346002)(37036004)(93886005)(86362001)(575784001)(36916002)(54906003)(110136005)(52116002)(25786009)(3260700006)(4326008)(229853002)(65806001)(65956001)(66066001)(486006)(53936002)(97736004)(16526019)(186003)(68736007)(386003)(53546011)(8936002)(31696002)(2906002)(77096007)(26005)(59450400001)(84326002)(76176011)(33964004)(58126008)(16586007)(7736002)(16576012)(316002)(8676002)(305945005)(81156014)(81166006)(6116002)(3846002)(478600001)(117156002)(65826007)(36756003)(6666003)(270700001)(2476003)(568964002)(5890100001)(4610100001)(476003)(6486002)(39060400002)(106356001)(7416002)(2616005)(6246003)(5660300001)(31686004)(446003)(64126003)(956004)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0201MB2454; H:[192.168.13.3]; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0201MB2454; 23:Y7ClWVSYJf1Uykoc6v9JR3IUhxBjzP0ePqygsbT?= =?us-ascii?Q?vUdHjiQN72VbaafbpNcov8tupLIySO6hhbSHbG+JCRV6gU0uSttJhxBm6jEr?= =?us-ascii?Q?dQjwRxpUHrJw7d+/ZDnvMNDeSomfQNMeIA1rsyZ2+zFHnAOeNmuhNDHDL6ta?= =?us-ascii?Q?c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ZbddY1axQHgvZZ41uA8jYp+glcB?= =?us-ascii?Q?pqt1IXEe1ZXvxQKSiZdPBAn9yi2w/g7hQXRdXbmvFQLOMP2U0huVeXkDyoH9?= =?us-ascii?Q?kJvzC+5dI4Cgq6DJ37hGYcCtjuFce0t4cu4CkrRl4DuYjGWPWgrwHifZ/prK?= =?us-ascii?Q?T/ZJH/49y/+pjwyJKoLytyB+aeY9YMXXoVROa4k0qs/vRyVFM/+/VChyliuq?= =?us-ascii?Q?PhVX0ICmDwbB0WHFf+zAXLPhfI8g8To2f3VRWZjrjF9FlNQSqedbfnaCcS/D?= =?us-ascii?Q?Xd0qhr1UVYo9GzopBuDH3hBhv9ibgdmdZQRKocRqNInmklByaxXNYK6gRudV?= =?us-ascii?Q?33jnj/272Nlkr8pLtlzRm5C8m9+e444KwNe5ZkimTtvTV7mETK1VErxh08C+?= =?us-ascii?Q?rQ1I3hRfMCCFJCIV5eNxIdKnetWiEVValoI2frMAoouLsy8O28y/3FHll8d3?= =?us-ascii?Q?LT4PjYGXHf+5An6L0LI4dJcczYoCq3DTmcKPCYKQNoFPhg/A4MnjB8HllIUr?= =?us-ascii?Q?nGpTNMLgiMd7pngvmAeu2NHzIj4t/uymj8KJlRBsOyXE8xYGCeF1A74AXzdM?= =?us-ascii?Q?V8Dgmb7gQRmhYyte1AnQcLhLnpQ5xxXcWaaLUZ2R4DZWibSEWdARsdLK9QIa?= =?us-ascii?Q?owEuNiwD5a6d9g5u6VM7IeR9hcuIUricUc6Et9h13VGfNSvLw/DdouFusC6O?= =?us-ascii?Q?72nTYcq3eU0blce1hByp2OYIic0cugHwx0vDk2CgkExyl7thLmKk=3D?= X-Microsoft-Antispam-Message-Info: 7RiYLttCeYa8yqsxuCvusPfHmnzgmnCrBCB1gYU5zJ5+Z4B1Ins/qCXecjBnYbWGPOtEKUmyAd7+n/chksSoN7q1+dva4QSR+8bm+zpj8GKzs7d+k89RU5814d565/60wK6Z97JRDBNYDcYeDAQGtJYBaJwNpUv0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7QJo9s/RVNynENbV/EpKW7ainDhO0stwqb9r0Lpj9nHCinNnGu3VPq9m2dLj5zwgeIb3la2WFlqUvsIx08/kqVCmYSZBkzZ8 X-MS-Office365-Filtering-Correlation-Id: 30b6d36b-3d97-49ca-efaf-08d5c4833044 X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2018 10:10:06.0658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 30b6d36b-3d97-49ca-efaf-08d5c4833044 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0201MB2454 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180528_031022_925741_D11C5F89 X-CRM114-Status: GOOD ( 24.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Richard Weinberger , Boris Brezillon , Josh Wu , linux-kernel@vger.kernel.org, Marek Vasut , linux-mtd@lists.infradead.org, Cyrille Pitchen , Eugen Hristev , Brian Norris , David Woodhouse , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 2018-05-28 00:11, Peter Rosin wrote: > On 2018-05-27 11:18, Peter Rosin wrote: >> On 2018-05-25 16:51, Tudor Ambarus wrote: >>> We think the best way is to keep LCD on DDR Ports 2 and 3 (8th and 9th >>> slaves), to have maximum bandwidth and to use DMA on DDR port 1 for NAND >>> (7th slave). >> >> Exactly how do I accomplish that? >> >> I can see how I can move the LCD between slave DDR port 2 and 3 by >> selecting LCDC DMA master 8 or 9 (but according to the above it should >> not matter). The big question is how I control what slave the NAND flash >> is going to use? I find nothing in the datasheet, and the code is also >> non-transparent enough for me to figure it out by myself without >> throwing out this question first... > > I added this: > > diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c > index e686fe73159e..3b33c63d2ed4 100644 > --- a/drivers/mtd/nand/raw/atmel/nand-controller.c > +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c > @@ -1991,6 +1991,9 @@ static int atmel_nand_controller_init(struct atmel_nand_controller *nc, > nc->dmac = dma_request_channel(mask, NULL, NULL); > if (!nc->dmac) > dev_err(nc->dev, "Failed to request DMA channel\n"); > + > + dev_info(nc->dev, "using %s for DMA transfers\n", > + dma_chan_name(nc->dmac)); > } > > /* We do not retrieve the SMC syscon when parsing old DTs. */ > > > > and the output is > > atmel-nand-controller 10000000.ebi:nand-controller: using dma0chan5 for DMA transfers > > So, DMA controller 0 is in use. I still don't know if IF0, IF1 or IF2 is used > or how to find out. I guess IF2 is not in use since that does not allow any > DDR2 port as slave... > > From the datasheet, DMAC0/IF0 uses DDR2 Port 2, and DMAC0/IF1 uses DDR2 Port 1. > But, by the looks of the register content in my other mail, it seems as if > DMA0/IF1 can also use DDR2 Port 3. > > So, I think I want either > > A) the NAND controller to use DMAC0/IF0 (i.e. DDR2 port 1, and possibly 3) and > the LCDC to use master 9 (i.e. DDR2 Port 2) > > or > > B) the NAND controller to use DMAC1/IF1 (i.e. DDR2 port 2) and the LCDC to use > master 8 (i.e. DDR2 Port 3) Crap, that was not what I meant to express. Sorry for the confusion. This is better. So, I think I want either A) the NAND controller to use master 1 DMAC0/IF0 (i.e. slave 8 DDR2 port 2) and the LCDC to use master 9 (i.e. slave 9 DDR2 Port 3) or B) the NAND controller to use master 2 DMAC0/IF1 (i.e. slave 7 DDR2 port 1, and possibly slave 9 DDR2 port 3 (if my previous findings are relevant) and the LCDC to use master 8 (i.e. slave 8 DDR2 Port 2) > But, again, how do I limit DMAC0 to either of IF0 or IF1 for NAND accesses? So, I added a horrid patch (attached), which mainly adds printk lines, but additionally does one more thing in atc_prep_dma_memcpy. It changes the DSCR_IF field (from 0) to 1 for DMA-memcpy for dma0chan5 (i.e. the NAND). At least I think it does that? Running with that patch gets me this: # dmesg | grep -i dma at_hdmac ffffe600.dma-controller: Atmel AHB DMA Controller ( cpy set slave ), 8 channels at_hdmac ffffe800.dma-controller: Atmel AHB DMA Controller ( cpy set slave ), 8 channels dma dma0chan0: xlate 0 2 dma dma0chan1: xlate 0 2 at91_i2c f0014000.i2c: using dma0chan0 (tx) and dma0chan1 (rx) for DMA transfers dma dma1chan0: xlate 0 2 dma dma1chan1: xlate 0 2 at91_i2c f801c000.i2c: using dma1chan0 (tx) and dma1chan1 (rx) for DMA transfers dma dma0chan2: xlate 0 2 dma dma0chan3: xlate 0 2 dma dma0chan4: xlate 0 2 atmel_mci f0000000.mmc: using dma0chan4 for DMA transfers dma dma1chan2: xlate 0 2 dma dma1chan3: xlate 0 2 atmel_aes f8038000.aes: Atmel AES - Using dma1chan2, dma1chan3 for DMA transfers dma dma1chan4: xlate 0 2 atmel_sha f8034000.sha: using dma1chan4 for DMA transfers dma dma1chan5: xlate 0 2 dma dma1chan6: xlate 0 2 atmel_tdes f803c000.tdes: using dma1chan5, dma1chan6 for DMA transfers atmel-nand-controller 10000000.ebi:nand-controller: using dma0chan5 for DMA transfers dma dma0chan5: memcpy: 0 dma dma0chan5: DSCR_IF: 1 dma dma0chan5: memcpy: 1 So, output is as expected and I believe that the patch makes the NAND DMA accesses use master 2 DMAC0/IF1 and are thus forced to use slave 7 DDR2 Port 1 (and possibly 9). The LCDC is using slave 8 DDR2 Port 2. So there should be no slave conflict? But the on-screen crap remains during NAND accesses. But pressing on. I then changed the priorities for all accesses to 0 in the PRxSy registers, except the ones for masters 8/9 LCDC (slaves 8/9) which I left at priority 3. But the on-screen crap remains during NAND accesses. My guess is that the NAND DMA is doing too long bursts and that the LCDC therefore has to wait too long and simply fails to keep the pipeline from running short? So I tried to reduce the maximum SLOT_CYCLE for slaves 7 and 9 in the SCFGx registers. No noticeable effect either. I then tried to split bursts from master 2 (DMAC0/IF1) with small values in the MCFG2 register. No effect. I'm getting nowhere. Cheers, Peter diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 75f38d19fcbe..6cb58197bd29 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -243,6 +243,18 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first) vdbg_dump_regs(atchan); + if (atchan->chan_common.chan_id == 5 && + atchan->chan_common.device->dev_id == 0) + { + static u32 last_if = 4; + u32 this_if = first->txd.phys & 3; + if (this_if != last_if) { + dev_info(chan2dev(&atchan->chan_common), + "DSCR_IF: %u\n", this_if); + last_if = this_if; + } + } + channel_writel(atchan, SADDR, 0); channel_writel(atchan, DADDR, 0); channel_writel(atchan, CTRLA, 0); @@ -854,6 +866,19 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, desc->lli.ctrlb = ctrlb; desc->txd.cookie = 0; + if (chan->chan_id == 5 && + chan->device->dev_id == 0) + { + static u32 last_if = 4; + u32 this_if = desc->txd.phys & 3; + if (this_if != last_if) { + dev_info(chan2dev(chan), + "memcpy: %u\n", this_if); + last_if = this_if; + } + desc->txd.phys = (desc->txd.phys & ~3) | 1; + } + desc->len = xfer_count << src_width; atc_desc_chain(&first, &prev, desc); @@ -1107,6 +1132,8 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | ATC_SRC_ADDR_MODE_INCR | ATC_FC_MEM2PER | ATC_SIF(atchan->mem_if) | ATC_DIF(atchan->per_if); + dev_info(chan2dev(chan), "slave_sg: mem2dev %d %d\n", + atchan->mem_if, atchan->per_if); reg = sconfig->dst_addr; for_each_sg(sgl, sg, sg_len, i) { struct at_desc *desc; @@ -1147,6 +1174,8 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | ATC_SRC_ADDR_MODE_FIXED | ATC_FC_PER2MEM | ATC_SIF(atchan->per_if) | ATC_DIF(atchan->mem_if); + dev_info(chan2dev(chan), "slave_sg: dev2mem %d %d\n", + atchan->mem_if, atchan->per_if); reg = sconfig->src_addr; for_each_sg(sgl, sg, sg_len, i) { @@ -1255,6 +1284,8 @@ atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc, | ATC_FC_MEM2PER | ATC_SIF(atchan->mem_if) | ATC_DIF(atchan->per_if); + dev_info(chan2dev(chan), "fill_desc: mem2dev %d %d\n", + atchan->mem_if, atchan->per_if); desc->len = period_len; break; @@ -1267,6 +1298,8 @@ atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc, | ATC_FC_PER2MEM | ATC_SIF(atchan->per_if) | ATC_DIF(atchan->mem_if); + dev_info(chan2dev(chan), "fill_desc: dev2mem %d %d\n", + atchan->mem_if, atchan->per_if); desc->len = period_len; break; @@ -1344,6 +1377,18 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, atc_desc_chain(&first, &prev, desc); } + if (chan->chan_id == 5 && + chan->device->dev_id == 0) + { + static u32 last_if = 4; + u32 this_if = first->txd.phys & 3; + if (this_if != last_if) { + dev_info(chan2dev(chan), + "cyclic: %u\n", this_if); + last_if = this_if; + } + } + /* lets make a cyclic list */ prev->lli.dscr = first->txd.phys; @@ -1712,6 +1757,8 @@ static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec, atchan = to_at_dma_chan(chan); atchan->per_if = dma_spec->args[0] & 0xff; atchan->mem_if = (dma_spec->args[0] >> 16) & 0xff; + dev_info(chan2dev(chan), "xlate %d %d\n", + atchan->mem_if, atchan->per_if); return chan; } @@ -2099,6 +2146,18 @@ static void atc_resume_cyclic(struct at_dma_chan *atchan) { struct at_dma *atdma = to_at_dma(atchan->chan_common.device); + if (atchan->chan_common.chan_id == 5 && + atchan->chan_common.device->dev_id == 0) + { + static u32 last_if = 4; + u32 this_if = atchan->save_dscr; + if (this_if != last_if) { + dev_info(chan2dev(&atchan->chan_common), + "resume_cyclic: %u\n", this_if); + last_if = this_if; + } + } + /* restore channel status for cyclic descriptors list: * next descriptor in the cyclic list at the time of suspend */ channel_writel(atchan, SADDR, 0); diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c index e686fe73159e..3b33c63d2ed4 100644 --- a/drivers/mtd/nand/raw/atmel/nand-controller.c +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c @@ -1991,6 +1991,9 @@ static int atmel_nand_controller_init(struct atmel_nand_controller *nc, nc->dmac = dma_request_channel(mask, NULL, NULL); if (!nc->dmac) dev_err(nc->dev, "Failed to request DMA channel\n"); + + dev_info(nc->dev, "using %s for DMA transfers\n", + dma_chan_name(nc->dmac)); } /* We do not retrieve the SMC syscon when parsing old DTs. */