From patchwork Fri Nov 29 12:19:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 21880 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 021AF23FC4 for ; Fri, 29 Nov 2013 12:20:18 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 5sf22295573qeb.7 for ; Fri, 29 Nov 2013 04:20:18 -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=HKwJDgvC6lnaKqSaecDHf/OIn3eCnypDIy7Bo5HjyxE=; b=Qh8lhLCJBfqKweaxqvG09sBoScQRkrS8Aex5xsRDmZZgQxv6zA8Z7xNSQBMfiGe9uK Zab4XW1QLnpzTp/A7CBvpP7GeLl+mCxhqQeH0GL18cwWcQpqGvoLFhU1/RRizoneWOr7 qDVRp5gMEOstkrPjLbOaWEg0Tgr/yWk967orNoOvXcLXnwV+auLr5MP1G/D+PKs9l4lb WoihgK8awoNVqgxVZAdFetDGWdKTQaTJTmAT9kcMcQoCQXAkZl4n/2QwtW3QUdLphcWa UckrklLt1Pd/K2wrm0t9dsjDPLkpsxU8eQ/PFyJ28smEJRwbE/8XfkNIzKGWtD9WVfDJ VUDg== X-Gm-Message-State: ALoCoQk4RZYOc68l+7S1YEE9CnJNYypEBAETGyNoifdIuMf1wRmGSkNvL2aPeleNchNIZxMUuPbY X-Received: by 10.58.23.166 with SMTP id n6mr16984714vef.13.1385727618870; Fri, 29 Nov 2013 04:20:18 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.40.194 with SMTP id z2ls876892qek.23.gmail; Fri, 29 Nov 2013 04:20:18 -0800 (PST) X-Received: by 10.52.97.35 with SMTP id dx3mr36408098vdb.18.1385727618631; Fri, 29 Nov 2013 04:20:18 -0800 (PST) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id 1si24770439vel.150.2013.11.29.04.20.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:20:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.173 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.173; Received: by mail-vc0-f173.google.com with SMTP id ia6so6742969vcb.32 for ; Fri, 29 Nov 2013 04:20:18 -0800 (PST) X-Received: by 10.58.156.106 with SMTP id wd10mr42544416veb.7.1385727618549; Fri, 29 Nov 2013 04:20:18 -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 u4csp87440vcz; Fri, 29 Nov 2013 04:20:18 -0800 (PST) X-Received: by 10.229.71.5 with SMTP id f5mr3314831qcj.18.1385727618199; Fri, 29 Nov 2013 04:20:18 -0800 (PST) Received: from mail-yh0-f47.google.com (mail-yh0-f47.google.com [209.85.213.47]) by mx.google.com with ESMTPS id o8si17252637qcj.66.2013.11.29.04.20.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:20:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.213.47 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.213.47; Received: by mail-yh0-f47.google.com with SMTP id 29so6591814yhl.20 for ; Fri, 29 Nov 2013 04:20:18 -0800 (PST) X-Received: by 10.236.43.141 with SMTP id l13mr710438yhb.167.1385727617981; Fri, 29 Nov 2013 04:20:17 -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 m29sm101911689yho.14.2013.11.29.04.20.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 04:20:17 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dwmw2@infradead.org Cc: linus.walleij@linaro.org, linux-mtd@lists.infradead.org, angus.clark@st.com, Lee Jones Subject: [PATCH v3 22/36] mtd: st_spi_fsm: Provide the default read/write configurations Date: Fri, 29 Nov 2013 12:19:11 +0000 Message-Id: <1385727565-25794-23-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1385727565-25794-1-git-send-email-lee.jones@linaro.org> References: <1385727565-25794-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.173 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. 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 9449005..0ecf248 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -28,6 +28,33 @@ #include "st_spi_fsm.h" #include "serial_flash_cmds.h" +/* + * 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 = {