From patchwork Wed Jun 11 08:56:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 31747 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 47712203C2 for ; Wed, 11 Jun 2014 09:02:30 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id m20sf11367478qcx.1 for ; Wed, 11 Jun 2014 02:02:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:mime-version:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=09kdJ7ooBSblrThNUAoaC+AXkrYVrieSkxwG/Tvgo2Y=; b=awR8L+6HeB8k7xQKtUxdHcAmismeORe5AK4X09evBhpevNneRy7KFx+3a3x4Q1byWu cZ8b40DnJqqNUodb6L7xOVEdWFJwjMHuZ7l1gkpSMhzzQcawuMHDi5AA8GZ+CdMBAm0y eDTaNIzDg7fUiLDdpihSTO1NHfKhpuaT67yJvdC5iNIbJGnFf1rJxB/mHoFRVOFlACdi x839DQLLaiX358MwUGa5AVNZdB5jVjA78/41hAgMk0Flk+UFU/REGTMnsJdb7+8a4Bfy i5V1aczw7CLe4Z2GOt/s298s0ANcXmdPatRu5Bxsm0dhbxLb+wVVUi7gZwdi9HpgAgrU 8RFA== X-Gm-Message-State: ALoCoQlKmk854nEUBSm2M1VbK282rWJwwJ+mGGEj4U8blBy1uUIFHKLL+5bSjCnNt5y3Jde/TW7y X-Received: by 10.58.106.75 with SMTP id gs11mr19861752veb.18.1402477350114; Wed, 11 Jun 2014 02:02:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.145 with SMTP id g17ls2353972qge.76.gmail; Wed, 11 Jun 2014 02:02:30 -0700 (PDT) X-Received: by 10.58.230.101 with SMTP id sx5mr26251851vec.10.1402477350011; Wed, 11 Jun 2014 02:02:30 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id fa1si12764899vcb.39.2014.06.11.02.02.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Jun 2014 02:02:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id db11so4882949veb.18 for ; Wed, 11 Jun 2014 02:02:29 -0700 (PDT) X-Received: by 10.53.8.162 with SMTP id dl2mr2245469vdd.24.1402477349919; Wed, 11 Jun 2014 02:02:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp286735vcb; Wed, 11 Jun 2014 02:02:29 -0700 (PDT) X-Received: by 10.140.44.72 with SMTP id f66mr24613848qga.78.1402477349451; Wed, 11 Jun 2014 02:02:29 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id w5si30588642qax.122.2014.06.11.02.02.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jun 2014 02:02:29 -0700 (PDT) Received-SPF: none (google.com: linux-mtd-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WueOL-0005Sw-JB; Wed, 11 Jun 2014 09:00:21 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WueMc-0002NX-SE; Wed, 11 Jun 2014 08:58:35 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5B8wEpL027190; Wed, 11 Jun 2014 03:58:14 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5B8wEcb009583; Wed, 11 Jun 2014 03:58:14 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Wed, 11 Jun 2014 03:58:14 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5B8uiSw020510; Wed, 11 Jun 2014 03:58:11 -0500 From: Roger Quadros To: , , Subject: [PATCH 24/36] ARM: OMAP2+: gpmc: add NAND specific setup Date: Wed, 11 Jun 2014 11:56:29 +0300 Message-ID: <1402477001-31132-25-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1402477001-31132-1-git-send-email-rogerq@ti.com> References: <1402477001-31132-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140611_015835_081254_BEFBAB87 X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.7 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [192.94.94.41 listed in wl.mailspike.net] -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: devicetree@vger.kernel.org, nsekhar@ti.com, linux-kernel@vger.kernel.org, kyungmin.park@samsung.com, linux-mtd@lists.infradead.org, pekon@ti.com, ezequiel.garcia@free-electrons.com, javier@dowhile0.org, linux-omap@vger.kernel.org, Roger Quadros X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rogerq@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Provide NAND specific resources and platform data. Signed-off-by: Roger Quadros --- arch/arm/mach-omap2/gpmc.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index c26ba3f..5563360 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -1350,6 +1350,42 @@ static int gpmc_probe_dt(struct platform_device *pdev) } #endif +static int gpmc_nand_setup(struct platform_device *parent_pdev, + struct gpmc_omap_cs_data *cs) +{ + struct resource *res; + struct resource *res_gpmc; + + if (!cs->pdev) + return -EINVAL; + + res = cs->pdev->resource; + + if (cs->pdev->num_resources < 3) + return -EINVAL; + + if (resource_type(&res[1]) != IORESOURCE_MEM || + resource_type(&res[2]) != IORESOURCE_IRQ) + return -EINVAL; + + if (!cs->settings) + return -EINVAL; + + /* GPMC register space */ + res_gpmc = platform_get_resource(parent_pdev, IORESOURCE_MEM, 0); + if (!res_gpmc) + return -EINVAL; + + res[1] = *res_gpmc; + + /* setup IRQ resources */ + res[2].start = gpmc_irq; + + cs->settings->device_nand = true; + + return 0; +} + static void gpmc_probe_legacy(struct platform_device *pdev) { int i, rc; @@ -1401,6 +1437,15 @@ static void gpmc_probe_legacy(struct platform_device *pdev) /* FIXME: When do we need to call gpmc_cs_remap()? */ skip_mem: + /* Customized NAND setup */ + if (cs->is_nand) { + if (gpmc_nand_setup(pdev, cs)) { + dev_err(dev, "Error setting up NAND on CS %d\n", + i); + continue; + } + } + if (cs->settings) { if (gpmc_cs_program_settings(i, cs->settings)) { dev_err(dev,