* [U-Boot] [PATCH] dfu: mmc: return data from raw partition reads
@ 2014-05-16 23:23 Stephen Warren
2014-05-19 22:07 ` Stephen Warren
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2014-05-16 23:23 UTC (permalink / raw)
To: u-boot
From: Stephen Warren <swarren@nvidia.com>
Nothing in dfu_mmc.c ever sets dfu->r_left. Consequently, reads from
MMC DFU altsettings would return 0 bytes.
Fix this by modifying dfu_read_medium_mmc() to set *len in the same way
that dfu_nand.c's dfu_read_medium_nand() does.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
Even though this mirrors how dfu_nand.c works, it feels odd to do this
every time a HW read is performed, since I believe this can happen
multiple times in a single DFU read transaction. Surely *len (and hence
dfu->r_left) should be set up once when the altsetting is initialized,
likely by calling a separate function in struct dfu_entity?
P.S. Could you please add a "dfu" entry into doc/git-mailrc?
---
drivers/dfu/dfu_mmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index 63cc876612c9..3addcef68bde 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -203,6 +203,7 @@ int dfu_read_medium_mmc(struct dfu_entity *dfu, u64 offset, void *buf,
switch (dfu->layout) {
case DFU_RAW_ADDR:
+ *len = dfu->data.mmc.lba_size * dfu->data.mmc.lba_blk_size;
ret = mmc_block_op(DFU_OP_READ, dfu, offset, buf, len);
break;
case DFU_FS_FAT:
--
1.8.1.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] dfu: mmc: return data from raw partition reads
2014-05-16 23:23 [U-Boot] [PATCH] dfu: mmc: return data from raw partition reads Stephen Warren
@ 2014-05-19 22:07 ` Stephen Warren
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Warren @ 2014-05-19 22:07 UTC (permalink / raw)
To: u-boot
On 05/16/2014 05:23 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Nothing in dfu_mmc.c ever sets dfu->r_left. Consequently, reads from
> MMC DFU altsettings would return 0 bytes.
>
> Fix this by modifying dfu_read_medium_mmc() to set *len in the same way
> that dfu_nand.c's dfu_read_medium_nand() does.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> Even though this mirrors how dfu_nand.c works, it feels odd to do this
> every time a HW read is performed, since I believe this can happen
> multiple times in a single DFU read transaction. Surely *len (and hence
> dfu->r_left) should be set up once when the altsetting is initialized,
> likely by calling a separate function in struct dfu_entity?
>
> P.S. Could you please add a "dfu" entry into doc/git-mailrc?
Hmm. Scratch this specific patch. While it makes some forms of reads
work, larger reads (e.g. of an entire 4MB boot0 eMMC HW partition) blow
up horribly. If anyone has any pointers on how this is supposed to work,
I'd be interested. I'm not sure that eMMC DFU read has actually been
tested...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-19 22:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-16 23:23 [U-Boot] [PATCH] dfu: mmc: return data from raw partition reads Stephen Warren
2014-05-19 22:07 ` Stephen Warren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox