From a7359e2fdf25ebe757fdbf54b0571cb85fdb3e10 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 10 Feb 2017 14:04:42 +0900 Subject: [PATCH 01/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 02/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 03/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 04/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 05/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 06/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 07/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 08/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 09/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 10/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 11/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 From c699566affc1227c1015e1a7b295d2a91aec459d Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 28 Sep 2017 15:57:08 +0900 Subject: [PATCH 12/16] arm: sc8830: sprd_reg_base: fix the wrong base register address According to spec, 0x40060000 is used the spinlock register, not spinlock control register(0x20c00000). Change-Id: Ifd399cae2416c20a0d45c9b766e73e7d3939fdf7 Signed-off-by: Jaehoon Chung --- arch/arm/include/asm/arch-sc8830/sprd_reg_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-sc8830/sprd_reg_base.h b/arch/arm/include/asm/arch-sc8830/sprd_reg_base.h index aeb0abf..599664d 100644 --- a/arch/arm/include/asm/arch-sc8830/sprd_reg_base.h +++ b/arch/arm/include/asm/arch-sc8830/sprd_reg_base.h @@ -80,7 +80,7 @@ extern "C" #define CTL_BASE_ADI 0x40030000 #define CTL_BASE_AON_SYS_TMR 0x40040000 #define CTL_BASE_AON_TMR 0x40050000 -#define CTL_BASE_SPIN_LCK 0x40060000 +#define CTL_BASE_SPIN_LCK_REG 0x40060000 #define CTL_BASE_RF_SPI 0x40070000 #define CTL_BASE_AON_I2C 0x40080000 #define CTL_BASE_INT 0x40200000 -- 2.7.4 From 37650cea98e5709f2ecbea85e51d13a5b7e35582 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Wed, 27 Sep 2017 17:01:34 +0900 Subject: [PATCH 13/16] mmc: add mmc_legacy_init() in header file mmc_legacy_init() is used when CONFIG_EMMC_BOOT is enabled. Add the mmc_legacy_init() in header file. Change-Id: I96aaee67ee511a484a812f4fe2afa9f4bc3d0620 Signed-off-by: Jaehoon Chung --- include/mmc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/mmc.h b/include/mmc.h index 8cda944..3e5ec5c 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -303,6 +303,9 @@ void print_mmc_devices(char separator); int board_mmc_getcd(u8 *cd, struct mmc *mmc); #ifdef CONFIG_GENERIC_MMC +#ifdef CONFIG_EMMC_BOOT +int mmc_legacy_init(int dev); +#endif int atmel_mci_init(void *regs); #else int mmc_legacy_init(int verbose); -- 2.7.4 From d0fcf75a4dbfa626a4cbff86ac67ae632fa3527c Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 28 Sep 2017 13:42:22 +0900 Subject: [PATCH 14/16] part: add the get_partition_info_efi_with_partnum() in header file Add the get_partition_info_efi_with_partnum() in header file for fixing compiler warning. Change-Id: I1c11f240d84216e9671f2e522f2b5907369b97dc Signed-off-by: Jaehoon Chung --- include/part.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/part.h b/include/part.h index ed8828b..1cfc43b 100644 --- a/include/part.h +++ b/include/part.h @@ -144,6 +144,7 @@ int test_part_amiga (block_dev_desc_t *dev_desc); #ifdef CONFIG_EFI_PARTITION /* disk/part_efi.c */ int get_partition_info_efi (block_dev_desc_t * dev_desc, int part, disk_partition_t *info); +int get_partition_info_efi_with_partnum(block_dev_desc_t * dev_desc, int part, disk_partition_t * info, unsigned long total, unsigned long sdidx, int sdpart, disk_partition_t *sdinfo); int get_partition_info_by_name_efi(block_dev_desc_t * dev_desc, wchar_t* partition_name,disk_partition_t * info); int get_partition_num_by_name_efi(block_dev_desc_t * dev_desc, const char *partition_name); void print_part_efi (block_dev_desc_t *dev_desc); -- 2.7.4 From ba3e33e31a89914b740e9c589e6be3d5f195edfa Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 28 Sep 2017 14:52:31 +0900 Subject: [PATCH 15/16] part_efi: don't build the dead code for checking gpt validation format_gpt_valid() isn't call anywhere. It means that code is dead. In future, someone want to use it, just add the configuration as CONFIG_GPT_FORMAT_VALID. Change-Id: Id6fdcbd0b1e0530779649096637f488024709c2a Signed-off-by: Jaehoon Chung --- disk/part_efi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/disk/part_efi.c b/disk/part_efi.c index 4458d88..5a4f20b 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -95,10 +95,12 @@ static int is_pmbr_valid(legacy_mbr * mbr); static int is_gpt_valid(block_dev_desc_t * dev_desc, unsigned long long lba, gpt_header * pgpt_head, gpt_entry ** pgpt_pte); +#ifdef CONFIG_GPT_FORMAT_VALID #ifdef CONFIG_EMMC_BOOT static int format_gpt_valid(block_dev_desc_t * dev_desc, unsigned long long lba, gpt_header * pgpt_head, gpt_entry ** pgpt_pte); #endif +#endif /* CONFIG_GPT_FORMAT_VALID */ static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc, gpt_header * pgpt_head); @@ -586,6 +588,7 @@ static int is_gpt_valid(block_dev_desc_t * dev_desc, unsigned long long lba, return 1; } +#ifdef CONFIG_GPT_FORMAT_VALID #ifdef CONFIG_EMMC_BOOT /** * format_gpt_valid() - tests one GPT header and PTEs for validity @@ -702,6 +705,7 @@ static int format_gpt_valid(block_dev_desc_t * dev_desc, unsigned long long lba, return 1; } #endif +#endif /* CONFIG_GPT_FORMAT_VALID */ /** * alloc_read_gpt_entries(): reads partition entries from disk -- 2.7.4 From 92911a2107786cb30275ca0f461d95a1ca39903b Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 28 Sep 2017 15:12:02 +0900 Subject: [PATCH 16/16] arm: bootm: remove the unused variables Remove the unused variables for fixing compiler warning. Change-Id: I59fc03e1ffb27b1e1c005ccb0b06c4b81d80b21c Signed-off-by: Jaehoon Chung --- arch/arm/lib/bootm.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index c1b6e24..a9e8ded 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -182,8 +182,6 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images) { ulong rd_len; void (*kernel_entry)(int zero, int dt_machid, void *dtblob); - ulong bootmap_base = getenv_bootm_low(); - ulong of_size = images->ft_len; char **of_flat_tree = &images->ft_addr; ulong *initrd_start = &images->initrd_start; ulong *initrd_end = &images->initrd_end; @@ -198,10 +196,6 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images) if (ret) return ret; - //ret = boot_relocate_fdt(lmb, bootmap_base, of_flat_tree, &of_size); - //if (ret) - // return ret; - debug("## Transferring control to Linux (at address %08lx) ...\n", (ulong) kernel_entry); -- 2.7.4