long long load_image_time = 0;
+#if BOOT_NATIVE_LINUX_MODEM
+extern void sipc_addr_reset(void);
+#endif
+extern unsigned char _chkNVEcc(uint8_t * buf, uint32_t size, uint32_t checksum);
+#ifdef CONFIG_TIZEN
+#ifdef CONFIG_RAMDISK_BOOT
+extern int load_ramdisk(char *name, unsigned int base_addr, unsigned int size);
+#endif
+#endif
+
#ifdef CONFIG_SUPPORT_TDLTE
static boot_image_required_t const s_boot_image_tl_table[] = {
{L"tl_fixnv1", L"tl_fixnv2", LTE_FIXNV_SIZE, LTE_FIXNV_ADDR},
};
#endif
+#ifndef CONFIG_TIZEN
#ifdef CONFIG_SUPPORT_W
static boot_image_required_t const s_boot_image_W_table[] = {
{L"wfixnv1", L"wfixnv2", FIXNV_SIZE, WFIXNV_ADR},
{NULL, NULL, 0, 0}
};
#endif
+#endif
static boot_image_required_t const s_boot_image_COMMON_table[] = {
#if !BOOT_NATIVE_LINUX
};
-static boot_image_required_t *const s_boot_image_table[] = {
+static boot_image_required_t const *s_boot_image_table[] = {
#ifdef CONFIG_SUPPORT_TDLTE
s_boot_image_tl_table,
#endif
return -1;
}
if (!get_partition_info_by_name(p_block_dev, L"logo", &info)) {
- if (TRUE != Emmc_Read(PARTITION_USER, info.start, size / EMMC_SECTOR_SIZE, bmp_img)) {
+ if (TRUE != Emmc_Read(PARTITION_USER, info.start, size / EMMC_SECTOR_SIZE, (uint8 *)bmp_img)) {
debugf("function: %s nand read error\n", __FUNCTION__);
return -1;
}
{
static char buf[72] = { 0 };
unsigned int i = 0;
- while ((NULL != wchar[i]) && (i < 72)) {
+ while ((!wchar[i]) && (i < 72)) {
buf[i] = wchar[i] & 0xFF;
i++;
}
return buf;
}
+#if 0
LOCAL void _boot_secure_check(void)
{
#ifdef CONFIG_SECURE_BOOT
#endif
return;
}
+#endif
/**
Function for reading user partition.
goto end;
}
- if (TRUE != Emmc_Read(PARTITION_USER, info.start + offsetsector, nsct, buf))
+ if (TRUE != Emmc_Read(PARTITION_USER, info.start + offsetsector, nsct, (uint8 *)buf))
goto end;
if (left) {
sctbuf = malloc(EMMC_SECTOR_SIZE);
if (NULL != sctbuf) {
- if (TRUE == Emmc_Read(PARTITION_USER, info.start + offsetsector + nsct, 1, sctbuf)) {
+ if (TRUE == Emmc_Read(PARTITION_USER, info.start + offsetsector + nsct, 1, (uint8 *)sctbuf)) {
memcpy(buf + (nsct * EMMC_SECTOR_SIZE), sctbuf, left);
ret = 1;
}
nsct = size / EMMC_SECTOR_SIZE;
left = size % EMMC_SECTOR_SIZE;
- if (nsct && !Emmc_Read(PARTITION_USER, start_sec, nsct, buf)) {
+ if (nsct && !Emmc_Read(PARTITION_USER, start_sec, nsct, (uint8 *)buf)) {
debugf("Failed to read mmc\n");
goto end;
}
if (left) {
sctbuf = malloc(EMMC_SECTOR_SIZE);
if (sctbuf) {
- if (!Emmc_Read(PARTITION_USER, start_sec + nsct, 1, sctbuf)) {
+ if (!Emmc_Read(PARTITION_USER, start_sec + nsct, 1, (uint8 *)sctbuf)) {
debugf("Failed to read mmc\n");
goto end;
}
nv_header_t *header_p = NULL;
uint32 bufsize = info.size + EMMC_SECTOR_SIZE;
- header_p = header;
+ header_p = (void *)header;
bakbuf = malloc(bufsize);
if (NULL == bakbuf)
return 0;
memset(header, 0, EMMC_SECTOR_SIZE);
memcpy(header, oribuf, EMMC_SECTOR_SIZE);
checksum = header_p->checksum;
- debugf("_boot_read_partition_with_backup origin checksum 0x%x\n", checksum);
+ debugf("_boot_read_partition_with_backup origin checksum 0x%lx\n", checksum);
if (_chkNVEcc(oribuf + EMMC_SECTOR_SIZE, info.size, checksum)) {
- memcpy(info.mem_addr, oribuf + EMMC_SECTOR_SIZE, info.size);
+ memcpy((void *)info.mem_addr, oribuf + EMMC_SECTOR_SIZE, info.size);
status += 1;
}
}
memset(header, 0, EMMC_SECTOR_SIZE);
memcpy(header, bakbuf, EMMC_SECTOR_SIZE);
checksum = header_p->checksum;
- debugf("_boot_read_partition_with_backup backup checksum 0x%x\n", checksum);
+ debugf("_boot_read_partition_with_backup backup checksum 0x%lx\n", checksum);
if (_chkNVEcc(bakbuf + EMMC_SECTOR_SIZE, info.size, checksum))
status += 1 << 1;
}
switch (status) {
case 0:
debugf("%s:(%s)both org and bak partition are damaged!\n", __FUNCTION__, w2c(info.partition));
- memset(info.mem_addr, 0, info.size);
+ memset((void *)info.mem_addr, 0, info.size);
free(bakbuf);
free(oribuf);
return 0;
break;
case 2:
debugf("%s:(%s)org partition is damaged!\n!", __FUNCTION__, w2c(info.partition));
- memcpy(info.mem_addr, bakbuf + EMMC_SECTOR_SIZE, info.size);
+ memcpy((void *)info.mem_addr, bakbuf + EMMC_SECTOR_SIZE, info.size);
_boot_partition_write(dev, info.partition, info.size + EMMC_SECTOR_SIZE, bakbuf);
break;
case 3:
//LOCAL __inline
int _boot_load_required_image(block_dev_desc_t * dev, boot_image_required_t img_info)
{
+#ifdef CONFIG_SECURE_BOOT
uint32 secure_boot_offset = 0;
+#endif
- debugf("%s: load %s to addr 0x%08x\n", __FUNCTION__, w2c(img_info.partition), img_info.mem_addr);
+ debugf("%s: load %s to addr 0x%08lx\n", __FUNCTION__, w2c(img_info.partition), img_info.mem_addr);
if (NULL != img_info.bak_partition) {
_boot_read_partition_with_backup(dev, img_info);
wchar_t *partition = NULL;
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))) {
offset = info.start * info.blksz;
- if (!blk_data_read(offset, sizeof(*hdr), hdr)) {
+ if (!blk_data_read(offset, sizeof(*hdr), (u8 *)hdr)) {
debugf("%s:%s read error!\n", __FUNCTION__, w2c(partition));
return 0;
}
roundup(hdr->kernel_size, ALIGN_SIZE) +
roundup(hdr->dt_size, ALIGN_SIZE);
- debugf("bzImage size: %x\n", size);
+ debugf("bzImage size: %lx\n", size);
- if (!blk_data_read(offset, size, KERNEL_ADR - roundup(sizeof(*hdr), ALIGN_SIZE))) {
+ if (!blk_data_read(offset, size, (u8 *)(KERNEL_ADR - roundup(sizeof(*hdr), ALIGN_SIZE)))) {
debugf("%s:%s kernel read error!\n", __FUNCTION__, w2c(partition));
return 0;
}
//read dt image
dt_img_adr = KERNEL_ADR + roundup(hdr->kernel_size, ALIGN_SIZE);
- debugf("dt_img_adr: %u\n", dt_img_adr);
- debugf("dt_img_adr: %x\n", dt_img_adr);
+ debugf("dt_img_adr: %lx\n", dt_img_adr);
if (load_dtb((int)DT_ADR, (void *)dt_img_adr)) {
debugf("%s:dt load error!\n", __FUNCTION__);
return 0;
{
boot_img_hdr *hdr = (void *)raw_header;
block_dev_desc_t *dev = NULL;
+#ifdef CONFIG_SECURE_BOOT
wchar_t *partition = NULL;
+#endif
int i, j;
long long start = get_ticks();