mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] mvebu: create bbu handler for kwb images and use it on cubox
Date: Mon, 11 Jun 2018 08:49:22 +0200	[thread overview]
Message-ID: <20180611064922.qmf3k7mfanv5g4j5@pengutronix.de> (raw)
In-Reply-To: <20180611064326.zkre4wacg2zkluov@pengutronix.de>

Hallo Sascha,

On Mon, Jun 11, 2018 at 08:43:26AM +0200, Sascha Hauer wrote:
> On Fri, Jun 08, 2018 at 10:42:44AM +0200, Uwe Kleine-König wrote:
> > +static int mvebu_bbu_flash_update_handler(struct bbu_handler *bbuh,
> > +					  struct bbu_data *data)
> > +{
> > +	struct mvebu_bbu_handler *mbbuh =
> > +		container_of(bbuh, struct mvebu_bbu_handler, bbuh);
> > +	const void *image = data->image;
> > +	size_t size = data->len;
> > +	enum filetype ft = file_detect_type(image, size);
> > +
> > +	if ((mbbuh->version == 0 && ft == filetype_kwbimage_v0) ||
> > +	    (mbbuh->version == 1 && ft == filetype_kwbimage_v1) ||
> > +	    data->flags & BBU_FLAG_FORCE) {
> > +		int ret = bbu_confirm(data);
> > +		if (ret)
> > +			return ret;
> > +
> > +		return write_file_flash(bbuh->devicefile, image, size);
> > +	} else {
> > +		pr_err("%s is not a valid kwbimage\n", data->imagefile);
> > +		return -EINVAL;
> > +	}
> > +}
> 
> Could this code be shared with other boards?

Sure. It should work on all mvebu targets that boot from a flash memory.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2018-06-11  6:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08  8:42 Uwe Kleine-König
2018-06-11  6:43 ` Sascha Hauer
2018-06-11  6:49   ` Uwe Kleine-König [this message]
2018-06-11  6:58   ` Sascha Hauer
2018-06-11 20:38 ` Sascha Hauer
2018-06-12  5:42   ` [PATCH] fixup! " Uwe Kleine-König
2018-06-13  8:28     ` Sascha Hauer

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=20180611064922.qmf3k7mfanv5g4j5@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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