From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Wed, 19 Dec 2012 17:42:13 -0600 Subject: [U-Boot] [PATCH 1/2] spi: Add progress percentage and write speed to `sf update` In-Reply-To: (from sjg@chromium.org on Wed Dec 19 17:20:07 2012) Message-ID: <1355960533.12062.16@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 12/19/2012 05:20:07 PM, Simon Glass wrote: > Hi Wolfgang, > > On Wed, Dec 19, 2012 at 3:10 PM, Wolfgang Denk wrote: > > Dear Simon Glass, > > > > In message <1348878482-1730-1-git-send-email-sjg@chromium.org> you > wrote: > >> From: James Miller > >> > >> Output a progress update only at most 10 times per second, to avoid > >> saturating (and waiting on) the console. Make the summary line > >> to fit on a single line. Make sure that cursor sits at the end of > >> each update line instead of the beginning. > >> > >> Sample output: > >> > >> SF: Detected W25Q32 with page size 4 KiB, total 4 MiB > >> Update SPI > >> 1331200 bytes written, 2863104 bytes skipped in 21.912s, speed > 199728 B/s > > > > I dislike making commands more verbose then needed, or helpful. Of > > course the latter may be considered a matter of taste, but first of > > all you also add code size here for questionable benefit. > > > > I object against this patch: > > > > 1) I cannot see what is so special in the "sf" command that it needs > > such handling, while commands accessing NOR or NAND flash or > > SDCard or any other storage devices don't. > > > > If there is an agreement that this feature should be added, then > it > > should be done in a general way that can be used everywhere. > > > > [Note that I doubt that "if".] > > Hmmm I suppose that is a good point. The main issue with SPI flash is > that it is extremely slow, and writing a few MB can take a minute or > so. The 'sf update' command was intended to do a smart update, and the > progress is useful for that. Other storage types are not so bad. NOR can be pretty slow as well -- and it does have a progress indicator in U-Boot (albeit a simpler one). NAND has a progress meter on erase, and for larger transfers it could probably use one on read/write as well. -Scott