X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=common%2Fspl%2Fspl_mmc.c;h=13fbff082cfe48bc4b846228d6463db3e7b342f0;hb=773b5940b5f2fb5d1041c6f4db5796121ccd29c5;hp=fc2f2260f888a308d26d7a63fb5db6e5b95b78df;hpb=b2a6dfe4f8d263b9aa45929f1a40cd1143775a81;p=platform%2Fkernel%2Fu-boot.git diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index fc2f226..13fbff0 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -69,54 +68,6 @@ static int mmc_load_image_raw_os(struct mmc *mmc) } #endif -#ifdef CONFIG_SPL_FAT_SUPPORT -static int mmc_load_image_fat(struct mmc *mmc, const char *filename) -{ - int err; - struct image_header *header; - - header = (struct image_header *)(CONFIG_SYS_TEXT_BASE - - sizeof(struct image_header)); - - err = file_fat_read(filename, header, sizeof(struct image_header)); - if (err <= 0) - goto end; - - spl_parse_image_header(header); - - err = file_fat_read(filename, (u8 *)spl_image.load_addr, 0); - -end: -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT - if (err <= 0) - printf("spl: error reading image %s, err - %d\n", - filename, err); -#endif - - return (err <= 0); -} - -#ifdef CONFIG_SPL_OS_BOOT -static int mmc_load_image_fat_os(struct mmc *mmc) -{ - int err; - - err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME, - (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0); - if (err <= 0) { -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT - printf("spl: error reading image %s, err - %d\n", - CONFIG_SPL_FAT_LOAD_ARGS_NAME, err); -#endif - return -1; - } - - return mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_KERNEL_NAME); -} -#endif - -#endif - void spl_mmc_load_image(void) { struct mmc *mmc; @@ -148,24 +99,17 @@ void spl_mmc_load_image(void) if (spl_start_uboot() || mmc_load_image_raw_os(mmc)) #endif err = mmc_load_image_raw(mmc, - CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #ifdef CONFIG_SPL_FAT_SUPPORT } else if (boot_mode == MMCSD_MODE_FAT) { debug("boot mode - FAT\n"); - - err = fat_register_device(&mmc->block_dev, - CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION); - if (err) { -#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT - printf("spl: fat register err - %d\n", err); -#endif - hang(); - } - #ifdef CONFIG_SPL_OS_BOOT - if (spl_start_uboot() || mmc_load_image_fat_os(mmc)) + if (spl_start_uboot() || spl_load_image_fat_os(&mmc->block_dev, + CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION)) #endif - err = mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME); + err = spl_load_image_fat(&mmc->block_dev, + CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION, + CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME); #endif } else { #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT