From patchwork Tue Dec 29 09:49:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 561515 X-Patchwork-Delegate: bmeng.cn@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 69C70140C2A for ; Tue, 29 Dec 2015 20:51:54 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B25024BA43; Tue, 29 Dec 2015 10:51:12 +0100 (CET) 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 tDlzgNyajClk; Tue, 29 Dec 2015 10:51:12 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8AE9C4B81F; Tue, 29 Dec 2015 10:51:01 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 465B04BA51 for ; Tue, 29 Dec 2015 10:50:51 +0100 (CET) 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 6xEKaZ5ncxTC for ; Tue, 29 Dec 2015 10:50:51 +0100 (CET) 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 mail-pa0-f65.google.com (mail-pa0-f65.google.com [209.85.220.65]) by theia.denx.de (Postfix) with ESMTPS id 183E24B9D7 for ; Tue, 29 Dec 2015 10:50:34 +0100 (CET) Received: by mail-pa0-f65.google.com with SMTP id pv5so8792614pac.0 for ; Tue, 29 Dec 2015 01:50:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eWqNM1964h+kUEzBxUYZnUDnPtGZKKZwTP9QYP8OnZw=; b=lmffgKG8/m3IQMxKyOLak+1CudvA8bATMSy8sWVa2o2cucsK1Z7IHTnwrODNoFnmTh UcIR7a4jhPP3Fet4NMoSu6RvtyWPBlEvDXg8F7GdgdnbvaYb/jvvr9oygx7kyMsoBxba 6L6gWlAlSg4nG37yZrNRpJBORAM8t2qCY8pAJC9sFp7sycuv86/nytaFx+MOuzGuGD70 AxDGubuSfKaBBXQOrMZof+JQTgyZ3ym1AWE2Fkk0xCe8GdYnsqxInW8DKd/eiYy4CQbY RhOFRhh1goiQwRrta8GVcZX2gfcmsx2C5R8ysg4spWB8HB5TXa0C+iz40XU3cUNAvaPK cJ2g== X-Received: by 10.66.55.6 with SMTP id n6mr84804099pap.33.1451382633254; Tue, 29 Dec 2015 01:50:33 -0800 (PST) Received: from Jubuntu.amcc.com ([182.73.239.130]) by smtp.gmail.com with ESMTPSA id m3sm53434870pfi.87.2015.12.29.01.50.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Dec 2015 01:50:32 -0800 (PST) From: Jagan Teki To: u-boot@lists.denx.de Date: Tue, 29 Dec 2015 15:19:52 +0530 Message-Id: <1451382594-29532-7-git-send-email-jteki@openedev.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451382594-29532-1-git-send-email-jteki@openedev.com> References: <1451382594-29532-1-git-send-email-jteki@openedev.com> Cc: Michal Simek , Siva Durga Prasad Paladugu , Jagan Teki Subject: [U-Boot] [PATCH v2 6/8] sf: Add SECT_4K_PMC X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add SECT_4K_PMC for erase 4KiB block on PMC chips. Cc: Simon Glass Cc: Bin Meng CC: Mugunthan V N Cc: Michal Simek Cc: Siva Durga Prasad Paladugu Signed-off-by: Jagan Teki --- 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 8eaadd7..75513b0 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 63c53c2..c3113bc 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;