From patchwork Sun Dec 6 00:35:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav.Michl@seznam.cz X-Patchwork-Id: 65085 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB5NZT1t004774 for ; Sat, 5 Dec 2009 23:35:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932917AbZLEXfW (ORCPT ); Sat, 5 Dec 2009 18:35:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932880AbZLEXfV (ORCPT ); Sat, 5 Dec 2009 18:35:21 -0500 Received: from smtp.seznam.cz ([77.75.72.43]:58750 "EHLO smtp.seznam.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932864AbZLEXfV (ORCPT ); Sat, 5 Dec 2009 18:35:21 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=seznam.cz; h=Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-Smtpd:X-Seznam-User:X-QM-Mark; b=WyTeJkrkpTphFlNS8R7JddixeGiHqSZlb8QEQATNgECcIE9oDHv/MjR5RMLM9y+BY DZ2/mqFIGGyPwNTZDjjiRDh19Jd7OIE57sA3dJxDLYXKQDzhFL1VeqY35QYVHsCeLHy omlOZky9v2qnNdHudIHfmmxRWAMXuZxnpflVo8k= Received: from debian (34.24.broadband3.iol.cz [85.70.24.34]) by email-relay2.go.seznam.cz (Seznam SMTPD 1.1.7@13984) with ESMTP; Sun, 06 Dec 2009 00:35:24 +0100 (CET) Received: by debian (sSMTP sendmail emulation); Sun, 06 Dec 2009 01:35:27 +0100 Date: Sun, 6 Dec 2009 01:35:27 +0100 From: Ladislav Michl To: linux-omap@vger.kernel.org Cc: Imre Deak , Brian Swetland , Kevin Hilman , "Syed Mohammed, Khasim" , Paul Mundt , Dirk Behme , Marek Vasut Subject: [RFC] use physmap-flash Message-ID: <20091206003527.GA13977@localhost.localdomain> Reply-To: Ladislav Michl MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Smtpd: 1.1.7@13984 X-Seznam-User: ladislav.michl@seznam.cz X-QM-Mark: email-qm4<417430978> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c index 35c75c1..30e6d0d 100644 --- a/arch/arm/mach-omap1/board-voiceblue.c +++ b/arch/arm/mach-omap1/board-voiceblue.c @@ -22,11 +22,11 @@ #include #include #include +#include #include #include #include -#include #include #include @@ -85,9 +85,31 @@ static int __init ext_uart_init(void) } arch_initcall(ext_uart_init); -static struct flash_platform_data voiceblue_flash_data = { - .map_name = "cfi_probe", +static void omap_set_vpp(struct map_info *map, int enable) +{ + static int count; + u32 l; + + if (cpu_class_is_omap1()) { + if (enable) { + if (count++ == 0) { + l = omap_readl(EMIFS_CONFIG); + l |= OMAP_EMIFS_CONFIG_WP; + omap_writel(l, EMIFS_CONFIG); + } + } else { + if (count && (--count == 0)) { + l = omap_readl(EMIFS_CONFIG); + l &= ~OMAP_EMIFS_CONFIG_WP; + omap_writel(l, EMIFS_CONFIG); + } + } + } +} + +static struct physmap_flash_data voiceblue_flash_data = { .width = 2, + .set_vpp = omap_set_vpp, }; static struct resource voiceblue_flash_resource = { @@ -97,7 +119,7 @@ static struct resource voiceblue_flash_resource = { }; static struct platform_device voiceblue_flash_device = { - .name = "omapflash", + .name = "physmap-flash", .id = 0, .dev = { .platform_data = &voiceblue_flash_data,