From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 24 03:23:15 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 777191065674; Sun, 24 Jul 2011 03:23:15 +0000 (UTC) (envelope-from jakub.klama@uj.edu.pl) Received: from mail.uj.edu.pl (mail.uj.edu.pl [149.156.89.147]) by mx1.freebsd.org (Postfix) with ESMTP id 378108FC1B; Sun, 24 Jul 2011 03:23:14 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from mbox.uj.edu.pl ([unknown] [149.156.89.248]) by mta.uoks.uj.edu.pl (Sun Java(tm) System Messaging Server 7u3-12.01 64bit (built Oct 15 2009)) with ESMTP id <0LOT007ISFQB7A40@mta.uoks.uj.edu.pl>; Sun, 24 Jul 2011 04:18:11 +0200 (CEST) Date: Sun, 24 Jul 2011 04:18:11 +0200 From: jakub.klama@uj.edu.pl To: freebsd-arm@freebsd.org, freebsd-hackers@freebsd.org, andrew@fubar.geek.nz Message-id: X-Sender: jakub.klama@uj.edu.pl User-Agent: Roundcube Webmail/0.5 Cc: Subject: LPC32x0 MMC/SD and DMA interface issues X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 03:23:15 -0000 Hi, During my GSoC work on LPC32x0 port, I've discovered that ARM PL180 MMC/SD controller present in SoC has completely useless PIO mode. That is, controller can't stop card clock when Rx FIFO buffer is full. This leads to permanent Rx overrun errors when CPU doesn't react to arriving data as fast as it should. Any other interrupt arriving between reading two blocks of data from SD card will make whole transfer fail. In practice, to make it work reasonably reliable in PIO mode, card clock speed should be lowered to less than 1MHz (while current SDHC cards can go with clocks of about 30MHz). I think that only possibility to make this controller working reasonable is to use DMA. On LPC32x0, there is central general-purpose DMA controller. And there is my central question: how to interface DMA controller driver with MMC/SD driver? Using direct function calls between drivers? My work from previous GSoC, Generic DMA Framework isn't ready to integrate right now, at least not that fast to do this in current GSoC timeline. Bearing in mind that it will be more or less temporary solution, will direct function calls between two drivers sufficient? Or maybe incorporate whole DMA-dealing code in MMC/SD driver? Regards, Jakub Klama