]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ums: support block devices not MMC devices
authorStephen Warren <swarren@nvidia.com>
Mon, 5 May 2014 16:40:11 +0000 (10:40 -0600)
committerLukasz Majewski <l.majewski@samsung.com>
Thu, 8 May 2014 08:38:29 +0000 (10:38 +0200)
The USB Mass Storage function could equally well support a SATA device
as support an MMC device. Update struct ums to contain a block device
descriptor, not an MMC device descriptor.

Cc: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
board/samsung/common/ums.c
include/usb_mass_storage.h

index cebabe920a29de022c99e5a1429e11929ce8ee74..ffe63685835c21061c8eb7e9b98ace37c727c295 100644 (file)
@@ -7,12 +7,13 @@
 
 #include <common.h>
 #include <usb_mass_storage.h>
+#include <mmc.h>
 #include <part.h>
 
 static int ums_read_sector(struct ums *ums_dev,
                           ulong start, lbaint_t blkcnt, void *buf)
 {
-       block_dev_desc_t *block_dev = &ums_dev->mmc->block_dev;
+       block_dev_desc_t *block_dev = ums_dev->block_dev;
        lbaint_t blkstart = start + ums_dev->start_sector;
        int dev_num = block_dev->dev;
 
@@ -22,7 +23,7 @@ static int ums_read_sector(struct ums *ums_dev,
 static int ums_write_sector(struct ums *ums_dev,
                            ulong start, lbaint_t blkcnt, const void *buf)
 {
-       block_dev_desc_t *block_dev = &ums_dev->mmc->block_dev;
+       block_dev_desc_t *block_dev = ums_dev->block_dev;
        lbaint_t blkstart = start + ums_dev->start_sector;
        int dev_num = block_dev->dev;
 
@@ -45,7 +46,7 @@ static struct ums *ums_disk_init(struct mmc *mmc)
                return NULL;
        }
 
-       ums_dev.mmc = mmc;
+       ums_dev.block_dev = &mmc->block_dev;
 
        if (ums_end_sector <= mmc_end_sector) {
                ums_dev.start_sector = UMS_START_SECTOR;
index ed460644c1fe9152243ad97ddd516aaa9ef6e87a..e3eb1ebb2e47bf47d6b00188508cc424a8b2c181 100644 (file)
@@ -9,7 +9,7 @@
 #define __USB_MASS_STORAGE_H__
 
 #define SECTOR_SIZE            0x200
-#include <mmc.h>
+#include <part.h>
 #include <linux/usb/composite.h>
 
 #ifndef UMS_START_SECTOR
@@ -31,7 +31,7 @@ struct ums {
        unsigned int start_sector;
        unsigned int num_sectors;
        const char *name;
-       struct mmc *mmc;
+       block_dev_desc_t *block_dev;
 };
 
 extern struct ums *ums;