From 1816491ef9cf99e6f8b7d29f9b099d585c75d964 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 25 Jan 2017 09:31:52 +0900 Subject: [PATCH 01/16] tizen: add ramdisk1 partition to default partition table This patch adds ramdisk1 partition to default partition table to flash ramdisk.img to the partition. Change-Id: I5aa9ec8b61f51af0806a6ebd97b3bc8bda1c77e7 Signed-off-by: Seung-Woo Kim --- include/configs/tizen_tm1.h | 1 + property/tizen_part.h | 1 + 2 files changed, 2 insertions(+) diff --git a/include/configs/tizen_tm1.h b/include/configs/tizen_tm1.h index f4924ef..916c108 100644 --- a/include/configs/tizen_tm1.h +++ b/include/configs/tizen_tm1.h @@ -409,6 +409,7 @@ #define PARTS_ROOTFS "rootfs" #define PARTS_RUNTIMENV1 "runtimenv1" #define PARTS_RUNTIMENV2 "runtimenv2" +#define PARTS_RAMDISK "ramdisk1" #define CONFIG_SIG diff --git a/property/tizen_part.h b/property/tizen_part.h index 386d0eb..487577b 100644 --- a/property/tizen_part.h +++ b/property/tizen_part.h @@ -27,6 +27,7 @@ struct part_mapping_table thor_part_map[] = { { 26, PARTS_ROOTFS, "rootfs", 0xc9d000, 0x1c0000, 0x200 }, { -1, PARTS_RUNTIMENV1, "", 0x5800, 0x800, 0x200 }, { -1, PARTS_RUNTIMENV2, "", 0x6000, 0x800, 0x200 }, + { -1, PARTS_RAMDISK, "ramdisk", 0x1e000, 0x4000, 0x200 }, }; #endif /* _TIZEN_PART_H_ */ -- 2.7.4 From 25b0d59d9acd91f1ee87dfcb9acc3d7654db4a95 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 25 Jan 2017 13:20:39 +0900 Subject: [PATCH 02/16] tizen: add ramdisk bootmode with ramdisk config option This patch adds ramdisk bootmode with ramdisk boot config option. Change-Id: Ic9b571b4eb7c09805b7f567fa9ffa5ec08fe51de Signed-off-by: Seung-Woo Kim --- include/normal_mode.h | 1 + property/normal_emc_mode.c | 10 ++++++++++ property/normal_mode.c | 13 ++++++++++--- property/tizen_misc.c | 5 +++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/include/normal_mode.h b/include/normal_mode.h index 2b2ab25..bd4beba 100644 --- a/include/normal_mode.h +++ b/include/normal_mode.h @@ -53,6 +53,7 @@ extern unsigned char raw_header[8192]; #define VLX_TAG_ADDR 0x82000100 #define DT_ADR 0x85400000 #define RAMDISK_ADR 0x85500000 +#define RAMDISK_SIZE_MB 8 #if defined (CONFIG_SPX30G) #define COOPERATE_PROCESSOR_RESET_ADDR 0x402b00b0 diff --git a/property/normal_emc_mode.c b/property/normal_emc_mode.c index d4fdecb..e364956 100644 --- a/property/normal_emc_mode.c +++ b/property/normal_emc_mode.c @@ -560,6 +560,15 @@ 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 + { + load_ramdisk(PARTS_RAMDISK, RAMDISK_ADR, RAMDISK_SIZE_MB * 1024 * 1024); + } +#endif /* CONFIG_RAMDISK_BOOT */ +#else /* CONFIG_TIZEN */ #ifdef CONFIG_SDRAMDISK { int sd_ramdisk_size = 0; @@ -574,6 +583,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; } diff --git a/property/normal_mode.c b/property/normal_mode.c index 2bd31af..3ef7204 100644 --- a/property/normal_mode.c +++ b/property/normal_mode.c @@ -172,15 +172,18 @@ int fdt_fixup_for_tizen(void *fdt) /* Tizen default cmdline: mem */ ptr += sprintf(ptr, CMDLINE_DEFAULT_TIZEN); +#ifdef CONFIG_RAMDISK_BOOT + ptr += sprintf(ptr, " root=/dev/ram0 rw initrd=0x%x,%dM", + RAMDISK_ADR, RAMDISK_SIZE_MB); +#else val = tizen_get_part_num(PARTS_ROOTFS); ptr += sprintf(ptr, " root=/dev/mmcblk0p%d ro rootfstype=ext4 rootwait", val); + ptr += sprintf(ptr, " initrd=0x%x,0x%x", RAMDISK_ADR, 0); +#endif ptr += sprintf(ptr, " lcd_id=ID%06x", load_lcd_id_to_kernel()); ptr += sprintf(ptr, " lcd_base=%x", CONFIG_FB_RAM_BASE); - /* check ramdisk_size */ - ptr += sprintf(ptr, " initrd=0x%x,0x%x", RAMDISK_ADR, 0); - ptr += sprintf(ptr, " mtp_offset=%s", load_mtp_offset_to_kernel()); ptr += sprintf(ptr, " elvss_offset=0x%x", load_elvss_offset_to_kernel()); ptr += sprintf(ptr, " hbm_offset=%s", load_hbm_offset_to_kernel()); @@ -197,7 +200,11 @@ int fdt_fixup_for_tizen(void *fdt) break; case PM_STATE_NORMAL: default: +#ifdef CONFIG_RAMDISK_BOOT + ptr += sprintf(ptr, " bootmode=ramdisk"); +#else ptr += sprintf(ptr, " bootmode=normal"); +#endif } thor_save_env("normal"); diff --git a/property/tizen_misc.c b/property/tizen_misc.c index a881d17..263c476 100644 --- a/property/tizen_misc.c +++ b/property/tizen_misc.c @@ -775,6 +775,11 @@ static int load_binary_to_addr(char *name, unsigned int addr, unsigned int size) return 0; } +int load_ramdisk(char *name, unsigned int base_addr, unsigned int size) +{ + return load_binary_to_addr(name, base_addr, size); +} + int check_board_signature(char *fname, unsigned int dn_addr, unsigned int size) { struct sig_header bh_target; -- 2.7.4 From cda554e2afee98343e51296d9ff98b8d04cae4fd Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 25 Jan 2017 13:22:15 +0900 Subject: [PATCH 03/16] tizen: tm1: enable ramdisk bootmode config option This patch enables ramdisk bootmode config option for tm1 board. Change-Id: I591324581500f9e10f2888f4c8bea46c3924bf10 Signed-off-by: Seung-Woo Kim --- include/configs/tizen_tm1.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/tizen_tm1.h b/include/configs/tizen_tm1.h index 916c108..1c0b878 100644 --- a/include/configs/tizen_tm1.h +++ b/include/configs/tizen_tm1.h @@ -411,6 +411,8 @@ #define PARTS_RUNTIMENV2 "runtimenv2" #define PARTS_RAMDISK "ramdisk1" +#define CONFIG_RAMDISK_BOOT 1 + #define CONFIG_SIG #ifdef CONFIG_CMD_NET -- 2.7.4 From 0eb9c61b163897ce42932843ef1442d50075f4fc Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 10 Feb 2017 13:15:09 +0900 Subject: [PATCH 04/16] tizen: add ramdisk2 partition to default parition table This patch adds ramdisk2 partition to default partition table to flash ramdisk-recovery.img to the partition for recovery mode. Change-Id: Ia6d1f78f14f40c83235af104c400af94552cb2f7 Signed-off-by: Seung-Woo Kim --- include/configs/tizen_tm1.h | 1 + property/tizen_part.h | 1 + 2 files changed, 2 insertions(+) diff --git a/include/configs/tizen_tm1.h b/include/configs/tizen_tm1.h index 1c0b878..4830323 100644 --- a/include/configs/tizen_tm1.h +++ b/include/configs/tizen_tm1.h @@ -410,6 +410,7 @@ #define PARTS_RUNTIMENV1 "runtimenv1" #define PARTS_RUNTIMENV2 "runtimenv2" #define PARTS_RAMDISK "ramdisk1" +#define PARTS_RAMDISK2 "ramdisk2" #define CONFIG_RAMDISK_BOOT 1 diff --git a/property/tizen_part.h b/property/tizen_part.h index 487577b..b12f176 100644 --- a/property/tizen_part.h +++ b/property/tizen_part.h @@ -28,6 +28,7 @@ struct part_mapping_table thor_part_map[] = { { -1, PARTS_RUNTIMENV1, "", 0x5800, 0x800, 0x200 }, { -1, PARTS_RUNTIMENV2, "", 0x6000, 0x800, 0x200 }, { -1, PARTS_RAMDISK, "ramdisk", 0x1e000, 0x4000, 0x200 }, + { -1, PARTS_RAMDISK2, "ramdisk-recovery", 0x22000, 0x4000, 0x200 }, }; #endif /* _TIZEN_PART_H_ */ -- 2.7.4 From 4bc519de93882e50a13916c9bc218d3f1ac38e9f Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 10 Feb 2017 13:59:26 +0900 Subject: [PATCH 05/16] tizen: fix to load kernel image with partition information This patch fixes to load kernel image with partition information instead of hard coded block offset of emmc. Change-Id: I4026c517a272e358acbd018473549c15689300ec Signed-off-by: Seung-Woo Kim --- include/configs/tizen_tm1.h | 2 +- property/normal_emc_mode.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/configs/tizen_tm1.h b/include/configs/tizen_tm1.h index 4830323..c815126 100644 --- a/include/configs/tizen_tm1.h +++ b/include/configs/tizen_tm1.h @@ -60,7 +60,7 @@ //#define CONFIG_YAFFS2 1 //#define BOOT_PART "boot" -#define BOOT_PART "KERNEL" +#define BOOT_PART "kernel" #define RECOVERY_PART "recovery" #define UBIPAC_PART "ubipac" diff --git a/property/normal_emc_mode.c b/property/normal_emc_mode.c index e364956..cba588b 100644 --- a/property/normal_emc_mode.c +++ b/property/normal_emc_mode.c @@ -519,16 +519,24 @@ 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"); } 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; } @@ -547,7 +555,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; } -- 2.7.4 From a7359e2fdf25ebe757fdbf54b0571cb85fdb3e10 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 10 Feb 2017 14:04:42 +0900 Subject: [PATCH 06/16] tizen: add recovery boot mode This patch adds recovery boot mode, in which mode, kernel image is loaded from recovery partition and ramdisk image is loaded from ramdisk2 partition. Also, it sets "bootmode=recovery" to bootargs of kernel. Change-Id: I5f6a024962a0d4744266763f7cddec8b6e4e2ea4 Signed-off-by: Seung-Woo Kim --- arch/arm/cpu/armv7/sc8830/misc.c | 15 +++++++++++++++ include/normal_mode.h | 1 + property/boot_mode_regist.c | 2 +- property/cmd_cboot.c | 8 ++++++++ property/normal_emc_mode.c | 8 +++++++- property/normal_mode.c | 15 +++++++++++++-- 6 files changed, 45 insertions(+), 4 deletions(-) diff --git a/arch/arm/cpu/armv7/sc8830/misc.c b/arch/arm/cpu/armv7/sc8830/misc.c index 33cf5fc..fbe348f 100644 --- a/arch/arm/cpu/armv7/sc8830/misc.c +++ b/arch/arm/cpu/armv7/sc8830/misc.c @@ -427,6 +427,7 @@ void pmic_init(void) #define REBOOT_MODE_MASK (0xFFFFFFF0) #define REBOOT_MODE_PREFIX (0x12345670) #define REBOOT_THOR_DOWNLOAD (0x1) +#define REBOOT_RECOVERY (0x4) int tizen_reboot_check(void) { int inform3 = readl(INFORM3); @@ -440,6 +441,20 @@ int tizen_reboot_check(void) return 0; } + +int tizen_reboot_recovery_check(void) +{ + int inform3 = readl(INFORM3); + + if ((inform3 & REBOOT_MODE_MASK) == REBOOT_MODE_PREFIX) { + if ((inform3 & 0xf) == REBOOT_RECOVERY) { + writel(0, INFORM3); + return 1; + } + } + + return 0; +} #endif #define REG32(x) (*((volatile uint32 *)(x))) diff --git a/include/normal_mode.h b/include/normal_mode.h index bd4beba..21d955e 100644 --- a/include/normal_mode.h +++ b/include/normal_mode.h @@ -216,6 +216,7 @@ int creat_cmdline(char * cmdline,boot_img_hdr *hdr); void vlx_entry(); extern char* get_product_sn(void); extern char *calibration_cmd_buf; +void set_recovery_mode(unsigned int recovery_mode); diff --git a/property/boot_mode_regist.c b/property/boot_mode_regist.c index 44dda2d..4d06c1f 100644 --- a/property/boot_mode_regist.c +++ b/property/boot_mode_regist.c @@ -35,8 +35,8 @@ void cmd_mode_regist(CBOOT_MODE_ENTRY *array) MODE_REGIST(CMD_NORMAL_MODE, normal_mode); MODE_REGIST(CMD_CHARGE_MODE, charge_mode); MODE_REGIST(CMD_THOR_MODE, thor_mode); -#ifndef CONFIG_TIZEN MODE_REGIST(CMD_RECOVERY_MODE, recovery_mode); +#ifndef CONFIG_TIZEN MODE_REGIST(CMD_FACTORYTEST_MODE,factorytest_mode); MODE_REGIST(CMD_FASTBOOT_MODE, fastboot_mode); MODE_REGIST(CMD_WATCHDOG_REBOOT, watchdog_mode); diff --git a/property/cmd_cboot.c b/property/cmd_cboot.c index d184fd8..663ad2d 100644 --- a/property/cmd_cboot.c +++ b/property/cmd_cboot.c @@ -230,6 +230,7 @@ boot_mode_enum_type get_mode_from_gpio_extend(void){ #ifdef CONFIG_TIZEN extern int tizen_reboot_check(void); +extern int tizen_reboot_recovery_check(void); #endif int do_cboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) @@ -290,6 +291,13 @@ int do_cboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (tizen_reboot_check()) { bootmode = CMD_THOR_MODE; DBG("do_cboot:boot mode is %d\n",bootmode); + } else if (tizen_reboot_recovery_check()) { +#ifdef CONFIG_RAMDISK_BOOT + bootmode = CMD_RECOVERY_MODE; +#else + bootmode = CMD_NORMAL_MODE; +#endif + DBG("do_cboot:boot mode is %d\n",bootmode); } } diff --git a/property/normal_emc_mode.c b/property/normal_emc_mode.c index cba588b..55b1fa1 100644 --- a/property/normal_emc_mode.c +++ b/property/normal_emc_mode.c @@ -524,6 +524,7 @@ LOCAL int _boot_load_kernel_ramdisk_image(block_dev_desc_t * dev, char *bootmode if (0 == memcmp(bootmode, RECOVERY_PART, strlen(RECOVERY_PART))) { partition = L"recovery"; debugf("enter recovery mode!\n"); + set_recovery_mode(1); } else { partition = L""BOOT_PART; debugf("Enter boot mode (partition name: %s)\n", w2c(partition)); @@ -573,7 +574,12 @@ LOCAL int _boot_load_kernel_ramdisk_image(block_dev_desc_t * dev, char *bootmode #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 */ diff --git a/property/normal_mode.c b/property/normal_mode.c index 3ef7204..0e4cd49 100644 --- a/property/normal_mode.c +++ b/property/normal_mode.c @@ -33,6 +33,7 @@ void *harsh_data = harsh_data_buf; unsigned char raw_header[8192]; const int SP09_MAX_PHASE_BUFF_SIZE = sizeof(SP09_PHASE_CHECK_T); unsigned int g_charger_mode = 0; +unsigned int g_recovery_mode = 0; char serial_number_to_transfer[SP09_MAX_SN_LEN]; extern int charger_connected(void); @@ -173,6 +174,9 @@ int fdt_fixup_for_tizen(void *fdt) ptr += sprintf(ptr, CMDLINE_DEFAULT_TIZEN); #ifdef CONFIG_RAMDISK_BOOT + if (g_recovery_mode) + ptr += sprintf(ptr, " bootmode=recovery"); + ptr += sprintf(ptr, " root=/dev/ram0 rw initrd=0x%x,%dM", RAMDISK_ADR, RAMDISK_SIZE_MB); #else @@ -200,11 +204,13 @@ int fdt_fixup_for_tizen(void *fdt) break; case PM_STATE_NORMAL: default: + if (!g_recovery_mode) { #ifdef CONFIG_RAMDISK_BOOT - ptr += sprintf(ptr, " bootmode=ramdisk"); + ptr += sprintf(ptr, " bootmode=ramdisk"); #else - ptr += sprintf(ptr, " bootmode=normal"); + ptr += sprintf(ptr, " bootmode=normal"); #endif + } } thor_save_env("normal"); @@ -389,6 +395,11 @@ static int start_linux() return 0; } +void set_recovery_mode(unsigned int recovery_mode) +{ + g_recovery_mode = recovery_mode; +} + void lcd_display_logo(int backlight_set, ulong bmp_img, size_t size) { #define mdelay(t) ({unsigned long msec=(t); while (msec--) { udelay(1000);}}) //LiWei add -- 2.7.4 From 1bf2efc4fffd9e6a0cf557a3021766f3a8a7d4d0 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 10 Feb 2017 14:06:40 +0900 Subject: [PATCH 07/16] tizen: add recovery u-boot prompt command This patch adds recovery command to u-boot prompt. Change-Id: Ifeaef04ea27beef5d7e31ac0d85717fe4c89eeb1 Signed-off-by: Seung-Woo Kim --- property/recv_mode.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/property/recv_mode.c b/property/recv_mode.c index ba43b80..47457ae 100644 --- a/property/recv_mode.c +++ b/property/recv_mode.c @@ -135,3 +135,18 @@ void recovery_mode(void) #endif } +#ifdef CONFIG_TIZEN +#ifdef CONFIG_RAMDISK_BOOT +int do_recovery(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + puts("Tizen Recovery mode\n"); + + recovery_mode(); +} + +U_BOOT_CMD(recovery, 1, 1, do_recovery, + "TIZEN Recovery mode", + "" +); +#endif +#endif -- 2.7.4 From cecbd73e488f709ca1d6889147890a59a8291ab2 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 6 Apr 2017 10:06:13 +0900 Subject: [PATCH 08/16] tizen: thordown: fix to check larger file size than partition size If the file is larger than its mapped partition size, then it should be failed to thor command. So, this patch fixes to check requested file size. Change-Id: I87a3c825138b93ebba961227e47a8cf600de602d Signed-off-by: Seung-Woo Kim --- property/thor_mode.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/property/thor_mode.c b/property/thor_mode.c index 4845b16..e277eba 100644 --- a/property/thor_mode.c +++ b/property/thor_mode.c @@ -178,6 +178,12 @@ static long long int process_rqt_download(const struct rqt_box *rqt) ret = rsp->ack; } + if (thor_file_size > part_info.size * part_info.blksz) { + thor_debug("Too large binary\n"); + rsp->ack = -EFBIG; + ret = rsp->ack; + } + break; case RQT_DL_FILE_START: send_rsp(rsp); -- 2.7.4 From fb35badbf11d74b8eee60d85447cab13ad07cb9c Mon Sep 17 00:00:00 2001 From: Gonzha Dmitriy Evgenevich Date: Wed, 31 May 2017 21:33:59 +0300 Subject: [PATCH 09/16] packaging: Turn off ASan build Turn off ASan in case of ASan build for u-boot-tm1 package Change-Id: I1a3714f47eb14da53fac8a14e179d90ffa416b7f Signed-off-by: Gonzha Dmitriy Evgenevich Signed-off-by: Seung-Woo Kim --- packaging/u-boot-tm1.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/packaging/u-boot-tm1.spec b/packaging/u-boot-tm1.spec index 4fa0d9b..a94fb53 100644 --- a/packaging/u-boot-tm1.spec +++ b/packaging/u-boot-tm1.spec @@ -32,6 +32,7 @@ and Microblaze. %setup -q %build +%{?asan:/usr/bin/gcc-unforce-options} cp %{SOURCE1001} . make distclean make tizen_tm1_config -- 2.7.4 From 4b1682c0ae40c138091e1f5067c04ec88f26c26e Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 16 Jun 2017 15:56:06 +0900 Subject: [PATCH 10/16] tizen: thordown: fix to check partition size more than 4GB The routine to check file size larger than partitione is introducetd, but it only checks partition size with 32 bit variable, so partition larger than 4GB is not properly checked. So this patch fixes to check partition size with 64 bit for more than 4GB partition. Change-Id: If22c12e9d0678ea571ca3c382b46f5ae93036025 Fixes: cecbd73e488f ("tizen: thordown: fix to check larger file size than partition size") Signed-off-by: Seung-Woo Kim --- property/thor_mode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/property/thor_mode.c b/property/thor_mode.c index e277eba..6e3a104 100644 --- a/property/thor_mode.c +++ b/property/thor_mode.c @@ -178,7 +178,8 @@ static long long int process_rqt_download(const struct rqt_box *rqt) ret = rsp->ack; } - if (thor_file_size > part_info.size * part_info.blksz) { + if ((uint64_t)thor_file_size > + (uint64_t)part_info.size * (uint64_t)part_info.blksz) { thor_debug("Too large binary\n"); rsp->ack = -EFBIG; ret = rsp->ack; -- 2.7.4 From 604594543295e3bc517790b0a5f314243cd89405 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 27 Sep 2017 20:22:56 +0900 Subject: [PATCH 11/16] build: remove duplicated config in Makefile There is duplicated config in Makefile. Remove the duplicated config to resolve following warning: Makefile:1609: warning: overriding recipe for target 'sp7731gea_hd_config' Makefile:1587: warning: ignoring old recipe for target 'sp7731gea_hd_config' Change-Id: Icd68729e87de893f10a31c6f0e1d47faf0603248 Signed-off-by: Seung-Woo Kim --- Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index 56af01c..fafb29d 100644 --- a/Makefile +++ b/Makefile @@ -1583,11 +1583,6 @@ sp7731gea_config : unconfig @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk @$(MKCONFIG) $@ arm armv7 sp7731gea spreadtrum sc8830 -sp7731gea_hd_config : unconfig - @mkdir -p $(obj)include - @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk - @$(MKCONFIG) $@ arm armv7 sp7731gea_hd spreadtrum sc8830 - sp8730seea_qhd_config : unconfig @mkdir -p $(obj)include @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk -- 2.7.4 From 92a4031fe4d8bbf461d724790a341f7c9e558f1c Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Wed, 27 Sep 2017 16:15:32 +0900 Subject: [PATCH 12/16] common: disable the PERFORMANCE_TEST configuration There is no needs to enable PERFORMANCE_TEST. Disabled the PERFORMANCE_TEST configuration. Change-Id: I071a1d9402e807cb6b469119a169567a5b26891b Signed-off-by: Jaehoon Chung --- include/common.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/common.h b/include/common.h index 4f8a332..478e8bf 100644 --- a/include/common.h +++ b/include/common.h @@ -124,7 +124,6 @@ typedef volatile unsigned char vu_char; #define debugX(level,fmt,args...) #endif /* DEBUG */ -#define PERFORMANCE_TEST 1 #ifdef PERFORMANCE_TEST #define performance_debug(fmt,args...) do { \ printf(fmt "++%lu \n", \ -- 2.7.4 From cc87b8fa384fa510aa2ed75ca7325cef229a8f31 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Wed, 27 Sep 2017 16:40:25 +0900 Subject: [PATCH 13/16] arch: sc8830: sci_types: remove the redefined macro Arleady defined 'MAX' and 'MIN' in include/common.h Remove the redefined 'MAX'/'MIN' macro. Change-Id: I7a5a15ee137b87133f619ac1803843734c10762c Signed-off-by: Jaehoon Chung --- arch/arm/include/asm/arch-sc8830/sci_types.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm/include/asm/arch-sc8830/sci_types.h b/arch/arm/include/asm/arch-sc8830/sci_types.h index 82f97ee..fbedf9a 100644 --- a/arch/arm/include/asm/arch-sc8830/sci_types.h +++ b/arch/arm/include/asm/arch-sc8830/sci_types.h @@ -153,9 +153,6 @@ typedef uint32 BLOCK_ID; /* some usefule marcos */ #define Bit(_i) ((u32) 1<<(_i)) -#define MAX( _x, _y ) ( ((_x) > (_y)) ? (_x) : (_y) ) - -#define MIN( _x, _y ) ( ((_x) < (_y)) ? (_x) : (_y) ) #define WORD_LO(_xxx) ((uint8) ((int16)(_xxx))) #define WORD_HI(_xxx) ((uint8) ((int16)(_xxx) >> 8)) -- 2.7.4 From c3ae759f4b6276cbf2730042ff5b19fea783140e Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Wed, 27 Sep 2017 16:07:04 +0900 Subject: [PATCH 14/16] configs: tizen_tm1: fix the duplicated defined config Some configurations are defined the twice. If configuration is not defined, it needs to define at that time. Change-Id: I8ee34f434fd3e532e610eadb16e6a36954615ee9 Signed-off-by: Jaehoon Chung --- include/configs/tizen_tm1.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/configs/tizen_tm1.h b/include/configs/tizen_tm1.h index c815126..81be832 100644 --- a/include/configs/tizen_tm1.h +++ b/include/configs/tizen_tm1.h @@ -125,7 +125,9 @@ #ifdef CONFIG_CMD_MMC #define CONFIG_CMD_FAT 1 #define CONFIG_FAT_WRITE 1 +#ifndef CONFIG_MMC #define CONFIG_MMC 1 +#endif /* !CONFIG_MMC */ #define CONFIG_GENERIC_MMC 1 #define CONFIG_SDHCI 1 #define CONFIG_SDHCI_CTRL_NO_HISPD 1 /* disable high speed control */ @@ -133,7 +135,9 @@ #define CONFIG_MMC_SDMA 1 #define CONFIG_MV_SDHCI 1 #define CONFIG_DOS_PARTITION 1 +#ifndef CONFIG_EFI_PARTITION #define CONFIG_EFI_PARTITION 1 +#endif /* !CONFIG_EFI_PARTITION */ #define CONFIG_SYS_MMC_NUM 1 #define CONFIG_SYS_MMC_BASE {0x20600000} #define CONFIG_SYS_SD_BASE 0x20300000 -- 2.7.4 From bf933f6b06da24d4ff5b1957d4b7a63d0fb85f41 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Tue, 10 May 2011 17:33:08 +0000 Subject: [PATCH 15/16] kwbimage: Fix check variable of checksum calc_hdrcsum two times are checked. checksumi of exthdr is not checked. Signed-off-by: Nobuhiro Iwamatsu CC: Prafulla Wadaskar [jh80.chung: cherry-pick from u-boot mainline to remove build warning] Signed-off-by: Jaehoon Chung Change-Id: I62d00303ad285eb1feed14dd0236a1c1a4940808 --- tools/kwbimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kwbimage.c b/tools/kwbimage.c index ba3076d..6448977 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -357,7 +357,7 @@ static int kwbimage_verify_header (unsigned char *ptr, int image_size, calc_exthdrcsum = kwbimage_checksum8 ((void *)exthdr, sizeof(extbhr_t) - sizeof(uint8_t), 0); - if (calc_hdrcsum != mhdr->checkSum) + if (calc_exthdrcsum != exthdr->checkSum) return -FDT_ERR_BADSTRUCTURE; /* exthdr csum not matched */ return 0; -- 2.7.4 From 1473c5553610d9fc871f824c6e11544a95c9848a Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 28 Sep 2017 15:23:19 +0900 Subject: [PATCH 16/16] arm: sc8830: sprd_module_config: remove the duplicated defined value KPD_NUM is already defined. (0x01 << 16) | (0x03 << 20) is same with (0x31 << 16). Change-Id: Ieef99d7f9c32ea7170f16814bccad718ef730ef3 Signed-off-by: Jaehoon Chung --- arch/arm/include/asm/arch-sc8830/sprd_module_config.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/include/asm/arch-sc8830/sprd_module_config.h b/arch/arm/include/asm/arch-sc8830/sprd_module_config.h index d262b0d..41b20c2 100644 --- a/arch/arm/include/asm/arch-sc8830/sprd_module_config.h +++ b/arch/arm/include/asm/arch-sc8830/sprd_module_config.h @@ -51,8 +51,6 @@ extern "C" #define KPD_NUM ((0x01 << 16) | (0x03 << 20))//KPDCTL_KPD ;// 5*5 #endif -#define KPD_NUM (0x31 << 16) - /**---------------------------------------------------------------------------* ** Macro Define for pwm ** **---------------------------------------------------------------------------*/ -- 2.7.4