public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [RESEND 7/7] fastboot: Implement generic fastboot_set_reboot_flag
Date: Sat, 23 Jan 2021 16:11:55 +0100	[thread overview]
Message-ID: <20210123161155.5e8c8cd8@jawa> (raw)
In-Reply-To: <56991dc2a425578649ae5dcbc02901cba800294d.1603442753.git.roman.kovalivskyi@globallogic.com>

Hi Roman,

> It is possible to implement fastboot_set_reboot_flag in a generic way
> if BCB commands are turned on for a target. Using
> bcb_set_reboot_reason allows to do this by simply passing string with
> correct reboot reason that should be handled during next boot process.
> 
> If BCB are turned off, then bcb_set_reboot_reason would simply return
> error, so it won't introduce any new behaviour for such targets.
> 
> Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
> ---
>  drivers/fastboot/fb_common.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/fastboot/fb_common.c
> b/drivers/fastboot/fb_common.c index 736ce1cd024f..005dccf3c967 100644
> --- a/drivers/fastboot/fb_common.c
> +++ b/drivers/fastboot/fb_common.c
> @@ -10,6 +10,7 @@
>   * Rob Herring <robh@kernel.org>
>   */
>  
> +#include <bcb.h>
>  #include <common.h>
>  #include <command.h>
>  #include <env.h>
> @@ -90,7 +91,16 @@ void fastboot_okay(const char *reason, char
> *response) */
>  int __weak fastboot_set_reboot_flag(enum fastboot_reboot_reason
> reason) {
> -	return -ENOSYS;
> +	static const char * const boot_cmds[] = {
> +		[FASTBOOT_REBOOT_REASON_BOOTLOADER] =
> "bootonce-bootloader",
> +		[FASTBOOT_REBOOT_REASON_FASTBOOTD] = "boot-fastboot",
> +		[FASTBOOT_REBOOT_REASON_RECOVERY] = "boot-recovery"
> +	};
> +
> +	if (reason >= FASTBOOT_REBOOT_REASONS_COUNT)
> +		return -EINVAL;
> +
> +	return
> bcb_write_reboot_reason(CONFIG_FASTBOOT_FLASH_MMC_DEV, "misc",
> boot_cmds[reason]); } 
>  /**

This patch causes build breaks when I run the CI on azzure. If it is
still needed, please rebase it and resend.


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210123/1d033591/attachment.sig>

  reply	other threads:[~2021-01-23 15:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23  8:52 [RESEND 0/7] Refactor generic fastboot_set_reboot_flag implementation Roman Kovalivskyi
2020-10-23  8:52 ` [RESEND 1/7] cmd: bcb: Extract '__bcb_load' from 'do_bcb_load' for internal needs Roman Kovalivskyi
2020-10-23  8:52 ` [RESEND 2/7] cmd: bcb: Extract '__bcb_set' from 'do_bcb_set' " Roman Kovalivskyi
2020-10-23  8:52 ` [RESEND 3/7] cmd: bcb: Extract '__bcb_store' from 'do_bcb_store' " Roman Kovalivskyi
2020-10-23  8:52 ` [RESEND 4/7] cmd: bcb: Expose 'bcb_write_reboot_reason' to external callers Roman Kovalivskyi
2020-10-23  8:52 ` [RESEND 5/7] cmd: bcb: Add support for processing const string literals in bcb_set() Roman Kovalivskyi
2020-10-23  8:52 ` [RESEND 6/7] Revert "fastboot: Add default fastboot_set_reboot_flag implementation" Roman Kovalivskyi
2021-01-23 15:08   ` Lukasz Majewski
2021-01-25 17:16     ` Roman Kovalivskyi
2021-01-25 18:10       ` Tom Rini
2021-01-25 18:33       ` Marek Vasut
2020-10-23  8:52 ` [RESEND 7/7] fastboot: Implement generic fastboot_set_reboot_flag Roman Kovalivskyi
2021-01-23 15:11   ` Lukasz Majewski [this message]
2020-12-10  7:30 ` [RESEND 0/7] Refactor generic fastboot_set_reboot_flag implementation Eugeniu Rosca
2020-12-10 16:54   ` Tom Rini
2021-01-22  9:08     ` Eugeniu Rosca

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=20210123161155.5e8c8cd8@jawa \
    --to=lukma@denx.de \
    --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