From patchwork Tue Jan 24 13:52:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mark.marshall@omicronenergy.com X-Patchwork-Id: 719138 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v78mY4jmzz9ryv for ; Wed, 25 Jan 2017 00:54:05 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=omicronenergy.com header.i=@omicronenergy.com header.b="CrmvGgws"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cW1Xr-00084e-HE; Tue, 24 Jan 2017 13:53:59 +0000 Received: from ns.omicron.at ([212.183.10.25]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cW1XS-0007yA-IJ for linux-mtd@lists.infradead.org; Tue, 24 Jan 2017 13:53:36 +0000 Received: from MGW01-ATKLA.omicron.at ([172.25.62.34]) by ns.omicron.at (8.15.2/8.15.2) with ESMTPS id v0ODqRFs018576 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA256 bits=256 verify=FAIL); Tue, 24 Jan 2017 14:52:27 +0100 DKIM-Filter: OpenDKIM Filter v2.10.3 ns.omicron.at v0ODqRFs018576 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omicronenergy.com; s=default; t=1485265948; bh=eOCa0nDfnWfi5FAcNrLVFBjw37GjiN2+srA9qc9CwN4=; h=From:To:CC:Subject:Date:From; b=CrmvGgwsqoSkIbwkOfBQ7QYOT/1zSCV2mzxa+hJiHCoV+yutGecwZnJOQ6d9gYti1 SPZcuRJ/6KK3KXhDyr97wz7uFnt65HQ90UzL4jTMVRZFA9RGq3JIsFlFP+gCgOSeOC StD8sahz1CKpl94Kbj9Xj2YhOLJCe4Io81JT5LVw= Received: from EXC01-ATKLA.omicron.at ([172.22.100.185]) by MGW01-ATKLA.omicron.at with ESMTP id v0ODqR0l007005-v0ODqR0n007005 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=CAFAIL); Tue, 24 Jan 2017 14:52:27 +0100 Received: from marmar13.omicron.at (172.22.32.163) by EXC01-ATKLA.omicron.at (172.22.100.185) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 24 Jan 2017 14:52:26 +0100 From: To: , Subject: [PATCH] m25p80: Use a 512 byte page size for Spansion flash s25fl512s Date: Tue, 24 Jan 2017 14:52:09 +0100 Message-ID: <1485265929-24020-1-git-send-email-mark.marshall@omicronenergy.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [172.22.32.163] X-ClientProxiedBy: EXC01-ATKLA.omicron.at (172.22.100.185) To EXC01-ATKLA.omicron.at (172.22.100.185) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170124_055334_953809_44F47AAB X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.183.10.25 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.brezillon@free-electrons.com, markmarshall14@gmail.com, richard@nod.at, Mark Marshall , marek.vasut@gmail.com, cyrille.pitchen@atmel.com, dwmw2@infradead.org Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Mark Marshall The s25fl512s flash from Spansion has a 512 byte write page size, which means that we can write 512 bytes at a time (instead of 256). This single change makes writing to the flash about 2x faster. Signed-off-by: Mark Marshall --- drivers/mtd/spi-nor/spi-nor.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index da7cd69..c9ac0bf 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -775,6 +775,21 @@ static int spi_nor_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) .page_size = 256, \ .flags = (_flags), +/* Used to set a custom (non 256) page_size */ +#define INFOP(_jedec_id, _ext_id, _sector_size, _n_sectors, _pg_sz, _flags) \ + .id = { \ + ((_jedec_id) >> 16) & 0xff, \ + ((_jedec_id) >> 8) & 0xff, \ + (_jedec_id) & 0xff, \ + ((_ext_id) >> 8) & 0xff, \ + (_ext_id) & 0xff, \ + }, \ + .id_len = (!(_jedec_id) ? 0 : (3 + ((_ext_id) ? 2 : 0))), \ + .sector_size = (_sector_size), \ + .n_sectors = (_n_sectors), \ + .page_size = (_pg_sz), \ + .flags = (_flags), \ + #define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width, _flags) \ .sector_size = (_sector_size), \ .n_sectors = (_n_sectors), \ @@ -905,7 +920,7 @@ static const struct flash_info spi_nor_ids[] = { { "s25sl064p", INFO(0x010216, 0x4d00, 64 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "s25fl256s0", INFO(0x010219, 0x4d00, 256 * 1024, 128, 0) }, { "s25fl256s1", INFO(0x010219, 0x4d01, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, - { "s25fl512s", INFO(0x010220, 0x4d00, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { "s25fl512s", INFOP(0x010220, 0x4d00, 256 * 1024, 256, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "s70fl01gs", INFO(0x010221, 0x4d00, 256 * 1024, 256, 0) }, { "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64, 0) }, { "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256, 0) },