All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: Frieder Schrempf <frieder@fris.de>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Heiko Thiery <heiko.thiery@gmail.com>,
	Michael Walle <michael@walle.cc>,
	Frieder Schrempf <frieder.schrempf@kontron.de>,
	 Bin Meng <bmeng.cn@gmail.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	 Pratyush Yadav <p.yadav@ti.com>,
	Sean Anderson <seanga2@gmail.com>
Subject: Re: [PATCH] cmd: sf: Support unaligned flash updates with 'sf update'
Date: Thu, 30 Sep 2021 23:03:47 -0600	[thread overview]
Message-ID: <CAPnjgZ3q1Bvm3fdN8yrAJiz+OpHL5bsSvvZhzm0mM+Gb51xOSw@mail.gmail.com> (raw)
In-Reply-To: <20210930161926.2748887-1-frieder@fris.de>

Hi Frieder,

On Thu, 30 Sept 2021 at 10:20, Frieder Schrempf <frieder@fris.de> wrote:
>
> From: Frieder Schrempf <frieder.schrempf@kontron.de>
>
> Currently 'sf update' supports only offsets that are aligned to the
> erase block size of the serial flash. Unaligned offsets result in
> something like:
>
> => sf update ${kernel_addr_r} 0x400 ${filesize}
> device 0 offset 0x400, size 0x11f758
> SPI flash failed in erase step

<insert motivation for patch here>

>
> In order to support unaligned updates, we simply read the first full
> block and check only the requested part of the block for changes. If
> necessary, the block is erased, the first (unchanged) part of the block
> is written back together with the second part of the block (updated data).
>
> Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
> ---
>  cmd/sf.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
>

Regards,
Simon

      parent reply	other threads:[~2021-10-01  5:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 16:19 [PATCH] cmd: sf: Support unaligned flash updates with 'sf update' Frieder Schrempf
2021-09-30 16:35 ` Michael Walle
2021-09-30 17:17   ` Frieder Schrempf
2021-09-30 21:08     ` Michael Walle
2021-10-04 10:31       ` Frieder Schrempf
2021-10-04 11:21         ` Michael Walle
2021-09-30 21:21 ` Michael Walle
2021-10-04 10:41   ` Frieder Schrempf
2021-10-01  5:03 ` Simon Glass [this message]

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=CAPnjgZ3q1Bvm3fdN8yrAJiz+OpHL5bsSvvZhzm0mM+Gb51xOSw@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=bmeng.cn@gmail.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=frieder@fris.de \
    --cc=heiko.thiery@gmail.com \
    --cc=jagan@amarulasolutions.com \
    --cc=michael@walle.cc \
    --cc=p.yadav@ti.com \
    --cc=seanga2@gmail.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.