From patchwork Mon Jul 29 15:23:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagannadha Sutradharudu Teki X-Patchwork-Id: 262839 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 8C85A2C00FB for ; Tue, 30 Jul 2013 01:40:08 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 895014A047; Mon, 29 Jul 2013 17:39:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YS4cTxtW0deK; Mon, 29 Jul 2013 17:39:56 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9E5554A025; Mon, 29 Jul 2013 17:39:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6DD734A02F for ; Mon, 29 Jul 2013 17:39:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e-u2DnOFNhC5 for ; Mon, 29 Jul 2013 17:39:29 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from am1outboundpool.messaging.microsoft.com (am1ehsobe004.messaging.microsoft.com [213.199.154.207]) by theia.denx.de (Postfix) with ESMTPS id 32B864A025 for ; Mon, 29 Jul 2013 17:39:17 +0200 (CEST) Received: from mail11-am1-R.bigfish.com (10.3.201.236) by AM1EHSOBE022.bigfish.com (10.3.207.144) with Microsoft SMTP Server id 14.1.225.22; Mon, 29 Jul 2013 15:24:08 +0000 Received: from mail11-am1 (localhost [127.0.0.1]) by mail11-am1-R.bigfish.com (Postfix) with ESMTP id E82FC200A1; Mon, 29 Jul 2013 15:24:07 +0000 (UTC) X-Forefront-Antispam-Report: CIP:149.199.60.83; KIP:(null); UIP:(null); IPV:NLI; H:xsj-gw1; RD:unknown-60-83.xilinx.com; EFVD:NLI X-SpamScore: 1 X-BigFish: VPS1(z5105hzzz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz1de098h8275bh1de097hz2fh95h668h839hd24hf0ah119dh1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1e23h906i1155h192ch) Received-SPF: pass (mail11-am1: domain of xilinx.com designates 149.199.60.83 as permitted sender) client-ip=149.199.60.83; envelope-from=jagannadha.sutradharudu-teki@xilinx.com; helo=xsj-gw1 ; helo=xsj-gw1 ; Received: from mail11-am1 (localhost.localdomain [127.0.0.1]) by mail11-am1 (MessageSwitch) id 1375111446254881_14041; Mon, 29 Jul 2013 15:24:06 +0000 (UTC) Received: from AM1EHSMHS001.bigfish.com (unknown [10.3.201.248]) by mail11-am1.bigfish.com (Postfix) with ESMTP id 38E2C24004A; Mon, 29 Jul 2013 15:24:06 +0000 (UTC) Received: from xsj-gw1 (149.199.60.83) by AM1EHSMHS001.bigfish.com (10.3.207.101) with Microsoft SMTP Server id 14.16.227.3; Mon, 29 Jul 2013 15:24:04 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-smtp1.xilinx.com) by xsj-gw1 with esmtp (Exim 4.63) (envelope-from ) id 1V3pIp-0008GP-HL; Mon, 29 Jul 2013 08:24:03 -0700 From: Jagannadha Sutradharudu Teki To: Date: Mon, 29 Jul 2013 20:53:40 +0530 X-Mailer: git-send-email 1.8.3 In-Reply-To: <1375111423-31385-1-git-send-email-jaganna@xilinx.com> References: <1375111423-31385-1-git-send-email-jaganna@xilinx.com> X-RCIS-Action: ALLOW MIME-Version: 1.0 Message-ID: <24d9edeb-836e-494d-a328-6b7bcada097a@AM1EHSMHS001.ehs.local> X-OriginatorOrg: xilinx.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: Willis Max , Jagannadha Sutradharudu Teki , "Todd Legler \(tlegler\)" , Tom Rini Subject: [U-Boot] [PATCH 2/5] sf: spansion|stmicro: Enable dual parallel access X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Dual parallel accessing can be done by updating flash part attributes like page_size*2, sector_size*2 Signed-off-by: Jagannadha Sutradharudu Teki --- drivers/mtd/spi/spansion.c | 6 ++++++ drivers/mtd/spi/stmicro.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/mtd/spi/spansion.c b/drivers/mtd/spi/spansion.c index 47a4897..a4ea16b 100644 --- a/drivers/mtd/spi/spansion.c +++ b/drivers/mtd/spi/spansion.c @@ -134,6 +134,12 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode) flash->page_size = 256; flash->sector_size = 256 * params->pages_per_sector; + + if (flash->spi->is_dual == SPI_FLASH_CONN_DUALPARALLEL) { + flash->page_size *= 2; + flash->sector_size *= 2; + } + flash->size = flash->sector_size * params->nr_sectors; return flash; diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c index 0ca00f1..e9b4bc6 100644 --- a/drivers/mtd/spi/stmicro.c +++ b/drivers/mtd/spi/stmicro.c @@ -192,6 +192,12 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode) flash->page_size = 256; flash->sector_size = 256 * params->pages_per_sector; + + if (flash->spi->is_dual == SPI_FLASH_CONN_DUALPARALLEL) { + flash->page_size *= 2; + flash->sector_size *= 2; + } + flash->size = flash->sector_size * params->nr_sectors; /* for >= 512MiB flashes, use flag status instead of read_status */