From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-gx0-f157.google.com (mail-gx0-f157.google.com [209.85.217.157]) by ozlabs.org (Postfix) with ESMTP id 4AE97DE0B0 for ; Sat, 18 Apr 2009 15:43:11 +1000 (EST) Received: by gxk1 with SMTP id 1so2442949gxk.9 for ; Fri, 17 Apr 2009 22:43:10 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <49E8F2D7.3050603@embeddedarm.com> References: <49E8F2D7.3050603@embeddedarm.com> From: Grant Likely Date: Fri, 17 Apr 2009 23:42:55 -0600 Message-ID: Subject: Re: PowerPC iotable_init equivalent? To: Eddie Dawydiuk Content-Type: text/plain; charset=ISO-8859-1 Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, Apr 17, 2009 at 3:21 PM, Eddie Dawydiuk wrote: > Hello, > > In the past I've worked with ARM architectures where I could setup virtual / > physical address mappings so I don't have to ioremap then pass around > pointers. Does PowerPC have an equivalent abstraction? If not whats the > recommended approach? No. Predefining virt->phys mappings is fragile since it makes assumptions about how the kernel is going to carve up the virtual address space. Better to let the kernel allocate virtual ranges as it needs them. As Kumar says, do your ioremap() (or, even better: of_iomap()) in your driver's probe function and store it in the driver's private data structure. g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.