Files
luban-lite-t3e-pro/application/baremetal/bootloader/lib/common/boot_app.c

50 lines
1011 B
C
Raw Normal View History

2023-08-30 16:21:18 +08:00
/*
2024-09-03 11:16:08 +08:00
* Copyright (c) 2023-2024, ArtInChip Technology Co., Ltd
2023-08-30 16:21:18 +08:00
*
* 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;
2024-09-03 11:16:08 +08:00
void (*ep)(int, unsigned long);
2023-11-09 20:19:51 +08:00
enum boot_device dev;
2024-09-03 11:16:08 +08:00
unsigned long boot_arg;
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();
2024-09-03 11:16:08 +08:00
boot_arg = (unsigned long)aic_get_boot_args();
2023-08-30 16:21:18 +08:00
aicos_dcache_clean();
2023-11-30 19:48:02 +08:00
aicos_icache_invalid();
2025-01-08 19:12:06 +08:00
aicos_local_irq_disable();
2024-09-03 11:16:08 +08:00
ep(dev, boot_arg);
2023-08-30 16:21:18 +08:00
}