From patchwork Tue Apr 27 07:43:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 95289 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3R7fTgp008163 for ; Tue, 27 Apr 2010 07:45:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752418Ab0D0HpK (ORCPT ); Tue, 27 Apr 2010 03:45:10 -0400 Received: from compulab.co.il ([67.18.134.219]:34452 "EHLO compulab.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751085Ab0D0HpJ (ORCPT ); Tue, 27 Apr 2010 03:45:09 -0400 Received: from mail.linux-boards.com ([192.114.83.142] helo=zimbra-mta.compulab.co.il) by compulab.site5.com with esmtp (Exim 4.69) (envelope-from ) id 1O6fTf-0004du-PG; Tue, 27 Apr 2010 02:45:08 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id DA8C59A0028; Tue, 27 Apr 2010 10:45:06 +0300 (IDT) X-Virus-Scanned: amavisd-new at compulab.co.il Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1FCOewapT2VB; Tue, 27 Apr 2010 10:45:06 +0300 (IDT) Received: from [10.1.1.77] (droid.compulab.local [10.1.1.77]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 9D4029A0027; Tue, 27 Apr 2010 10:45:06 +0300 (IDT) Message-ID: <4BD695BC.3080109@compulab.co.il> Date: Tue, 27 Apr 2010 10:43:56 +0300 From: Mike Rapoport User-Agent: Thunderbird 2.0.0.23 (X11/20100106) MIME-Version: 1.0 To: Tony Lindgren CC: "Ghorai, Sukumar" , "linux-omap@vger.kernel.org" , Mike Rapoport Subject: Re: [PATCH] OMAP: fix gpmc nand setup when no timings supplied References: <1271670618-5671-1-git-send-email-mike@compulab.co.il> <4BCFDC6F.6010801@compulab.co.il> <2A3DCF3DA181AD40BDE86A3150B27B6B030D5D7ADD@dbde02.ent.ti.com> <4BCFF3C1.5070005@compulab.co.il> <2A3DCF3DA181AD40BDE86A3150B27B6B030D5D7B5A@dbde02.ent.ti.com> <4BD00C9A.8050601@compulab.co.il> <20100426181448.GG7225@atomide.com> In-Reply-To: <20100426181448.GG7225@atomide.com> X-Enigmail-Version: 0.95.7 X-ACL-Warn: { X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - compulab.site5.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il X-Source: X-Source-Args: X-Source-Dir: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 27 Apr 2010 07:45:12 +0000 (UTC) diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index 64d74f0..65ac0d0 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c @@ -34,6 +34,12 @@ static struct platform_device gpmc_nand_device = { .resource = &gpmc_nand_resource, }; +static int gpmc_nand_detect_timings(void) +{ + /* FIXME: implement timings detection */ + return -EINVAL; +} + static int omap2_nand_gpmc_retime(void) { struct gpmc_timings t; @@ -109,6 +115,14 @@ int __init gpmc_nand_init(struct omap_nand_platform_data *_nand_data) return err; } + if (gpmc_nand_data->keep_timings) { + err = gpmc_nand_detect_timings(); + if (err < 0) { + dev_err(dev, "Cannot detect GPMC timings\n"); + return err; + } + } + err = gpmc_nand_setup(); if (err < 0) { dev_err(dev, "NAND platform setup failed: %d\n", err); diff --git a/arch/arm/plat-omap/include/plat/nand.h b/arch/arm/plat-omap/include/plat/nand.h index 6ba88d2..cf05d2d 100644 --- a/arch/arm/plat-omap/include/plat/nand.h +++ b/arch/arm/plat-omap/include/plat/nand.h @@ -24,6 +24,7 @@ struct omap_nand_platform_data { void __iomem *gpmc_cs_baseaddr; void __iomem *gpmc_baseaddr; int devsize; + bool keep_timings; }; /* size (4 KiB) for IO mapping */