All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jocelyn Bohr <bohr@google.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH v2 13/20] fastboot: Merge reboot-bootloader handling
Date: Wed, 02 May 2018 05:46:57 +0000	[thread overview]
Message-ID: <CAPJEgOEDmZSGLNTsrEUcwD2PZ6tvvP3Hfe23uwDU7ZQccv6gyg@mail.gmail.com> (raw)
In-Reply-To: <CAO5Uq5RZwwkVTaH0Lkqz_UrSrTHJssfHp2BMBUTHWir0vYbEwA@mail.gmail.com>

On Tue, May 1, 2018 at 1:21 AM Alex Kiernan <alex.kiernan@gmail.com> wrote:

> On Tue, May 1, 2018 at 8:22 AM Alex Kiernan <alex.kiernan@gmail.com>
> wrote:
>
>
> > On Tue, May 1, 2018 at 7:50 AM Jocelyn Bohr <bohr@google.com> wrote:
>
>
>
> > > On Mon, Apr 30, 2018 at 1:33 AM Alex Kiernan <alex.kiernan@gmail.com>
> > wrote:
>
> > >> Extract fb_set_reboot_flag() from USB code and ensure all the overides
> > >> are included, then make the UDP fastboot code go through this same
> > >> path.
>
> > >> Note this changes the behaviour of the fastboot net code such that
> > >> "reboot-bootloader" is no longer written to CONFIG_FASTBOOT_BUF_ADDR
> for
> > >> use as a marker on reboot (the AOSP code in
> common/android-bootloader.c
> > >> uses this marker - this code could be reinstated there if that gets
> > >> merged).
>
> > >> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
> > >> ---
>
> > >> Changes in v2: None
>
> > >>   arch/arm/mach-omap2/boot-common.c     |  2 +-
> > >>   arch/arm/mach-rockchip/rk3128-board.c |  2 +-
> > >>   arch/arm/mach-rockchip/rk322x-board.c |  2 +-
> > >>   drivers/fastboot/fb_common.c          |  5 +++++
> > >>   drivers/usb/gadget/f_fastboot.c       |  5 -----
> > >>   include/fastboot.h                    |  1 +
> > >>   net/fastboot.c                        | 17 +++++++++--------
> > >>   7 files changed, 18 insertions(+), 16 deletions(-)
>
> > >> diff --git a/arch/arm/mach-omap2/boot-common.c
> > b/arch/arm/mach-omap2/boot-common.c
> > >> index f9ab5da..2be5c11 100644
> > >> --- a/arch/arm/mach-omap2/boot-common.c
> > >> +++ b/arch/arm/mach-omap2/boot-common.c
> > >> @@ -238,7 +238,7 @@ void arch_preboot_os(void)
> > >>   }
> > >>   #endif
>
> > >> -#if defined(CONFIG_USB_FUNCTION_FASTBOOT) &&
> > !defined(CONFIG_ENV_IS_NOWHERE)
> > >> +#if CONFIG_IS_ENABLED(FASTBOOT) && !CONFIG_IS_ENABLED(ENV_IS_NOWHERE)
> > >>   int fb_set_reboot_flag(void)
> > >>   {
> > >>          printf("Setting reboot to fastboot flag ...\n");
> > >> diff --git a/arch/arm/mach-rockchip/rk3128-board.c
> > b/arch/arm/mach-rockchip/rk3128-board.c
> > >> index 2e8393d..00ad563 100644
> > >> --- a/arch/arm/mach-rockchip/rk3128-board.c
> > >> +++ b/arch/arm/mach-rockchip/rk3128-board.c
> > >> @@ -112,7 +112,7 @@ int board_usb_cleanup(int index, enum
> usb_init_type
> > init)
> > >>   }
> > >>   #endif
>
> > >> -#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
> > >> +#if CONFIG_IS_ENABLED(FASTBOOT)
> > >>   int fb_set_reboot_flag(void)
> > >>   {
> > >>          struct rk3128_grf *grf;
> > >> diff --git a/arch/arm/mach-rockchip/rk322x-board.c
> > b/arch/arm/mach-rockchip/rk322x-board.c
> > >> index 8642a90..0ddfac8 100644
> > >> --- a/arch/arm/mach-rockchip/rk322x-board.c
> > >> +++ b/arch/arm/mach-rockchip/rk322x-board.c
> > >> @@ -140,7 +140,7 @@ int board_usb_cleanup(int index, enum
> usb_init_type
> > init)
> > >>   }
> > >>   #endif
>
> > >> -#if defined(CONFIG_USB_FUNCTION_FASTBOOT)
> > >> +#if CONFIG_IS_ENABLED(FASTBOOT)
> > >>   int fb_set_reboot_flag(void)
> > >>   {
> > >>          struct rk322x_grf *grf;
> > >> diff --git a/drivers/fastboot/fb_common.c
> b/drivers/fastboot/fb_common.c
> > >> index 8b3627b..36ef669 100644
> > >> --- a/drivers/fastboot/fb_common.c
> > >> +++ b/drivers/fastboot/fb_common.c
> > >> @@ -102,3 +102,8 @@ int fastboot_lookup_command(const char
> *cmd_string)
>
> > >>          return -1;
> > >>   }
> > >> +
> > >> +int __weak fb_set_reboot_flag(void)
> > >> +{
> > >> +       return -1;
> > >> +}
>
> > > Instead could this write the string "reboot-bootloader" to
> > CONFIG_FASTBOOT_BUF_ADDR?
>
>
> > I guess the thing you lose is you don't then get a default "I don't know
> > how to do that" response. Am I right in thinking you're only using this
> > behaviour on Raspberry Pi, or is it broader?
>
>
> Thinking about this some more... if we moved that string write into the
> default fb_set_reboot_flag implementation and then guarded the
> reboot-bootloader command with a new Kconfig symbol, you could get the "I
> don't know how to do that" behaviour by disabling the command?
>

