[U-Boot] [RFC PATCH v2 13/20] fastboot: Merge reboot-bootloader handling

Alex Kiernan alex.kiernan at gmail.com
Fri May 4 07:34:02 UTC 2018


On Thu, May 3, 2018 at 10:16 PM Joe Hershberger <joe.hershberger at ni.com>
wrote:

> On Mon, Apr 30, 2018 at 3:32 AM, Alex Kiernan <alex.kiernan at 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 at gmail.com>

> One nit below, but,

> Acked-by: Joe Hershberger <joe.hershberger at ni.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;

> Why did you stop returning a proper errno?


checkpatch doesn't like it:

WARNING: ENOSYS means 'invalid syscall nr' and nothing else
#10: FILE: drivers/fastboot/fb_common.c:92:
+ return -ENOSYS;

If that's a warning we're happy to ignore, I'll swap it back.

-- 
Alex Kiernan


More information about the U-Boot mailing list