#if ((CONFIG_COMMANDS & CFG_CMD_IDE) || \
(CONFIG_COMMANDS & CFG_CMD_SCSI) || \
- (CONFIG_COMMANDS & CFG_CMD_USB) ) && defined(CONFIG_DOS_PARTITION)
+ (CONFIG_COMMANDS & CFG_CMD_USB) || \
+ defined(CONFIG_MMC) || \
+ defined(CONFIG_SYSTEMACE) ) && defined(CONFIG_DOS_PARTITION)
/* Convert char[4] in little endian format to the host format integer
*/
(is_extended (p->sys_ind) ? " Extd" : ""));
}
+static int test_block_type(unsigned char *buffer)
+{
+ if((buffer[DOS_PART_MAGIC_OFFSET + 0] != 0x55) ||
+ (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)
+ return DOS_PBR; /* is PBR */
+ return DOS_MBR; /* Is MBR */
+}
+
int test_part_dos (block_dev_desc_t *dev_desc)
{
dev_desc->dev, ext_part_sector);
return;
}
- if (buffer[DOS_PART_MAGIC_OFFSET] != 0x55 ||
- buffer[DOS_PART_MAGIC_OFFSET + 1] != 0xaa) {
+ i=test_block_type(buffer);
+ if(i==-1) {
printf ("bad MBR sector signature 0x%02x%02x\n",
buffer[DOS_PART_MAGIC_OFFSET],
buffer[DOS_PART_MAGIC_OFFSET + 1]);
return;
}
-
+ if(i==DOS_PBR) {
+ printf (" 1\t\t 0\t%10ld\t%2x\n",
+ dev_desc->lba, buffer[DOS_PBR_MEDIA_TYPE_OFFSET]);
+ return;
+ }
/* Print all primary/logical partitions */
pt = (dos_partition_t *) (buffer + DOS_PART_TBL_OFFSET);
for (i = 0; i < 4; i++, pt++) {
switch(dev_desc->if_type) {
case IF_TYPE_IDE:
case IF_TYPE_ATAPI:
- sprintf (info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num);
+ sprintf ((char *)info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num);
break;
case IF_TYPE_SCSI:
- sprintf (info->name, "sd%c%d\n", 'a' + dev_desc->dev, part_num);
+ sprintf ((char *)info->name, "sd%c%d\n", 'a' + dev_desc->dev, part_num);
break;
case IF_TYPE_USB:
- sprintf (info->name, "usbd%c%d\n", 'a' + dev_desc->dev, part_num);
+ sprintf ((char *)info->name, "usbd%c%d\n", 'a' + dev_desc->dev, part_num);
break;
case IF_TYPE_DOC:
- sprintf (info->name, "docd%c%d\n", 'a' + dev_desc->dev, part_num);
+ sprintf ((char *)info->name, "docd%c%d\n", 'a' + dev_desc->dev, part_num);
break;
default:
- sprintf (info->name, "xx%c%d\n", 'a' + dev_desc->dev, part_num);
+ sprintf ((char *)info->name, "xx%c%d\n", 'a' + dev_desc->dev, part_num);
break;
}
/* sprintf(info->type, "%d, pt->sys_ind); */
- sprintf (info->type, "U-Boot");
+ sprintf ((char *)info->type, "U-Boot");
return 0;
}