summaryrefslogtreecommitdiff
path: root/disk/part_dos.c
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2010-12-28 10:58:36 +0800
committerTerry Lv <r65388@freescale.com>2010-12-29 10:36:26 +0800
commit17b4c8e9eb30e3eb305baef98eb23325e61db592 (patch)
tree37a61babb35f73b633850303ab57923bb42b95cb /disk/part_dos.c
parent07ce4f0a2fee112bd3043d162b201abd65a52b6c (diff)
downloadu-boot-imx-17b4c8e9eb30e3eb305baef98eb23325e61db592.zip
u-boot-imx-17b4c8e9eb30e3eb305baef98eb23325e61db592.tar.gz
u-boot-imx-17b4c8e9eb30e3eb305baef98eb23325e61db592.tar.bz2
ENGR00137408: Add FAT32 support
Add FAT32 support. The code is got from community. Based on hash number 71aab09b2c1edd1b6e00819abd1e31c04db04f36. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'disk/part_dos.c')
-rw-r--r--disk/part_dos.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/disk/part_dos.c b/disk/part_dos.c
index b915eb7..ff9aa6e 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -77,8 +77,10 @@ static int test_block_type(unsigned char *buffer)
(buffer[DOS_PART_MAGIC_OFFSET + 1] != 0xaa) ) {
return (-1);
} /* no DOS Signature at all */
- if(strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET],"FAT",3)==0)
+ if (strncmp((char *)&buffer[DOS_PBR_FSTYPE_OFFSET], "FAT", 3) == 0 ||
+ strncmp((char *)&buffer[DOS_PBR32_FSTYPE_OFFSET], "FAT32", 5) == 0) {
return DOS_PBR; /* is PBR */
+ }
return DOS_MBR; /* Is MBR */
}
@@ -188,7 +190,8 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part
* fdisk does not show the extended partitions that
* are not in the MBR
*/
- if ((pt->sys_ind != 0) &&
+ if (((pt->boot_ind & ~0x80) == 0) &&
+ (pt->sys_ind != 0) &&
(part_num == which_part) &&
(is_extended(pt->sys_ind) == 0)) {
info->blksz = 512;