mirror of
https://gitee.com/Vancouver2017/luban-lite.git
synced 2025-12-17 17:48:55 +00:00
V1.0.5
This commit is contained in:
@@ -22,6 +22,26 @@
|
||||
|
||||
#define APPLICATION_PART "os"
|
||||
|
||||
#ifdef AIC_AB_SYSTEM_INTERFACE
|
||||
#include <absystem.h>
|
||||
|
||||
char target[32] = { 0 };
|
||||
#endif
|
||||
|
||||
static struct aic_partition *find_boot_part(struct aic_partition *part, char *name)
|
||||
{
|
||||
struct aic_partition *p = part;
|
||||
|
||||
while (p) {
|
||||
if (!strcmp(p->name, name))
|
||||
break;
|
||||
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
static int do_mmc_boot(int argc, char *argv[])
|
||||
{
|
||||
int ret = 0, mmc_id = 0;
|
||||
@@ -57,13 +77,28 @@ static int do_mmc_boot(int argc, char *argv[])
|
||||
}
|
||||
|
||||
part = parts;
|
||||
while (part) {
|
||||
if (!strcmp(part->name, APPLICATION_PART))
|
||||
break;
|
||||
|
||||
part = part->next;
|
||||
#ifdef AIC_AB_SYSTEM_INTERFACE
|
||||
ret = aic_ota_check();
|
||||
if (ret) {
|
||||
printf("Aic ota check error.\n");
|
||||
}
|
||||
|
||||
ret = aic_get_os_to_startup(target);
|
||||
if (ret) {
|
||||
printf("Aic get os fail, startup from %s default.\n", APPLICATION_PART);
|
||||
|
||||
part = find_boot_part(part, APPLICATION_PART);
|
||||
|
||||
} else {
|
||||
part = find_boot_part(part, target);
|
||||
|
||||
printf("Start-up from %s\n", target);
|
||||
}
|
||||
#else
|
||||
part = find_boot_part(part, APPLICATION_PART);
|
||||
#endif
|
||||
|
||||
if (!part) {
|
||||
printf("Failed to get application partition.\n");
|
||||
goto out;
|
||||
@@ -74,6 +109,7 @@ static int do_mmc_boot(int argc, char *argv[])
|
||||
info.dev_type = DEVICE_MMC;
|
||||
info.bl_len = MMC_BLOCK_SIZE;
|
||||
|
||||
entry_point = 0;
|
||||
ret = spl_load_simple_fit(&info, &entry_point);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user