2023-08-30 16:21:18 +08:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Artinchip Technology Co., Ltd
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*
|
|
|
|
|
* Wu Dehuang <dehuang.wu@artinchip.com>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <image.h>
|
|
|
|
|
#include <boot.h>
|
|
|
|
|
#include <aic_core.h>
|
|
|
|
|
#include <aic_time.h>
|
|
|
|
|
#include <boot_time.h>
|
|
|
|
|
#include <console.h>
|
2023-11-09 20:19:51 +08:00
|
|
|
#include <boot_param.h>
|
2023-08-30 16:21:18 +08:00
|
|
|
|
|
|
|
|
void boot_app(void *app)
|
|
|
|
|
{
|
|
|
|
|
int ret;
|
2023-11-09 20:19:51 +08:00
|
|
|
void (*ep)(int);
|
|
|
|
|
enum boot_device dev;
|
2023-08-30 16:21:18 +08:00
|
|
|
|
|
|
|
|
ret = console_get_ctrlc();
|
|
|
|
|
if (ret > 0)
|
|
|
|
|
return;
|
2023-11-09 20:19:51 +08:00
|
|
|
#ifndef LPKG_USING_FDTLIB
|
2023-08-30 16:21:18 +08:00
|
|
|
ep = image_get_entry_point(app);
|
2023-11-09 20:19:51 +08:00
|
|
|
#else
|
|
|
|
|
ep = app;
|
|
|
|
|
#endif
|
2024-06-04 19:00:30 +08:00
|
|
|
if (!ep) {
|
|
|
|
|
printf("Entry point is null, Run APP failure.\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-08-30 16:21:18 +08:00
|
|
|
boot_time_trace("Run APP");
|
|
|
|
|
boot_time_show();
|
2023-11-09 20:19:51 +08:00
|
|
|
dev = aic_get_boot_device();
|
2023-08-30 16:21:18 +08:00
|
|
|
aicos_dcache_clean();
|
2023-11-30 19:48:02 +08:00
|
|
|
aicos_icache_invalid();
|
2023-11-09 20:19:51 +08:00
|
|
|
ep(dev);
|
2023-08-30 16:21:18 +08:00
|
|
|
}
|