All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
To: u-boot@lists.denx.de
Subject: [RESEND 6/7] Revert "fastboot: Add default fastboot_set_reboot_flag implementation"
Date: Mon, 25 Jan 2021 19:16:37 +0200	[thread overview]
Message-ID: <6db5a822-eca6-4415-91fa-0d6594e5df93@globallogic.com> (raw)
In-Reply-To: <20210123160838.01f8e455@jawa>

Hi Lukasz,

On 1/23/21 5:08 PM, Lukasz Majewski wrote:
> Hi Roman,
> 
>> This reverts commit 0ebf9842e56c5b8cb7cb1f990bb452cc14af6225.
>>
>> Current generic implementation of fastboot_set_reboot_flag is somewhat
>> messy and requires some additional configuration option to be enabled
>> besides CMD_BCB, so it reverts that implementtion in order to bring a
>> new cleaner one.
>>
>> Next commit introduces new generic implementation of
>> fastboot_set_reboot_flag.
>>
>> Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
>> ---
>>   drivers/fastboot/Kconfig       | 12 ----------
>>   drivers/fastboot/Makefile      |  1 -
>>   drivers/fastboot/fb_bcb_impl.c | 43
>> ---------------------------------- include/fastboot.h             |
>> 9 ------- 4 files changed, 65 deletions(-)
>>   delete mode 100644 drivers/fastboot/fb_bcb_impl.c
>>
>> diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig
>> index 4352ba67a713..d4436dfc9173 100644
>> --- a/drivers/fastboot/Kconfig
>> +++ b/drivers/fastboot/Kconfig
>> @@ -165,18 +165,6 @@ config FASTBOOT_CMD_OEM_FORMAT
>>   	  relies on the env variable partitions to contain the list
>> of partitions as required by the gpt command.
>>   
>> -config FASTBOOT_USE_BCB_SET_REBOOT_FLAG
>> -	bool "Use BCB by fastboot to set boot reason"
>> -	depends on CMD_BCB && !ARCH_MESON && !ARCH_ROCKCHIP &&
>> !TARGET_KC1 && \
>> -	  !TARGET_SNIPER && !TARGET_AM57XX_EVM && !TARGET_DRA7XX_EVM
>> -	default y
>> -	help
>> -	  Fastboot could implement setting of reboot reason in a
>> generic fashion
>> -	  via BCB commands. BCB commands are able to write reboot
>> reason into
>> -	  command field of boot control block. In general case it is
>> sufficient
>> -	  implementation if your platform supports BCB commands and
>> doesn't
>> -	  require any specific reboot reason handling.
>> -
>>   endif # FASTBOOT
>>   
>>   endmenu
>> diff --git a/drivers/fastboot/Makefile b/drivers/fastboot/Makefile
>> index 2b2c390fe4de..048af5aa8234 100644
>> --- a/drivers/fastboot/Makefile
>> +++ b/drivers/fastboot/Makefile
>> @@ -5,4 +5,3 @@ obj-y += fb_getvar.o
>>   obj-y += fb_command.o
>>   obj-$(CONFIG_FASTBOOT_FLASH_MMC) += fb_mmc.o
>>   obj-$(CONFIG_FASTBOOT_FLASH_NAND) += fb_nand.o
>> -obj-$(CONFIG_FASTBOOT_USE_BCB_SET_REBOOT_FLAG) += fb_bcb_impl.o
>> diff --git a/drivers/fastboot/fb_bcb_impl.c
>> b/drivers/fastboot/fb_bcb_impl.c deleted file mode 100644
>> index 89ec3601b6f6..000000000000
>> --- a/drivers/fastboot/fb_bcb_impl.c
>> +++ /dev/null
>> @@ -1,43 +0,0 @@
>> -// SPDX-License-Identifier: GPL-2.0+
>> -/*
>> - * Copyright 2020 GlobalLogic.
>> - * Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
>> - */
>> -
>> -#include <common.h>
>> -#include <fastboot.h>
>> -
>> -/**
>> - * fastboot_set_reboot_flag() - Set flag to indicate
>> reboot-bootloader
>> - *
>> - * Set flag which indicates that we should reboot into the bootloader
>> - * following the reboot that fastboot executes after this function.
>> - *
>> - * This function should be overridden in your board file with one
>> - * which sets whatever flag your board specific Android bootloader
>> flow
>> - * requires in order to re-enter the bootloader.
>> - */
>> -int fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
>> -{
>> -	char cmd[64];
>> -
>> -	if (reason >= FASTBOOT_REBOOT_REASONS_COUNT)
>> -		return -EINVAL;
>> -
>> -	snprintf(cmd, sizeof(cmd), "bcb load %d misc",
>> -		 CONFIG_FASTBOOT_FLASH_MMC_DEV);
>> -
>> -	if (run_command(cmd, 0))
>> -		return -ENODEV;
>> -
>> -	snprintf(cmd, sizeof(cmd), "bcb set command %s",
>> -		 fastboot_boot_cmds[reason]);
>> -
>> -	if (run_command(cmd, 0))
>> -		return -ENOEXEC;
>> -
>> -	if (run_command("bcb store", 0))
>> -		return -EIO;
>> -
>> -	return 0;
>> -}
>> diff --git a/include/fastboot.h b/include/fastboot.h
>> index 8e9ee80907df..b86b508e69fd 100644
>> --- a/include/fastboot.h
>> +++ b/include/fastboot.h
>> @@ -52,15 +52,6 @@ enum fastboot_reboot_reason {
>>   	FASTBOOT_REBOOT_REASONS_COUNT
>>   };
>>   
>> -/**
>> - * BCB boot commands
>> - */
>> -static const char * const fastboot_boot_cmds[] = {
>> -	[FASTBOOT_REBOOT_REASON_BOOTLOADER] = "bootonce-bootloader",
>> -	[FASTBOOT_REBOOT_REASON_FASTBOOTD] = "boot-fastboot",
>> -	[FASTBOOT_REBOOT_REASON_RECOVERY] = "boot-recovery"
>> -};
>> -
>>   /**
>>    * fastboot_response() - Writes a response of the form "$tag$reason".
>>    *
> 
> If this patch is still needed - please rebase it on newest master
> (after the incoming PR) as it causes build breaks.
> 
> 
> 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
> 

Could you please share some info on how do you build it (used defconfig, 
error messages, used compiler, etc.)? I cannot reproduce those issues on 
my side.

I've tried to rebase my patches onto the current master and rebase was 
done cleanly, there are no conflicts. I've tried building it with 
rcar3_ulcb_defconfig and build was successful.

Used defconfig: rcar3_ulcb_defconfig
Used arch: ARM
Used compiler: gcc 7.1 for aarch64-linux-gnu
Used CFLAGS: -fgnu89-inline

Best regards,
Roman Kovalivskyi

  reply	other threads:[~2021-01-25 17:16 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 [this message]
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
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=6db5a822-eca6-4415-91fa-0d6594e5df93@globallogic.com \
    --to=roman.kovalivskyi@globallogic.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.