ima3-mx53:Rename CONFIG_PRIME => CONFIG_ETHPRME, remove
[platform/kernel/u-boot.git] / disk / part_dos.c
index b915eb7..a43dd9c 100644 (file)
@@ -36,7 +36,6 @@
 #include "part_dos.h"
 
 #if defined(CONFIG_CMD_IDE) || \
-    defined(CONFIG_CMD_MG_DISK) || \
     defined(CONFIG_CMD_SATA) || \
     defined(CONFIG_CMD_SCSI) || \
     defined(CONFIG_CMD_USB) || \
@@ -77,15 +76,17 @@ 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 */
 }
 
 
 int test_part_dos (block_dev_desc_t *dev_desc)
 {
-       unsigned char buffer[DEFAULT_SECTOR_SIZE];
+       ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
 
        if ((dev_desc->block_read(dev_desc->dev, 0, 1, (ulong *) buffer) != 1) ||
            (buffer[DOS_PART_MAGIC_OFFSET + 0] != 0x55) ||
@@ -100,7 +101,7 @@ int test_part_dos (block_dev_desc_t *dev_desc)
 static void print_partition_extended (block_dev_desc_t *dev_desc, int ext_part_sector, int relative,
                                                           int part_num)
 {
-       unsigned char buffer[DEFAULT_SECTOR_SIZE];
+       ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
        dos_partition_t *pt;
        int i;
 
@@ -164,7 +165,7 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part
                                 int relative, int part_num,
                                 int which_part, disk_partition_t *info)
 {
-       unsigned char buffer[DEFAULT_SECTOR_SIZE];
+       ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
        dos_partition_t *pt;
        int i;
 
@@ -188,7 +189,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;