All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jagan Teki <jteki@openedev.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 6/8] sf: Add SECT_4K_PMC
Date: Sat, 19 Dec 2015 19:43:36 +0530	[thread overview]
Message-ID: <1450534418-5007-7-git-send-email-jteki@openedev.com> (raw)
In-Reply-To: <1450534418-5007-1-git-send-email-jteki@openedev.com>

Add SECT_4K_PMC for erase 4KiB block on PMC chips.

Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Jagan Teki <jteki@openedev.com>
---
 drivers/mtd/spi/sf_internal.h | 1 +
 drivers/mtd/spi/spi_flash.c   | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 4b3a553..62f419f 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -67,6 +67,7 @@ enum spi_nor_option_flags {
 
 /* Erase commands */
 #define CMD_ERASE_4K			0x20
+#define CMD_ERASE_4K_PMC		0xd7
 #define CMD_ERASE_32K			0x52
 #define CMD_ERASE_CHIP			0xc7
 #define CMD_ERASE_64K			0xd8
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 2b1ea6f..98c8cfe 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -1382,6 +1382,9 @@ int spi_flash_scan(struct spi_flash *flash)
 	if (info->flags & SECT_4K) {
 		flash->erase_cmd = CMD_ERASE_4K;
 		flash->erase_size = 4096 << flash->shift;
+	} else if (info->flags & SECT_4K_PMC) {
+		flash->erase_cmd = CMD_ERASE_4K_PMC;
+		flash->erase_size = 4096;
 	} else {
 		flash->erase_cmd = CMD_ERASE_64K;
 		flash->erase_size = flash->sector_size;
-- 
1.9.1

  parent reply	other threads:[~2015-12-19 14:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-19 14:13 [U-Boot] [PATCH 0/8] sf: Add flash_ids inside Core Jagan Teki
2015-12-19 14:13 ` [U-Boot] [PATCH 1/8] sf: Add spi_flash_ids local to core Jagan Teki
2015-12-28  4:22   ` Simon Glass
2015-12-28 14:08     ` Jagan Teki
2015-12-19 14:13 ` [U-Boot] [PATCH 2/8] sf: Rename SST_WR to SST_WRITE Jagan Teki
2015-12-19 14:13 ` [U-Boot] [PATCH 3/8] sf: Remove SPI_NOR_DUAL|QUAD_READ Jagan Teki
2015-12-19 14:13 ` [U-Boot] [PATCH 4/8] sf: Use sf_params in sandbox Jagan Teki
2015-12-19 14:13 ` [U-Boot] [PATCH 5/8] sf: Remove SECT_32K Jagan Teki
2015-12-19 14:13 ` Jagan Teki [this message]
2015-12-19 14:13 ` [U-Boot] [PATCH 7/8] sf: Use CONFIG_SPI_FLASH_USE_4K_SECTORS Jagan Teki
2015-12-19 14:13 ` [U-Boot] [PATCH 8/8] sf: Fix few naming convension for read modes Jagan Teki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450534418-5007-7-git-send-email-jteki@openedev.com \
    --to=jteki@openedev.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.