All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/8] ums: support block devices not MMC devices
@ 2014-04-30 21:13 Stephen Warren
  2014-04-30 21:13 ` [U-Boot] [PATCH 2/8] ums: remove UMS_{NUM, START}_SECTORS + UMS_START_SECTOR Stephen Warren
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Stephen Warren @ 2014-04-30 21:13 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

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: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 board/samsung/common/ums.c | 7 ++++---
 include/usb_mass_storage.h | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/board/samsung/common/ums.c b/board/samsung/common/ums.c
index dc155ad0e5b3..60e7d2a2bd6e 100644
--- a/board/samsung/common/ums.c
+++ b/board/samsung/common/ums.c
@@ -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;
diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h
index 058dcf117404..12fbae447c09 100644
--- a/include/usb_mass_storage.h
+++ b/include/usb_mass_storage.h
@@ -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;
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-05-05 16:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-30 21:13 [U-Boot] [PATCH 1/8] ums: support block devices not MMC devices Stephen Warren
2014-04-30 21:13 ` [U-Boot] [PATCH 2/8] ums: remove UMS_{NUM, START}_SECTORS + UMS_START_SECTOR Stephen Warren
2014-04-30 21:13 ` [U-Boot] [PATCH 3/8] ums: remove error-checking of MMC device size Stephen Warren
2014-05-01 20:00   ` Stephen Warren
2014-04-30 21:13 ` [U-Boot] [PATCH 4/8] ums: remove ums_disk_init() Stephen Warren
2014-04-30 21:13 ` [U-Boot] [PATCH 5/8] ums: move IO support code to common location Stephen Warren
2014-04-30 21:13 ` [U-Boot] [PATCH 6/8] ums: use get_device() not find_mmc_device(); Stephen Warren
2014-04-30 21:13 ` [U-Boot] [PATCH 7/8] ums: move all variable declarations to the start of the block Stephen Warren
2014-05-01 10:51   ` Marek Vasut
2014-05-01 16:58     ` Stephen Warren
2014-05-01 19:43       ` Lukasz Majewski
2014-05-01 21:47         ` Stephen Warren
2014-05-05  9:16           ` Przemyslaw Marczak
2014-05-05 16:33             ` Stephen Warren
2014-05-02  4:45       ` Marek Vasut
2014-04-30 21:13 ` [U-Boot] [PATCH 8/8] ums: allow the user to specify the device type Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.