From patchwork Fri Sep 18 14:53:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 53894 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id 7A428218E3 for ; Fri, 18 Sep 2015 14:55:45 +0000 (UTC) Received: by lbot4 with SMTP id t4sf17971744lbo.0 for ; Fri, 18 Sep 2015 07:55:44 -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:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=kOSc8wA1rntNElSVz4xQDSphj4K/4jecoo53upWeAVk=; b=Vz/eq3C1zZ32i4KcKiurqitfcutMprFWsWFz+aE6gvcjw4vyF8LX9GKPD+OwY6Yil8 MvVS8SkkMK+3aekCw4Y+X4BDngYkLuQSmygUROFawtX3fy7irHa/Gn2j+Mlm1B3UTLQD V3TaMyaPCL0h/5OW7cJ1TrMA5nYP0cg0GfFVpIWpjDLOtTVvVlyl8bDvO9DVWl5cO+tH Jmpr6+waSwHqdQNxi19aCX5NdHkSdVPsXtnjWARWkDjBKbLsNMpNuyNhUX292tCJVu6U SPjnJPaLyzXPjm8GXAqhwUMfdgf5zdrtYmLWTe0kIHT3b5n6pHmPDKyEbx+L03S3vbGO A3fQ== X-Gm-Message-State: ALoCoQkdb9ff3YOYRDgPm9kKrKUQbmDux4wFHLIFr3uAISOnMNEdcDJt2asfTXP4RBMMSbRmBEEj X-Received: by 10.112.125.104 with SMTP id mp8mr990014lbb.20.1442588144500; Fri, 18 Sep 2015 07:55:44 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.97 with SMTP id r1ls222650lah.95.gmail; Fri, 18 Sep 2015 07:55:44 -0700 (PDT) X-Received: by 10.112.135.9 with SMTP id po9mr3440354lbb.56.1442588144335; Fri, 18 Sep 2015 07:55:44 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id m6si4282637laf.62.2015.09.18.07.55.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Sep 2015 07:55:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbcao8 with SMTP id ao8so26409204lbc.3 for ; Fri, 18 Sep 2015 07:55:44 -0700 (PDT) X-Received: by 10.152.5.170 with SMTP id t10mr3298414lat.112.1442588144189; Fri, 18 Sep 2015 07:55:44 -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.112.59.35 with SMTP id w3csp344246lbq; Fri, 18 Sep 2015 07:55:43 -0700 (PDT) X-Received: by 10.50.1.44 with SMTP id 12mr32321525igj.61.1442588143220; Fri, 18 Sep 2015 07:55:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ft7si7092816igb.101.2015.09.18.07.55.42; Fri, 18 Sep 2015 07:55:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754476AbbIROze (ORCPT + 30 others); Fri, 18 Sep 2015 10:55:34 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:42110 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753804AbbIROzV (ORCPT ); Fri, 18 Sep 2015 10:55:21 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8IEt0dh001186; Fri, 18 Sep 2015 09:55:00 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8IEt0oW008438; Fri, 18 Sep 2015 09:55:00 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Fri, 18 Sep 2015 09:55:00 -0500 Received: from rockdesk.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8IEseAL002598; Fri, 18 Sep 2015 09:54:57 -0500 From: Roger Quadros To: CC: , , , , , , , , , , Roger Quadros Subject: [PATCH v3 05/27] memory: omap-gpmc: Add GPMC-NAND ops to get writebufferempty status Date: Fri, 18 Sep 2015 17:53:27 +0300 Message-ID: <1442588029-13769-6-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442588029-13769-1-git-send-email-rogerq@ti.com> References: <1442588029-13769-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.217.176 as permitted sender) smtp.mailfrom=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: , This is needed by OMAP NAND driver to poll the empty status of the writebuffer. Signed-off-by: Roger Quadros --- drivers/memory/omap-gpmc.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index a80c53e..174c45b 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -81,6 +81,8 @@ #define GPMC_CONFIG_LIMITEDADDRESS BIT(1) +#define GPMC_STATUS_EMPTYWRITEBUFFERSTATUS BIT(0) + #define GPMC_CONFIG2_CSEXTRADELAY BIT(7) #define GPMC_CONFIG3_ADVEXTRADELAY BIT(7) #define GPMC_CONFIG4_OEEXTRADELAY BIT(7) @@ -1099,7 +1101,17 @@ void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs) } } -static struct gpmc_nand_ops nand_ops; +static bool gpmc_nand_writebuffer_empty(void) +{ + if (gpmc_read_reg(GPMC_STATUS) & GPMC_STATUS_EMPTYWRITEBUFFERSTATUS) + return true; + + return false; +} + +static struct gpmc_nand_ops nand_ops = { + .nand_writebuffer_empty = gpmc_nand_writebuffer_empty, +}; /** * gpmc_omap_get_nand_ops - Get the GPMC NAND interface