public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 2/2] sunxi: add "fel" boot target
Date: Sun, 27 Sep 2015 00:03:01 +0300	[thread overview]
Message-ID: <20150927000301.1d12828d@i7> (raw)
In-Reply-To: <55F6B3B1.3060404@redhat.com>

On Mon, 14 Sep 2015 13:46:57 +0200
Hans de Goede <hdegoede@redhat.com> wrote:

> Hi,
> 
> On 14-09-15 13:42, Hans de Goede wrote:
> 
> >> Supporting both boot.scr and uEnv.txt for FEL boot seems to be
> >> reasonably simple to me. You can even do it in a single patch
> >> series. As Hans suggests, please take care of the boot.scr case
> >> first. Then maybe introduce uEnv.txt support with an additional
> >> patch.
> >
> > I'm still not convinced that support uEnv.txt is necessary at all,
> > but I agree that if we this having this done through extra fields,
> > rather then through a union would be better.
> 
> p.s.
> 
> As for the version byte vs minor/major scheme discussion. Why not
> simply declare that we will always be backwards compatible, and
> only ever add new fields ? Then we can simply add version checks
> around those new fields, and have both back and forward compatibility.
> 
> In this case the single byte should suffice nicely.

Regarding "Why not simply declare that we will always be backwards
compatible". Certain things are not always in our perfect control.
It's better not to make unnecessary promises, otherwise they can
become a liability :-)

For example, let's suppose that we have added data fields for
both "uEnv.txt" and "boot.scr" in the SPL header. Then suppose
that later U-Boot maintainers decide to deprecate and drop support
of one of these methods in favour of the other.

This situation can be handled by doing the major version increase
and removing the obsolete field from the SPL header. The "fel" tool
would notice that the U-Boot binary is incompatible and complain,
providing the user with all the necessary hints.

But if we don't have the concept of major/minor versions, then the
"fel" tool would be just assuming full backwards compatibility and
happily trying to pass the obsolete data to U-Boot.

Yes, we can also always change the SPL header signature in the case
of introducing incompatible changes. But the down side is that the
"fel" tool would treat this situation as "unknown bootloader"
instead of "incompatible U-Boot".

Anyway, nothing really needs to be changed on the U-Boot side at
this moment and the Bernhard's patches don't need any modifications.
It's up to the "fel" tool how to interpret the version byte. For
example, we can arbitrarily decide that the top 4 bits are used for
the major version part and low 4 bits are used for the minor version
part. If only the minor version number is changed, then assume
backwards compatibility. If the major version number has changed,
then complain to the user.

-- 
Best regards,
Siarhei Siamashka

      reply	other threads:[~2015-09-26 21:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 14:11 [U-Boot] [RFC PATCH 0/2] sunxi: support FEL-provided environment vars and "fel" boot target Bernhard Nortmann
2015-09-03 14:11 ` [U-Boot] [RFC PATCH 1/2] sunxi: retrieve FEL-provided values to environment variables Bernhard Nortmann
2015-09-10 18:34   ` Hans de Goede
2015-09-11  9:08     ` Bernhard Nortmann
2015-09-12 11:58     ` Ian Campbell
2015-09-12 12:24       ` Hans de Goede
2015-09-14 13:12         ` Bernhard Nortmann
2015-09-03 14:12 ` [U-Boot] [RFC PATCH 2/2] sunxi: add "fel" boot target Bernhard Nortmann
2015-09-10 18:36   ` Hans de Goede
2015-09-11  9:31     ` Bernhard Nortmann
2015-09-12 12:48       ` Hans de Goede
2015-09-13  7:15         ` Ian Campbell
2015-09-14 10:33       ` Siarhei Siamashka
2015-09-14 11:42         ` Hans de Goede
2015-09-14 11:46           ` Hans de Goede
2015-09-26 21:03             ` Siarhei Siamashka [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=20150927000301.1d12828d@i7 \
    --to=siarhei.siamashka@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox