All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Protsenko <semen.protsenko@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] board: ti: am57xx: Correct the fastboot product var
Date: Thu, 25 Jul 2019 17:43:07 +0300	[thread overview]
Message-ID: <CAKaJLVv-0v5hXucE8zYATiUORJj-83APTu4DXLo3oZjdWFN7Kw@mail.gmail.com> (raw)
In-Reply-To: <e7258a98-673e-7996-3e15-878b68964aa9@ti.com>

On Thu, Jul 25, 2019 at 5:05 PM Andrew F. Davis <afd@ti.com> wrote:
>
> On 7/25/19 9:22 AM, Sam Protsenko wrote:
> > "fastboot flashall" expects "fastboot getvar product" to be
> > "beagle_x15board". Instead, "am57xx" is returned, as it's set in $board
> > env var from SYS_BOARD in board/ti/am57xx/Kconfig file.
> >
> > Override fastboot product variable and set it to correct value, to fix
> > "fastboot flashall".
> >
> > Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> > ---
> >  board/ti/am57xx/board.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
> > index 1a903f13a6..c8eac4edde 100644
> > --- a/board/ti/am57xx/board.c
> > +++ b/board/ti/am57xx/board.c
> > @@ -685,6 +685,11 @@ static int device_okay(const char *path)
> >  }
> >  #endif
> >
> > +static void am57x_set_fastboot_vars(void)
> > +{
> > +     env_set("fastboot.product", "beagle_x15board");
>
>
> This doesn't seem right.. This is common source for all AM57x based
> boards, the only thing we can return here is "am57xx". Either fastboot
> needs some sort of conversion on its side, or we set the exact board
> name the same way we do device-tree name detection.
>

The thing is, we have only beagle_x15 target in AOSP right now, which
we use for all AM57xx based boards (as I understand). So "fastboot
flashall" expects "getvar product" to be exactly that, otherwise it
fails. We can check board_is_x15() to do what you're suggesting to do,
but in that case we won't be able to use "fastboot flashall" e.g. for
AM57xx EVM. How do you suggest to fix that case if we don't return
"beagle_x15board"?

Anyway, do you know any other usages of "getvar product" than this
use-case? As fastboot is Android protocol, I think we should make it
work properly with Android first, and all custom down-stream usages
should respect that.

> Andrew
>
> > +}
> > +
> >  int board_late_init(void)
> >  {
> >       setup_board_eeprom_env();
> > @@ -717,6 +722,7 @@ int board_late_init(void)
> >
> >       omap_die_id_serial();
> >       omap_set_fastboot_vars();
> > +     am57x_set_fastboot_vars();
> >
> >       am57x_idk_lcd_detect();
> >
> >

  reply	other threads:[~2019-07-25 14:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 13:22 [U-Boot] [PATCH] board: ti: am57xx: Correct the fastboot product var Sam Protsenko
2019-07-25 14:05 ` Andrew F. Davis
2019-07-25 14:43   ` Sam Protsenko [this message]
2019-07-25 15:03     ` Andrew F. Davis
2019-07-25 16:28       ` Sam Protsenko
2019-07-25 17:13         ` Sam Protsenko

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=CAKaJLVv-0v5hXucE8zYATiUORJj-83APTu4DXLo3oZjdWFN7Kw@mail.gmail.com \
    --to=semen.protsenko@linaro.org \
    --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.