common: android/rkimg: remove/clean android a/b (slot) code
- the partition disk layer takes over the responsibility of slot suffix appending, we remove relative code to make file clean; - put android a/b code together and name them to be eary understood, this makes file esay to read. Change-Id: Id8c838da682ce6098bd7192d7d7c64269f4e86ba Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
parent
f2b98302da
commit
c6666740ee
|
|
@ -755,7 +755,6 @@ int do_avb_flow(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
load_address = CONFIG_SYS_LOAD_ADDR;
|
||||
rk_avb_ab_slot_select(ops->ab_ops, boot_slot_select);
|
||||
strcat(slot_partition[1], requested_partitions[1]);
|
||||
strcat(slot_partition[1], boot_slot_select);
|
||||
printf("%s\n", slot_partition[1]);
|
||||
ops->get_unique_guid_for_partition(ops,
|
||||
slot_partition[1],
|
||||
|
|
@ -767,7 +766,7 @@ int do_avb_flow(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|||
strcat(root_data, " ");
|
||||
strcat(root_data, command_line);
|
||||
env_set("bootargs", root_data);
|
||||
if (android_avb_boot_flow(boot_slot_select, load_address)) {
|
||||
if (android_avb_boot_flow(load_address)) {
|
||||
printf("Cannot boot the system, goto the fastboot!\n");
|
||||
avb_ops_user_free(ops);
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -74,26 +74,105 @@ static int get_partition_unique_uuid(char *partition,
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
char *android_str_append(char *base_name, char *slot_suffix)
|
||||
static void reset_cpu_if_android_ab(void)
|
||||
{
|
||||
char *part_name;
|
||||
size_t part_name_len;
|
||||
|
||||
part_name_len = strlen(base_name) + 1;
|
||||
if (slot_suffix)
|
||||
part_name_len += strlen(slot_suffix);
|
||||
part_name = malloc(part_name_len);
|
||||
if (!part_name)
|
||||
return NULL;
|
||||
strcpy(part_name, base_name);
|
||||
if (slot_suffix && (slot_suffix[0] != '\0'))
|
||||
strcat(part_name, slot_suffix);
|
||||
|
||||
return part_name;
|
||||
printf("Reset in AB system.\n");
|
||||
flushc();
|
||||
/*
|
||||
* Since we use the retry-count in ab system, then can
|
||||
* try reboot if verify fail until the retry-count is
|
||||
* equal to zero.
|
||||
*/
|
||||
reset_cpu(0);
|
||||
}
|
||||
|
||||
static void update_root_uuid_if_android_ab(void)
|
||||
{
|
||||
/*
|
||||
* In android a/b & avb process, the system.img is mandory and the
|
||||
* "root=" will be added in vbmeta.img.
|
||||
*
|
||||
* In linux a/b & avb process, the system is NOT mandory and the
|
||||
* "root=" will not be added in vbmeta.img but in kernel dts bootargs.
|
||||
* (Parsed and droped late, i.e. "root=" is not available now/always).
|
||||
*
|
||||
* To compatible with the above two processes, test the existence of
|
||||
* "root=" and create it for linux ab & avb.
|
||||
*/
|
||||
char root_partuuid[70] = "root=PARTUUID=";
|
||||
char *boot_args = env_get("bootargs");
|
||||
char guid_buf[UUID_SIZE] = {0};
|
||||
|
||||
if (!strstr(boot_args, "root=")) {
|
||||
get_partition_unique_uuid(ANDROID_PARTITION_SYSTEM,
|
||||
guid_buf, UUID_SIZE);
|
||||
strcat(root_partuuid, guid_buf);
|
||||
env_update("bootargs", root_partuuid);
|
||||
}
|
||||
}
|
||||
|
||||
static int decrease_tries_if_android_ab(char *slot_suffix)
|
||||
{
|
||||
AvbABData ab_data_orig;
|
||||
AvbABData ab_data;
|
||||
AvbOps *ops;
|
||||
size_t slot_index = 0;
|
||||
|
||||
/* TODO: get from pre-loader or misc partition */
|
||||
if (rk_avb_get_current_slot(slot_suffix)) {
|
||||
printf("rk_avb_get_current_slot() failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!strncmp(slot_suffix, "_a", 2))
|
||||
slot_index = 0;
|
||||
else if (!strncmp(slot_suffix, "_b", 2))
|
||||
slot_index = 1;
|
||||
else
|
||||
slot_index = 0;
|
||||
|
||||
ops = avb_ops_user_new();
|
||||
if (!ops) {
|
||||
printf("avb_ops_user_new() failed!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (load_metadata(ops->ab_ops, &ab_data, &ab_data_orig)) {
|
||||
printf("Can not load metadata\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ... and decrement tries remaining, if applicable. */
|
||||
if (!ab_data.slots[slot_index].successful_boot &&
|
||||
ab_data.slots[slot_index].tries_remaining > 0)
|
||||
ab_data.slots[slot_index].tries_remaining -= 1;
|
||||
|
||||
if (save_metadata_if_changed(ops->ab_ops, &ab_data, &ab_data_orig)) {
|
||||
printf("Can not save metadata\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (slot_suffix[0] != '_') {
|
||||
#ifndef CONFIG_ANDROID_AVB
|
||||
printf("###There is no bootable slot, bring up lastboot!###\n");
|
||||
if (rk_get_lastboot() == 1)
|
||||
memcpy(slot_suffix, "_b", 2);
|
||||
else if (rk_get_lastboot() == 0)
|
||||
memcpy(slot_suffix, "_a", 2);
|
||||
else
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static inline void reset_cpu_if_android_ab(void) {}
|
||||
static inline void update_root_uuid_if_android_ab(void) {}
|
||||
static inline int decrease_tries_if_android_ab(char *slot_suffix) { return 0; }
|
||||
#endif
|
||||
|
||||
int android_bootloader_message_load(
|
||||
struct blk_desc *dev_desc,
|
||||
const disk_partition_t *part_info,
|
||||
|
|
@ -209,35 +288,6 @@ static const char *android_boot_mode_str(enum android_boot_mode mode)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static int android_part_get_info_by_name_suffix(struct blk_desc *dev_desc,
|
||||
const char *base_name,
|
||||
const char *slot_suffix,
|
||||
disk_partition_t *part_info)
|
||||
{
|
||||
char *part_name;
|
||||
int part_num;
|
||||
size_t part_name_len;
|
||||
|
||||
part_name_len = strlen(base_name) + 1;
|
||||
if (slot_suffix)
|
||||
part_name_len += strlen(slot_suffix);
|
||||
part_name = malloc(part_name_len);
|
||||
if (!part_name)
|
||||
return -1;
|
||||
strcpy(part_name, base_name);
|
||||
if (slot_suffix && (slot_suffix[0] != '\0'))
|
||||
strcat(part_name, slot_suffix);
|
||||
|
||||
part_num = part_get_info_by_name(dev_desc, part_name, part_info);
|
||||
if (part_num < 0) {
|
||||
debug("ANDROID: Could not find partition \"%s\"\n", part_name);
|
||||
part_num = -1;
|
||||
}
|
||||
|
||||
free(part_name);
|
||||
return part_num;
|
||||
}
|
||||
|
||||
static int android_bootloader_boot_bootloader(void)
|
||||
{
|
||||
const char *fastboot_cmd = env_get("fastbootcmd");
|
||||
|
|
@ -255,9 +305,8 @@ static int android_bootloader_get_fdt(const char *part_name,
|
|||
const char *load_file_name)
|
||||
{
|
||||
struct blk_desc *dev_desc;
|
||||
disk_partition_t boot_part_info;
|
||||
disk_partition_t part_info;
|
||||
char *fdt_addr = NULL;
|
||||
char slot_suffix[5] = {0};
|
||||
char dev_part[3] = {0};
|
||||
loff_t bytes = 0;
|
||||
loff_t pos = 0;
|
||||
|
|
@ -272,24 +321,11 @@ static int android_bootloader_get_fdt(const char *part_name,
|
|||
return -1;
|
||||
}
|
||||
|
||||
memset(&boot_part_info, 0, sizeof(boot_part_info));
|
||||
|
||||
#ifdef CONFIG_RK_AVB_LIBAVB_USER
|
||||
if (rk_avb_get_current_slot(slot_suffix)) {
|
||||
printf("ANDROID: Get Current Slot error.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
part_num = android_part_get_info_by_name_suffix(dev_desc,
|
||||
part_name,
|
||||
slot_suffix, &boot_part_info);
|
||||
#else
|
||||
part_num = part_get_info_by_name(dev_desc, part_name, &boot_part_info);
|
||||
part_num = part_get_info_by_name(dev_desc, part_name, &part_info);
|
||||
if (part_num < 0) {
|
||||
printf("ANDROID: Could not find partition \"%s\"\n", part_name);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
snprintf(dev_part, ARRAY_SIZE(dev_part), ":%x", part_num);
|
||||
if (fs_set_blk_dev_with_part(dev_desc, part_num))
|
||||
|
|
@ -731,7 +767,7 @@ __weak int board_select_fdt_index(ulong dt_table_hdr)
|
|||
|
||||
static int android_get_dtbo(ulong *fdt_dtbo,
|
||||
const struct andr_img_hdr *hdr,
|
||||
int *index)
|
||||
int *index, int boot_mode)
|
||||
{
|
||||
struct dt_table_header *dt_hdr = NULL;
|
||||
struct blk_desc *dev_desc;
|
||||
|
|
@ -745,27 +781,11 @@ static int android_get_dtbo(ulong *fdt_dtbo,
|
|||
int ret;
|
||||
|
||||
/* Get partition according to boot mode */
|
||||
if (rockchip_get_boot_mode() == BOOT_MODE_RECOVERY)
|
||||
if (boot_mode == BOOT_MODE_RECOVERY)
|
||||
part_name = PART_RECOVERY;
|
||||
else
|
||||
part_name = PART_DTBO;
|
||||
|
||||
#ifdef CONFIG_ANDROID_AB
|
||||
char slot_suffix[3] = {0};
|
||||
char *part_name_temp = PART_DTBO;
|
||||
|
||||
if (rk_avb_get_current_slot(slot_suffix)) {
|
||||
printf("%s: rk_avb_get_current_slot failed !\n", __func__);
|
||||
return -ENODEV;
|
||||
}
|
||||
part_name = android_str_append(part_name_temp, slot_suffix);
|
||||
if (!part_name) {
|
||||
printf("%s: android_str_append failed !\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
debug("%s: part_name=%s\n", __func__, part_name);
|
||||
#endif
|
||||
|
||||
/* Get partition info */
|
||||
dev_desc = rockchip_get_bootdev();
|
||||
if (!dev_desc) {
|
||||
|
|
@ -870,31 +890,20 @@ int android_fdt_overlay_apply(void *fdt_addr)
|
|||
char buf[32] = {0};
|
||||
u32 blk_cnt;
|
||||
ulong fdt_dtbo = -1;
|
||||
int boot_mode;
|
||||
int index = -1;
|
||||
int ret;
|
||||
|
||||
/* Get partition according to boot mode */
|
||||
if (rockchip_get_boot_mode() == BOOT_MODE_RECOVERY)
|
||||
boot_mode = rockchip_get_boot_mode();
|
||||
#ifdef CONFIG_ANDROID_AB
|
||||
if (boot_mode == BOOT_MODE_RECOVERY)
|
||||
boot_mode = BOOT_MODE_NORMAL;
|
||||
#endif
|
||||
if (boot_mode == BOOT_MODE_RECOVERY)
|
||||
part_name = PART_RECOVERY;
|
||||
else
|
||||
part_name = PART_BOOT;
|
||||
|
||||
#ifdef CONFIG_ANDROID_AB
|
||||
char slot_suffix[3] = {0};
|
||||
char *part_name_temp = PART_BOOT;
|
||||
|
||||
if (rk_avb_get_current_slot(slot_suffix)) {
|
||||
printf("%s: rk_avb_get_current_slot failed !\n", __func__);
|
||||
return -ENODEV;
|
||||
}
|
||||
part_name = android_str_append(part_name_temp, slot_suffix);
|
||||
if (!part_name) {
|
||||
printf("%s: android_str_append failed !\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
printf("%s: part_name=%s\n", __func__, part_name);
|
||||
#endif
|
||||
|
||||
/* Get partition info */
|
||||
dev_desc = rockchip_get_bootdev();
|
||||
if (!dev_desc) {
|
||||
|
|
@ -936,7 +945,7 @@ int android_fdt_overlay_apply(void *fdt_addr)
|
|||
goto out;
|
||||
}
|
||||
|
||||
ret = android_get_dtbo(&fdt_dtbo, (void *)hdr, &index);
|
||||
ret = android_get_dtbo(&fdt_dtbo, (void *)hdr, &index, boot_mode);
|
||||
if (!ret) {
|
||||
phys_size_t fdt_size;
|
||||
/* Must incease size before overlay */
|
||||
|
|
@ -969,16 +978,12 @@ out:
|
|||
|
||||
static int load_android_image(struct blk_desc *dev_desc,
|
||||
char *boot_partname,
|
||||
char *slot_suffix,
|
||||
unsigned long *load_address)
|
||||
{
|
||||
disk_partition_t boot_part;
|
||||
int ret, part_num;
|
||||
|
||||
part_num = android_part_get_info_by_name_suffix(dev_desc,
|
||||
boot_partname,
|
||||
slot_suffix,
|
||||
&boot_part);
|
||||
part_num = part_get_info_by_name(dev_desc, boot_partname, &boot_part);
|
||||
if (part_num < 0) {
|
||||
printf("%s: Can't find part: %s\n", __func__, boot_partname);
|
||||
return -1;
|
||||
|
|
@ -1036,58 +1041,9 @@ int android_bootloader_boot_flow(struct blk_desc *dev_desc,
|
|||
|
||||
printf("ANDROID: reboot reason: \"%s\"\n", android_boot_mode_str(mode));
|
||||
|
||||
#ifdef CONFIG_ANDROID_AB
|
||||
/*TODO: get from pre-loader or misc partition*/
|
||||
if (rk_avb_get_current_slot(slot_suffix)) {
|
||||
printf("rk_avb_get_current_slot() failed\n");
|
||||
/* Get current slot_suffix */
|
||||
if (decrease_tries_if_android_ab(slot_suffix))
|
||||
return -1;
|
||||
}
|
||||
|
||||
AvbOps *ops;
|
||||
AvbABData ab_data;
|
||||
AvbABData ab_data_orig;
|
||||
size_t slot_index_to_boot = 0;
|
||||
|
||||
if (!strncmp(slot_suffix, "_a", 2))
|
||||
slot_index_to_boot = 0;
|
||||
else if (!strncmp(slot_suffix, "_b", 2))
|
||||
slot_index_to_boot = 1;
|
||||
else
|
||||
slot_index_to_boot = 0;
|
||||
ops = avb_ops_user_new();
|
||||
if (ops == NULL) {
|
||||
printf("avb_ops_user_new() failed!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(load_metadata(ops->ab_ops, &ab_data, &ab_data_orig)) {
|
||||
printf("Can not load metadata\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ... and decrement tries remaining, if applicable. */
|
||||
if (!ab_data.slots[slot_index_to_boot].successful_boot &&
|
||||
ab_data.slots[slot_index_to_boot].tries_remaining > 0) {
|
||||
ab_data.slots[slot_index_to_boot].tries_remaining -= 1;
|
||||
}
|
||||
|
||||
if (save_metadata_if_changed(ops->ab_ops, &ab_data, &ab_data_orig)) {
|
||||
printf("Can not save metadata\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (slot_suffix[0] != '_') {
|
||||
#ifndef CONFIG_ANDROID_AVB
|
||||
printf("###There is no bootable slot, bring up lastboot!###\n");
|
||||
if (rk_get_lastboot() == 1)
|
||||
memcpy(slot_suffix, "_b", 2);
|
||||
else if(rk_get_lastboot() == 0)
|
||||
memcpy(slot_suffix, "_a", 2);
|
||||
else
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (mode) {
|
||||
case ANDROID_BOOT_MODE_NORMAL:
|
||||
|
|
@ -1117,7 +1073,6 @@ int android_bootloader_boot_flow(struct blk_desc *dev_desc,
|
|||
|
||||
#ifdef CONFIG_ANDROID_AVB
|
||||
uint8_t vboot_flag = 0;
|
||||
char vbmeta_partition[9] = {0};
|
||||
disk_partition_t vbmeta_part_info;
|
||||
|
||||
if (trusty_read_vbootkey_enable_flag(&vboot_flag)) {
|
||||
|
|
@ -1130,29 +1085,20 @@ int android_bootloader_boot_flow(struct blk_desc *dev_desc,
|
|||
if (android_slot_verify(boot_partname, &load_address,
|
||||
slot_suffix)) {
|
||||
printf("AVB verify failed\n");
|
||||
#ifdef CONFIG_ANDROID_AB
|
||||
printf("Reset in AB system.\n");
|
||||
flushc();
|
||||
/*
|
||||
* Since we use the retry-count in ab system, then can
|
||||
* try reboot if verify fail until the retry-count is
|
||||
* equal to zero.
|
||||
*/
|
||||
reset_cpu(0);
|
||||
#endif
|
||||
reset_cpu_if_android_ab();
|
||||
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
strcat(vbmeta_partition, ANDROID_PARTITION_VBMETA);
|
||||
strcat(vbmeta_partition, slot_suffix);
|
||||
part_num = part_get_info_by_name(dev_desc, vbmeta_partition,
|
||||
part_num = part_get_info_by_name(dev_desc,
|
||||
ANDROID_PARTITION_VBMETA,
|
||||
&vbmeta_part_info);
|
||||
if (part_num < 0) {
|
||||
printf("Not AVB images, AVB skip\n");
|
||||
env_update("bootargs",
|
||||
"androidboot.verifiedbootstate=orange");
|
||||
if (load_android_image(dev_desc, boot_partname,
|
||||
slot_suffix, &load_address)) {
|
||||
&load_address)) {
|
||||
printf("Android image load failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -1161,16 +1107,8 @@ int android_bootloader_boot_flow(struct blk_desc *dev_desc,
|
|||
if (android_slot_verify(boot_partname, &load_address,
|
||||
slot_suffix)) {
|
||||
printf("AVB verify failed\n");
|
||||
#ifdef CONFIG_ANDROID_AB
|
||||
printf("Reset in AB system.\n");
|
||||
flushc();
|
||||
/*
|
||||
* Since we use the retry-count in ab system,
|
||||
* then can try reboot if verify fail until
|
||||
* the retry-count is equal to zero.
|
||||
*/
|
||||
reset_cpu(0);
|
||||
#endif
|
||||
reset_cpu_if_android_ab();
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1180,32 +1118,12 @@ int android_bootloader_boot_flow(struct blk_desc *dev_desc,
|
|||
* 2. Load the boot/recovery from the desired "boot" partition.
|
||||
* Determine if this is an AOSP image.
|
||||
*/
|
||||
if (load_android_image(dev_desc, boot_partname,
|
||||
slot_suffix, &load_address)) {
|
||||
if (load_android_image(dev_desc, boot_partname, &load_address)) {
|
||||
printf("Android image load failed\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ANDROID_AB
|
||||
/* In android a/b & avb process, the "root=" will be add which parameter
|
||||
* is in vbmeta.In linux a/b & avb process, the "root=" must be add by
|
||||
* follow code. To be compatible with the above two processes, test it
|
||||
* is necessary to add "root=".
|
||||
*/
|
||||
char root_partition[20] = {0};
|
||||
char guid_buf[UUID_SIZE] = {0};
|
||||
char root_partuuid[70] = "root=PARTUUID=";
|
||||
char *boot_args = env_get("bootargs");
|
||||
|
||||
if (!strstr(boot_args, "root=")) {
|
||||
strcat(root_partition, ANDROID_PARTITION_SYSTEM);
|
||||
strcat(root_partition, slot_suffix);
|
||||
get_partition_unique_uuid(root_partition, guid_buf, UUID_SIZE);
|
||||
strcat(root_partuuid, guid_buf);
|
||||
env_update("bootargs", root_partuuid);
|
||||
}
|
||||
#endif
|
||||
update_root_uuid_if_android_ab();
|
||||
|
||||
/* Set Android root variables. */
|
||||
env_set_ulong("android_root_devnum", dev_desc->devnum);
|
||||
|
|
@ -1251,24 +1169,33 @@ int android_bootloader_boot_flow(struct blk_desc *dev_desc,
|
|||
return -1;
|
||||
}
|
||||
|
||||
int android_avb_boot_flow(char *slot_suffix, unsigned long kernel_address)
|
||||
int android_avb_boot_flow(unsigned long kernel_address)
|
||||
{
|
||||
struct blk_desc *dev_desc;
|
||||
disk_partition_t boot_part_info;
|
||||
int ret;
|
||||
|
||||
dev_desc = rockchip_get_bootdev();
|
||||
if (!dev_desc) {
|
||||
printf("%s: dev_desc is NULL!\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Load the kernel from the desired "boot" partition. */
|
||||
android_part_get_info_by_name_suffix(dev_desc,
|
||||
ANDROID_PARTITION_BOOT,
|
||||
slot_suffix, &boot_part_info);
|
||||
ret = android_image_load(dev_desc, &boot_part_info, kernel_address,
|
||||
-1UL);
|
||||
if (ret < 0)
|
||||
ret = part_get_info_by_name(dev_desc, ANDROID_PARTITION_BOOT,
|
||||
&boot_part_info);
|
||||
if (ret < 0) {
|
||||
printf("%s: failed to get boot part\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = android_image_load(dev_desc, &boot_part_info,
|
||||
kernel_address, -1UL);
|
||||
if (ret < 0) {
|
||||
printf("Android avb boot failed, error %d.\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
android_bootloader_boot_kernel(kernel_address);
|
||||
|
||||
/* TODO: If the kernel doesn't boot mark the selected slot as bad. */
|
||||
|
|
@ -1280,17 +1207,25 @@ int android_boot_flow(unsigned long kernel_address)
|
|||
struct blk_desc *dev_desc;
|
||||
disk_partition_t boot_part_info;
|
||||
int ret;
|
||||
|
||||
dev_desc = rockchip_get_bootdev();
|
||||
if (!dev_desc) {
|
||||
printf("%s: dev_desc is NULL!\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
/* Load the kernel from the desired "boot" partition. */
|
||||
part_get_info_by_name(dev_desc, ANDROID_PARTITION_BOOT, &boot_part_info);
|
||||
ret = part_get_info_by_name(dev_desc, ANDROID_PARTITION_BOOT,
|
||||
&boot_part_info);
|
||||
if (ret < 0) {
|
||||
printf("%s: failed to get boot part\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = android_image_load(dev_desc, &boot_part_info, kernel_address,
|
||||
-1UL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
android_bootloader_boot_kernel(kernel_address);
|
||||
|
||||
/* TODO: If the kernel doesn't boot mark the selected slot as bad. */
|
||||
|
|
|
|||
|
|
@ -44,12 +44,11 @@ int android_bootloader_boot_flow(struct blk_desc *dev_desc,
|
|||
/** android_avb_boot_flow - Execute the Android Bootloader Flow.
|
||||
* This fuction use to select and boot kernel through ab_suffix.
|
||||
*
|
||||
* @ab_suffix: the boot slot to boot from.
|
||||
* @kernel_address: address where to load the kernel if needed.
|
||||
*
|
||||
* @return a negative number in case of error, otherwise it doesn't return.
|
||||
*/
|
||||
int android_avb_boot_flow(char *ab_suffix, unsigned long kernel_address);
|
||||
int android_avb_boot_flow(unsigned long kernel_address);
|
||||
|
||||
/** android_assemble_cmdline - Assemble args for cmdline.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue