summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongjin Kim <tobetter@gmail.com>2022-04-20 17:51:32 +0300
committerDongjin Kim <tobetter@gmail.com>2022-04-22 09:01:44 +0300
commit09ffccce617877e1fcb3ab443a11c203b216d0ee (patch)
tree40153de1d2ca77ab4c727bce59fc4dfba6cad641
parent88b784f02e6056b8a69e93a7494cd62fb4c221d5 (diff)
downloadu-boot-09ffccce617877e1fcb3ab443a11c203b216d0ee.tar.xz
ODROID-M1: Revert "gpt: return 1 directly when test the mbr sector"
This reverts commit 3bdef7e642ae558d0e61ce26438d10b55b26ec9c. This commit blocks to boot from SD card, since it won't check it partition type properly and treats it's always EFI partition type. Change-Id: Ic5ae4fe70fdd61addc5cd8dfdb782928535fabea Signed-off-by: Dongjin Kim <tobetter@gmail.com>
-rw-r--r--disk/part_efi.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 27f3e4dda3..32805f1e19 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -445,7 +445,6 @@ static int part_efi_repair(struct blk_desc *dev_desc, gpt_entry *gpt_pte,
static int part_test_efi(struct blk_desc *dev_desc)
{
ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, legacymbr, 1, dev_desc->blksz);
- int ret = 0;
/* Read legacy MBR from block 0 and validate it */
if ((blk_dread(dev_desc, 0, 1, (ulong *)legacymbr) != 1)
@@ -489,10 +488,7 @@ static int part_test_efi(struct blk_desc *dev_desc)
if (part_efi_repair(dev_desc, b_gpt_pte, b_gpt_head,
head_gpt_valid, backup_gpt_valid))
printf("Primary GPT repair fail!\n");
- } else if (head_gpt_valid == 0 && backup_gpt_valid == 0) {
- ret = -1;
}
-
free(h_gpt_pte);
h_gpt_pte = NULL;
free(h_gpt_head);
@@ -503,7 +499,7 @@ static int part_test_efi(struct blk_desc *dev_desc)
b_gpt_head = NULL;
#endif
#endif
- return ret;
+ return 0;
}
/**
@@ -1083,18 +1079,6 @@ static int is_pmbr_valid(legacy_mbr * mbr)
{
int i = 0;
-#ifdef CONFIG_ARCH_ROCKCHIP
- /*
- * In sd-update card, we use RKPARM partition in bootloader to load
- * firmware, and use MS-DOS partition in recovery to update system.
- * Now, we want to use gpt in bootloader and abandon the RKPARM
- * partition. So in new sd-update card, we write the MS-DOS partition
- * table and gpt to sd card. Then we must return 1 directly when test
- * the mbr sector otherwise the gpt is unavailable.
- */
- return 1;
-#endif
-
if (!mbr || le16_to_cpu(mbr->signature) != MSDOS_MBR_SIGNATURE)
return 0;