From patchwork Thu Mar 20 09:20:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 26660 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D437B202E0 for ; Thu, 20 Mar 2014 09:22:16 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id to1sf2123937ieb.9 for ; Thu, 20 Mar 2014 02:22:16 -0700 (PDT) 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=W/gJ17XTepQYylXI1UeQr6rMCa58eA5mQHvx4+L9mHk=; b=IuZuH6EHDuD94HLd1JKdtlqF6qRqfdJtbKp2Z0/gXRpzgz47DS3VCdkEhWouPwKuPO smVTF9ebYCQOJrkj8BQgUzOxoP1796o8bMR9ctLj9XXbNrovfdlkTB/hcEZd6c3sbs/3 q15wl8laIUvlq+FWd+d1gBnTjX2vvQkctxgSXmHO1dwmTgEijbQ+xXS3Aw7L7wHd4kfz t0N8n4AprUXe1QjtbZ6zDUcQVcABuNXi26lY9wV562xrHETeNpcX/cOy/dnRgQ/KbZaO WBN3gY5LIYaydlhQ28l+ixOcHjxkqksA/fBZ6ddoLSBt/HCat3OTmirY49XkopT3acx+ UwHA== X-Gm-Message-State: ALoCoQkZ8OsM5Thpx9/ux8tp1tRvuzzXgS8w4+R0g+W5U33Q38D2iKeGmXr218QPm1CTGFKjAvGd X-Received: by 10.182.194.71 with SMTP id hu7mr3221975obc.37.1395307336149; Thu, 20 Mar 2014 02:22:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.225 with SMTP id r88ls168600qgr.2.gmail; Thu, 20 Mar 2014 02:22:16 -0700 (PDT) X-Received: by 10.221.27.8 with SMTP id ro8mr3908826vcb.30.1395307336038; Thu, 20 Mar 2014 02:22:16 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id iz10si297767vec.60.2014.03.20.02.22.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:22:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id sa20so583683veb.22 for ; Thu, 20 Mar 2014 02:22:16 -0700 (PDT) X-Received: by 10.52.147.238 with SMTP id tn14mr28141198vdb.23.1395307333626; Thu, 20 Mar 2014 02:22:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.78.9 with SMTP id i9csp372563vck; Thu, 20 Mar 2014 02:22:13 -0700 (PDT) X-Received: by 10.194.243.68 with SMTP id ww4mr6439472wjc.58.1395307332663; Thu, 20 Mar 2014 02:22:12 -0700 (PDT) Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) by mx.google.com with ESMTPS id iy12si12103710wic.81.2014.03.20.02.22.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:22:12 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.175 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.175; Received: by mail-we0-f175.google.com with SMTP id q58so361140wes.20 for ; Thu, 20 Mar 2014 02:22:12 -0700 (PDT) X-Received: by 10.180.85.234 with SMTP id k10mr1780619wiz.32.1395307332152; Thu, 20 Mar 2014 02:22:12 -0700 (PDT) Received: from lee--X1.home (host109-148-116-196.range109-148.btcentralplus.com. [109.148.116.196]) by mx.google.com with ESMTPSA id di9sm4735120wid.6.2014.03.20.02.22.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:22:11 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, computersforpeace@gmail.com Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org, Angus.Clark@st.com, Lee Jones Subject: [PATCH v6 26/36] mtd: st_spi_fsm: Write to Flash via the FSM FIFO Date: Thu, 20 Mar 2014 09:20:58 +0000 Message-Id: <1395307268-12721-27-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1395307268-12721-1-git-send-email-lee.jones@linaro.org> References: <1395307268-12721-1-git-send-email-lee.jones@linaro.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.128.177 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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 b1a65c1..58b8761 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;