The "reboot-bootloader" behavior isn't RPi specific, it's part of the
fastboot
protocol and is required by all Android bootloaders that support fastboot.

https://android.googlesource.com/platform/system/core/+/master/fastboot/

So my thinking was that since it's part of the protocol, the weak function
could
have some default implementation. I can't think of a reason for a device to
support fastboot but not the "reboot-bootloader" command.

-- 
> Alex Kiernan
>

  reply	other threads:[~2018-05-02  5:46 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30  8:32 [U-Boot] [RFC PATCH v2 00/20] Add fastboot UDP support Alex Kiernan
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 01/20] fastboot: Move fastboot to drivers/fastboot Alex Kiernan
2018-04-30 23:12   ` Simon Glass
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 02/20] fastboot: Switch dependencies on FASTBOOT to USB_FUNCTION_FASTBOOT Alex Kiernan
2018-05-03 18:19   ` Joe Hershberger
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 03/20] fastboot: Refactor fastboot_okay/fail to take response Alex Kiernan
2018-05-03 18:24   ` Joe Hershberger
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 04/20] fastboot: Extract fastboot_okay/fail to fb_common.c Alex Kiernan
2018-05-03 18:26   ` Joe Hershberger
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 05/20] fastboot: Introduce fastboot_response and refactor fastboot_okay/fail Alex Kiernan
2018-05-03 18:28   ` Joe Hershberger
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 06/20] fastboot: Correct dependencies in FASTBOOT_FLASH Alex Kiernan
2018-05-03 18:34   ` Joe Hershberger
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 07/20] net: fastboot: Merge AOSP UDP fastboot Alex Kiernan
2018-05-01  6:28   ` Jocelyn Bohr
2018-05-03 20:38   ` Joe Hershberger
2018-05-08  9:11     ` Alex Kiernan
2018-05-08 15:24       ` Joe Hershberger
2018-05-08 15:51         ` Alex Kiernan
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 08/20] net: fastboot: Support building without MMC Alex Kiernan
2018-05-03 20:39   ` Joe Hershberger
2018-05-04  6:06     ` Jocelyn Bohr
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 09/20] fastboot: Refactor write_fb_response into fastboot_okay/fail/response Alex Kiernan
2018-05-03 20:48   ` Joe Hershberger
2018-05-04  6:00     ` Jocelyn Bohr
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 10/20] fastboot: Merge USB and UDP getvar implementation Alex Kiernan
2018-05-03 20:56   ` Joe Hershberger
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 11/20] fastboot: net: Change 'continue' so it matches USB fastboot Alex Kiernan
2018-05-03 20:58   ` Joe Hershberger
2018-05-04  6:18     ` Jocelyn Bohr
2018-05-08  9:20     ` Alex Kiernan
2018-05-08 15:32       ` Joe Hershberger
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 12/20] fastboot: net: Convert command lookup to a table Alex Kiernan
2018-05-03 21:08   ` Joe Hershberger
2018-05-04  9:14     ` Alex Kiernan
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 13/20] fastboot: Merge reboot-bootloader handling Alex Kiernan
2018-05-01  6:49   ` Jocelyn Bohr
2018-05-01  7:23     ` Alex Kiernan
2018-05-01  8:21       ` Alex Kiernan
2018-05-02  5:46         ` Jocelyn Bohr [this message]
2018-05-02  5:51           ` Jocelyn Bohr
2018-05-02  8:24             ` Alex Kiernan
2018-05-03 21:15   ` Joe Hershberger
2018-05-04  7:34     ` Alex Kiernan
2018-05-04  7:44       ` Joe Hershberger
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 14/20] fastboot: Avoid re-parsing cmd_string for boot/reboot Alex Kiernan
2018-05-03 21:17   ` Joe Hershberger
2018-05-07 21:20     ` Jocelyn Bohr
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 15/20] fastboot: Merge boot common across USB and UDP Alex Kiernan
2018-05-03 21:21   ` Joe Hershberger
2018-05-07 21:59     ` Jocelyn Bohr
2018-05-08  6:08       ` Joe Hershberger
2018-05-08  6:54         ` Alex Kiernan
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 16/20] fastboot: net: Add NAND support Alex Kiernan
2018-05-03 21:24   ` Joe Hershberger
2018-05-08 16:38     ` Jocelyn Bohr
2018-05-08  6:53   ` Jocelyn Bohr
2018-05-08  7:19     ` Joe Hershberger
2018-05-08  9:09       ` Alex Kiernan
2018-05-08 16:37         ` Jocelyn Bohr
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 17/20] fastboot: Guard getvar:partition-type/size with MMC Alex Kiernan
2018-05-03 21:26   ` Joe Hershberger
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 18/20] fastboot: Check if part_name is NULL before using it Alex Kiernan
2018-05-03 21:26   ` Joe Hershberger
2018-05-08  6:55     ` Jocelyn Bohr
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 19/20] fastboot: Add missing newlines Alex Kiernan
2018-05-03 21:26   ` Joe Hershberger
2018-05-08  6:56     ` Jocelyn Bohr
2018-04-30  8:32 ` [U-Boot] [RFC PATCH v2 20/20] fastboot: net: Split fastboot protocol out from net Alex Kiernan
2018-05-03 21:29   ` Joe Hershberger
2018-05-04  6:05     ` Alex Kiernan
2018-05-02  6:33 ` [U-Boot] [RFC PATCH v2 00/20] Add fastboot UDP support Jocelyn Bohr
2018-05-02  8:14   ` Alex Kiernan
2018-05-08  7:13     ` Jocelyn Bohr

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=CAPJEgOEDmZSGLNTsrEUcwD2PZ6tvvP3Hfe23uwDU7ZQccv6gyg@mail.gmail.com \
    --to=bohr@google.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 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.