Files
banban/ql-config/soc_platform/preboot_boot2/cpu/crane/startup.c
T

55 lines
1.1 KiB
C

#include <stdint.h>
#include "cinit.h"
#include "syscall-arom.h"
#include "log.h"
#include "bl2_arg.h"
#ifdef MODULE_LOADTABLE
#include "loadtable.h"
#endif
#include "pmu.h"
#ifdef MODULE_NVCTR_SYSCALL
#include "nvctr_syscall.h"
#endif
/*---------------------------------------------------------------------------*/
extern int main(void);
/*---------------------------------------------------------------------------*/
__attribute__((target("arm"), section(".text.boot")))
int
_start(bl2_arg_t *arg)
{
#ifdef MODULE_LOADTABLE
if(process_loadtable() < 0) {
return -1;
}
#endif
cinit_clear_bss();
syscall_init();
#ifdef MODULE_NVCTR_SYSCALL
/*
* Can not put it in the syscall_init() because syscall_init()
* may be invoked in process_loadtable() for compressed image
* and the code is not ready at that time.
*/
nvctr_arom_refs_init();
#endif
bl2_arg_init(arg);
arg = bl2_arg_get();
if(arg && arg->disable_log) {
log_set_level("main", LOG_LEVEL_ERR);
} else {
if(usb_connect() == 0) {
log_set_level("main", LOG_LEVEL_PRINT);
}
}
cinit_call_constructors();
int rc = main();
return rc;
}