From patchwork Wed Jun 11 08:56:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 31734 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8C4C3203C2 for ; Wed, 11 Jun 2014 08:59:51 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id oz11sf14975679veb.3 for ; Wed, 11 Jun 2014 01:59:51 -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:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=coTYZunIdCJGEkoM+oWqgA8V0KxBqAKYmU/IM8259o4=; b=mIyZ5s/Qq1dJnQH4Q/fuw/dyZ8ZQJCxRExxoRzdBIi3fAbDKyHIp2qWvv39Q/dytB1 uTwsitG3Ctap1qG73v62i50eMygW+V+IK3ZmUh4GhnuxE5OvhXm0GZIisLi4TJxUEl+P UDArDdgxVtY8jqqgDb9MJezgEd/IC3IGUIMl4q0JFBbf3BwoDY8mrrjx3pEFKImQ+IWi zOKeDluGUfmcreqr0JHhKe4zMWiaGHhVmvGtk4M3Saf1vG4fPx4i6yWEyfiWIMXQkt0X UkBe7pPPx6A0piY/pA7XlXtUbP35yDYWp9rjySt9pBLse1eBNJyao4JRpStLkvjJnYXA 5LCw== X-Gm-Message-State: ALoCoQnAjefute+KsHDC0hsWfm3W9V9b2to+HhOVWGFIa7TEp/ASRFfm8Rp7IA/jmDrdLaWm6dKl X-Received: by 10.58.238.7 with SMTP id vg7mr1908495vec.22.1402477191396; Wed, 11 Jun 2014 01:59:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.33 with SMTP id e30ls2656379qge.89.gmail; Wed, 11 Jun 2014 01:59:51 -0700 (PDT) X-Received: by 10.58.133.6 with SMTP id oy6mr23767504veb.25.1402477191289; Wed, 11 Jun 2014 01:59:51 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id im2si14031218veb.47.2014.06.11.01.59.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Jun 2014 01:59:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id jz11so6174312veb.17 for ; Wed, 11 Jun 2014 01:59:51 -0700 (PDT) X-Received: by 10.58.29.106 with SMTP id j10mr1837440veh.31.1402477191176; Wed, 11 Jun 2014 01:59:51 -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 vs6csp286530vcb; Wed, 11 Jun 2014 01:59:50 -0700 (PDT) X-Received: by 10.68.139.225 with SMTP id rb1mr3388764pbb.153.1402477190443; Wed, 11 Jun 2014 01:59:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sl2si37212113pbc.221.2014.06.11.01.59.49; Wed, 11 Jun 2014 01:59:49 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932659AbaFKI7X (ORCPT + 27 others); Wed, 11 Jun 2014 04:59:23 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:33145 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932610AbaFKI7R (ORCPT ); Wed, 11 Jun 2014 04:59:17 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5B8wk0D003650; Wed, 11 Jun 2014 03:58:46 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5B8wkgm022396; Wed, 11 Jun 2014 03:58:46 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Wed, 11 Jun 2014 03:58:46 -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 s5B8uiT7020510; Wed, 11 Jun 2014 03:58:43 -0500 From: Roger Quadros To: , , CC: , , , , , , , , , Roger Quadros Subject: [PATCH 33/36] ARM: OMAP2+: board-flash: Use gpmc_generic_init() for NOR Date: Wed, 11 Jun 2014 11:56:38 +0300 Message-ID: <1402477001-31132-34-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 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.172 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Don't access any GPMC registers here. Use gpmc_generic_init() to pass GPMC Chip Select settings, platform device and platform data to the GPMC driver. Signed-off-by: Roger Quadros --- arch/arm/mach-omap2/board-flash.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index b6885e4..617e441 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c @@ -41,7 +41,10 @@ static struct physmap_flash_data board_nor_data = { }; static struct resource board_nor_resource = { + /* GPMC driver will fixup the resource, see gpmc_probe_legacy () */ .flags = IORESOURCE_MEM, + .start = 0, + .end = FLASH_SIZE_SDPV1 - 1, /* fixed @runtime for SDPV2 */ }; static struct platform_device board_nor_device = { @@ -62,23 +65,14 @@ __init board_nor_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) board_nor_data.parts = nor_parts; board_nor_data.nr_parts = nr_parts; - /* Configure start address and size of NOR device */ - if (omap_rev() >= OMAP3430_REV_ES1_0) { - err = gpmc_cs_request(cs, FLASH_SIZE_SDPV2 - 1, - (unsigned long *)&board_nor_resource.start); - board_nor_resource.end = board_nor_resource.start - + FLASH_SIZE_SDPV2 - 1; - } else { - err = gpmc_cs_request(cs, FLASH_SIZE_SDPV1 - 1, - (unsigned long *)&board_nor_resource.start); - board_nor_resource.end = board_nor_resource.start - + FLASH_SIZE_SDPV1 - 1; - } - if (err < 0) { - pr_err("NOR: Can't request GPMC CS\n"); - return; - } - if (platform_device_register(&board_nor_device) < 0) + /* Configure size of NOR device */ + if (omap_rev() >= OMAP3430_REV_ES1_0) + board_nor_resource.end = FLASH_SIZE_SDPV2 - 1; + + err = gpmc_generic_init(cs, false, + NULL, NULL, NULL, + &board_nor_device, sizeof(board_nor_data)); + if (err) pr_err("Unable to register NOR device\n"); }