From patchwork Wed Jan 8 13:47:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 22953 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 96C11202E2 for ; Wed, 8 Jan 2014 13:48:52 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id uo5sf3877323pbc.2 for ; Wed, 08 Jan 2014 05:48:51 -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=JBADCq4asVeJg5f3goOWgrMEsSG+XAsQukxl7eASh5sqxba/LFZhxBXUykfPeDdKD7 3B1xAZN0k9cQRlTn9BjCaK9tVrNLM1wz7fGp/XxL09x+jlQGZ9JyypnBxS/YjMwCAf3L gJOYDz7vGquUNyeS6YNUXxjrcm/U+zlnQf2ShUXiRY2qOBBfayK+VborG/i8B/GHkD2R gAXCkMIvsb2gYB3eKKaZxgYgFYS5lcqqJmZPywBUZRt0QOCkA6oSUrqpY8HUCCNEESYc MUkY0EcElSRSGSbT++yy/FvnoWYjV52lqWjbFagNUy5/KUeqjn7FEwxmmvOXT/Vfl0gs At0g== X-Gm-Message-State: ALoCoQkjLLTvK+5mVU1RzulOlDQ20FCF6x1MpJ+wkq92SwPt2nE53qX9Y9e4GIhc6WbHVWKkL4OB X-Received: by 10.66.190.197 with SMTP id gs5mr4450764pac.14.1389188931909; Wed, 08 Jan 2014 05:48:51 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.229 with SMTP id u5ls538806qeq.69.gmail; Wed, 08 Jan 2014 05:48:51 -0800 (PST) X-Received: by 10.58.216.133 with SMTP id oq5mr1726503vec.80.1389188931771; Wed, 08 Jan 2014 05:48:51 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id gs2si588791vdc.135.2014.01.08.05.48.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jan 2014 05:48:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 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.176; Received: by mail-ve0-f176.google.com with SMTP id oz11so1241978veb.21 for ; Wed, 08 Jan 2014 05:48:51 -0800 (PST) X-Received: by 10.58.155.162 with SMTP id vx2mr3197984veb.46.1389188931665; Wed, 08 Jan 2014 05:48:51 -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 ey3csp226621ved; Wed, 8 Jan 2014 05:48:51 -0800 (PST) X-Received: by 10.194.8.229 with SMTP id u5mr10911987wja.80.1389188930632; Wed, 08 Jan 2014 05:48:50 -0800 (PST) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by mx.google.com with ESMTPS id r5si24937563wjq.62.2014.01.08.05.48.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jan 2014 05:48:50 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.47 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.47; Received: by mail-wg0-f47.google.com with SMTP id n12so1471626wgh.14 for ; Wed, 08 Jan 2014 05:48:50 -0800 (PST) X-Received: by 10.180.20.100 with SMTP id m4mr21480674wie.32.1389188930225; Wed, 08 Jan 2014 05:48:50 -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.48.48 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jan 2014 05:48:49 -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 17/37] mtd: st_spi_fsm: Provide the sequence for enabling 32bit addressing mode Date: Wed, 8 Jan 2014 13:47:00 +0000 Message-Id: <1389188840-14306-18-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.176 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;