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@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox