yb_arm/app/src/main.c
lishuang.xie d734e714d5 1. New Feature#1006
2. add case0 : LTE 2 ape testcase
3. add case20: NR  4 ape testcase
4. add case21: NR  8 ape testcase
5. add case22: LTE 8 ape testcase
6. add case50: PCIE EP: arm read cfg for phy
2023-08-23 16:02:18 +08:00

86 lines
2.0 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"
int32_t test_case(uint32_t argc, int32_t* argvp);
extern OSP_STATUS osp_init();
extern int32_t osp_set_taskcpu(uint8_t cpu, uint8_t pri);
extern uint8_t osp_sw_queue_init();
#ifdef ENABLE_JESD_TEST
extern int32_t UCP_API_RFIC_CellInit(void);
extern int32_t UCP_API_RFIC_CellSetup(uint64_t txLo, uint64_t rxLo, uint64_t bw, uint16_t initAtt);
#endif
#define MAX_PARA_NUM 4
uint8_t gu8_main_flag = 1; /* main fun while(): 1 while; 0: out */
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_RFIC_CellInit();
UCP_API_RFIC_CellSetup(2575770000u, 2575770000u, 100000000u, 0);
#endif
osp_init();
osp_set_taskcpu(7, 95);
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 (gu8_main_flag)
{
usleep(100);
}
return 0;
}