From patchwork Wed Sep 21 07:25:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 115696 X-Patchwork-Delegate: promsoft@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 90274B6F8D for ; Wed, 21 Sep 2011 17:26:13 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9772728300; Wed, 21 Sep 2011 09:26:10 +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 Yr9HSqw25M92; Wed, 21 Sep 2011 09:26:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5A78228302; Wed, 21 Sep 2011 09:25:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9994F282DE for ; Wed, 21 Sep 2011 09:25:44 +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 LBFvqK8Orqr5 for ; Wed, 21 Sep 2011 09:25:42 +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 mail-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by theia.denx.de (Postfix) with ESMTPS id C6A30282E5 for ; Wed, 21 Sep 2011 09:25:34 +0200 (CEST) Received: by mail-yx0-f172.google.com with SMTP id 33so953965yxt.3 for ; Wed, 21 Sep 2011 00:25:34 -0700 (PDT) Received: by 10.68.7.36 with SMTP id g4mr991531pba.109.1316589934004; Wed, 21 Sep 2011 00:25:34 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id h5sm14177076pbq.11.2011.09.21.00.25.30 (version=SSLv3 cipher=OTHER); Wed, 21 Sep 2011 00:25:33 -0700 (PDT) From: Chander Kashyap To: u-boot@lists.denx.de Date: Wed, 21 Sep 2011 12:55:04 +0530 Message-Id: <1316589904-17431-5-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1316589904-17431-1-git-send-email-chander.kashyap@linaro.org> References: <1316589904-17431-1-git-send-email-chander.kashyap@linaro.org> Cc: linaro-dev@lists.linaro.org, bjlee@samsung.com, patches@linaro.org, mk7.kang@samsung.com, samsung@lists.linaro.org Subject: [U-Boot] [PATCH 4/4] smdkv310: use macro for mmc data read function address X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de board/samsung/smdkv310/mmc_boot.c: Removed the typedef for "mmc data read API (copy_sd_mmc_to_mem)" as it is used only once and replaced hard-coded API address value by macro. Signed-off-by: Chander Kashyap --- board/samsung/smdkv310/mmc_boot.c | 15 ++++++++------- include/configs/smdkv310.h | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/board/samsung/smdkv310/mmc_boot.c b/board/samsung/smdkv310/mmc_boot.c index 2f3e463..d3fc18d 100644 --- a/board/samsung/smdkv310/mmc_boot.c +++ b/board/samsung/smdkv310/mmc_boot.c @@ -23,15 +23,16 @@ #include #include -typedef u32(*copy_sd_mmc_to_mem) \ - (u32 start_block, u32 block_count, u32 *dest_addr); - - +/* +* Copy U-boot from mmc to RAM: +* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains +* API (Data transfer from mmc to ram) +*/ void copy_uboot_to_ram(void) { - copy_sd_mmc_to_mem copy_bl2 = (copy_sd_mmc_to_mem)(0x00002488); - copy_bl2(BL2_START_OFFSET,\ - BL2_SIZE_BLOC_COUNT, (u32 *)CONFIG_SYS_TEXT_BASE); + u32 (*copy_bl2)(u32, u32, u32) = (void *)COPY_BL2_FNPTR_ADDR; + + copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT, CONFIG_SYS_TEXT_BASE); } void board_init_f(unsigned long bootflag) diff --git a/include/configs/smdkv310.h b/include/configs/smdkv310.h index cf2ef17..5cec9e3 100644 --- a/include/configs/smdkv310.h +++ b/include/configs/smdkv310.h @@ -93,6 +93,7 @@ /* MMC SPL */ #define CONFIG_SPL +#define COPY_BL2_FNPTR_ADDR 0x00002488 #define CONFIG_BOOTCOMMAND "fatload mmc 0 40007000 uImage; bootm 40007000"