From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261419AbVFOLry (ORCPT ); Wed, 15 Jun 2005 07:47:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261396AbVFOLry (ORCPT ); Wed, 15 Jun 2005 07:47:54 -0400 Received: from extgw-uk.mips.com ([62.254.210.129]:44317 "EHLO bacchus.net.dhis.org") by vger.kernel.org with ESMTP id S261387AbVFOLpt (ORCPT ); Wed, 15 Jun 2005 07:45:49 -0400 Date: Wed, 15 Jun 2005 12:41:59 +0100 From: Ralf Baechle To: Finn Thain Cc: Geert Uytterhoeven , Jeff Garzik , Linux/m68k , Linux/m68k on Mac , Linux MIPS , Linux kernel , Thomas Bogendoerfer Subject: Re: [PATCH] Jazzsonic driver updates Message-ID: <20050615114158.GA9411@linux-mips.org> References: <200503070210.j272ARii023023@hera.kernel.org> <20050323100139.GB8813@linux-mips.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 12, 2005 at 04:05:30PM +1000, Finn Thain wrote: > > Oh funny. vdma_alloc() was created 10 years ago as an internal API for > > the Jazz machines. Didn't realize m68k had cloned it :-) If anything > > it seems this should be converted to the modern DMA API. > > I've just started merging my Mac sonic work into 2.6.12-rc6. m68k doesn't > yet implement the modern DMA API, but it is easy to fake it for a while > for macsonic.c. So I don't mind converting macsonic, jazzsonic and the > shared sonic driver core to the new API. > > But, I knowing nothing about the Jazz DMA controller. I need some help > from the MIPS people: It's a while since I last touched that machine, so remember this is from 10 year old memory ... The Jazz DMA hardware is an MMU that translates virtual DMA to physical addresses. It's virtual DMA address space is 16MB in size, it's page size is 4kB. That's a set of capabilities that nicely translates into the DMA API. > Would I be right to say that vdma_{alloc,free}() can be changed to > dma_{,un}map_single? The other Jazz specific routine that sonic uses is > vdma_log2phys, and I don't know if that has a better alternative. The use of that call should simply be eleminated entirely. DMA API functions such as dma_alloc_coherent or dma_map_single will return a dma_handle which along with the virtual address returned is everything ever needed to program a DMA engine. Ralf