X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=property%2Fnormal_emc_mode.c;h=55b1fa11de31856a28cf0d5b69fef95b24f5034e;hb=a7359e2fdf25ebe757fdbf54b0571cb85fdb3e10;hp=d4fdecbabb6c624389a1edd3b0e79e396c6f068b;hpb=70c9b062ef932fd9af53168d16ff9767f0654630;p=profile%2Fmobile%2Fplatform%2Fkernel%2Fu-boot-tm1.git diff --git a/property/normal_emc_mode.c b/property/normal_emc_mode.c old mode 100755 new mode 100644 index d4fdecb..55b1fa1 --- a/property/normal_emc_mode.c +++ b/property/normal_emc_mode.c @@ -519,16 +519,25 @@ LOCAL int _boot_load_kernel_ramdisk_image(block_dev_desc_t * dev, char *bootmode uint32 size, offset; uint32 dt_img_adr; uint32 secure_boot_offset = 0; + disk_partition_t info; if (0 == memcmp(bootmode, RECOVERY_PART, strlen(RECOVERY_PART))) { partition = L"recovery"; debugf("enter recovery mode!\n"); + set_recovery_mode(1); } else { - partition = BOOT_PART; - debugf("Enter boot mode (partition name: %s)\n", partition); + partition = L""BOOT_PART; + debugf("Enter boot mode (partition name: %s)\n", w2c(partition)); + } + + if (get_partition_info_by_name(dev, partition, &info)) { + debugf("get partition %s info failed!\n", w2c(partition)); + return 0; } - if (!blk_data_read(0x2C00000, sizeof(*hdr), hdr)) { + offset = info.start * info.blksz; + + if (!blk_data_read(offset, sizeof(*hdr), hdr)) { debugf("%s:%s read error!\n", __FUNCTION__, w2c(partition)); return 0; } @@ -547,7 +556,7 @@ LOCAL int _boot_load_kernel_ramdisk_image(block_dev_desc_t * dev, char *bootmode debugf("bzImage size: %x\n", size); - if (!blk_data_read(0x2C00000, size, KERNEL_ADR - roundup(sizeof(*hdr), ALIGN_SIZE))) { + if (!blk_data_read(offset, size, KERNEL_ADR - roundup(sizeof(*hdr), ALIGN_SIZE))) { debugf("%s:%s kernel read error!\n", __FUNCTION__, w2c(partition)); return 0; } @@ -560,6 +569,20 @@ LOCAL int _boot_load_kernel_ramdisk_image(block_dev_desc_t * dev, char *bootmode debugf("%s:dt load error!\n", __FUNCTION__); return 0; } + + +#ifdef CONFIG_TIZEN +#ifdef CONFIG_RAMDISK_BOOT + { + char *ramdisk_part; + if (0 == memcmp(bootmode, RECOVERY_PART, strlen(RECOVERY_PART))) + ramdisk_part = PARTS_RAMDISK2; + else + ramdisk_part = PARTS_RAMDISK; + load_ramdisk(ramdisk_part, RAMDISK_ADR, RAMDISK_SIZE_MB * 1024 * 1024); + } +#endif /* CONFIG_RAMDISK_BOOT */ +#else /* CONFIG_TIZEN */ #ifdef CONFIG_SDRAMDISK { int sd_ramdisk_size = 0; @@ -574,6 +597,7 @@ LOCAL int _boot_load_kernel_ramdisk_image(block_dev_desc_t * dev, char *bootmode hdr->ramdisk_size = sd_ramdisk_size; } #endif +#endif /* CONFIG_TIZEN */ return 1; }