From patchwork Thu Jul 20 07:48:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenyou Yang X-Patchwork-Id: 791479 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xCmvT5qv8z9s7h for ; Thu, 20 Jul 2017 18:16:37 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 8D774C21C38; Thu, 20 Jul 2017 08:16:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3BC94C21BE5; Thu, 20 Jul 2017 07:55:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 36BC6C21C57; Thu, 20 Jul 2017 07:55:10 +0000 (UTC) Received: from eusmtp01.atmel.com (eusmtp01.atmel.com [212.144.249.242]) by lists.denx.de (Postfix) with ESMTPS id DD951C21D56 for ; Thu, 20 Jul 2017 07:54:16 +0000 (UTC) Received: from apsmtp01.atmel.com (10.168.254.31) by eusmtp01.atmel.com (10.145.145.30) with Microsoft SMTP Server id 14.3.235.1; Thu, 20 Jul 2017 09:54:12 +0200 Received: from shaarm01.corp.atmel.com (10.168.254.13) by apsmtp01.atmel.com (10.168.254.31) with Microsoft SMTP Server id 14.3.235.1; Thu, 20 Jul 2017 15:56:07 +0800 From: Wenyou Yang To: U-Boot Mailing List Date: Thu, 20 Jul 2017 15:48:45 +0800 Message-ID: <20170720074849.6787-5-wenyou.yang@microchip.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170720074849.6787-1-wenyou.yang@microchip.com> References: <20170720074849.6787-1-wenyou.yang@microchip.com> MIME-Version: 1.0 Cc: Marek Vasut , Cyrille Pitchen , Jagan Teki Subject: [U-Boot] [PATCH v2 4/8] sf: differentiate Page Program 1-1-4 and 1-4-4 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Cyrille Pitchen This patch simply renames the ambiguous CMD_QUAD_PAGE_PROGRAM macro into the more explicit CMD_PAGE_PROGRAM_1_1_4. Also it defines the CMD_PAGE_PROGRAM_1_4_4 macro to the standard 38h op code. Signed-off-by: Cyrille Pitchen Signed-off-by: Wenyou Yang --- Changes in v2: None drivers/mtd/spi/sf_internal.h | 3 ++- drivers/mtd/spi/spi_flash.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h index 5c551089d6..8b8c951bcc 100644 --- a/drivers/mtd/spi/sf_internal.h +++ b/drivers/mtd/spi/sf_internal.h @@ -48,7 +48,8 @@ enum spi_nor_option_flags { #define CMD_PAGE_PROGRAM 0x02 #define CMD_WRITE_DISABLE 0x04 #define CMD_WRITE_ENABLE 0x06 -#define CMD_QUAD_PAGE_PROGRAM 0x32 +#define CMD_PAGE_PROGRAM_1_1_4 0x32 +#define CMD_PAGE_PROGRAM_1_4_4 0x38 /* Read commands */ #define CMD_READ_ARRAY_SLOW 0x03 diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 588e5729b4..8712e5eef0 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -1059,7 +1059,7 @@ int spi_flash_scan(struct spi_flash *flash) /* Look for write commands */ if (info->flags & WR_QPP && spi->mode & SPI_TX_QUAD) { - flash->write_cmd = CMD_QUAD_PAGE_PROGRAM; + flash->write_cmd = CMD_PAGE_PROGRAM_1_1_4; flash->write_proto = SPI_FPROTO_1_1_4; } else { /* Go for default supported write cmd */