From patchwork Thu Mar 20 09:20:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 26652 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 16096202E0 for ; Thu, 20 Mar 2014 09:22:00 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf1428620qcq.4 for ; Thu, 20 Mar 2014 02:22:00 -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=YgwYCn/jMC+wINIe6OiZOazbCcZcLiwxhUtiulEKXqE=; b=fdiMICupP5GZggOY6XElA1qWhNI/G34BtagOeaBh5u1LPmRZVZBE04HDYDXTIdaQaq ICUalDjoLkVSDL0jZImZvRUORkeutdHVQqOyBAWVoEXS3ndV2QDwkjXlCjn5/zKfLwO2 gYwjfcGlz7Z5y0xeUIjpmuN/jJA+bnShrieNlzV/IsfOXwGx6xcNzyZjOtu8XN0CXC6b PX9+XCph1u0zX34iHz4s9uUXSgbTI1ju7N0zDy8RVvi1SF/Cdaq7OPwN1eRnKeLXjnI+ 86AIbXaeoJYPduKH/7jF8vySU3d6eLF1K2W/9Nc+OZm1dLpxLhixdMmUxqQsGJBCq222 qtOw== X-Gm-Message-State: ALoCoQlDBp7p2GInHpe0gWYvDVhcjnL5mnfL+OVz3XAHHtMG2BBsP3HHQa782PRDyViucQ34M7uS X-Received: by 10.58.198.3 with SMTP id iy3mr7505173vec.39.1395307320814; Thu, 20 Mar 2014 02:22:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.33 with SMTP id c30ls179151qge.9.gmail; Thu, 20 Mar 2014 02:22:00 -0700 (PDT) X-Received: by 10.220.188.10 with SMTP id cy10mr3280952vcb.36.1395307320643; Thu, 20 Mar 2014 02:22:00 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id 16si298026vce.12.2014.03.20.02.22.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:22:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 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.174; Received: by mail-ve0-f174.google.com with SMTP id oz11so599717veb.33 for ; Thu, 20 Mar 2014 02:22:00 -0700 (PDT) X-Received: by 10.52.147.238 with SMTP id tn14mr28140812vdb.23.1395307320564; Thu, 20 Mar 2014 02:22:00 -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 i9csp372543vck; Thu, 20 Mar 2014 02:21:59 -0700 (PDT) X-Received: by 10.194.48.80 with SMTP id j16mr7042960wjn.44.1395307319118; Thu, 20 Mar 2014 02:21:59 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id he7si861124wjc.26.2014.03.20.02.21.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:21:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.178; Received: by mail-wi0-f178.google.com with SMTP id bs8so486564wib.11 for ; Thu, 20 Mar 2014 02:21:58 -0700 (PDT) X-Received: by 10.181.13.82 with SMTP id ew18mr23366107wid.22.1395307318437; Thu, 20 Mar 2014 02:21:58 -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.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 02:21:57 -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 19/36] mtd: st_spi_fsm: Provide a method to put the chip into 32bit addressing mode Date: Thu, 20 Mar 2014 09:20:51 +0000 Message-Id: <1395307268-12721-20-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.128.174 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: , Most Serial Flash chips support 24bit addressing as a default but more recent incarnations can support 32bit. Based on information provided though platform specific data and capabilities we can determine whether or not our current chip can. This patch provides a means to setup the FSM message sequence to put the chip into 32bit mode. Acked-by Angus Clark Signed-off-by: Lee Jones --- drivers/mtd/devices/st_spi_fsm.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index 7cc4425..0a5b702 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -375,6 +375,8 @@ static struct flash_info flash_types[] = { { NULL, 0x000000, 0, 0, 0, 0, 0, NULL }, }; +static struct stfsm_seq stfsm_seq_en_32bit_addr;/* Dynamically populated */ + static struct stfsm_seq stfsm_seq_read_jedec = { .data_size = TRANSFER_SIZE(8), .seq_opc[0] = (SEQ_OPC_PADS_1 | @@ -523,6 +525,23 @@ static void stfsm_read_fifo(struct stfsm *fsm, uint32_t *buf, } } +static int stfsm_enter_32bit_addr(struct stfsm *fsm, int enter) +{ + struct stfsm_seq *seq = &stfsm_seq_en_32bit_addr; + uint32_t cmd = enter ? FLASH_CMD_EN4B_ADDR : FLASH_CMD_EX4B_ADDR; + + seq->seq_opc[0] = (SEQ_OPC_PADS_1 | + SEQ_OPC_CYCLES(8) | + SEQ_OPC_OPCODE(cmd) | + SEQ_OPC_CSDEASSERT); + + stfsm_load_seq(fsm, seq); + + stfsm_wait_seq(fsm); + + return 0; +} + /* * SoC reset on 'boot-from-spi' systems *