mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-18 19:04:38 +00:00
bootstd: android: Add U-Boot version to cmdline
When booting into Android fastbootd (a subset of recovery), the default UI shows the bootloader version in the screen [1]. This is done via the ro.bootloader property which should come from the bootloader. Provide the U-Boot version via a kernel commandline argument so that fastbootd can show it properly on the screen. [1] https://android.googlesource.com/platform/bootable/recovery/+/refs/heads/main/fastboot/fastboot.cpp#42 Reviewed-by: Julien Masson <jmasson@baylibre.com> Reviewed-by: Guillaume La Roque <glaroque@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/r/20240912-bootmeth-bootloader-version-v2-1-76d4c0b45024@baylibre.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
This commit is contained in:
parent
4b17845529
commit
3af5b851b4
1 changed files with 12 additions and 1 deletions
|
@ -22,6 +22,7 @@
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <mapmem.h>
|
#include <mapmem.h>
|
||||||
#include <part.h>
|
#include <part.h>
|
||||||
|
#include <version.h>
|
||||||
#include "bootmeth_android.h"
|
#include "bootmeth_android.h"
|
||||||
|
|
||||||
#define BCB_FIELD_COMMAND_SZ 32
|
#define BCB_FIELD_COMMAND_SZ 32
|
||||||
|
@ -171,6 +172,12 @@ static int configure_serialno(struct bootflow *bflow)
|
||||||
return bootflow_cmdline_set_arg(bflow, "androidboot.serialno", serialno, false);
|
return bootflow_cmdline_set_arg(bflow, "androidboot.serialno", serialno, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int configure_bootloader_version(struct bootflow *bflow)
|
||||||
|
{
|
||||||
|
return bootflow_cmdline_set_arg(bflow, "androidboot.bootloader",
|
||||||
|
PLAIN_VERSION, false);
|
||||||
|
}
|
||||||
|
|
||||||
static int android_read_bootflow(struct udevice *dev, struct bootflow *bflow)
|
static int android_read_bootflow(struct udevice *dev, struct bootflow *bflow)
|
||||||
{
|
{
|
||||||
struct blk_desc *desc = dev_get_uclass_plat(bflow->blk);
|
struct blk_desc *desc = dev_get_uclass_plat(bflow->blk);
|
||||||
|
@ -264,8 +271,12 @@ static int android_read_bootflow(struct udevice *dev, struct bootflow *bflow)
|
||||||
goto free_priv;
|
goto free_priv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ignoring return code: setting serial number is not mandatory for booting */
|
/*
|
||||||
|
* Ignoring return code for the following configurations:
|
||||||
|
* these are not mandatory for booting.
|
||||||
|
*/
|
||||||
configure_serialno(bflow);
|
configure_serialno(bflow);
|
||||||
|
configure_bootloader_version(bflow);
|
||||||
|
|
||||||
if (priv->boot_mode == ANDROID_BOOT_MODE_NORMAL) {
|
if (priv->boot_mode == ANDROID_BOOT_MODE_NORMAL) {
|
||||||
ret = bootflow_cmdline_set_arg(bflow, "androidboot.force_normal_boot",
|
ret = bootflow_cmdline_set_arg(bflow, "androidboot.force_normal_boot",
|
||||||
|
|
Loading…
Add table
Reference in a new issue