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: 4211 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A24DC23F58 for ; Wed, 21 Sep 2011 07:25:36 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 93407A189AB for ; Wed, 21 Sep 2011 07:25:36 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 23so1925184fxe.11 for ; Wed, 21 Sep 2011 00:25:36 -0700 (PDT) Received: by 10.223.33.19 with SMTP id f19mr551502fad.122.1316589936480; Wed, 21 Sep 2011 00:25:36 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.18.198 with SMTP id y6cs111605lad; Wed, 21 Sep 2011 00:25:36 -0700 (PDT) Received: by 10.236.180.105 with SMTP id i69mr2645056yhm.64.1316589935545; Wed, 21 Sep 2011 00:25:35 -0700 (PDT) Received: from mail-yi0-f50.google.com (mail-yi0-f50.google.com [209.85.218.50]) by mx.google.com with ESMTPS id i1si3045119yhn.37.2011.09.21.00.25.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Sep 2011 00:25:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.218.50 is neither permitted nor denied by best guess record for domain of chander.kashyap@linaro.org) client-ip=209.85.218.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.218.50 is neither permitted nor denied by best guess record for domain of chander.kashyap@linaro.org) smtp.mail=chander.kashyap@linaro.org Received: by yib25 with SMTP id 25so2128641yib.37 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 Cc: mk7.kang@samsung.com, bjlee@samsung.com, patches@linaro.org, samsung@lists.linaro.org, linaro-dev@lists.linaro.org, Chander Kashyap Subject: [PATCH 4/4] smdkv310: use macro for mmc data read function address 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> 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"