]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - disk/part.c
Merge branch 'u-boot-tegra/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / disk / part.c
index 4646f682d2c8b6c7f05bf0dc5ea9fba1c8b4f791..d73625c4434c622a4a8d3e0ed78e41667b6eabf5 100644 (file)
 #define PRINTF(fmt,args...)
 #endif
 
-/* Rather than repeat this expression each time, add a define for it */
-#if (defined(CONFIG_CMD_IDE) || \
-     defined(CONFIG_CMD_SATA) || \
-     defined(CONFIG_CMD_SCSI) || \
-     defined(CONFIG_CMD_USB) || \
-     defined(CONFIG_MMC) || \
-     defined(CONFIG_SYSTEMACE) )
-#define HAVE_BLOCK_DEVICE
-#endif
-
 struct block_drvr {
        char *name;
        block_dev_desc_t* (*get_dev)(int dev);
@@ -199,7 +189,7 @@ void dev_print (block_dev_desc_t *dev_desc)
                break;
        }
        puts ("\n");
-       if ((dev_desc->lba * dev_desc->blksz)>0L) {
+       if (dev_desc->lba > 0L && dev_desc->blksz > 0L) {
                ulong mb, mb_quot, mb_rem, gb, gb_quot, gb_rem;
                lbaint_t lba;
 
@@ -472,6 +462,23 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
        int part;
        disk_partition_t tmpinfo;
 
+       /*
+        * For now, we have a special case for sandbox, since there is no
+        * real block device support.
+        */
+       if (0 == strcmp(ifname, "host")) {
+               *dev_desc = NULL;
+               info->start = info->size =  info->blksz = 0;
+               info->bootable = 0;
+               strcpy((char *)info->type, BOOT_PART_TYPE);
+               strcpy((char *)info->name, "Sandbox host");
+#ifdef CONFIG_PARTITION_UUIDS
+               info->uuid[0] = 0;
+#endif
+
+               return 0;
+       }
+
        /* If no dev_part_str, use bootdevice environment variable */
        if (!dev_part_str || !strlen(dev_part_str) ||
            !strcmp(dev_part_str, "-"))