From patchwork Fri Nov 29 12:19:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 21875 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ECAD023FC4 for ; Fri, 29 Nov 2013 12:20:10 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf20782103yho.4 for ; Fri, 29 Nov 2013 04:20:10 -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=+Lk31aVjIJJoJFh4yYSweqDPSWW/QdHOXSx5AHqtplc=; b=fJDymf4T8GBouIS+I6UX3kjpNSmqRoAEDNt/YzZQCSX3x9LuZK7W6l1gWqJQJr4FT9 GKLRYTLHMt78y6mDbGcvW9YTUc3MqWUeLVVlS1oN6Syh0W9uVa5eUyEWxVfDYZUJ8lJw /vXdZeZNSPX1Ozb1uDpjJuVMpbLhDERY1lB+w0gg0YOyL+F3LvfpmPhWBZw5ecz9ngJz qIdw7SHE5+5kZhw8PT5JSuSHPJM+ITn6wZh9Jwm9VAEMy34b4xjYPEGBtkcWXFDIe6+m 3DunozWVtg8TxNeL70Am496ftM6eIYzEmhjNZoHy+SmJiKd/rI3gmkqOco1l9kWGabHg jY7g== X-Gm-Message-State: ALoCoQkllc4frNt1UPuGgmKEtbZu53Vuc9hNVfaBOPf3SCZ83KwnzxzUZWHqe7hKiowZc8TozrHb X-Received: by 10.52.119.205 with SMTP id kw13mr9993233vdb.3.1385727610786; Fri, 29 Nov 2013 04:20:10 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.72 with SMTP id w8ls3502460qej.59.gmail; Fri, 29 Nov 2013 04:20:10 -0800 (PST) X-Received: by 10.220.192.198 with SMTP id dr6mr21731660vcb.19.1385727609221; Fri, 29 Nov 2013 04:20:09 -0800 (PST) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id xt2si24801348vcb.33.2013.11.29.04.20.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:20:09 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id id10so6462036vcb.19 for ; Fri, 29 Nov 2013 04:20:09 -0800 (PST) X-Received: by 10.221.32.200 with SMTP id sl8mr29843vcb.64.1385727609150; Fri, 29 Nov 2013 04:20:09 -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 u4csp87425vcz; Fri, 29 Nov 2013 04:20:08 -0800 (PST) X-Received: by 10.49.62.167 with SMTP id z7mr86011182qer.67.1385727608749; Fri, 29 Nov 2013 04:20:08 -0800 (PST) Received: from mail-yh0-f47.google.com (mail-yh0-f47.google.com [209.85.213.47]) by mx.google.com with ESMTPS id a4si7235889qar.44.2013.11.29.04.20.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:20:08 -0800 (PST) Received-SPF: neutral (google.com: 209.85.213.47 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.213.47; Received: by mail-yh0-f47.google.com with SMTP id 29so6746078yhl.34 for ; Fri, 29 Nov 2013 04:20:08 -0800 (PST) X-Received: by 10.236.171.195 with SMTP id r43mr2031109yhl.56.1385727608477; Fri, 29 Nov 2013 04:20:08 -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.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:20:08 -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 17/36] mtd: st_spi_fsm: Provide the sequence for enabling 32bit addressing mode Date: Fri, 29 Nov 2013 12:19:06 +0000 Message-Id: <1385727565-25794-18-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.220.174 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: , The FSM Serial Flash Controller is driven by issuing a standard set of register writes we call a message sequence. This patch supplies a method to prepare the message sequence responsible for setting 32bit addressing mode on the Flash chip. Signed-off-by: Lee Jones --- drivers/mtd/devices/st_spi_fsm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index 47f9da0..7d690c7 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -66,6 +66,28 @@ static struct stfsm_seq stfsm_seq_erase_sector = { SEQ_CFG_STARTSEQ), }; +static int stfsm_n25q_en_32bit_addr_seq(struct stfsm_seq *seq) +{ + seq->seq_opc[0] = (SEQ_OPC_PADS_1 | SEQ_OPC_CYCLES(8) | + SEQ_OPC_OPCODE(FLASH_CMD_EN4B_ADDR)); + seq->seq_opc[1] = (SEQ_OPC_PADS_1 | SEQ_OPC_CYCLES(8) | + SEQ_OPC_OPCODE(FLASH_CMD_WREN) | + SEQ_OPC_CSDEASSERT); + + seq->seq[0] = STFSM_INST_CMD2; + seq->seq[1] = STFSM_INST_CMD1; + seq->seq[2] = STFSM_INST_WAIT; + seq->seq[3] = STFSM_INST_STOP; + + seq->seq_cfg = (SEQ_CFG_PADS_1 | + SEQ_CFG_ERASE | + SEQ_CFG_READNOTWRITE | + SEQ_CFG_CSDEASSERT | + SEQ_CFG_STARTSEQ); + + return 0; +} + static inline int stfsm_is_idle(struct stfsm *fsm) { return readl(fsm->base + SPI_FAST_SEQ_STA) & 0x10;