diff options
author | Luke Go <luke.go@hardkernel.com> | 2019-01-25 18:39:25 +0900 |
---|---|---|
committer | Dongjin Kim <tobetter@gmail.com> | 2019-01-25 19:01:44 +0900 |
commit | 2892f2fbdca5a68cab93f89a07aad123c258e8e0 (patch) | |
tree | 7534df62771f818b90ae99483dc4429ccb2e631f | |
parent | 9c079b1c6b72fa9d1a4567cabbb97a6342b8ece1 (diff) | |
download | u-boot-odroid-c1-2892f2fbdca5a68cab93f89a07aad123c258e8e0.tar.gz |
ODROID-COMMON: android: Reordering the partition table type.
Before this patch, each of accessing the partition table commands are
using the 'MPT' table. After the patch, checking the table type are
reordered and the 'MBR' table is used. So each commands can access via
the 'MBR' table. Just the fastboot using the 'MPT' table.
Change-Id: I819690fa90302737d65d7b4093fe0f9819cfa854
-rw-r--r-- | board/hardkernel/odroid-common/partition.c | 3 | ||||
-rw-r--r-- | common/cmd_fastboot.c | 22 | ||||
-rw-r--r-- | disk/part.c | 16 |
3 files changed, 32 insertions, 9 deletions
diff --git a/board/hardkernel/odroid-common/partition.c b/board/hardkernel/odroid-common/partition.c index a1bbc7a4d8..d16da3a801 100644 --- a/board/hardkernel/odroid-common/partition.c +++ b/board/hardkernel/odroid-common/partition.c @@ -151,7 +151,6 @@ int board_fdisk_all(void) block_dev_desc_t *dev_desc = &mmc->block_dev; - init_part(dev_desc); board_partition_list(); /* Read the first sector, MBR, to buffer */ @@ -194,5 +193,7 @@ int board_fdisk_all(void) return -EIO; } + init_part(dev_desc); + return 0; } diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c index a210579be6..e91b541ee6 100644 --- a/common/cmd_fastboot.c +++ b/common/cmd_fastboot.c @@ -10,6 +10,7 @@ #include <common.h> #include <command.h> #include <g_dnl.h> +#include <mmc.h> #if defined(CONFIG_ODROID_COMMON) extern int board_partition_list(void); @@ -21,6 +22,19 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) #if defined(CONFIG_ODROID_COMMON) board_partition_list(); + + int mmc_dev = board_current_mmc(); + struct mmc *mmc = find_mmc_device(mmc_dev); + if (mmc == NULL) + return -ENODEV; + block_dev_desc_t *dev_desc = &mmc->block_dev; +#endif + +#ifdef CONFIG_MPT_PARTITION + if (test_part_mpt(dev_desc) == 0) { + printf("%s() %d: PART_TYPE_MPT\n", __func__, __LINE__); + dev_desc->part_type = PART_TYPE_MPT; + } #endif g_dnl_clear_detach(); @@ -38,6 +52,14 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) g_dnl_unregister(); g_dnl_clear_detach(); + +#ifdef CONFIG_DOS_PARTITION + if (test_part_dos(dev_desc) == 0) { + printf("%s() %d: PART_TYPE_DOS\n", __func__, __LINE__); + dev_desc->part_type = PART_TYPE_DOS; + } +#endif + return CMD_RET_SUCCESS; } diff --git a/disk/part.c b/disk/part.c index f8f2e0524d..ce072dcf92 100644 --- a/disk/part.c +++ b/disk/part.c @@ -277,14 +277,6 @@ void init_part(block_dev_desc_t *dev_desc) } #endif -#ifdef CONFIG_MPT_PARTITION - if (test_part_mpt(dev_desc) == 0) { - printf("%s() %d: PART_TYPE_MPT\n", __func__, __LINE__); - dev_desc->part_type = PART_TYPE_MPT; - return; - } -#endif - #ifdef CONFIG_DOS_PARTITION if (test_part_dos(dev_desc) == 0) { printf("%s() %d: PART_TYPE_DOS\n", __func__, __LINE__); @@ -293,6 +285,14 @@ void init_part(block_dev_desc_t *dev_desc) } #endif +#ifdef CONFIG_MPT_PARTITION + if (test_part_mpt(dev_desc) == 0) { + printf("%s() %d: PART_TYPE_MPT\n", __func__, __LINE__); + dev_desc->part_type = PART_TYPE_MPT; + return; + } +#endif + #ifdef CONFIG_AMIGA_PARTITION if (test_part_amiga(dev_desc) == 0) { dev_desc->part_type = PART_TYPE_AMIGA; |