From patchwork Thu Mar 20 09:20:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 26654 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5FE36202E0 for ; Thu, 20 Mar 2014 09:22:04 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id j17sf2387829oag.6 for ; Thu, 20 Mar 2014 02:22:03 -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=yI+K9+vDfENweC+SbwuFJvaCmp6mW3oHrjG2BtWGJ9o=; b=mQsL2a7dItrH6d0eHLmKU61lJoR56ks0onMb+v9jRNcTeGjk++npjiFUo1AYys1Jcu JEt7+xmXx1aFwnYJf+tF76C6OeJv8mYGkorFK7YVlw7l67xvr2vbihM7LQFAnjSKWOw3 ayf7Ctmi0VXJgeN+ZSv5g1awc2qAXwCxHYU95+OmYVLD8+86BtulISScotFhChKl3rT8 +7U5+LjJPeGRvxcJNaN8pzooLUs5GRTx9C5vnvl7TsCe0qXTvRiLqXxXIBsPmtlOo3Pc 3bE+u9I1rhHb4/aPcKlCsL78Oavdco7v1hSGhEh5tFZBCDfiznHqHJrTyqAAJqxAbDhl 2pOw== X-Gm-Message-State: ALoCoQkJU8IrUDD1A2KQAxwPKP+wFjTTSxcLV7cHN7algK0LR0bStqM9baHDLRkWdynbml9xu/oe X-Received: by 10.42.240.19 with SMTP id ky19mr14971987icb.4.1395307323899; Thu, 20 Mar 2014 02:22:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.130 with SMTP id u2ls142667qga.34.gmail; Thu, 20 Mar 2014 02:22:03 -0700 (PDT) X-Received: by 10.221.55.133 with SMTP id vy5mr33367664vcb.17.1395307323806; Thu, 20 Mar 2014 02:22:03 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id la9si299471veb.38.2014.03.20.02.22.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:22:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 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.178; Received: by mail-vc0-f178.google.com with SMTP id im17so589014vcb.23 for ; Thu, 20 Mar 2014 02:22:03 -0700 (PDT) X-Received: by 10.52.34.4 with SMTP id v4mr2803387vdi.42.1395307323726; Thu, 20 Mar 2014 02:22:03 -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 i9csp372550vck; Thu, 20 Mar 2014 02:22:03 -0700 (PDT) X-Received: by 10.180.72.136 with SMTP id d8mr1783935wiv.44.1395307322730; Thu, 20 Mar 2014 02:22:02 -0700 (PDT) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by mx.google.com with ESMTPS id o8si843152wjo.93.2014.03.20.02.22.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:22:02 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.48 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.48; Received: by mail-wg0-f48.google.com with SMTP id l18so372907wgh.7 for ; Thu, 20 Mar 2014 02:22:02 -0700 (PDT) X-Received: by 10.194.242.4 with SMTP id wm4mr385799wjc.88.1395307322128; Thu, 20 Mar 2014 02:22:02 -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.22.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:22:01 -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 21/36] mtd: st_spi_fsm: Provide the default read/write configurations Date: Thu, 20 Mar 2014 09:20:53 +0000 Message-Id: <1395307268-12721-22-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.178 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: , Message sequences can vary depending on how many pads (lines) are required to address the chip (mode & dummy), how many data pads (lines) are required to write out to the chip which will determine speed amongst other things which are detailed by the SFDP specification. We are able to use multiple configurations for each chip, but they need to me matched to a device's capabilities. These configurations are listed in preference order - most preferred first. Acked-by Angus Clark Signed-off-by: Lee Jones --- drivers/mtd/devices/st_spi_fsm.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index 5683443..03b49a4 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -375,6 +375,33 @@ static struct flash_info flash_types[] = { { NULL, 0x000000, 0, 0, 0, 0, 0, NULL }, }; +/* + * FSM message sequence configurations: + * + * All configs are presented in order of preference + */ + +/* Default READ configurations, in order of preference */ +static struct seq_rw_config default_read_configs[] = { + {FLASH_FLAG_READ_1_4_4, FLASH_CMD_READ_1_4_4, 0, 4, 4, 0x00, 2, 4}, + {FLASH_FLAG_READ_1_1_4, FLASH_CMD_READ_1_1_4, 0, 1, 4, 0x00, 4, 0}, + {FLASH_FLAG_READ_1_2_2, FLASH_CMD_READ_1_2_2, 0, 2, 2, 0x00, 4, 0}, + {FLASH_FLAG_READ_1_1_2, FLASH_CMD_READ_1_1_2, 0, 1, 2, 0x00, 0, 8}, + {FLASH_FLAG_READ_FAST, FLASH_CMD_READ_FAST, 0, 1, 1, 0x00, 0, 8}, + {FLASH_FLAG_READ_WRITE, FLASH_CMD_READ, 0, 1, 1, 0x00, 0, 0}, + {0x00, 0, 0, 0, 0, 0x00, 0, 0}, +}; + +/* Default WRITE configurations */ +static struct seq_rw_config default_write_configs[] = { + {FLASH_FLAG_WRITE_1_4_4, FLASH_CMD_WRITE_1_4_4, 1, 4, 4, 0x00, 0, 0}, + {FLASH_FLAG_WRITE_1_1_4, FLASH_CMD_WRITE_1_1_4, 1, 1, 4, 0x00, 0, 0}, + {FLASH_FLAG_WRITE_1_2_2, FLASH_CMD_WRITE_1_2_2, 1, 2, 2, 0x00, 0, 0}, + {FLASH_FLAG_WRITE_1_1_2, FLASH_CMD_WRITE_1_1_2, 1, 1, 2, 0x00, 0, 0}, + {FLASH_FLAG_READ_WRITE, FLASH_CMD_WRITE, 1, 1, 1, 0x00, 0, 0}, + {0x00, 0, 0, 0, 0, 0x00, 0, 0}, +}; + static struct stfsm_seq stfsm_seq_en_32bit_addr;/* Dynamically populated */ static struct stfsm_seq stfsm_seq_read_jedec = {