From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail123.messagelabs.com (mail123.messagelabs.com [85.158.136.3]) by ozlabs.org (Postfix) with SMTP id A13EA6801D for ; Tue, 23 Aug 2005 00:19:42 +1000 (EST) From: "Achim Machura" To: "'Kunkel, Ulrich'" Date: Mon, 22 Aug 2005 16:12:52 +0200 Message-ID: <002e01c5a723$9669d7a0$34f1ff0a@beint.local> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" In-Reply-To: Cc: "Linuxppc-Embedded \(E-Mail\)" Subject: AW: MPC5200 mmap, ioremap Reply-To: achim.machura@berghof.com List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hello Ulrich, > mem =12 M i think it means the kernel knows about 12 MB This code below works fine at our board, but we use only a few kb in the protected ram. I don't Know whats happen if size is bigger as one page. int asi_common_mmap(struct file *filp, struct vm_area_struct *vma) { // unsigned long off = vma->vm_pgoff << PAGE_SHIFT; unsigned long physical = ASI_IOMEM_BASE; unsigned long vsize = vma->vm_end - vma->vm_start; // unsigned long psize = ASI_IOMEM_SIZE - off; // rt_printk("start : 0x%08lX\n", vma->vm_start); // rt_printk("end : 0x%08lX\n", vma->vm_end); // rt_printk("offset: 0x%08lX\n", off); // rt_printk("phys : 0x%08lX\n", physical); // rt_printk("vsize : 0x%08lX\n", vsize); // rt_printk("psize : 0x%08lX\n", psize); if (filp->f_flags & O_SYNC) { // rt_printk("I/O-Mem"); vma->vm_flags |= VM_IO; } vma->vm_flags |= VM_RESERVED; //if (vsize > psize) return -EINVAL; /* spans too high */ if(remap_page_range(vma->vm_start, physical, vsize, vma->vm_page_prot)) { return -EAGAIN; } return(0); } Achim