From patchwork Tue Jul 28 08:41:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vignesh Raghavendra X-Patchwork-Id: 6880571 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 98023C05AC for ; Tue, 28 Jul 2015 08:47:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3B9420718 for ; Tue, 28 Jul 2015 08:47:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA25D2069F for ; Tue, 28 Jul 2015 08:47:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755097AbbG1InQ (ORCPT ); Tue, 28 Jul 2015 04:43:16 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:32961 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbbG1InM (ORCPT ); Tue, 28 Jul 2015 04:43:12 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t6S8gbMf010637; Tue, 28 Jul 2015 03:42:37 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t6S8gbGM000519; Tue, 28 Jul 2015 03:42:37 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Tue, 28 Jul 2015 03:42:37 -0500 Received: from uda0132425.apr.dhcp.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 t6S8gQCB028779; Tue, 28 Jul 2015 03:42:33 -0500 From: Vignesh R To: Mark Brown , David Woodhouse , Brian Norris , Tony Lindgren , Russell King CC: Huang Shijie , Vignesh R , , , , , , Subject: [RFC PATCH 1/5] spi: introduce flag for memory mapped read Date: Tue, 28 Jul 2015 14:11:12 +0530 Message-ID: <1438072876-16338-2-git-send-email-vigneshr@ti.com> X-Mailer: git-send-email 2.4.6 In-Reply-To: <1438072876-16338-1-git-send-email-vigneshr@ti.com> References: <1438072876-16338-1-git-send-email-vigneshr@ti.com> MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP TI QSPI controller has SFI translator which exposes entire flash memory as memory mapped region for read. With this interface, the CPU can copy data from flash using normal memcpy call. SFI translator takes care of generating appropriate SPI signals to read data from flash. This interface works only with SPI flash memories and cannot be used with other SPI devices. Introduce use_mmap_read field in spi_message struct. This can be set by mtd devices (m25p80) to indicate to spi-master (ti-qspi) to perform memory mapped read. This helps to distinguish whether the spi-message is from mtd layer(hence mmap read is possible) or by other spi devices. Signed-off-by: Vignesh R --- include/linux/spi/spi.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index d673072346f2..f1a0329ee63f 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -640,6 +640,8 @@ struct spi_transfer { * @actual_length: the total number of bytes that were transferred in all * successful segments * @status: zero for success, else negative errno + * @use_mmap_mode: Indicate to spi master to perform memory mapped + * read if possible. * @queue: for use by whichever driver currently owns the message * @state: for use by whichever driver currently owns the message * @@ -681,6 +683,7 @@ struct spi_message { unsigned frame_length; unsigned actual_length; int status; + bool use_mmap_mode; /* for optional use by whatever driver currently owns the * spi_message ... between calls to spi_async and then later