From patchwork Tue Dec 29 09:49:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 561517 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 63B4F140C2A for ; Tue, 29 Dec 2015 20:52:26 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 781024BA81; Tue, 29 Dec 2015 10:51:23 +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 ezSwOCDKU1Cx; Tue, 29 Dec 2015 10:51:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5350E4BA82; Tue, 29 Dec 2015 10:51:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 92DEC4BA3F 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 plcNnDedSQ6d 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-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by theia.denx.de (Postfix) with ESMTPS id 736434B9F1 for ; Tue, 29 Dec 2015 10:50:44 +0100 (CET) Received: by mail-pf0-f193.google.com with SMTP id 65so8155275pff.1 for ; Tue, 29 Dec 2015 01:50:44 -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=n0wJzW4S3l/9B2/GkNUiTc6rzjjYxBIi9E/mTD8sZVU=; b=VsUvIKIRZL7T+glmJlpfWmzf2TYoPtQS1HnsSWhCsUPs6vRksC6xv8tXNOBFHl8f2i 67wTMG7xIod5Ot+FDk7LFA9n1EsXzB2zTiPtZ5qM8EKB0aOkkk+MjPBuXEXBKNRN+5R1 BpW74pm1QdbYk8dO2FClIiFXAgU5JJToiHsEQwOYaTZIKzgoJxjF6qMSp7Dvhc/Td+Nm GgWgHCG809qARiGwhkRRtJHizsSWFdwjrbTWJTM/Z7yI4ZZLF+S0CR8DWfBMw8xe9668 SaOtjWCF29CyYe2etTg6TXxX9+eg4newjr5yv+3uBVxgF/nl6vdPaTArS5h9MvzKZIEi e6Jw== X-Received: by 10.98.64.27 with SMTP id n27mr40372748pfa.141.1451382643199; Tue, 29 Dec 2015 01:50:43 -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.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Dec 2015 01:50:41 -0800 (PST) From: Jagan Teki To: u-boot@lists.denx.de Date: Tue, 29 Dec 2015 15:19:54 +0530 Message-Id: <1451382594-29532-9-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 8/8] sf: Fix few naming convension for read modes 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" spi_read_cmds => read_mode e_rd_cmd => flash_read spi_read_cmds_array => flash_read_cmd All these are flash specific notation used in spi_flash core hence renamed to proper naming convensions related to flash. 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 | 2 +- drivers/mtd/spi/spi_flash.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h index 75513b0..89176db 100644 --- a/drivers/mtd/spi/sf_internal.h +++ b/drivers/mtd/spi/sf_internal.h @@ -21,7 +21,7 @@ enum spi_dual_flash { }; /* Enum list - Full read commands */ -enum spi_read_cmds { +enum read_mode { ARRAY_SLOW = BIT(0), ARRAY_FAST = BIT(1), DUAL_OUTPUT_FAST = BIT(2), diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 2a7983c..95c1d46 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -44,7 +44,7 @@ struct flash_info { u16 addr_width; /* Enum list for read commands */ - enum spi_read_cmds e_rd_cmd; + enum read_mode flash_read; u16 flags; #define SECT_4K 0x01 /* SPINOR_OP_BE_4K works uniformly */ @@ -868,7 +868,7 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len) #endif /* Used when the "_ext_id" is two bytes at most */ -#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _e_rd_cmd, _flags) \ +#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flash_read, _flags) \ .id = { \ ((_jedec_id) >> 16) & 0xff, \ ((_jedec_id) >> 8) & 0xff, \ @@ -880,10 +880,10 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len) .sector_size = (_sector_size), \ .n_sectors = (_n_sectors), \ .page_size = 256, \ - .e_rd_cmd = _e_rd_cmd, \ + .flash_read = _flash_read, \ .flags = (_flags), -#define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors, _e_rd_cmd, _flags) \ +#define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors, _flash_read, _flags) \ .id = { \ ((_jedec_id) >> 16) & 0xff, \ ((_jedec_id) >> 8) & 0xff, \ @@ -896,15 +896,15 @@ int stm_unlock(struct spi_flash *flash, u32 ofs, size_t len) .sector_size = (_sector_size), \ .n_sectors = (_n_sectors), \ .page_size = 256, \ - .e_rd_cmd = _e_rd_cmd, \ + .flash_read = _flash_read, \ .flags = (_flags), -#define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width, _e_rd_cmd, _flags) \ +#define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width, _flash_read, _flags) \ .sector_size = (_sector_size), \ .n_sectors = (_n_sectors), \ .page_size = (_page_size), \ .addr_width = (_addr_width), \ - .e_rd_cmd = _e_rd_cmd, \ + .flash_read = _flash_read, \ .flags = (_flags), /* NOTE: double check command sets and memory organization when you add @@ -1297,7 +1297,7 @@ int spi_flash_scan(struct spi_flash *flash) { struct spi_slave *spi = flash->spi; const struct flash_info *info = NULL; - static u8 spi_read_cmds_array[] = { + static u8 flash_read_cmd[] = { CMD_READ_ARRAY_SLOW, CMD_READ_ARRAY_FAST, CMD_READ_DUAL_OUTPUT_FAST, @@ -1397,9 +1397,9 @@ int spi_flash_scan(struct spi_flash *flash) flash->sector_size = flash->erase_size; /* Look for the fastest read cmd */ - cmd = fls(info->e_rd_cmd & spi->mode_rx); + cmd = fls(info->flash_read & spi->mode_rx); if (cmd) { - cmd = spi_read_cmds_array[cmd - 1]; + cmd = flash_read_cmd[cmd - 1]; flash->read_cmd = cmd; } else { /* Go for default supported read cmd */