From patchwork Thu Jan 23 10:31:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 23593 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C7C4D218BD for ; Thu, 23 Jan 2014 10:32:38 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 20sf6449515yks.0 for ; Thu, 23 Jan 2014 02:32:37 -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=AoScL1hXgdk+54n6xNHHVXW9muxqv07NmFWwOlysHVU=; b=FNM+ezceFzCKwP8dlxJHKKcOi8e3y3r/n+VO7VSy+uc8CrcGUyFjTrkIfDe1BjCFsb roDA9HUc08UKnVaGPJPO6i3TMRaawdMyTcXNJNUQuaDGVe8pDGZ6cRhjiEDfSPXryqop wkF6OfRc6DVXJxS/W0y4Q9CkO8Y+l9nHXbNgdASo8piWy+6vXB7Xb/EpjcVxU/70nBRw LSks+4tPeCam0NRulWX1MVMroHXRdD8VMkCfDjMkWRhfRNPaJ9pFIULrzlE52EhAUoWQ qet53hOD68xT6QGnRxhjboRxtyLzvG263IissQ2fFfe2tZrqpBAlJKjl8mGFkFWzI+lF LIBA== X-Gm-Message-State: ALoCoQnMlrv/QCzxHZY+lXpc5kgSOCsmzTGIcQcjhTJyjjH8IiXmrT9LlA71/0fvK9hMGi+vOhdf X-Received: by 10.236.14.100 with SMTP id c64mr2489482yhc.38.1390473157939; Thu, 23 Jan 2014 02:32:37 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.100.146 with SMTP id s18ls272702qge.8.gmail; Thu, 23 Jan 2014 02:32:37 -0800 (PST) X-Received: by 10.220.99.7 with SMTP id s7mr4068641vcn.19.1390473157746; Thu, 23 Jan 2014 02:32:37 -0800 (PST) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id mj10si6435471vcb.12.2014.01.23.02.32.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:32:37 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.182 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.182; Received: by mail-ve0-f182.google.com with SMTP id jy13so999673veb.27 for ; Thu, 23 Jan 2014 02:32:37 -0800 (PST) X-Received: by 10.220.58.202 with SMTP id i10mr4123134vch.23.1390473157666; Thu, 23 Jan 2014 02:32:37 -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 u4csp15967vcz; Thu, 23 Jan 2014 02:32:37 -0800 (PST) X-Received: by 10.195.12.164 with SMTP id er4mr387570wjd.92.1390473156739; Thu, 23 Jan 2014 02:32:36 -0800 (PST) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by mx.google.com with ESMTPS id ed5si383943wib.11.2014.01.23.02.32.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:32:36 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.42 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.42; Received: by mail-wg0-f42.google.com with SMTP id l18so412571wgh.5 for ; Thu, 23 Jan 2014 02:32:36 -0800 (PST) X-Received: by 10.194.219.1 with SMTP id pk1mr6096703wjc.36.1390473156305; Thu, 23 Jan 2014 02:32:36 -0800 (PST) Received: from localhost.localdomain ([80.76.198.141]) by mx.google.com with ESMTPSA id ay6sm21257831wjb.23.2014.01.23.02.32.34 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Jan 2014 02:32:35 -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 22/37] mtd: st_spi_fsm: Provide the default read/write configurations Date: Thu, 23 Jan 2014 10:31:10 +0000 Message-Id: <1390473085-24626-23-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.128.182 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 d009e1b..5582df0 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -411,6 +411,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 = {