mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: nikita.yoush@cogentembedded.com, barebox@lists.infradead.org,
	cphealy@gmail.com
Subject: Re: [PATCH v2 4/4] ARM: i.MX: Add support for ZII RDU1 board
Date: Mon, 25 Jun 2018 18:30:07 +0200	[thread overview]
Message-ID: <1529944207.9910.29.camel@pengutronix.de> (raw)
In-Reply-To: <CAHQ1cqEMipPPqTvVFPO4YYCB7ojNmh8Jq6Lcem8e7UMrKU83mQ@mail.gmail.com>

Am Montag, den 25.06.2018, 09:11 -0700 schrieb Andrey Smirnov:
[...]
> > > +
> > > +/**
> > > + * zii_rdu1_bbu_spi_update - RDU1 specific BBU handler
> > > + *
> > > > + * @handler:       BBU handler pointer passed down by BBU framework
> > > > + * @data:  BBU data pointer passed down by BBU framework
> > > 
> > > + *
> > > + * RDU1 design chose to use first page of the onboard dataflash to
> > > + * store vendor board-specific paramters, which is problematic because
> > > + * imx_bbu_internal_v1_update() will not spare that region when
> > > + * peforming the update.
> > > + *
> > > + * This functions works as a thin wrapper around
> > > + * imx_bbu_internal_v1_update() and saves the data before and restores
> > > + * it after, keeping board specific data intact.
> > > + */
> > 
> > In general I like the idea of replacing the update handler in the
> > board, as it shows clearly that this is some board specific quirk.
> > 
> > I don't fully agree on the implementation of the handler though.
> > Overwriting and restoring the config area still has the risk of
> > destroying this data, leaving the unit in a bricked state.
> > 
> 
> The only info contained in config area is unit's MAC address and and
> LCD panel type. Loosing this information, while inconvenient, is not
> going to brick the unit. Additionally:
> 
> -  LCD type information could and is tentatively planed to be derived
> from P/N information available via RAVE SP EEPROM, so that leaves us
> with just MAC address.
> 
> - Config header in SPI NOR is also duplicated in SPI EEPROM connected
> to i.MX51, so it can be resorted from there if need be.
> 
> - Removing this risk will do nothing to the risk of truly bricking the
> unit via failed bootloader upgrade which is several orders of
> magnitude more likely due to size difference of bootloader image vs
> config area.

Yea, I thought there was some more valuable thing stored in this area.

> > As the config area is page aligned, there is no need to touch it at all
> > (I think). All you need to do is to point the BBU target at the barebox
> > partition on the dataflash and truncate the barebox image in the custom
> > handler by changing data->image and data->len in the custom RDU1
> > handler.
> > 
> 
> I'll give this approach a try since it sounds like it's going to allow
> me to drop a bit of extra code, but if it doesn't I think the original
> code is good enough and we should let the perfect be the enemy of the
> good.

Agreed. I won't object to the current approach if the simpler option
turns out to not work for some reason.

Regards,
Lucas

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

      reply	other threads:[~2018-06-25 16:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 19:24 [PATCH v2 0/4] ZII RDU1 support Andrey Smirnov
2018-06-20 19:24 ` [PATCH v2 1/4] ARM: babbage: Make PMIC initialization shareable Andrey Smirnov
2018-06-20 19:24 ` [PATCH v2 2/4] bbu: Make bbu_find_handler_by_device() public Andrey Smirnov
2018-06-20 19:24 ` [PATCH v2 3/4] ARM: i.MX: bbu: Make imx_bbu_internal_v1_update() public Andrey Smirnov
2018-06-20 19:24 ` [PATCH v2 4/4] ARM: i.MX: Add support for ZII RDU1 board Andrey Smirnov
2018-06-25  9:03   ` Lucas Stach
2018-06-25 16:11     ` Andrey Smirnov
2018-06-25 16:30       ` Lucas Stach [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=1529944207.9910.29.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=andrew.smirnov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=cphealy@gmail.com \
    --cc=nikita.yoush@cogentembedded.com \
    /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