yb_arm/app/src/main.c
2023-07-12 14:14:31 +08:00

84 lines
1.9 KiB
C

// +FHDR------------------------------------------------------------
// Copyright (c) 2022 SmartLogic.
// ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename : main.c
// Author : xianfeng.du
// Created On : 2022-06-25
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------
#define _GNU_SOURCE
#include <sched.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "ospLog.h"
#include "ospShell.h"
#include "ucp_printf.h"
#include "drv_init.h"
#ifdef ENABLE_JESD_TEST
extern int32_t UCP_API_JESD_PlatformSetup (void);
extern int32_t UCP_API_TRANSCEIVER_Init(uint64_t txLo, uint64_t rxLo, uint64_t bw, uint16_t initAtt);
#endif
int32_t test_case(uint32_t argc, int32_t* argvp);
extern OSP_STATUS osp_init();
extern uint8_t osp_sw_queue_init();
#define MAX_PARA_NUM 4
int32_t main(int32_t argc, char* argvp[])
{
//uint32_t stc_cnt = 0, stc_cnt1 = 0;
UCP_PRINT_DEBUG("Hello world from A72.");
cpu_set_t mask;
CPU_ZERO(&mask);
CPU_SET(4,&mask);
sched_setaffinity(0,sizeof(cpu_set_t),&mask);
#ifdef ENABLE_JESD_TEST
UCP_API_JESD_PlatformSetup();
UCP_API_TRANSCEIVER_Init(2575770000u, 2575770000u, 100000000u, 0);
usleep(100000);
#endif
osp_init();
drv_init();
#ifdef PALLADIUM_TEST
UCP_PRINT_DEBUG("entered testmode.");
int32_t args[MAX_PARA_NUM];
uint32_t count = argc - 1;
if(count > MAX_PARA_NUM) {
UCP_PRINT_ERROR("parameter number[%d] error",count);
return -1;
}
for (uint32_t i=0; i<count;i++) {
args[i] = (int32_t)strtoul(argvp[i+1],NULL,0);
}
test_case(count, args);
#endif
while (1)
{
usleep(100);
}
return 0;
}