public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] dfu: fix some issues with reads/uploads
Date: Tue, 10 Jun 2014 11:53:17 -0600	[thread overview]
Message-ID: <5397460D.8090102@wwwdotorg.org> (raw)
In-Reply-To: <20140530102857.414614cc@amdc2363>

On 05/30/2014 02:28 AM, Lukasz Majewski wrote:
> Stephen Warren wrote:
...
>> Wouldn't it be better to have the following separate
>> "backends" to DFU:
>>
>> * MMC (raw IO only)
>> * NAND (raw IO only)
>> * RAM (raw IO only)
>> * Filesystem (anything that fs/fat/ext* load/write can support)
>>
>> That way, DFU could be applied to e.g. USB mass storage, IDE,
>> SATA, ... devices too.
> 
> I think that separating the IO even from dfu_mmc.c code would be a good
> way to go. 
> 
> Could you however, present how would you like to fit it to the current
> design?

Here's how I'd love to see the dfu command work. It would take a bit of
refactoring of the code, and a change to the format of the dfu_alt_info
variable and "dfu" command parameters. Perhaps we could have an option
to the "dfu" command saying which cmdline style the user is using?

dfu_alt_info = setting [; setting]*

setting = mmc_format | nand_format | ram_format | fs_format

mmc_format = "mmc" device_id hwpart_num start_sector sector_count

nand_format = "nand" device_id start_sector sector_count

ram_format = "ram" start_address byte_count

fs_format = "fs" fs_device_type fs_device_id filename

All fs access would be through the generic filesystem API in fs/fs.c
rather than by using run_command(). The "fs_device_type",
"fs_device_id", and "filename" parameters in "fs_format" above would
simply be passed directly to the fs.c APIs without any interpretation by
the DFU code. This would allow automatic support of any memory device
type that "load", "ls", ... support. The code also wouldn't have to
construct command-lines and then re-parse them; calling functions
directly is a lot simpler.

The "dfu" command wouldn't take any device type/ID parameters. Instead,
all device IDs would be part of the dfu_alt_info variable. This would
allow e.g. eMMC partitions and SPI flash devices to be exposed at the
same time, rather than having to somehow co-ordinate executing one dfu
command in U-Boot to update the SPI flash, then quitting that, then
starting a different dfu command in U-Boot to update some data on eMMC.
It's harder to automate that vs. just starting dfu once, then running a
single script on the host which writes a bunch of dfu settings in
sequence without the need for co-ordination.

I'm not sure how much time I have to actually work on converting the
code to work that way though. Since we already have a working non-DFU
flashing solution using U-Boot[1], my management sees any work on DFU as
a bit redundant. Still, it would be nice to use standard protocols for
this...

[1] https://github.com/NVIDIA/tegra-uboot-flasher-scripts

  parent reply	other threads:[~2014-06-10 17:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 23:59 [U-Boot] [PATCH] dfu: fix some issues with reads/uploads Stephen Warren
2014-05-22 10:20 ` Lukasz Majewski
2014-05-22 17:06   ` Stephen Warren
2014-05-30  8:28     ` Lukasz Majewski
2014-05-30 20:59       ` Stephen Warren
2014-06-02  6:14         ` Lukasz Majewski
2014-06-02 15:52           ` Stephen Warren
2014-06-03  7:51             ` Lukasz Majewski
2014-06-10 17:53       ` Stephen Warren [this message]
2014-06-12  7:17         ` Lukasz Majewski
2014-06-12 15:25           ` Stephen Warren
2014-06-20 15:16       ` Lukasz Majewski
  -- strict thread matches above, loose matches on Subject: below --
2014-06-10 21:25 Stephen Warren
2014-06-10 21:27 ` Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5397460D.8090102@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox