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 (!blk_data_read(0x2C00000, sizeof(*hdr), hdr)) {
+ if (get_partition_info_by_name(dev, partition, &info)) {
+ debugf("get partition %s info failed!\n", w2c(partition));
+ return 0;
+ }
+
+ offset = info.start * info.blksz;
+
+ if (!blk_data_read(offset, sizeof(*hdr), hdr)) {
debugf("%s:%s read error!\n", __FUNCTION__, w2c(partition));
return 0;
}
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;
}
#ifdef CONFIG_TIZEN
#ifdef CONFIG_RAMDISK_BOOT
{
- load_ramdisk(PARTS_RAMDISK, RAMDISK_ADR, RAMDISK_SIZE_MB * 1024 * 1024);
+ 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 */