From patchwork Wed Jan 8 13:47:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 22963 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 45EEA202E2 for ; Wed, 8 Jan 2014 13:49:09 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf6089710obc.8 for ; Wed, 08 Jan 2014 05:49:08 -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=YJFpKxibE9OExbvTLUzXCh30Eiu/c4/jmMn4brDRoDUurUPIWugjPZhqBtwJS9vxEG 9/uw5ILQnXt8md08pbK7RNwGeVWWWJ10mpgCD2M+yQPOFM3T7dMtUJj8Cy8JlxJRoODv HTDNk1ubmo7pUsKo3YitV28JuM5WAdZCiOy+T2cRPgQnsinqV8X5US3tEx94cngp3xPI PeyzZVufn2gnuiyqYnKEFNcGZ/tDrI2K0HPrBqZnKIWVPofeIwU6hKySjKPaqBIwX3+y mcEDBe3z7VkhIcW5nq6o9QRJVnHxD52RNO+4DEuLAmdDyjhNKgsFsjb4Yp0QL7cXdX92 ckfw== X-Gm-Message-State: ALoCoQmq5K7r/nUoBNlzcpmX44j/JFCuZR9RNTnlKJSbi5s0H+/YrgbICpe0vnVx/YptctpqDa5t X-Received: by 10.42.46.3 with SMTP id i3mr16371702icf.31.1389188948371; Wed, 08 Jan 2014 05:49:08 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.132.164 with SMTP id ov4ls489191qeb.32.gmail; Wed, 08 Jan 2014 05:49:08 -0800 (PST) X-Received: by 10.52.163.169 with SMTP id yj9mr1579225vdb.86.1389188948223; Wed, 08 Jan 2014 05:49:08 -0800 (PST) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id si2si619600vdc.12.2014.01.08.05.49.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jan 2014 05:49:08 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.172 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.172; Received: by mail-ve0-f172.google.com with SMTP id jw12so1239149veb.17 for ; Wed, 08 Jan 2014 05:49:08 -0800 (PST) X-Received: by 10.53.8.1 with SMTP id dg1mr2680200vdd.52.1389188948132; Wed, 08 Jan 2014 05:49:08 -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.59.13.131 with SMTP id ey3csp226643ved; Wed, 8 Jan 2014 05:49:07 -0800 (PST) X-Received: by 10.194.86.200 with SMTP id r8mr12323849wjz.49.1389188946632; Wed, 08 Jan 2014 05:49:06 -0800 (PST) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by mx.google.com with ESMTPS id mu5si2599613wib.0.2014.01.08.05.49.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jan 2014 05:49:06 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.175 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.175; Received: by mail-wi0-f175.google.com with SMTP id hi5so5530169wib.2 for ; Wed, 08 Jan 2014 05:49:06 -0800 (PST) X-Received: by 10.194.23.201 with SMTP id o9mr11126183wjf.67.1389188946187; Wed, 08 Jan 2014 05:49:06 -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 j9sm48125217wjx.18.2014.01.08.05.49.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jan 2014 05:49:05 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: computersforpeace@gmail.com, angus.clark@st.com, Lee Jones Subject: [PATCH v4 27/37] mtd: st_spi_fsm: Write to Flash via the FSM FIFO Date: Wed, 8 Jan 2014 13:47:10 +0000 Message-Id: <1389188840-14306-28-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1389188840-14306-1-git-send-email-lee.jones@linaro.org> References: <1389188840-14306-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.172 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;