Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755097AbbDPR2o (ORCPT ); Thu, 16 Apr 2015 13:28:44 -0400 Received: from smtp.domeneshop.no ([194.63.252.55]:48010 "EHLO smtp.domeneshop.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754767AbbDPR2g (ORCPT ); Thu, 16 Apr 2015 13:28:36 -0400 Message-ID: <552FF139.9020007@tronnes.org> Date: Thu, 16 Apr 2015 19:28:25 +0200 From: =?windows-1252?Q?Noralf_Tr=F8nnes?= User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Rogier Wolff CC: Martin Sperl , dmaengine@vger.kernel.org, vinod.koul@intel.com, linux-kernel@vger.kernel.org, jonathan@raspberrypi.org, linux-rpi-kernel@lists.infradead.org, dan.j.williams@intel.com, Dom Cobley Subject: Re: [PATCH] dmaengine: bcm2835: Add slave dma support References: <1429091778-26350-1-git-send-email-noralf@tronnes.org> <75BEAE20-81A9-4567-8AB2-1C1865A0B72D@sperl.org> <552EB393.4050609@tronnes.org> <20150416063055.GH23239@bitwizard.nl> In-Reply-To: <20150416063055.GH23239@bitwizard.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2322 Lines: 49 Den 16.04.2015 08:30, skrev Rogier Wolff: > On Wed, Apr 15, 2015 at 08:53:07PM +0200, Noralf Tr?nnes wrote: > >> A 16-bit register can't hold a value of 65536. >> Either the max value is 65535 or the register is 17-bits wide. > It is common for hardware registers to have the value "0" mean 65536 > in case of a 16-bit register. > > The hardware would then FIRST decrement the register and THEN check > for zero. This results in the behaviour that "1" requires one cycle to > complete, "10" requires ten cycles, and "0" means the same as the > total number of bitpatterns possible in the register. (256 for an > 8-bit register, 65536 for a 16-bit register). > > Another way to implement such a register in hardware would "check for > zero" first, and not do antyhing if the register equals zero. This > results in differnet behaviour for the "0" value. > > That said: IMHO, the overhead of setting up 2 transfers for each 64k > block as opposed to only one results in such a small performance > penalty that I'd prefer to play it safe unless you're very sure you > can adequately test it. (Another option would be to set the maximum > transfer size to 0xf000: 60kbytes. Less than 10% extra transfers in > the long run than when aiming for the edge...) Dom Cobley (Raspberry Pi) has just been in contact with the hardware designer. He said: 65535 is the maximum transfer length of a LITE channel. 65536 will be treated as zero which is undefined (it will actually do one transfer then stop) Additional info from the datasheet about Lite channels: The internal data structure is 128 bits instead of 256 bits. This means that if you do a 128 bit wide read burst of more than 1 beat, the DMA input register will be full and the read bus will be stalled. The normal DMA engine can accept a read burst of 2 without stalling. If you do a narrow 32 bit read burst from the peripherals then the lite engine can cope with a burst of 4 as opposed to a burst of 8 for the normal engine. This suggest to me that we could go as far as the last 128-bit boundary like this: (SZ_64K - 16) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/