products: Remove the unused porting test code in the aocpu main file [1/1]
PD#SWPL-61470
Problem:
Remove the unused porting test code in the aocpu main file.
Solution:
Remove the unused porting test code in the aocpu main file.
Verify:
T5D_AM301
Change-Id: I3174b023c811efc16c9ec8b639c0eaf16ef46316
Signed-off-by: Xiaohu.Huang <xiaohu.huang@amlogic.com>
diff --git a/main.c b/main.c
index 4782a35..bc382dd 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,3 @@
-#if 1
/*
* IntTest.c
*
@@ -254,149 +253,3 @@
for ( ;; );
}
/*-----------------------------------------------------------*/
-#else
-
-#include "stdint.h"
-#include "sys/cdefs.h"
-#include "FreeRTOS.h"
-#include "task.h"
-#include "timers.h"
-
-#include "common.h"
-#include "riscv_encoding.h"
-#include "n200_func.h"
-
-#if 1
-#define REG32_ADDR(addr) ((volatile uint32_t *)(uintptr_t)(addr))
-#define REG32(addr) (*REG32_ADDR(addr))
-
-#define UART_WFIFO (0 << 2)
-#define UART_STATUS (3 << 2)
-#ifdef UART_PORT_CONS
-#undef UART_PORT_CONS
-#define UART_PORT_CONS ((0x8c00 << 2) + 0xffd00000)
-#endif
-#define P_UART(uart_base, reg) (uart_base + reg)
-#define P_UART_STATUS(uart_base) P_UART(uart_base, UART_STATUS)
-#define P_UART_WFIFO(uart_base) P_UART(uart_base, UART_WFIFO)
-#define UART_STAT_MASK_TFIFO_FULL (1<<21)
-#define UART_STAT_MASK_TFIFO_EMPTY (1<<22)
-#endif
-
-#define INT_TEST_TIMER_PERIOD_MS (2000)
-
-#define write_csr(reg, val) ({ \
- if (__builtin_constant_p(val) && (unsigned long)(val) < 32) \
- asm volatile ("csrw " #reg ", %0" :: "i"(val)); \
- else \
- asm volatile ("csrw " #reg ", %0" :: "r"(val)); })
-
-int prvUartTxIsFull(void)
-{
- return REG32(P_UART_STATUS(UART_PORT_CONS)) & UART_STAT_MASK_TFIFO_FULL;
-}
-
-void vUartTxFlush(void)
-{
- while (! (REG32(P_UART_STATUS(UART_PORT_CONS)) & UART_STAT_MASK_TFIFO_EMPTY));
-}
-
-void vUartPutc(const char c)
-{
- if (c == '\n')
- {
- vUartPutc('\r');
- }
-
- while (prvUartTxIsFull());
- REG32(P_UART_WFIFO(UART_PORT_CONS)) = c;
- vUartTxFlush();
-}
-
-void vUartPuts(const char *s)
-{
- while (*s)
- {
- vUartPutc(*s++);
- }
-}
-
-static void vPrintSystemStatus(TimerHandle_t xTimer)
-{
- (void)xTimer;
-
- taskENTER_CRITICAL();
- vUartPuts("[AOCPU]:Timer ...\n");
- taskEXIT_CRITICAL();
-}
-
-static void vPrintTask1( void *pvParameters )
-{
- /* to be void gnerate warning from the compiler */
- (void)pvParameters;
-
- for ( ;; )
- {
- vUartPuts("[AOCPU]:Task1 process...\r\n");
- vTaskDelay(pdMS_TO_TICKS(1000));
- }
-}
-
-static void vPrintTask2( void *pvParameters )
-{
- /* to be void gnerate warning from the compiler */
- (void)pvParameters;
-
- for ( ;; )
- {
- vUartPuts("[AOCPU]:Task2 process...\r\n");
- printf("[AOCPU]:build time:[%s-%s]\r\n", __DATE__, __TIME__);
- vTaskDelay(pdMS_TO_TICKS(1000));
- }
-}
-
-int print_lastword_crash(const char *fmt, ...)
-{
- return 0;
-}
-
-static void vPICInit(void) {
-
- // Disable global interrupter
- clear_csr(mstatus, MSTATUS_MIE);
-
- // Initialize interrupter handler
- for (int i = 0; i < PIC_NUM_INTERRUPTS; i ++) {
- pic_interrupt_handlers[i] = DefaultInterruptHandler;
- }
-
- // Enable global interrupt
- set_csr(mstatus, MSTATUS_MIE);
-}
-
-extern void trap_entry(void);
-extern void irq_entry(void);
-
-TimerHandle_t xSoftTimer = NULL;
-
-int main(void)
-{
- vUartPuts("[AOCPU]:Starting AOCPU FreeRTOS\n");
- vPICInit();
-
- vUartPuts("[AOCPU]:Starting timer ...\n");
- xSoftTimer = xTimerCreate("Timer", pdMS_TO_TICKS(INT_TEST_TIMER_PERIOD_MS), pdTRUE, NULL, vPrintSystemStatus);
- xTimerStart(xSoftTimer, 0);
-
- xTaskCreate( vPrintTask1, "Print1", configMINIMAL_STACK_SIZE, NULL, 2, NULL );
- xTaskCreate( vPrintTask2, "Print2", configMINIMAL_STACK_SIZE, NULL, 2, NULL );
-
- write_csr(mtvec, &trap_entry);
- write_csr_mivec(&irq_entry);
-
- vUartPuts("[AOCPU]:Starting task scheduler ...\n");
- vTaskStartScheduler();
-
- return 0;
-}
-#endif