diff mbox

[4/4] smdkv310: use macro for mmc data read function address

Message ID 1316589904-17431-5-git-send-email-chander.kashyap@linaro.org
State Accepted
Headers show

Commit Message

Chander Kashyap Sept. 21, 2011, 7:25 a.m. UTC
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 <chander.kashyap@linaro.org>
---
 board/samsung/smdkv310/mmc_boot.c |   15 ++++++++-------
 include/configs/smdkv310.h        |    1 +
 2 files changed, 9 insertions(+), 7 deletions(-)
diff mbox

Patch

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<common.h>
 #include<config.h>
 
-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"