From patchwork Thu Jan 23 10:31:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 23588 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 46B62218BD for ; Thu, 23 Jan 2014 10:32:26 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id e16sf2654788qcx.8 for ; Thu, 23 Jan 2014 02:32:25 -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=HKnky+9Es+b2DZpVJgvv9+IbBesRk1Lp5Euv3AQP5NM=; b=OMlasBhkJmn6zg0hWGv/+VyQ3igAnTZ/6JrxnPLl5RWwZdJ7tcSN/pOHXprJoHD2pz NDn0mmuH6d83kH+CSvftUcMUoL5IkbFBwWEudal8XwWJXxyADFFUxva44sgAfRpco0co Tnx6sjcelcnr4I/d8lXSU2Yj0r0rP054BnDXcxUlZ8+qRjxwY+UxJETUDd0c3zXFfExA FaTkL73t0CB2dFIHTJcQAzDNbwNbAn+vuJiHYkydP0FmPJA/QrpI2JZ5PhwjecCcY32b 3XTvtRdTmyOGV0BiSnLOpFE76S2KWd7d7SFigs8VJE6W0CZe4oeDVzCda2VSI3E0i9Xn T+aA== X-Gm-Message-State: ALoCoQk5fJ9/bItR9RsSkP7Ys/C2n70pSnJVgwZ5RJA+7vvR892/VBLPrbMxfSlndpb2GbZspDyM X-Received: by 10.236.26.209 with SMTP id c57mr2364834yha.45.1390473145525; Thu, 23 Jan 2014 02:32:25 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.231 with SMTP id q94ls308566qga.45.gmail; Thu, 23 Jan 2014 02:32:25 -0800 (PST) X-Received: by 10.220.58.202 with SMTP id i10mr4122700vch.23.1390473145427; Thu, 23 Jan 2014 02:32:25 -0800 (PST) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id i3si6418493vcp.127.2014.01.23.02.32.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:32:25 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.50 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.50; Received: by mail-vb0-f50.google.com with SMTP id w8so946717vbj.9 for ; Thu, 23 Jan 2014 02:32:25 -0800 (PST) X-Received: by 10.220.103.141 with SMTP id k13mr4076383vco.25.1390473145352; Thu, 23 Jan 2014 02:32:25 -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 u4csp15951vcz; Thu, 23 Jan 2014 02:32:24 -0800 (PST) X-Received: by 10.194.219.132 with SMTP id po4mr6013826wjc.7.1390473144427; Thu, 23 Jan 2014 02:32:24 -0800 (PST) Received: from mail-we0-f172.google.com (mail-we0-f172.google.com [74.125.82.172]) by mx.google.com with ESMTPS id p6si8792419wjx.11.2014.01.23.02.32.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:32:24 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.172 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.172; Received: by mail-we0-f172.google.com with SMTP id q58so956390wes.31 for ; Thu, 23 Jan 2014 02:32:24 -0800 (PST) X-Received: by 10.180.75.202 with SMTP id e10mr23903643wiw.50.1390473144007; Thu, 23 Jan 2014 02:32:24 -0800 (PST) Received: from localhost.localdomain ([80.76.198.141]) by mx.google.com with ESMTPSA id ay6sm21257831wjb.23.2014.01.23.02.32.21 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:32:23 -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 17/37] mtd: st_spi_fsm: Provide the sequence for enabling 32bit addressing mode Date: Thu, 23 Jan 2014 10:31:05 +0000 Message-Id: <1390473085-24626-18-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.50 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 5ee6d08..02718ae 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -447,6 +447,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;