diff --git a/.gitignore b/.gitignore index 7382682ac76b9365236a197a81f9796d983b4651..0312e04755433021b6a973d859552a2581023e4f 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ *.bin *.dis app* +*.rar # Debug files *.dSYM/ diff --git a/docs/Changlog.md b/docs/Changlog.md index 2a64c543741e53dafff2a47a9aac3fb0c9817ecd..851ffaccfb2011201b3a627d49e5fda27b9adcf6 100644 --- a/docs/Changlog.md +++ b/docs/Changlog.md @@ -20,6 +20,21 @@ * Ver   Who        Date         Changes * ----- ------     --------    -------------------------------------- --> + +# Phytium FreeRTOS SDK 2022-06-18 0.1.0 ChangeLog + +Change Log sinc 2022-05-30 + +## example + +- adapt to the new standalone sdk v0.2.0 + +- Restruct lwip_test example + +## third-party + +- Restruct lwip gmac adapter, add gmac port + # Phytium FreeRTOS SDK 0.0.7 ChangeLog Change Log sinc 2022-03-21,2022-04-20 diff --git a/drivers/serial/fpl011/fpl011_os.c b/drivers/serial/fpl011/fpl011_os.c index d6dfdda27495eb914a60944bc3025483665a3909..931d2763335cc0d242b94b0d6041abcbe6d43ab0 100644 --- a/drivers/serial/fpl011/fpl011_os.c +++ b/drivers/serial/fpl011/fpl011_os.c @@ -28,6 +28,7 @@ #include "ft_types.h" #include "ft_assert.h" #include "sdkconfig.h" +#include "cpu_info.h" #include #ifdef CONFIG_FREERTOS_USE_UART @@ -97,6 +98,7 @@ void FtFreertosUartInit(FtFreertosUart *uart_p, FtFreertosUartConfig *config_p) FPl011 *bsp_uart_p = NULL; FError ret; u32 intr_mask; + u32 cpu_id = 0; FPl011Config driver_config; FASSERT(uart_p != NULL); FASSERT(config_p != NULL); @@ -111,6 +113,8 @@ void FtFreertosUartInit(FtFreertosUart *uart_p, FtFreertosUartConfig *config_p) FASSERT((uart_p->tx_event = xEventGroupCreate()) != NULL); FASSERT((uart_p->rx_event = xEventGroupCreate()) != NULL); + GetCpuId(&cpu_id); + InterruptSetTargetCpus(bsp_uart_p->config.irq_num, cpu_id); FPl011SetRxFifoThreadhold(bsp_uart_p,FPL011IFLS_RXIFLSEL_1_4); FPl011SetTxFifoThreadHold(bsp_uart_p,FPL011IFLS_TXIFLSEL_1_2); @@ -118,7 +122,6 @@ void FtFreertosUartInit(FtFreertosUart *uart_p, FtFreertosUartConfig *config_p) FPl011SetInterruptMask(bsp_uart_p,intr_mask); FPl011SetOptions(bsp_uart_p, FPL011_OPTION_UARTEN | FPL011_OPTION_RXEN | FPL011_OPTION_TXEN | FPL011_OPTION_FIFOEN); - InterruptSetPriority(bsp_uart_p->config.irq_num, config_p->isr_priority); InterruptInstall(bsp_uart_p->config.irq_num, FPl011InterruptHandler, bsp_uart_p, "uart1"); InterruptUmask(bsp_uart_p->config.irq_num); diff --git a/example/amp/openamp/core0/configs/d2000_aarch32_eg_configs b/example/amp/openamp/core0/configs/d2000_aarch32_eg_configs index 6ddf67c8471ba5299f7be502727cdc418568b6eb..f834bd72420687bd47e841c249987cd0e2b17df5 100644 --- a/example/amp/openamp/core0/configs/d2000_aarch32_eg_configs +++ b/example/amp/openamp/core0/configs/d2000_aarch32_eg_configs @@ -32,9 +32,8 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -# CONFIG_USE_L3CACHE is not set +CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y # CONFIG_USE_SYS_TICK is not set CONFIG_USE_AARCH64_L1_TO_AARCH32=y @@ -48,6 +47,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -66,7 +68,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -79,6 +80,9 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -87,6 +91,17 @@ CONFIG_USE_NEW_LIBC=y # # Building Option # +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +CONFIG_LOG_ERROR=y +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -112,15 +127,8 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options - -# CONFIG_LOG_VERBOS is not set -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -CONFIG_LOG_ERROR=y -# CONFIG_LOG_NONE is not set # end of Building Option # @@ -170,5 +178,8 @@ CONFIG_USE_LETTER_SHELL=y # Letter Shell Configuration # CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration # end of FreeRTOS Setting diff --git a/example/amp/openamp/core0/configs/d2000_aarch64_eg_configs b/example/amp/openamp/core0/configs/d2000_aarch64_eg_configs index aa0b991c9871ec2332bbd0ab414c75ca49ef6398..c8b7f68b570af7b2683b63d48daf7be065d2947d 100644 --- a/example/amp/openamp/core0/configs/d2000_aarch64_eg_configs +++ b/example/amp/openamp/core0/configs/d2000_aarch64_eg_configs @@ -32,9 +32,8 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -# CONFIG_USE_L3CACHE is not set +CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y # CONFIG_USE_SYS_TICK is not set # CONFIG_MMU_DEBUG_PRINTS is not set @@ -48,6 +47,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -66,7 +68,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -79,6 +80,9 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -87,6 +91,17 @@ CONFIG_USE_NEW_LIBC=y # # Building Option # +CONFIG_LOG_VERBOS=y +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +# CONFIG_LOG_ERROR is not set +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -102,20 +117,14 @@ CONFIG_RAM_START_UP_ADDR=0xb0300000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options - -CONFIG_LOG_VERBOS=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set # end of Building Option # @@ -165,5 +174,8 @@ CONFIG_USE_LETTER_SHELL=y # Letter Shell Configuration # CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration # end of FreeRTOS Setting diff --git a/example/amp/openamp/core0/configs/ft2004_aarch32_eg_configs b/example/amp/openamp/core0/configs/ft2004_aarch32_eg_configs index b9f719b58c888e61e8be5ff3fb78216f2d5cf0b6..435638022be7be3a0fca5603a01879d33ffb1114 100644 --- a/example/amp/openamp/core0/configs/ft2004_aarch32_eg_configs +++ b/example/amp/openamp/core0/configs/ft2004_aarch32_eg_configs @@ -32,9 +32,8 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -# CONFIG_USE_L3CACHE is not set +CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y # CONFIG_USE_SYS_TICK is not set CONFIG_USE_AARCH64_L1_TO_AARCH32=y @@ -43,11 +42,14 @@ CONFIG_USE_AARCH64_L1_TO_AARCH32=y # # Board Configuration # -# CONFIG_TARGET_F2000_4 is not set CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_D2000 is not set # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -66,7 +68,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -79,6 +80,9 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -87,6 +91,17 @@ CONFIG_USE_NEW_LIBC=y # # Building Option # +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +CONFIG_LOG_ERROR=y +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -112,15 +127,8 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options - -# CONFIG_LOG_VERBOS is not set -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -CONFIG_LOG_ERROR=y -# CONFIG_LOG_NONE is not set # end of Building Option # @@ -170,5 +178,8 @@ CONFIG_USE_LETTER_SHELL=y # Letter Shell Configuration # CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration # end of FreeRTOS Setting diff --git a/example/amp/openamp/core0/configs/ft2004_aarch64_eg_configs b/example/amp/openamp/core0/configs/ft2004_aarch64_eg_configs index ac32338011a54f35916bed4b4437886408b75ce4..92d97b6791d3fc05e0560fcb04a2ac3fb490063d 100644 --- a/example/amp/openamp/core0/configs/ft2004_aarch64_eg_configs +++ b/example/amp/openamp/core0/configs/ft2004_aarch64_eg_configs @@ -32,9 +32,8 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -# CONFIG_USE_L3CACHE is not set +CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y # CONFIG_USE_SYS_TICK is not set # CONFIG_MMU_DEBUG_PRINTS is not set @@ -43,11 +42,14 @@ CONFIG_USE_MMU=y # # Board Configuration # -# CONFIG_TARGET_F2000_4 is not set CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_D2000 is not set # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -66,7 +68,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -79,6 +80,9 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -87,6 +91,17 @@ CONFIG_USE_NEW_LIBC=y # # Building Option # +CONFIG_LOG_VERBOS=y +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +# CONFIG_LOG_ERROR is not set +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -102,20 +117,14 @@ CONFIG_RAM_START_UP_ADDR=0xb0300000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options - -CONFIG_LOG_VERBOS=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set # end of Building Option # @@ -165,5 +174,8 @@ CONFIG_USE_LETTER_SHELL=y # Letter Shell Configuration # CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration # end of FreeRTOS Setting diff --git a/example/amp/openamp/core0/makefile b/example/amp/openamp/core0/makefile index 1abdc14915f2dece9bb9099c582b24fe5f3c6176..834a156b992e122b3c7bf3f48070acda3c968abe 100644 --- a/example/amp/openamp/core0/makefile +++ b/example/amp/openamp/core0/makefile @@ -22,7 +22,7 @@ include $(FREERTOS_SDK_ROOT)/make/build_freertos.mk # 完成编译 boot: - make + make -j cp ./$(CONFIG_TARGET_NAME).elf $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).elf scp: diff --git a/example/amp/openamp/core0/sdkconfig b/example/amp/openamp/core0/sdkconfig index b9f719b58c888e61e8be5ff3fb78216f2d5cf0b6..435638022be7be3a0fca5603a01879d33ffb1114 100644 --- a/example/amp/openamp/core0/sdkconfig +++ b/example/amp/openamp/core0/sdkconfig @@ -32,9 +32,8 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -# CONFIG_USE_L3CACHE is not set +CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y # CONFIG_USE_SYS_TICK is not set CONFIG_USE_AARCH64_L1_TO_AARCH32=y @@ -43,11 +42,14 @@ CONFIG_USE_AARCH64_L1_TO_AARCH32=y # # Board Configuration # -# CONFIG_TARGET_F2000_4 is not set CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_D2000 is not set # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -66,7 +68,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -79,6 +80,9 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -87,6 +91,17 @@ CONFIG_USE_NEW_LIBC=y # # Building Option # +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +CONFIG_LOG_ERROR=y +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -112,15 +127,8 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options - -# CONFIG_LOG_VERBOS is not set -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -CONFIG_LOG_ERROR=y -# CONFIG_LOG_NONE is not set # end of Building Option # @@ -170,5 +178,8 @@ CONFIG_USE_LETTER_SHELL=y # Letter Shell Configuration # CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set # end of Letter Shell Configuration # end of FreeRTOS Setting diff --git a/example/amp/openamp/core0/sdkconfig.h b/example/amp/openamp/core0/sdkconfig.h index 1bbe850446c1d117376128159874c3841c6bccc2..3734019cf9d48d4b45806d4098577b6abdbbb153 100644 --- a/example/amp/openamp/core0/sdkconfig.h +++ b/example/amp/openamp/core0/sdkconfig.h @@ -28,9 +28,8 @@ #define CONFIG_TARGET_ARMV8_AARCH32 /* CONFIG_TARGET_ARMV8_AARCH64 is not set */ -/* CONFIG_TARGET_ARMV7 is not set */ #define CONFIG_USE_CACHE -/* CONFIG_USE_L3CACHE is not set */ +#define CONFIG_USE_L3CACHE #define CONFIG_USE_MMU /* CONFIG_USE_SYS_TICK is not set */ #define CONFIG_USE_AARCH64_L1_TO_AARCH32 @@ -38,11 +37,14 @@ /* Board Configuration */ -/* CONFIG_TARGET_F2000_4 is not set */ #define CONFIG_TARGET_F2000_4 +/* CONFIG_TARGET_D2000 is not set */ /* CONFIG_TARGET_E2000Q is not set */ /* CONFIG_TARGET_E2000D is not set */ /* CONFIG_TARGET_E2000S is not set */ +#define CONFIG_DEFAULT_DEBUG_PRINT_UART1 +/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ +/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ /* end of Board Configuration */ /* Components Configuration */ @@ -58,7 +60,6 @@ #define CONFIG_ENABLE_Pl011_UART /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ -/* CONFIG_USE_IOMUX is not set */ /* CONFIG_USE_ETH is not set */ /* CONFIG_USE_CAN is not set */ /* CONFIG_USE_I2C is not set */ @@ -71,12 +72,27 @@ /* CONFIG_USE_RTC is not set */ /* CONFIG_USE_SATA is not set */ /* CONFIG_USE_USB is not set */ +/* CONFIG_USE_ADC is not set */ +/* CONFIG_USE_PWM is not set */ +/* CONFIG_USE_IPC is not set */ /* end of Components Configuration */ #define CONFIG_USE_NEW_LIBC /* end of Standalone Setting */ /* Building Option */ +/* CONFIG_LOG_VERBOS is not set */ +/* CONFIG_LOG_DEBUG is not set */ +/* CONFIG_LOG_INFO is not set */ +/* CONFIG_LOG_WARN is not set */ +#define CONFIG_LOG_ERROR +/* CONFIG_LOG_NONE is not set */ +#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ +/* CONFIG_LOG_EXTRA_INFO is not set */ +/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ + /* Linker Options */ #define CONFIG_AARCH32_RAM_LD @@ -99,14 +115,8 @@ /* Compiler Options */ -#define CONFIG_DON_T_BINARY_OUTPUT +/* CONFIG_OUTPUT_BINARY is not set */ /* end of Compiler Options */ -/* CONFIG_LOG_VERBOS is not set */ -/* CONFIG_LOG_DEBUG is not set */ -/* CONFIG_LOG_INFO is not set */ -/* CONFIG_LOG_WARN is not set */ -#define CONFIG_LOG_ERROR -/* CONFIG_LOG_NONE is not set */ /* end of Building Option */ /* Component Configuration */ @@ -148,6 +158,9 @@ /* Letter Shell Configuration */ #define CONFIG_LS_PL011_UART +#define CONFIG_DEFAULT_LETTER_SHELL_USE_UART1 +/* CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set */ +/* CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set */ /* end of Letter Shell Configuration */ /* end of FreeRTOS Setting */ diff --git a/example/amp/openamp/core1/configs/d2000_aarch32_eg_configs b/example/amp/openamp/core1/configs/d2000_aarch32_eg_configs index 37c7eecef899af1058527125786ae5a3cdd6f43b..3797f2dca650a4367081e4cb192e9696baf7d78c 100644 --- a/example/amp/openamp/core1/configs/d2000_aarch32_eg_configs +++ b/example/amp/openamp/core1/configs/d2000_aarch32_eg_configs @@ -18,7 +18,6 @@ CONFIG_IPI_IRQ_NUM_PRIORITY=16 CONFIG_SPIN_MEM=0x80000000 CONFIG_TARGET_CPU_ID=1 CONFIG_IPI_CHN_BITMASK=1 -CONFIG_WITH_BAREMETAL=y # end of Amp Config # end of Project Configuration @@ -32,9 +31,8 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -# CONFIG_USE_L3CACHE is not set +CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y # CONFIG_USE_SYS_TICK is not set # CONFIG_USE_AARCH64_L1_TO_AARCH32 is not set @@ -48,6 +46,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -66,7 +67,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -79,6 +79,9 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -87,6 +90,17 @@ CONFIG_USE_NEW_LIBC=y # # Building Option # +CONFIG_LOG_VERBOS=y +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +# CONFIG_LOG_ERROR is not set +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +# CONFIG_INTERRUPT_ROLE_MASTER is not set +CONFIG_INTERRUPT_ROLE_SLAVE=y +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -112,15 +126,8 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options - -CONFIG_LOG_VERBOS=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set # end of Building Option # diff --git a/example/amp/openamp/core1/configs/d2000_aarch64_eg_configs b/example/amp/openamp/core1/configs/d2000_aarch64_eg_configs index 0ddad6e880105143b34a7f35470c6755a307c149..8892fb446bb05c70b8938f585598892c9574b5bb 100644 --- a/example/amp/openamp/core1/configs/d2000_aarch64_eg_configs +++ b/example/amp/openamp/core1/configs/d2000_aarch64_eg_configs @@ -31,9 +31,8 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -# CONFIG_USE_L3CACHE is not set +CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y # CONFIG_USE_SYS_TICK is not set # CONFIG_MMU_DEBUG_PRINTS is not set @@ -47,6 +46,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -65,7 +67,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -78,6 +79,9 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -92,6 +96,11 @@ CONFIG_LOG_VERBOS=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +# CONFIG_INTERRUPT_ROLE_MASTER is not set +CONFIG_INTERRUPT_ROLE_SLAVE=y +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -107,12 +116,13 @@ CONFIG_RAM_START_UP_ADDR=0xe0300000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/amp/openamp/core1/configs/ft2004_aarch32_eg_configs b/example/amp/openamp/core1/configs/ft2004_aarch32_eg_configs index 5e58d0e87d6313a268d46156ccdd4ed28c7c2c7f..4bd8309b8754711de58d7c9c429c12378eba38f8 100644 --- a/example/amp/openamp/core1/configs/ft2004_aarch32_eg_configs +++ b/example/amp/openamp/core1/configs/ft2004_aarch32_eg_configs @@ -18,7 +18,6 @@ CONFIG_IPI_IRQ_NUM_PRIORITY=16 CONFIG_SPIN_MEM=0x80000000 CONFIG_TARGET_CPU_ID=1 CONFIG_IPI_CHN_BITMASK=1 -CONFIG_WITH_BAREMETAL=y # end of Amp Config # end of Project Configuration @@ -32,9 +31,8 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -# CONFIG_USE_L3CACHE is not set +CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y # CONFIG_USE_SYS_TICK is not set # CONFIG_USE_AARCH64_L1_TO_AARCH32 is not set @@ -43,11 +41,14 @@ CONFIG_USE_MMU=y # # Board Configuration # -# CONFIG_TARGET_F2000_4 is not set CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_D2000 is not set # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -66,7 +67,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -79,6 +79,9 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -87,6 +90,17 @@ CONFIG_USE_NEW_LIBC=y # # Building Option # +CONFIG_LOG_VERBOS=y +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +# CONFIG_LOG_ERROR is not set +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +# CONFIG_INTERRUPT_ROLE_MASTER is not set +CONFIG_INTERRUPT_ROLE_SLAVE=y +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -112,15 +126,8 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options - -CONFIG_LOG_VERBOS=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set # end of Building Option # diff --git a/example/amp/openamp/core1/configs/ft2004_aarch64_eg_configs b/example/amp/openamp/core1/configs/ft2004_aarch64_eg_configs index 16cc6178461f2170759d2a5d24aad9e0607fc442..e4c5ab4b2e336aacec7bd578aa856fecfa4dab59 100644 --- a/example/amp/openamp/core1/configs/ft2004_aarch64_eg_configs +++ b/example/amp/openamp/core1/configs/ft2004_aarch64_eg_configs @@ -31,9 +31,8 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -# CONFIG_USE_L3CACHE is not set +CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y # CONFIG_USE_SYS_TICK is not set # CONFIG_MMU_DEBUG_PRINTS is not set @@ -42,11 +41,14 @@ CONFIG_USE_MMU=y # # Board Configuration # -# CONFIG_TARGET_F2000_4 is not set CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_D2000 is not set # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -65,7 +67,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -78,6 +79,9 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -92,6 +96,11 @@ CONFIG_LOG_VERBOS=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +# CONFIG_INTERRUPT_ROLE_MASTER is not set +CONFIG_INTERRUPT_ROLE_SLAVE=y +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -107,12 +116,13 @@ CONFIG_RAM_START_UP_ADDR=0xe0300000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/amp/openamp/core1/sdkconfig b/example/amp/openamp/core1/sdkconfig index 5e58d0e87d6313a268d46156ccdd4ed28c7c2c7f..4bd8309b8754711de58d7c9c429c12378eba38f8 100644 --- a/example/amp/openamp/core1/sdkconfig +++ b/example/amp/openamp/core1/sdkconfig @@ -18,7 +18,6 @@ CONFIG_IPI_IRQ_NUM_PRIORITY=16 CONFIG_SPIN_MEM=0x80000000 CONFIG_TARGET_CPU_ID=1 CONFIG_IPI_CHN_BITMASK=1 -CONFIG_WITH_BAREMETAL=y # end of Amp Config # end of Project Configuration @@ -32,9 +31,8 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -# CONFIG_USE_L3CACHE is not set +CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y # CONFIG_USE_SYS_TICK is not set # CONFIG_USE_AARCH64_L1_TO_AARCH32 is not set @@ -43,11 +41,14 @@ CONFIG_USE_MMU=y # # Board Configuration # -# CONFIG_TARGET_F2000_4 is not set CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_D2000 is not set # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -66,7 +67,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set # CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set @@ -79,6 +79,9 @@ CONFIG_ENABLE_Pl011_UART=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -87,6 +90,17 @@ CONFIG_USE_NEW_LIBC=y # # Building Option # +CONFIG_LOG_VERBOS=y +# CONFIG_LOG_DEBUG is not set +# CONFIG_LOG_INFO is not set +# CONFIG_LOG_WARN is not set +# CONFIG_LOG_ERROR is not set +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +# CONFIG_INTERRUPT_ROLE_MASTER is not set +CONFIG_INTERRUPT_ROLE_SLAVE=y +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -112,15 +126,8 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options - -CONFIG_LOG_VERBOS=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set # end of Building Option # diff --git a/example/amp/openamp/core1/sdkconfig.h b/example/amp/openamp/core1/sdkconfig.h index 5ece8e72c2a0f3872ff52c48234eba7354535a84..08fe8d08c0b332bad4ca6d26e5019623ca41d249 100644 --- a/example/amp/openamp/core1/sdkconfig.h +++ b/example/amp/openamp/core1/sdkconfig.h @@ -16,7 +16,6 @@ #define CONFIG_SPIN_MEM 0x80000000 #define CONFIG_TARGET_CPU_ID 1 #define CONFIG_IPI_CHN_BITMASK 1 -#define CONFIG_WITH_BAREMETAL /* end of Amp Config */ /* end of Project Configuration */ @@ -28,9 +27,8 @@ #define CONFIG_TARGET_ARMV8_AARCH32 /* CONFIG_TARGET_ARMV8_AARCH64 is not set */ -/* CONFIG_TARGET_ARMV7 is not set */ #define CONFIG_USE_CACHE -/* CONFIG_USE_L3CACHE is not set */ +#define CONFIG_USE_L3CACHE #define CONFIG_USE_MMU /* CONFIG_USE_SYS_TICK is not set */ /* CONFIG_USE_AARCH64_L1_TO_AARCH32 is not set */ @@ -38,11 +36,14 @@ /* Board Configuration */ -/* CONFIG_TARGET_F2000_4 is not set */ #define CONFIG_TARGET_F2000_4 +/* CONFIG_TARGET_D2000 is not set */ /* CONFIG_TARGET_E2000Q is not set */ /* CONFIG_TARGET_E2000D is not set */ /* CONFIG_TARGET_E2000S is not set */ +#define CONFIG_DEFAULT_DEBUG_PRINT_UART1 +/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ +/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ /* end of Board Configuration */ /* Components Configuration */ @@ -58,7 +59,6 @@ #define CONFIG_ENABLE_Pl011_UART /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ -/* CONFIG_USE_IOMUX is not set */ /* CONFIG_USE_ETH is not set */ /* CONFIG_USE_CAN is not set */ /* CONFIG_USE_I2C is not set */ @@ -71,12 +71,27 @@ /* CONFIG_USE_RTC is not set */ /* CONFIG_USE_SATA is not set */ /* CONFIG_USE_USB is not set */ +/* CONFIG_USE_ADC is not set */ +/* CONFIG_USE_PWM is not set */ +/* CONFIG_USE_IPC is not set */ /* end of Components Configuration */ #define CONFIG_USE_NEW_LIBC /* end of Standalone Setting */ /* Building Option */ +#define CONFIG_LOG_VERBOS +/* CONFIG_LOG_DEBUG is not set */ +/* CONFIG_LOG_INFO is not set */ +/* CONFIG_LOG_WARN is not set */ +/* CONFIG_LOG_ERROR is not set */ +/* CONFIG_LOG_NONE is not set */ +#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG +/* CONFIG_INTERRUPT_ROLE_MASTER is not set */ +#define CONFIG_INTERRUPT_ROLE_SLAVE +/* CONFIG_LOG_EXTRA_INFO is not set */ +/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ + /* Linker Options */ #define CONFIG_AARCH32_RAM_LD @@ -99,14 +114,8 @@ /* Compiler Options */ -#define CONFIG_DON_T_BINARY_OUTPUT +/* CONFIG_OUTPUT_BINARY is not set */ /* end of Compiler Options */ -#define CONFIG_LOG_VERBOS -/* CONFIG_LOG_DEBUG is not set */ -/* CONFIG_LOG_INFO is not set */ -/* CONFIG_LOG_WARN is not set */ -/* CONFIG_LOG_ERROR is not set */ -/* CONFIG_LOG_NONE is not set */ /* end of Building Option */ /* Component Configuration */ diff --git a/example/freertos_test/configs/d2000_aarch32_eg_configs b/example/freertos_test/configs/d2000_aarch32_eg_configs index 311dd1d91ef9a63a86447691d9cb05099205b4cb..039caf5a9547e0423879a9bb3dfc403a1b95b81e 100644 --- a/example/freertos_test/configs/d2000_aarch32_eg_configs +++ b/example/freertos_test/configs/d2000_aarch32_eg_configs @@ -2,7 +2,7 @@ # # Project Configuration # -CONFIG_TARGET_NAME="d2000_freertos" +CONFIG_TARGET_NAME="d2000_freertos_32" CONFIG_LWIP_POLL_TEST=y # CONFIG_LWIP_INTRRUPT_TEST is not set # end of Project Configuration @@ -17,11 +17,10 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y -# CONFIG_USE_SYS_TICK is not set +CONFIG_USE_SYS_TICK=y CONFIG_USE_AARCH64_L1_TO_AARCH32=y # end of Arch Configuration @@ -33,6 +32,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,7 +53,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -81,6 +82,9 @@ CONFIG_ENABLE_FWDT=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -95,6 +99,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -120,7 +129,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/freertos_test/configs/d2000_aarch64_eg_configs b/example/freertos_test/configs/d2000_aarch64_eg_configs index ca6275911c622b0a31248d9b9464c590c3a1c781..72e9530c52b401553fea7c5e576c1b0d3cdf5875 100644 --- a/example/freertos_test/configs/d2000_aarch64_eg_configs +++ b/example/freertos_test/configs/d2000_aarch64_eg_configs @@ -17,7 +17,6 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -33,6 +32,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,7 +53,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -81,6 +82,9 @@ CONFIG_ENABLE_FWDT=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -95,6 +99,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -110,12 +119,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/freertos_test/configs/ft2004_aarch32_eg_configs b/example/freertos_test/configs/ft2004_aarch32_eg_configs index a4d10dad439f55c4424d21848e2fda709c59128b..82dbbe95ff94d5c797b1b826b9a1ff0f4eac9110 100644 --- a/example/freertos_test/configs/ft2004_aarch32_eg_configs +++ b/example/freertos_test/configs/ft2004_aarch32_eg_configs @@ -17,7 +17,6 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -33,6 +32,9 @@ CONFIG_TARGET_F2000_4=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,7 +53,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -81,6 +82,9 @@ CONFIG_ENABLE_FWDT=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -95,6 +99,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -120,7 +129,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/freertos_test/configs/ft2004_aarch64_eg_configs b/example/freertos_test/configs/ft2004_aarch64_eg_configs index 870a8e862d49f5eee5f0bcbe728b5caaf0eb30d3..a5fdebe62e9b0b0112ff1e963486b46d3b3317bf 100644 --- a/example/freertos_test/configs/ft2004_aarch64_eg_configs +++ b/example/freertos_test/configs/ft2004_aarch64_eg_configs @@ -2,7 +2,7 @@ # # Project Configuration # -CONFIG_TARGET_NAME="ft2004_freertos" +CONFIG_TARGET_NAME="ft2004_freertos_64" CONFIG_LWIP_POLL_TEST=y # CONFIG_LWIP_INTRRUPT_TEST is not set # end of Project Configuration @@ -17,7 +17,6 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -33,6 +32,9 @@ CONFIG_TARGET_F2000_4=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,18 +53,7 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set -CONFIG_USE_ETH=y - -# -# Eth Configuration -# -# CONFIG_ENABLE_FXMAC is not set -CONFIG_ENABLE_FGMAC=y -CONFIG_FGMAC_PHY_COMMON=y -# CONFIG_FGMAC_PHY_AR803X is not set -# end of Eth Configuration - +# CONFIG_USE_ETH is not set # CONFIG_USE_CAN is not set # CONFIG_USE_I2C is not set # CONFIG_USE_TIMER is not set @@ -81,6 +72,9 @@ CONFIG_ENABLE_FWDT=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -90,11 +84,16 @@ CONFIG_USE_NEW_LIBC=y # Building Option # # CONFIG_LOG_VERBOS is not set -# CONFIG_LOG_DEBUG is not set -CONFIG_LOG_INFO=y +CONFIG_LOG_DEBUG=y +# CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -110,12 +109,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/freertos_test/main.c b/example/freertos_test/main.c index 15a3fb417e76a55fe6788ac0257423dae51e7ee6..eb9ba337a9274b62cff599834b6cf6868494fcf1 100644 --- a/example/freertos_test/main.c +++ b/example/freertos_test/main.c @@ -28,7 +28,6 @@ #include "task.h" #include "unity.h" - #define ISR_FLOAT_TEST 1 #define BACKPORT_TEST 1 #define DEBUG_QUEUE_REGISTER_TEST 1 @@ -43,7 +42,7 @@ #define ISR_LATENCY_TEST 1 #define HOOK_TEST 1 #define NEWLIB_REENT_TEST 1 -#define PANIC_TEST 1 +#define PANIC_TEST 0 /* D2000 aarch32 is not supported*/ #define QUEUE_SET_GET_TEST 1 #define STREAM_TEST 1 #define PRIORITY_TEST 1 diff --git a/example/freertos_test/makefile b/example/freertos_test/makefile index 0d410a80d72c1fff5cf6d420171b98176766c389..1552d892274d4fc2fefd9f1d4ee0dff7d4191670 100644 --- a/example/freertos_test/makefile +++ b/example/freertos_test/makefile @@ -22,6 +22,6 @@ include $(FREERTOS_SDK_ROOT)/make/build_freertos.mk # 完成编译 boot: - make + make -j cp ./$(CONFIG_TARGET_NAME).elf $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).elf diff --git a/example/freertos_test/sdkconfig b/example/freertos_test/sdkconfig index ca6275911c622b0a31248d9b9464c590c3a1c781..039caf5a9547e0423879a9bb3dfc403a1b95b81e 100644 --- a/example/freertos_test/sdkconfig +++ b/example/freertos_test/sdkconfig @@ -2,7 +2,7 @@ # # Project Configuration # -CONFIG_TARGET_NAME="d2000_freertos" +CONFIG_TARGET_NAME="d2000_freertos_32" CONFIG_LWIP_POLL_TEST=y # CONFIG_LWIP_INTRRUPT_TEST is not set # end of Project Configuration @@ -15,14 +15,13 @@ CONFIG_USE_FREERTOS=y # # Arch Configuration # -# CONFIG_TARGET_ARMV8_AARCH32 is not set -CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set +CONFIG_TARGET_ARMV8_AARCH32=y +# CONFIG_TARGET_ARMV8_AARCH64 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y CONFIG_USE_SYS_TICK=y -# CONFIG_MMU_DEBUG_PRINTS is not set +CONFIG_USE_AARCH64_L1_TO_AARCH32=y # end of Arch Configuration # @@ -33,6 +32,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,7 +53,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -81,6 +82,9 @@ CONFIG_ENABLE_FWDT=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -95,12 +99,17 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options # -# CONFIG_AARCH32_RAM_LD is not set -CONFIG_AARCH64_RAM_LD=y +CONFIG_AARCH32_RAM_LD=y +# CONFIG_AARCH64_RAM_LD is not set # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y CONFIG_ROM_START_UP_ADDR=0x80100000 @@ -109,13 +118,18 @@ CONFIG_LINK_SCRIPT_RAM=y CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 -CONFIG_STACK_SIZE=0x100000 +CONFIG_SVC_STACK_SIZE=0x1000 +CONFIG_SYS_STACK_SIZE=0x1000 +CONFIG_IRQ_STACK_SIZE=0x1000 +CONFIG_ABORT_STACK_SIZE=0x1000 +CONFIG_FIQ_STACK_SIZE=0x1000 +CONFIG_UNDEF_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/freertos_test/sdkconfig.h b/example/freertos_test/sdkconfig.h index b4dd5ab22b6a0453888d2c37d9881d201812f14a..c38e3c73dfdf5f17f665681906d5cdbf68075082 100644 --- a/example/freertos_test/sdkconfig.h +++ b/example/freertos_test/sdkconfig.h @@ -3,7 +3,7 @@ /* Project Configuration */ -#define CONFIG_TARGET_NAME "d2000_freertos" +#define CONFIG_TARGET_NAME "d2000_freertos_32" #define CONFIG_LWIP_POLL_TEST /* CONFIG_LWIP_INTRRUPT_TEST is not set */ /* end of Project Configuration */ @@ -14,14 +14,13 @@ /* Arch Configuration */ -/* CONFIG_TARGET_ARMV8_AARCH32 is not set */ -#define CONFIG_TARGET_ARMV8_AARCH64 -/* CONFIG_TARGET_ARMV7 is not set */ +#define CONFIG_TARGET_ARMV8_AARCH32 +/* CONFIG_TARGET_ARMV8_AARCH64 is not set */ #define CONFIG_USE_CACHE #define CONFIG_USE_L3CACHE #define CONFIG_USE_MMU #define CONFIG_USE_SYS_TICK -/* CONFIG_MMU_DEBUG_PRINTS is not set */ +#define CONFIG_USE_AARCH64_L1_TO_AARCH32 /* end of Arch Configuration */ /* Board Configuration */ @@ -31,6 +30,9 @@ /* CONFIG_TARGET_E2000Q is not set */ /* CONFIG_TARGET_E2000D is not set */ /* CONFIG_TARGET_E2000S is not set */ +#define CONFIG_DEFAULT_DEBUG_PRINT_UART1 +/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ +/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ /* end of Board Configuration */ /* Components Configuration */ @@ -46,7 +48,6 @@ #define CONFIG_ENABLE_Pl011_UART /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ -/* CONFIG_USE_IOMUX is not set */ #define CONFIG_USE_ETH /* Eth Configuration */ @@ -72,6 +73,9 @@ /* CONFIG_USE_RTC is not set */ /* CONFIG_USE_SATA is not set */ /* CONFIG_USE_USB is not set */ +/* CONFIG_USE_ADC is not set */ +/* CONFIG_USE_PWM is not set */ +/* CONFIG_USE_IPC is not set */ /* end of Components Configuration */ #define CONFIG_USE_NEW_LIBC /* end of Standalone Setting */ @@ -84,11 +88,16 @@ /* CONFIG_LOG_WARN is not set */ /* CONFIG_LOG_ERROR is not set */ /* CONFIG_LOG_NONE is not set */ +#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ +/* CONFIG_LOG_EXTRA_INFO is not set */ +/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ /* Linker Options */ -/* CONFIG_AARCH32_RAM_LD is not set */ -#define CONFIG_AARCH64_RAM_LD +#define CONFIG_AARCH32_RAM_LD +/* CONFIG_AARCH64_RAM_LD is not set */ /* CONFIG_USER_DEFINED_LD is not set */ #define CONFIG_LINK_SCRIPT_ROM #define CONFIG_ROM_START_UP_ADDR 0x80100000 @@ -97,12 +106,17 @@ #define CONFIG_RAM_START_UP_ADDR 0x81000000 #define CONFIG_RAM_SIZE_MB 64 #define CONFIG_HEAP_SIZE 1 -#define CONFIG_STACK_SIZE 0x100000 +#define CONFIG_SVC_STACK_SIZE 0x1000 +#define CONFIG_SYS_STACK_SIZE 0x1000 +#define CONFIG_IRQ_STACK_SIZE 0x1000 +#define CONFIG_ABORT_STACK_SIZE 0x1000 +#define CONFIG_FIQ_STACK_SIZE 0x1000 +#define CONFIG_UNDEF_STACK_SIZE 0x1000 /* end of Linker Options */ /* Compiler Options */ -#define CONFIG_DON_T_BINARY_OUTPUT +/* CONFIG_OUTPUT_BINARY is not set */ /* end of Compiler Options */ /* end of Building Option */ diff --git a/example/freertos_test/src/freertos_eventgroups.c b/example/freertos_test/src/freertos_eventgroups.c index c495abf89c36be42bf9985d1c27da61e917e9699..ebd758f13675a0b0381f74b995a67a983657172e 100644 --- a/example/freertos_test/src/freertos_eventgroups.c +++ b/example/freertos_test/src/freertos_eventgroups.c @@ -1,5 +1,6 @@ #include - +#include +#include #include "FreeRTOS.h" #include "task.h" #include "semphr.h" @@ -9,7 +10,6 @@ #include "ft_debug.h" #include "unity.h" #include "interrupt.h" -#include "gicv3.h" #include "parameters.h" #include "fwdt.h" #include "fwdt_hw.h" @@ -149,7 +149,7 @@ static void FWdtRefreshTest(FWdtCtrl *pctrl) { FWdtConfig *pconfig = &pctrl->config; /* interrupt init */ - InterruptSetPriority(pconfig->irq_num, /*pconfig->irq_prority*/((0x8 << 4) + 4 * 16)); + InterruptSetPriority(pconfig->irq_num, IRQ_PRIORITY_VALUE_12); InterruptInstall(pconfig->irq_num, FWdtInterrupt, (void*)pctrl, pconfig->instance_name); InterruptUmask(pconfig->irq_num); FWdtSetTimeout(pctrl, 3); @@ -165,9 +165,17 @@ static void FWdtRefreshTest(FWdtCtrl *pctrl) */ static void WdtTaskCreate(void) { - FWdtCtrl *pctrl = &wdt_ctrl; - pctrl->config = *FWdtLookupConfig(wdt_id); - FWdtRefreshTest(pctrl); + GenericTimerStart(); + + memset(&wdt_ctrl, 0, sizeof(wdt_ctrl)); + + FWdtConfig pconfig = *FWdtLookupConfig(wdt_id); + + /* wdt init, include reset and read */ + FWdtCfgInitialize(&wdt_ctrl, &pconfig); + + FWdtRefreshTest(&wdt_ctrl); + } void EventGroupIsrTest(void) diff --git a/example/freertos_test/src/test_isr_latency.c b/example/freertos_test/src/test_isr_latency.c index 2f0b3c6f9f51d985f594f2a34c5b68af58ffa68a..10f076b4d3c0f92e21df9e4a96f00c2c04016cbe 100644 --- a/example/freertos_test/src/test_isr_latency.c +++ b/example/freertos_test/src/test_isr_latency.c @@ -1,4 +1,5 @@ #include +#include #include "FreeRTOS.h" #include "task.h" #include "semphr.h" @@ -6,7 +7,6 @@ #include #include #include "interrupt.h" -#include "gicv3.h" #include "parameters.h" #include "fwdt.h" #include "fwdt_hw.h" @@ -64,13 +64,14 @@ static void FWdtRefreshTest(FWdtCtrl *pctrl) { FWdtConfig *pconfig = &pctrl->config; /* interrupt init */ - InterruptSetPriority(pconfig->irq_num, /*pconfig->irq_prority*/((0x8 << 4) + 4 * 16)); + InterruptSetPriority(pconfig->irq_num, IRQ_PRIORITY_VALUE_12); InterruptInstall(pconfig->irq_num, FWdtInterrupt, (void*)pctrl, pconfig->instance_name); InterruptUmask(pconfig->irq_num); FWdtSetTimeout(pctrl, 1); FWdtStart(pctrl); } + /** * @name: WdtNoRefreshTest * @msg: Set wdt timeout value, start wdt, no refresh. @@ -80,9 +81,17 @@ static void FWdtRefreshTest(FWdtCtrl *pctrl) */ static void WdtTaskCreate(void) { - FWdtCtrl *pctrl = &wdt_ctrl; - pctrl->config = *FWdtLookupConfig(wdt_id); - FWdtRefreshTest(pctrl); + GenericTimerStart(); + + memset(&wdt_ctrl, 0, sizeof(wdt_ctrl)); + + FWdtConfig pconfig = *FWdtLookupConfig(wdt_id); + + /* wdt init, include reset and read */ + FWdtCfgInitialize(&wdt_ctrl, &pconfig); + + FWdtRefreshTest(&wdt_ctrl); + } static void TestTask(void *arg) { diff --git a/example/freertos_test/src/wdt_isr.c b/example/freertos_test/src/wdt_isr.c index ac39c9ab0b1d9ee3ba012a29796afa7bdb5b97b3..c3b60921c59e172b887f996890271cfb67ff7734 100644 --- a/example/freertos_test/src/wdt_isr.c +++ b/example/freertos_test/src/wdt_isr.c @@ -25,7 +25,7 @@ #include #include #include "interrupt.h" -#include "gicv3.h" + #include "parameters.h" #include "fwdt.h" #include "fwdt_hw.h" diff --git a/example/function_test/configs/d2000_aarch32_eg_configs b/example/function_test/configs/d2000_aarch32_eg_configs index 7be054e5011244d39bfb1c27ba18bae27d681714..96723a200da17cf39acacae5a0b3c32f863747a6 100644 --- a/example/function_test/configs/d2000_aarch32_eg_configs +++ b/example/function_test/configs/d2000_aarch32_eg_configs @@ -15,7 +15,6 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -31,6 +30,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -49,7 +51,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -72,6 +73,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -86,6 +90,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -111,7 +120,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/function_test/configs/d2000_aarch64_eg_configs b/example/function_test/configs/d2000_aarch64_eg_configs index 787f24ddb988dca43363ca67e6fe91ac693348da..2b102f641ef57de30835c0d7672e4816ab2f66a1 100644 --- a/example/function_test/configs/d2000_aarch64_eg_configs +++ b/example/function_test/configs/d2000_aarch64_eg_configs @@ -15,7 +15,6 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -31,6 +30,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -49,7 +51,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -72,6 +73,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -86,6 +90,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -101,12 +110,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/function_test/configs/ft2004_aarch32_eg_configs b/example/function_test/configs/ft2004_aarch32_eg_configs index dc58cfd77f526b5892541ce6b0654b107b810d7e..6749092beda947a4d3e8064aa7b9de464c0de7b3 100644 --- a/example/function_test/configs/ft2004_aarch32_eg_configs +++ b/example/function_test/configs/ft2004_aarch32_eg_configs @@ -15,7 +15,6 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -31,6 +30,9 @@ CONFIG_TARGET_F2000_4=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -49,7 +51,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -72,6 +73,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -86,6 +90,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -111,7 +120,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/function_test/configs/ft2004_aarch64_eg_configs b/example/function_test/configs/ft2004_aarch64_eg_configs index af81779b892d9dade88ea6cec86382b33137133d..2a7c245668efaf7efda182c5f362cacf2bbecd45 100644 --- a/example/function_test/configs/ft2004_aarch64_eg_configs +++ b/example/function_test/configs/ft2004_aarch64_eg_configs @@ -15,7 +15,6 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -31,6 +30,9 @@ CONFIG_TARGET_F2000_4=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -49,7 +51,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -72,6 +73,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -86,6 +90,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -101,12 +110,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/function_test/sdkconfig b/example/function_test/sdkconfig index 787f24ddb988dca43363ca67e6fe91ac693348da..2a7c245668efaf7efda182c5f362cacf2bbecd45 100644 --- a/example/function_test/sdkconfig +++ b/example/function_test/sdkconfig @@ -2,7 +2,7 @@ # # Project Configuration # -CONFIG_TARGET_NAME="d2000_freertos" +CONFIG_TARGET_NAME="ft2004_freertos" # end of Project Configuration # @@ -15,22 +15,24 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y -# CONFIG_USE_SYS_TICK is not set +CONFIG_USE_SYS_TICK=y # CONFIG_MMU_DEBUG_PRINTS is not set # end of Arch Configuration # # Board Configuration # -# CONFIG_TARGET_F2000_4 is not set -CONFIG_TARGET_D2000=y +CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_D2000 is not set # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -49,7 +51,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -72,6 +73,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -86,6 +90,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -101,12 +110,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/function_test/sdkconfig.h b/example/function_test/sdkconfig.h index 1599395e64bee536398116265c2d45bd08e374fa..ecde6cb5f7fd0ef82b821d70472d49f6cdca5f7b 100644 --- a/example/function_test/sdkconfig.h +++ b/example/function_test/sdkconfig.h @@ -3,7 +3,7 @@ /* Project Configuration */ -#define CONFIG_TARGET_NAME "d2000_freertos" +#define CONFIG_TARGET_NAME "ft2004_freertos" /* end of Project Configuration */ /* Standalone Setting */ @@ -14,21 +14,23 @@ /* CONFIG_TARGET_ARMV8_AARCH32 is not set */ #define CONFIG_TARGET_ARMV8_AARCH64 -/* CONFIG_TARGET_ARMV7 is not set */ #define CONFIG_USE_CACHE #define CONFIG_USE_L3CACHE #define CONFIG_USE_MMU -/* CONFIG_USE_SYS_TICK is not set */ +#define CONFIG_USE_SYS_TICK /* CONFIG_MMU_DEBUG_PRINTS is not set */ /* end of Arch Configuration */ /* Board Configuration */ -/* CONFIG_TARGET_F2000_4 is not set */ -#define CONFIG_TARGET_D2000 +#define CONFIG_TARGET_F2000_4 +/* CONFIG_TARGET_D2000 is not set */ /* CONFIG_TARGET_E2000Q is not set */ /* CONFIG_TARGET_E2000D is not set */ /* CONFIG_TARGET_E2000S is not set */ +#define CONFIG_DEFAULT_DEBUG_PRINT_UART1 +/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ +/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ /* end of Board Configuration */ /* Components Configuration */ @@ -44,7 +46,6 @@ #define CONFIG_ENABLE_Pl011_UART /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ -/* CONFIG_USE_IOMUX is not set */ #define CONFIG_USE_ETH /* Eth Configuration */ @@ -65,6 +66,9 @@ /* CONFIG_USE_RTC is not set */ /* CONFIG_USE_SATA is not set */ /* CONFIG_USE_USB is not set */ +/* CONFIG_USE_ADC is not set */ +/* CONFIG_USE_PWM is not set */ +/* CONFIG_USE_IPC is not set */ /* end of Components Configuration */ #define CONFIG_USE_NEW_LIBC /* end of Standalone Setting */ @@ -77,6 +81,11 @@ /* CONFIG_LOG_WARN is not set */ /* CONFIG_LOG_ERROR is not set */ /* CONFIG_LOG_NONE is not set */ +#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ +/* CONFIG_LOG_EXTRA_INFO is not set */ +/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ /* Linker Options */ @@ -91,11 +100,12 @@ #define CONFIG_RAM_SIZE_MB 64 #define CONFIG_HEAP_SIZE 1 #define CONFIG_STACK_SIZE 0x100000 +#define CONFIG_FPU_STACK_SIZE 0x1000 /* end of Linker Options */ /* Compiler Options */ -#define CONFIG_DON_T_BINARY_OUTPUT +/* CONFIG_OUTPUT_BINARY is not set */ /* end of Compiler Options */ /* end of Building Option */ diff --git a/example/function_test/src/test_uart.c b/example/function_test/src/test_uart.c index c34bb8eebb2c3a7ef89e2b58a8a1dc242f57b0c0..27855958d6ad7bcafe6ccf36ab893903cba7f931 100644 --- a/example/function_test/src/test_uart.c +++ b/example/function_test/src/test_uart.c @@ -24,7 +24,7 @@ #include #include "ft_types.h" #include "fpl011.h" -#include "gicv3.h" + #include "interrupt.h" static FPl011 pl011_obj; diff --git a/example/hello_world/configs/d2000_aarch32_eg_configs b/example/hello_world/configs/d2000_aarch32_eg_configs index bfba859b216ea9d4878539a56afb09a22e8cf3e4..76c3e9e09a81bb2ed2f3b1716daccae0a0a01450 100644 --- a/example/hello_world/configs/d2000_aarch32_eg_configs +++ b/example/hello_world/configs/d2000_aarch32_eg_configs @@ -20,7 +20,6 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -36,6 +35,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -54,7 +56,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -77,6 +78,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -91,6 +95,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -116,7 +125,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/hello_world/configs/d2000_aarch64_eg_configs b/example/hello_world/configs/d2000_aarch64_eg_configs index f099abac6034cf1e8fe8c8adadbb4cde502331be..ff475b13a90bbd31d8be3457a4d9551999b872ab 100644 --- a/example/hello_world/configs/d2000_aarch64_eg_configs +++ b/example/hello_world/configs/d2000_aarch64_eg_configs @@ -20,7 +20,6 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -36,6 +35,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -54,7 +56,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -77,6 +78,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -91,6 +95,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -106,12 +115,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/hello_world/configs/ft2004_aarch32_eg_configs b/example/hello_world/configs/ft2004_aarch32_eg_configs index 45305bfd438eb2a2a9c9507f6f95b8ed237ed4e3..92609aab24857f5ac850d113ca20e6846f47b83a 100644 --- a/example/hello_world/configs/ft2004_aarch32_eg_configs +++ b/example/hello_world/configs/ft2004_aarch32_eg_configs @@ -20,7 +20,6 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -36,6 +35,9 @@ CONFIG_TARGET_F2000_4=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -54,7 +56,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -77,6 +78,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -91,6 +95,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -116,7 +125,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/hello_world/configs/ft2004_aarch64_eg_configs b/example/hello_world/configs/ft2004_aarch64_eg_configs index 52b4de9835866349072fe0c318b3b9f9b4f3c6a4..9599c944d771eb7a7893f6c6f106e99d150ab4c2 100644 --- a/example/hello_world/configs/ft2004_aarch64_eg_configs +++ b/example/hello_world/configs/ft2004_aarch64_eg_configs @@ -20,7 +20,6 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -36,6 +35,9 @@ CONFIG_TARGET_F2000_4=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -54,7 +56,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -77,6 +78,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -91,6 +95,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -106,12 +115,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/hello_world/sdkconfig b/example/hello_world/sdkconfig index f099abac6034cf1e8fe8c8adadbb4cde502331be..9599c944d771eb7a7893f6c6f106e99d150ab4c2 100644 --- a/example/hello_world/sdkconfig +++ b/example/hello_world/sdkconfig @@ -6,7 +6,7 @@ # # FT2000-4 AARCH32 FreeRTOS Configuration # -CONFIG_TARGET_NAME="d2000_freertos" +CONFIG_TARGET_NAME="ft2004_freertos" # end of FT2000-4 AARCH32 FreeRTOS Configuration # end of Project Configuration @@ -20,22 +20,24 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y -# CONFIG_USE_SYS_TICK is not set +CONFIG_USE_SYS_TICK=y # CONFIG_MMU_DEBUG_PRINTS is not set # end of Arch Configuration # # Board Configuration # -# CONFIG_TARGET_F2000_4 is not set -CONFIG_TARGET_D2000=y +CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_D2000 is not set # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -54,7 +56,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -77,6 +78,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -91,6 +95,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -106,12 +115,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/hello_world/sdkconfig.h b/example/hello_world/sdkconfig.h index ed9703ffed67084facb095f650a2010257315bda..ebad8504d5b33052d5f9ed186d5ea59ae1019b55 100644 --- a/example/hello_world/sdkconfig.h +++ b/example/hello_world/sdkconfig.h @@ -5,7 +5,7 @@ /* FT2000-4 AARCH32 FreeRTOS Configuration */ -#define CONFIG_TARGET_NAME "d2000_freertos" +#define CONFIG_TARGET_NAME "ft2004_freertos" /* end of FT2000-4 AARCH32 FreeRTOS Configuration */ /* end of Project Configuration */ @@ -17,21 +17,23 @@ /* CONFIG_TARGET_ARMV8_AARCH32 is not set */ #define CONFIG_TARGET_ARMV8_AARCH64 -/* CONFIG_TARGET_ARMV7 is not set */ #define CONFIG_USE_CACHE #define CONFIG_USE_L3CACHE #define CONFIG_USE_MMU -/* CONFIG_USE_SYS_TICK is not set */ +#define CONFIG_USE_SYS_TICK /* CONFIG_MMU_DEBUG_PRINTS is not set */ /* end of Arch Configuration */ /* Board Configuration */ -/* CONFIG_TARGET_F2000_4 is not set */ -#define CONFIG_TARGET_D2000 +#define CONFIG_TARGET_F2000_4 +/* CONFIG_TARGET_D2000 is not set */ /* CONFIG_TARGET_E2000Q is not set */ /* CONFIG_TARGET_E2000D is not set */ /* CONFIG_TARGET_E2000S is not set */ +#define CONFIG_DEFAULT_DEBUG_PRINT_UART1 +/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ +/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ /* end of Board Configuration */ /* Components Configuration */ @@ -47,7 +49,6 @@ #define CONFIG_ENABLE_Pl011_UART /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ -/* CONFIG_USE_IOMUX is not set */ #define CONFIG_USE_ETH /* Eth Configuration */ @@ -68,6 +69,9 @@ /* CONFIG_USE_RTC is not set */ /* CONFIG_USE_SATA is not set */ /* CONFIG_USE_USB is not set */ +/* CONFIG_USE_ADC is not set */ +/* CONFIG_USE_PWM is not set */ +/* CONFIG_USE_IPC is not set */ /* end of Components Configuration */ #define CONFIG_USE_NEW_LIBC /* end of Standalone Setting */ @@ -80,6 +84,11 @@ /* CONFIG_LOG_WARN is not set */ /* CONFIG_LOG_ERROR is not set */ /* CONFIG_LOG_NONE is not set */ +#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ +/* CONFIG_LOG_EXTRA_INFO is not set */ +/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ /* Linker Options */ @@ -94,11 +103,12 @@ #define CONFIG_RAM_SIZE_MB 64 #define CONFIG_HEAP_SIZE 1 #define CONFIG_STACK_SIZE 0x100000 +#define CONFIG_FPU_STACK_SIZE 0x1000 /* end of Linker Options */ /* Compiler Options */ -#define CONFIG_DON_T_BINARY_OUTPUT +/* CONFIG_OUTPUT_BINARY is not set */ /* end of Compiler Options */ /* end of Building Option */ diff --git a/example/lwip_test/Kconfig b/example/lwip_test/Kconfig index 2a4d9f32a52224720d7dc80c9a6c2a3a3c762489..e4467f1947d73652214644db36d561107763a389 100644 --- a/example/lwip_test/Kconfig +++ b/example/lwip_test/Kconfig @@ -1,25 +1,41 @@ mainmenu "Phytium FreeRTOS Configuration" menu "Project Configuration" - + config TARGET_NAME string "Build Target Name" default "baremetal" help Build Target name for the demo - choice LWIP_TEST_ITEMS - prompt "Select Test Item" - default LWIP_POLL_TEST - help - Select arch for build - - config LWIP_POLL_TEST - bool "Poll Wait" + + choice + prompt "choice lwip config" + default LWIP_IPV4_TEST + config LWIP_IPV4_TEST + bool "test lwip ipv4" + config LWIP_IPV4_DHCP_TEST + bool "test lwip ipv4 and dhcp" + config LWIP_IPV6_TEST + bool "test lwip ipv6" + endchoice - config LWIP_INTRRUPT_TEST - bool "Poll Intrrupt" + config GMAC_RX_DESCNUM + int "receive description number" + default "16" + help + receive description number for the demo - endchoice #LWIP_TEST_ITEMS + config GMAC_TX_DESCNUM + int "transmit description number" + default "16" + help + transmit description number for the demo + + config GMAC_IRQ_PRIORITY + int "gmac irq priority, 0~15" + default "12" + help + gmac irq priority for the demo endmenu source "$(FREERTOS_SDK_ROOT)/Kconfig" diff --git a/example/lwip_test/README.md b/example/lwip_test/README.md index fcd9c9164bac36b15bce2d4bdfd7aeb2320e97c7..78b112a5f71ffed0f0035a407f81d2ddcab3178e 100644 --- a/example/lwip_test/README.md +++ b/example/lwip_test/README.md @@ -26,7 +26,7 @@ ## 1. 例程介绍 本例程示范了freertos环境下的lwip移植。 -本例程目前支持在freertos下,移植lwip,使网络能够ping通,freertos的cpu状态信息任务正常运行。 +本例程目前支持在freertos下,移植lwip,使网络能够ping通,shell能够正常运行。 ## 2. 如何使用例程 @@ -54,7 +54,8 @@ 对应的配置项是, -- Use LWIP +- CONFIG_USE_LWIP +- CONFIG_USE_LETTER_SHELL 本例子已经提供好具体的编译指令,以下进行介绍: - make 将目录下的工程进行编译 @@ -107,7 +108,7 @@ sudo service tftpd-hpa restart - 开发板侧使用bootelf命令跳转 ``` -setenv ipaddr 192.168.4.20 +setenv ipaddr 192.168.4.20 setenv serverip 192.168.4.50 setenv gatewayip 192.168.4.1 tftpboot 0x90100000 freertos.elf @@ -116,11 +117,11 @@ bootelf -p 0x90100000 ### 2.4 输出与实验现象 -- 启动进入后,cpu状态任务打印状态信息 +- 启动进入后,根据连接的gmac口,输入指令完成网口初始化 -![cpu状态打印任务](./pic/cpu_status.png "cpu_status.png") +![gmac_probe](./pic/gmac_probe.png "gmac_probe.png") -#### 2.4.1 使用网线连接计算机和开发板网口0,ping 192.168.4.20命令进行网络测试 +#### 2.4.1 使用网线连接计算机和开发板网口0,ping 192.168.4.10命令进行网络测试 ![ping](./pic/ping.png "ping.png") @@ -138,5 +139,5 @@ A: 考虑以下两个宏的大小:PBUF_POOL_SIZE定义缓冲池的个数,PBU ## 4. 修改历史记录 v0.0.4 初次合入lwip - +v0.1.0 重构lwip diff --git a/example/lwip_test/configs/d2000_aarch32_eg_configs b/example/lwip_test/configs/d2000_aarch32_eg_configs index 42b429c08521fafa2a51d47920996855174d691f..3e92d12be669e0c13b0d3ac0cb86d1fe7df9ca98 100644 --- a/example/lwip_test/configs/d2000_aarch32_eg_configs +++ b/example/lwip_test/configs/d2000_aarch32_eg_configs @@ -2,9 +2,13 @@ # # Project Configuration # -CONFIG_TARGET_NAME="d2000_freertos" -CONFIG_LWIP_POLL_TEST=y -# CONFIG_LWIP_INTRRUPT_TEST is not set +CONFIG_TARGET_NAME="d2000_freertos_32" +CONFIG_LWIP_IPV4_TEST=y +# CONFIG_LWIP_IPV4_DHCP_TEST is not set +# CONFIG_LWIP_IPV6_TEST is not set +CONFIG_GMAC_RX_DESCNUM=16 +CONFIG_GMAC_TX_DESCNUM=16 +CONFIG_GMAC_IRQ_PRIORITY=12 # end of Project Configuration # @@ -17,7 +21,6 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -33,6 +36,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,7 +57,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -74,6 +79,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -88,6 +96,10 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set # # Linker Options @@ -113,7 +125,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option @@ -136,10 +148,20 @@ CONFIG_USE_LWIP=y # # LWIP Configuration # -CONFIG_LWIP_F_GMAC=y +CONFIG_LWIP_FGMAC=y +# CONFIG_LWIP_FXMAC is not set # end of LWIP Configuration CONFIG_USE_BACKTRACE=y # CONFIG_USE_AMP is not set -# CONFIG_USE_LETTER_SHELL is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration # end of FreeRTOS Setting diff --git a/example/lwip_test/configs/d2000_aarch64_eg_configs b/example/lwip_test/configs/d2000_aarch64_eg_configs index f850409496c7a9c636973d2a3975f030f11c7a37..931e19d2c95cebe25b77224c93514609f1052849 100644 --- a/example/lwip_test/configs/d2000_aarch64_eg_configs +++ b/example/lwip_test/configs/d2000_aarch64_eg_configs @@ -2,9 +2,13 @@ # # Project Configuration # -CONFIG_TARGET_NAME="d2000_freertos" -CONFIG_LWIP_POLL_TEST=y -# CONFIG_LWIP_INTRRUPT_TEST is not set +CONFIG_TARGET_NAME="d2000_freertos_64" +CONFIG_LWIP_IPV4_TEST=y +# CONFIG_LWIP_IPV4_DHCP_TEST is not set +# CONFIG_LWIP_IPV6_TEST is not set +CONFIG_GMAC_RX_DESCNUM=16 +CONFIG_GMAC_TX_DESCNUM=16 +CONFIG_GMAC_IRQ_PRIORITY=12 # end of Project Configuration # @@ -17,7 +21,6 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -33,6 +36,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,7 +57,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -74,6 +79,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -88,6 +96,10 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set # # Linker Options @@ -103,12 +115,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option @@ -131,10 +144,20 @@ CONFIG_USE_LWIP=y # # LWIP Configuration # -CONFIG_LWIP_F_GMAC=y +CONFIG_LWIP_FGMAC=y +# CONFIG_LWIP_FXMAC is not set # end of LWIP Configuration CONFIG_USE_BACKTRACE=y # CONFIG_USE_AMP is not set -# CONFIG_USE_LETTER_SHELL is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration # end of FreeRTOS Setting diff --git a/example/lwip_test/configs/e2000q_aarch64_eg_configs b/example/lwip_test/configs/e2000q_aarch64_eg_configs new file mode 100644 index 0000000000000000000000000000000000000000..e29f6d87199b0dff619bd7554e185ef4df9fb7c8 --- /dev/null +++ b/example/lwip_test/configs/e2000q_aarch64_eg_configs @@ -0,0 +1,163 @@ + +# +# Project Configuration +# +CONFIG_TARGET_NAME="e2000q_freertos_64" +CONFIG_LWIP_IPV4_TEST=y +# CONFIG_LWIP_IPV4_DHCP_TEST is not set +# CONFIG_LWIP_IPV6_TEST is not set +CONFIG_GMAC_RX_DESCNUM=16 +CONFIG_GMAC_TX_DESCNUM=16 +CONFIG_GMAC_IRQ_PRIORITY=12 +# end of Project Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +# CONFIG_TARGET_ARMV8_AARCH32 is not set +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_USE_CACHE=y +CONFIG_USE_L3CACHE=y +CONFIG_USE_MMU=y +CONFIG_USE_SYS_TICK=y +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +# CONFIG_TARGET_D2000 is not set +CONFIG_TARGET_E2000Q=y +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI is not set +CONFIG_USE_GIC=y +CONFIG_ENABLE_GICV3=y +CONFIG_USE_SERIAL=y + +# +# Usart Configuration +# +CONFIG_ENABLE_Pl011_UART=y +# end of Usart Configuration + +# CONFIG_USE_GPIO is not set +CONFIG_USE_ETH=y + +# +# Eth Configuration +# +CONFIG_ENABLE_FXMAC=y +# CONFIG_ENABLE_FGMAC is not set +CONFIG_FXMAC_PHY_COMMON=y +# CONFIG_FXMAC_PHY_YT is not set +# end of Eth Configuration + +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_SDMMC is not set +# CONFIG_USE_PCIE is not set +# CONFIG_USE_WDT is not set +# CONFIG_USE_DMA is not set +# CONFIG_USE_NAND is not set +# CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +CONFIG_LOG_INFO=y +# CONFIG_LOG_WARN is not set +# CONFIG_LOG_ERROR is not set +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set + +# +# Linker Options +# +# CONFIG_AARCH32_RAM_LD is not set +CONFIG_AARCH64_RAM_LD=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 +# end of Linker Options + +# +# Compiler Options +# +# CONFIG_OUTPUT_BINARY is not set +# end of Compiler Options +# end of Building Option + +# +# Component Configuration +# + +# +# Freertos Drivers +# +CONFIG_FREERTOS_USE_UART=y +# end of Freertos Drivers +# end of Component Configuration + +# +# FreeRTOS Setting +# +CONFIG_USE_LWIP=y + +# +# LWIP Configuration +# +# CONFIG_LWIP_FGMAC is not set +CONFIG_LWIP_FXMAC=y +# end of LWIP Configuration + +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_AMP is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration +# end of FreeRTOS Setting diff --git a/example/lwip_test/configs/ft2004_aarch32_eg_configs b/example/lwip_test/configs/ft2004_aarch32_eg_configs index 6b829d83032718a540e73903e18c023f59f7dd4e..c0d84d13e9e38ab89d46890f7b2ab503bee6db96 100644 --- a/example/lwip_test/configs/ft2004_aarch32_eg_configs +++ b/example/lwip_test/configs/ft2004_aarch32_eg_configs @@ -2,9 +2,13 @@ # # Project Configuration # -CONFIG_TARGET_NAME="ft2004_freertos" -CONFIG_LWIP_POLL_TEST=y -# CONFIG_LWIP_INTRRUPT_TEST is not set +CONFIG_TARGET_NAME="ft2004_freertos_32" +CONFIG_LWIP_IPV4_TEST=y +# CONFIG_LWIP_IPV4_DHCP_TEST is not set +# CONFIG_LWIP_IPV6_TEST is not set +CONFIG_GMAC_RX_DESCNUM=256 +CONFIG_GMAC_TX_DESCNUM=256 +CONFIG_GMAC_IRQ_PRIORITY=12 # end of Project Configuration # @@ -17,9 +21,8 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -CONFIG_USE_L3CACHE=y +# CONFIG_USE_L3CACHE is not set CONFIG_USE_MMU=y CONFIG_USE_SYS_TICK=y CONFIG_USE_AARCH64_L1_TO_AARCH32=y @@ -33,6 +36,9 @@ CONFIG_TARGET_F2000_4=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,7 +57,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -74,6 +79,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -83,11 +91,16 @@ CONFIG_USE_NEW_LIBC=y # Building Option # # CONFIG_LOG_VERBOS is not set -# CONFIG_LOG_DEBUG is not set +CONFIG_LOG_DEBUG=y # CONFIG_LOG_INFO is not set -CONFIG_LOG_WARN=y +# CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -96,10 +109,10 @@ CONFIG_AARCH32_RAM_LD=y # CONFIG_AARCH64_RAM_LD is not set # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y -CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_START_UP_ADDR=0xa0100000 CONFIG_ROM_SIZE_MB=1 CONFIG_LINK_SCRIPT_RAM=y -CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_START_UP_ADDR=0xa1000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_SVC_STACK_SIZE=0x1000 @@ -113,7 +126,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option @@ -136,10 +149,20 @@ CONFIG_USE_LWIP=y # # LWIP Configuration # -CONFIG_LWIP_F_GMAC=y +CONFIG_LWIP_FGMAC=y +# CONFIG_LWIP_FXMAC is not set # end of LWIP Configuration CONFIG_USE_BACKTRACE=y # CONFIG_USE_AMP is not set -# CONFIG_USE_LETTER_SHELL is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration # end of FreeRTOS Setting diff --git a/example/lwip_test/configs/ft2004_aarch64_eg_configs b/example/lwip_test/configs/ft2004_aarch64_eg_configs index 342d5fc72eb26aef9227249c7597ba2b7cddec39..def95b9997e3ff570b0db23c6003139b038ad84e 100644 --- a/example/lwip_test/configs/ft2004_aarch64_eg_configs +++ b/example/lwip_test/configs/ft2004_aarch64_eg_configs @@ -2,9 +2,13 @@ # # Project Configuration # -CONFIG_TARGET_NAME="ft2004_freertos" -CONFIG_LWIP_POLL_TEST=y -# CONFIG_LWIP_INTRRUPT_TEST is not set +CONFIG_TARGET_NAME="ft2004_freertos_64" +CONFIG_LWIP_IPV4_TEST=y +# CONFIG_LWIP_IPV4_DHCP_TEST is not set +# CONFIG_LWIP_IPV6_TEST is not set +CONFIG_GMAC_RX_DESCNUM=256 +CONFIG_GMAC_TX_DESCNUM=256 +CONFIG_GMAC_IRQ_PRIORITY=12 # end of Project Configuration # @@ -17,9 +21,8 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -CONFIG_USE_L3CACHE=y +# CONFIG_USE_L3CACHE is not set CONFIG_USE_MMU=y CONFIG_USE_SYS_TICK=y # CONFIG_MMU_DEBUG_PRINTS is not set @@ -33,6 +36,9 @@ CONFIG_TARGET_F2000_4=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,7 +57,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -74,6 +79,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -83,11 +91,16 @@ CONFIG_USE_NEW_LIBC=y # Building Option # # CONFIG_LOG_VERBOS is not set -# CONFIG_LOG_DEBUG is not set +CONFIG_LOG_DEBUG=y # CONFIG_LOG_INFO is not set -CONFIG_LOG_WARN=y +# CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -96,19 +109,20 @@ CONFIG_LOG_WARN=y CONFIG_AARCH64_RAM_LD=y # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y -CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_START_UP_ADDR=0xa0100000 CONFIG_ROM_SIZE_MB=1 CONFIG_LINK_SCRIPT_RAM=y -CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_START_UP_ADDR=0xa1000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option @@ -131,10 +145,20 @@ CONFIG_USE_LWIP=y # # LWIP Configuration # -CONFIG_LWIP_F_GMAC=y +CONFIG_LWIP_FGMAC=y +# CONFIG_LWIP_FXMAC is not set # end of LWIP Configuration CONFIG_USE_BACKTRACE=y # CONFIG_USE_AMP is not set -# CONFIG_USE_LETTER_SHELL is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration # end of FreeRTOS Setting diff --git a/example/lwip_test/configs/sdkconfig_jailhouse_core0 b/example/lwip_test/configs/sdkconfig_jailhouse_core0 new file mode 100644 index 0000000000000000000000000000000000000000..aa9b736194b389341c6ee1e1867a8add9de1879b --- /dev/null +++ b/example/lwip_test/configs/sdkconfig_jailhouse_core0 @@ -0,0 +1,163 @@ + +# +# Project Configuration +# +CONFIG_TARGET_NAME="d2000_freertos_64" +# CONFIG_LWIP_IPV4_TEST is not set +CONFIG_LWIP_IPV4_DHCP_TEST=y +# CONFIG_LWIP_IPV6_TEST is not set +CONFIG_GMAC_RX_DESCNUM=16 +CONFIG_GMAC_TX_DESCNUM=16 +CONFIG_GMAC_IRQ_PRIORITY=12 +# end of Project Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +# CONFIG_TARGET_ARMV8_AARCH32 is not set +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_USE_CACHE=y +# CONFIG_USE_L3CACHE is not set +CONFIG_USE_MMU=y +CONFIG_USE_SYS_TICK=y +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +CONFIG_TARGET_D2000=y +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART1 is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART0=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI is not set +CONFIG_USE_GIC=y +CONFIG_ENABLE_GICV3=y +CONFIG_USE_SERIAL=y + +# +# Usart Configuration +# +CONFIG_ENABLE_Pl011_UART=y +# end of Usart Configuration + +# CONFIG_USE_GPIO is not set +CONFIG_USE_ETH=y + +# +# Eth Configuration +# +# CONFIG_ENABLE_FXMAC is not set +CONFIG_ENABLE_FGMAC=y +CONFIG_FGMAC_PHY_COMMON=y +# CONFIG_FGMAC_PHY_AR803X is not set +# end of Eth Configuration + +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_SDMMC is not set +# CONFIG_USE_PCIE is not set +# CONFIG_USE_WDT is not set +# CONFIG_USE_DMA is not set +# CONFIG_USE_NAND is not set +# CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +CONFIG_LOG_INFO=y +# CONFIG_LOG_WARN is not set +# CONFIG_LOG_ERROR is not set +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set + +# +# Linker Options +# +# CONFIG_AARCH32_RAM_LD is not set +CONFIG_AARCH64_RAM_LD=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_SIZE_MB=64 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 +# end of Linker Options + +# +# Compiler Options +# +# CONFIG_DON_T_BINARY_OUTPUT is not set +# end of Compiler Options +# end of Building Option + +# +# Component Configuration +# + +# +# Freertos Drivers +# +CONFIG_FREERTOS_USE_UART=y +# end of Freertos Drivers +# end of Component Configuration + +# +# FreeRTOS Setting +# +CONFIG_USE_LWIP=y + +# +# LWIP Configuration +# +CONFIG_LWIP_FGMAC=y +# CONFIG_LWIP_FXMAC is not set +# end of LWIP Configuration + +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_AMP is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART1 is not set +CONFIG_DEFAULT_LETTER_SHELL_USE_UART0=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration +# end of FreeRTOS Setting diff --git a/example/lwip_test/configs/sdkconfig_jailhouse_core1 b/example/lwip_test/configs/sdkconfig_jailhouse_core1 new file mode 100644 index 0000000000000000000000000000000000000000..a3fd6a55a82c450b7129fcc412dabe2735c440ab --- /dev/null +++ b/example/lwip_test/configs/sdkconfig_jailhouse_core1 @@ -0,0 +1,163 @@ + +# +# Project Configuration +# +CONFIG_TARGET_NAME="d2000_freertos_64" +# CONFIG_LWIP_IPV4_TEST is not set +CONFIG_LWIP_IPV4_DHCP_TEST=y +# CONFIG_LWIP_IPV6_TEST is not set +CONFIG_GMAC_RX_DESCNUM=16 +CONFIG_GMAC_TX_DESCNUM=16 +CONFIG_GMAC_IRQ_PRIORITY=12 +# end of Project Configuration + +# +# Standalone Setting +# +CONFIG_USE_FREERTOS=y + +# +# Arch Configuration +# +# CONFIG_TARGET_ARMV8_AARCH32 is not set +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_USE_CACHE=y +# CONFIG_USE_L3CACHE is not set +CONFIG_USE_MMU=y +CONFIG_USE_SYS_TICK=y +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arch Configuration + +# +# Board Configuration +# +# CONFIG_TARGET_F2000_4 is not set +CONFIG_TARGET_D2000=y +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Board Configuration + +# +# Components Configuration +# +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI is not set +CONFIG_USE_GIC=y +CONFIG_ENABLE_GICV3=y +CONFIG_USE_SERIAL=y + +# +# Usart Configuration +# +CONFIG_ENABLE_Pl011_UART=y +# end of Usart Configuration + +# CONFIG_USE_GPIO is not set +CONFIG_USE_ETH=y + +# +# Eth Configuration +# +# CONFIG_ENABLE_FXMAC is not set +CONFIG_ENABLE_FGMAC=y +CONFIG_FGMAC_PHY_COMMON=y +# CONFIG_FGMAC_PHY_AR803X is not set +# end of Eth Configuration + +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_SDMMC is not set +# CONFIG_USE_PCIE is not set +# CONFIG_USE_WDT is not set +# CONFIG_USE_DMA is not set +# CONFIG_USE_NAND is not set +# CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# end of Components Configuration + +CONFIG_USE_NEW_LIBC=y +# end of Standalone Setting + +# +# Building Option +# +# CONFIG_LOG_VERBOS is not set +# CONFIG_LOG_DEBUG is not set +CONFIG_LOG_INFO=y +# CONFIG_LOG_WARN is not set +# CONFIG_LOG_ERROR is not set +# CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set + +# +# Linker Options +# +# CONFIG_AARCH32_RAM_LD is not set +CONFIG_AARCH64_RAM_LD=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_LINK_SCRIPT_ROM=y +CONFIG_ROM_START_UP_ADDR=0xa0100000 +CONFIG_ROM_SIZE_MB=1 +CONFIG_LINK_SCRIPT_RAM=y +CONFIG_RAM_START_UP_ADDR=0xa1000000 +CONFIG_RAM_SIZE_MB=64 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 +# end of Linker Options + +# +# Compiler Options +# +# CONFIG_DON_T_BINARY_OUTPUT is not set +# end of Compiler Options +# end of Building Option + +# +# Component Configuration +# + +# +# Freertos Drivers +# +CONFIG_FREERTOS_USE_UART=y +# end of Freertos Drivers +# end of Component Configuration + +# +# FreeRTOS Setting +# +CONFIG_USE_LWIP=y + +# +# LWIP Configuration +# +CONFIG_LWIP_FGMAC=y +# CONFIG_LWIP_FXMAC is not set +# end of LWIP Configuration + +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_AMP is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration +# end of FreeRTOS Setting diff --git a/example/lwip_test/get_cpu_stats.c b/example/lwip_test/get_cpu_stats.c deleted file mode 100644 index 87756e05382517187278d179f7a4aff67cb6725a..0000000000000000000000000000000000000000 --- a/example/lwip_test/get_cpu_stats.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright : (C) 2022 Phytium Information Technology, Inc. - * All Rights Reserved. - * - * This program is OPEN SOURCE software: you can redistribute it and/or modify it - * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, - * either version 1.0 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the Phytium Public License for more details. - * - * - * FilePath: get_cpu_stats.c - * Date: 2022-02-24 13:42:19 - * LastEditTime: 2022-03-21 17:01:54 - * Description:  This file is for - * - * Modify History: - * Ver   Who        Date         Changes - * ----- ------     --------    -------------------------------------- - */ - - -#include -#include -#include "FreeRTOS.h" -#include "task.h" -#include "ft_types.h" - -static TaskHandle_t cpuStatsTaskHandle = NULL; -static void CpuStatsTask(void* parameter) -{ - u8 CPU_RunInfo[400]; //保存任务运行时间信息 - - while (1) - { - memset(CPU_RunInfo,0,400); //信息缓冲区清零 - vTaskList((char *)&CPU_RunInfo); //获取任务运行时间信息 - - printf("---------------------------------------------\r\n"); - printf("task_name task_state priority stack task_num\r\n"); - printf("%s", CPU_RunInfo); - printf("---------------------------------------------\r\n"); - - memset(CPU_RunInfo, 0, 400); //信息缓冲区清零 - - vTaskGetRunTimeStats((char *)&CPU_RunInfo); - - printf("task_name\trun_time_count\tusage_rate\r\n"); - printf("%s", CPU_RunInfo); - printf("---------------------------------------------\r\n\n"); - vTaskDelay(2000); /* 延时 */ - } -} - -static TaskHandle_t appTaskCreateHandle = NULL; -static void AppTaskCreate(void) -{ - BaseType_t ret = pdPASS;/* 定义一个创建信息返回值,默认为 pdPASS */ - - taskENTER_CRITICAL(); //进入临界区 - - /* 创建 CPU stats 任务 */ - ret = xTaskCreate((TaskFunction_t )CpuStatsTask, /* 任务入口函数 */ - (const char* )"CPU_STATS_Task",/* 任务名字 */ - (uint16_t )1024, /* 任务栈大小 */ - (void* )NULL, /* 任务入口函数参数 */ - (UBaseType_t )4, /* 任务的优先级 */ - (TaskHandle_t* )&cpuStatsTaskHandle);/* 任务控制块指针 */ - - if (pdPASS == ret) - { - printf("create cpu stats task success!\r\n"); - } - - vTaskDelete(appTaskCreateHandle); //删除 AppTaskCreate 任务 - - taskEXIT_CRITICAL(); //退出临界区 -} - -BaseType_t TestCpuStatsEntry() -{ - BaseType_t ret = pdPASS;/* 定义一个创建信息返回值,默认为 pdPASS */ - - ret = xTaskCreate((TaskFunction_t )AppTaskCreate, /* 任务入口函数 */ - (const char* )"AppTaskCreate",/* 任务名字 */ - (uint16_t )512, /* 任务栈大小 */ - (void* )NULL,/* 任务入口函数参数 */ - (UBaseType_t )1, /* 任务的优先级 */ - (TaskHandle_t* )&appTaskCreateHandle); /* 任务控制 */ - - return ret; -} \ No newline at end of file diff --git a/example/lwip_test/main.c b/example/lwip_test/main.c index b569b490f5f2461d7f826930d1d89a4ea26a6599..c9b71b6c7b079af6aa3696da14eca1d95916e71f 100644 --- a/example/lwip_test/main.c +++ b/example/lwip_test/main.c @@ -20,53 +20,18 @@ * Ver   Who        Date         Changes * ----- ------     --------    -------------------------------------- */ - -#include "parameters.h" -#include "ft_types.h" +#include #include "FreeRTOS.h" #include "task.h" -#include "ft_os_gmac.h" - -#define OS_GMAC0_NAME "gmac0" - -extern BaseType_t TestCpuStatsEntry(); -extern void LwipRawTest(FtOsGmac *Os_Gmac); - -FtOsGmac os_gmac = {0}; +#include "shell_port.h" int main() { BaseType_t ret = pdPASS; - FtOsGmacConfig os_config = { - .gmac_instance = FT_OS_GMAC0_ID, - .isr_priority = 0, /* irq Priority */ - .address = {{192, - 168, - 4, - 20}, - {255, 255, 255, 0}, - {192, 168, 4, 1}}, - .mac_input_thread = { - .thread_name = OS_GMAC0_NAME, - .stack_depth = 4096, /* The number of words the stack */ - .priority = configMAX_PRIORITIES-1, /* Defines the priority at which the task will execute. */ - .thread_handle = NULL, - }, /* Gmac input thread */ - - }; - - /* !!! make sure eth in-place before init gmac */ - FtOsGmacObjectInit(&os_gmac, &os_config); - - LwipRawTest(&os_gmac); - - ret = TestCpuStatsEntry(); - - if (pdPASS != ret) - { + ret = LSUserShellTask(); + if(ret != pdPASS) goto FAIL_EXIT; - } vTaskStartScheduler(); /* 启动任务,开启调度 */ while (1); /* 正常不会执行到这里 */ diff --git a/example/lwip_test/makefile b/example/lwip_test/makefile index 5495bf3ab30e1282a773104dedfe1c0891b0c6c8..a497d88a7635a154ef55a9a24656929c2d81ebc7 100644 --- a/example/lwip_test/makefile +++ b/example/lwip_test/makefile @@ -22,9 +22,5 @@ include $(FREERTOS_SDK_ROOT)/make/build_freertos.mk # 完成编译 boot: - make -# @echo tar $(CONFIG_TARGET_NAME) -# @echo img $(BOOT_IMG_NAME) + make -j cp ./$(CONFIG_TARGET_NAME).elf $(USR_BOOT_DIR)/$(BOOT_IMG_NAME).elf - - diff --git a/example/lwip_test/pic/cpu_status.png b/example/lwip_test/pic/cpu_status.png deleted file mode 100644 index 6ac486edc48c4af8d4ae03357296059b23809946..0000000000000000000000000000000000000000 Binary files a/example/lwip_test/pic/cpu_status.png and /dev/null differ diff --git a/example/lwip_test/pic/gmac_probe.png b/example/lwip_test/pic/gmac_probe.png new file mode 100644 index 0000000000000000000000000000000000000000..b66366681dca15350475cde67df6bd8687815214 Binary files /dev/null and b/example/lwip_test/pic/gmac_probe.png differ diff --git a/example/lwip_test/pic/ping.png b/example/lwip_test/pic/ping.png index 5a4245b937d934d26cd22a1e7114353c935ae7e0..4df451934d172b9bd0870228ad29d0d6c45937eb 100644 Binary files a/example/lwip_test/pic/ping.png and b/example/lwip_test/pic/ping.png differ diff --git a/example/lwip_test/sdkconfig b/example/lwip_test/sdkconfig index f850409496c7a9c636973d2a3975f030f11c7a37..def95b9997e3ff570b0db23c6003139b038ad84e 100644 --- a/example/lwip_test/sdkconfig +++ b/example/lwip_test/sdkconfig @@ -2,9 +2,13 @@ # # Project Configuration # -CONFIG_TARGET_NAME="d2000_freertos" -CONFIG_LWIP_POLL_TEST=y -# CONFIG_LWIP_INTRRUPT_TEST is not set +CONFIG_TARGET_NAME="ft2004_freertos_64" +CONFIG_LWIP_IPV4_TEST=y +# CONFIG_LWIP_IPV4_DHCP_TEST is not set +# CONFIG_LWIP_IPV6_TEST is not set +CONFIG_GMAC_RX_DESCNUM=256 +CONFIG_GMAC_TX_DESCNUM=256 +CONFIG_GMAC_IRQ_PRIORITY=12 # end of Project Configuration # @@ -17,9 +21,8 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y -CONFIG_USE_L3CACHE=y +# CONFIG_USE_L3CACHE is not set CONFIG_USE_MMU=y CONFIG_USE_SYS_TICK=y # CONFIG_MMU_DEBUG_PRINTS is not set @@ -28,11 +31,14 @@ CONFIG_USE_SYS_TICK=y # # Board Configuration # -# CONFIG_TARGET_F2000_4 is not set -CONFIG_TARGET_D2000=y +CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_D2000 is not set # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,7 +57,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -74,6 +79,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -83,11 +91,16 @@ CONFIG_USE_NEW_LIBC=y # Building Option # # CONFIG_LOG_VERBOS is not set -# CONFIG_LOG_DEBUG is not set -CONFIG_LOG_INFO=y +CONFIG_LOG_DEBUG=y +# CONFIG_LOG_INFO is not set # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -96,19 +109,20 @@ CONFIG_LOG_INFO=y CONFIG_AARCH64_RAM_LD=y # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y -CONFIG_ROM_START_UP_ADDR=0x80100000 +CONFIG_ROM_START_UP_ADDR=0xa0100000 CONFIG_ROM_SIZE_MB=1 CONFIG_LINK_SCRIPT_RAM=y -CONFIG_RAM_START_UP_ADDR=0x81000000 +CONFIG_RAM_START_UP_ADDR=0xa1000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option @@ -131,10 +145,20 @@ CONFIG_USE_LWIP=y # # LWIP Configuration # -CONFIG_LWIP_F_GMAC=y +CONFIG_LWIP_FGMAC=y +# CONFIG_LWIP_FXMAC is not set # end of LWIP Configuration CONFIG_USE_BACKTRACE=y # CONFIG_USE_AMP is not set -# CONFIG_USE_LETTER_SHELL is not set +CONFIG_USE_LETTER_SHELL=y + +# +# Letter Shell Configuration +# +CONFIG_LS_PL011_UART=y +CONFIG_DEFAULT_LETTER_SHELL_USE_UART1=y +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set +# CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set +# end of Letter Shell Configuration # end of FreeRTOS Setting diff --git a/example/lwip_test/sdkconfig.h b/example/lwip_test/sdkconfig.h index 796406cffee896421a6ebf7f37be0fe16984d553..23e9614ddbfc88192668fc6d7d7f32a0e67e8721 100644 --- a/example/lwip_test/sdkconfig.h +++ b/example/lwip_test/sdkconfig.h @@ -3,9 +3,13 @@ /* Project Configuration */ -#define CONFIG_TARGET_NAME "d2000_freertos" -#define CONFIG_LWIP_POLL_TEST -/* CONFIG_LWIP_INTRRUPT_TEST is not set */ +#define CONFIG_TARGET_NAME "ft2004_freertos_64" +#define CONFIG_LWIP_IPV4_TEST +/* CONFIG_LWIP_IPV4_DHCP_TEST is not set */ +/* CONFIG_LWIP_IPV6_TEST is not set */ +#define CONFIG_GMAC_RX_DESCNUM 256 +#define CONFIG_GMAC_TX_DESCNUM 256 +#define CONFIG_GMAC_IRQ_PRIORITY 12 /* end of Project Configuration */ /* Standalone Setting */ @@ -16,9 +20,8 @@ /* CONFIG_TARGET_ARMV8_AARCH32 is not set */ #define CONFIG_TARGET_ARMV8_AARCH64 -/* CONFIG_TARGET_ARMV7 is not set */ #define CONFIG_USE_CACHE -#define CONFIG_USE_L3CACHE +/* CONFIG_USE_L3CACHE is not set */ #define CONFIG_USE_MMU #define CONFIG_USE_SYS_TICK /* CONFIG_MMU_DEBUG_PRINTS is not set */ @@ -26,11 +29,14 @@ /* Board Configuration */ -/* CONFIG_TARGET_F2000_4 is not set */ -#define CONFIG_TARGET_D2000 +#define CONFIG_TARGET_F2000_4 +/* CONFIG_TARGET_D2000 is not set */ /* CONFIG_TARGET_E2000Q is not set */ /* CONFIG_TARGET_E2000D is not set */ /* CONFIG_TARGET_E2000S is not set */ +#define CONFIG_DEFAULT_DEBUG_PRINT_UART1 +/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ +/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ /* end of Board Configuration */ /* Components Configuration */ @@ -46,7 +52,6 @@ #define CONFIG_ENABLE_Pl011_UART /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ -/* CONFIG_USE_IOMUX is not set */ #define CONFIG_USE_ETH /* Eth Configuration */ @@ -67,6 +72,9 @@ /* CONFIG_USE_RTC is not set */ /* CONFIG_USE_SATA is not set */ /* CONFIG_USE_USB is not set */ +/* CONFIG_USE_ADC is not set */ +/* CONFIG_USE_PWM is not set */ +/* CONFIG_USE_IPC is not set */ /* end of Components Configuration */ #define CONFIG_USE_NEW_LIBC /* end of Standalone Setting */ @@ -74,11 +82,16 @@ /* Building Option */ /* CONFIG_LOG_VERBOS is not set */ -/* CONFIG_LOG_DEBUG is not set */ -#define CONFIG_LOG_INFO +#define CONFIG_LOG_DEBUG +/* CONFIG_LOG_INFO is not set */ /* CONFIG_LOG_WARN is not set */ /* CONFIG_LOG_ERROR is not set */ /* CONFIG_LOG_NONE is not set */ +#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ +/* CONFIG_LOG_EXTRA_INFO is not set */ +/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ /* Linker Options */ @@ -86,18 +99,19 @@ #define CONFIG_AARCH64_RAM_LD /* CONFIG_USER_DEFINED_LD is not set */ #define CONFIG_LINK_SCRIPT_ROM -#define CONFIG_ROM_START_UP_ADDR 0x80100000 +#define CONFIG_ROM_START_UP_ADDR 0xa0100000 #define CONFIG_ROM_SIZE_MB 1 #define CONFIG_LINK_SCRIPT_RAM -#define CONFIG_RAM_START_UP_ADDR 0x81000000 +#define CONFIG_RAM_START_UP_ADDR 0xa1000000 #define CONFIG_RAM_SIZE_MB 64 #define CONFIG_HEAP_SIZE 1 #define CONFIG_STACK_SIZE 0x100000 +#define CONFIG_FPU_STACK_SIZE 0x1000 /* end of Linker Options */ /* Compiler Options */ -#define CONFIG_DON_T_BINARY_OUTPUT +/* CONFIG_OUTPUT_BINARY is not set */ /* end of Compiler Options */ /* end of Building Option */ @@ -115,11 +129,20 @@ /* LWIP Configuration */ -#define CONFIG_LWIP_F_GMAC +#define CONFIG_LWIP_FGMAC +/* CONFIG_LWIP_FXMAC is not set */ /* end of LWIP Configuration */ #define CONFIG_USE_BACKTRACE /* CONFIG_USE_AMP is not set */ -/* CONFIG_USE_LETTER_SHELL is not set */ +#define CONFIG_USE_LETTER_SHELL + +/* Letter Shell Configuration */ + +#define CONFIG_LS_PL011_UART +#define CONFIG_DEFAULT_LETTER_SHELL_USE_UART1 +/* CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 is not set */ +/* CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 is not set */ +/* end of Letter Shell Configuration */ /* end of FreeRTOS Setting */ #endif diff --git a/example/lwip_test/src/lwip_test.c b/example/lwip_test/src/lwip_test.c new file mode 100644 index 0000000000000000000000000000000000000000..0f91d5c526e6f25578a60cf35f32c8889d02bd1c --- /dev/null +++ b/example/lwip_test/src/lwip_test.c @@ -0,0 +1,260 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: lwip_test.c + * Date: 2022-06-06 22:57:08 + * LastEditTime: 2022-06-06 22:57:08 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#include +#include +#include "strto.h" +#include "sdkconfig.h" +#include "FreeRTOS.h" +#include "task.h" +#include "ft_types.h" +#include "parameters.h" + +#ifndef SDK_CONFIG_H__ + #error "Please include sdkconfig.h first" +#endif + + + +#include "lwip_port.h" +#include "lwip/ip4_addr.h" +#include "lwip/init.h" +#include "netif/ethernet.h" +#include "ethernetif.h" +#include "lwip/netif.h" +#include "lwip/tcpip.h" +#include "../src/shell.h" + + + +#if LWIP_IPV6 +#include "lwip/ip.h" +#include "lwip/ip6_addr.h" +#else +#if LWIP_DHCP +#include "lwip/dhcp.h" +#endif +#endif + +#if defined(CONFIG_ENABLE_FGMAC) +#include "ft_os_gmac.h" + +static FtOsGmac os_gmac[GMAC_INSTANCE_NUM] = {0}; +static u32 gmac_id = FT_OS_GMAC0_ID; + +/* the mac address of the board. this should be unique per board */ + unsigned char mac_ethernet_address[GMAC_INSTANCE_NUM][NETIF_MAX_HWADDR_LEN] = { + {0x0, 0x0, 0x1, 0x11, 0x1, 0x21}, + {0x0, 0x0, 0x2, 0x22, 0x2, 0x23} + }; + +#if !LWIP_IPV6 +ip4_addr_t ipaddr[GMAC_INSTANCE_NUM], netmask[GMAC_INSTANCE_NUM], gw[GMAC_INSTANCE_NUM]; +#if LWIP_DHCP +static TaskHandle_t appTaskCreateHandle = NULL; +void LwipDhcpTest(FtOsGmac *os_gmac) +{ + int mscnt = 0; + dhcp_start(&(os_gmac->netif_object)); + printf("LwipDhcpTest is start \r\n"); + while (1) + { + vTaskDelay(DHCP_FINE_TIMER_MSECS / portTICK_RATE_MS); + dhcp_fine_tmr(); + mscnt += DHCP_FINE_TIMER_MSECS; + if (mscnt >= DHCP_COARSE_TIMER_SECS*1000) + { + dhcp_coarse_tmr(); + mscnt = 0; + } + } +} +#endif +#endif + +void LwipRawInit(FtOsGmac *os_gmac) +{ + BaseType_t ret = pdPASS;/* 定义一个创建信息返回值,默认为 pdPASS */ + static boolean init_flag = FALSE; + +#if !LWIP_IPV6 + + memset(&ipaddr[gmac_id], 0, sizeof(ip4_addr_t)); + memset(&netmask[gmac_id], 0, sizeof(ip4_addr_t)); + memset(&gw[gmac_id], 0, sizeof(ip4_addr_t)); + +#if LWIP_DHCP + ipaddr[gmac_id].addr = 0; + gw[gmac_id].addr = 0; + netmask[gmac_id].addr = 0; +#else + /* initialize IP addresses to be used */ + IP4_ADDR(&ipaddr[gmac_id], + os_gmac->config.address.ip_address[0], + os_gmac->config.address.ip_address[1], + os_gmac->config.address.ip_address[2], + os_gmac->config.address.ip_address[3]); + IP4_ADDR(&netmask[gmac_id], + os_gmac->config.address.netmask_address[0], + os_gmac->config.address.netmask_address[1], + os_gmac->config.address.netmask_address[2], + os_gmac->config.address.netmask_address[3]); + IP4_ADDR(&gw[gmac_id], + os_gmac->config.address.netmask_address[0], + os_gmac->config.address.netmask_address[1], + os_gmac->config.address.netmask_address[2], + os_gmac->config.address.netmask_address[3]); +#endif + +#endif + + /* 初始化LwIP堆 */ + if(init_flag == FALSE) + { + tcpip_init(NULL, NULL); + init_flag = TRUE; + } + + /* 添加网络接口 (IPv4/IPv6) */ + lwip_port_add(&os_gmac->netif_object, &ipaddr[gmac_id], &netmask[gmac_id], &gw[gmac_id], + mac_ethernet_address[gmac_id], gmac_id); + + /* 注册默认网络接口 */ + netif_set_default(&os_gmac->netif_object); + + if (netif_is_link_up(&os_gmac->netif_object)) + { + /* 当netif完全配置好时,必须调用该函数 */ + netif_set_up(&os_gmac->netif_object); + } + else + { + /* 当netif链接关闭时,必须调用该函数 */ + netif_set_down(&os_gmac->netif_object); + } + +#if LWIP_DHCP && LWIP_IPV4 + /* Create a new DHCP client for this interface. + * Note: you must call dhcp_fine_tmr() and dhcp_coarse_tmr() at + * the predefined regular intervals after starting the client. + */ + printf("dhcp_start...\r\n"); + + ret = xTaskCreate((TaskFunction_t )LwipDhcpTest, /* 任务入口函数 */ + (const char* )"LwipDhcpTest",/* 任务名字 */ + (uint16_t )4096, /* 任务栈大小 */ + (void* )(os_gmac),/* 任务入口函数参数 */ + (UBaseType_t )configMAX_PRIORITIES-1, /* 任务的优先级 */ + (TaskHandle_t* )&appTaskCreateHandle); /* 任务控制 */ + if (pdPASS == ret) + { + printf("create lwip dhcp task success!\r\n"); + } + +#endif + +} + + +void LwipTestCreate(void * args) +{ + FtOsGmacConfig os_config[GMAC_INSTANCE_NUM] = + { + { + .gmac_instance = 0, + .isr_priority = 0, /* irq Priority */ + .address = + { + {192, 168, 4, 10}, + {255, 255, 255, 0}, + {192, 168, 4, 1} + }, + .mac_input_thread = + { + .thread_name = "gmac0", + .stack_depth = 4096, /* The number of words the stack */ + .priority = configMAX_PRIORITIES-1, /* Defines the priority at which the task will execute. */ + .thread_handle = NULL, + }, /* Gmac input thread */ + }, + { + .gmac_instance = 1, + .isr_priority = 0, /* irq Priority */ + .address = + { + {192, 168, 4, 20}, + {255, 255, 255, 0}, + {192, 168, 4, 1} + }, + .mac_input_thread = + { + .thread_name = "gmac1", + .stack_depth = 4096, /* The number of words the stack */ + .priority = configMAX_PRIORITIES-1, /* Defines the priority at which the task will execute. */ + .thread_handle = NULL, + }, /* Gmac input thread */ + }, + }; + + /* !!! make sure eth in-place before init gmac */ + FtOsGmacObjectInit(&os_gmac[gmac_id], &os_config[gmac_id]); + + LwipRawInit(&os_gmac[gmac_id]); + + vTaskDelete(NULL); +} + +void LwipTest(void) +{ + BaseType_t ret; + ret = xTaskCreate((TaskFunction_t)LwipTestCreate, /* 任务入口函数 */ + (const char *)"LwipTestCreate", /* 任务名字 */ + (uint16_t)2048, /* 任务栈大小 */ + (void *)NULL, /* 任务入口函数参数 */ + (UBaseType_t)configMAX_PRIORITIES-1,/* 任务的优先级 */ + NULL); /* 任务控制块指针 */ + + FASSERT_MSG(ret == pdPASS,"LwipTestCreate Task create is failed"); + +} + +static int GmacIdSet(int argc, char *argv[]) +{ + + if (!strcmp(argv[1], "probe")) + { + if (argc >= 3) + { + gmac_id = (u32)simple_strtoul(argv[2], NULL, 10); + } + else + { + gmac_id = FT_OS_GMAC0_ID; + } + LwipTest(); + } + + return 0; +} +SHELL_EXPORT_CMD(SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), gmac, GmacIdSet, set the gmac id); +#endif \ No newline at end of file diff --git a/example/lwip_test/test_lwip.c b/example/lwip_test/test_lwip.c deleted file mode 100644 index 24fe1a1eee23807ffa39c74af9069c402ad720b9..0000000000000000000000000000000000000000 --- a/example/lwip_test/test_lwip.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright : (C) 2022 Phytium Information Technology, Inc. - * All Rights Reserved. - * - * This program is OPEN SOURCE software: you can redistribute it and/or modify it - * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, - * either version 1.0 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the Phytium Public License for more details. - * - * - * FilePath: test_lwip.c - * Date: 2022-02-24 13:42:19 - * LastEditTime: 2022-03-21 17:02:05 - * Description:  This file is for - * - * Modify History: - * Ver   Who        Date         Changes - * ----- ------     --------    -------------------------------------- - */ - -#include -#include -#include "sdkconfig.h" -#include "FreeRTOS.h" -#include "task.h" -#include "ft_types.h" - -#ifndef SDK_CONFIG_H__ - #error "Please include sdkconfig.h first" -#endif - -#ifndef CONFIG_ENABLE_FGMAC - #error "Please include component f_gmac first" -#endif - -#include "fgmac.h" -#include "lwip/ip4_addr.h" -#include "lwip/init.h" -#include "netif/ethernet.h" -#include "ethernetif.h" -#include "lwip/netif.h" -#include "lwip/tcpip.h" -#include "ft_os_gmac.h" - -/* board ip addrress */ -#define IP_ADDR0 192 -#define IP_ADDR1 168 -#define IP_ADDR2 4 -#define IP_ADDR3 20 - -/* netmask */ -#define NETMASK_ADDR0 255 -#define NETMASK_ADDR1 255 -#define NETMASK_ADDR2 255 -#define NETMASK_ADDR3 0 - -/* gateway */ -#define GATEWAY_ADDR0 192 -#define GATEWAY_ADDR1 168 -#define GATEWAY_ADDR2 4 -#define GATEWAY_ADDR3 1 - -struct ethernetif { - struct eth_addr *ethaddr; - FGmac *ethctrl; -}; - -static ip4_addr_t ip_addr, net_mask, gate_way; - -void LwipRawTest(FtOsGmac *os_gmac) -{ - memset(&ip_addr, 0, sizeof(ip_addr)); - memset(&net_mask, 0, sizeof(net_mask)); - memset(&gate_way, 0, sizeof(gate_way)); - - IP4_ADDR(&ip_addr, IP_ADDR0, IP_ADDR1, IP_ADDR2, IP_ADDR3); - IP4_ADDR(&net_mask, NETMASK_ADDR0, NETMASK_ADDR1, NETMASK_ADDR2, NETMASK_ADDR3); - IP4_ADDR(&gate_way, GATEWAY_ADDR0, GATEWAY_ADDR1, GATEWAY_ADDR2, GATEWAY_ADDR3); - - /* 初始化LwIP堆 */ - tcpip_init(NULL, NULL); - - /* 添加网络接口 (IPv4/IPv6) */ - netif_add(&os_gmac->netif_object, &ip_addr, &net_mask, &gate_way, NULL, ethernetif_init, tcpip_input); - - /* 注册默认网络接口 */ - netif_set_default(&os_gmac->netif_object); - - if (netif_is_link_up(&os_gmac->netif_object)) - { - /* 当netif完全配置好时,必须调用该函数 */ - printf("link is up...\r\n"); - netif_set_up(&os_gmac->netif_object); - } - else - { - /* 当netif链接关闭时,必须调用该函数 */ - printf("link is down..\r\n"); - netif_set_down(&os_gmac->netif_object); - } - -} diff --git a/example/start_up/configs/d2000_aarch32_eg_configs b/example/start_up/configs/d2000_aarch32_eg_configs index d018cf740e2aa9d391aeba4f328c57ffa5ff597b..2f1f22a6cedcc87bbff436cb66e0e344d773dd46 100644 --- a/example/start_up/configs/d2000_aarch32_eg_configs +++ b/example/start_up/configs/d2000_aarch32_eg_configs @@ -24,7 +24,6 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -40,6 +39,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -58,7 +60,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -81,6 +82,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -95,6 +99,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -120,7 +129,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/start_up/configs/d2000_aarch64_eg_configs b/example/start_up/configs/d2000_aarch64_eg_configs index a82ed3a5ef662b3f55924a746caddf3dcb44e15c..c1cb2c985812cc2523a33f861b2410f39b9b857e 100644 --- a/example/start_up/configs/d2000_aarch64_eg_configs +++ b/example/start_up/configs/d2000_aarch64_eg_configs @@ -24,7 +24,6 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -40,6 +39,9 @@ CONFIG_TARGET_D2000=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -58,7 +60,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -81,6 +82,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -95,6 +99,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -110,12 +119,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x400 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/start_up/configs/ft2004_aarch32_eg_configs b/example/start_up/configs/ft2004_aarch32_eg_configs index 233fac34baafc8efedba0fc04fd8729abec34d05..483e2e16b507546640af997b48f3515c573a029e 100644 --- a/example/start_up/configs/ft2004_aarch32_eg_configs +++ b/example/start_up/configs/ft2004_aarch32_eg_configs @@ -24,7 +24,6 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -40,6 +39,9 @@ CONFIG_TARGET_F2000_4=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -58,7 +60,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -81,6 +82,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -95,6 +99,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -120,7 +129,7 @@ CONFIG_UNDEF_STACK_SIZE=0x1000 # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/start_up/configs/ft2004_aarch64_eg_configs b/example/start_up/configs/ft2004_aarch64_eg_configs index 5908438a099e8ed652b90afb84ad5ee121ab10ad..2c348bc8e56ea64778e23f4d8219738732cab79f 100644 --- a/example/start_up/configs/ft2004_aarch64_eg_configs +++ b/example/start_up/configs/ft2004_aarch64_eg_configs @@ -24,7 +24,6 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y @@ -40,6 +39,9 @@ CONFIG_TARGET_F2000_4=y # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -58,7 +60,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -81,6 +82,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -95,6 +99,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -110,12 +119,13 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/start_up/sdkconfig b/example/start_up/sdkconfig index a82ed3a5ef662b3f55924a746caddf3dcb44e15c..2c348bc8e56ea64778e23f4d8219738732cab79f 100644 --- a/example/start_up/sdkconfig +++ b/example/start_up/sdkconfig @@ -6,7 +6,7 @@ # # FT2000-4 AARCH32 FreeRTOS Configuration # -CONFIG_TARGET_NAME="d2000_freertos" +CONFIG_TARGET_NAME="ft2004_freertos" # CONFIG_DEMO_HELLO_WORLD is not set # CONFIG_DEMO_GET_CPU_STATS is not set CONFIG_DEMO_MSG_QUEUE=y @@ -24,22 +24,24 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y -# CONFIG_USE_SYS_TICK is not set +CONFIG_USE_SYS_TICK=y # CONFIG_MMU_DEBUG_PRINTS is not set # end of Arch Configuration # # Board Configuration # -# CONFIG_TARGET_F2000_4 is not set -CONFIG_TARGET_D2000=y +CONFIG_TARGET_F2000_4=y +# CONFIG_TARGET_D2000 is not set # CONFIG_TARGET_E2000Q is not set # CONFIG_TARGET_E2000D is not set # CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -58,7 +60,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -81,6 +82,9 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_RTC is not set # CONFIG_USE_SATA is not set # CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration CONFIG_USE_NEW_LIBC=y @@ -95,6 +99,11 @@ CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -109,13 +118,14 @@ CONFIG_LINK_SCRIPT_RAM=y CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 -CONFIG_STACK_SIZE=0x400 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options # # Compiler Options # -CONFIG_DON_T_BINARY_OUTPUT=y +# CONFIG_OUTPUT_BINARY is not set # end of Compiler Options # end of Building Option diff --git a/example/start_up/sdkconfig.h b/example/start_up/sdkconfig.h index f9fffb475a02d1a98fa450b48302c6d941081197..ebea18e2098e005f7bfbd3986ce082911ca8435e 100644 --- a/example/start_up/sdkconfig.h +++ b/example/start_up/sdkconfig.h @@ -5,7 +5,7 @@ /* FT2000-4 AARCH32 FreeRTOS Configuration */ -#define CONFIG_TARGET_NAME "d2000_freertos" +#define CONFIG_TARGET_NAME "ft2004_freertos" /* CONFIG_DEMO_HELLO_WORLD is not set */ /* CONFIG_DEMO_GET_CPU_STATS is not set */ #define CONFIG_DEMO_MSG_QUEUE @@ -21,21 +21,23 @@ /* CONFIG_TARGET_ARMV8_AARCH32 is not set */ #define CONFIG_TARGET_ARMV8_AARCH64 -/* CONFIG_TARGET_ARMV7 is not set */ #define CONFIG_USE_CACHE #define CONFIG_USE_L3CACHE #define CONFIG_USE_MMU -/* CONFIG_USE_SYS_TICK is not set */ +#define CONFIG_USE_SYS_TICK /* CONFIG_MMU_DEBUG_PRINTS is not set */ /* end of Arch Configuration */ /* Board Configuration */ -/* CONFIG_TARGET_F2000_4 is not set */ -#define CONFIG_TARGET_D2000 +#define CONFIG_TARGET_F2000_4 +/* CONFIG_TARGET_D2000 is not set */ /* CONFIG_TARGET_E2000Q is not set */ /* CONFIG_TARGET_E2000D is not set */ /* CONFIG_TARGET_E2000S is not set */ +#define CONFIG_DEFAULT_DEBUG_PRINT_UART1 +/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ +/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ /* end of Board Configuration */ /* Components Configuration */ @@ -51,7 +53,6 @@ #define CONFIG_ENABLE_Pl011_UART /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ -/* CONFIG_USE_IOMUX is not set */ #define CONFIG_USE_ETH /* Eth Configuration */ @@ -72,6 +73,9 @@ /* CONFIG_USE_RTC is not set */ /* CONFIG_USE_SATA is not set */ /* CONFIG_USE_USB is not set */ +/* CONFIG_USE_ADC is not set */ +/* CONFIG_USE_PWM is not set */ +/* CONFIG_USE_IPC is not set */ /* end of Components Configuration */ #define CONFIG_USE_NEW_LIBC /* end of Standalone Setting */ @@ -84,6 +88,11 @@ /* CONFIG_LOG_WARN is not set */ /* CONFIG_LOG_ERROR is not set */ /* CONFIG_LOG_NONE is not set */ +#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ +/* CONFIG_LOG_EXTRA_INFO is not set */ +/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ /* Linker Options */ @@ -97,12 +106,13 @@ #define CONFIG_RAM_START_UP_ADDR 0x81000000 #define CONFIG_RAM_SIZE_MB 64 #define CONFIG_HEAP_SIZE 1 -#define CONFIG_STACK_SIZE 0x400 +#define CONFIG_STACK_SIZE 0x100000 +#define CONFIG_FPU_STACK_SIZE 0x1000 /* end of Linker Options */ /* Compiler Options */ -#define CONFIG_DON_T_BINARY_OUTPUT +/* CONFIG_OUTPUT_BINARY is not set */ /* end of Compiler Options */ /* end of Building Option */ diff --git a/example/start_up/test_task_priority.c b/example/start_up/test_task_priority.c index cdc3fb6a01394b2609734aa16660a8f3b089ab0f..a108f6d8487e164d82ddf894d44f7608aa3e66d3 100644 --- a/example/start_up/test_task_priority.c +++ b/example/start_up/test_task_priority.c @@ -27,9 +27,9 @@ #include "task.h" #include "ft_types.h" -const UBaseType_t task1Priority = configKERNEL_INTERRUPT_PRIORITY - 1; -const UBaseType_t task2Priority = configKERNEL_INTERRUPT_PRIORITY/2; -const UBaseType_t task3Priority = configKERNEL_INTERRUPT_PRIORITY/3; +const UBaseType_t task1Priority = configMAX_PRIORITIES - 1; +const UBaseType_t task2Priority = configMAX_PRIORITIES/2; +const UBaseType_t task3Priority = configMAX_PRIORITIES/3; const TickType_t task1Delay = 100; const TickType_t task2Delay = 100; const TickType_t task3Delay = 100; diff --git a/example/start_up/test_uart.c b/example/start_up/test_uart.c index eac942ce6247d7dc9cb8be225e27b540a9906650..d607a0f401ffdfd9fb732b22ecaafef4a10969f2 100644 --- a/example/start_up/test_uart.c +++ b/example/start_up/test_uart.c @@ -24,7 +24,6 @@ #include #include "ft_types.h" #include "fpl011.h" -#include "gicv3.h" #include "interrupt.h" static FPl011 pl011_obj; diff --git a/example/template/configs/d2000_aarch32_eg_configs b/example/template/configs/d2000_aarch32_eg_configs index a3bdac432e5e71bfeb397ff2867aed542763af0f..fb90dad10923629c159adb5ba46325ce440b36ea 100644 --- a/example/template/configs/d2000_aarch32_eg_configs +++ b/example/template/configs/d2000_aarch32_eg_configs @@ -6,7 +6,7 @@ # # Template Configuration # -CONFIG_TARGET_NAME="d2000_freertos" +CONFIG_TARGET_NAME="ft2004_freertos" # end of Template Configuration # end of Project Configuration @@ -20,11 +20,10 @@ CONFIG_USE_FREERTOS=y # CONFIG_TARGET_ARMV8_AARCH32=y # CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y -# CONFIG_USE_SYS_TICK is not set +CONFIG_USE_SYS_TICK=y CONFIG_USE_AARCH64_L1_TO_AARCH32=y # end of Arch Configuration @@ -32,8 +31,13 @@ CONFIG_USE_AARCH64_L1_TO_AARCH32=y # Board Configuration # # CONFIG_TARGET_F2000_4 is not set -# CONFIG_TARGET_E2000 is not set CONFIG_TARGET_D2000=y +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -43,9 +47,15 @@ CONFIG_TARGET_D2000=y # CONFIG_USE_QSPI is not set CONFIG_USE_GIC=y CONFIG_ENABLE_GICV3=y -# CONFIG_USE_SERIAL is not set +CONFIG_USE_SERIAL=y + +# +# Usart Configuration +# +CONFIG_ENABLE_Pl011_UART=y +# end of Usart Configuration + # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -66,30 +76,30 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_DMA is not set # CONFIG_USE_NAND is not set # CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration -CONFIG_USE_G_LIBC=y -# CONFIG_USE_NEW_LIBC is not set +CONFIG_USE_NEW_LIBC=y # end of Standalone Setting # # Building Option # - -# -# Cross-Compiler Setting -# -CONFIG_COMPILER_NO_STD_STARUP=y -CONFIG_GCC_OPTIMIZE_LEVEL=0 -# CONFIG_USE_EXT_COMPILER is not set -# end of Cross-Compiler Setting - # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -111,6 +121,12 @@ CONFIG_ABORT_STACK_SIZE=0x1000 CONFIG_FIQ_STACK_SIZE=0x1000 CONFIG_UNDEF_STACK_SIZE=0x1000 # end of Linker Options + +# +# Compiler Options +# +# CONFIG_OUTPUT_BINARY is not set +# end of Compiler Options # end of Building Option # @@ -128,4 +144,7 @@ CONFIG_FREERTOS_USE_UART=y # FreeRTOS Setting # # CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_AMP is not set +# CONFIG_USE_LETTER_SHELL is not set # end of FreeRTOS Setting diff --git a/example/template/configs/d2000_aarch64_eg_configs b/example/template/configs/d2000_aarch64_eg_configs index fde19b6238c503dba780c741ce12ed13eab5332c..5ed9e7127e84f64bb4b96ad42521995ad03d0278 100644 --- a/example/template/configs/d2000_aarch64_eg_configs +++ b/example/template/configs/d2000_aarch64_eg_configs @@ -6,7 +6,7 @@ # # Template Configuration # -CONFIG_TARGET_NAME="d2000_freertos" +CONFIG_TARGET_NAME="ft2004_freertos" # end of Template Configuration # end of Project Configuration @@ -20,19 +20,24 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y -# CONFIG_USE_SYS_TICK is not set +CONFIG_USE_SYS_TICK=y +# CONFIG_MMU_DEBUG_PRINTS is not set # end of Arch Configuration # # Board Configuration # # CONFIG_TARGET_F2000_4 is not set -# CONFIG_TARGET_E2000 is not set CONFIG_TARGET_D2000=y +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -42,9 +47,15 @@ CONFIG_TARGET_D2000=y # CONFIG_USE_QSPI is not set CONFIG_USE_GIC=y CONFIG_ENABLE_GICV3=y -# CONFIG_USE_SERIAL is not set +CONFIG_USE_SERIAL=y + +# +# Usart Configuration +# +CONFIG_ENABLE_Pl011_UART=y +# end of Usart Configuration + # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -65,30 +76,30 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_DMA is not set # CONFIG_USE_NAND is not set # CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration -CONFIG_USE_G_LIBC=y -# CONFIG_USE_NEW_LIBC is not set +CONFIG_USE_NEW_LIBC=y # end of Standalone Setting # # Building Option # - -# -# Cross-Compiler Setting -# -CONFIG_COMPILER_NO_STD_STARUP=y -CONFIG_GCC_OPTIMIZE_LEVEL=0 -# CONFIG_USE_EXT_COMPILER is not set -# end of Cross-Compiler Setting - # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -104,7 +115,14 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options + +# +# Compiler Options +# +# CONFIG_OUTPUT_BINARY is not set +# end of Compiler Options # end of Building Option # @@ -122,4 +140,7 @@ CONFIG_FREERTOS_USE_UART=y # FreeRTOS Setting # # CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_AMP is not set +# CONFIG_USE_LETTER_SHELL is not set # end of FreeRTOS Setting diff --git a/example/template/configs/ft2004_aarch64_eg_configs b/example/template/configs/ft2004_aarch64_eg_configs index 57941cf47df6c3bf68ed001d2ef65536c8b4e378..1bc9d4960ada873109c37d6322e41286fa9ead39 100644 --- a/example/template/configs/ft2004_aarch64_eg_configs +++ b/example/template/configs/ft2004_aarch64_eg_configs @@ -20,19 +20,24 @@ CONFIG_USE_FREERTOS=y # # CONFIG_TARGET_ARMV8_AARCH32 is not set CONFIG_TARGET_ARMV8_AARCH64=y -# CONFIG_TARGET_ARMV7 is not set CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y CONFIG_USE_SYS_TICK=y +# CONFIG_MMU_DEBUG_PRINTS is not set # end of Arch Configuration # # Board Configuration # CONFIG_TARGET_F2000_4=y -# CONFIG_TARGET_E2000 is not set # CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -51,7 +56,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -72,30 +76,30 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_DMA is not set # CONFIG_USE_NAND is not set # CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration -CONFIG_USE_G_LIBC=y -# CONFIG_USE_NEW_LIBC is not set +CONFIG_USE_NEW_LIBC=y # end of Standalone Setting # # Building Option # - -# -# Cross-Compiler Setting -# -CONFIG_COMPILER_NO_STD_STARUP=y -CONFIG_GCC_OPTIMIZE_LEVEL=0 -# CONFIG_USE_EXT_COMPILER is not set -# end of Cross-Compiler Setting - # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options @@ -111,7 +115,14 @@ CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options + +# +# Compiler Options +# +# CONFIG_OUTPUT_BINARY is not set +# end of Compiler Options # end of Building Option # @@ -129,4 +140,7 @@ CONFIG_FREERTOS_USE_UART=y # FreeRTOS Setting # # CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_AMP is not set +# CONFIG_USE_LETTER_SHELL is not set # end of FreeRTOS Setting diff --git a/example/template/main.c b/example/template/main.c index 2dd73873421f97fccd117e96310368f277c9efd2..c7282c408bd55e57fc894977481d025da47abd99 100644 --- a/example/template/main.c +++ b/example/template/main.c @@ -29,7 +29,7 @@ #include "queue.h" #include "ft_types.h" #include "ft_assert.h" -#include "gicv3.h" + #include "generic_timer.h" #include "interrupt.h" #include "parameters.h" diff --git a/example/template/sdkconfig b/example/template/sdkconfig index 4f19551765d863d224485712442b57b550ebf333..1bc9d4960ada873109c37d6322e41286fa9ead39 100644 --- a/example/template/sdkconfig +++ b/example/template/sdkconfig @@ -18,22 +18,26 @@ CONFIG_USE_FREERTOS=y # # Arch Configuration # -CONFIG_TARGET_ARMV8_AARCH32=y -# CONFIG_TARGET_ARMV8_AARCH64 is not set -# CONFIG_TARGET_ARMV7 is not set +# CONFIG_TARGET_ARMV8_AARCH32 is not set +CONFIG_TARGET_ARMV8_AARCH64=y CONFIG_USE_CACHE=y CONFIG_USE_L3CACHE=y CONFIG_USE_MMU=y CONFIG_USE_SYS_TICK=y -CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# CONFIG_MMU_DEBUG_PRINTS is not set # end of Arch Configuration # # Board Configuration # CONFIG_TARGET_F2000_4=y -# CONFIG_TARGET_E2000 is not set # CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set # end of Board Configuration # @@ -52,7 +56,6 @@ CONFIG_ENABLE_Pl011_UART=y # end of Usart Configuration # CONFIG_USE_GPIO is not set -# CONFIG_USE_IOMUX is not set CONFIG_USE_ETH=y # @@ -73,36 +76,36 @@ CONFIG_FGMAC_PHY_COMMON=y # CONFIG_USE_DMA is not set # CONFIG_USE_NAND is not set # CONFIG_USE_RTC is not set +# CONFIG_USE_SATA is not set +# CONFIG_USE_USB is not set +# CONFIG_USE_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set # end of Components Configuration -CONFIG_USE_G_LIBC=y -# CONFIG_USE_NEW_LIBC is not set +CONFIG_USE_NEW_LIBC=y # end of Standalone Setting # # Building Option # - -# -# Cross-Compiler Setting -# -CONFIG_COMPILER_NO_STD_STARUP=y -CONFIG_GCC_OPTIMIZE_LEVEL=0 -# CONFIG_USE_EXT_COMPILER is not set -# end of Cross-Compiler Setting - # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set # CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set # # Linker Options # -CONFIG_AARCH32_RAM_LD=y -# CONFIG_AARCH64_RAM_LD is not set +# CONFIG_AARCH32_RAM_LD is not set +CONFIG_AARCH64_RAM_LD=y # CONFIG_USER_DEFINED_LD is not set CONFIG_LINK_SCRIPT_ROM=y CONFIG_ROM_START_UP_ADDR=0x80100000 @@ -111,13 +114,15 @@ CONFIG_LINK_SCRIPT_RAM=y CONFIG_RAM_START_UP_ADDR=0x81000000 CONFIG_RAM_SIZE_MB=64 CONFIG_HEAP_SIZE=1 -CONFIG_SVC_STACK_SIZE=0x1000 -CONFIG_SYS_STACK_SIZE=0x1000 -CONFIG_IRQ_STACK_SIZE=0x1000 -CONFIG_ABORT_STACK_SIZE=0x1000 -CONFIG_FIQ_STACK_SIZE=0x1000 -CONFIG_UNDEF_STACK_SIZE=0x1000 +CONFIG_STACK_SIZE=0x100000 +CONFIG_FPU_STACK_SIZE=0x1000 # end of Linker Options + +# +# Compiler Options +# +# CONFIG_OUTPUT_BINARY is not set +# end of Compiler Options # end of Building Option # @@ -135,4 +140,7 @@ CONFIG_FREERTOS_USE_UART=y # FreeRTOS Setting # # CONFIG_USE_LWIP is not set +CONFIG_USE_BACKTRACE=y +# CONFIG_USE_AMP is not set +# CONFIG_USE_LETTER_SHELL is not set # end of FreeRTOS Setting diff --git a/example/template/sdkconfig.h b/example/template/sdkconfig.h index ac92b7219c92f12e0bca38fa5d47ea641f93df11..5a96579e6fc98b6842785d0b99a555c871af2a69 100644 --- a/example/template/sdkconfig.h +++ b/example/template/sdkconfig.h @@ -15,21 +15,25 @@ /* Arch Configuration */ -#define CONFIG_TARGET_ARMV8_AARCH32 -/* CONFIG_TARGET_ARMV8_AARCH64 is not set */ -/* CONFIG_TARGET_ARMV7 is not set */ +/* CONFIG_TARGET_ARMV8_AARCH32 is not set */ +#define CONFIG_TARGET_ARMV8_AARCH64 #define CONFIG_USE_CACHE #define CONFIG_USE_L3CACHE #define CONFIG_USE_MMU #define CONFIG_USE_SYS_TICK -#define CONFIG_USE_AARCH64_L1_TO_AARCH32 +/* CONFIG_MMU_DEBUG_PRINTS is not set */ /* end of Arch Configuration */ /* Board Configuration */ #define CONFIG_TARGET_F2000_4 -/* CONFIG_TARGET_E2000 is not set */ /* CONFIG_TARGET_D2000 is not set */ +/* CONFIG_TARGET_E2000Q is not set */ +/* CONFIG_TARGET_E2000D is not set */ +/* CONFIG_TARGET_E2000S is not set */ +#define CONFIG_DEFAULT_DEBUG_PRINT_UART1 +/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ +/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ /* end of Board Configuration */ /* Components Configuration */ @@ -45,7 +49,6 @@ #define CONFIG_ENABLE_Pl011_UART /* end of Usart Configuration */ /* CONFIG_USE_GPIO is not set */ -/* CONFIG_USE_IOMUX is not set */ #define CONFIG_USE_ETH /* Eth Configuration */ @@ -64,30 +67,33 @@ /* CONFIG_USE_DMA is not set */ /* CONFIG_USE_NAND is not set */ /* CONFIG_USE_RTC is not set */ +/* CONFIG_USE_SATA is not set */ +/* CONFIG_USE_USB is not set */ +/* CONFIG_USE_ADC is not set */ +/* CONFIG_USE_PWM is not set */ +/* CONFIG_USE_IPC is not set */ /* end of Components Configuration */ -#define CONFIG_USE_G_LIBC -/* CONFIG_USE_NEW_LIBC is not set */ +#define CONFIG_USE_NEW_LIBC /* end of Standalone Setting */ /* Building Option */ -/* Cross-Compiler Setting */ - -#define CONFIG_COMPILER_NO_STD_STARUP -#define CONFIG_GCC_OPTIMIZE_LEVEL 0 -/* CONFIG_USE_EXT_COMPILER is not set */ -/* end of Cross-Compiler Setting */ /* CONFIG_LOG_VERBOS is not set */ /* CONFIG_LOG_DEBUG is not set */ #define CONFIG_LOG_INFO /* CONFIG_LOG_WARN is not set */ /* CONFIG_LOG_ERROR is not set */ /* CONFIG_LOG_NONE is not set */ +#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ +/* CONFIG_LOG_EXTRA_INFO is not set */ +/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ /* Linker Options */ -#define CONFIG_AARCH32_RAM_LD -/* CONFIG_AARCH64_RAM_LD is not set */ +/* CONFIG_AARCH32_RAM_LD is not set */ +#define CONFIG_AARCH64_RAM_LD /* CONFIG_USER_DEFINED_LD is not set */ #define CONFIG_LINK_SCRIPT_ROM #define CONFIG_ROM_START_UP_ADDR 0x80100000 @@ -96,13 +102,14 @@ #define CONFIG_RAM_START_UP_ADDR 0x81000000 #define CONFIG_RAM_SIZE_MB 64 #define CONFIG_HEAP_SIZE 1 -#define CONFIG_SVC_STACK_SIZE 0x1000 -#define CONFIG_SYS_STACK_SIZE 0x1000 -#define CONFIG_IRQ_STACK_SIZE 0x1000 -#define CONFIG_ABORT_STACK_SIZE 0x1000 -#define CONFIG_FIQ_STACK_SIZE 0x1000 -#define CONFIG_UNDEF_STACK_SIZE 0x1000 +#define CONFIG_STACK_SIZE 0x100000 +#define CONFIG_FPU_STACK_SIZE 0x1000 /* end of Linker Options */ + +/* Compiler Options */ + +/* CONFIG_OUTPUT_BINARY is not set */ +/* end of Compiler Options */ /* end of Building Option */ /* Component Configuration */ @@ -116,6 +123,9 @@ /* FreeRTOS Setting */ /* CONFIG_USE_LWIP is not set */ +#define CONFIG_USE_BACKTRACE +/* CONFIG_USE_AMP is not set */ +/* CONFIG_USE_LETTER_SHELL is not set */ /* end of FreeRTOS Setting */ #endif diff --git a/install.py b/install.py index fb6299d6cccf0d723780c8c91244383b776460b9..0b4745121df90e0bd51841c910d594898808bffd 100644 --- a/install.py +++ b/install.py @@ -86,7 +86,7 @@ os.system("chmod +x ./make/*.mk --silent ") os.system("chmod +x ./lib/Kconfiglib/*.py --silent ") # Add standalone sdk -standalone_sdk_v="v0.1.17" +standalone_sdk_v="v0.2.0" standalone_path=freertos_sdk_path + '/standalone' standalone_branche="master" standalone_remote="https://gitee.com/phytium_embedded/phytium-standalone-sdk.git" diff --git a/make/Kconfig b/make/Kconfig index 66276df111449883b4ab45e0fd310b450918de92..69db46689f9c6dfe822b800a4ca4f942435a5276 100644 --- a/make/Kconfig +++ b/make/Kconfig @@ -1,11 +1,11 @@ menu "Compiler Options" -config DON_T_BINARY_OUTPUT - bool "Don't output *.bin file" - default y +config OUTPUT_BINARY + bool "Build *.bin as Ouput" + default n help - Don't create output bin by binary + Build binary files *.bin as Outputs endmenu diff --git a/make/complier.mk b/make/complier.mk index 3f76460b9ec71538a934caa931c681ed441f2a55..0ba45cd259b59650e675d1060939aef8430d6f03 100755 --- a/make/complier.mk +++ b/make/complier.mk @@ -160,7 +160,7 @@ $(APP): $(OBJ_FILES) linkscript @echo Linking $@.elf @echo Dumping $@.map $(QUIET) $(CC) $(TARGET_ARCH) $(LDFLAGS) -T $(PROJ_LD) --output $@.elf -Wl,-Map=$@.map $(OBJ_FILES) -lm -ifndef CONFIG_DON_T_BINARY_OUTPUT +ifdef CONFIG_OUTPUT_BINARY @echo Objcopying $@.bin $(QUIET) $(OC) -v -O binary $@.elf $@.bin endif diff --git a/make/default_load.mk b/make/default_load.mk index d6597fbbd4228d79bbc9d67a7601b7e25d132f07..bda38e619306b9132fcfa39d17172e9b16f05d9d 100644 --- a/make/default_load.mk +++ b/make/default_load.mk @@ -3,6 +3,8 @@ .PHONY: load_e2000_aarch32 load_e2000_aarch64 backup_kconfig build_ft2004_aarch32 build_ft2004_aarch64 build_d2000_aarch32 build_d2000_aarch64 config_ft2004_aarch32 config_ft2004_aarch64 config_d2000_aarch32 config_d2000_aarch64 load_ft2004_aarch32: + @echo $(BUILD_ALL_OUTPUT_DIR) + exit @echo "========Load for FT2000/4 AARCH32 Start=============" make ldconfig LDCONFIG_ARG=$(EG_CONFIGS_DIR)/ft2004_aarch32_eg_configs @echo "==============FT2000/4 AARCH32=======================" @@ -22,42 +24,72 @@ load_d2000_aarch64: make ldconfig LDCONFIG_ARG=$(EG_CONFIGS_DIR)/d2000_aarch64_eg_configs @echo "==============D2000 AARCH64=========================" -load_e2000_aarch32: - @echo "=======Load for E2000 AARCH32====================" - make ldconfig LDCONFIG_ARG=$(EG_CONFIGS_DIR)/e2000_aarch32_eg_configs - @echo "==============E2000 AARCH32=======================" +load_e2000s_aarch32: + @echo "=======Load for E2000S AARCH32====================" + make ldconfig LDCONFIG_ARG=$(EG_CONFIGS_DIR)/e2000s_aarch32_eg_configs + @echo "==============E2000S AARCH32=======================" -load_e2000_aarch64: - @echo "========Load for E2000 AARCH64===================" - make ldconfig LDCONFIG_ARG=$(EG_CONFIGS_DIR)/e2000_aarch64_eg_configs - @echo "==============E2000 AARCH64=========================" +load_e2000s_aarch64: + @echo "========Load for E2000S AARCH64===================" + make ldconfig LDCONFIG_ARG=$(EG_CONFIGS_DIR)/e2000s_aarch64_eg_configs + @echo "==============E2000S AARCH64=========================" +load_e2000d_aarch32: + @echo "=======Load for E2000D AARCH32====================" + make ldconfig LDCONFIG_ARG=$(EG_CONFIGS_DIR)/e2000d_aarch32_eg_configs + @echo "==============E2000D AARCH32=======================" + +load_e2000d_aarch64: + @echo "========Load for E2000D AARCH64===================" + make ldconfig LDCONFIG_ARG=$(EG_CONFIGS_DIR)/e2000d_aarch64_eg_configs + @echo "==============E2000D AARCH64=========================" + +load_e2000q_aarch32: + @echo "=======Load for E2000Q AARCH32====================" + make ldconfig LDCONFIG_ARG=$(EG_CONFIGS_DIR)/e2000q_aarch32_eg_configs + @echo "==============E2000Q AARCH32=======================" + +load_e2000q_aarch64: + @echo "========Load for E2000Q AARCH64===================" + make ldconfig LDCONFIG_ARG=$(EG_CONFIGS_DIR)/e2000q_aarch64_eg_configs + @echo "==============E2000Q AARCH64=========================" backup_kconfig: ifdef CONFIG_TARGET_ARMV8_AARCH32 ifdef CONFIG_TARGET_D2000 - cp sdkconfig $(EG_CONFIGS_DIR)/d2000_aarch32_eg_configs + cp sdkconfig ./configs/d2000_aarch32_eg_configs endif ifdef CONFIG_TARGET_F2000_4 - cp sdkconfig $(EG_CONFIGS_DIR)/ft2004_aarch32_eg_configs + cp sdkconfig ./configs/ft2004_aarch32_eg_configs +endif +ifdef CONFIG_TARGET_E2000S + cp sdkconfig ./configs/e2000s_aarch32_eg_configs endif -ifdef CONFIG_TARGET_E2000 - cp sdkconfig $(EG_CONFIGS_DIR)/e2000_aarch32_eg_configs +ifdef CONFIG_TARGET_E2000D + cp sdkconfig ./configs/e2000d_aarch32_eg_configs +endif +ifdef CONFIG_TARGET_E2000Q + cp sdkconfig ./configs/e2000q_aarch32_eg_configs endif endif ifdef CONFIG_TARGET_ARMV8_AARCH64 ifdef CONFIG_TARGET_D2000 - cp sdkconfig $(EG_CONFIGS_DIR)/d2000_aarch64_eg_configs + cp sdkconfig ./configs/d2000_aarch64_eg_configs endif ifdef CONFIG_TARGET_F2000_4 - cp sdkconfig $(EG_CONFIGS_DIR)/ft2004_aarch64_eg_configs + cp sdkconfig ./configs/ft2004_aarch64_eg_configs endif -ifdef CONFIG_TARGET_E2000 - cp sdkconfig $(EG_CONFIGS_DIR)/e2000_aarch64_eg_configs +ifdef CONFIG_TARGET_E2000S + cp sdkconfig ./configs/e2000s_aarch64_eg_configs +endif +ifdef CONFIG_TARGET_E2000D + cp sdkconfig ./configs/e2000d_aarch64_eg_configs +endif +ifdef CONFIG_TARGET_E2000Q + cp sdkconfig ./configs/e2000q_aarch64_eg_configs endif endif - config_ft2004_aarch32: lddefconfig genconfig clean config_ft2004_aarch64: lddefconfig genconfig clean diff --git a/make/ld/Kconfig b/make/ld/Kconfig index 431b8a4eca41645169d84f394bb168578fe1e82f..cb853779493722db6af5a51b1647ef293346c103 100644 --- a/make/ld/Kconfig +++ b/make/ld/Kconfig @@ -118,5 +118,12 @@ menu "Linker Options" help Assign undef stack size in Linkscript + config FPU_STACK_SIZE + hex "Fpu stack Size (Byte)" + default "0x1000" + depends on AARCH64_RAM_LD + help + Assign Fpu stack size in Linkscript + endmenu diff --git a/make/ld/aarch64_ram.ld b/make/ld/aarch64_ram.ld index 4c28d58a57e8c40e8714e8fa4fed2a685f217bac..52b378e6d656c1f863b7aea9aa5f056e0c663a5c 100644 --- a/make/ld/aarch64_ram.ld +++ b/make/ld/aarch64_ram.ld @@ -12,6 +12,7 @@ SECTIONS { .text : { KEEP (*(.vectors)) + KEEP (*(.freertos_vectors)) *(.boot) *(.text) *(.text.*) @@ -157,6 +158,12 @@ SECTIONS HeapLimit = .; } > RAM + .fpu_stack(NOLOAD):{ + . = ALIGN(64); + _fpu_stack_end = .; + . += CONFIG_FPU_STACK_SIZE; + __fpu_stack = .; + } > RAM .stack (NOLOAD) : { . = ALIGN(64); diff --git a/make/standalone_dependence.mk b/make/standalone_dependence.mk index 3ff4c72c1984e8456c715750bd4e602b7ef89fac..e3e9e40ddd4b59a0f478f3a8ec039796866b3e8b 100644 --- a/make/standalone_dependence.mk +++ b/make/standalone_dependence.mk @@ -7,8 +7,6 @@ EXCL_SRC += $(STANDALONE_DIR)/common/fmemory_pool.c ifdef CONFIG_TARGET_ARMV8_AARCH64 EXCL_SRC += $(STANDALONE_DIR)/arch/armv8/aarch64/gcc/boot.S -EXCL_SRC += $(STANDALONE_DIR)/arch/armv8/aarch64/gcc/vectors.S -EXCL_SRC += $(STANDALONE_DIR)/arch/armv8/aarch64/gcc/vectors_g.c else EXCL_SRC += $(STANDALONE_DIR)/arch/armv8/aarch32/gcc/vector.S endif diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch32/FreeRTOSConfig.h b/third-party/freertos/portable/GCC/ft_platform/aarch32/FreeRTOSConfig.h index 0e189b2c915421df1d8b16263b9601c323b1dcd0..a1bb6a7dd1448a6e1944c40b3813e8c041c1cc8b 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch32/FreeRTOSConfig.h +++ b/third-party/freertos/portable/GCC/ft_platform/aarch32/FreeRTOSConfig.h @@ -28,6 +28,11 @@ #ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H +#if !defined(__ASSEMBLER__) +#include "parameters.h" +#include "interrupt.h" +#endif + /*----------------------------------------------------------- * Application specific definitions. * @@ -62,11 +67,10 @@ * */ +/* 在不安全group1 中,16 is steps ,3 是其中等级*/ +#define configKERNEL_INTERRUPT_PRIORITY IRQ_PRIORITY_VALUE_11 /* 在不安全group1 中 ,0x8 ~0xb 不可以使用安全api(优先级越低越高)*/ -#define configMAX_API_CALL_INTERRUPT_PRIORITY 0xb -/* 在不安全group1 中,16 is steps ,3 是其中等级*/ -#define configKERNEL_INTERRUPT_PRIORITY ((0x8 << 4) + 3 * 16) - +#define configMAX_API_CALL_INTERRUPT_PRIORITY IRQ_PRIORITY_VALUE_11 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 //Method to select the next task #define configUSE_TICKLESS_IDLE 0 //disable tickless mode @@ -77,7 +81,7 @@ #define configMAX_PRIORITIES (7) #define configMINIMAL_STACK_SIZE ((unsigned short)1024) //min task stack size 100*4 bytes #define configTOTAL_HEAP_SIZE (10*1024 * 1024) //total heap size -#define configMAX_TASK_NAME_LEN (20) +#define configMAX_TASK_NAME_LEN (32) #define configUSE_TRACE_FACILITY 1 //启用可视化跟踪调试 /* 与宏 configUSE_TRACE_FACILITY 同时为 1 时会编译下面 3 个函数 * prvWriteNameToBuffer() diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c b/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c index 74582106d9471751beff0b04d9dab04ef8739662..fd7978f98791a210d92b7f0ab5aa827b52984b6c 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c +++ b/third-party/freertos/portable/GCC/ft_platform/aarch32/port.c @@ -539,12 +539,6 @@ void vPortValidateInterruptPriority(void) #endif /* configASSERT_DEFINED */ /*-----------------------------------------------------------*/ -void vApplicationFPUSafeIRQHandler(uint32_t ulICCIAR) -{ - (void)ulICCIAR; - configASSERT((volatile void *)NULL); -} - _WEAK void vApplicationTickHook(void) { } diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch32/portASM.S b/third-party/freertos/portable/GCC/ft_platform/aarch32/portASM.S index 4cdbf8e8ef079af292b3120d5210480a6d602048..9ecf83e4fd0063595ee85ef645e30e4c4d897812 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch32/portASM.S +++ b/third-party/freertos/portable/GCC/ft_platform/aarch32/portASM.S @@ -329,7 +329,7 @@ ulMaxAPIPriorityMaskConst: .word ulMaxAPIPriorityMask vTaskSwitchContextConst: .word vTaskSwitchContext vApplicationIRQHandlerConst: .word vApplicationIRQHandler ulPortInterruptNestingConst: .word ulPortInterruptNesting -vApplicationFPUSafeIRQHandlerConst: .word vApplicationFPUSafeIRQHandler +vApplicationFPUSafeIRQHandlerConst: .word vApplicationInterruptHandler .end diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/FreeRTOSConfig.h b/third-party/freertos/portable/GCC/ft_platform/aarch64/FreeRTOSConfig.h index 45ec5d249f7058c727c9ab972f63c8c10a1bde9f..687b2b0fc964e5da24415fc6bed6f022f51a2e91 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch64/FreeRTOSConfig.h +++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/FreeRTOSConfig.h @@ -28,7 +28,7 @@ #ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H -#include "parameters.h" +#include "interrupt.h" /*----------------------------------------------------------- * Application specific definitions. @@ -65,10 +65,12 @@ * For the purpose of setting configMAX_API_CALL_INTERRUPT_PRIORITY 255 * represents the lowest priority. */ -/* 在不安全group1 中 ,0x8 ~0xb 不可以使用安全api(优先级越低越高)*/ -#define configMAX_API_CALL_INTERRUPT_PRIORITY 0xb + /* 在不安全group1 中,16 is steps ,3 是其中等级*/ -#define configKERNEL_INTERRUPT_PRIORITY ((0x8 << 4) + 3 * 16) +#define configKERNEL_INTERRUPT_PRIORITY IRQ_PRIORITY_VALUE_11 +/* 在不安全group1 中 ,0x8 ~0xb 不可以使用安全api(优先级越低越高)*/ +#define configMAX_API_CALL_INTERRUPT_PRIORITY IRQ_PRIORITY_VALUE_11 + #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 #define configUSE_TICKLESS_IDLE 0 @@ -80,7 +82,7 @@ #define configMAX_PRIORITIES (8) #define configMINIMAL_STACK_SIZE ((unsigned short)1024) #define configTOTAL_HEAP_SIZE (1024 * 1024) -#define configMAX_TASK_NAME_LEN (10) +#define configMAX_TASK_NAME_LEN (32) #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 #define configUSE_MUTEXES 1 diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/boot.S b/third-party/freertos/portable/GCC/ft_platform/aarch64/boot.S index 39ea6c03e1afb41f5f4dd05e63cb675edc562166..1c9f992c8f2e7615b218893a089a72eac7aa34e1 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch64/boot.S +++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/boot.S @@ -1,5 +1,3 @@ - - .global _boot .global _vector_table @@ -13,6 +11,8 @@ .section .boot,"ax" _boot: + bl FTraceUartInit + bl FTraceBootup mrs x0, CurrentEL cmp x0, 0xc b.eq El3Entry @@ -36,7 +36,8 @@ _boot: /* daif=0000 */ msr spsr_el3, x0 /* m[4:0]=01001 el2h must match scr_el3.rw*/ - + + bl FTraceEL3 /* determine el2 entry.*/ adr x0, El2Entry /* El2Entry points to the first instruction of */ @@ -44,17 +45,21 @@ _boot: /* el2 code.*/ eret El2Entry: - + mov x1, #0x0 + msr sctlr_el1, x1 /* initialize the sctlr_el1 register before entering el1.*/ msr sctlr_el1, xzr mrs x0, hcr_el2 orr x0, x0, #(1<<31) + bic x0, x0, #(1<<27) /* HCR_EL2.TGE = 0 */ /* rw=1 el1 execution state is aarch64.*/ msr hcr_el2, x0 mov x0, #0b00101 /* daif=0000 */ msr spsr_el2, x0 /* m[4:0]=00101 el1h must match hcr_el2.rw.*/ + + bl FTraceEL2 adr x0, El1Entry /* El1Entry points to the first instruction of */ msr elr_el2, x0 @@ -105,8 +110,7 @@ InitEl1: /* Trap floating point access only in case of standalone BSP */ mrs x0, CPACR_EL1 - /* bic x0, x0, #(0x3 << 20) */ - orr x0, x0, #(0x3 << 20) + orr x0, x0, #(0x3 << 20) /*This control does not cause any instructions to be trapped. */ msr CPACR_EL1, x0 isb @@ -115,6 +119,7 @@ InitEl1: ldr x2,=el1_stack mov sp,x2 + bl FTraceEL1 bl _startup /* jump to start */ @@ -122,5 +127,3 @@ hang: wfi b HangPrint b hang - - diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/freertos_vectors.S b/third-party/freertos/portable/GCC/ft_platform/aarch64/freertos_vectors.S new file mode 100644 index 0000000000000000000000000000000000000000..19b424a644982a70c2d3e3b025f9af3b1d783e83 --- /dev/null +++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/freertos_vectors.S @@ -0,0 +1,65 @@ +.globl _freertos_vector_table +.globl SErrorInterruptHandler + + +.section .freertos_vectors, "a" + + +_freertos_vector_table: +.set FREERTOS_VBAR, _freertos_vector_table +.align 11 /* VBAR_EL1 Vector Base Address is [55:48] */ +.org(FREERTOS_VBAR) + + b FreeRTOS_SWI_Handler + +.org (FREERTOS_VBAR + 0x80) + b FreeRTOS_IRQ_Handler + +.org (FREERTOS_VBAR + 0x100) + b . + +.org (FREERTOS_VBAR + 0x180) + b . + +.org (FREERTOS_VBAR + 0x200) + b FreeRTOS_SWI_Handler + +.org (FREERTOS_VBAR + 0x280) + b FreeRTOS_IRQ_Handler + +.org (FREERTOS_VBAR + 0x300) + b . + +.org (FREERTOS_VBAR + 0x380) + b SErrorInterruptHandler /* SError/vSError */ + +.org (FREERTOS_VBAR + 0x400) + b . + +.org (FREERTOS_VBAR + 0x480) + b . + +.org (FREERTOS_VBAR + 0x500) + b . + +.org (FREERTOS_VBAR + 0x580) + b . + +.org (FREERTOS_VBAR + 0x600) + b . + +.org (FREERTOS_VBAR + 0x680) + b . + +.org (FREERTOS_VBAR + 0x700) + b . + +.org (FREERTOS_VBAR + 0x780) + b . + +.org (FREERTOS_VBAR + 0x800) + + + + +.end \ No newline at end of file diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c b/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c index 307d5ba0dbcc6c22a4aceaa19f12a67bc94a4550..fc5d395121e96f2411c310cdb2048adc8ae513a4 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c +++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/port.c @@ -32,8 +32,8 @@ #include "FreeRTOS.h" #include "task.h" #include "ft_types.h" -#include "gicv3_cpuif.h" - +#include "interrupt.h" +#include "fgic_cpu_interface.h" #ifndef configUNIQUE_INTERRUPT_PRIORITIES #error configUNIQUE_INTERRUPT_PRIORITIES must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html #endif @@ -114,7 +114,7 @@ point is zero. */ #define portCLEAR_INTERRUPT_MASK() \ { \ portDISABLE_INTERRUPTS(); \ - setPriorityMask(portUNMASK_VALUE); \ + InterruptSetPriorityMask(portUNMASK_VALUE); \ __asm volatile("DSB SY \n" \ "ISB SY \n"); \ portENABLE_INTERRUPTS(); \ @@ -310,10 +310,10 @@ BaseType_t xPortStartScheduler(void) setting. See the comments in vPortValidateInterruptPriority() below for more information. */ // configASSERT((portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE); - configASSERT((getBPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE); + configASSERT((FGicGetICC_BPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE); // if ((portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE) - if ((getBPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE) + if ((FGicGetICC_BPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE) { /* Interrupts are turned off in the CPU itself to ensure a tick does not execute while the scheduler is being started. Interrupts are @@ -401,7 +401,7 @@ void FreeRTOS_Tick_Handler(void) necessary to turn off interrupts in the CPU itself while the ICCPMR is being updated. */ - setPriorityMask(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT); + InterruptSetPriorityMask(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT); __asm volatile("dsb sy \n" "isb sy \n" :: : "memory"); @@ -448,7 +448,7 @@ UBaseType_t uxPortSetInterruptMask(void) /* Interrupt in the CPU must be turned off while the ICCPMR is being updated. */ portDISABLE_INTERRUPTS(); - if (getPriorityMask() == (uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT)) + if (FGicGetICC_PMR() == (uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT)) { /* Interrupts were already masked. */ ulReturn = pdTRUE; @@ -456,7 +456,7 @@ UBaseType_t uxPortSetInterruptMask(void) else { ulReturn = pdFALSE; - setPriorityMask(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT); + InterruptSetPriorityMask(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT); // portICCPMR_PRIORITY_MASK_REGISTER = (uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT); __asm volatile("dsb sy \n" "isb sy \n" :: @@ -486,7 +486,7 @@ void vPortValidateInterruptPriority(void) FreeRTOS maintains separate thread and ISR API functions to ensure interrupt entry is as fast and simple as possible. */ - configASSERT(getRunningPriority() >= (uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT)); + configASSERT(FGicGetICC_RPR() >= (uint32_t)(configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT)); /* Priority grouping: The interrupt controller (GIC) allows the bits that define each interrupt's priority to be split between bits that @@ -498,7 +498,7 @@ void vPortValidateInterruptPriority(void) The priority grouping is configured by the GIC's binary point register (ICCBPR). Writting 0 to ICCBPR will ensure it is set to its lowest possible value (which may be above 0). */ - configASSERT((getBPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE); + configASSERT((FGicGetICC_BPR1() & portBINARY_POINT_BITS) <= portMAX_BINARY_POINT_VALUE); } #endif /* configASSERT_DEFINED */ diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/portASM.S b/third-party/freertos/portable/GCC/ft_platform/aarch64/portASM.S index 1c8b1ad09911c3244b777e61caead0d5f727e530..0536517403ae927d687994b09de41283fcce93fe 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch64/portASM.S +++ b/third-party/freertos/portable/GCC/ft_platform/aarch64/portASM.S @@ -24,7 +24,49 @@ * * 1 tab == 4 spaces! */ -#include "gicv3_aliases.h" + + #define ICC_AP0R0_EL1 S3_0_C12_C8_4 +#define ICC_AP0R1_EL1 S3_0_C12_C8_5 +#define ICC_AP0R2_EL1 S3_0_C12_C8_6 +#define ICC_AP0R3_EL1 S3_0_C12_C8_7 + +#define ICC_AP1R0_EL1 S3_0_C12_C9_0 +#define ICC_AP1R1_EL1 S3_0_C12_C9_1 +#define ICC_AP1R2_EL1 S3_0_C12_C9_2 +#define ICC_AP1R3_EL1 S3_0_C12_C9_3 + +#define ICC_ASGI1R_EL1 S3_0_C12_C11_6 + +#define ICC_BPR0_EL1 S3_0_C12_C8_3 +#define ICC_BPR1_EL1 S3_0_C12_C12_3 + +#define ICC_CTLR_EL1 S3_0_C12_C12_4 +#define ICC_CTLR_EL3 S3_6_C12_C12_4 + +#define ICC_DIR_EL1 S3_0_C12_C11_1 + +#define ICC_EOIR0_EL1 S3_0_C12_C8_1 +#define ICC_EOIR1_EL1 S3_0_C12_C12_1 + +#define ICC_HPPIR0_EL1 S3_0_C12_C8_2 +#define ICC_HPPIR1_EL1 S3_0_C12_C12_2 + +#define ICC_IAR0_EL1 S3_0_C12_C8_0 +#define ICC_IAR1_EL1 S3_0_C12_C12_0 + +#define ICC_IGRPEN0_EL1 S3_0_C12_C12_6 +#define ICC_IGRPEN1_EL1 S3_0_C12_C12_7 +#define ICC_IGRPEN1_EL3 S3_6_C12_C12_7 + +#define ICC_PMR_EL1 S3_0_C4_C6_0 +#define ICC_RPR_EL1 S3_0_C12_C11_3 + +#define ICC_SGI0R_EL1 S3_0_C12_C11_7 +#define ICC_SGI1R_EL1 S3_0_C12_C11_5 + +#define ICC_SRE_EL1 S3_0_C12_C12_5 +#define ICC_SRE_EL2 S3_4_C12_C9_5 +#define ICC_SRE_EL3 S3_6_C12_C12_5 .text @@ -33,7 +75,7 @@ .extern pxCurrentTCB .extern vTaskSwitchContext .extern _freertos_vector_table - .extern vApplicationIRQHandler + .extern vApplicationInterruptHandler .extern ullPortInterruptNesting .extern ullPortTaskHasFPUContext .extern ullCriticalNesting @@ -322,7 +364,7 @@ FreeRTOS_IRQ_Handler: STP X0, X1, [SP, #-0x10]! /* Call the C handler. */ - BL vApplicationIRQHandler + BL vApplicationInterruptHandler /* Disable interrupts. */ MSR DAIFSET, #2 @@ -419,7 +461,7 @@ pxCurrentTCBConst: .dword pxCurrentTCB ullCriticalNestingConst: .dword ullCriticalNesting ullPortTaskHasFPUContextConst: .dword ullPortTaskHasFPUContext ullMaxAPIPriorityMaskConst: .dword ullMaxAPIPriorityMask -vApplicationIRQHandlerConst: .dword vApplicationIRQHandler +vApplicationIRQHandlerConst: .dword vApplicationInterruptHandler ullPortInterruptNestingConst: .dword ullPortInterruptNesting ullPortYieldRequiredConst: .dword ullPortYieldRequired diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/vectors.S b/third-party/freertos/portable/GCC/ft_platform/aarch64/vectors.S deleted file mode 100644 index d70bf54b16efda01a0e495674e96252c293013f2..0000000000000000000000000000000000000000 --- a/third-party/freertos/portable/GCC/ft_platform/aarch64/vectors.S +++ /dev/null @@ -1,314 +0,0 @@ - -.globl _boot -.globl _vector_table -.globl _freertos_vector_table - -.globl FiqInterrupt -.globl IrqInterrupt -.globl SerrorInterrupt -.globl SynchronousInterrupt -.globl fpu_status - - - - -.macro SaveRegister - stp X0,X1, [sp,#-0x10]! - stp X2,X3, [sp,#-0x10]! - stp X4,X5, [sp,#-0x10]! - stp X6,X7, [sp,#-0x10]! - stp X8,X9, [sp,#-0x10]! - stp X10,X11, [sp,#-0x10]! - stp X12,X13, [sp,#-0x10]! - stp X14,X15, [sp,#-0x10]! - stp X16,X17, [sp,#-0x10]! - stp X18,X19, [sp,#-0x10]! - stp X29,X30, [sp,#-0x10]! -.endm - - -.macro RestoreRegister - ldp X29,X30, [sp], #0x10 - ldp X18,X19, [sp], #0x10 - ldp X16,X17, [sp], #0x10 - ldp X14,X15, [sp], #0x10 - ldp X12,X13, [sp], #0x10 - ldp X10,X11, [sp], #0x10 - ldp X8,X9, [sp], #0x10 - ldp X6,X7, [sp], #0x10 - ldp X4,X5, [sp], #0x10 - ldp X2,X3, [sp], #0x10 - ldp X0,X1, [sp], #0x10 -.endm - - -.macro SaveFloatregister - bl FloatSave -/* Load the floating point context array address from fpu_context_base */ - ldr x1,=fpu_context_base - ldr x0, [x1] - -/* Save all the floating point register to the array */ - stp q0,q1, [x0], #0x20 - stp q2,q3, [x0], #0x20 - stp q4,q5, [x0], #0x20 - stp q6,q7, [x0], #0x20 - stp q8,q9, [x0], #0x20 - stp q10,q11, [x0], #0x20 - stp q12,q13, [x0], #0x20 - stp q14,q15, [x0], #0x20 - stp q16,q17, [x0], #0x20 - stp q18,q19, [x0], #0x20 - stp q20,q21, [x0], #0x20 - stp q22,q23, [x0], #0x20 - stp q24,q25, [x0], #0x20 - stp q26,q27, [x0], #0x20 - stp q28,q29, [x0], #0x20 - stp q30,q31, [x0], #0x20 - mrs x2, FPCR - mrs x3, FPSR - stp x2, x3, [x0], #0x10 - -/* Save current address of floating point context array to fpu_context_base */ - str x0, [x1] -.endm - -.macro RestoreFloatRegister - -/* Restore the address of floating point context array from fpu_context_base */ - ldr x1,=fpu_context_base - ldr x0, [x1] - -/* Restore all the floating point register from the array */ - ldp x2, x3, [x0,#-0x10]! - msr FPCR, x2 - msr FPSR, x3 - ldp q30,q31, [x0,#-0x20]! - ldp q28,q29, [x0,#-0x20]! - ldp q26,q27, [x0,#-0x20]! - ldp q24,q25, [x0,#-0x20]! - ldp q22,q23, [x0,#-0x20]! - ldp q20,q21, [x0,#-0x20]! - ldp q18,q19, [x0,#-0x20]! - ldp q16,q17, [x0,#-0x20]! - ldp q14,q15, [x0,#-0x20]! - ldp q12,q13, [x0,#-0x20]! - ldp q10,q11, [x0,#-0x20]! - ldp q8,q9, [x0,#-0x20]! - ldp q6,q7, [x0,#-0x20]! - ldp q4,q5, [x0,#-0x20]! - ldp q2,q3, [x0,#-0x20]! - ldp q0,q1, [x0,#-0x20]! - -/* Save current address of floating point context array to fpu_context_base */ - str x0, [x1] -.endm - -.org 0 - -.section .vectors, "a" - -_vector_table: -.set VBAR, _vector_table -.org VBAR - - b _boot -.org (VBAR + 0x200) - b SynchronousInterruptHandler - -.org (VBAR + 0x280) - b IRQInterruptHandler - -.org (VBAR + 0x300) - b FIQInterruptHandler - -.org (VBAR + 0x380) - b SErrorInterruptHandler - - -SynchronousInterruptHandler: - SaveRegister -/* Check if the Synchronous abort is occurred due to floating point access. */ - mrs x0, ESR_EL1 - - and x0, x0, #(0x3F << 26) - mov x1, #(0x7 << 26) - cmp x0, x1 -/* If exception is not due to floating point access go to synchronous handler */ - bne Synchronoushandler - -/* - * If excpetion occurred due to floating point access, Enable the floating point - * access i.e. do not trap floating point instruction - */ - - mrs x1,CPACR_EL1 - orr x1, x1, #(0x1<<20) - msr CPACR_EL1, x1 - isb - -/* If the floating point access was previously enabled, store FPU context - * registers(StoreFloat). - */ - ldr x0, =fpu_status - ldrb w1,[x0] - cbnz w1, StoreFloat -/* - * If the floating point access was not enabled previously, save the status of - * floating point accessibility i.e. enabled and store floating point context - * array address(fpu_context) to fpu_context_base. - */ - mov w1, #0x1 - strb w1, [x0] - ldr x0, =fpu_context - ldr x1, =fpu_context_base - str x0,[x1] - b RestoreContext -StoreFloat: - SaveFloatRegister - b RestoreContext -Synchronoushandler: /* 此处还需要进行压栈处理,位函数内提供打印信息 */ - mrs x0, CPACR_EL1 - mrs x1, ELR_EL1 - mrs x2, SPSR_EL1 - stp x0, x1, [sp,#-0x10]! - mov x21, sp - add x21, x21, #208 - stp x21,x21, [sp,#-0x10]! - mov x0, sp - - bl SynchronousInterrupt -RestoreContext: - RestoreRegister - eret - - -IRQInterruptHandler: - SaveRegister -/* Save the status of SPSR, ELR and CPTR to stack */ - mrs x0, CPACR_EL1 - mrs x1, ELR_EL1 - mrs x2, SPSR_EL1 - - stp x0, x1, [sp,#-0x10]! - str x2, [sp,#-0x10]! - -/* Trap floating point access */ - mrs x1,CPACR_EL1 - bic x1, x1, #(0x1<<20) - msr CPACR_EL1, x1 - isb - - bl IRQInterrupt -/* - * If floating point access is enabled during interrupt handling, - * restore floating point registers. - */ - mrs x0,CPACR_EL1 - ands x0, x0, #(0x1<<20) - beq RestorePrevState - - RestoreFloatRegister - -/* Restore the status of SPSR, ELR and CPTR from stack */ -RestorePrevState: - ldr x2,[sp],0x10 - ldp x0, x1, [sp],0x10 - - msr CPACR_EL1, x0 - msr ELR_EL1, x1 - msr SPSR_EL1, x2 - - RestoreRegister - eret - -FIQInterruptHandler: - - SaveRegister - - bl FIQInterrupt - - RestoreRegister - - eret - -SErrorInterruptHandler: - - SaveRegister - /* Save the status of SPSR, ELR and CPTR to stack */ - mrs x0, CPACR_EL1 - mrs x1, ELR_EL1 - mrs x2, SPSR_EL1 - stp x0, x1, [sp,#-0x10]! - mov x21, sp - add x21, x21, #208 - stp x21,x21, [sp,#-0x10]! - mov x0, sp - - mov x0, sp - bl SErrorInterrupt - - RestoreRegister - - eret - - - - -.set FREERTOS_VBAR, (VBAR+0x2000) - -.org(FREERTOS_VBAR) -_freertos_vector_table: - b FreeRTOS_SWI_Handler - -.org (FREERTOS_VBAR + 0x80) - b FreeRTOS_IRQ_Handler - -.org (FREERTOS_VBAR + 0x100) - b . - -.org (FREERTOS_VBAR + 0x180) - b . - -.org (FREERTOS_VBAR + 0x200) - b FreeRTOS_SWI_Handler - -.org (FREERTOS_VBAR + 0x280) - b FreeRTOS_IRQ_Handler - -.org (FREERTOS_VBAR + 0x300) - b . - -.org (FREERTOS_VBAR + 0x380) - b SErrorInterruptHandler /* SError/vSError */ - -.org (FREERTOS_VBAR + 0x400) - b . - -.org (FREERTOS_VBAR + 0x480) - b . - -.org (FREERTOS_VBAR + 0x500) - b . - -.org (FREERTOS_VBAR + 0x580) - b . - -.org (FREERTOS_VBAR + 0x600) - b . - -.org (FREERTOS_VBAR + 0x680) - b . - -.org (FREERTOS_VBAR + 0x700) - b . - -.org (FREERTOS_VBAR + 0x780) - b . - -.org (FREERTOS_VBAR + 0x800) - - -.align 8 - -.end \ No newline at end of file diff --git a/third-party/freertos/portable/MemMang/qemu_aarch32/heap_4.c b/third-party/freertos/portable/MemMang/qemu_aarch32/heap_4.c deleted file mode 100644 index 02251c094646b111f63216856fbff414709b3f95..0000000000000000000000000000000000000000 --- a/third-party/freertos/portable/MemMang/qemu_aarch32/heap_4.c +++ /dev/null @@ -1,436 +0,0 @@ -/* - * FreeRTOS Kernel V10.0.1 - * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - * - * 1 tab == 4 spaces! - */ - -/* - * A sample implementation of pvPortMalloc() and vPortFree() that combines - * (coalescences) adjacent memory blocks as they are freed, and in so doing - * limits memory fragmentation. - * - * See heap_1.c, heap_2.c and heap_3.c for alternative implementations, and the - * memory management pages of http://www.FreeRTOS.org for more information. - */ -#include - -/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining -all the API functions to use the MPU wrappers. That should only be done when -task.h is included from an application file. */ -#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE - -#include "FreeRTOS.h" -#include "task.h" - -#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE - -#if( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) - #error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0 -#endif - -/* Block sizes must not get too small. */ -#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( xHeapStructSize << 1 ) ) - -/* Assumes 8bit bytes! */ -#define heapBITS_PER_BYTE ( ( size_t ) 8 ) - -/* Allocate the memory for the heap. */ -#if( configAPPLICATION_ALLOCATED_HEAP == 1 ) - /* The application writer has already defined the array used for the RTOS - heap - probably so it can be placed in a special segment or address. */ - extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; -#else - static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; -#endif /* configAPPLICATION_ALLOCATED_HEAP */ - -/* Define the linked list structure. This is used to link free blocks in order -of their memory address. */ -typedef struct A_BLOCK_LINK -{ - struct A_BLOCK_LINK *pxNextFreeBlock; /*<< The next free block in the list. */ - size_t xBlockSize; /*<< The size of the free block. */ -} BlockLink_t; - -/*-----------------------------------------------------------*/ - -/* - * Inserts a block of memory that is being freed into the correct position in - * the list of free memory blocks. The block being freed will be merged with - * the block in front it and/or the block behind it if the memory blocks are - * adjacent to each other. - */ -static void prvInsertBlockIntoFreeList( BlockLink_t *pxBlockToInsert ); - -/* - * Called automatically to setup the required heap structures the first time - * pvPortMalloc() is called. - */ -static void prvHeapInit( void ); - -/*-----------------------------------------------------------*/ - -/* The size of the structure placed at the beginning of each allocated memory -block must by correctly byte aligned. */ -static const size_t xHeapStructSize = ( sizeof( BlockLink_t ) + ( ( size_t ) ( portBYTE_ALIGNMENT - 1 ) ) ) & ~( ( size_t ) portBYTE_ALIGNMENT_MASK ); - -/* Create a couple of list links to mark the start and end of the list. */ -static BlockLink_t xStart, *pxEnd = NULL; - -/* Keeps track of the number of free bytes remaining, but says nothing about -fragmentation. */ -static size_t xFreeBytesRemaining = 0U; -static size_t xMinimumEverFreeBytesRemaining = 0U; - -/* Gets set to the top bit of an size_t type. When this bit in the xBlockSize -member of an BlockLink_t structure is set then the block belongs to the -application. When the bit is free the block is still part of the free heap -space. */ -static size_t xBlockAllocatedBit = 0; - -/*-----------------------------------------------------------*/ - -void *pvPortMalloc( size_t xWantedSize ) -{ -BlockLink_t *pxBlock, *pxPreviousBlock, *pxNewBlockLink; -void *pvReturn = NULL; - - vTaskSuspendAll(); - { - /* If this is the first call to malloc then the heap will require - initialisation to setup the list of free blocks. */ - if( pxEnd == NULL ) - { - prvHeapInit(); - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - - /* Check the requested block size is not so large that the top bit is - set. The top bit of the block size member of the BlockLink_t structure - is used to determine who owns the block - the application or the - kernel, so it must be free. */ - if( ( xWantedSize & xBlockAllocatedBit ) == 0 ) - { - /* The wanted size is increased so it can contain a BlockLink_t - structure in addition to the requested amount of bytes. */ - if( xWantedSize > 0 ) - { - xWantedSize += xHeapStructSize; - - /* Ensure that blocks are always aligned to the required number - of bytes. */ - if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 ) - { - /* Byte alignment required. */ - xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ); - configASSERT( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) == 0 ); - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - - if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) ) - { - /* Traverse the list from the start (lowest address) block until - one of adequate size is found. */ - pxPreviousBlock = &xStart; - pxBlock = xStart.pxNextFreeBlock; - while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) ) - { - pxPreviousBlock = pxBlock; - pxBlock = pxBlock->pxNextFreeBlock; - } - - /* If the end marker was reached then a block of adequate size - was not found. */ - if( pxBlock != pxEnd ) - { - /* Return the memory space pointed to - jumping over the - BlockLink_t structure at its start. */ - pvReturn = ( void * ) ( ( ( uint8_t * ) pxPreviousBlock->pxNextFreeBlock ) + xHeapStructSize ); - - /* This block is being returned for use so must be taken out - of the list of free blocks. */ - pxPreviousBlock->pxNextFreeBlock = pxBlock->pxNextFreeBlock; - - /* If the block is larger than required it can be split into - two. */ - if( ( pxBlock->xBlockSize - xWantedSize ) > heapMINIMUM_BLOCK_SIZE ) - { - /* This block is to be split into two. Create a new - block following the number of bytes requested. The void - cast is used to prevent byte alignment warnings from the - compiler. */ - pxNewBlockLink = ( void * ) ( ( ( uint8_t * ) pxBlock ) + xWantedSize ); - configASSERT( ( ( ( size_t ) pxNewBlockLink ) & portBYTE_ALIGNMENT_MASK ) == 0 ); - - /* Calculate the sizes of two blocks split from the - single block. */ - pxNewBlockLink->xBlockSize = pxBlock->xBlockSize - xWantedSize; - pxBlock->xBlockSize = xWantedSize; - - /* Insert the new block into the list of free blocks. */ - prvInsertBlockIntoFreeList( pxNewBlockLink ); - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - - xFreeBytesRemaining -= pxBlock->xBlockSize; - - if( xFreeBytesRemaining < xMinimumEverFreeBytesRemaining ) - { - xMinimumEverFreeBytesRemaining = xFreeBytesRemaining; - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - - /* The block is being returned - it is allocated and owned - by the application and has no "next" block. */ - pxBlock->xBlockSize |= xBlockAllocatedBit; - pxBlock->pxNextFreeBlock = NULL; - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - - traceMALLOC( pvReturn, xWantedSize ); - } - ( void ) xTaskResumeAll(); - - #if( configUSE_MALLOC_FAILED_HOOK == 1 ) - { - if( pvReturn == NULL ) - { - extern void vApplicationMallocFailedHook( void ); - vApplicationMallocFailedHook(); - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - } - #endif - - configASSERT( ( ( ( size_t ) pvReturn ) & ( size_t ) portBYTE_ALIGNMENT_MASK ) == 0 ); - return pvReturn; -} -/*-----------------------------------------------------------*/ - -void vPortFree( void *pv ) -{ -uint8_t *puc = ( uint8_t * ) pv; -BlockLink_t *pxLink; - - if( pv != NULL ) - { - /* The memory being freed will have an BlockLink_t structure immediately - before it. */ - puc -= xHeapStructSize; - - /* This casting is to keep the compiler from issuing warnings. */ - pxLink = ( void * ) puc; - - /* Check the block is actually allocated. */ - configASSERT( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 ); - configASSERT( pxLink->pxNextFreeBlock == NULL ); - - if( ( pxLink->xBlockSize & xBlockAllocatedBit ) != 0 ) - { - if( pxLink->pxNextFreeBlock == NULL ) - { - /* The block is being returned to the heap - it is no longer - allocated. */ - pxLink->xBlockSize &= ~xBlockAllocatedBit; - - vTaskSuspendAll(); - { - /* Add this block to the list of free blocks. */ - xFreeBytesRemaining += pxLink->xBlockSize; - traceFREE( pv, pxLink->xBlockSize ); - prvInsertBlockIntoFreeList( ( ( BlockLink_t * ) pxLink ) ); - } - ( void ) xTaskResumeAll(); - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - } -} -/*-----------------------------------------------------------*/ - -size_t xPortGetFreeHeapSize( void ) -{ - return xFreeBytesRemaining; -} -/*-----------------------------------------------------------*/ - -size_t xPortGetMinimumEverFreeHeapSize( void ) -{ - return xMinimumEverFreeBytesRemaining; -} -/*-----------------------------------------------------------*/ - -void vPortInitialiseBlocks( void ) -{ - /* This just exists to keep the linker quiet. */ -} -/*-----------------------------------------------------------*/ - -static void prvHeapInit( void ) -{ -BlockLink_t *pxFirstFreeBlock; -uint8_t *pucAlignedHeap; -size_t uxAddress; -size_t xTotalHeapSize = configTOTAL_HEAP_SIZE; - - /* Ensure the heap starts on a correctly aligned boundary. */ - uxAddress = ( size_t ) ucHeap; - - if( ( uxAddress & portBYTE_ALIGNMENT_MASK ) != 0 ) - { - uxAddress += ( portBYTE_ALIGNMENT - 1 ); - uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK ); - xTotalHeapSize -= uxAddress - ( size_t ) ucHeap; - } - - pucAlignedHeap = ( uint8_t * ) uxAddress; - - /* xStart is used to hold a pointer to the first item in the list of free - blocks. The void cast is used to prevent compiler warnings. */ - xStart.pxNextFreeBlock = ( void * ) pucAlignedHeap; - xStart.xBlockSize = ( size_t ) 0; - - /* pxEnd is used to mark the end of the list of free blocks and is inserted - at the end of the heap space. */ - uxAddress = ( ( size_t ) pucAlignedHeap ) + xTotalHeapSize; - uxAddress -= xHeapStructSize; - uxAddress &= ~( ( size_t ) portBYTE_ALIGNMENT_MASK ); - pxEnd = ( void * ) uxAddress; - pxEnd->xBlockSize = 0; - pxEnd->pxNextFreeBlock = NULL; - - /* To start with there is a single free block that is sized to take up the - entire heap space, minus the space taken by pxEnd. */ - pxFirstFreeBlock = ( void * ) pucAlignedHeap; - pxFirstFreeBlock->xBlockSize = uxAddress - ( size_t ) pxFirstFreeBlock; - pxFirstFreeBlock->pxNextFreeBlock = pxEnd; - - /* Only one block exists - and it covers the entire usable heap space. */ - xMinimumEverFreeBytesRemaining = pxFirstFreeBlock->xBlockSize; - xFreeBytesRemaining = pxFirstFreeBlock->xBlockSize; - - /* Work out the position of the top bit in a size_t variable. */ - xBlockAllocatedBit = ( ( size_t ) 1 ) << ( ( sizeof( size_t ) * heapBITS_PER_BYTE ) - 1 ); -} -/*-----------------------------------------------------------*/ - -static void prvInsertBlockIntoFreeList( BlockLink_t *pxBlockToInsert ) -{ -BlockLink_t *pxIterator; -uint8_t *puc; - - /* Iterate through the list until a block is found that has a higher address - than the block being inserted. */ - for( pxIterator = &xStart; pxIterator->pxNextFreeBlock < pxBlockToInsert; pxIterator = pxIterator->pxNextFreeBlock ) - { - /* Nothing to do here, just iterate to the right position. */ - } - - /* Do the block being inserted, and the block it is being inserted after - make a contiguous block of memory? */ - puc = ( uint8_t * ) pxIterator; - if( ( puc + pxIterator->xBlockSize ) == ( uint8_t * ) pxBlockToInsert ) - { - pxIterator->xBlockSize += pxBlockToInsert->xBlockSize; - pxBlockToInsert = pxIterator; - } - else - { - mtCOVERAGE_TEST_MARKER(); - } - - /* Do the block being inserted, and the block it is being inserted before - make a contiguous block of memory? */ - puc = ( uint8_t * ) pxBlockToInsert; - if( ( puc + pxBlockToInsert->xBlockSize ) == ( uint8_t * ) pxIterator->pxNextFreeBlock ) - { - if( pxIterator->pxNextFreeBlock != pxEnd ) - { - /* Form one big block from the two blocks. */ - pxBlockToInsert->xBlockSize += pxIterator->pxNextFreeBlock->xBlockSize; - pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock->pxNextFreeBlock; - } - else - { - pxBlockToInsert->pxNextFreeBlock = pxEnd; - } - } - else - { - pxBlockToInsert->pxNextFreeBlock = pxIterator->pxNextFreeBlock; - } - - /* If the block being inserted plugged a gab, so was merged with the block - before and the block after, then it's pxNextFreeBlock pointer will have - already been set, and should not be set here as that would make it point - to itself. */ - if( pxIterator != pxBlockToInsert ) - { - pxIterator->pxNextFreeBlock = pxBlockToInsert; - } - else - { - mtCOVERAGE_TEST_MARKER(); - } -} - diff --git a/third-party/freertos/portable/freertos_configs.c b/third-party/freertos/portable/freertos_configs.c index c2f9d4e1d8b9b4bc7d17e6a398c53096488ad050..bf59b5a1fbfbef2253554ea31ac89590f441a644 100644 --- a/third-party/freertos/portable/freertos_configs.c +++ b/third-party/freertos/portable/freertos_configs.c @@ -25,12 +25,12 @@ #include "task.h" #include "ft_types.h" #include "parameters.h" -#include "gicv3.h" #include "generic_timer.h" #include "interrupt.h" #include #include "cpu_info.h" #include "ft_assert.h" +#include "exception.h" void vMainAssertCalled(const char *pcFileName, uint32_t ulLineNumber) { @@ -88,42 +88,19 @@ void vClearTickInterrupt(void) GenericTimerCompare(cntfrq / configTICK_RATE_HZ); } - -static void vFIrqHandler(int ir) -{ - void *param; - IrqHandler isr_func; - extern struct IrqDesc isr_table[]; - - /* get interrupt service routine */ - isr_func = isr_table[ir].handler; - if (isr_func) - { - /* Interrupt for myself. */ - param = isr_table[ir].param; - /* turn to interrupt service routine */ - isr_func(ir, param); - } - - /* end of interrupt */ - InterruptAck(ir); -} - volatile unsigned int gCpuRuntime; -#ifdef __aarch64__ - -void vApplicationIRQHandler(uint32_t ulICCIAR) +void vApplicationInterruptHandler(uint32_t ulICCIAR) { int ulInterruptID; /* Interrupts cannot be re-enabled until the source of the interrupt is - cleared. The ID of the interrupt is obtained by bitwise ANDing the ICCIAR - value with 0x3FF. */ + cleared. The ID of the interrupt is obtained by bitwise ANDing the ICCIAR + value with 0x3FF. */ ulInterruptID = ulICCIAR & 0x3FFUL; /* call handler function */ - if (ulInterruptID == 30) + if (ulInterruptID == GENERIC_TIMER_NS_IRQ_NUM) { /* Generic Timer */ gCpuRuntime++; @@ -131,41 +108,15 @@ void vApplicationIRQHandler(uint32_t ulICCIAR) } else { - vFIrqHandler(ulInterruptID); + FExceptionInterruptHandler((void *)(uintptr)ulInterruptID); } } -#else - -void vApplicationFPUSafeIRQHandler(uint32_t ulICCIAR) -{ - int ulInterruptID; - - /* Interrupts cannot be re-enabled until the source of the interrupt is - cleared. The ID of the interrupt is obtained by bitwise ANDing the ICCIAR - value with 0x3FF. */ - ulInterruptID = ulICCIAR & 0x3FFUL; - - /* call handler function */ - if (ulInterruptID == 30) - { - /* Generic Timer */ - gCpuRuntime++; - FreeRTOS_Tick_Handler(); - } - else - { - vFIrqHandler(ulInterruptID); - } -} -#endif - +static InterruptDrvType finterrupt; -void InitIrq() +void vApplicationInitIrq(void) { - /* interrupt init */ - ArmGicRedistAddressSet(0, GICV3_RD_BASEADDRESS + 0, 0); - InterruptInit(GICV3_BASEADDRESS, 0); + InterruptInit(&finterrupt,INTERRUPT_DRV_INTS_ID,INTERRUPT_ROLE_MASTER); } @@ -204,7 +155,7 @@ void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackTy } /* configSUPPORT_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the - * application must provide an implementation of vApplicationGetTimerTaskMemory() + * application must provide an implementation of `vApplicationGetTimerTaskMemory() * to provide the memory that is used by the Timer service task. */ void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize ) { diff --git a/third-party/freertos/queue.c b/third-party/freertos/queue.c index c37d285f343db916d95b56f2ef0f89b9becc6f92..91bf9e7f7170aac83acd2283e5f5c1468426f8d7 100644 --- a/third-party/freertos/queue.c +++ b/third-party/freertos/queue.c @@ -925,7 +925,7 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue, const void * const pv BaseType_t xReturn; UBaseType_t uxSavedInterruptStatus; Queue_t * const pxQueue = ( Queue_t * ) xQueue; - + configASSERT( pxQueue ); configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) ); configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) ); diff --git a/third-party/letter-shell-3.1/Kconfig b/third-party/letter-shell-3.1/Kconfig index cce820581ec432d625516ad045358daabc3e5962..40fc48b26c27a20cbaa5fb1e4c5bf122d28e1d5d 100644 --- a/third-party/letter-shell-3.1/Kconfig +++ b/third-party/letter-shell-3.1/Kconfig @@ -10,5 +10,21 @@ menu "Letter Shell Configuration" select ENABLE_Pl011_UART bool "PL011" + if LS_PL011_UART + choice LETTER_SHELL_USE_UART_INSTANCE + prompt "Select Debug uart instance" + default DEFAULT_LETTER_SHELL_USE_UART1 + help + Select arch for build + config DEFAULT_LETTER_SHELL_USE_UART1 + bool "Use uart1" + config DEFAULT_LETTER_SHELL_USE_UART0 + bool "Use uart0" + config DEFAULT_LETTER_SHELL_USE_UART2 + bool "Use uart2" + endchoice # SHELL_USE_UART + + endif + endchoice # LETTER_SHELL_USART_TYPE endmenu \ No newline at end of file diff --git a/third-party/letter-shell-3.1/port/cmd/cmd_freertos_state.c b/third-party/letter-shell-3.1/port/cmd/cmd_freertos_state.c new file mode 100644 index 0000000000000000000000000000000000000000..dfafb7640baa1ed35ebe2f5da7b4a3ae04a59750 --- /dev/null +++ b/third-party/letter-shell-3.1/port/cmd/cmd_freertos_state.c @@ -0,0 +1,55 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: cmd_freertos_state.c + * Date: 2022-06-07 08:41:34 + * LastEditTime: 2022-06-07 08:41:34 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#include +#include "../src/shell.h" +#include "strto.h" +#include "FreeRTOS.h" +#include "task.h" +#include "string.h" + + +static int CpusTaskStat(int argc, char *argv[]) +{ + u8 CPU_RunInfo[400]; /*保存任务运行时间信息*/ + + memset(CPU_RunInfo,0,400); /*信息缓冲区清零*/ + vTaskList((char *)&CPU_RunInfo); /*获取任务运行时间信息*/ + + printf("---------------------------------------------\r\n"); + printf("task_name task_state priority stack task_num\r\n"); + printf("%s", CPU_RunInfo); + printf("---------------------------------------------\r\n"); + + memset(CPU_RunInfo, 0, 400); /*信息缓冲区清零*/ + + vTaskGetRunTimeStats((char *)&CPU_RunInfo); + + printf("task_name\trun_time_count\tusage_rate\r\n"); + printf("%s", CPU_RunInfo); + printf("---------------------------------------------\r\n\n"); + + return 0; +} + +SHELL_EXPORT_CMD(SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), state, CpusTaskStat, display freertos task stats); \ No newline at end of file diff --git a/third-party/letter-shell-3.1/port/pl011/fpl011_os_port.c b/third-party/letter-shell-3.1/port/pl011/fpl011_os_port.c index 8dddc71f260cfeaafc55d93daacb508ff7edc021..3ce23dd4fb050746a0bac28695268a098f71884c 100644 --- a/third-party/letter-shell-3.1/port/pl011/fpl011_os_port.c +++ b/third-party/letter-shell-3.1/port/pl011/fpl011_os_port.c @@ -31,6 +31,22 @@ FtFreertosUart os_uart1; extern Shell shell_object; +static char data[64]; + + +#ifdef CONFIG_DEFAULT_LETTER_SHELL_USE_UART1 +#define LETTER_SHELL_UART_ID UART1_ID +#endif + +#ifdef CONFIG_DEFAULT_LETTER_SHELL_USE_UART0 +#define LETTER_SHELL_UART_ID UART0_ID +#endif + +#ifdef CONFIG_DEFAULT_LETTER_SHELL_USE_UART2 +#define LETTER_SHELL_UART_ID UART2_ID +#endif + +extern void FtFreertosUartIntrInit(FtFreertosUart *uart_p); /** * @brief 用户shell写 @@ -59,8 +75,8 @@ signed char LSUserShellRead(char *data) void LSSerialConfig(void) { FtFreertosUartConfig config = { - .uart_instance = UART1_ID, /* select uart global object */ - .isr_priority = 0xd0, /* irq Priority */ + .uart_instance = LETTER_SHELL_UART_ID, /* select uart global object */ + .isr_priority = IRQ_PRIORITY_VALUE_13, /* irq Priority */ .isr_event_mask = (RTOS_UART_ISR_OEIM_MASK|RTOS_UART_ISR_BEIM_MASK|RTOS_UART_ISR_PEIM_MASK|RTOS_UART_ISR_FEIM_MASK|RTOS_UART_ISR_RTIM_MASK|RTOS_UART_ISR_RXIM_MASK) }; FtFreertosUartInit(&os_uart1,&config); @@ -68,12 +84,12 @@ void LSSerialConfig(void) void LSSerialWaitLoop(void) { - char data[64]; u32 recive_length = 0; u32 i = 0; + while (TRUE) { - FtFreertosUartReceiveBuffer(&os_uart1,data,sizeof(data),&recive_length); + FtFreertosUartReceiveBuffer(&os_uart1, data, sizeof(data), &recive_length); for (i = 0; i < recive_length; i++) { shellHandler(&shell_object, data[i]); diff --git a/third-party/letter-shell-3.1/port/shell_port.c b/third-party/letter-shell-3.1/port/shell_port.c index cc7268aaa4e9ba2e994b571e5cbd30b6367ada71..9285f511a20cab7fb53a7c65addb5d7f58f83466 100644 --- a/third-party/letter-shell-3.1/port/shell_port.c +++ b/third-party/letter-shell-3.1/port/shell_port.c @@ -39,13 +39,10 @@ extern signed char LSUserShellRead(char *data); extern void LSSerialConfig(); extern void LSSerialWaitLoop(); -/** - * @brief 用户shell初始化 - * - * Note: Call this function will lead to infinite create freertos task - */ -BaseType_t LSUserShellTask(void) + +void LSUserShellTaskCreate( void * args) { + BaseType_t ret; LSSerialConfig(); shell_object.write = LSUserShellWrite; @@ -53,12 +50,31 @@ BaseType_t LSUserShellTask(void) shellInit(&shell_object, shell_buffer, 4096); - return xTaskCreate((TaskFunction_t )LSSerialWaitLoop, /* 任务入口函数 */ + ret = xTaskCreate((TaskFunction_t )LSSerialWaitLoop, /* 任务入口函数 */ (const char* )"LSSerialWaitLoop",/* 任务名字 */ (uint16_t )1024, /* 任务栈大小 */ (void* )NULL,/* 任务入口函数参数 */ (UBaseType_t )2, /* 任务的优先级 */ NULL); /* 任务控制块指针 */ + + FASSERT_MSG(ret == pdPASS,"LSUserShellTask create is failed"); + + vTaskDelete(NULL); +} + +/** + * @brief 用户shell初始化 + * + * Note: Call this function will lead to infinite create freertos task + */ +BaseType_t LSUserShellTask(void) +{ + return xTaskCreate((TaskFunction_t )LSUserShellTaskCreate, /* 任务入口函数 */ + (const char* )"LSUserShellTaskCreate",/* 任务名字 */ + (uint16_t )1024, /* 任务栈大小 */ + (void* )NULL,/* 任务入口函数参数 */ + (UBaseType_t )2, /* 任务的优先级 */ + NULL); /* 任务控制块指针 */ } diff --git a/third-party/letter-shell-3.1/src/shell.c b/third-party/letter-shell-3.1/src/shell.c index 0be57292eedbdc2cc6380ad25fff46956ba08235..4217c670da9761cbdeb21be1c06c6fa29a5c07bf 100644 --- a/third-party/letter-shell-3.1/src/shell.c +++ b/third-party/letter-shell-3.1/src/shell.c @@ -86,10 +86,14 @@ enum #if defined(CONFIG_TARGET_F2000_4) #define SHELL_PLATFORM "FT2000/4 " -#elif defined(CONFIG_TARGET_D2000) +#elif defined(CONFIG_TARGET_D2000) #define SHELL_PLATFORM "D2000 " -#elif defined(CONFIG_TARGET_E2000) -#define SHELL_PLATFORM "E2000 " +#elif defined(CONFIG_TARGET_E2000Q) +#define SHELL_PLATFORM "E2000Q " +#elif defined(CONFIG_TARGET_E2000D) +#define SHELL_PLATFORM "E2000D " +#elif defined(CONFIG_TARGET_E2000S) +#define SHELL_PLATFORM "E2000S " #else #define SHELL_PLATFORM "Unkonwn " #endif diff --git a/third-party/lwip-2.1.2/Kconfig b/third-party/lwip-2.1.2/Kconfig index 936a7e74b8c4a14f8a438d54b15c88561899a1e3..3de97fbc4ff24a674fa835798ad5a0305a330b3a 100644 --- a/third-party/lwip-2.1.2/Kconfig +++ b/third-party/lwip-2.1.2/Kconfig @@ -1,14 +1,19 @@ menu "LWIP Configuration" choice LWIP_GMAC_CTRL_TYPE prompt "Gmac Drivers" - default LWIP_F_GMAC + default LWIP_FGMAC help Select Gmac Driver for Lwip - config LWIP_F_GMAC + config LWIP_FGMAC select USE_ETH select ENABLE_FGMAC - bool "F_GMAC" + bool "FGMAC" + + config LWIP_FXMAC + select USE_ETH + select ENABLE_FXMAC + bool "FXMAC" endchoice # LWIP_GMAC_CTRL_TYPE endmenu \ No newline at end of file diff --git a/third-party/lwip-2.1.2/core/netif.c b/third-party/lwip-2.1.2/core/netif.c index 15200a27409df70f6018fbb6f792cecfcf18b279..ff7ae0110f51447347da7e3ddb134da338bf29d5 100644 --- a/third-party/lwip-2.1.2/core/netif.c +++ b/third-party/lwip-2.1.2/core/netif.c @@ -480,6 +480,13 @@ netif_do_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr, ip_addr_t *ol netif_issue_reports(netif, NETIF_REPORT_TYPE_IPV4); + LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("netif: ip address of interface %c%c set to %" U16_F ".%" U16_F ".%" U16_F ".%" U16_F "\n", + netif->name[0], netif->name[1], + ip4_addr1_16(netif_ip_addr4(netif)), + ip4_addr2_16(netif_ip_addr4(netif)), + ip4_addr3_16(netif_ip_addr4(netif)), + ip4_addr4_16(netif_ip_addr4(netif)))); + NETIF_STATUS_CALLBACK(netif); return 1; /* address changed */ } diff --git a/third-party/lwip-2.1.2/ports/f_gmac/perf.h b/third-party/lwip-2.1.2/ports/f_gmac/perf.h deleted file mode 100644 index 326ac9e86ef93e76c5c6753bea2cb261ce9f029a..0000000000000000000000000000000000000000 --- a/third-party/lwip-2.1.2/ports/f_gmac/perf.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef LWIP_ARCH_PERF_H -#define LWIP_ARCH_PERF_H - -#include - -#ifdef PERF -#define PERF_START { \ - unsigned long __c1l, __c1h, __c2l, __c2h; \ - __asm__(".byte 0x0f, 0x31" : "=a" (__c1l), "=d" (__c1h)) -#define PERF_STOP(x) __asm__(".byte 0x0f, 0x31" : "=a" (__c2l), "=d" (__c2h)); \ - perf_print(__c1l, __c1h, __c2l, __c2h, x);} - -/*#define PERF_START do { \ - struct tms __perf_start, __perf_end; \ - times(&__perf_start) -#define PERF_STOP(x) times(&__perf_end); \ - perf_print_times(&__perf_start, &__perf_end, x);\ - } while(0)*/ -#else /* PERF */ -#define PERF_START /* null definition */ -#define PERF_STOP(x) /* null definition */ -#endif /* PERF */ - -void perf_print(unsigned long c1l, unsigned long c1h, - unsigned long c2l, unsigned long c2h, - char *key); - -void perf_print_times(struct tms *start, struct tms *end, char *key); - -void perf_init(char *fname); - -#endif /* LWIP_ARCH_PERF_H */ diff --git a/third-party/lwip-2.1.2/ports/f_gmac/arch/cc.h b/third-party/lwip-2.1.2/ports/fgmac/arch/cc.h similarity index 100% rename from third-party/lwip-2.1.2/ports/f_gmac/arch/cc.h rename to third-party/lwip-2.1.2/ports/fgmac/arch/cc.h diff --git a/third-party/lwip-2.1.2/ports/f_gmac/arch/sys_arch.h b/third-party/lwip-2.1.2/ports/fgmac/arch/sys_arch.h similarity index 71% rename from third-party/lwip-2.1.2/ports/f_gmac/arch/sys_arch.h rename to third-party/lwip-2.1.2/ports/fgmac/arch/sys_arch.h index 91e6b50ab2ff9e6fedcdac0c6782614d9dd5fb67..14234a341fe77cf6d581881385725b51e388a5fb 100644 --- a/third-party/lwip-2.1.2/ports/f_gmac/arch/sys_arch.h +++ b/third-party/lwip-2.1.2/ports/fgmac/arch/sys_arch.h @@ -1,11 +1,3 @@ -/* - * @Author: your name - * @Date: 2021-02-08 10:34:58 - * @LastEditTime: 2021-02-25 17:07:46 - * @LastEditors: Please set LastEditors - * @Description: In User Settings Edit - * @FilePath: \freertos\devices\ft2004\drivers\freertos\lwip\system\arch\sys_arch.h - */ /* * Copyright (c) 2001-2003 Swedish Institute of Computer Science. * All rights reserved. @@ -40,7 +32,6 @@ #ifndef __SYS_ARCH_H__ #define __SYS_ARCH_H__ -#include "lwip/opt.h" #if !NO_SYS @@ -58,23 +49,18 @@ extern "C" #define SYS_SEM_NULL (xSemaphoreHandle)0 #define SYS_DEFAULT_THREAD_STACK_DEPTH configMINIMAL_STACK_SIZE - typedef xSemaphoreHandle sys_sem_t; - typedef xSemaphoreHandle sys_mutex_t; - typedef xQueueHandle sys_mbox_t; - typedef xTaskHandle sys_thread_t; - - typedef struct _sys_arch_state_t - { - // Task creation data. - char cTaskName[configMAX_TASK_NAME_LEN]; - unsigned short nStackDepth; - unsigned short nTaskCount; - } sys_arch_state_t; +typedef xSemaphoreHandle sys_sem_t; +typedef xSemaphoreHandle sys_mutex_t; +typedef xQueueHandle sys_mbox_t; +typedef xTaskHandle sys_thread_t; -//extern sys_arch_state_t s_sys_arch_state; - -//void sys_set_default_state(); -//void sys_set_state(signed char *pTaskName, unsigned short nStackSize); +typedef struct _sys_arch_state_t +{ + // Task creation data. + char cTaskName[configMAX_TASK_NAME_LEN]; + unsigned short nStackDepth; + unsigned short nTaskCount; +} sys_arch_state_t; /* Message queue constants. */ #define archMAX_MESG_QUEUE_LENGTH (12) diff --git a/third-party/lwip-2.1.2/ports/f_gmac/ethernetif.c b/third-party/lwip-2.1.2/ports/fgmac/ethernetif.c similarity index 84% rename from third-party/lwip-2.1.2/ports/f_gmac/ethernetif.c rename to third-party/lwip-2.1.2/ports/fgmac/ethernetif.c index c78c7fca071a4673bc1d1d20f60795d0bff7ca50..27bdfe954bac8b13418d986a9e7a40ba03c6d0da 100644 --- a/third-party/lwip-2.1.2/ports/f_gmac/ethernetif.c +++ b/third-party/lwip-2.1.2/ports/fgmac/ethernetif.c @@ -64,56 +64,20 @@ /* The time to block waiting for input. */ #define TIME_WAITING_FOR_INPUT (portMAX_DELAY) -/* Stack size of the interface thread */ -#define INTERFACE_THREAD_STACK_SIZE (350) - -/* Define those to better describe your network interface. */ -#define IFNAME0 's' -#define IFNAME1 't' - #define ETHNETIF_DEBUG_TAG "ETHNETIF" #define ETHNETIF_DEBUG_I(format, ...) FT_DEBUG_PRINT_I(ETHNETIF_DEBUG_TAG, format, ##__VA_ARGS__) #define ETHNETIF_DEBUG_E(format, ...) FT_DEBUG_PRINT_E(ETHNETIF_DEBUG_TAG, format, ##__VA_ARGS__) #define ETHNETIF_DEBUG_W(format, ...) FT_DEBUG_PRINT_W(ETHNETIF_DEBUG_TAG, format, ##__VA_ARGS__) -extern FError FGmacWritePhyReg(FGmacPhy *instance_p, u16 phy_reg, u32 phy_reg_val); -extern FError FGmacReadPhyReg(FGmacPhy *instance_p, u16 phy_reg, u32 *phy_reg_val_p); - /** * Helper struct to hold private data used to operate your ethernet interface. * Keeping the ethernet address of the MAC in this struct is not necessary * as it is already kept in the struct netif. * But this is only an example, anyway... */ -struct ethernetif { - struct eth_addr *ethaddr; - FGmac *ethctrl; -}; - -static FGmac gctrl; /* huge size ctrl block */ -static FGmacPhy phy; - -static struct ethernetif netifctrl; -/* align buf and descriptor by 128 */ -static u8 tx_buf[GMAC_TX_DESCNUM * GMAC_MAX_PACKET_SIZE] __aligned(GMAC_DMA_MIN_ALIGN); -static u8 rx_buf[GMAC_RX_DESCNUM * GMAC_MAX_PACKET_SIZE] __aligned(GMAC_DMA_MIN_ALIGN); -static FGmacDmaDesc tx_desc[GMAC_TX_DESCNUM] __aligned(GMAC_DMA_MIN_ALIGN); -static FGmacDmaDesc rx_desc[GMAC_RX_DESCNUM] __aligned(GMAC_DMA_MIN_ALIGN); - -/** - * @name: eth_ctrl_init - * @msg: config gmac and initialization - * @return {*} - * @param {FGmac} *pctrl - */ -u32 eth_ctrl_init(FGmac *pctrl) -{ - LWIP_ASSERT("pctrl != NULL", (pctrl != NULL)); - u32 ret = FGMAC_SUCCESS; - return ret; -} +static netif_config netif_config_instance[GMAC_INSTANCE_NUM]; void ethernet_link_thread(void *argument) { @@ -210,40 +174,58 @@ void GmacStatusCheckCallBack(void *args, u32 mac_phy_status) * @param netif the already initialized lwip network interface structure * for this ethernetif */ -static void low_level_init(struct netif *netif) +static err_t low_level_init(struct netif *netif) { - u32 reg_value = 0; LWIP_ASSERT("netif != NULL", (netif != NULL)); - u32 ret = FGMAC_SUCCESS; - FGmacMacAddr mac_addr; - FGmac *p_ctrl; + FGmacMacAddr mac_addr; + FGmac *gmac_ctrl; FtOsGmac *os_gmac_ptr; + u16 reg_value = 0; os_gmac_ptr = container_of(netif, FtOsGmac, netif_object); + gmac_ctrl = &os_gmac_ptr->gmac; - p_ctrl = &os_gmac_ptr->gmac; - - /* Init Gmac */ - FtOsGmacInit(os_gmac_ptr, &phy); + ethernetif *ethernetif_p = (ethernetif *)(netif->state); - /* Set Receive Callback */ - FGmacRegisterEvtHandler(p_ctrl, FGMAC_RX_COMPLETE_EVT, GmacReceiveCallBack); + netif_config *netif_config_p = container_of(ethernetif_p, netif_config, netifctrl); + + /* Create a binary semaphore used for informing ethernetif of frame reception */ + FASSERT((os_gmac_ptr->s_semaphore = xSemaphoreCreateBinary()) != NULL); + /* Create a event group used for ethernetif of status change */ + FASSERT((os_gmac_ptr->s_status_event = xEventGroupCreate()) != NULL); + + /* Init Gmac */ + FError ret = FtOsGmacInit(os_gmac_ptr, netif_config_p); + if(ret != FGMAC_SUCCESS) + { + if(ret == FGMAC_ERR_PHY_AUTO_FAILED) + { + ETHNETIF_DEBUG_E("FtOsGmacInit is failed, phy auto negotiation is not success."); + } + else + { + ETHNETIF_DEBUG_E("FtOsGmacInit is failed"); + return ERR_CONN; + } + } + + /* Set Receive Callback */ + FGmacRegisterEvtHandler(gmac_ctrl, FGMAC_RX_COMPLETE_EVT, GmacReceiveCallBack); #if LWIP_ARP || LWIP_ETHERNET /* set MAC hardware address length */ netif->hwaddr_len = ETH_HWADDR_LEN; + + for(u8 i = 0; i<(sizeof(mac_addr)/sizeof(mac_addr[0])); i++) + { + mac_addr[i] = netif->hwaddr[i]; + } /* set MAC hardware address */ - memset(mac_addr, 0, sizeof(mac_addr)); - FGmacGetMacAddr(os_gmac_ptr->gmac.config.base_addr, mac_addr); - - /* set MAC hardware address */ - netif->hwaddr[0] = mac_addr[0]; - netif->hwaddr[1] = mac_addr[1]; - netif->hwaddr[2] = mac_addr[2]; - netif->hwaddr[3] = mac_addr[3]; - netif->hwaddr[4] = mac_addr[4]; - netif->hwaddr[5] = mac_addr[5]; + FGmacSetMacAddr(gmac_ctrl->config.base_addr, mac_addr); + + /* clear rgmii interrupt due to phy reset */ + reg_value = FGMAC_READ_REG32(gmac_ctrl->config.base_addr, FGMAC_MAC_PHY_STATUS); /* maximum transfer unit */ netif->mtu = GMAC_MTU; @@ -251,39 +233,35 @@ static void low_level_init(struct netif *netif) /* Accept broadcast address and ARP traffic */ /* don't set NETIF_FLAG_ETHARP if this device is not an ethernet one */ #if LWIP_ARP - netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP; + netif->flags |= NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP; #else - netif->flags |= NETIF_FLAG_BROADCAST; + netif->flags |= NETIF_FLAG_BROADCAST; #endif /* LWIP_ARP */ - /* Create the task that handles the ETH_MAC */ - if (xTaskCreate((TaskFunction_t)ethernetif_input, - os_gmac_ptr->config.mac_input_thread.thread_name, - os_gmac_ptr->config.mac_input_thread.stack_depth, - os_gmac_ptr, os_gmac_ptr->config.mac_input_thread.priority, - &os_gmac_ptr->config.mac_input_thread.thread_handle) != pdPASS) - { - ETHNETIF_DEBUG_I("xTaskCreate is Error %s\r\n", os_gmac_ptr->config.mac_input_thread.thread_name); - FASSERT(0); + /* Create the task that handles the ETH_MAC */ + if (xTaskCreate((TaskFunction_t)ethernetif_input, + os_gmac_ptr->config.mac_input_thread.thread_name, + os_gmac_ptr->config.mac_input_thread.stack_depth, + os_gmac_ptr, os_gmac_ptr->config.mac_input_thread.priority, + &os_gmac_ptr->config.mac_input_thread.thread_handle) != pdPASS) + { + ETHNETIF_DEBUG_I("xTaskCreate is Error %s\r\n", os_gmac_ptr->config.mac_input_thread.thread_name); + FASSERT(0); } - /* Enable MAC and DMA transmission and reception */ - FtOsGmacStart(os_gmac_ptr); - + /* Enable MAC and DMA transmission and reception */ + FtOsGmacStart(os_gmac_ptr); + /* Read Register Configuration */ - FGmacReadPhyReg(&phy, PHY_INTERRUPT_ENABLE_OFFSET, ®_value); + FGmacReadPhyReg(gmac_ctrl, gmac_ctrl->phy_addr, PHY_INTERRUPT_ENABLE_OFFSET, ®_value); reg_value |= (PHY_INTERRUPT_ENABLE_LINK_FAIL); /* Enable Interrupt on change of link status */ - FGmacWritePhyReg(&phy, PHY_INTERRUPT_ENABLE_OFFSET, reg_value); + FGmacWritePhyReg(gmac_ctrl, gmac_ctrl->phy_addr, PHY_INTERRUPT_ENABLE_OFFSET, reg_value); - /* Read Register Configuration */ - FGmacReadPhyReg(&phy, PHY_INTERRUPT_ENABLE_OFFSET, ®_value); - #endif /* LWIP_ARP || LWIP_ETHERNET */ - LWIP_DEBUGF(NETIF_DEBUG, ("init success\n")); - return; + return ERR_OK; } /** @@ -379,24 +357,32 @@ static err_t low_level_output(struct netif *netif, struct pbuf *p) ETHNETIF_DEBUG_I(" error Buffer is 0 \r\n"); return ERR_VAL; } - } + } /* Copy the remaining bytes */ memcpy((u8 *)((u8 *)buffer + buffer_offset), (u8 *)((u8 *)q->payload + pay_load_offset), bytes_left_to_copy); buffer_offset = buffer_offset + bytes_left_to_copy; frame_length = frame_length + bytes_left_to_copy; FGMAC_DMA_INC_DESC(gmac->tx_ring.desc_buf_idx, gmac->tx_ring.desc_max_num); + } #if ETH_PAD_SIZE pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */ #endif - FGmacSendFrame(gmac, frame_length); + FError ret = FGmacSendFrame(gmac, frame_length); + + if (ret != FGMAC_SUCCESS) + { + errval = ERR_USE; + ETHNETIF_DEBUG_I("error errval = ERR_USE; FGmacSendFrame\r\n"); + goto error; + } error: FGmacResmuDmaUnderflow(gmac->config.base_addr); - + return errval; } @@ -439,7 +425,6 @@ static struct pbuf *low_level_input(struct netif *netif) length = (gmac->rx_desc[desc_buffer_index].status & FGMAC_DMA_RDES0_FRAME_LEN_MASK) >> FGMAC_DMA_RDES0_FRAME_LEN_SHIFT; buffer = (u8 *)(intptr)(gmac->rx_desc[desc_buffer_index].buf_addr); - #if ETH_PAD_SIZE length += ETH_PAD_SIZE; /* allow room for Ethernet padding */ #endif @@ -448,7 +433,6 @@ static struct pbuf *low_level_input(struct netif *netif) { /* We allocate a pbuf chain of pbufs from the Lwip buffer pool */ p = pbuf_alloc(PBUF_RAW, length, PBUF_POOL); - } #ifdef RAW_DATA_PRINT @@ -510,8 +494,9 @@ static struct pbuf *low_level_input(struct netif *netif) /* Sync index */ gmac->rx_ring.desc_buf_idx = gmac->rx_ring.desc_idx; - + FGmacResumeDmaRecv(gmac->config.base_addr); + return p; } @@ -533,10 +518,8 @@ void ethernetif_input(void const *argument) for (;;) { - if (xSemaphoreTake(os_gmac_ptr->s_semaphore, TIME_WAITING_FOR_INPUT) == pdTRUE) { - do { LOCK_TCPIP_CORE(); @@ -549,19 +532,11 @@ void ethernetif_input(void const *argument) } } UNLOCK_TCPIP_CORE(); - } while (p != NULL); + } while (p != NULL); } } } - -static void arp_timer(void *arg) -{ - (void)arg; - etharp_tmr(); - sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL); -} - #if !LWIP_ARP /** * This function has to be completed by user in case of ARP OFF. @@ -594,9 +569,11 @@ static err_t low_level_output_arp_off(struct netif *netif, struct pbuf *q, const err_t ethernetif_init(struct netif *netif) { LWIP_ASSERT("netif != NULL", (netif != NULL)); + err_t ret = ERR_OK; + u32 gmac_id = (u32)(uintptr)netif->state; - memset(&netifctrl, 0, sizeof(netifctrl)); - + memset(&netif_config_instance[gmac_id], 0, sizeof(netif_config_instance[gmac_id])); + printf("&netif_config_instance[gmac_id] = %#x\n", &netif_config_instance[gmac_id]); LWIP_DEBUGF(NETIF_DEBUG, ("*******start init eth\n")); #if LWIP_NETIF_HOSTNAME @@ -604,9 +581,8 @@ err_t ethernetif_init(struct netif *netif) netif->hostname = "lwip"; #endif /* LWIP_NETIF_HOSTNAME */ - netif->state = &netifctrl; // 通过state将ethernetif结构传递到上层 - netif->name[0] = IFNAME0; - netif->name[1] = IFNAME1; + netif->state = &netif_config_instance[gmac_id].netifctrl; // 通过state将ethernetif结构传递到上层 + /* We directly use etharp_output() here to save a function call. * You can instead declare your own function an call etharp_output() * from it if you have to do some checks before sending (e.g. if link @@ -628,23 +604,11 @@ err_t ethernetif_init(struct netif *netif) #endif /* LWIP_IPV6 */ netif->linkoutput = low_level_output; - /* initialize the hardware */ - netifctrl.ethctrl = &gctrl; - low_level_init(netif); - netifctrl.ethaddr = (struct eth_addr *) &(netif->hwaddr[0]); - return ERR_OK; -} + /* initialize the hardware */ + ret = low_level_init(netif); -/** -* @brief Returns the current time in milliseconds -* when LWIP_TIMERS == 1 and NO_SYS == 1 -* @param None -* @retval Time -*/ -u32_t sys_jiffies(void) -{ - return GenericGetTick(); + return ret; } /** @@ -653,7 +617,7 @@ u32_t sys_jiffies(void) * @param None * @retval Time */ -u32_t sys_now(void) +u32_t sys_jiffies(void) { return GenericGetTick(); } diff --git a/third-party/lwip-2.1.2/ports/f_gmac/ethernetif.h b/third-party/lwip-2.1.2/ports/fgmac/ethernetif.h similarity index 61% rename from third-party/lwip-2.1.2/ports/f_gmac/ethernetif.h rename to third-party/lwip-2.1.2/ports/fgmac/ethernetif.h index 5a28d28ed8ffc62f5a76fd268e01ab89292da7ad..f6fb15ae24eb07540e10fbaa43dbab111f717910 100644 --- a/third-party/lwip-2.1.2/ports/f_gmac/ethernetif.h +++ b/third-party/lwip-2.1.2/ports/fgmac/ethernetif.h @@ -26,9 +26,30 @@ #include "lwip/err.h" #include "lwip/netif.h" +#include "fgmac.h" +#include "parameters.h" +#include "sdkconfig.h" + +#define GMAC_RX_DESCNUM CONFIG_GMAC_RX_DESCNUM +#define GMAC_TX_DESCNUM CONFIG_GMAC_TX_DESCNUM + +typedef struct { + struct eth_addr *ethaddr; + FGmac *ethctrl; +}ethernetif; + +typedef struct +{ + FGmac gctrl; + ethernetif netifctrl; + /* align buf and descriptor by 128 */ + u8 tx_buf[GMAC_TX_DESCNUM * GMAC_MAX_PACKET_SIZE] __aligned(GMAC_DMA_MIN_ALIGN); + u8 rx_buf[GMAC_RX_DESCNUM * GMAC_MAX_PACKET_SIZE] __aligned(GMAC_DMA_MIN_ALIGN); + u8 tx_desc[GMAC_TX_DESCNUM * sizeof(FGmacDmaDesc)] __aligned(GMAC_DMA_MIN_ALIGN); + u8 rx_desc[GMAC_RX_DESCNUM * sizeof(FGmacDmaDesc) + 128] __aligned(GMAC_DMA_MIN_ALIGN); +}netif_config; err_t ethernetif_init(struct netif *netif); void ethernetif_input(void const *argument); -void ethernetif_notify_conn_changed(struct netif *netif); #endif \ No newline at end of file diff --git a/third-party/lwip-2.1.2/ports/f_gmac/ft_os_gmac.c b/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.c similarity index 72% rename from third-party/lwip-2.1.2/ports/f_gmac/ft_os_gmac.c rename to third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.c index 25f0cc75b702608eb87f5297e94520122181de09..ef0b9fedc3d2acaabfa89e6c45614038e63746e4 100644 --- a/third-party/lwip-2.1.2/ports/f_gmac/ft_os_gmac.c +++ b/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.c @@ -27,19 +27,19 @@ #include #include #include - #include "ft_os_gmac.h" #include "fgmac.h" #include "ft_assert.h" #include "ft_io.h" #include "ft_assert.h" -#include "gicv3.h" #include "interrupt.h" #include "list.h" +#include "cpu_info.h" #include "ft_debug.h" #define OS_MAC_DEBUG_TAG "OS_MAC" +#define OS_MAC_DEBUG_D(format, ...) FT_DEBUG_PRINT_D(OS_MAC_DEBUG_TAG, format, ##__VA_ARGS__) #define OS_MAC_DEBUG_I(format, ...) FT_DEBUG_PRINT_I(OS_MAC_DEBUG_TAG, format, ##__VA_ARGS__) #define OS_MAC_DEBUG_E(format, ...) FT_DEBUG_PRINT_E(OS_MAC_DEBUG_TAG, format, ##__VA_ARGS__) #define OS_MAC_DEBUG_W(format, ...) FT_DEBUG_PRINT_W(OS_MAC_DEBUG_TAG, format, ##__VA_ARGS__) @@ -47,6 +47,7 @@ #define FT_OS_GMACOBJECT_READLY 0x58 static boolean rx_data_flag = FALSE; +static FGmacConfig gmac_config; static void EthLinkPhyStatusChecker(void *param) { @@ -54,10 +55,11 @@ static void EthLinkPhyStatusChecker(void *param) FGmac *instance_p = (FGmac *)param; uintptr base_addr = instance_p->config.base_addr; - u32 phy_status = FGMAC_READ_REG32(base_addr, FGMAC_MAC_PHY_STATUS); + u32 status = FGMAC_READ_REG32(base_addr, FGMAC_MAC_PHY_STATUS); - if (FGMAC_RGSMIIIS_LNKSTS_UP == (FGMAC_RGSMIIIS_LNKSTS & phy_status)) + if (FGMAC_RGSMIIIS_LNKSTS_UP == (FGMAC_RGSMIIIS_LNKSTS & status)) { + FGmacPhyCfgInitialize(instance_p); OS_MAC_DEBUG_I("link is up"); } else @@ -162,11 +164,8 @@ void EthLinkStatusChecker(void *param) } else { - OS_MAC_DEBUG_I("link is down"); + OS_MAC_DEBUG_I("link is down ---"); } - - (void)speed; - (void)duplex; } static void EthLinkRecvDoneCallback(void *param) @@ -200,11 +199,23 @@ int FtOsGmacSetupInterrupt(FGmac *instance_p) FGmacConfig *config_p = &instance_p->config; uintptr base_addr = config_p->base_addr; u32 irq_num = config_p->irq_num; - u32 irq_priority = (0x8 << 4) + 4 * 16; + u32 cpu_id; + + u32 irq_priority = (config_p->irq_prority); + + if(irq_priority < (configMAX_API_CALL_INTERRUPT_PRIORITY)) + { + OS_MAC_DEBUG_E("gmac irq priority is not applicable, you need set value below configMAX_API_CALL_INTERRUPT_PRIORITY!!!"); + FASSERT(0); + } + + /* gic initialize */ + GetCpuId(&cpu_id); + InterruptSetTargetCpus(irq_num, cpu_id); /* disable all gmac & dma intr */ - FGmacSetInterruptMask(instance_p, FGMAC_CTRL_INTR, FGMAC_ISR_MASK_ALL_BITS, FALSE); - FGmacSetInterruptMask(instance_p, FGMAC_DMA_INTR, FGMAC_DMA_INTR_ENA_ALL_MASK, FALSE); + FGmacSetInterruptMask(instance_p, FGMAC_CTRL_INTR, FGMAC_ISR_MASK_ALL_BITS); + FGmacSetInterruptMask(instance_p, FGMAC_DMA_INTR, FGMAC_DMA_INTR_ENA_ALL_MASK); InterruptSetPriority(irq_num, irq_priority); InterruptInstall(irq_num, FGmacInterruptHandler, instance_p, "GMAC-IRQ"); @@ -219,9 +230,9 @@ int FtOsGmacSetupInterrupt(FGmac *instance_p) InterruptUmask(irq_num); /* enable some interrupts */ - FGmacSetInterruptMask(instance_p, FGMAC_CTRL_INTR, FGMAC_ISR_MASK_RSIM, TRUE); - FGmacSetInterruptMask(instance_p, FGMAC_DMA_INTR, FGMAC_DMA_INTR_ENA_NIE | FGMAC_DMA_INTR_ENA_RIE\ - /*FGMAC_DMA_INTR_ENA_ALL_MASK*/, TRUE); + FGmacSetInterruptUmask(instance_p, FGMAC_CTRL_INTR, FGMAC_ISR_MASK_RSIM); + FGmacSetInterruptUmask(instance_p, FGMAC_DMA_INTR, + FGMAC_DMA_INTR_ENA_NIE | FGMAC_DMA_INTR_ENA_RIE | FGMAC_DMA_INTR_ENA_AIE); OS_MAC_DEBUG_I("gmac setup done"); return 0; @@ -235,36 +246,32 @@ int FtOsGmacSetupInterrupt(FGmac *instance_p) * @return {*} */ -static u8 rx_buf[GMAC_RX_DESCNUM * GMAC_MAX_PACKET_SIZE] __attribute__((aligned(32))); -static u8 tx_buf[GMAC_TX_DESCNUM * GMAC_MAX_PACKET_SIZE] __attribute__((aligned(32))); -static u8 tx_desc[GMAC_TX_DESCNUM * sizeof(FGmacDmaDesc)] __attribute__((aligned(128))); -static u8 rx_desc[GMAC_RX_DESCNUM * sizeof(FGmacDmaDesc) + 128] __attribute__((aligned(128))); - -static void FtOsGmacMemCreate(FtOsGmac *os_gmac) +static void FtOsGmacMemCreate(FtOsGmac *os_gmac, netif_config *netif_config_p) { FASSERT(os_gmac != NULL); - os_gmac->rx_buffer = rx_buf; + + os_gmac->rx_buffer = netif_config_p->rx_buf; if (os_gmac->rx_buffer == NULL) { OS_MAC_DEBUG_E("Rxbuffer Malloc is error "); FASSERT(0); } - os_gmac->tx_buffer = tx_buf; + os_gmac->tx_buffer = netif_config_p->tx_buf; if (os_gmac->tx_buffer == NULL) { OS_MAC_DEBUG_E("Txbuffer Malloc is error "); FASSERT(0); } - os_gmac->gmac.tx_desc = (FGmacDmaDesc *)tx_desc; + os_gmac->gmac.tx_desc = (FGmacDmaDesc *)netif_config_p->tx_desc; if (os_gmac->gmac.tx_desc == NULL) { OS_MAC_DEBUG_E("tx_desc Malloc is error "); FASSERT(0); } - os_gmac->gmac.rx_desc = (FGmacDmaDesc *)rx_desc; + os_gmac->gmac.rx_desc = (FGmacDmaDesc *)netif_config_p->rx_desc; if (os_gmac->gmac.rx_desc == NULL) { OS_MAC_DEBUG_E("rx_desc Malloc is error "); @@ -325,30 +332,57 @@ void FtOsGmacObjectInit(FtOsGmac *os_gmac, FtOsGmacConfig *config) * @return {*} */ -void FtOsGmacInit(FtOsGmac *os_gmac, FGmacPhy *phy_p) +FError FtOsGmacInit(FtOsGmac *os_gmac, netif_config *netif_config_p) { - FASSERT(os_gmac != NULL); - FASSERT(phy_p != NULL); - FASSERT((os_gmac->is_ready == FT_OS_GMACOBJECT_READLY)); - + FASSERT(os_gmac->is_ready == FT_OS_GMACOBJECT_READLY); + const FGmacConfig *def_config_p = NULL; FGmac *gmac; + FError ret = FGMAC_SUCCESS; gmac = &os_gmac->gmac; + FtOsGmacMemFree(os_gmac); - - FASSERT(FGmacCfgInitialize(gmac, FGmacLookupConfig(gmac->config.instance_id)) == FT_SUCCESS); - FtOsGmacMemCreate(os_gmac); + memset(gmac, 0U, sizeof(FGmac)); + def_config_p = FGmacLookupConfig(os_gmac->config.gmac_instance); + if(NULL == def_config_p) + { + OS_MAC_DEBUG_E("gmac lookup cfg failed "); + return FGMAC_ERR_FAILED; + } + + gmac_config = *def_config_p; + gmac_config.speed = FGMAC_PHY_SPEED_1000; + gmac_config.mdc_clk_hz = FGMAC_PHY_MII_ADDR_CR_250_300MHZ; + gmac_config.en_auto_negtiation = TRUE; + gmac_config.duplex_mode = FGMAC_PHY_MODE_FULLDUPLEX; + +#ifdef CONFIG_GMAC_IRQ_PRIORITY + gmac_config.irq_prority = CONFIG_GMAC_IRQ_PRIORITY; +#else + gmac_config.irq_prority = IRQ_PRIORITY_VALUE_12; +#endif + + /* initialize gmac */ + ret = FGmacCfgInitialize(gmac, &gmac_config); + if(FGMAC_SUCCESS != ret) + { + OS_MAC_DEBUG_E("gmac cfg init failed "); + os_gmac->is_ready = 0; + return FGMAC_ERR_FAILED; + } + + FtOsGmacMemCreate(os_gmac, netif_config_p); /* initialize phy */ - memset(phy_p, 0U, sizeof(FGmacPhy)); - FGmacPhyLookupConfig(gmac->config.instance_id, phy_p); - FASSERT(FGmacPhyCfgInitialize(phy_p) == FT_SUCCESS); - - /* Create a binary semaphore used for informing ethernetif of frame reception */ - FASSERT((os_gmac->s_semaphore = xSemaphoreCreateBinary()) != NULL); - /* Create a event group used for ethernetif of status change */ - FASSERT((os_gmac->s_status_event = xEventGroupCreate()) != NULL); + ret = FGmacPhyCfgInitialize(gmac); + if(FGMAC_SUCCESS != ret) + { + OS_MAC_DEBUG_E("gmac phy cfg init failed "); + return FGMAC_ERR_PHY_AUTO_FAILED; + } + + return ret; } /** @@ -366,18 +400,22 @@ void FtOsGmacStart(FtOsGmac *os_gmac) FGmac *gmac; gmac = &os_gmac->gmac; u32 ret = FT_SUCCESS; - + + /* Initialize Rx Description list : ring Mode */ + ret = FGmacSetupRxDescRing(gmac, (FGmacDmaDesc *)(gmac->rx_desc), os_gmac->rx_buffer, GMAC_MAX_PACKET_SIZE, GMAC_RX_DESCNUM); if (FT_SUCCESS != ret) { - OS_MAC_DEBUG_E("gmac return err code %d\r\n", ret); + OS_MAC_DEBUG_E("gmac setup rx return err code %d\r\n", ret); FASSERT(FT_SUCCESS == ret); } - /* Initialize Rx Description list : ring Mode */ - FGmacSetupRxDescRing(gmac, (FGmacDmaDesc *)(gmac->rx_desc), os_gmac->rx_buffer, GMAC_MAX_PACKET_SIZE, GMAC_RX_DESCNUM); - /* Initialize Tx Description list : ring Mode */ - FGmacSetupTxDescRing(gmac, (FGmacDmaDesc *)(gmac->tx_desc), os_gmac->tx_buffer, GMAC_MAX_PACKET_SIZE, GMAC_TX_DESCNUM); + ret = FGmacSetupTxDescRing(gmac, (FGmacDmaDesc *)(gmac->tx_desc), os_gmac->tx_buffer, GMAC_MAX_PACKET_SIZE, GMAC_TX_DESCNUM); + if (FT_SUCCESS != ret) + { + OS_MAC_DEBUG_E("gmac setup tx return err code %d\r\n", ret); + FASSERT(FT_SUCCESS == ret); + } /* enable gmac */ FGmacStartTrans(gmac); @@ -395,4 +433,13 @@ void FtOsGmacStop(FtOsGmac *os_gmac) FASSERT(os_gmac != NULL); FASSERT((os_gmac->is_ready == FT_OS_GMACOBJECT_READLY)); gmac = &os_gmac->gmac; + + /* disable all gmac & dma intr */ + FGmacSetInterruptMask(gmac, FGMAC_CTRL_INTR, FGMAC_ISR_MASK_ALL_BITS); + FGmacSetInterruptMask(gmac, FGMAC_DMA_INTR, FGMAC_DMA_INTR_ENA_ALL_MASK); + + /* umask intr */ + InterruptMask(gmac->config.irq_num); + + FGmacStopTrans(gmac); } diff --git a/third-party/lwip-2.1.2/ports/f_gmac/ft_os_gmac.h b/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.h similarity index 89% rename from third-party/lwip-2.1.2/ports/f_gmac/ft_os_gmac.h rename to third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.h index 866a9326122c94b68e56785112dd2f8a26c42a87..e555f3ea4c8f1a8403ca1e1aa73cc75a23a50c71 100644 --- a/third-party/lwip-2.1.2/ports/f_gmac/ft_os_gmac.h +++ b/third-party/lwip-2.1.2/ports/fgmac/ft_os_gmac.h @@ -34,6 +34,7 @@ #include "fgmac_phy.h" #include "parameters.h" #include "lwip/netif.h" +#include "ethernetif.h" #define FT_OS_GMAC0_ID GMAC_INSTANCE_0 #define FT_OS_GMAC1_ID GMAC_INSTANCE_1 @@ -45,20 +46,19 @@ * @{ */ -#define GMAC_RX_DESCNUM 1024U -#define GMAC_TX_DESCNUM 1024U + #define GMAC_MTU 1500U /* Common PHY Registers (AR8035) */ #define PHY_INTERRUPT_ENABLE_OFFSET ((u16)0x12) -#define PHY_INTERRUPT_ENABLE_LINK_FAIL 0x00000800U /* Link fail interrupt, 0 Interrupt disable , 1 Interrupt enable */ +#define PHY_INTERRUPT_ENABLE_LINK_FAIL BIT(11) /* Link fail interrupt, 0 Interrupt disable , 1 Interrupt enable */ struct Ipv4Address { - u8 Ip_Address[4]; - u8 Netmask_Address[4]; - u8 GateWay_Address[4]; + u8 ip_address[4]; + u8 netmask_address[4]; + u8 gateWay_address[4]; }; struct GmacThread @@ -89,8 +89,10 @@ typedef struct SemaphoreHandle_t s_semaphore; /* Semaphore to signal incoming packets */ EventGroupHandle_t s_status_event; /* Event Group to show netif's status ,follow FT_NETIF_XX*/ } FtOsGmac; + + void FtOsGmacObjectInit(FtOsGmac *os_gmac, FtOsGmacConfig *config); -void FtOsGmacInit(FtOsGmac *os_gmac, FGmacPhy *phy_p); +FError FtOsGmacInit(FtOsGmac *os_gmac, netif_config *netif_config_p); void FtOsGmacStart(FtOsGmac *os_gmac); void FtOsGmacStop(FtOsGmac *os_gmac); int FtOsGmacSetupInterrupt(FGmac *instance_p); diff --git a/third-party/lwip-2.1.2/ports/f_gmac/lwipopts.h b/third-party/lwip-2.1.2/ports/fgmac/lwipopts.h similarity index 74% rename from third-party/lwip-2.1.2/ports/f_gmac/lwipopts.h rename to third-party/lwip-2.1.2/ports/fgmac/lwipopts.h index 350b42f1d3b7fe5f25f7b970aea77e45cf294073..84a2431e904d55022ca700f14e0fba1c0a432ad2 100644 --- a/third-party/lwip-2.1.2/ports/f_gmac/lwipopts.h +++ b/third-party/lwip-2.1.2/ports/fgmac/lwipopts.h @@ -32,14 +32,43 @@ #ifndef LWIP_LWIPOPTS_H #define LWIP_LWIPOPTS_H +#include "sdkconfig.h" +#ifndef SDK_CONFIG_H__ + #warning "Please include sdkconfig.h" +#endif + #include "arch/sys_arch.h" -#ifdef LWIP_OPTTEST_FILE -#include "lwipopts_test.h" -#else /* LWIP_OPTTEST_FILE */ +#ifdef CONFIG_LWIP_IPV4_TEST +#define LWIP_IPV4 1 +#define LWIP_IPV6 0 +#define LWIP_IPV6_MLD 0 +/* ---------- DHCP options ---------- */ +/* Define LWIP_DHCP to 1 if you want DHCP configuration of + interfaces. */ +#define LWIP_DHCP 0 +#endif + +#ifdef CONFIG_LWIP_IPV4_DHCP_TEST #define LWIP_IPV4 1 #define LWIP_IPV6 0 +#define LWIP_IPV6_MLD 0 +/* ---------- DHCP options ---------- */ +/* Define LWIP_DHCP to 1 if you want DHCP configuration of + interfaces. */ +#define LWIP_DHCP 1 +#endif + +#ifdef CONFIG_LWIP_IPV6_TEST +#define LWIP_IPV4 0 +#define LWIP_IPV6 1 +#define LWIP_IPV6_MLD 0 +/* ---------- DHCP options ---------- */ +/* Define LWIP_DHCP to 1 if you want DHCP configuration of + interfaces. */ +#define LWIP_DHCP 0 +#endif #define NO_SYS 0 /* 无操作系统模拟层, 只提供RAW CALL */ #define LWIP_SOCKET (NO_SYS==0) @@ -49,36 +78,23 @@ #define LWIP_IGMP LWIP_IPV4 #define LWIP_ICMP LWIP_IPV4 -#define LWIP_SNMP LWIP_UDP -#define MIB2_STATS LWIP_SNMP -#ifdef LWIP_HAVE_MBEDTLS -#define LWIP_SNMP_V3 (LWIP_SNMP) -#endif - -#define LWIP_DNS LWIP_UDP -#define LWIP_MDNS_RESPONDER LWIP_UDP - -#define LWIP_NUM_NETIF_CLIENT_DATA (LWIP_MDNS_RESPONDER) - -#define LWIP_HAVE_LOOPIF 0 -#define LWIP_NETIF_LOOPBACK 1 -#define LWIP_LOOPBACK_MAX_PBUFS 10 #define TCP_LISTEN_BACKLOG 1 -#define LWIP_COMPAT_SOCKETS 1 #define LWIP_SO_RCVTIMEO 1 #define LWIP_SO_RCVBUF 1 #define LWIP_TCPIP_CORE_LOCKING 1 #define LWIP_NETIF_LINK_CALLBACK 0 //支持来自接口的回调函数 -#define LWIP_NETIF_STATUS_CALLBACK 0 -#define LWIP_NETIF_EXT_STATUS_CALLBACK 0 +#define LWIP_NETIF_STATUS_CALLBACK 1 +#define LWIP_NETIF_EXT_STATUS_CALLBACK 1 -#ifdef LWIP_DEBUG +#ifndef LWIP_DEBUG +#define LWIP_DEBUG //打印调试信息 +#endif -#define LWIP_DBG_MIN_LEVEL 0 +#ifdef LWIP_DEBUG #define PPP_DEBUG LWIP_DBG_OFF #define MEM_DEBUG LWIP_DBG_OFF #define MEMP_DEBUG LWIP_DBG_OFF @@ -86,11 +102,9 @@ #define API_LIB_DEBUG LWIP_DBG_OFF #define API_MSG_DEBUG LWIP_DBG_OFF #define TCPIP_DEBUG LWIP_DBG_OFF -#define NETIF_DEBUG LWIP_DBG_OFF #define SOCKETS_DEBUG LWIP_DBG_OFF #define DNS_DEBUG LWIP_DBG_OFF #define AUTOIP_DEBUG LWIP_DBG_OFF -#define DHCP_DEBUG LWIP_DBG_OFF #define IP_DEBUG LWIP_DBG_OFF #define IP_REASS_DEBUG LWIP_DBG_OFF #define ICMP_DEBUG LWIP_DBG_OFF @@ -108,6 +122,7 @@ #endif #define NETIF_DEBUG LWIP_DBG_ON +#define DHCP_DEBUG LWIP_DBG_ON /* ---------- Memory options ---------- */ /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which @@ -156,7 +171,6 @@ a lot of data that needs to be copied, this should be set high. */ #define MEMP_NUM_TCPIP_MSG_API 16 #define MEMP_NUM_TCPIP_MSG_INPKT 16 - /* ---------- Pbuf options ---------- */ /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ #define PBUF_POOL_SIZE 400 /* pbuf tests need ~200KByte */ @@ -171,23 +185,11 @@ a lot of data that needs to be copied, this should be set high. */ */ #define SYS_LIGHTWEIGHT_PROT (NO_SYS==0) //0, 不提供缓冲区分配释放的保护 -/** -* NO_SYS_NO_TIMERS==1: 无操作系统定时器 -* -*/ -#define NO_SYS_NO_TIMERS 0 //提供操作系统定时 - - /* ---------- TCP options ---------- */ #define LWIP_TCP 1 #define TCP_TTL 255 #define LWIP_ALTCP (LWIP_TCP) -#ifdef LWIP_HAVE_MBEDTLS -#define LWIP_ALTCP_TLS (LWIP_TCP) -#define LWIP_ALTCP_TLS_MBEDTLS (LWIP_TCP) -#endif - /* Controls if TCP should queue segments that arrive out of order. Define to 0 if your device is low on memory. */ @@ -217,19 +219,6 @@ a lot of data that needs to be copied, this should be set high. */ /* Maximum number of retransmissions of SYN segments. */ #define TCP_SYNMAXRTX 4 - -/* ---------- ARP options ---------- */ -#define LWIP_ARP 1 -#define ARP_TABLE_SIZE 10 -#define ARP_QUEUEING 1 - - -/* ---------- IP options ---------- */ -/* Define IP_FORWARD to 1 if you wish to have the ability to forward - IP packets across network interfaces. If you are going to run lwIP - on a device with only one network interface, define this to 0. */ -#define IP_FORWARD 1 - /* IP reassembly and segmentation.These are orthogonal even * if they both deal with IP fragments */ #define IP_REASSEMBLY 1 @@ -238,93 +227,33 @@ a lot of data that needs to be copied, this should be set high. */ #define IP_FRAG 1 #define IPV6_FRAG_COPYHEADER 1 -/* ---------- ICMP options ---------- */ -#define ICMP_TTL 255 - - -/* ---------- DHCP options ---------- */ -/* Define LWIP_DHCP to 1 if you want DHCP configuration of - interfaces. */ -#define LWIP_DHCP LWIP_UDP - /* 1 if you want to do an ARP check on the offered address (recommended). */ #define DHCP_DOES_ARP_CHECK (LWIP_DHCP) - /* ---------- AUTOIP options ------- */ #define LWIP_AUTOIP (LWIP_DHCP) #define LWIP_DHCP_AUTOIP_COOP (LWIP_DHCP && LWIP_AUTOIP) - /* ---------- UDP options ---------- */ #define LWIP_UDP 1 #define LWIP_UDPLITE LWIP_UDP -#define UDP_TTL 255 - - -/* ---------- RAW options ---------- */ -#define LWIP_RAW 1 +#define LWIP_SNMP LWIP_UDP +#define MIB2_STATS LWIP_SNMP -/* ---------- Statistics options ---------- */ +#define LWIP_DNS LWIP_UDP +#define LWIP_MDNS_RESPONDER LWIP_UDP -#define LWIP_STATS 1 -#define LWIP_STATS_DISPLAY 1 +#define LWIP_NUM_NETIF_CLIENT_DATA (LWIP_MDNS_RESPONDER) -#if LWIP_STATS -#define LINK_STATS 1 -#define IP_STATS 1 -#define ICMP_STATS 1 -#define IGMP_STATS 1 -#define IPFRAG_STATS 1 -#define UDP_STATS 1 -#define TCP_STATS 1 -#define MEM_STATS 1 -#define MEMP_STATS 1 -#define PBUF_STATS 1 -#define SYS_STATS 1 +/* ---------- RAW options ---------- */ +#define LWIP_RAW 1 #define LWIP_PROVIDE_ERRNO 1 //使用errno -#endif /* LWIP_STATS */ - -#ifndef LWIP_DEBUG -#define LWIP_DEBUG //打印调试信息 -#endif - -/* ---------- NETBIOS options ---------- */ -#define LWIP_NETBIOS_RESPOND_NAME_QUERY 1 - -/* ---------- PPP options ---------- */ - -#define PPP_SUPPORT 0 /* Set > 0 for PPP */ - -#if PPP_SUPPORT - -#define NUM_PPP 1 /* Max PPP sessions. */ -/* Select modules to enable. Ideally these would be set in the makefile but - * we're limited by the command line length so you need to modify the settings - * in this file. - */ -#define PPPOE_SUPPORT 1 -#define PPPOS_SUPPORT 1 - -#define PAP_SUPPORT 1 /* Set > 0 for PAP. */ -#define CHAP_SUPPORT 1 /* Set > 0 for CHAP. */ -#define MSCHAP_SUPPORT 0 /* Set > 0 for MSCHAP */ -#define CBCP_SUPPORT 0 /* Set > 0 for CBCP (NOT FUNCTIONAL!) */ -#define CCP_SUPPORT 0 /* Set > 0 for CCP */ -#define VJ_SUPPORT 1 /* Set > 0 for VJ header compression. */ -#define MD5_SUPPORT 1 /* Set > 0 for MD5 (see also CHAP) */ - -#endif /* PPP_SUPPORT */ - -#endif /* LWIP_OPTTEST_FILE */ - /* The following defines must be done even in OPTTEST mode: */ - #if !defined(NO_SYS) || !NO_SYS /* default is 0 */ void sys_check_core_locking(void); #define LWIP_ASSERT_CORE_LOCKED() //sys_check_core_locking() @@ -334,9 +263,7 @@ void sys_mark_tcpip_thread(void); #if !defined(LWIP_TCPIP_CORE_LOCKING) || LWIP_TCPIP_CORE_LOCKING /* default is 1 */ /** The global semaphore to lock the stack. */ extern sys_mutex_t lock_tcpip_core; - #define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core)//sys_lock_tcpip_core() - #define UNLOCK_TCPIP_CORE() sys_mutex_unlock(&lock_tcpip_core)//sys_unlock_tcpip_core() #endif #endif diff --git a/third-party/lwip-2.1.2/ports/f_gmac/sys_arch.c b/third-party/lwip-2.1.2/ports/fgmac/sys_arch.c similarity index 99% rename from third-party/lwip-2.1.2/ports/f_gmac/sys_arch.c rename to third-party/lwip-2.1.2/ports/fgmac/sys_arch.c index 59b1a86d10f6824ebbe6f95115abaec9ac7af91b..ddac7b626c7a8db9b839ad80d44eaffed3c15e75 100644 --- a/third-party/lwip-2.1.2/ports/f_gmac/sys_arch.c +++ b/third-party/lwip-2.1.2/ports/fgmac/sys_arch.c @@ -1,5 +1,3 @@ - - /* lwIP includes. */ #include "lwip/debug.h" #include "lwip/def.h" diff --git a/third-party/lwip-2.1.2/ports/fxmac/arch/cc.h b/third-party/lwip-2.1.2/ports/fxmac/arch/cc.h new file mode 100644 index 0000000000000000000000000000000000000000..5003882ccbe500ae099788a97f37eb7de3dc16d0 --- /dev/null +++ b/third-party/lwip-2.1.2/ports/fxmac/arch/cc.h @@ -0,0 +1,111 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: cc.h + * Date: 2022-04-02 16:43:32 + * LastEditTime: 2022-04-19 21:27:57 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ +#ifndef LWIP_ARCH_CC_H +#define LWIP_ARCH_CC_H + +#if defined __ANDROID__ +#define LWIP_UNIX_ANDROID +#elif defined __linux__ +#define LWIP_UNIX_LINUX +#elif defined __APPLE__ +#define LWIP_UNIX_MACH +#elif defined __OpenBSD__ +#define LWIP_UNIX_OPENBSD +#elif defined __CYGWIN__ +#define LWIP_UNIX_CYGWIN +#elif defined __GNU__ +#define LWIP_UNIX_HURD +#endif + +#define LWIP_NO_STDINT_H 1 //not include "stdint.h" + +/* define basic types */ +#include + +typedef uint8_t u8_t; // unsigned 8-bit +typedef signed char s8_t; // signed 8-bit +typedef uint16_t u16_t; // unsigned 16-bit +typedef short s16_t; // signed 16-bit +typedef uint32_t u32_t; // unsigned 32-bit +typedef long s32_t; // signed 32-bit +typedef uint64_t u64_t; // unsigned 64-bit +#if defined(__aarch64__) +typedef u64_t mem_ptr_t; +#else +typedef u32_t mem_ptr_t; +#endif + +/* define printf format */ +#define U16_F "hu" +#define S16_F "d" +#define X16_F "hx" +#define U32_F "u" +#define S32_F "d" +#define X32_F "x" +#if defined(__aarch64__) +#define SZT_F "luz" +#else +#define SZT_F "uz" +#endif + +#ifndef BYTE_ORDER +#define BYTE_ORDER LITTLE_ENDIAN +#endif + +#define LWIP_TIMEVAL_PRIVATE 0 +#include + +#define LWIP_ERRNO_INCLUDE + +#if defined(LWIP_UNIX_LINUX) || defined(LWIP_UNIX_HURD) +#define LWIP_ERRNO_STDINCLUDE 1 +#endif + +#define LWIP_RAND() ((u32_t)rand()) + +/* different handling for unit test, normally not needed */ +#ifdef LWIP_NOASSERT_ON_ERROR +#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ + handler;}} while(0) +#endif + +#if defined(LWIP_UNIX_ANDROID) && defined(FD_SET) +typedef __kernel_fd_set fd_set; +#endif + +#if defined(LWIP_UNIX_MACH) +/* sys/types.h and signal.h bring in Darwin byte order macros. pull the + header here and disable LwIP's version so that apps still can get + the macros via LwIP headers and use system headers */ +#include +#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS +#endif + +struct sio_status_s; +typedef struct sio_status_s sio_status_t; +#define sio_fd_t sio_status_t* +#define __sio_fd_t_defined + +typedef unsigned int sys_prot_t; + +#endif /* LWIP_ARCH_CC_H */ diff --git a/third-party/lwip-2.1.2/ports/fxmac/arch/sys_arch_raw.c b/third-party/lwip-2.1.2/ports/fxmac/arch/sys_arch_raw.c new file mode 100644 index 0000000000000000000000000000000000000000..e89c1aff693c9227c639cb4cdebf590bf3060679 --- /dev/null +++ b/third-party/lwip-2.1.2/ports/fxmac/arch/sys_arch_raw.c @@ -0,0 +1,65 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: sys_arch_raw.c + * Date: 2022-04-02 16:43:32 + * LastEditTime: 2022-04-19 21:56:22 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#include "arch/cc.h" +#include "lwip/sys.h" + +#ifdef __aarch64__ +#include "aarch64.h" +#else +#include "cp15.h" +#endif + +/* + * This optional function does a "fast" critical region protection and returns + * the previous protection level. This function is only called during very short + * critical regions. An embedded system which supports ISR-based drivers might + * want to implement this function by disabling interrupts. Task-based systems + * might want to implement this by using a mutex or disabling tasking. This + * function should support recursive calls from the same task or interrupt. In + * other words, sys_arch_protect() could be called while already protected. In + * that case the return value indicates that it is already protected. + * sys_arch_protect() is only required if your port is supporting an operating + * system. + */ +sys_prot_t sys_arch_protect() +{ + sys_prot_t cur; + + cur = MFCPSR(); + MTCPSR(cur | 0xC0); + + return cur; +} + +/* + * This optional function does a "fast" set of critical region protection to the + * value specified by pval. See the documentation for sys_arch_protect() for + * more information. This function is only required if your port is supporting + * an operating system. + */ +void +sys_arch_unprotect(sys_prot_t lev) +{ + MTCPSR(lev); +} diff --git a/third-party/lwip-2.1.2/ports/fxmac/ethernetif.c b/third-party/lwip-2.1.2/ports/fxmac/ethernetif.c new file mode 100644 index 0000000000000000000000000000000000000000..f030534a9fb083b15bd845946b228dedd24df643 --- /dev/null +++ b/third-party/lwip-2.1.2/ports/fxmac/ethernetif.c @@ -0,0 +1,437 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: ethernetif.c + * Date: 2022-04-02 16:43:32 + * LastEditTime: 2022-04-19 21:27:57 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#include +#include + +#include "lwipopts.h" +#include "lwip/opt.h" +#include "lwip/def.h" +#include "lwip/mem.h" +#include "lwip/pbuf.h" +#include "lwip/sys.h" +#include "lwip/stats.h" +#include "lwip/igmp.h" +#include "netif/etharp.h" +#include "ethernetif.h" +#include "lwip_port.h" +#include "ethernetif_queue.h" +#include "fxmac.h" + +#if LWIP_IPV6 +#include "lwip/ethip6.h" +#endif + +/* Define those to better describe your network interface. */ +#define IFNAME0 't' +#define IFNAME1 'e' + +FXmacConfig *mac_config; +struct netif *NetIf; + +#if defined(OS_IS_FREERTOS) && defined(__arm__) && !defined(ARMR5) +int32_t lExpireCounter = 0; +#define RESETRXTIMEOUT 10 +#endif + +/* + * this function is always called with interrupts off + * this function also assumes that there are available BD's + */ +static err_t unbuffered_low_level_output(ethernetif *ethernetif_p, struct pbuf *p) +{ + FError status = 0; + +#if ETH_PAD_SIZE + pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */ +#endif + status = xmac_sgsend(ethernetif_p, p); + if (status != FT_SUCCESS) + { +#if LINK_STATS + lwip_stats.link.drop++; +#endif + } + +#if ETH_PAD_SIZE + pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */ +#endif + +#if LINK_STATS + lwip_stats.link.xmit++; +#endif /* LINK_STATS */ + + return ERR_OK; +} + +/* + * low_level_output(): + * + * Should do the actual transmission of the packet. The packet is + * contained in the pbuf that is passed to the function. This pbuf + * might be chained. + * + */ +static err_t low_level_output(struct netif *netif, struct pbuf *p) +{ + SYS_ARCH_DECL_PROTECT(lev); + err_t err; + u32 freecnt; + FXmacBdRing *txring; + + struct xmac_netif *xmac_netif_p = (struct xmac_netif *)(netif->state); + ethernetif *ethernetif_p = (ethernetif *)(xmac_netif_p->state); + + SYS_ARCH_PROTECT(lev); + + /* check if space is available to send */ + freecnt = is_tx_space_available(ethernetif_p); + if (freecnt <= 5) + { + txring = &(FXMAC_GET_TXRING(ethernetif_p->xmac_ctrl)); + xmac_process_sent_bds(ethernetif_p, txring); + } + + if (is_tx_space_available(ethernetif_p)) + { + unbuffered_low_level_output(ethernetif_p, p); + err = ERR_OK; + } + else + { +#if LINK_STATS + lwip_stats.link.drop++; +#endif + f_printk("pack dropped, no space\r\n"); + err = ERR_MEM; + } + + SYS_ARCH_UNPROTECT(lev); + return err; +} + +/* + * low_level_input(): + * + * Should allocate a pbuf and transfer the bytes of the incoming + * packet from the interface into the pbuf. + * + */ +static struct pbuf *low_level_input(struct netif *netif) +{ + struct xmac_netif *xmac_netif_p = (struct xmac_netif *)(netif->state); + ethernetif *ethernetif_p = (ethernetif *)(xmac_netif_p->state); + struct pbuf *p; + + f_printk("pq_qlength(ethernetif_p->recv_q)=%d\n", xmac_pq_qlength(ethernetif_p->recv_q)); + /* see if there is data to process */ + if (xmac_pq_qlength(ethernetif_p->recv_q) == 0) + return NULL; + + /* return one packet from receive q */ + p = (struct pbuf *)xmac_pq_dequeue(ethernetif_p->recv_q); + return p; +} + +/* + * ethernetif_output(): + * + * This function is called by the TCP/IP stack when an IP packet + * should be sent. It calls the function called low_level_output() to + * do the actual transmission of the packet. + * + */ + +static err_t ethernetif_output(struct netif *netif, struct pbuf *p, + const ip_addr_t *ipaddr) +{ + /* resolve hardware address, then send (or queue) packet */ + return etharp_output(netif, p, ipaddr); +} + +/* + * ethernetif_input(): + * + * This function should be called when a packet is ready to be read + * from the interface. It uses the function low_level_input() that + * should handle the actual reception of bytes from the network + * interface. + * + * Returns the number of packets read (max 1 packet on success, + * 0 if there are no packets) + * + */ + +void ethernetif_input(struct netif *netif) +{ + struct eth_hdr *ethhdr; + struct pbuf *p; + SYS_ARCH_DECL_PROTECT(lev); + +#ifdef OS_IS_FREERTOS + while (1) +#endif + { + /* move received packet into a new pbuf */ + SYS_ARCH_PROTECT(lev); + p = low_level_input(netif); + SYS_ARCH_UNPROTECT(lev); + + /* no packet could be read, silently ignore this */ + if (p == NULL) + { + return; + } + + /* points to packet payload, which starts with an Ethernet header */ + ethhdr = p->payload; + +#if LINK_STATS + lwip_stats.link.recv++; +#endif /* LINK_STATS */ + + switch (htons(ethhdr->type)) + { + /* IP or ARP packet? */ + case ETHTYPE_IP: + case ETHTYPE_ARP: +#if LWIP_IPV6 + /*IPv6 Packet?*/ + case ETHTYPE_IPV6: +#endif +#if PPPOE_SUPPORT + /* PPPoE packet? */ + case ETHTYPE_PPPOEDISC: + case ETHTYPE_PPPOE: +#endif /* PPPOE_SUPPORT */ + /* full packet send to tcpip_thread to process */ + if (netif->input(p, netif) != ERR_OK) + { + LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\r\n")); + pbuf_free(p); + p = NULL; + } + break; + + default: + pbuf_free(p); + p = NULL; + break; + } + } + + return; +} + +#if defined(OS_IS_FREERTOS) && defined(__arm__) && !defined(ARMR5) +void vTimerCallback(TimerHandle_t pxTimer) +{ + /* Do something if the pxTimer parameter is NULL */ + configASSERT(pxTimer); + + lExpireCounter++; + /* If the timer has expired 100 times then reset RX */ + if (lExpireCounter >= RESETRXTIMEOUT) + { + lExpireCounter = 0; + ethernetif_resetrx_on_no_rxdata(NetIf); + } +} +#endif + +static err_t low_level_init(struct netif *netif) +{ + uintptr mac_address = (uintptr)(netif->state); + struct xmac_netif *xmac_netif_p; + ethernetif *ethernetif_p; + u32 dmacrreg; + s32_t status = FT_SUCCESS; + NetIf = netif; + + ethernetif_p = mem_malloc(sizeof *ethernetif_p); + if (ethernetif_p == NULL) + { + LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_p_init: out of memory\r\n")); + return ERR_MEM; + } + + xmac_netif_p = mem_malloc(sizeof *xmac_netif_p); + if (xmac_netif_p == NULL) + { + LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_p_init: out of memory\r\n")); + return ERR_MEM; + } + + xmac_netif_p->state = (void *)ethernetif_p; + ethernetif_p->send_q = NULL; + ethernetif_p->recv_q = xmac_pq_create_queue(); + if (!ethernetif_p->recv_q) + return ERR_MEM; + + /* maximum transfer unit */ +#ifdef XMAC_USE_JUMBO + netif->mtu = FXMAC_MTU_JUMBO - FXMAC_HDR_SIZE; +#else + netif->mtu = FXMAC_MTU - FXMAC_HDR_SIZE; +#endif + + netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | + NETIF_FLAG_LINK_UP; + +#if !NO_SYS + sys_sem_new(&xmac_netif_p->sem_rx_data_available, 0); +#endif + /* obtain config of this emac */ + mac_config = (FXmacConfig *)FXmacLookupConfig((unsigned)(uintptr)netif->state); + + status = FXmacCfgInitialize(ðernetif_p->xmac_ctrl, mac_config); + if (status != FT_SUCCESS) + { + f_printk("In %s:EmacPs Configuration Failed....\r\n", __func__); + } + + /* initialize the mac */ + xmac_init(ethernetif_p, netif); + + dmacrreg = FXMAC_READREG32(ethernetif_p->xmac_ctrl.config.base_address, FXMAC_DMACR_OFFSET); + dmacrreg = dmacrreg | (0x00000010); + FXMAC_WRITEREG32(ethernetif_p->xmac_ctrl.config.base_address, FXMAC_DMACR_OFFSET, dmacrreg); + +#if defined(OS_IS_FREERTOS) && defined(__arm__) && !defined(ARMR5) + /* Freertos tick is 10ms by default; set period to the same */ + xmac_netif_p->xTimer = xTimerCreate("Timer", 10, pdTRUE, (void *)1, vTimerCallback); + if (xmac_netif_p->xTimer == NULL) + { + f_printk("In %s:Timer creation failed....\r\n", __func__); + } + else + { + if (xTimerStart(xmac_netif_p->xTimer, 0) != pdPASS) + { + f_printk("In %s:Timer start failed....\r\n", __func__); + } + } +#endif + xmac_setup_isr(xmac_netif_p); + init_dma(xmac_netif_p); + xmac_start(ethernetif_p); + + /* replace the state in netif (currently the emac baseaddress) + * with the mac instance pointer. + */ + netif->state = (void *)xmac_netif_p; + + return ERR_OK; +} + +void xmac_handle_dma_tx_error(struct xmac_netif *xmac_netif_p) +{ + ethernetif *ethernetif_p; + s32_t status = FT_SUCCESS; + u32 dmacrreg; + + SYS_ARCH_DECL_PROTECT(lev); + SYS_ARCH_PROTECT(lev); + + ethernetif_p = (ethernetif *)(xmac_netif_p->state); + free_txrx_pbufs(ethernetif_p); + status = FXmacCfgInitialize(ðernetif_p->xmac_ctrl, mac_config); + + if (status != FT_SUCCESS) + { + f_printk("In %s:EmacPs Configuration Failed....\r\n", __func__); + } + + /* initialize the mac */ + xmac_init_on_error(ethernetif_p, NetIf); + dmacrreg = FXMAC_READREG32(ethernetif_p->xmac_ctrl.config.base_address, FXMAC_DMACR_OFFSET); + dmacrreg = dmacrreg | (0x01000000); /* force_discard_on_err */ + FXMAC_WRITEREG32(ethernetif_p->xmac_ctrl.config.base_address, FXMAC_DMACR_OFFSET, dmacrreg); + xmac_setup_isr(xmac_netif_p); + init_dma(xmac_netif_p); + xmac_start(ethernetif_p); + + SYS_ARCH_UNPROTECT(lev); +} + +void xmac_handle_tx_errors(struct xmac_netif *xmac_netif_p) +{ + ethernetif *ethernetif_p; + u32 netctrlreg; + + SYS_ARCH_DECL_PROTECT(lev); + SYS_ARCH_PROTECT(lev); + ethernetif_p = (ethernetif *)(xmac_netif_p->state); + netctrlreg = FXMAC_READREG32(ethernetif_p->xmac_ctrl.config.base_address, + FXMAC_NWCTRL_OFFSET); + netctrlreg = netctrlreg & (~FXMAC_NWCTRL_TXEN_MASK); + FXMAC_WRITEREG32(ethernetif_p->xmac_ctrl.config.base_address, + FXMAC_NWCTRL_OFFSET, netctrlreg); + free_onlytx_pbufs(ethernetif_p); + + clean_dma_txdescs(xmac_netif_p); + netctrlreg = FXMAC_READREG32(ethernetif_p->xmac_ctrl.config.base_address, FXMAC_NWCTRL_OFFSET); + netctrlreg = netctrlreg | (FXMAC_NWCTRL_TXEN_MASK); + FXMAC_WRITEREG32(ethernetif_p->xmac_ctrl.config.base_address, FXMAC_NWCTRL_OFFSET, netctrlreg); + SYS_ARCH_UNPROTECT(lev); +} + +/* + * ethernetif_init(): + * + * Should be called at the beginning of the program to set up the + * network interface. It calls the function low_level_init() to do the + * actual setup of the hardware. + * + */ + +err_t ethernetif_init(struct netif *netif) +{ +#if LWIP_SNMP + /* ifType ethernetCsmacd(6) @see RFC1213 */ + netif->link_type = 6; + /* your link speed here */ + netif->link_speed = ; + netif->ts = 0; + netif->ifinoctets = 0; + netif->ifinucastpkts = 0; + netif->ifinnucastpkts = 0; + netif->ifindiscards = 0; + netif->ifoutoctets = 0; + netif->ifoutucastpkts = 0; + netif->ifoutnucastpkts = 0; + netif->ifoutdiscards = 0; +#endif + + netif->name[0] = IFNAME0; + netif->name[1] = IFNAME1; + netif->output = ethernetif_output; + netif->linkoutput = low_level_output; +#if LWIP_IPV6 + netif->output_ip6 = ethip6_output; +#endif + + low_level_init(netif); + return ERR_OK; +} + diff --git a/third-party/lwip-2.1.2/ports/fxmac/ethernetif.h b/third-party/lwip-2.1.2/ports/fxmac/ethernetif.h new file mode 100644 index 0000000000000000000000000000000000000000..ec684b935692dad7fdc54f4dabd00b0309e46aea --- /dev/null +++ b/third-party/lwip-2.1.2/ports/fxmac/ethernetif.h @@ -0,0 +1,99 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: ethernetif.h + * Date: 2022-04-02 16:43:32 + * LastEditTime: 2022-04-19 21:27:57 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#ifndef __ETHERNETIF_H__ +#define __ETHERNETIF_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lwip/netif.h" +#include "netif/etharp.h" +#include "lwip/sys.h" +#include "lwip_port.h" +#include "f_printk.h" +#include "fxmac.h" +#include "ethernetif_queue.h" +#include "arch/cc.h" + +#if defined (ARMR5) || (__aarch64__) || (ARMA53_32) || (__MICROBLAZE__) +#if defined (USE_JUMBO_FRAMES) +#define XMAC_USE_JUMBO +#endif +#endif + +#define MAX_FRAME_SIZE_JUMBO (FXMAC_MTU_JUMBO + FXMAC_HDR_SIZE + FXMAC_TRL_SIZE) + +void ethernetif_setmac(u32_t index, u8_t *addr); +u8_t* ethernetif_getmac(u32_t index); +err_t ethernetif_init(struct netif *netif); +void ethernetif_input(struct netif *netif); + +/* ethernetif_hw.c */ +void ethernetif_error_handler(FXmac * Temac); + +/* structure within each netif, encapsulating all information required for + * using a particular xmac instance + */ +typedef struct { + FXmac xmac_ctrl; + + /* queue to store overflow packets */ + pq_queue_t *recv_q; + pq_queue_t *send_q; + + /* pointers to memory holding buffer descriptors (used only with SDMA) */ + void *rx_bdspace; + void *tx_bdspace; + + unsigned int last_rx_frms_cntr; + +} ethernetif; + +u32 is_tx_space_available(ethernetif *emac); + +void xmac_process_sent_bds(ethernetif *ethernetif_p, FXmacBdRing *txring); +void xmac_send_handler(void *arg); +FError xmac_sgsend(ethernetif *ethernetif_p, struct pbuf *p); +void xmac_recv_handler(void *arg); +void xmac_error_handler(void *arg, u8 Direction, u32 ErrorWord); +void setup_rx_bds(ethernetif *ethernetif_p, FXmacBdRing *rxring); +void xmac_handle_tx_errors(struct xmac_netif *xmac_netif_p); +void xmac_handle_dma_tx_error(struct xmac_netif *xmac_netif_p); +void xmac_init(ethernetif *ethernetif_p, struct netif *netif); +void xmac_setup_isr (struct xmac_netif *xmac_netif_p); +FError init_dma(struct xmac_netif *xmac_netif_p); +void xmac_start (ethernetif *ethernetif_p); +void free_txrx_pbufs(ethernetif *ethernetif_p); +void free_onlytx_pbufs(ethernetif *ethernetif_p); +void xmac_init_on_error (ethernetif *ethernetif_p, struct netif *netif); +void clean_dma_txdescs(struct xmac_netif *xmac_netif_p); +void resetrx_on_no_rxdata(ethernetif *ethernetif_p); +void reset_dma(struct xmac_netif *xmac_netif_p); + +#ifdef __cplusplus +} +#endif + +#endif /* __ETHERNETIF_H__ */ diff --git a/third-party/lwip-2.1.2/ports/fxmac/ethernetif_dma.c b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_dma.c new file mode 100644 index 0000000000000000000000000000000000000000..062dbda481537e9c2fe669e16071cb8eb9f6aae7 --- /dev/null +++ b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_dma.c @@ -0,0 +1,756 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: ethernetif_dma.c + * Date: 2022-04-02 16:43:32 + * LastEditTime: 2022-04-19 21:27:57 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#include "lwipopts.h" +#include "lwip/stats.h" +#include "lwip/sys.h" +#include "lwip/inet_chksum.h" +#include "ethernetif.h" + +#include "ft_types.h" +#include "fxmac.h" +#include "parameters.h" +#include "lwip_port.h" +#include "interrupt.h" +#include "fxmac_bd.h" +#include "f_printk.h" +#include "cache.h" + +#ifdef __aarch64__ +#include "aarch64.h" +#else +#include "cp15.h" +#endif + +#ifdef OS_IS_FREERTOS +#include "FreeRTOS.h" +#include "semphr.h" +#include "timers.h" +#endif + +#define XMAC_LWIP_CONFIG_N_TX_DESC 64 +#define XMAC_LWIP_CONFIG_N_RX_DESC 64 + +/* Byte alignment of BDs */ +#define BD_ALIGNMENT (FXMAC_DMABD_MINIMUM_ALIGNMENT*2) + +/* A max of 4 different ethernet interfaces are supported */ +static uintptr tx_pbufs_storage[4*XMAC_LWIP_CONFIG_N_TX_DESC]; +static uintptr rx_pbufs_storage[4*XMAC_LWIP_CONFIG_N_RX_DESC]; + +static u32 xmac_intr_num; + +/****************************************************************************** + * Each BD is of 8 bytes of size and the BDs (BD chain) need to be put + * at uncached memory location. If they are not put at uncached + * locations, the user needs to flush or invalidate for each BD/packet. + * However, the flush or invalidate can happen over a cache line which can + * span multiple BDs. This means a flush or invalidate of one BD can actually + * flush/invalidate multiple BDs adjacent to the targeted BD.Assuming that + * the user and hardware both update the BD fields, this operation from user + * can potentially overwrite the updates done by hardware or user. + * To avoid this, it is always safe to put the BD chains for Rx and tx side + * at uncached memory location. + * + * The standalone BSP for Cortex A9 implements only primary page tables. + * Each table entry corresponds to 1 MB of address map. This means, if a memory + * region has to be made uncached, the minimum granularity will be of 1 MB. + * + * The implementation below allocates a 1 MB of u8 array aligned to 1 MB. + * This ensures that this array is put at 1 MB aligned memory (e.g. 0x1200000) + * and accupies memory of 1 MB. The init_dma function then changes 1 MB of this + * region to make it uncached (strongly ordered). + * This increases the bss section of the program significantly and can be a + * wastage of memory. The reason beings, BDs will hardly occupy few KBs of + * memory and the rest of 1 MB of memory will be unused. + * + * If a program uses other peripherals that have DMAs/bus masters and need + * uncached memory, they may also end of following the same approach. This + * definitely aggravates the memory wastage issue. To avoid all this, the user + * can create a new 1 MB section in the linker script and reserve it for such + * use cases that need uncached memory location. They can then have their own + * memory allocation logic in their application that allocates uncached memory + * from this 1 MB location. For such a case, changes need to be done in this + * file and appropriate uncached memory allocated through other means can be + * used. + * + * The present implementation here allocates 1 MB of uncached memory. It + * reserves of 64 KB of memory for each BD chain. 64 KB of memory means 8192 of + * BDs for each BD chain which is more than enough for any application. + * Assuming that both emac0 and emac1 are present, 256 KB of memory is allocated + * for BDs. The rest 768 KB of memory is just unused. + *********************************************************************************/ + +#if defined __aarch64__ +u8 bd_space[0x200000] __attribute__ ((aligned (0x200000))); +#else +u8 bd_space[0x100000] __attribute__ ((aligned (0x100000))); +#endif +static volatile u32 bd_space_index = 0; +static volatile u32 bd_space_attr_set = 0; + +#ifdef OS_IS_FREERTOS +long xInsideISR = 0; +#endif + +#define FXMAC_BD_TO_INDEX(ringptr, bdptr) \ + (((uintptr)bdptr - (uintptr)(ringptr)->base_bd_addr) / (ringptr)->separation) + +/** + * @name: + * @msg: 获取当前bdring 剩余计数 + * @return {*} + * @param {ethernetif} *ethernetif_p + */ +u32 is_tx_space_available(ethernetif *ethernetif_p) +{ + FXmacBdRing *txring; + u32 freecnt = 0; + + txring = &(FXMAC_GET_TXRING(ethernetif_p->xmac_ctrl)); + + /* tx space is available as long as there are valid BD's */ + freecnt = FXmacBdRingGetFreeCnt(txring); + return freecnt; +} + + +/** + * @name: + * @msg: 获取当前用于存放lwip queue 结构体的指针地址,深度为XMAC_LWIP_CONFIG_N_TX_DESC + * @return {*} + * @param {ethernetif} *ethernetif_p + */ +static inline u32 get_base_index_tx_buf(ethernetif *ethernetif_p) +{ + return ethernetif_p->xmac_ctrl.config.instance_id *XMAC_LWIP_CONFIG_N_TX_DESC; +} + +static inline u32 get_base_index_rx_buf(ethernetif *ethernetif_p) +{ + return ethernetif_p->xmac_ctrl.config.instance_id * XMAC_LWIP_CONFIG_N_RX_DESC; +} + +/** + * @name: + * @msg: 释放发送队列q参数 + * @return {*} + * @param {ethernetif} *ethernetif_p + * @param {FXmacBdRing} *txring + */ +void xmac_process_sent_bds(ethernetif *ethernetif_p, FXmacBdRing *txring) +{ + FXmacBd *txbdset; + FXmacBd *curbdpntr; + u32 n_bds; + FError status; + u32 n_pbufs_freed = 0; + u32 bdindex; + struct pbuf *p; + u32 *temp; + u32 index; + + index = get_base_index_tx_buf(ethernetif_p); + + while (1) + { + /* obtain processed BD's */ + n_bds = FXmacBdRingFromHwTx(txring, XMAC_LWIP_CONFIG_N_TX_DESC, &txbdset); + if (n_bds == 0) + { + return; + } + /* free the processed BD's */ + n_pbufs_freed = n_bds; + curbdpntr = txbdset; + while (n_pbufs_freed > 0) + { + bdindex = FXMAC_BD_TO_INDEX(txring, curbdpntr); + temp = (u32 *)curbdpntr; + *temp = 0; /* Word 0 */ + temp++; + if (bdindex == (XMAC_LWIP_CONFIG_N_TX_DESC - 1)) + { + *temp = 0xC0000000; /* Word 1 ,used/Wrap – marks last descriptor in transmit buffer descriptor list.*/ + } + else + { + *temp = 0x80000000; /* Word 1 , Used – must be zero for GEM to read data to the transmit buffer.*/ + } + DSB(); + p = (struct pbuf *)tx_pbufs_storage[index + bdindex]; + if (p != NULL) + { + pbuf_free(p); + } + tx_pbufs_storage[index + bdindex] = 0; + curbdpntr = FXmacBdRingNext(txring, curbdpntr); + n_pbufs_freed--; + DSB(); + } + + status = FXmacBdRingFree(txring, n_bds, txbdset); + if (status != FT_SUCCESS) + { + f_printk( ("Failure while freeing in Tx Done ISR\r\n")); + } + } + return; +} + +void xmac_send_handler(void *arg) +{ + struct xmac_netif *xmac_netif_p; + ethernetif *ethernetif_p; + FXmacBdRing *txringptr; + u32 regval; + +#ifdef OS_IS_FREERTOS + xInsideISR++; +#endif + + xmac_netif_p = (struct xmac_netif *)(arg); + ethernetif_p = (ethernetif *)(xmac_netif_p->state); + txringptr = &(FXMAC_GET_TXRING(ethernetif_p->xmac_ctrl)); + regval = FXMAC_READREG32(ethernetif_p->xmac_ctrl.config.base_address, FXMAC_TXSR_OFFSET); + FXMAC_WRITEREG32(ethernetif_p->xmac_ctrl.config.base_address,FXMAC_TXSR_OFFSET, regval); /* 清除中断状态位来停止中断 */ + + /* If Transmit done interrupt is asserted, process completed BD's */ + xmac_process_sent_bds(ethernetif_p, txringptr); +#ifdef OS_IS_FREERTOS + xInsideISR--; +#endif +} + +FError xmac_sgsend(ethernetif *ethernetif_p, struct pbuf *p) +{ + struct pbuf *q; + u32 n_pbufs; + FXmacBd *txbdset, *txbd, *last_txbd = NULL; + FXmacBd *temp_txbd; + FError status; + FXmacBdRing *txring; + u32 bdindex; + u32 lev; + u32 index; + u32 max_fr_size; + + lev = MFCPSR(); + MTCPSR(lev | 0xC0); /* Mask IRQ and FIQ interrupts in cpsr */ + + txring = &(FXMAC_GET_TXRING(ethernetif_p->xmac_ctrl)); + + index = get_base_index_tx_buf (ethernetif_p); + + /* first count the number of pbufs */ + for (q = p, n_pbufs = 0; q != NULL; q = q->next) + n_pbufs++; + + /* obtain as many BD's */ + status = FXmacBdRingAlloc(txring, n_pbufs, &txbdset); + if (status != FT_SUCCESS) + { + MTCPSR(lev); + f_printk("sgsend: Error allocating TxBD\r\n"); + return ERR_GENERAL; + } + + for(q = p, txbd = txbdset; q != NULL; q = q->next) + { + bdindex = FXMAC_BD_TO_INDEX(txring, txbd); + if (tx_pbufs_storage[index + bdindex] != 0) + { + MTCPSR(lev); + f_printk("PBUFS not available\r\n"); + return ERR_GENERAL; + } + + /* Send the data from the pbuf to the interface, one pbuf at a + time. The size of the data in each pbuf is kept in the ->len + variable. */ + FCacheDCacheFlushRange((uintptr)q->payload, (uintptr)q->len); + + FXmacBdSetaddressTx(txbd, (uintptr)q->payload); + +#ifdef XMAC_USE_JUMBO + max_fr_size = FXMAC_MAX_FRAME_SIZE_JUMBO - 18; +#else + max_fr_size = FXMAC_MAX_FRAME_SIZE - 18; +#endif + if (q->len > max_fr_size) + FXmacBdSetLength(txbd, max_fr_size & 0x3FFF); + else + FXmacBdSetLength(txbd, q->len & 0x3FFF); + + tx_pbufs_storage[index + bdindex] = (uintptr)q; + + pbuf_ref(q); + last_txbd = txbd; + FXmacBdClearLast(txbd); + txbd = FXmacBdRingNext(txring, txbd); + } + FXmacBdSetLast(last_txbd); + /* For fragmented packets, remember the 1st BD allocated for the 1st + packet fragment. The used bit for this BD should be cleared at the end + after clearing out used bits for other fragments. For packets without + just remember the allocated BD. */ + temp_txbd = txbdset; + txbd = txbdset; + txbd = FXmacBdRingNext(txring, txbd); + q = p->next; + for(; q != NULL; q = q->next) + { + FXmacBdClearTxUsed(txbd); + DSB(); + txbd = FXmacBdRingNext(txring, txbd); + } + FXmacBdClearTxUsed(temp_txbd); + DSB(); + + status = FXmacBdRingToHw(txring, n_pbufs, txbdset); + if (status != FT_SUCCESS) + { + MTCPSR(lev); + f_printk("sgsend: Error submitting TxBD\r\n"); + return ERR_GENERAL; + } + /* Start transmit */ + FXMAC_WRITEREG32((ethernetif_p->xmac_ctrl).config.base_address, + FXMAC_NWCTRL_OFFSET, + (FXMAC_READREG32((ethernetif_p->xmac_ctrl).config.base_address, + FXMAC_NWCTRL_OFFSET) | FXMAC_NWCTRL_STARTTX_MASK)); + + MTCPSR(lev); + return status; +} + +void setup_rx_bds(ethernetif *ethernetif_p, FXmacBdRing *rxring) +{ + FXmacBd *rxbd; + FError status; + struct pbuf *p; + u32 freebds; + u32 bdindex; + u32 *temp; + u32 index; + + index = get_base_index_rx_buf(ethernetif_p); + + freebds = FXmacBdRingGetFreeCnt(rxring); + while (freebds > 0) + { + freebds--; + +#ifdef XMAC_USE_JUMBO + p = pbuf_alloc(PBUF_RAW, MAX_FRAME_SIZE_JUMBO, PBUF_POOL); +#else + p = pbuf_alloc(PBUF_RAW, FXMAC_MAX_FRAME_SIZE, PBUF_POOL); +#endif + if (!p) + { +#if LINK_STATS + lwip_stats.link.memerr++; + lwip_stats.link.drop++; +#endif + f_printk("unable to alloc pbuf in recv_handler\r\n"); + return; + } + status = FXmacBdRingAlloc(rxring, 1, &rxbd); + if (status != FT_SUCCESS) + { + f_printk("setup_rx_bds: Error allocating RxBD\r\n"); + pbuf_free(p); + return; + } + status = FXmacBdRingToHw(rxring, 1, rxbd); + if (status != FT_SUCCESS) + { + f_printk("Error committing RxBD to hardware: "); + if (status == FXMAC_ERR_SG_LIST) + { + f_printk("XST_DMA_SG_LIST_ERROR: this function was called out of sequence with FXmacBdRingAlloc()\r\n"); + } + else + { + f_printk("set of BDs was rejected because the first BD did not have its start-of-packet bit set, or the last BD did not have its end-of-packet bit set, or any one of the BD set has 0 as length value\r\n"); + } + + pbuf_free(p); + FXmacBdRingUnAlloc(rxring, 1, rxbd); + return; + } +#ifdef XMAC_USE_JUMBO + FCacheDCacheInvalidateRange((uintptr)p->payload, (uintptr)MAX_FRAME_SIZE_JUMBO); +#else + FCacheDCacheInvalidateRange((uintptr)p->payload, (uintptr)FXMAC_MAX_FRAME_SIZE); +#endif + bdindex = FXMAC_BD_TO_INDEX(rxring, rxbd); + temp = (u32 *)rxbd; + if (bdindex == (XMAC_LWIP_CONFIG_N_RX_DESC - 1)) + { + *temp = 0x00000002; + } + else + { + *temp = 0; + } + temp++; + *temp = 0; + DSB(); + + FXmacBdSetaddressRx(rxbd, (uintptr)p->payload); + rx_pbufs_storage[index + bdindex] = (uintptr)p; + } +} + +void xmac_recv_handler(void *arg) +{ + struct pbuf *p; + FXmacBd *rxbdset, *curbdptr; + struct xmac_netif *xmac_netif_p; + ethernetif *ethernetif_p; + FXmacBdRing *rxring; + volatile u32 bd_processed; + u32 rx_bytes, k; + u32 bdindex; + u32 regval; + u32 index; + u32 gigeversion; + + xmac_netif_p = (struct xmac_netif *)(arg); + ethernetif_p = (ethernetif *)(xmac_netif_p->state); + rxring = &FXMAC_GET_RXRING(ethernetif_p->xmac_ctrl); + +#ifdef OS_IS_FREERTOS + xInsideISR++; +#endif + + index = get_base_index_rx_buf (ethernetif_p); + + /* If Reception done interrupt is asserted, call RX call back function + to handle the processed BDs and then raise the according flag.*/ + regval = FXMAC_READREG32(ethernetif_p->xmac_ctrl.config.base_address, FXMAC_RXSR_OFFSET); + FXMAC_WRITEREG32(ethernetif_p->xmac_ctrl.config.base_address, FXMAC_RXSR_OFFSET, regval); + + while(1) + { + bd_processed = FXmacBdRingFromHwRx(rxring, XMAC_LWIP_CONFIG_N_RX_DESC, &rxbdset); + if (bd_processed <= 0) + { + break; + } + + for (k = 0, curbdptr=rxbdset; k < bd_processed; k++) + { + + bdindex = FXMAC_BD_TO_INDEX(rxring, curbdptr); + p = (struct pbuf *)rx_pbufs_storage[index + bdindex]; + + /* + * Adjust the buffer size to the actual number of bytes received. + */ +#ifdef XMAC_USE_JUMBO + rx_bytes = FXmacGetRxFrameSize(ðernetif_p->xmac_ctrl, curbdptr); +#else + rx_bytes = FXmacBdGetLength(curbdptr); +#endif + pbuf_realloc(p, rx_bytes); + + /* Invalidate RX frame before queuing to handle + * L1 cache prefetch conditions on any architecture. + */ + FCacheDCacheInvalidateRange((uintptr)p->payload, rx_bytes); + + /* store it in the receive queue, + * where it'll be processed by a different handler + */ + if (xmac_pq_enqueue(ethernetif_p->recv_q, (void*)p) < 0) + { +#if LINK_STATS + lwip_stats.link.memerr++; + lwip_stats.link.drop++; +#endif + pbuf_free(p); + } + curbdptr = FXmacBdRingNext( rxring, curbdptr); + } + /* free up the BD's */ + FXmacBdRingFree(rxring, bd_processed, rxbdset); + setup_rx_bds(ethernetif_p, rxring); +#if !NO_SYS + sys_sem_signal(&xmac_netif_p->sem_rx_data_available); +#endif + } + +#ifdef OS_IS_FREERTOS + xInsideISR--; +#endif + return; +} + +void clean_dma_txdescs(struct xmac_netif *xmac_netif_p) +{ + FXmacBd bdtemplate; + FXmacBdRing *txringptr; + ethernetif *ethernetif_p = (ethernetif *)(xmac_netif_p->state); + + txringptr = &FXMAC_GET_TXRING((ethernetif_p->xmac_ctrl)); + FXmacBdClear(&bdtemplate); + FXmacBdSetStatus(&bdtemplate, FXMAC_TXBUF_USED_MASK); + + /* Create the TxBD ring */ + FXmacBdRingCreate(txringptr, (uintptr) ethernetif_p->tx_bdspace, + (uintptr) ethernetif_p->tx_bdspace, BD_ALIGNMENT, + XMAC_LWIP_CONFIG_N_TX_DESC); + FXmacBdRingClone(txringptr, &bdtemplate, FXMAC_SEND); +} + +FError init_dma(struct xmac_netif *xmac_netif_p) +{ + FXmacBd bdtemplate; + FXmacBdRing *rxringptr, *txringptr; + FXmacBd *rxbd; + struct pbuf *p; + FError status; + int i; + u32 bdindex; + volatile uintptr tempaddress; + u32 index; + u32 gigeversion; + FXmacBd *bdtxterminate; + FXmacBd *bdrxterminate; + u32 *temp; + + ethernetif *ethernetif_p = (ethernetif *)(xmac_netif_p->state); + + index = get_base_index_rx_buf(ethernetif_p); + /* + * The BDs need to be allocated in uncached memory. Hence the 1 MB + * address range allocated for Bd_Space is made uncached + * by setting appropriate attributes in the translation table. + * The Bd_Space is aligned to 1MB and has a size of 1 MB. This ensures + * a reserved uncached area used only for BDs. + */ + if (bd_space_attr_set == 0) + { + bd_space_attr_set = 1; + } + + rxringptr = &FXMAC_GET_RXRING(ethernetif_p->xmac_ctrl); + txringptr = &FXMAC_GET_TXRING(ethernetif_p->xmac_ctrl); + f_printk( "rxringptr: 0x%08x\r\n", rxringptr); + f_printk( "txringptr: 0x%08x\r\n", txringptr); + + /* Allocate 64k for Rx and Tx bds each to take care of extreme cases */ + tempaddress = (uintptr)&(bd_space[bd_space_index]); + ethernetif_p->rx_bdspace = (void *)tempaddress; + bd_space_index += 0x10000; + tempaddress = (uintptr)&(bd_space[bd_space_index]); + ethernetif_p->tx_bdspace = (void *)tempaddress; + bd_space_index += 0x10000; + + f_printk( ("rx_bdspace: %p \r\n", ethernetif_p->rx_bdspace)); + f_printk( ("tx_bdspace: %p \r\n", ethernetif_p->tx_bdspace)); + + if (!ethernetif_p->rx_bdspace || !ethernetif_p->tx_bdspace) + { + f_printk("%s@%d: Error: Unable to allocate memory for TX/RX buffer descriptors", + __FILE__, __LINE__); + return ERR_IF; + } + + /* Setup RxBD space. */ + FXmacBdClear(&bdtemplate); + + /* Create the RxBD ring */ + status = FXmacBdRingCreate(rxringptr, (uintptr) ethernetif_p->rx_bdspace, + (uintptr) ethernetif_p->rx_bdspace, BD_ALIGNMENT, + XMAC_LWIP_CONFIG_N_RX_DESC); + + if(status != FT_SUCCESS) + { + f_printk( ("Error setting up RxBD space\r\n")); + return ERR_IF; + } + + status = FXmacBdRingClone(rxringptr, &bdtemplate, FXMAC_RECV); + if(status != FT_SUCCESS) + { + f_printk("Error initializing RxBD space\r\n"); + return ERR_IF; + } + + FXmacBdClear(&bdtemplate); + FXmacBdSetStatus(&bdtemplate, FXMAC_TXBUF_USED_MASK); + + /* Create the TxBD ring */ + status = FXmacBdRingCreate(txringptr, (uintptr) ethernetif_p->tx_bdspace, + (uintptr) ethernetif_p->tx_bdspace, BD_ALIGNMENT, + XMAC_LWIP_CONFIG_N_TX_DESC); + + if (status != FT_SUCCESS) + { + return ERR_IF; + } + + /* We reuse the bd template, as the same one will work for both rx and tx. */ + status = FXmacBdRingClone(txringptr, &bdtemplate, FXMAC_SEND); + if (status != FT_SUCCESS) + { + return ERR_IF; + } + + /* + * Allocate RX descriptors, 1 RxBD at a time. + */ + for (i = 0; i < XMAC_LWIP_CONFIG_N_RX_DESC; i++) + { +#ifdef XMAC_USE_JUMBO + p = pbuf_alloc(PBUF_RAW, FXMAC_MAX_FRAME_SIZE_JUMBO, PBUF_POOL); +#else + p = pbuf_alloc(PBUF_RAW, FXMAC_MAX_FRAME_SIZE, PBUF_POOL); +#endif + if (!p) + { +#if LINK_STATS + lwip_stats.link.memerr++; + lwip_stats.link.drop++; +#endif + f_printk("unable to alloc pbuf in init_dma\r\n"); + return ERR_IF; + } + status = FXmacBdRingAlloc(rxringptr, 1, &rxbd); + if (status != FT_SUCCESS) + { + f_printk( ("init_dma: Error allocating RxBD\r\n")); + pbuf_free(p); + return ERR_IF; + } + /* Enqueue to HW */ + status = FXmacBdRingToHw(rxringptr, 1, rxbd); + if (status != FT_SUCCESS) + { + f_printk( ("Error: committing RxBD to HW\r\n")); + pbuf_free(p); + FXmacBdRingUnAlloc(rxringptr, 1, rxbd); + return ERR_IF; + } + + bdindex = FXMAC_BD_TO_INDEX(rxringptr, rxbd); + temp = (u32 *)rxbd; + *temp = 0; + if (bdindex == (XMAC_LWIP_CONFIG_N_RX_DESC - 1)) + { + *temp = 0x00000002; + } + temp++; + *temp = 0; + DSB(); + +#ifdef XMAC_USE_JUMBO + FCacheDCacheInvalidateRange((uintptr)p->payload, (uintptr)MAX_FRAME_SIZE_JUMBO); +#else + FCacheDCacheInvalidateRange((uintptr)p->payload, (uintptr)FXMAC_MAX_FRAME_SIZE); +#endif + FXmacBdSetaddressRx(rxbd, (uintptr)p->payload); + + rx_pbufs_storage[index + bdindex] = (uintptr)p; + } + + FXmacSetQueuePtr(&(ethernetif_p->xmac_ctrl), ethernetif_p->xmac_ctrl.tx_bd_queue.bdring.base_bd_addr, 0, (u16)FXMAC_SEND); + FXmacSetQueuePtr(&(ethernetif_p->xmac_ctrl), ethernetif_p->xmac_ctrl.rx_bd_queue.bdring.base_bd_addr, 0, (u16)FXMAC_RECV); + + xmac_intr_num = ethernetif_p->xmac_ctrl.config.queue_irq_num[0]; + return 0; +} + +void free_txrx_pbufs(ethernetif *ethernetif_p) +{ + u32 index; + u32 index1; + struct pbuf *p; + + index1 = get_base_index_tx_buf(ethernetif_p); + + for (index = index1; index < (index1 + XMAC_LWIP_CONFIG_N_TX_DESC); index++) + { + if(tx_pbufs_storage[index] != 0) + { + p = (struct pbuf *)tx_pbufs_storage[index]; + pbuf_free(p); + tx_pbufs_storage[index] = 0; + } + } + + for (index = index1; index < (index1 + XMAC_LWIP_CONFIG_N_TX_DESC); index++) + { + p = (struct pbuf *)rx_pbufs_storage[index]; + pbuf_free(p); + + } +} + +void free_onlytx_pbufs(ethernetif *ethernetif_p) +{ + u32 index; + u32 index1; + struct pbuf *p; + + index1 = get_base_index_tx_buf(ethernetif_p); + for (index = index1; index < (index1 + XMAC_LWIP_CONFIG_N_TX_DESC); index++) + { + if (tx_pbufs_storage[index] != 0) + { + p = (struct pbuf *)tx_pbufs_storage[index]; + pbuf_free(p); + tx_pbufs_storage[index] = 0; + } + } +} + +/* reset Tx and Rx DMA pointers */ +void reset_dma(struct xmac_netif *xmac_netif_p) +{ + u8 txqueuenum; + u32 gigeversion; + ethernetif *ethernetif_p = (ethernetif *)(xmac_netif_p->state); + FXmacBdRing *txringptr = &FXMAC_GET_TXRING(ethernetif_p->xmac_ctrl); + FXmacBdRing *rxringptr = &FXMAC_GET_RXRING(ethernetif_p->xmac_ctrl); + + FXmacBdringPtrReset(txringptr, ethernetif_p->tx_bdspace); + FXmacBdringPtrReset(rxringptr, ethernetif_p->rx_bdspace); + + FXmacSetQueuePtr(&(ethernetif_p->xmac_ctrl), ethernetif_p->xmac_ctrl.tx_bd_queue.bdring.base_bd_addr, 0, (u16)FXMAC_SEND); + FXmacSetQueuePtr(&(ethernetif_p->xmac_ctrl), ethernetif_p->xmac_ctrl.rx_bd_queue.bdring.base_bd_addr, 0, (u16)FXMAC_RECV); + +} + +void xmac_disable_intr(void) +{ + InterruptMask(xmac_intr_num); +} + +void xmac_enable_intr(void) +{ + InterruptUmask(xmac_intr_num); +} diff --git a/third-party/lwip-2.1.2/ports/fxmac/ethernetif_hw.c b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_hw.c new file mode 100644 index 0000000000000000000000000000000000000000..b20f67290845fab29b487a9b7d7b26137465d62e --- /dev/null +++ b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_hw.c @@ -0,0 +1,181 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: ethernetif_hw.c + * Date: 2022-04-02 16:43:32 + * LastEditTime: 2022-04-19 21:27:57 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#include "fxmac.h" +#include "ethernetif.h" +#include "lwipopts.h" +#include "interrupt.h" + +#ifdef OS_IS_FREERTOS +extern long xInsideISR; +#endif + +void xmac_init(ethernetif *ethernetif_p, struct netif *netif) +{ + FXmac *xmac_p; + u32 status = FT_SUCCESS; + + xmac_p = ðernetif_p->xmac_ctrl; + +#ifdef XMAC_USE_JUMBO + FXmacSetOptions(xmac_p, FXMAC_JUMBO_ENABLE_OPTION); +#endif + +#ifdef LWIP_IGMP + FXmacSetOptions(xmac_p, FXMAC_MULTICAST_OPTION,0); +#endif + + /* set mac address */ + status = FXmacSetMacAddress(xmac_p, (void*)(netif->hwaddr), 1); + if (status != FT_SUCCESS) + { + f_printk("In %s:Emac Mac Address set failed...\r\n",__func__); + } + + FXmacSelectClk(xmac_p, 1000); + +} + +void xmac_init_on_error(ethernetif *ethernetif_p, struct netif *netif) +{ + FXmac *xmac_p; + u32 status = FT_SUCCESS; + xmac_p = ðernetif_p->xmac_ctrl; + + /* set mac address */ + status = FXmacSetMacAddress(xmac_p, (void*)(netif->hwaddr), 1); + if (status != FT_SUCCESS) + { + f_printk("In %s:Emac Mac Address set failed...\r\n",__func__); + } +} + +void xmac_setup_isr (struct xmac_netif *xmac_netif_p) +{ + ethernetif *ethernetif_p; + ethernetif_p = (ethernetif *)(xmac_netif_p->state); + + /* Setup callbacks */ + FXmacSetHandler(ðernetif_p->xmac_ctrl, FXMAC_HANDLER_DMASEND, xmac_send_handler, xmac_netif_p); + FXmacSetHandler(ðernetif_p->xmac_ctrl, FXMAC_HANDLER_DMARECV, xmac_recv_handler, xmac_netif_p); + FXmacSetHandler(ðernetif_p->xmac_ctrl, FXMAC_HANDLER_ERROR, xmac_error_handler, xmac_netif_p); + + InterruptSetPriority(ethernetif_p->xmac_ctrl.config.queue_irq_num[0], 0); + InterruptInstall(ethernetif_p->xmac_ctrl.config.queue_irq_num[0], FXmacIntrHandler, ðernetif_p->xmac_ctrl, "fxmac"); + InterruptUmask(ethernetif_p->xmac_ctrl.config.queue_irq_num[0]); + +} + +void xmac_start(ethernetif *ethernetif_p) +{ + /* start the temac */ + FXmacStart(ðernetif_p->xmac_ctrl); +} + +void xmac_restart_transmitter (ethernetif *ethernetif_p) +{ + u32 reg; + reg = FXMAC_READREG32(ethernetif_p->xmac_ctrl.config.base_address, + FXMAC_NWCTRL_OFFSET); + reg = reg & (~FXMAC_NWCTRL_TXEN_MASK); + FXMAC_WRITEREG32(ethernetif_p->xmac_ctrl.config.base_address, + FXMAC_NWCTRL_OFFSET, reg); + + reg = FXMAC_READREG32(ethernetif_p->xmac_ctrl.config.base_address, + FXMAC_NWCTRL_OFFSET); + reg = reg | (FXMAC_NWCTRL_TXEN_MASK); + FXMAC_WRITEREG32(ethernetif_p->xmac_ctrl.config.base_address, + FXMAC_NWCTRL_OFFSET, reg); +} + +void xmac_error_handler(void *arg,u8 direction, u32 error_word) +{ + struct xmac_netif *xmac_netif_p; + ethernetif *ethernetif_p; + FXmacBdRing *rxring; + FXmacBdRing *txring; +#ifdef OS_IS_FREERTOS + xInsideISR++; +#endif + + xmac_netif_p = (struct xmac_netif *)(arg); + ethernetif_p = (ethernetif *)(xmac_netif_p->state); + rxring = &FXMAC_GET_RXRING((ethernetif_p->xmac_ctrl)); + txring = &FXMAC_GET_TXRING((ethernetif_p->xmac_ctrl)); + + if (error_word != 0) + { + switch (direction) + { + case FXMAC_RECV: + if (error_word & FXMAC_RXSR_HRESPNOK_MASK) + { + LWIP_DEBUGF(NETIF_DEBUG, ("Receive DMA error\r\n")); + xmac_handle_dma_tx_error(xmac_netif_p); + } + if (error_word & FXMAC_RXSR_RXOVR_MASK) + { + LWIP_DEBUGF(NETIF_DEBUG, ("Receive over run\r\n")); + xmac_recv_handler(arg); + setup_rx_bds(ethernetif_p, rxring); + } + if (error_word & FXMAC_RXSR_BUFFNA_MASK) + { + LWIP_DEBUGF(NETIF_DEBUG, ("Receive buffer not available\r\n")); + xmac_recv_handler(arg); + setup_rx_bds(ethernetif_p, rxring); + } + break; + case FXMAC_SEND: + if (error_word & FXMAC_TXSR_HRESPNOK_MASK) + { + LWIP_DEBUGF(NETIF_DEBUG, ("Transmit DMA error\r\n")); + xmac_handle_dma_tx_error(xmac_netif_p); + } + if (error_word & FXMAC_TXSR_URUN_MASK) + { + LWIP_DEBUGF(NETIF_DEBUG, ("Transmit under run\r\n")); + xmac_handle_tx_errors(xmac_netif_p); + } + if (error_word & FXMAC_TXSR_BUFEXH_MASK) + { + LWIP_DEBUGF(NETIF_DEBUG, ("Transmit buffer exhausted\r\n")); + xmac_handle_tx_errors(xmac_netif_p); + } + if (error_word & FXMAC_TXSR_RXOVR_MASK) + { + LWIP_DEBUGF(NETIF_DEBUG, ("Transmit retry excessed limits\r\n")); + xmac_handle_tx_errors(xmac_netif_p); + } + if (error_word & FXMAC_TXSR_FRAMERX_MASK) + { + LWIP_DEBUGF(NETIF_DEBUG, ("Transmit collision\r\n")); + xmac_process_sent_bds(ethernetif_p, txring); + } + break; + } + } +#ifdef OS_IS_FREERTOS + xInsideISR--; +#endif +} diff --git a/third-party/lwip-2.1.2/ports/fxmac/ethernetif_hw.h b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_hw.h new file mode 100644 index 0000000000000000000000000000000000000000..17a3306e2e9d73564607b8394f495a7fa68698a0 --- /dev/null +++ b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_hw.h @@ -0,0 +1,38 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: ethernetif_hw.h + * Date: 2022-04-02 16:43:32 + * LastEditTime: 2022-04-19 22:03:51 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#ifndef __ETHERNETIF_HW_H_ +#define __ETHERNETIF_HW_H_ + +#include "ethernetif.h" +#include "lwip/netif.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third-party/lwip-2.1.2/ports/fxmac/ethernetif_queue.c b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_queue.c new file mode 100644 index 0000000000000000000000000000000000000000..790c8039c38e3d3a087f3b703286f00109d9dc63 --- /dev/null +++ b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_queue.c @@ -0,0 +1,82 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: ethernetif_queue.c + * Date: 2022-04-02 16:43:32 + * LastEditTime: 2022-04-19 21:27:57 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#include +#include "ethernetif_queue.h" +#include "f_printk.h" + +#define NUM_QUEUES 2 + +pq_queue_t pq_queue[NUM_QUEUES]; + +pq_queue_t *xmac_pq_create_queue() +{ + static int i; + pq_queue_t *q = NULL; + + if (i >= NUM_QUEUES) + { + f_printk("ERR: Max Queues allocated\n\r"); + return q; + } + + q = &pq_queue[i++]; + + if (!q) + return q; + + q->head = q->tail = q->len = 0; + + return q; +} + +int xmac_pq_enqueue(pq_queue_t *q, void *p) +{ + if (q->len == PQ_QUEUE_SIZE) + return -1; + + q->data[q->head] = p; + q->head = (q->head + 1)%PQ_QUEUE_SIZE; + q->len++; + + return 0; +} + +void* xmac_pq_dequeue(pq_queue_t *q) +{ + int ptail; + + if (q->len == 0) + return NULL; + + ptail = q->tail; + q->tail = (q->tail + 1)%PQ_QUEUE_SIZE; + q->len--; + + return q->data[ptail]; +} + +int xmac_pq_qlength(pq_queue_t *q) +{ + return q->len; +} diff --git a/third-party/freertos/portable/GCC/ft_platform/aarch64/vectors_g.c b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_queue.h similarity index 62% rename from third-party/freertos/portable/GCC/ft_platform/aarch64/vectors_g.c rename to third-party/lwip-2.1.2/ports/fxmac/ethernetif_queue.h index 61546459a4b1ae1ecd749bdcf2e26c99abc9271f..68c44bb94dab1e3d5336f9f798b3d6780887ca38 100644 --- a/third-party/freertos/portable/GCC/ft_platform/aarch64/vectors_g.c +++ b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_queue.h @@ -11,9 +11,9 @@ * See the Phytium Public License for more details. * * - * FilePath: vectors_g.c - * Date: 2022-02-24 13:42:19 - * LastEditTime: 2022-03-21 17:03:39 + * FilePath: ethernetif_queue.h + * Date: 2022-04-06 14:46:52 + * LastEditTime: 2022-04-06 14:46:53 * Description:  This file is for * * Modify History: @@ -21,15 +21,28 @@ * ----- ------     --------    -------------------------------------- */ +#ifndef __ETHERNETIF_QUEUE_H_ +#define __ETHERNETIF_QUEUE_H_ +#ifdef __cplusplus +extern "C" { +#endif +#define PQ_QUEUE_SIZE 4096 +typedef struct +{ + void *data[PQ_QUEUE_SIZE]; + int head, tail, len; +} pq_queue_t; +pq_queue_t* xmac_pq_create_queue(void); +int xmac_pq_enqueue(pq_queue_t *q, void *p); +void* xmac_pq_dequeue(pq_queue_t *q); +int xmac_pq_qlength(pq_queue_t *q); +#ifdef __cplusplus +} +#endif -#include "ft_types.h" - - -volatile u8 fpu_context[528] ; -volatile u8 *fpu_context_base ; -volatile u8 fpu_status ; +#endif diff --git a/third-party/lwip-2.1.2/ports/fxmac/ethernetif_sio.c b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_sio.c new file mode 100644 index 0000000000000000000000000000000000000000..c478cf781fc9bf55c764267f75855e5a99ba0154 --- /dev/null +++ b/third-party/lwip-2.1.2/ports/fxmac/ethernetif_sio.c @@ -0,0 +1,98 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: ethernetif_sio.c + * Date: 2022-03-14 18:12:03 + * LastEditTime: 2022-03-14 18:12:03 + * Description:  This file is for + * + * Modify History: + * Ver   Who        Date         Changes + * ----- ------     --------    -------------------------------------- + */ + +#include "arch/cc.h" + +/** + * Sends a single character to the serial device. + * + * @param c character to send + * @param fd serial device handle + * + * @note This function will block until the character can be sent. + */ +void sio_send(u8_t c, sio_fd_t fd) +{ + (void)c; + (void)fd; +} + +/** + * Opens a serial device for communication. + * + * @param devnum device number + * @return handle to serial device if successful, NULL otherwise + */ +sio_fd_t sio_open(u8_t devnum) +{ + sio_fd_t sd; + (void)devnum; + + sd = 0; + + return sd; +} + +/** + * Reads from the serial device. + * + * @param fd serial device handle + * @param data pointer to data buffer for receiving + * @param len maximum length (in bytes) of data to receive + * @return number of bytes actually received - may be 0 if aborted by sio_read_abort + * + * @note This function will block until data can be received. The blocking + * can be cancelled by calling sio_read_abort(). + */ +u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len) +{ + u32_t recved_bytes; + (void)len; + (void)data; + (void)fd; + + recved_bytes = 0; // dummy code + + return recved_bytes; +} + +/** + * Tries to read from the serial device. Same as sio_read but returns + * immediately if no data is available and never blocks. + * + * @param fd serial device handle + * @param data pointer to data buffer for receiving + * @param len maximum length (in bytes) of data to receive + * @return number of bytes actually received + */ +u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len) +{ + u32_t recved_bytes; + (void)len; + (void)data; + (void)fd; + + recved_bytes = 0; // dummy code + + return recved_bytes; +} \ No newline at end of file diff --git a/third-party/lwip-2.1.2/ports/fxmac/lwipopts.h b/third-party/lwip-2.1.2/ports/fxmac/lwipopts.h new file mode 100644 index 0000000000000000000000000000000000000000..04fe9371e2507fcb1c627cc12e274f1d7d67435f --- /dev/null +++ b/third-party/lwip-2.1.2/ports/fxmac/lwipopts.h @@ -0,0 +1,116 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: lwipopts.h + * Date: 2022-04-02 16:43:32 + * LastEditTime: 2022-04-19 21:27:57 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#ifndef __LWIPOPTS_H_ +#define __LWIPOPTS_H_ + +#ifndef PROCESSOR_LITTLE_ENDIAN +#define PROCESSOR_LITTLE_ENDIAN +#endif + +#define SYS_LIGHTWEIGHT_PROT 1 + +#define NO_SYS 1 +#define LWIP_SOCKET 0 +#define LWIP_COMPAT_SOCKETS 0 +#define LWIP_NETCONN 0 + +#define NO_SYS_NO_TIMERS 0 + +#define LWIP_TCP_KEEPALIVE 0 + +#define MEM_ALIGNMENT 64 +#define MEM_SIZE 131072 +#define MEMP_NUM_PBUF 16 +#define MEMP_NUM_UDP_PCB 4 +#define MEMP_NUM_TCP_PCB 32 +#define MEMP_NUM_TCP_PCB_LISTEN 8 +#define MEMP_NUM_TCP_SEG 256 +#define MEMP_NUM_SYS_TIMEOUT 8 +#define MEMP_NUM_NETBUF 8 +#define MEMP_NUM_NETCONN 16 +#define MEMP_NUM_TCPIP_MSG_API 16 +#define MEMP_NUM_TCPIP_MSG_INPKT 64 + +#define MEMP_NUM_SYS_TIMEOUT 8 +#define PBUF_POOL_SIZE 2048 +#define PBUF_POOL_BUFSIZE 1700 +#define PBUF_LINK_HLEN 16 + +#define ARP_TABLE_SIZE 10 +#define ARP_QUEUEING 1 + +#define ICMP_TTL 255 + +#define IP_OPTIONS 0 +#define IP_FORWARD 0 +#define IP_REASSEMBLY 1 +#define IP_FRAG 1 +#define IP_REASS_MAX_PBUFS 128 +#define IP_FRAG_MAX_MTU 1500 +#define IP_DEFAULT_TTL 255 +#define LWIP_CHKSUM_ALGORITHM 3 + +#define LWIP_UDP 1 +#define UDP_TTL 255 + +#define LWIP_TCP 1 +#define TCP_MSS 1460 +#define TCP_SND_BUF 8192 +#define TCP_WND 2048 +#define TCP_TTL 255 +#define TCP_MAXRTX 12 +#define TCP_SYNMAXRTX 4 +#define TCP_QUEUE_OOSEQ 1 +#define TCP_SND_QUEUELEN 16 * TCP_SND_BUF/TCP_MSS +#define CHECKSUM_GEN_TCP 0 +#define CHECKSUM_GEN_UDP 0 +#define CHECKSUM_GEN_IP 0 +#define CHECKSUM_CHECK_TCP 0 +#define CHECKSUM_CHECK_UDP 0 +#define CHECKSUM_CHECK_IP 0 +#define LWIP_FULL_CSUM_OFFLOAD_RX 1 +#define LWIP_FULL_CSUM_OFFLOAD_TX 1 + +#define MEMP_SEPARATE_POOLS 1 +#define MEMP_NUM_FRAG_PBUF 256 +#define IP_OPTIONS_ALLOWED 0 +#define TCP_OVERSIZE TCP_MSS + +#define LWIP_DHCP 0 +#define DHCP_DOES_ARP_CHECK 0 + +#define CONFIG_LINKSPEED_AUTODETECT 1 + +/* +#define LWIP_IPV4 1 +#define LWIP_IPV6 0 + +#define LWIP_ARP 1 +#define ARP_TABLE_SIZE 10 +#define ARP_QUEUEING 1 +*/ +#define LWIP_DEBUG + + +#endif diff --git a/third-party/lwip-2.1.2/ports/lwip_port.c b/third-party/lwip-2.1.2/ports/lwip_port.c new file mode 100644 index 0000000000000000000000000000000000000000..569ce617cdcf0b88e976e48b96be279a972033cf --- /dev/null +++ b/third-party/lwip-2.1.2/ports/lwip_port.c @@ -0,0 +1,369 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: lwip_port.c + * Date: 2022-06-09 16:03:57 + * LastEditTime: 2022-06-09 16:03:57 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ------ -------- -------------------------------------- + */ + +#include + +#include "sdkconfig.h" +#ifndef SDK_CONFIG_H__ + #warning "Please include sdkconfig.h" +#endif + +#include "lwipopts.h" + +#ifdef CONFIG_LWIP_FXMAC +#include "fxmac.h" +#include "ethernetif.h" +#include "eth_ieee_reg.h" +#endif + +#ifdef CONFIG_LWIP_FGMAC +#include "ethernetif.h" +#include "fgmac.h" +#include "fgmac_phy.h" +#include "fgmac_hw.h" +#endif + +#include "lwip/mem.h" +#include "lwip/stats.h" +#include "lwip/sys.h" +#include "lwip/ip.h" +#include "lwip/tcp.h" +#include "lwip/udp.h" +#include "lwip/priv/tcp_priv.h" +#include "lwip/ip_addr.h" +#include "lwip/init.h" + +#include "netif/etharp.h" +#include "lwip_port.h" +#include "parameters.h" +#include "ft_types.h" +#include "ft_debug.h" +#include "generic_timer.h" + +#if !NO_SYS +#include "lwip/tcpip.h" +#endif + +#ifdef OS_IS_FREERTOS +#define THREAD_STACKSIZE 256 +#define LINK_DETECT_THREAD_INTERVAL 1000 /* one second */ + +void link_detect_thread(void *p); +#endif + +#define LWIP_PORT_DEBUG_TAG "LWIP-PORT" +#define LWIP_PORT_ERROR(format, ...) FT_DEBUG_PRINT_E(LWIP_PORT_DEBUG_TAG, format, ##__VA_ARGS__) +#define LWIP_PORT_INFO(format, ...) FT_DEBUG_PRINT_I(LWIP_PORT_DEBUG_TAG, format, ##__VA_ARGS__) +#define LWIP_PORT_DEBUG(format, ...) FT_DEBUG_PRINT_D(LWIP_PORT_DEBUG_TAG, format, ##__VA_ARGS__) +#define LWIP_PORT_WARN(format, ...) FT_DEBUG_PRINT_W(LWIP_PORT_DEBUG_TAG, format, ##__VA_ARGS__) + +/* Define those to better describe your network interface. */ +#define IFNAME0 'f' +#define IFNAME1 't' + +enum ethernet_link_status eth_link_status = ETH_LINK_UNDEFINED; +u32 phyaddrforemac; + +volatile u32 timer_irq_cnt = 0; + +/* + * lwip_port_add: this is a wrapper around lwIP's netif_add function. + * The objective is to provide portability between the different Xilinx MAC's + * This function can be used to add both xps_ethernetlite and xps_ll_temac + * based interfaces + */ +struct netif *lwip_port_add(struct netif *netif, + ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw, + unsigned char *mac_ethernet_address, + unsigned int mac_id) +{ + u8 i; + +#ifdef OS_IS_FREERTOS + /* Start thread to detect link periodically for Hot Plug autodetect */ + sys_thread_new("link_detect_thread", link_detect_thread, netif, + THREAD_STACKSIZE, tskIDLE_PRIORITY); +#endif + + /* set mac address */ + netif->hwaddr_len = NETIF_MAX_HWADDR_LEN; + for (i = 0; i < NETIF_MAX_HWADDR_LEN; i++) + netif->hwaddr[i] = mac_ethernet_address[i]; + + netif->name[0] = IFNAME0; + netif->name[1] = IFNAME1; + + /* initialize based on MAC type */ + return netif_add(netif, +#if LWIP_IPV4 + ipaddr, netmask, gw, +#endif + (void*)(uintptr)mac_id, + + ethernetif_init, + +#if NO_SYS + ethernet_input +#else + tcpip_input +#endif + ); + +} + +#if !NO_SYS +/* + * The input thread calls lwIP to process any received packets. + * This thread waits until a packet is received (sem_rx_data_available), + * and then calls lwip_port_input which processes 1 packet at a time. + */ +void lwip_port_input_thread(struct netif *netif) +{ + struct xmac_netif *emac = (struct xmac_netif *)netif->state; + while (1) { + /* sleep until there are packets to process + * This semaphore is set by the packet receive interrupt + * routine. + */ + sys_sem_wait(&emac->sem_rx_data_available); + + /* move all received packets to lwIP */ + lwip_port_input(netif); + } +} +#endif + +void lwip_port_input(struct netif *netif) +{ + ethernetif_input(netif); +} + +#if defined(CONFIG_LWIP_FXMAC) +static u32 phy_link_detect(FXmac *instance_p, u32 phy_addr) +{ + u16 status; + + /* Read Phy Status register twice to get the confirmation of the current + * link status. + */ + + FXmacPhyRead(instance_p, phy_addr, PHY_STATUS_REG_OFFSET, &status); + FXmacPhyRead(instance_p, phy_addr, PHY_STATUS_REG_OFFSET, &status); + + if (status & PHY_STAT_LINK_STATUS) + return 1; + return 0; +} + +static u32 phy_autoneg_status(FXmac *instance_p, u32 phy_addr) +{ + u16 status; + + /* Read Phy Status register twice to get the confirmation of the current + * link status. + */ + FXmacPhyRead(instance_p, phy_addr, PHY_STATUS_REG_OFFSET, &status); + FXmacPhyRead(instance_p, phy_addr, PHY_STATUS_REG_OFFSET, &status); + + if (status & PHY_STATUS_AUTONEGOTIATE_COMPLETE) + return 1; + return 0; +} + + + +void lwip_port_link_detect(struct netif *netif) +{ + u32 link_speed, phy_link_status; + struct xmac_netif *xmac_netif_p = (struct xmac_netif *)(netif->state); + ethernetif *ethernetif_p = (ethernetif *)(xmac_netif_p->state); + FXmac *instance_p = ðernetif_p->xmac_ctrl; + + if ((instance_p->is_ready != (u32)FT_COMPONENT_IS_READY) || + (eth_link_status == ETH_LINK_UNDEFINED)) + return; + + phy_link_status = phy_link_detect(instance_p, phyaddrforemac); + + if ((eth_link_status == ETH_LINK_UP) && (!phy_link_status)) + eth_link_status = ETH_LINK_DOWN; + + switch (eth_link_status) { + case ETH_LINK_UNDEFINED: + case ETH_LINK_UP: + return; + case ETH_LINK_DOWN: + netif_set_link_down(netif); + eth_link_status = ETH_LINK_NEGOTIATING; + LWIP_PORT_DEBUG("Ethernet Link down"); + break; + case ETH_LINK_NEGOTIATING: + if (phy_link_status && phy_autoneg_status(instance_p, phyaddrforemac)) + { + /* Initiate Phy setup to get link speed */ + netif_set_link_up(netif); + eth_link_status = ETH_LINK_UP; + LWIP_PORT_DEBUG("Ethernet Link up"); + } + break; + } +} + +#else + +static u32 phy_link_detect(FGmac *instance_p, u32 phy_addr) +{ + u16 status; + + /* Read Phy Status register twice to get the confirmation of the current + * link status. + */ + FGmacReadPhyReg(instance_p, instance_p->phy_addr, FGMAC_PHY_MII_STATUS_REG, &status); + FGmacReadPhyReg(instance_p, instance_p->phy_addr, FGMAC_PHY_MII_STATUS_REG, &status); + + if (status & FGMAC_PHY_MII_SR_LSTATUS) + return 1; + return 0; +} + +static u32 phy_autoneg_status(FGmac *instance_p, u32 phy_addr) +{ + u16 status; + + /* Read Phy Status register twice to get the confirmation of the current + * link status. + */ + FGmacReadPhyReg(instance_p, instance_p->phy_addr, FGMAC_PHY_MII_STATUS_REG, &status); + FGmacReadPhyReg(instance_p, instance_p->phy_addr, FGMAC_PHY_MII_STATUS_REG, &status); + + if (status & FGMAC_PHY_MII_SR_AUTO_NEGOT_COMPLETE) + return 1; + return 0; +} + +void lwip_port_link_detect(struct netif *netif) +{ + u32 link_speed, phy_link_status; + enum ethernet_link_status link_status; + + ethernetif *mac_netif = (ethernetif *)(netif->state); + FGmac *instance_p = mac_netif->ethctrl; + + if (instance_p->is_ready != FT_COMPONENT_IS_READY) + { + LWIP_PORT_ERROR("instance_p is not ready\n"); + return; + } + + /* read gmac phy link status */ + phy_link_status = phy_link_detect(instance_p, instance_p->phy_addr); + link_status = phy_link_status ? ETH_LINK_UP : ETH_LINK_DOWN; + + /* if the link status is changed */ + if(eth_link_status != link_status) + eth_link_status = link_status; + else + return; + + switch (eth_link_status) + { + case ETH_LINK_UP: + if (phy_link_status && phy_autoneg_status(instance_p, instance_p->phy_addr)) + { + netif_set_link_up(netif); + eth_link_status = ETH_LINK_UP; + LWIP_PORT_DEBUG("Ethernet Link up\r\n"); + } + break; + case ETH_LINK_DOWN: + netif_set_link_down(netif); + LWIP_PORT_DEBUG("Ethernet Link down\r\n"); + break; + default: + break; + } + + return; +} + + +void lwip_port_start(struct netif *netif) +{ + u32 link_speed, phy_link_status; + enum ethernet_link_status link_status; + + ethernetif *mac_netif = (ethernetif *)(netif->state); + FGmac *instance_p = mac_netif->ethctrl; + + if (instance_p->is_ready != FT_COMPONENT_IS_READY) + { + LWIP_PORT_ERROR("instance_p is not ready\n"); + return; + } + FGmacStartTrans(instance_p); +} + +void lwip_port_stop(struct netif *netif) +{ + u32 link_speed, phy_link_status; + enum ethernet_link_status link_status; + + ethernetif *mac_netif = (ethernetif *)(netif->state); + FGmac *instance_p = mac_netif->ethctrl; + + if (instance_p->is_ready != FT_COMPONENT_IS_READY) + { + LWIP_PORT_ERROR("instance_p is not ready\n"); + return; + } + + FGmacStopTrans(instance_p); +} + +#endif + +/** +* @brief Returns the current time in milliseconds +* when LWIP_TIMERS == 1 and NO_SYS == 1 +* @param None +* @retval Time +*/ +u32_t sys_now(void) +{ + return GenericGetTick(); +} + +#ifdef OS_IS_FREERTOS +void link_detect_thread(void *p) +{ + struct netif *netif = (struct netif *) p; + + while (1) { + /* Call lwip_port_link_detect() every second to detect Ethernet link + * change. + */ + lwip_port_link_detect(netif); + vTaskDelay(LINK_DETECT_THREAD_INTERVAL / portTICK_RATE_MS); + } +} +#endif diff --git a/third-party/lwip-2.1.2/ports/lwip_port.h b/third-party/lwip-2.1.2/ports/lwip_port.h new file mode 100644 index 0000000000000000000000000000000000000000..16d45f8a5d1718e18b682bf247aa693bc375e5eb --- /dev/null +++ b/third-party/lwip-2.1.2/ports/lwip_port.h @@ -0,0 +1,79 @@ +/* + * Copyright : (C) 2022 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: lwip_port.h + * Date: 2022-04-06 14:46:52 + * LastEditTime: 2022-04-06 14:46:53 + * Description:  This file is for + * + * Modify History: + * Ver   Who        Date         Changes + * ----- ------     --------    -------------------------------------- + */ + +#ifndef __LWIP_PORT_H_ +#define __LWIP_PORT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lwipopts.h" + +#if !NO_SYS +#ifdef OS_IS_XILKERNEL +#include "xmk.h" +#endif +#include "lwip/sys.h" +#endif + +#include "lwip/netif.h" +#include "lwip/ip.h" + +struct xmac_netif { + void *state; +#if !NO_SYS + sys_sem_t sem_rx_data_available; +#endif +#if defined(OS_IS_FREERTOS) && defined(__arm__) && !defined(ARMR5) + TimerHandle_t xTimer; +#endif +}; + +enum ethernet_link_status { + ETH_LINK_UNDEFINED = 0, + ETH_LINK_UP, + ETH_LINK_DOWN, + ETH_LINK_NEGOTIATING +}; + +void lwip_port_link_detect(struct netif *netif); +void lwip_port_input(struct netif *netif); +void lwip_port_input_thread(struct netif *netif); +struct netif *lwip_port_add(struct netif *netif, + ip_addr_t *ipaddr, ip_addr_t *netmask, ip_addr_t *gw, + unsigned char *mac_ethernet_address, + unsigned int mac_id); + +void lwip_port_start(struct netif *netif); +void lwip_port_stop(struct netif *netif); + +#if defined(__arm__) || defined(__aarch64__) +void lwip_port_resetrx_on_no_rxdata(struct netif *netif); +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/third-party/openamp/ports/phytium_os_rproc.c b/third-party/openamp/ports/phytium_os_rproc.c index baad5cdb54e3e1d47b8528eff47f8272fd5e0739..91968b42eb3bce019bc3214eb37606be3397e67c 100644 --- a/third-party/openamp/ports/phytium_os_rproc.c +++ b/third-party/openamp/ports/phytium_os_rproc.c @@ -221,7 +221,7 @@ static int PhytiumProcNotify(struct remoteproc *rproc, uint32_t id) #else u32 cpu_id; GetCpuId(&cpu_id); - IpiSend((uintptr)(prproc->kick_dev->irq_info), prproc->ipi_chn_mask); + InterruptCoreInterSend((uintptr)(prproc->kick_dev->irq_info), prproc->ipi_chn_mask); #endif /* RPMSG_NO_IPI */ return 0; diff --git a/third-party/third-party.mk b/third-party/third-party.mk index d591ab423ac202527c5c4e0672a89ba5db364483..d6972a5589e95ccd333999479c3c890dbc2e1aec 100644 --- a/third-party/third-party.mk +++ b/third-party/third-party.mk @@ -1,4 +1,3 @@ - THIRD_PARTY_CUR_DIR := $(FREERTOS_SDK_ROOT)/third-party EXCL_SRC += $(THIRD_PARTY_CUR_DIR)/freertos/portable/MemMang/heap_1.c\ @@ -37,12 +36,25 @@ INC_DIR += $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/include \ $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/include/netif # src code of ports -ifdef CONFIG_ENABLE_FGMAC - INC_DIR += $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/f_gmac \ - $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/f_gmac/arch +ifdef CONFIG_LWIP_FGMAC +INC_DIR += $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/fgmac \ + $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/fgmac/arch \ + $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports + +SRC_DIR += $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/fgmac \ + $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/fgmac/arch \ + $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports +endif + +ifdef CONFIG_LWIP_FXMAC +INC_DIR += $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/fxmac \ + $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/fxmac/arch \ + $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports + +SRC_DIR += $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/fxmac \ + $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/fxmac/arch \ + $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports - SRC_DIR += $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/f_gmac \ - $(THIRD_PARTY_CUR_DIR)/lwip-2.1.2/ports/f_gmac/arch endif endif #CONFIG_USE_LWIP