From patchwork Fri Nov 29 12:19:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 21885 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3809D23FC4 for ; Fri, 29 Nov 2013 12:20:29 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id h16sf32108541oag.8 for ; Fri, 29 Nov 2013 04:20:28 -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=G0lreMNQxr6kpdPdqgxs0qX93ojK8UF4O2l6L4XS3YY=; b=Rr3ijqR7m12c/NuFHf9PvM1RykphekaxTRfPs+0n7BlapwJ+ksrPQC893Pjhd2rd6L le36fCOY+8lxcOsPPoi0xA4XlAszaWkH5PMQUOkfw3VZW+FJzdQjfnhIkylxUDz2/xk3 glvMTnqA9PlH39RTpGivMp2UsaPEx7e9j1DQV40ScxwitIeze+GFQOuWn7u7mkRvrRoP DrO9fM5J8Ro9a7+JlHcT2yxVH1GvwnQX34OJGUvmksittVf6dYp2tB/m1+GBvsdqSkQh l7bUUxAVh7ej68ZsRHNP3v5vlnD3mdSwjQfp5hjcJsZG330scK9JmijmxKzJ0hhLo1VJ 0yxQ== X-Gm-Message-State: ALoCoQn+7hcLeklplambcxqeoIM1GlvU00eYR0O74DIVBZyCqZ2SLwqelKFcxFnab8foYKmpRocb X-Received: by 10.42.62.8 with SMTP id w8mr13593958ich.23.1385727628858; Fri, 29 Nov 2013 04:20:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.96.101 with SMTP id dr5ls3644248qeb.80.gmail; Fri, 29 Nov 2013 04:20:28 -0800 (PST) X-Received: by 10.59.1.41 with SMTP id bd9mr165802ved.63.1385727628686; Fri, 29 Nov 2013 04:20:28 -0800 (PST) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id th8si17685828vdc.37.2013.11.29.04.20.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:20:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.173 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.173; Received: by mail-ve0-f173.google.com with SMTP id oz11so7066650veb.32 for ; Fri, 29 Nov 2013 04:20:28 -0800 (PST) X-Received: by 10.220.182.69 with SMTP id cb5mr1653174vcb.41.1385727628614; Fri, 29 Nov 2013 04:20:28 -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 u4csp87456vcz; Fri, 29 Nov 2013 04:20:28 -0800 (PST) X-Received: by 10.224.111.197 with SMTP id t5mr86836256qap.49.1385727628273; Fri, 29 Nov 2013 04:20:28 -0800 (PST) Received: from mail-yh0-f51.google.com (mail-yh0-f51.google.com [209.85.213.51]) by mx.google.com with ESMTPS id q6si21845659qag.88.2013.11.29.04.20.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:20:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.213.51 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.213.51; Received: by mail-yh0-f51.google.com with SMTP id c41so5137733yho.10 for ; Fri, 29 Nov 2013 04:20:27 -0800 (PST) X-Received: by 10.236.199.81 with SMTP id w57mr831704yhn.139.1385727627603; Fri, 29 Nov 2013 04:20:27 -0800 (PST) Received: from localhost.localdomain (cpc15-aztw25-2-0-cust493.aztw.cable.virginm.net. [92.233.57.238]) by mx.google.com with ESMTPSA id m29sm101911689yho.14.2013.11.29.04.20.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:20:27 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dwmw2@infradead.org Cc: linus.walleij@linaro.org, linux-mtd@lists.infradead.org, angus.clark@st.com, Lee Jones Subject: [PATCH v3 27/36] mtd: st_spi_fsm: Write to Flash via the FSM FIFO Date: Fri, 29 Nov 2013 12:19:16 +0000 Message-Id: <1385727565-25794-28-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1385727565-25794-1-git-send-email-lee.jones@linaro.org> References: <1385727565-25794-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.173 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 c76510e..c08805f 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -261,6 +261,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;