From patchwork Wed Sep 4 15:14:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Burton X-Patchwork-Id: 272652 X-Patchwork-Delegate: panto@antoniou-consulting.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 967712C007C for ; Thu, 5 Sep 2013 01:15:27 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BCA0F4A0AE; Wed, 4 Sep 2013 17:15:04 +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 cVEWMFtC7cVM; Wed, 4 Sep 2013 17:15:04 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0490E4A092; Wed, 4 Sep 2013 17:14:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5D4354A08E for ; Wed, 4 Sep 2013 17:14:27 +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 V9j-ch-njM-1 for ; Wed, 4 Sep 2013 17:14:26 +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 multi.imgtec.com (multi.imgtec.com [194.200.65.239]) by theia.denx.de (Postfix) with ESMTPS id 069744A08F for ; Wed, 4 Sep 2013 17:14:17 +0200 (CEST) From: Paul Burton To: Date: Wed, 4 Sep 2013 16:14:03 +0100 Message-ID: <1378307643-17095-1-git-send-email-paul.burton@imgtec.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1378307547-16984-1-git-send-email-paul.burton@imgtec.com> References: <1378307547-16984-1-git-send-email-paul.burton@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.152.22] X-SEF-Processed: 7_3_0_01192__2013_09_04_16_14_17 Cc: panto@antoniou-consulting.com Subject: [U-Boot] [PATCH 5/5] mmc: don't support write & erase for SPL builds 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 For SPL builds this is just dead code since we'll only need to read. Eliminating it results in a significant size reduction for the SPL binary. Signed-off-by: Paul Burton --- drivers/mmc/mmc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 30a985b..d305257 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -248,6 +248,7 @@ err_out: static unsigned long mmc_berase(int dev_num, lbaint_t start, lbaint_t blkcnt) { +#ifndef CONFIG_SPL_BUILD int err = 0; struct mmc *mmc = find_mmc_device(dev_num); lbaint_t blk = 0, blk_r = 0; @@ -281,6 +282,9 @@ mmc_berase(int dev_num, lbaint_t start, lbaint_t blkcnt) } return blk; +#else /* CONFIG_SPL_BUILD */ + return -1; +#endif } static ulong @@ -349,6 +353,7 @@ mmc_write_blocks(struct mmc *mmc, lbaint_t start, lbaint_t blkcnt, const void*sr static ulong mmc_bwrite(int dev_num, lbaint_t start, lbaint_t blkcnt, const void*src) { +#ifndef CONFIG_SPL_BUILD lbaint_t cur, blocks_todo = blkcnt; struct mmc *mmc = find_mmc_device(dev_num); @@ -368,6 +373,9 @@ mmc_bwrite(int dev_num, lbaint_t start, lbaint_t blkcnt, const void*src) } while (blocks_todo > 0); return blkcnt; +#else /* CONFIG_SPL_BUILD */ + return 0; +#endif } static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,