From patchwork Thu Mar 20 09:20:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 26649 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BF792202E0 for ; Thu, 20 Mar 2014 09:21:55 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id a41sf1535672yho.10 for ; Thu, 20 Mar 2014 02:21:55 -0700 (PDT) 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=stWe+t75/1u3sgPpSNZkbx5oLQoZgkmmuESSqNkrWzA=; b=NqDCFPmoLdhpGZHuckMKocl16v9UHMyjcucoYIbIkK2MNN/Zfz7bkQH3a0ucN6Kol0 O3x9OLyTHj6f5OlAQgBbMtZlGYw/zub2aiGKVHoZd/WyixtJQJ/Tv2vVr8T1Jd1sUAcL /uS0qa1pEx9S+2nKyOOMOrHWDsEcEck+udW2A37dPYRoKfPdLljN2OBbsqhAnQBYrJTi yIgTz+wL2Y1obDdxhiTzrqZVlZI54PzVTNMQ9SXCBAQoXt6Sn3Z3myH6AC2DtUUcb7Pf rp42htcpUNXI1lX5WQFXbSgbDpvWYh6G+PVUn6YsK9rRQ92zfkiqUUiOA5Hkbyy6s6yh jIZA== X-Gm-Message-State: ALoCoQkPxrWNUfQVmwQlCC55XE7VV9m6Y+0ifM7Ovr9igMnkmaidDMiHoPqMzxeW+d+G1/1l6uvJ X-Received: by 10.236.151.44 with SMTP id a32mr1376068yhk.21.1395307315245; Thu, 20 Mar 2014 02:21:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.167 with SMTP id 36ls179372qgn.55.gmail; Thu, 20 Mar 2014 02:21:55 -0700 (PDT) X-Received: by 10.52.141.105 with SMTP id rn9mr2734119vdb.44.1395307315052; Thu, 20 Mar 2014 02:21:55 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id cb3si293016vdc.203.2014.03.20.02.21.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:21:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so597751vcb.20 for ; Thu, 20 Mar 2014 02:21:55 -0700 (PDT) X-Received: by 10.220.164.80 with SMTP id d16mr32847426vcy.15.1395307314970; Thu, 20 Mar 2014 02:21:54 -0700 (PDT) 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.78.9 with SMTP id i9csp372533vck; Thu, 20 Mar 2014 02:21:54 -0700 (PDT) X-Received: by 10.180.185.197 with SMTP id fe5mr1747315wic.56.1395307313495; Thu, 20 Mar 2014 02:21:53 -0700 (PDT) Received: from mail-we0-f173.google.com (mail-we0-f173.google.com [74.125.82.173]) by mx.google.com with ESMTPS id ax8si826368wjc.157.2014.03.20.02.21.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:21:53 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.173 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.173; Received: by mail-we0-f173.google.com with SMTP id w61so369192wes.32 for ; Thu, 20 Mar 2014 02:21:52 -0700 (PDT) X-Received: by 10.194.2.194 with SMTP id 2mr6006306wjw.73.1395307312669; Thu, 20 Mar 2014 02:21:52 -0700 (PDT) Received: from lee--X1.home (host109-148-116-196.range109-148.btcentralplus.com. [109.148.116.196]) by mx.google.com with ESMTPSA id di9sm4735120wid.6.2014.03.20.02.21.50 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:21:51 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, computersforpeace@gmail.com Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org, Angus.Clark@st.com, Lee Jones Subject: [PATCH v6 16/36] mtd: st_spi_fsm: Provide the sequence for enabling 32bit addressing mode Date: Thu, 20 Mar 2014 09:20:48 +0000 Message-Id: <1395307268-12721-17-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1395307268-12721-1-git-send-email-lee.jones@linaro.org> References: <1395307268-12721-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.175 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. Acked-by Angus Clark 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 06e6a52..9d1edf0 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -411,6 +411,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;