From patchwork Fri Nov 22 16:22:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 21697 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DCD5223FDC for ; Fri, 22 Nov 2013 16:24:10 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id kl14sf2609974pab.2 for ; Fri, 22 Nov 2013 08:24: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=bmwxh6fHz+Jv58GS0mLgQzvWV8EDoQMZlgtMZNDeIFY=; b=drMmimsPkrvasIg/l+aLOfL7iUft4cSypRKcbSoYUSvQZTC2Kb+TsRi646YZTNIKk6 eA7ritekpAtCedCvku4iYPrHAQy7bTnHP3j9uDsTkf4WcmmKCd7AyzkDqenjXBNMlWhV eAKpd/ITxx0x2oSdqdCkbKNXnkwVKAyGwvji4goCF6GUQPQTG89ZhF2TKH1E4x+D0hzZ 22yCoLIy3ZceCdEoek1vROdiCGktE76ipUjRPQ6ujVI1ANeQq9mqjmW1BxqKmO6ymRpu OuDn2RhiePGTwnM4hVpD/6DuBoj3+whljjyAmFF3HumCiR0cTRZfWPwhPpyb/yJAWsPk K7eg== X-Gm-Message-State: ALoCoQmADzlaOXpapqUzGLkjvrOLZy2zCs+rRgx94e8sBFytsC9JbpdD+oqf49WJoN+dD0MssDjY X-Received: by 10.66.102.36 with SMTP id fl4mr4212469pab.20.1385137450203; Fri, 22 Nov 2013 08:24:10 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.74.198 with SMTP id w6ls1039442qev.9.gmail; Fri, 22 Nov 2013 08:24:10 -0800 (PST) X-Received: by 10.58.207.15 with SMTP id ls15mr12082054vec.17.1385137450063; Fri, 22 Nov 2013 08:24:10 -0800 (PST) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id sz7si12853889vdc.73.2013.11.22.08.24.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Nov 2013 08:24:10 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.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.128.174; Received: by mail-ve0-f174.google.com with SMTP id pa12so1054016veb.33 for ; Fri, 22 Nov 2013 08:24:10 -0800 (PST) X-Received: by 10.58.254.200 with SMTP id ak8mr12187226ved.12.1385137449988; Fri, 22 Nov 2013 08:24: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 u4csp51547vcz; Fri, 22 Nov 2013 08:24:09 -0800 (PST) X-Received: by 10.66.149.73 with SMTP id ty9mr12844376pab.36.1385137449126; Fri, 22 Nov 2013 08:24:09 -0800 (PST) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by mx.google.com with ESMTPS id xj9si15186917pab.266.2013.11.22.08.24.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Nov 2013 08:24:09 -0800 (PST) Received-SPF: neutral (google.com: 209.85.192.174 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id y13so1455479pdi.33 for ; Fri, 22 Nov 2013 08:24:08 -0800 (PST) X-Received: by 10.68.170.225 with SMTP id ap1mr3610326pbc.117.1385137448750; Fri, 22 Nov 2013 08:24: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 qz9sm52962938pbc.3.2013.11.22.08.24.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Nov 2013 08:24:08 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dwmw2@infradead.org, linux-mtd@lists.infradead.org, angus.clark@st.com Cc: linus.walleij@linaro.org, Lee Jones Subject: [PATCH 17/23] mtd: st_spi_fsm: Provide the sequence for enabling 32bit addressing mode Date: Fri, 22 Nov 2013 16:22:54 +0000 Message-Id: <1385137380-28968-18-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1385137380-28968-1-git-send-email-lee.jones@linaro.org> References: <1385137380-28968-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.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 583a0ab..a56fb98 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_prepare_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;