From patchwork Tue Aug 6 16:17:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagannadha Sutradharudu Teki X-Patchwork-Id: 265138 X-Patchwork-Delegate: jagannadh.teki@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 354792C0C76 for ; Wed, 7 Aug 2013 02:21:45 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 425994A02F; Tue, 6 Aug 2013 18:20:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 MbOmgNerNmgd; Tue, 6 Aug 2013 18:20:56 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BF5834A03E; Tue, 6 Aug 2013 18:19:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DC7C24A096 for ; Tue, 6 Aug 2013 18:18:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 Z6Q72HMVPMvK for ; Tue, 6 Aug 2013 18:18:50 +0200 (CEST) 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 co1outboundpool.messaging.microsoft.com (co1ehsobe006.messaging.microsoft.com [216.32.180.189]) by theia.denx.de (Postfix) with ESMTPS id 4026E4A03F for ; Tue, 6 Aug 2013 18:18:25 +0200 (CEST) Received: from mail142-co1-R.bigfish.com (10.243.78.237) by CO1EHSOBE021.bigfish.com (10.243.66.84) with Microsoft SMTP Server id 14.1.225.22; Tue, 6 Aug 2013 16:18:21 +0000 Received: from mail142-co1 (localhost [127.0.0.1]) by mail142-co1-R.bigfish.com (Postfix) with ESMTP id 0CC1818024A; Tue, 6 Aug 2013 16:18:21 +0000 (UTC) X-Forefront-Antispam-Report: CIP:149.199.60.83; KIP:(null); UIP:(null); IPV:NLI; H:xsj-gw1; RD:unknown-60-83.xilinx.com; EFVD:NLI X-SpamScore: 2 X-BigFish: VPS2(z551bizzz1f42h208ch1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz1de098h8275bh1de097hz2fh95h668h839hd24hf0ah119dh1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1e23h906i1155h192ch) Received-SPF: pass (mail142-co1: domain of xilinx.com designates 149.199.60.83 as permitted sender) client-ip=149.199.60.83; envelope-from=jagannadha.sutradharudu-teki@xilinx.com; helo=xsj-gw1 ; helo=xsj-gw1 ; Received: from mail142-co1 (localhost.localdomain [127.0.0.1]) by mail142-co1 (MessageSwitch) id 1375805898804441_27461; Tue, 6 Aug 2013 16:18:18 +0000 (UTC) Received: from CO1EHSMHS004.bigfish.com (unknown [10.243.78.226]) by mail142-co1.bigfish.com (Postfix) with ESMTP id B651D200064; Tue, 6 Aug 2013 16:18:18 +0000 (UTC) Received: from xsj-gw1 (149.199.60.83) by CO1EHSMHS004.bigfish.com (10.243.66.14) with Microsoft SMTP Server id 14.16.227.3; Tue, 6 Aug 2013 16:18:16 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-smtp1.xilinx.com) by xsj-gw1 with esmtp (Exim 4.63) (envelope-from ) id 1V6jxg-0006vX-OM; Tue, 06 Aug 2013 09:18:16 -0700 From: Jagannadha Sutradharudu Teki To: Date: Tue, 6 Aug 2013 21:47:28 +0530 X-Mailer: git-send-email 1.8.3 In-Reply-To: <1375805851-32163-1-git-send-email-jaganna@xilinx.com> References: <1375805851-32163-1-git-send-email-jaganna@xilinx.com> X-RCIS-Action: ALLOW MIME-Version: 1.0 Message-ID: X-OriginatorOrg: xilinx.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: "Todd Legler (tlegler)" , Willis Max , Jagannadha Sutradharudu Teki , Syed@theia.denx.de, Hussain , Rajeshwari Shinde , Tom Rini Subject: [U-Boot] [RESEND PATCH v2 17/20] sf: Add proper comment style on spi_flash structure X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Added proper comment style on spi_flash structure to make more readable. Signed-off-by: Jagannadha Sutradharudu Teki --- Changes for v2: - none include/spi_flash.h | 63 +++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/include/spi_flash.h b/include/spi_flash.h index 14e4ae2..34a167b 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -37,39 +37,46 @@ # define CMD_SST_AAI_WP 0xAD /* Auto Address Incr Word Program */ #endif +/** + * struct spi_flash - SPI flash structure + * + * @spi: SPI slave + * @name: Name of SPI flash + * @size: Total flash size + * @page_size: Write (page) size + * @sector_size: Sector size + * @erase_size: Erase size + * @bank_read_cmd: Bank read cmd + * @bank_write_cmd: Bank write cmd + * @bank_curr: Current flash bank + * @poll_cmd: Poll cmd - for flash erase/program + * @erase_cmd: Erase cmd 4K, 32K, 64K + * @memory_map: Address of read-only SPI flash access + * @read: Flash read ops + * @write: Flash write ops + * @erase: Flash erase ops + */ struct spi_flash { struct spi_slave *spi; + const char *name; - const char *name; - - /* Total flash size */ - u32 size; - /* Write (page) size */ - u32 page_size; - /* Sector size */ - u32 sector_size; - /* Erase size */ - u32 erase_size; + u32 size; + u32 page_size; + u32 sector_size; + u32 erase_size; #ifdef CONFIG_SPI_FLASH_BAR - /* Bank read cmd */ - u8 bank_read_cmd; - /* Bank write cmd */ - u8 bank_write_cmd; - /* Current flash bank */ - u8 bank_curr; + u8 bank_read_cmd; + u8 bank_write_cmd; + u8 bank_curr; #endif - /* Poll cmd - for flash erase/program */ - u8 poll_cmd; - /* Erase cmd 4K, 32K, 64K */ - u8 erase_cmd; - - void *memory_map; /* Address of read-only SPI flash access */ - int (*read)(struct spi_flash *flash, u32 offset, - size_t len, void *buf); - int (*write)(struct spi_flash *flash, u32 offset, - size_t len, const void *buf); - int (*erase)(struct spi_flash *flash, u32 offset, - size_t len); + u8 poll_cmd; + u8 erase_cmd; + + void *memory_map; + int (*read)(struct spi_flash *flash, u32 offset, size_t len, void *buf); + int (*write)(struct spi_flash *flash, u32 offset, size_t len, + const void *buf); + int (*erase)(struct spi_flash *flash, u32 offset, size_t len); }; /**