Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263050AbVCJUgc (ORCPT ); Thu, 10 Mar 2005 15:36:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262968AbVCJUdH (ORCPT ); Thu, 10 Mar 2005 15:33:07 -0500 Received: from alog0139.analogic.com ([208.224.220.154]:11137 "EHLO chaos.analogic.com") by vger.kernel.org with ESMTP id S263128AbVCJUaj (ORCPT ); Thu, 10 Mar 2005 15:30:39 -0500 Date: Thu, 10 Mar 2005 15:28:25 -0500 (EST) From: linux-os Reply-To: linux-os@analogic.com To: Nate Edel cc: Jason Luo , Arjan van de Ven , Linux kernel Subject: Re: Can I get 200M contiguous physical memory? In-Reply-To: <00b701c525a3$128c2ac0$6a004b0a@charlemagne> Message-ID: References: <20050310081634.GA29516@taniwha.stupidest.org> <1110445030.6291.57.camel@laptopd505.fenrus.org> <00b701c525a3$128c2ac0$6a004b0a@charlemagne> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2568 Lines: 65 On Thu, 10 Mar 2005, Nate Edel wrote: > From: "Arjan van de Ven" > To: "Jason Luo" >>> A data acquisition card. In DMA mode, the card need 200M contiguous >>> memory for DMA. >> >> (or want to reserve memory at the boot commandline and then do really >> really evil hacks) > > Such as booting the machine with "mem=(real memory - 200)M" and then just > doing an ioremap of the top 200M of memory. > > It's not the most elegant way of doing things given that it requires user > intervention at boot time, but I'm not sure it counts as a "really evil > hack." Code-wise it's very simple - there's sample code in a couple of the > in-RAM MTD(*) drivers you can use as a model. I'm not sure if this method > will translate easily to non-x86 platforms if that's an issue. > > (* /drivers/mtd/devices/slram.c and /drivers/mtd/devices/mtdram.c ; I'm not > sure which of these is more up to date.) > - It doesn't require user-intervention either you can put a "mem=" statement in your boot configuration. Here's some GRUB stuff: # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You do not have a /boot partition. This means that # all kernel and initrd paths are relative to /, eg. # root (hd0,0) # kernel /boot/vmlinuz-version ro root=/dev/hda1 # initrd /boot/initrd-version.img #boot=/dev/hda default=1 timeout=10 splashimage=(hd0,0)/boot/grub/splash.xpm.gz title Fedora Core (2.6.11) root (hd0,0) kernel /boot/vmlinuz-2.6.11 ro root=LABEL=/ mem=768m rhgb initrd /boot/initrd-2.6.11.img [SNIPPED...] Also, You should NEVER require 200 MB of contiguous memory! The Bus- Master controllers (all of them) provide for scatter-lists. You just need to know how to program them. You just get the bus address of every page in an allocated buffer. You just put those addresses in the linked-list. Even the old ISA DMA controller can only do 128k (64k words) at a time. Therefore, you only need 128k of physical memory locked down at any one time. Cheers, Dick Johnson Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips). Notice : All mail here is now cached for review by Dictator Bush. 98.36% of all statistics are fiction. - 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/