From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from az33egw02.freescale.net (az33egw02.freescale.net [192.88.158.103]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "az33egw02.freescale.net", Issuer "Thawte Premium Server CA" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 05051DDF77 for ; Tue, 16 Dec 2008 12:12:11 +1100 (EST) Date: Mon, 15 Dec 2008 17:11:58 -0800 (PST) From: Trent Piepho To: Paul Mackerras Subject: Re: [PATCH] POWERPC: MTD: Add cached map support to physmap_of MTD driver In-Reply-To: <18758.62580.416920.482077@cargo.ozlabs.ibm.com> Message-ID: References: <1229365518-20538-1-git-send-email-tpiepho@freescale.com> <18758.62580.416920.482077@cargo.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: linuxppc-dev@ozlabs.org, MTD mailing list , xyzzy@speakeasy.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 16 Dec 2008, Paul Mackerras wrote: > Trent Piepho writes: >> The MTD system supports operation where a direct mapped flash chip is >> mapped twice. The normal mapping is a standard ioremap(), which is >> non-cached and guarded on powerpc. The second mapping is used only for >> reads and can be cached and non-guarded. Currently, only the pxa2xx >> mapping driver makes use of this feature. This patch adds support to the >> physmap_of driver on PPC32 platforms for this cached mapping mode. > > Note that having two mappings of the same physical address that differ > in cacheability is a programming error according to the PowerPC > architecture. > > Do you know that the processor implementations where you want to do > this can cope with having two mappings with different cacheability? Good question. It worked for me, but I guess all powerpc32 can't handle it. Shame, as it provides a huge speed up. I suppose an alternative would be to map the chip twice at different physical addresses, by just configuring the chip select to be twice the size it should be, and giving them different cacheability. Or changing the mapping for writes and then changing it back. It wouldn't be necessary to change the whole thing, just the page being written to.