All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 07/14] fastboot: Implement flashing session counter
Date: Tue, 20 Oct 2015 15:41:28 -0400	[thread overview]
Message-ID: <20151020194128.GC23893@bill-the-cat> (raw)
In-Reply-To: <1444912462-3949-8-git-send-email-maxime.ripard@free-electrons.com>

On Thu, Oct 15, 2015 at 02:34:15PM +0200, Maxime Ripard wrote:

> The fastboot flash command that writes an image to a partition works in
> several steps:
> 
> 1 - Retrieve the maximum size the device can download through the
>     "max-download-size" variable
> 
> 2 - Retrieve the partition type through the "partition-type:%s" variable,
>     that indicates whether or not the partition needs to be erased (even
>     though the fastboot client has minimal support for that)
> 
> 3a - If the image is smaller than what the device can handle, send the image
>      and flash it.
> 
> 3b - If the image is larger than what the device can handle, create a
>      sparse image, and split it in several chunks that would fit. Send the
>      chunk, flash it, repeat until we have no more data to send.
> 
> However, in the 3b case, the subsequent transfers have no particular
> identifiers, the protocol just assumes that you would resume the writes
> where you left it.
> 
> While doing so works well, it also means that flashing two subsequent
> images on the same partition (for example because the user made a mistake)
> would not work withouth flashing another partition or rebooting the board,
> which is not really intuitive.
> 
> Since we have always the same pattern, we can however maintain a counter
> that will be reset every time the client will retrieve max-download-size,
> and incremented after each buffer will be flashed, that will allow us to
> tell whether we should simply resume the flashing where we were, or start
> back at the beginning of the partition.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151020/df7edb8a/attachment.sig>

  reply	other threads:[~2015-10-20 19:41 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 12:34 [U-Boot] [PATCH v2 00/14] Implement fastboot over NAND and sparse transfers Maxime Ripard
2015-10-15 12:34 ` [U-Boot] [PATCH v2 01/14] mtd: uboot: Add meaningful error message Maxime Ripard
2015-11-13  1:26   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 02/14] sparse: Move main header parsing to a function of its own Maxime Ripard
2015-11-13  1:26   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 03/14] sparse: Refactor chunk parsing function Maxime Ripard
2015-11-13  1:27   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 04/14] sparse: Simplify multiple logic Maxime Ripard
2015-10-20 19:39   ` Tom Rini
2015-11-13  1:27   ` [U-Boot] [U-Boot,v2,04/14] " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 05/14] fastboot: Move fastboot response functions to fastboot core Maxime Ripard
2015-10-20 19:40   ` Tom Rini
2015-11-13  1:27   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 06/14] sparse: Implement storage abstraction Maxime Ripard
2015-11-13  1:27   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 07/14] fastboot: Implement flashing session counter Maxime Ripard
2015-10-20 19:41   ` Tom Rini [this message]
2015-11-13  1:27   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 08/14] sparse: Implement several chunks flashing Maxime Ripard
2015-10-20 19:47   ` Tom Rini
2015-11-13  1:27   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 09/14] fastboot: Implement NAND backend Maxime Ripard
2015-10-20 19:46   ` Tom Rini
2015-10-21 14:57     ` Maxime Ripard
2015-10-21 20:49       ` Tom Rini
2015-11-13  1:27   ` [U-Boot] [U-Boot,v2,09/14] " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 10/14] fastboot: nand: Add pre erase and write hooks Maxime Ripard
2015-11-13  1:27   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 11/14] sparse: Rename the file and header Maxime Ripard
2015-10-20 19:46   ` Tom Rini
2015-11-13  1:27   ` [U-Boot] [U-Boot,v2,11/14] " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 12/14] sunxi: Add support for android boot image Maxime Ripard
2015-10-15 18:42   ` Ian Campbell
2015-10-15 12:34 ` [U-Boot] [PATCH v2 13/14] sunxi: A13-Olinuxino: Enable the USB OTG controller Maxime Ripard
2015-11-13  1:27   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-10-15 12:34 ` [U-Boot] [PATCH v2 14/14] sunxi: cubietruck: " Maxime Ripard
2015-11-13  1:27   ` [U-Boot] [U-Boot, v2, " Tom Rini
2015-10-17 13:59 ` [U-Boot] [PATCH v2 00/14] Implement fastboot over NAND and sparse transfers Hans de Goede
2015-10-17 14:42   ` Hans de Goede
2015-10-19  8:17     ` Maxime Ripard
2015-10-20 19:32       ` Tom Rini
2015-10-20 19:38         ` Tom Rini

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=20151020194128.GC23893@bill-the-cat \
    --to=trini@konsulko.com \
    --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 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.