diff mbox

[U-Boot,V2,1/8] ums: support block devices not MMC devices

Message ID 1399308018-10953-1-git-send-email-swarren@wwwdotorg.org
State Accepted
Delegated to: Marek Vasut
Headers show

Commit Message

Stephen Warren May 5, 2014, 4:40 p.m. UTC
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: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
---
v2: (The series) rebased onto latest u-boot-usb/master to pick up
Mateusz's DFU changes.

 board/samsung/common/ums.c | 7 ++++---
 include/usb_mass_storage.h | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

Comments

Marek Vasut May 5, 2014, 5:45 p.m. UTC | #1
On Monday, May 05, 2014 at 06:40:11 PM, Stephen Warren wrote:
> 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: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>

Lukasz, I think this series is yours, right ? :)

Best regards,
Marek Vasut
Łukasz Majewski May 6, 2014, 6:21 a.m. UTC | #2
Hi Marek,

> On Monday, May 05, 2014 at 06:40:11 PM, Stephen Warren wrote:
> > 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: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Stephen Warren <swarren@nvidia.com>
> > Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
> 
> Lukasz, I think this series is yours, right ? :)

We feel a bit responsible for the gadget code :-).

Przemek (If he don't mind :-)) will look into the v2 of the UMS, since
Stephen has sent it yesterday, and if nothing breaks I will pull them to
u-boot-dfu branch.

> 
> Best regards,
> Marek Vasut
Przemyslaw Marczak May 6, 2014, 8:28 a.m. UTC | #3
Hi,

On 05/06/2014 08:21 AM, Lukasz Majewski wrote:
> Hi Marek,
>
>> On Monday, May 05, 2014 at 06:40:11 PM, Stephen Warren wrote:
>>> 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: Lukasz Majewski <l.majewski@samsung.com>
>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
>>
>> Lukasz, I think this series is yours, right ? :)
>
> We feel a bit responsible for the gadget code :-).
>
> Przemek (If he don't mind :-)) will look into the v2 of the UMS, since
> Stephen has sent it yesterday, and if nothing breaks I will pull them to
> u-boot-dfu branch.
>
>>
>> Best regards,
>> Marek Vasut
>
>
>

Patch number 7 can be applied with "am -3", beside this Trats2 is 
working fine.
Thanks
Łukasz Majewski May 6, 2014, 9:21 a.m. UTC | #4
Hi Stephen,

> 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: Lukasz Majewski <l.majewski@samsung.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
> ---
> v2: (The series) rebased onto latest u-boot-usb/master to pick up
> Mateusz's DFU changes.

Applied to u-boot-dfu branch. Thanks Stephen for your effort.
diff mbox

Patch

diff --git a/board/samsung/common/ums.c b/board/samsung/common/ums.c
index cebabe920a29..ffe63685835c 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 ed460644c1fe..e3eb1ebb2e47 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;