From patchwork Thu Jan 23 10:31:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 23598 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 68C16218BD for ; Thu, 23 Jan 2014 10:32:52 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id i4sf6459529oah.7 for ; Thu, 23 Jan 2014 02:32:51 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=d/m/OY+7NTkakWf87JUgT+bdNofodMGmkPXG/GZDuIo=; b=mNC4bMXCpGmnvhd5MXLaE38PVzDJtesnbOTg0fGpRYBgo4dGr1n8psHxf62r/OOhiV 9HxrYQJ44MJFgBcU+giub6N5gN0K/tErqSCu1UKTFb6r88po/Dw4/bgIEtDDKJTAe0OO I1jksMfvxDY+7bjXu0oqOytdahDT09FT5N7xj51WBBcfCcuP9cwNybTSZY9U81zpDaUk I4fl8Ps7Euj8d4tRTW2F4pma2Np/VNwsTc8zqqme4nbfzhWHLxDBpy+9rGQF95DuIW8l PU4ufZxLfQAWY82w89QEYE4uZt7UlfA+A2nDPVEhryVxZd8Z4txPK3AbZr8z4pO7e1PK EbAA== X-Gm-Message-State: ALoCoQk20jIXwj3BcPrnFyguzgRgEeZMBamkzEIe0baqTrEl2X2t8jvtDj5F4YiM6pGirXBqZO21 X-Received: by 10.50.112.10 with SMTP id im10mr1350511igb.1.1390473171574; Thu, 23 Jan 2014 02:32:51 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.132.196 with SMTP id ow4ls261039qeb.40.gmail; Thu, 23 Jan 2014 02:32:51 -0800 (PST) X-Received: by 10.58.50.71 with SMTP id a7mr4009837veo.32.1390473171479; Thu, 23 Jan 2014 02:32:51 -0800 (PST) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id q10si6433030ves.20.2014.01.23.02.32.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:32:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.47; Received: by mail-vb0-f47.google.com with SMTP id p6so926180vbe.20 for ; Thu, 23 Jan 2014 02:32:51 -0800 (PST) X-Received: by 10.220.103.141 with SMTP id k13mr4077273vco.25.1390473171404; Thu, 23 Jan 2014 02:32:51 -0800 (PST) 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.174.196 with SMTP id u4csp15995vcz; Thu, 23 Jan 2014 02:32:51 -0800 (PST) X-Received: by 10.194.174.4 with SMTP id bo4mr1349503wjc.62.1390473170604; Thu, 23 Jan 2014 02:32:50 -0800 (PST) Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by mx.google.com with ESMTPS id ne3si8898223wic.68.2014.01.23.02.32.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:32:50 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.173 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.173; Received: by mail-wi0-f173.google.com with SMTP id d13so6627787wiw.12 for ; Thu, 23 Jan 2014 02:32:50 -0800 (PST) X-Received: by 10.180.21.166 with SMTP id w6mr23641488wie.31.1390473170075; Thu, 23 Jan 2014 02:32:50 -0800 (PST) Received: from localhost.localdomain ([80.76.198.141]) by mx.google.com with ESMTPSA id ay6sm21257831wjb.23.2014.01.23.02.32.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:32:49 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org, dwmw2@infradead.org, linux-mtd@lists.infradead.org, computersforpeace@gmail.com, Angus.Clark@st.com, DCG_UPD_stlinux_kernel@list.st.com, olivier.clergeaud@st.com, Lee Jones Subject: [PATCH RESEND v4 27/37] mtd: st_spi_fsm: Write to Flash via the FSM FIFO Date: Thu, 23 Jan 2014 10:31:15 +0000 Message-Id: <1390473085-24626-28-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1390473085-24626-1-git-send-email-lee.jones@linaro.org> References: <1390473085-24626-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.212.47 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. 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 b43fed1..c64f741 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -661,6 +661,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;