From patchwork Tue Feb 18 14:55:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 24879 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 26975202B2 for ; Tue, 18 Feb 2014 15:01:16 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id to1sf13217690ieb.11 for ; Tue, 18 Feb 2014 07:01:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=XBrU7AtlibfIhI25lwrjKzVmxKPSoI/7JHxZj2jkSP0=; b=OOtXCQ3qHb75TimOHSMrRPIbbg07Lv3QFVqf75yFm8jxRy3JAG5U8F3RMNUvxwRtbA wveUYvR1rzvzVqkQIEzI4er9DtNzDhzd25hY4ctSodVR3xMfK4B/OvJbM/pLrFoeEnrF IZ9oQ5M0475xOtibd9GLbloZ4At/pSkcwvrSxC2ywAt2f7NkLq1+6Jx0YwUqkkJ3Y7Yd i+kLR+F1ECg7jY5NqgItAFnygQPUbcPf0ne8UTcRz6JXL/rZB19XS1u9nQhR4Wgo74kl KAoQ0OkbdFZBz4fKx1gCA92oLznm0kTwJCsxjA9CRjEOjGUwe7fdaas0opAz2BooLRoI YO0g== X-Gm-Message-State: ALoCoQk1yU6iMLEWUm+aJFSVGzMYVeAIen3+jSc146x7pvJpRlU/hGq1JdY5RdIkYjhQAe0S3btb X-Received: by 10.42.13.198 with SMTP id e6mr11174338ica.21.1392735675360; Tue, 18 Feb 2014 07:01:15 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.90.80 with SMTP id w74ls1298657qgd.95.gmail; Tue, 18 Feb 2014 07:01:15 -0800 (PST) X-Received: by 10.220.112.75 with SMTP id v11mr151160vcp.74.1392735675249; Tue, 18 Feb 2014 07:01:15 -0800 (PST) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id uw4si5568936vdc.27.2014.02.18.07.01.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 07:01:15 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ks9so13376568vcb.11 for ; Tue, 18 Feb 2014 07:01:15 -0800 (PST) X-Received: by 10.52.84.102 with SMTP id x6mr4352337vdy.49.1392735675173; Tue, 18 Feb 2014 07:01:15 -0800 (PST) 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.220.174.196 with SMTP id u4csp222866vcz; Tue, 18 Feb 2014 07:01:14 -0800 (PST) X-Received: by 10.67.22.100 with SMTP id hr4mr33283286pad.112.1392735674152; Tue, 18 Feb 2014 07:01:14 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az6si7249134pab.14.2014.02.18.07.01.13; Tue, 18 Feb 2014 07:01:13 -0800 (PST) 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 S1756333AbaBRPBE (ORCPT + 27 others); Tue, 18 Feb 2014 10:01:04 -0500 Received: from mail-wg0-f52.google.com ([74.125.82.52]:62728 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932272AbaBRO5g (ORCPT ); Tue, 18 Feb 2014 09:57:36 -0500 Received: by mail-wg0-f52.google.com with SMTP id b13so3404023wgh.7 for ; Tue, 18 Feb 2014 06:57:35 -0800 (PST) X-Received: by 10.194.188.80 with SMTP id fy16mr23005783wjc.30.1392735455111; Tue, 18 Feb 2014 06:57:35 -0800 (PST) Received: from localhost.localdomain ([80.76.198.141]) by mx.google.com with ESMTPSA id h13sm46039687wjr.22.2014.02.18.06.57.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 06:57:34 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: lee.jones@linaro.org, DCG_UPD_stlinux_kernel@list.st.com, dwmw2@infradead.org, linux-mtd@lists.infradead.org, computersforpeace@gmail.com, Angus.Clark@st.com Subject: [PATCH 26/35] mtd: st_spi_fsm: Write to Flash via the FSM FIFO Date: Tue, 18 Feb 2014 14:55:53 +0000 Message-Id: <1392735362-1245-27-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392735362-1245-1-git-send-email-lee.jones@linaro.org> References: <1392735362-1245-1-git-send-email-lee.jones@linaro.org> 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: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , When we write data to the FIFO the FSM Controller subsequently writes that data out to the Serial Flash chip. Acked-by Angus Clark Signed-off-by: Lee Jones --- drivers/mtd/devices/st_spi_fsm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index e4815fe..ea55548 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -668,6 +668,20 @@ static void stfsm_read_fifo(struct stfsm *fsm, uint32_t *buf, } } +static int stfsm_write_fifo(struct stfsm *fsm, + const uint32_t *buf, const uint32_t size) +{ + uint32_t words = size >> 2; + + dev_dbg(fsm->dev, "writing %d bytes to FIFO\n", size); + + BUG_ON((((uint32_t)buf) & 0x3) || (size & 0x3)); + + writesl(fsm->base + SPI_FAST_SEQ_DATA_REG, buf, words); + + return size; +} + static int stfsm_enter_32bit_addr(struct stfsm *fsm, int enter) { struct stfsm_seq *seq = &stfsm_seq_en_32bit_addr;