diff --git a/arch/armv8/aarch32/fmmu.c b/arch/armv8/aarch32/fmmu.c index 275e03aff7768141834538b7e8d51118c9b39747..1d29289b88eaf262300e4b3df6871dff557afc55 100644 --- a/arch/armv8/aarch32/fmmu.c +++ b/arch/armv8/aarch32/fmmu.c @@ -39,12 +39,6 @@ #define CONFIG_MMU_PAGE_SIZE 4096 #endif // !CONFIG_MMU_PAGE_SIZE -/* KB, MB, GB */ -#define KB(x) ((x) << 10) -#define MB(x) (KB(x) << 10) -#define GB(x) (MB(x) << 10) - - /* * Comp.: * ARM Architecture Reference Manual, ARMv7-A and ARMv7-R edition diff --git a/arch/armv8/aarch64/fmmu.h b/arch/armv8/aarch64/fmmu.h index 5422b93e4c2d6f78b700220a0a7b081752aa6209..88bfe40283d2a6848b83b8f012208c64f5999387 100644 --- a/arch/armv8/aarch64/fmmu.h +++ b/arch/armv8/aarch64/fmmu.h @@ -211,13 +211,6 @@ extern "C" #define PTE_BLOCK_DESC_PXN (1ULL << 53) #define PTE_BLOCK_DESC_UXN (1ULL << 54) -/* KB, MB, GB */ -#define KB(x) ((x) << 10) -#define MB(x) (KB(x) << 10) -#define GB(x) (MB(x) << 10) - - - /* * 48-bit address with 4KB granule size: * diff --git a/arch/armv8/aarch64/gcc/fvectors.S b/arch/armv8/aarch64/gcc/fvectors.S index 712013d51157f2f9f52d454b3d7979ed25329ecd..56f9345b55b3690d5b2a673da0ecb0d2553653e6 100644 --- a/arch/armv8/aarch64/gcc/fvectors.S +++ b/arch/armv8/aarch64/gcc/fvectors.S @@ -161,8 +161,11 @@ IRQInterruptHandler: /* Restore the ICCIAR value. */ LDP X0, X1, [SP], #0x10 + /* Use barrier instructions to ensure ordering of memory operations. */ + dsb sy /* End IRQ processing by writing ICCIAR to the EOI register. */ MSR S3_0_C12_C12_1, x0 + isb /* Restore the status of SPSR, ELR and CPTR from stack */ ldr x2,[sp],0x10 diff --git a/common/fkernel.h b/common/fkernel.h index 96f0e01751b1c12cad0a89e478a76148812ecd4f..c4bf1457647b71810f5e355a47a057dc27a1c5b2 100644 --- a/common/fkernel.h +++ b/common/fkernel.h @@ -209,6 +209,16 @@ extern "C" #define NANO_TO_MICRO 1000 #define NANO_TO_KILO 1000000 +/* KB, MB, GB */ +#ifndef KB +#define KB(x) ((x) << 10) +#endif +#ifndef MB +#define MB(x) (KB(x) << 10) +#endif +#ifndef GB +#define GB(x) (MB(x) << 10) +#endif /** * UPPER_32_BITS - return bits 32-63 of a number * @n: the number we're accessing diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index b86450526511e2cec7a5e0157b7033d6d12ee1d1..21931b5df4b48011ef05a6e93297e033e0206905 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,3 +1,40 @@ +# Phytium Standalone SDK 2025-07-28 ChangeLog + +Change Log since 2025-07-28 + +## arch + +- add barrier to solve the gicv3 issue + +# Phytium Standalone SDK 2025-07-25 ChangeLog + +Change Log since 2025-07-25 + +## driver + +- first time add sec rnd driver + +## example + +- add rnd example + +# Phytium Standalone SDK 2025-07-21 ChangeLog + +Change Log since 2025-07-17 + +## arch + +- modify KB, MB, GB definition + +## example + +- update example defination + +## third-party + +- libmetal update to v1.8.0 +- openamp update to v1.8.0 + # Phytium Standalone SDK 2025-07-17 ChangeLog Change Log since 2025-07-15 diff --git a/drivers/drivers.kconfig b/drivers/drivers.kconfig index 235d015eb97bfb35d68c773a1648df651224e52c..d16b405ed325e981c1c6fc52de9ece4fd321753e 100755 --- a/drivers/drivers.kconfig +++ b/drivers/drivers.kconfig @@ -233,6 +233,17 @@ config USE_MEDIA if USE_MEDIA source "$SDK_DIR/drivers/media/Kconfig" endif + +config USE_SEC + bool + prompt "Use SEC" + default n + help + Include SEC drivers + + if USE_SEC + source "$SDK_DIR/drivers/sec/Kconfig" + endif config USE_SCMI_MHU bool diff --git a/drivers/include.mk b/drivers/include.mk index f53273652555c4b7912ce9ad1dfc40bd2effa9cd..1b35e63fa69f6ac6497522a12e97279617e45177 100755 --- a/drivers/include.mk +++ b/drivers/include.mk @@ -191,7 +191,18 @@ ifdef CONFIG_USE_MEDIA endif endif +#sec +ifdef CONFIG_USE_SEC +ifdef CONFIG_USE_FRAND + BUILD_INC_PATH_DIR += $(DRV_CUR_DIR)/sec/rnd +endif + +ifdef CONFIG_USE_FSHA + BUILD_INC_PATH_DIR += $(DRV_CUR_DIR)/sec/sha +endif + +endif #i2s ifdef CONFIG_USE_FI2S diff --git a/drivers/makefile b/drivers/makefile index 14e5806a5955bfb5d8d8e6dd7f9b3cb9ca082fdb..604c302796c8bff4f9fa84971ec03f894217f9c8 100644 --- a/drivers/makefile +++ b/drivers/makefile @@ -25,6 +25,7 @@ include timer/src.mk include watchdog/src.mk include i2s/src.mk include device/src.mk +include sec/src.mk CSRCS_RELATIVE_FILES := $(foreach file, $(DRIVERS_CSRCS), $(wildcard */**/$(file) */$(file))) ASRCS_RELATIVE_FILES := $(foreach file, $(DRIVERS_ASRCS), $(wildcard */**/$(file))) diff --git a/drivers/sec/Kconfig b/drivers/sec/Kconfig new file mode 100644 index 0000000000000000000000000000000000000000..cc58304956cdbc47c71f1a6f830daca4d4daedbe --- /dev/null +++ b/drivers/sec/Kconfig @@ -0,0 +1,11 @@ +menu "SEC Configuration" +config ENABLE_FRND + bool + prompt "Use FRND" + default n + +config ENABLE_FSHA + bool + prompt "Use FSHA" + default n +endmenu \ No newline at end of file diff --git a/drivers/sec/src.mk b/drivers/sec/src.mk new file mode 100644 index 0000000000000000000000000000000000000000..45abd0d83ec6b945a9f8e9fdc4a613cc505361db --- /dev/null +++ b/drivers/sec/src.mk @@ -0,0 +1,12 @@ +ifdef CONFIG_ENABLE_FRND +DRIVERS_CSRCS += +endif + +ifdef CONFIG_ENABLE_FSHA +DRIVERS_CSRCS += +endif + + + + + diff --git a/example/peripherals/dma/gdma/sdkconfig b/example/peripherals/dma/gdma/sdkconfig index a770280a8e10c585ff183ff6baff78bff89a12dd..9e3926473a1066f332e8120dbdff3db001e233b5 100644 --- a/example/peripherals/dma/gdma/sdkconfig +++ b/example/peripherals/dma/gdma/sdkconfig @@ -75,7 +75,7 @@ CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # # Board Configuration # -CONFIG_BOARD_NAME="phytiumpi" +CONFIG_BOARD_NAME="demo" # CONFIG_USE_SPI_IOPAD is not set # CONFIG_USE_GPIO_IOPAD is not set # CONFIG_USE_CAN_IOPAD is not set @@ -85,14 +85,14 @@ CONFIG_BOARD_NAME="phytiumpi" # CONFIG_USE_TACHO_IOPAD is not set # CONFIG_USE_UART_IOPAD is not set # CONFIG_USE_THIRD_PARTY_IOPAD is not set -# CONFIG_E2000Q_DEMO_BOARD is not set -CONFIG_PHYTIUMPI_FIREFLY_BOARD=y +CONFIG_E2000Q_DEMO_BOARD=y # # IO mux configuration when board start up # # end of IO mux configuration when board start up +# CONFIG_PHYTIUMPI_FIREFLY_BOARD is not set # CONFIG_CUS_DEMO_BOARD is not set # @@ -108,9 +108,9 @@ CONFIG_TARGET_NAME="gdma" CONFIG_ELOG_LINE_BUF_SIZE=0x100 # CONFIG_LOG_VERBOS is not set # CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set +CONFIG_LOG_INFO=y # CONFIG_LOG_WARN is not set -CONFIG_LOG_ERROR=y +# CONFIG_LOG_ERROR is not set # CONFIG_LOG_NONE is not set # CONFIG_LOG_EXTRA_INFO is not set # CONFIG_LOG_DISPALY_CORE_NUM is not set @@ -158,6 +158,7 @@ CONFIG_ENABLE_FGDMA=y # CONFIG_USE_PWM is not set # CONFIG_USE_IPC is not set # CONFIG_USE_MEDIA is not set +# CONFIG_USE_SEC is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set # CONFIG_USE_I3C is not set diff --git a/example/peripherals/i2c/i2c/sdkconfig b/example/peripherals/i2c/i2c/sdkconfig index 9ca953d5ebbb5225f0bfd6a29f64d8f03fc85f20..4f1c554dd60d9ae3f9528b6677da13ff31b14edc 100644 --- a/example/peripherals/i2c/i2c/sdkconfig +++ b/example/peripherals/i2c/i2c/sdkconfig @@ -165,6 +165,7 @@ CONFIG_ENABLE_MIO=y # CONFIG_USE_PWM is not set # CONFIG_USE_IPC is not set # CONFIG_USE_MEDIA is not set +# CONFIG_USE_SEC is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set # CONFIG_USE_I3C is not set diff --git a/example/peripherals/pin/sdkconfig b/example/peripherals/pin/sdkconfig index cb5a3b38115e63eef4cd0b250da0cc6de8e8b4ae..f11847c6ec8fbd5667ed12bf3d71a129a042280e 100644 --- a/example/peripherals/pin/sdkconfig +++ b/example/peripherals/pin/sdkconfig @@ -70,6 +70,7 @@ CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # @@ -157,6 +158,7 @@ CONFIG_ENABLE_FGPIO=y # CONFIG_USE_PWM is not set # CONFIG_USE_IPC is not set # CONFIG_USE_MEDIA is not set +# CONFIG_USE_SEC is not set # CONFIG_USE_SCMI_MHU is not set # CONFIG_USE_I2S is not set # CONFIG_USE_I3C is not set diff --git a/example/peripherals/pin/sdkconfig.h b/example/peripherals/pin/sdkconfig.h index bd09e5c878432ad8b942b5e09de101a99a023659..3c6e0e72a2bfd28ca6d4214791486c5710e7cf05 100644 --- a/example/peripherals/pin/sdkconfig.h +++ b/example/peripherals/pin/sdkconfig.h @@ -66,6 +66,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ @@ -145,6 +146,7 @@ /* CONFIG_USE_PWM is not set */ /* CONFIG_USE_IPC is not set */ /* CONFIG_USE_MEDIA is not set */ +/* CONFIG_USE_SEC is not set */ /* CONFIG_USE_SCMI_MHU is not set */ /* CONFIG_USE_I2S is not set */ /* CONFIG_USE_I3C is not set */ diff --git a/example/peripherals/sec/rnd/Kconfig b/example/peripherals/sec/rnd/Kconfig new file mode 100644 index 0000000000000000000000000000000000000000..118209a55966b6514d825108a15c554fd56fc13d --- /dev/null +++ b/example/peripherals/sec/rnd/Kconfig @@ -0,0 +1,17 @@ +mainmenu "Phytium Baremetal Configuration" + + menu "Project Configuration" + + menu " Baremetal Configuration" + config TARGET_NAME + string "Build Target Name" + default "rnd" + help + Build Target name for the demo + + endmenu + +endmenu + + +source "$(SDK_DIR)/standalone.kconfig" diff --git a/example/peripherals/sec/rnd/README.md b/example/peripherals/sec/rnd/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f3ed091fbf99efac303113decc0250c88caf5435 --- /dev/null +++ b/example/peripherals/sec/rnd/README.md @@ -0,0 +1,131 @@ +# SEC RND测试 + +## 1. 例程介绍 + +> ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作 `
` + +注:飞腾派SEC安全控制器,PE220x有1个RND控制器。 + +RND测试例程 (fsecrnd_test_example.c) + +- 初始化RND基本配置 +- 对随机数进行配置,设置为PTRNG模式 +- 打开使能是时钟及随机数产生控制位 +- 随机数数据地址生成随机数 + + + +## 2. 如何使用例程 + +> ``描述开发平台准备,使用例程配置,构建和下载镜像的过程 `
` + +本例程需要以下硬件, + +- 准备PE220x demo板,PhytiumPi其中一块开发板 +- 串口线和串口上位机 + + +### 2.1 硬件配置方法 + +- 连接串口,开始测试。 + + +### 2.2 SDK配置方法 + +> ``依赖哪些驱动、库和第三方组件,如何完成配置(列出需要使能的关键配置项)`
` + +- 使能SEC `CONFIG_USE_SEC`, 然后选择FRND驱动 `CONFIG_ENABLE_FRND` +- 使能Letter Shell `CONFIG_USE_LETTER_SHELL`, 然后选择UART驱动 `CONFIG_LS_PL011_UART` + +对应的配置项是, + +- Use SEC +- Use FRND +- Use Letter Shell + +本例子已经提供好具体的编译指令,以下进行介绍: + 1. make 将目录下的工程进行编译 + 2. make clean 将目录下的工程进行清理 + 3. make image 将目录下的工程进行编译,并将生成的elf 复制到目标地址 + 4. make list_kconfig 当前工程支持哪些配置文件 + 5. make load_kconfig LOAD_CONFIG_NAME=`` 将预设配置加载至工程中 + 6. make menuconfig 配置目录下的参数变量 + 7. make backup_kconfig 将目录下的sdkconfig 备份到./configs下 + +具体使用方法为: + +- 在当前目录下 +- 执行以上指令 + +### 2.3 构建和下载 + +> ``描述构建、烧录下载镜像的过程,列出相关的命令 `
` + +- 在host侧完成配置 + +配置成PE220x,对于其它平台,使用对应的默认配置,如PE220x: + +``` +$ make load_kconfig LOAD_CONFIG_NAME=pe2204_aarch64_demo_rnd +``` + +- 在host侧完成构建 + +``` +$ make image +``` + +- host侧设置重启host侧tftp服务器 + +``` +sudo service tftpd-hpa restart +``` + +- 开发板侧使用bootelf命令跳转 + +``` +setenv ipaddr 192.168.4.20 +setenv serverip 192.168.4.50 +setenv gatewayip 192.168.4.1 +tftpboot 0x90100000 baremetal.elf +bootelf -p 0x90100000 +``` + +### 2.4 输出与实验现象 + +> ``描述输入输出情况,列出存在哪些输出,对应的输出是什么(建议附录相关现象图片)`
` + +#### 2.4.1 RND测试默认生成100个随机数例程 + +``` +$ rnd ptrng +``` +默认输出100个随机数 + +![rnd_ptng_default](./fig/rnd_ptng_default.png) + +![rnd_ptng_default2](./fig/rnd_ptng_default2.png) + +#### 2.4.2 RND测试默认指定生成n个随机数例程 + +``` +$ rnd ptrng 16 +``` +指定生成16个(可更改小于4096)随机数 + +![rng_ptng_16byte](./fig/rng_ptng_16byte.png) + + +## 3. 如何解决问题 + +> ``主要记录使用例程中可能会遇到的问题,给出相应的解决方案 `
` + +### 3.1 查看生成随机数 + +- 如默认用例不输出显示随机数,若需要,make menuconfig修改打印Debug log level为info + +![fsec_print_info](./fig/fsec_print_info.png) + +## 4. 修改历史记录 + +> ``记录例程的重大修改记录,标明修改发生的版本号 `
` diff --git a/example/peripherals/sec/rnd/configs/pe2202_aarch32_demo_rnd.config b/example/peripherals/sec/rnd/configs/pe2202_aarch32_demo_rnd.config new file mode 100644 index 0000000000000000000000000000000000000000..fc00526641a84b0fc535612b1997c67fbcc64bdd --- /dev/null +++ b/example/peripherals/sec/rnd/configs/pe2202_aarch32_demo_rnd.config @@ -0,0 +1,259 @@ + +# +# Project Configuration +# + +# +# Baremetal Configuration +# +CONFIG_TARGET_NAME="rnd" +# end of Baremetal Configuration +# end of Project Configuration + +CONFIG_USE_BAREMETAL=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +# CONFIG_ARCH_ARMV8_AARCH64 is not set +CONFIG_ARCH_ARMV8_AARCH32=y + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH32=y +CONFIG_ARCH_EXECUTION_STATE="aarch32" + +# +# Fpu configuration +# +CONFIG_CRYPTO_NEON_FP_ARMV8=y +# CONFIG_VFPV4 is not set +# CONFIG_VFPV4_D16 is not set +# CONFIG_VFPV3 is not set +# CONFIG_VFPV3_D16 is not set +CONFIG_ARM_MFPU="crypto-neon-fp-armv8" +CONFIG_MFLOAT_ABI_HARD=y +# CONFIG_MFLOAT_ABI_SOFTFP is not set +CONFIG_ARM_MFLOAT_ABI="hard" +# end of Fpu configuration +# end of Compiler configuration + +CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# end of Arm architecture configuration + +CONFIG_MMU_PAGE_SIZE=0x1000 +CONFIG_FMMU_NUM_L2_TABLES=256 +# end of Arch configuration + +# +# Soc configuration +# +# CONFIG_TARGET_PHYTIUMPI is not set +# CONFIG_TARGET_E2000Q is not set +CONFIG_TARGET_PE2202=y +# CONFIG_TARGET_E2000S is not set +# CONFIG_TARGET_FT2004 is not set +# CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_PD2308 is not set +# CONFIG_TARGET_QEMU_VIRT is not set +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2202" +CONFIG_SOC_CORE_NUM=2 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Soc configuration + +# +# Board Configuration +# +CONFIG_E2000D_DEMO_BOARD=y +CONFIG_BOARD_NAME="demo" + +# +# IO mux configuration when board start up +# +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_ADC_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +CONFIG_USE_UART_IOPAD=y +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +CONFIG_ELOG_LINE_BUF_SIZE=0x100 +# 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_LOG_EXTRA_INFO is not set +CONFIG_LOG_DISPALY_CORE_NUM=y +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +# CONFIG_INTERRUPT_ROLE_MASTER is not set +CONFIG_INTERRUPT_ROLE_SLAVE=y +# CONFIG_INTERRUPT_ROLE_NONE is not set +# end of Sdk common configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI 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_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO 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_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +CONFIG_USE_SEC=y + +# +# SEC Configuration +# +CONFIG_ENABLE_FRND=y +# end of SEC Configuration + +# CONFIG_USE_SCMI_MHU is not set +# CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set +# end of Drivers configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP 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 + +# CONFIG_USE_AMP is not set +# CONFIG_USE_YMODEM is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_FATFS_0_1_4 is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_FSL_SDMMC is not set +# CONFIG_USE_MICROPYTHON is not set +# CONFIG_USE_TINYMAIX is not set +# CONFIG_USE_CHERRY_USB is not set +# CONFIG_USE_CMSIS is not set +# end of Third-party configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +CONFIG_OUTPUT_BINARY=y + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +# CONFIG_WALL_WARNING_ERROR is not set +# CONFIG_STRICT_PROTOTYPES is not set +CONFIG_DEBUG_SYMBOLS=y +# CONFIG_FRAME_POINTER is not set +# CONFIG_OUTPUT_ASM_DIS is not set +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USE_NEWLIB is not set +# CONFIG_USE_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0xb0100000 +CONFIG_IMAGE_MAX_LENGTH=0x1000000 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x4000 +# end of Linker Options +# end of Build setup diff --git a/example/peripherals/sec/rnd/configs/pe2202_aarch64_demo_rnd.config b/example/peripherals/sec/rnd/configs/pe2202_aarch64_demo_rnd.config new file mode 100644 index 0000000000000000000000000000000000000000..7452710f20de55848b1a7581ae398ce443dbe4af --- /dev/null +++ b/example/peripherals/sec/rnd/configs/pe2202_aarch64_demo_rnd.config @@ -0,0 +1,258 @@ + +# +# Project Configuration +# + +# +# Baremetal Configuration +# +CONFIG_TARGET_NAME="rnd" +# end of Baremetal Configuration +# end of Project Configuration + +CONFIG_USE_BAREMETAL=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +CONFIG_ARCH_ARMV8_AARCH64=y +# CONFIG_ARCH_ARMV8_AARCH32 is not set + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_ARCH_EXECUTION_STATE="aarch64" +CONFIG_ARM_NEON=y +CONFIG_ARM_CRC=y +CONFIG_ARM_CRYPTO=y +CONFIG_ARM_FLOAT_POINT=y +# CONFIG_GCC_CODE_MODEL_TINY is not set +CONFIG_GCC_CODE_MODEL_SMALL=y +# CONFIG_GCC_CODE_MODEL_LARGE is not set +# end of Compiler configuration + +# CONFIG_BOOT_WITH_FLUSH_CACHE is not set +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arm architecture configuration + +CONFIG_MMU_PAGE_SIZE=0x1000 +CONFIG_MAX_XLAT_TABLES=256 +# end of Arch configuration + +# +# Soc configuration +# +# CONFIG_TARGET_PHYTIUMPI is not set +# CONFIG_TARGET_E2000Q is not set +CONFIG_TARGET_PE2202=y +# CONFIG_TARGET_E2000S is not set +# CONFIG_TARGET_FT2004 is not set +# CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_PD2308 is not set +# CONFIG_TARGET_QEMU_VIRT is not set +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2202" +CONFIG_SOC_CORE_NUM=2 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Soc configuration + +# +# Board Configuration +# + +CONFIG_BOARD_NAME="demo" + +# +# IO mux configuration when board start up +# +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_ADC_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +CONFIG_USE_UART_IOPAD=y +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_E2000D_DEMO_BOARD=y +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +CONFIG_ELOG_LINE_BUF_SIZE=0x100 +# 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_LOG_EXTRA_INFO is not set +CONFIG_LOG_DISPALY_CORE_NUM=y +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_NS_GTIMER=y +# CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_INTERRUPT_ROLE_NONE is not set +# end of Sdk common configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI 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_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO 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_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +CONFIG_USE_SEC=y + +# +# SEC Configuration +# +CONFIG_ENABLE_FRND=y +# end of SEC Configuration + +# CONFIG_USE_SCMI_MHU is not set +# CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set +# CONFIG_USE_MSG is not set +# CONFIG_USE_DEVICE is not set +# end of Drivers configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP 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 + +# CONFIG_USE_AMP is not set +# CONFIG_USE_YMODEM is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_FATFS_0_1_4 is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_FSL_SDMMC is not set +# CONFIG_USE_MICROPYTHON is not set +# CONFIG_USE_TINYMAIX is not set +# CONFIG_USE_CHERRY_USB is not set +# CONFIG_USE_CMSIS is not set +# end of Third-party configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +CONFIG_OUTPUT_BINARY=y + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +CONFIG_WALL_WARNING_ERROR=y +# CONFIG_STRICT_PROTOTYPES is not set +CONFIG_DEBUG_SYMBOLS=y +# CONFIG_FRAME_POINTER is not set +CONFIG_OUTPUT_ASM_DIS=y +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USE_NEWLIB is not set +# CONFIG_USE_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0xb0100000 +CONFIG_IMAGE_MAX_LENGTH=0x1000000 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x4000 +# end of Linker Options +# end of Build setup diff --git a/example/peripherals/sec/rnd/configs/pe2204_aarch32_demo_rnd.config b/example/peripherals/sec/rnd/configs/pe2204_aarch32_demo_rnd.config new file mode 100644 index 0000000000000000000000000000000000000000..1c5c215d9fd3ce846711771ed4e5252237e44ae9 --- /dev/null +++ b/example/peripherals/sec/rnd/configs/pe2204_aarch32_demo_rnd.config @@ -0,0 +1,274 @@ + +# +# Project Configuration +# + +# +# Baremetal Configuration +# +CONFIG_TARGET_NAME="rnd" +# end of Baremetal Configuration +# end of Project Configuration + +CONFIG_USE_BAREMETAL=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +# CONFIG_ARCH_ARMV8_AARCH64 is not set +CONFIG_ARCH_ARMV8_AARCH32=y + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH32=y +CONFIG_ARCH_EXECUTION_STATE="aarch32" + +# +# Fpu configuration +# +CONFIG_CRYPTO_NEON_FP_ARMV8=y +# CONFIG_VFPV4 is not set +# CONFIG_VFPV4_D16 is not set +# CONFIG_VFPV3 is not set +# CONFIG_VFPV3_D16 is not set +CONFIG_ARM_MFPU="crypto-neon-fp-armv8" +CONFIG_MFLOAT_ABI_HARD=y +# CONFIG_MFLOAT_ABI_SOFTFP is not set +CONFIG_ARM_MFLOAT_ABI="hard" +# end of Fpu configuration +# end of Compiler configuration + +CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# end of Arm architecture configuration + +# +# multi-core system deployment framework +# +# CONFIG_USE_MSDF is not set +# end of multi-core system deployment framework + +CONFIG_MMU_PAGE_SIZE_4K=y +# CONFIG_MMU_PAGE_SIZE_16K is not set +# CONFIG_MMU_PAGE_SIZE_64K is not set +CONFIG_MMU_PAGE_SIZE=0x1000 +CONFIG_MAX_XLAT_TABLES=256 +# CONFIG_ENABLE_GIC_ITS is not set +# end of Arch configuration + +# +# Soc configuration +# +CONFIG_TARGET_PE2204=y +# CONFIG_TARGET_PE2202 is not set +# CONFIG_TARGET_PE2201 is not set +# CONFIG_TARGET_PD1904 is not set +# CONFIG_TARGET_PD2008 is not set +# CONFIG_TARGET_PD2308 is not set +# CONFIG_TARGET_PS2316 is not set +# CONFIG_TARGET_PD2408 is not set +# CONFIG_TARGET_QEMU_VIRT is not set +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Soc configuration + +# +# Board Configuration +# +CONFIG_BOARD_NAME="demo" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +CONFIG_USE_UART_IOPAD=y +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_E2000Q_DEMO_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_PHYTIUMPI_FIREFLY_BOARD is not set +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +CONFIG_ELOG_LINE_BUF_SIZE=0x100 +# 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_LOG_EXTRA_INFO is not set +# CONFIG_LOG_DISPALY_CORE_NUM is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_NS_GTIMER=y +# CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_INTERRUPT_ROLE_NONE is not set +# end of Sdk common configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI 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_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO 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_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +CONFIG_USE_SEC=y + +# +# SEC Configuration +# +CONFIG_ENABLE_FRND=y +# end of SEC Configuration + +# CONFIG_USE_SCMI_MHU is not set +# CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set +# CONFIG_USE_MSG is not set +# CONFIG_USE_DEVICE is not set +# end of Drivers configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP 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 + +# CONFIG_USE_AMP is not set +# CONFIG_USE_YMODEM is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_FATFS_0_1_4 is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_FSL_SDMMC is not set +# CONFIG_USE_MICROPYTHON is not set +# CONFIG_USE_TINYMAIX is not set +# CONFIG_USE_CHERRY_USB is not set +# CONFIG_USE_CMSIS is not set +# end of Third-party configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +CONFIG_OUTPUT_BINARY=y + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +CONFIG_WALL_WARNING_ERROR=y +# CONFIG_STRICT_PROTOTYPES is not set +CONFIG_DEBUG_SYMBOLS=y +# CONFIG_FRAME_POINTER is not set +CONFIG_OUTPUT_ASM_DIS=y +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USE_NEWLIB is not set +# CONFIG_USE_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0xb0100000 +CONFIG_IMAGE_MAX_LENGTH=0x1000000 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x4000 +# end of Linker Options +# end of Build setup diff --git a/example/peripherals/sec/rnd/configs/pe2204_aarch32_phytiumpi_rnd.config b/example/peripherals/sec/rnd/configs/pe2204_aarch32_phytiumpi_rnd.config new file mode 100644 index 0000000000000000000000000000000000000000..7d641988c7187ff5d3de5fe186e0ae4d9736d4a1 --- /dev/null +++ b/example/peripherals/sec/rnd/configs/pe2204_aarch32_phytiumpi_rnd.config @@ -0,0 +1,259 @@ + +# +# Project Configuration +# + +# +# Baremetal Configuration +# +CONFIG_TARGET_NAME="rnd" +# end of Baremetal Configuration +# end of Project Configuration + +CONFIG_USE_BAREMETAL=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +# CONFIG_ARCH_ARMV8_AARCH64 is not set +CONFIG_ARCH_ARMV8_AARCH32=y + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH32=y +CONFIG_ARCH_EXECUTION_STATE="aarch32" + +# +# Fpu configuration +# +CONFIG_CRYPTO_NEON_FP_ARMV8=y +# CONFIG_VFPV4 is not set +# CONFIG_VFPV4_D16 is not set +# CONFIG_VFPV3 is not set +# CONFIG_VFPV3_D16 is not set +CONFIG_ARM_MFPU="crypto-neon-fp-armv8" +CONFIG_MFLOAT_ABI_HARD=y +# CONFIG_MFLOAT_ABI_SOFTFP is not set +CONFIG_ARM_MFLOAT_ABI="hard" +# end of Fpu configuration +# end of Compiler configuration + +CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# end of Arm architecture configuration + +CONFIG_MMU_PAGE_SIZE=0x1000 +CONFIG_FMMU_NUM_L2_TABLES=256 +# end of Arch configuration + +# +# Soc configuration +# +CONFIG_PHYTIUMPI_FIREFLY_BOARD=y +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +# CONFIG_TARGET_FT2004 is not set +# CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_PD2308 is not set +# CONFIG_TARGET_QEMU_VIRT is not set +CONFIG_SOC_NAME="phytiumpi" +CONFIG_SOC_CORE_NUM=4 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Soc configuration + +# +# Board Configuration +# +CONFIG_BOARD_NAME="phytiumpi_firefly" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +CONFIG_USE_UART_IOPAD=y +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_FIREFLY_DEMO_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +CONFIG_ELOG_LINE_BUF_SIZE=0x100 +# 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_LOG_EXTRA_INFO is not set +CONFIG_LOG_DISPALY_CORE_NUM=y +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +# CONFIG_INTERRUPT_ROLE_MASTER is not set +CONFIG_INTERRUPT_ROLE_SLAVE=y +# CONFIG_INTERRUPT_ROLE_NONE is not set +# end of Sdk common configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI 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_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO 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_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +CONFIG_USE_SEC=y + +# +# SEC Configuration +# +CONFIG_ENABLE_FRND=y +# end of SEC Configuration + +# CONFIG_USE_SCMI_MHU is not set +# CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set +# CONFIG_USE_MSG is not set +# CONFIG_USE_DEVICE is not set +# end of Drivers configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP 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 + +# CONFIG_USE_AMP is not set +# CONFIG_USE_YMODEM is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_FATFS_0_1_4 is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_FSL_SDMMC is not set +# CONFIG_USE_MICROPYTHON is not set +# CONFIG_USE_TINYMAIX is not set +# CONFIG_USE_CHERRY_USB is not set +# CONFIG_USE_CMSIS is not set +# end of Third-party configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +# CONFIG_OUTPUT_BINARY is not set + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +# CONFIG_WALL_WARNING_ERROR is not set +# CONFIG_STRICT_PROTOTYPES is not set +CONFIG_DEBUG_SYMBOLS=y +# CONFIG_FRAME_POINTER is not set +# CONFIG_OUTPUT_ASM_DIS is not set +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USE_NEWLIB is not set +# CONFIG_USE_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0xb0100000 +CONFIG_IMAGE_MAX_LENGTH=0x1000000 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x4000 +# end of Linker Options +# end of Build setup diff --git a/example/peripherals/sec/rnd/configs/pe2204_aarch64_demo_rnd.config b/example/peripherals/sec/rnd/configs/pe2204_aarch64_demo_rnd.config new file mode 100644 index 0000000000000000000000000000000000000000..5ed3768e911c82357af374eaa6d06b6bd7946f48 --- /dev/null +++ b/example/peripherals/sec/rnd/configs/pe2204_aarch64_demo_rnd.config @@ -0,0 +1,258 @@ + +# +# Project Configuration +# + +# +# Baremetal Configuration +# +CONFIG_TARGET_NAME="rnd" +# end of Baremetal Configuration +# end of Project Configuration + +CONFIG_USE_BAREMETAL=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +CONFIG_ARCH_ARMV8_AARCH64=y +# CONFIG_ARCH_ARMV8_AARCH32 is not set + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_ARCH_EXECUTION_STATE="aarch64" +CONFIG_ARM_NEON=y +CONFIG_ARM_CRC=y +CONFIG_ARM_CRYPTO=y +CONFIG_ARM_FLOAT_POINT=y +# CONFIG_GCC_CODE_MODEL_TINY is not set +CONFIG_GCC_CODE_MODEL_SMALL=y +# CONFIG_GCC_CODE_MODEL_LARGE is not set +# end of Compiler configuration + +# CONFIG_BOOT_WITH_FLUSH_CACHE is not set +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arm architecture configuration + +CONFIG_MMU_PAGE_SIZE=0x1000 +CONFIG_MAX_XLAT_TABLES=256 +# end of Arch configuration + +# +# Soc configuration +# +CONFIG_TARGET_PE2204=y +# CONFIG_TARGET_PE2202 is not set +# CONFIG_TARGET_PE2201 is not set +# CONFIG_TARGET_PD1904 is not set +# CONFIG_TARGET_PD2008 is not set +# CONFIG_TARGET_PD2308 is not set +# CONFIG_TARGET_PS2316 is not set +# CONFIG_TARGET_PD2408 is not set +# CONFIG_TARGET_QEMU_VIRT is not set +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Soc configuration + +# +# Board Configuration +# +CONFIG_BOARD_NAME="demo" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +CONFIG_USE_UART_IOPAD=y +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_E2000Q_DEMO_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_PHYTIUMPI_FIREFLY_BOARD is not set +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +CONFIG_ELOG_LINE_BUF_SIZE=0x100 +# 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_VERBOS=y +# CONFIG_LOG_NONE is not set +# CONFIG_LOG_EXTRA_INFO is not set +# CONFIG_LOG_DISPALY_CORE_NUM is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_NS_GTIMER=y +# CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_INTERRUPT_ROLE_NONE is not set +# end of Sdk common configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI 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_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO 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_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +CONFIG_USE_SEC=y + +# +# SEC Configuration +# +CONFIG_ENABLE_FRND=y +# end of SEC Configuration + +# CONFIG_USE_SCMI_MHU is not set +# CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set +# CONFIG_USE_MSG is not set +# CONFIG_USE_DEVICE is not set +# end of Drivers configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP 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 + +# CONFIG_USE_AMP is not set +# CONFIG_USE_YMODEM is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_FATFS_0_1_4 is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_FSL_SDMMC is not set +# CONFIG_USE_MICROPYTHON is not set +# CONFIG_USE_TINYMAIX is not set +# CONFIG_USE_CHERRY_USB is not set +# CONFIG_USE_CMSIS is not set +# end of Third-party configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +CONFIG_OUTPUT_BINARY=y + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +CONFIG_WALL_WARNING_ERROR=y +# CONFIG_STRICT_PROTOTYPES is not set +CONFIG_DEBUG_SYMBOLS=y +# CONFIG_FRAME_POINTER is not set +CONFIG_OUTPUT_ASM_DIS=y +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USE_NEWLIB is not set +# CONFIG_USE_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0xb0100000 +CONFIG_IMAGE_MAX_LENGTH=0x1000000 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x4000 +# end of Linker Options +# end of Build setup diff --git a/example/peripherals/sec/rnd/configs/pe2204_aarch64_phytiumpi_rnd.config b/example/peripherals/sec/rnd/configs/pe2204_aarch64_phytiumpi_rnd.config new file mode 100644 index 0000000000000000000000000000000000000000..bb90a127a5642d3ed3cad559f0aff94f6d25e508 --- /dev/null +++ b/example/peripherals/sec/rnd/configs/pe2204_aarch64_phytiumpi_rnd.config @@ -0,0 +1,253 @@ + +# +# Project Configuration +# + +# +# Baremetal Configuration +# +CONFIG_TARGET_NAME="rnd" +# end of Baremetal Configuration +# end of Project Configuration + +CONFIG_USE_BAREMETAL=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +CONFIG_ARCH_ARMV8_AARCH64=y +# CONFIG_ARCH_ARMV8_AARCH32 is not set + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_ARCH_EXECUTION_STATE="aarch64" +CONFIG_ARM_NEON=y +CONFIG_ARM_CRC=y +CONFIG_ARM_CRYPTO=y +CONFIG_ARM_FLOAT_POINT=y +# CONFIG_GCC_CODE_MODEL_TINY is not set +CONFIG_GCC_CODE_MODEL_SMALL=y +# CONFIG_GCC_CODE_MODEL_LARGE is not set +# end of Compiler configuration + +# CONFIG_BOOT_WITH_FLUSH_CACHE is not set +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arm architecture configuration + +CONFIG_MMU_PAGE_SIZE=0x1000 +CONFIG_MAX_XLAT_TABLES=256 +# end of Arch configuration + +# +# Soc configuration +# +CONFIG_PHYTIUMPI_FIREFLY_BOARD=y +# CONFIG_TARGET_E2000Q is not set +# CONFIG_TARGET_E2000D is not set +# CONFIG_TARGET_E2000S is not set +# CONFIG_TARGET_FT2004 is not set +# CONFIG_TARGET_D2000 is not set +# CONFIG_TARGET_PD2308 is not set +# CONFIG_TARGET_QEMU_VIRT is not set +CONFIG_SOC_NAME="phytiumpi" +CONFIG_SOC_CORE_NUM=4 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_E2000=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# end of Soc configuration + +# +# Board Configuration +# +CONFIG_BOARD_NAME="phytiumpi_firefly" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +CONFIG_USE_UART_IOPAD=y +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_FIREFLY_DEMO_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +CONFIG_ELOG_LINE_BUF_SIZE=0x100 +# 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_LOG_EXTRA_INFO is not set +CONFIG_LOG_DISPALY_CORE_NUM=y +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_INTERRUPT_ROLE_NONE is not set +# end of Sdk common configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI 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_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO 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_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +CONFIG_USE_SEC=y + +# +# SEC Configuration +# +CONFIG_ENABLE_FRND=y +# end of SEC Configuration + +# CONFIG_USE_SCMI_MHU is not set +# CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set +# CONFIG_USE_MSG is not set +# CONFIG_USE_DEVICE is not set +# end of Drivers configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP 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 + +# CONFIG_USE_AMP is not set +# CONFIG_USE_YMODEM is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_FATFS_0_1_4 is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_FSL_SDMMC is not set +# CONFIG_USE_MICROPYTHON is not set +# CONFIG_USE_TINYMAIX is not set +# CONFIG_USE_CHERRY_USB is not set +# CONFIG_USE_CMSIS is not set +# end of Third-party configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +# CONFIG_OUTPUT_BINARY is not set + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +# CONFIG_WALL_WARNING_ERROR is not set +# CONFIG_STRICT_PROTOTYPES is not set +CONFIG_DEBUG_SYMBOLS=y +# CONFIG_FRAME_POINTER is not set +# CONFIG_OUTPUT_ASM_DIS is not set +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USE_NEWLIB is not set +# CONFIG_USE_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0xb0100000 +CONFIG_IMAGE_MAX_LENGTH=0x1000000 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x4000 +# end of Linker Options +# end of Build setup diff --git a/example/peripherals/sec/rnd/fig/fsec_print_info.png b/example/peripherals/sec/rnd/fig/fsec_print_info.png new file mode 100644 index 0000000000000000000000000000000000000000..71a715da2784aa038bcd1898c9e3c421ff4166bb Binary files /dev/null and b/example/peripherals/sec/rnd/fig/fsec_print_info.png differ diff --git a/example/peripherals/sec/rnd/fig/rnd_ptng_default.png b/example/peripherals/sec/rnd/fig/rnd_ptng_default.png new file mode 100644 index 0000000000000000000000000000000000000000..75cc0ea9ab9d1b0b946f1d5519e1186f4572fa0a Binary files /dev/null and b/example/peripherals/sec/rnd/fig/rnd_ptng_default.png differ diff --git a/example/peripherals/sec/rnd/fig/rnd_ptng_default2.png b/example/peripherals/sec/rnd/fig/rnd_ptng_default2.png new file mode 100644 index 0000000000000000000000000000000000000000..75cc0ea9ab9d1b0b946f1d5519e1186f4572fa0a Binary files /dev/null and b/example/peripherals/sec/rnd/fig/rnd_ptng_default2.png differ diff --git a/example/peripherals/sec/rnd/fig/rng_ptng_16byte.png b/example/peripherals/sec/rnd/fig/rng_ptng_16byte.png new file mode 100644 index 0000000000000000000000000000000000000000..6760fcf3ef9c6e15e052dffdbe7955d35c9ab0cb Binary files /dev/null and b/example/peripherals/sec/rnd/fig/rng_ptng_16byte.png differ diff --git a/example/peripherals/sec/rnd/main.c b/example/peripherals/sec/rnd/main.c new file mode 100644 index 0000000000000000000000000000000000000000..b1c76e696f04cea64792094db132649d65584d0d --- /dev/null +++ b/example/peripherals/sec/rnd/main.c @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2025, Phytium Technology Co., Ltd. All Rights Reserved. + * + * Licensed under the BSD 3-Clause License (the "License"); you may not use + * this file except in compliance with the License. You may obtain a copy of + * the License at + * + * https://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + * FilePath: main.c + * Created Date: 2025-07-04 18:21:24 + * Last Modified: 2025-07-30 14:51:24 + * @Description:  This file is for fsec rnd test + * + * @Modify History: + * Ver   Who         Date         Changes + * ----- ------      --------    -------------------------------------- + * 1.0 kkp 2025/06/20 first release + */ +/***************************** Include Files *********************************/ +#include +#include "ftypes.h" +#include "fsleep.h" +#include "fprintk.h" +#include "stdio.h" +#include "fdebug.h" +#include "fcache.h" +#include "sdkconfig.h" +#ifdef CONFIG_USE_LETTER_SHELL +#include "shell_port.h" +#endif + + +/************************** Function Prototypes ******************************/ +int main(int argc, char **argv) +{ + +#ifdef CONFIG_USE_LETTER_SHELL + /* if shell command is enabled, register example entry as shell command */ + LSUserShellLoop(); +#else + /*run the rnd example*/ + FSecRndPtrngExample(0,100); +#endif + return 0; +} + diff --git a/example/peripherals/sec/rnd/makefile b/example/peripherals/sec/rnd/makefile new file mode 100644 index 0000000000000000000000000000000000000000..2121ed64b33d1b55a7720b671924466217f1d007 --- /dev/null +++ b/example/peripherals/sec/rnd/makefile @@ -0,0 +1,23 @@ +# 指定工程项目根目录为当前 +PROJECT_DIR = $(CURDIR) +SDK_DIR ?= $(CURDIR)/../../../.. + + +USER_CSRC := main.c +USER_CSRC += $(wildcard src/*.c) + + +USER_INCLUDE := $(PROJECT_DIR) \ + $(PROJECT_DIR)/inc \ + $(SDK_DIR)/drivers/sec/rnd/ + + +include $(SDK_DIR)/tools/build/makeall.mk + +USR_BOOT_DIR ?= /mnt/d/tftpboot + +image: + make clean + make all -j + cp ./$(IMAGE_OUT_NAME).elf $(USR_BOOT_DIR)/baremetal.elf + cp ./$(IMAGE_OUT_NAME).bin $(USR_BOOT_DIR)/baremetal.bin \ No newline at end of file diff --git a/example/peripherals/sec/rnd/sdkconfig b/example/peripherals/sec/rnd/sdkconfig new file mode 100644 index 0000000000000000000000000000000000000000..3564ae847921f94d9f508da44c3525b7de96e0d0 --- /dev/null +++ b/example/peripherals/sec/rnd/sdkconfig @@ -0,0 +1,270 @@ + +# +# Project Configuration +# + +# +# Baremetal Configuration +# +CONFIG_TARGET_NAME="rnd" +# end of Baremetal Configuration +# end of Project Configuration + +CONFIG_USE_BAREMETAL=y + +# +# Arch configuration +# +CONFIG_TARGET_ARMv8=y +CONFIG_ARCH_NAME="armv8" + +# +# Arm architecture configuration +# +CONFIG_ARCH_ARMV8_AARCH64=y +# CONFIG_ARCH_ARMV8_AARCH32 is not set + +# +# Compiler configuration +# +CONFIG_ARM_GCC_SELECT=y +# CONFIG_ARM_CLANG_SELECT is not set +CONFIG_TOOLCHAIN_NAME="gcc" +CONFIG_TARGET_ARMV8_AARCH64=y +CONFIG_ARCH_EXECUTION_STATE="aarch64" +CONFIG_ARM_NEON=y +CONFIG_ARM_CRC=y +CONFIG_ARM_CRYPTO=y +CONFIG_ARM_FLOAT_POINT=y +# CONFIG_GCC_CODE_MODEL_TINY is not set +CONFIG_GCC_CODE_MODEL_SMALL=y +# CONFIG_GCC_CODE_MODEL_LARGE is not set +# end of Compiler configuration + +# CONFIG_BOOT_WITH_FLUSH_CACHE is not set +# CONFIG_MMU_DEBUG_PRINTS is not set +# end of Arm architecture configuration + +# +# multi-core system deployment framework +# +# CONFIG_USE_MSDF is not set +# end of multi-core system deployment framework + +CONFIG_MMU_PAGE_SIZE_4K=y +# CONFIG_MMU_PAGE_SIZE_16K is not set +# CONFIG_MMU_PAGE_SIZE_64K is not set +CONFIG_MMU_PAGE_SIZE=0x1000 +CONFIG_MAX_XLAT_TABLES=256 +# CONFIG_ENABLE_GIC_ITS is not set +# end of Arch configuration + +# +# Soc configuration +# +CONFIG_TARGET_PE2204=y +# CONFIG_TARGET_PE2202 is not set +# CONFIG_TARGET_PE2201 is not set +# CONFIG_TARGET_PD1904 is not set +# CONFIG_TARGET_PD2008 is not set +# CONFIG_TARGET_PD2308 is not set +# CONFIG_TARGET_PS2316 is not set +# CONFIG_TARGET_PD2408 is not set +# CONFIG_TARGET_QEMU_VIRT is not set +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 +CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 +CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 +CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 +CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y +CONFIG_DEFAULT_DEBUG_PRINT_UART1=y +# CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set +# CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set +# end of Soc configuration + +# +# Board Configuration +# +CONFIG_BOARD_NAME="demo" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +CONFIG_USE_UART_IOPAD=y +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +CONFIG_E2000Q_DEMO_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_PHYTIUMPI_FIREFLY_BOARD is not set +# CONFIG_CUS_DEMO_BOARD is not set + +# +# Build project name +# +# end of Build project name +# end of Board Configuration + +# +# Sdk common configuration +# +CONFIG_ELOG_LINE_BUF_SIZE=0x100 +# 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_LOG_EXTRA_INFO is not set +# CONFIG_LOG_DISPALY_CORE_NUM is not set +# CONFIG_BOOTUP_DEBUG_PRINTS is not set +CONFIG_USE_NS_GTIMER=y +# CONFIG_USE_VIRTUAL_GTIMER is not set +CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set +# CONFIG_INTERRUPT_ROLE_NONE is not set +# end of Sdk common configuration + +# +# Drivers configuration +# +CONFIG_USE_IOMUX=y +# CONFIG_ENABLE_IOCTRL is not set +CONFIG_ENABLE_IOPAD=y +# CONFIG_USE_SPI is not set +# CONFIG_USE_QSPI 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_ETH is not set +# CONFIG_USE_CAN is not set +# CONFIG_USE_I2C is not set +# CONFIG_USE_TIMER is not set +# CONFIG_USE_MIO 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_ADC is not set +# CONFIG_USE_PWM is not set +# CONFIG_USE_IPC is not set +# CONFIG_USE_MEDIA is not set +CONFIG_USE_SEC=y + +# +# SEC Configuration +# +CONFIG_ENABLE_FRND=y +# CONFIG_ENABLE_FSHA is not set +# end of SEC Configuration + +# CONFIG_USE_SCMI_MHU is not set +# CONFIG_USE_I2S is not set +# CONFIG_USE_I3C is not set +# CONFIG_USE_MSG is not set +# CONFIG_USE_DEVICE is not set +# end of Drivers configuration + +# +# Third-party configuration +# +# CONFIG_USE_LWIP 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 + +# CONFIG_USE_AMP is not set +# CONFIG_USE_YMODEM is not set +# CONFIG_USE_SFUD is not set +# CONFIG_USE_FATFS_0_1_4 is not set +# CONFIG_USE_SPIFFS is not set +# CONFIG_USE_LITTLE_FS is not set +# CONFIG_USE_LVGL is not set +# CONFIG_USE_FREEMODBUS is not set +# CONFIG_USE_FSL_SDMMC is not set +# CONFIG_USE_MICROPYTHON is not set +# CONFIG_USE_TINYMAIX is not set +# CONFIG_USE_CHERRY_USB is not set +# CONFIG_USE_CMSIS is not set +# end of Third-party configuration + +# +# Build setup +# +CONFIG_CHECK_DEPS=y +CONFIG_OUTPUT_BINARY=y + +# +# Optimization options +# +# CONFIG_DEBUG_NOOPT is not set +# CONFIG_DEBUG_CUSTOMOPT is not set +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y +CONFIG_DEBUG_LINK_MAP=y +# CONFIG_CCACHE is not set +# CONFIG_ARCH_COVERAGE is not set +# CONFIG_LTO_FULL is not set +# end of Optimization options + +# +# Debug options +# +# CONFIG_DEBUG_ENABLE_ALL_WARNING is not set +CONFIG_WALL_WARNING_ERROR=y +# CONFIG_STRICT_PROTOTYPES is not set +CONFIG_DEBUG_SYMBOLS=y +# CONFIG_FRAME_POINTER is not set +CONFIG_OUTPUT_ASM_DIS=y +# CONFIG_ENABLE_WSHADOW is not set +# CONFIG_ENABLE_WUNDEF is not set +CONFIG_DOWNGRADE_DIAG_WARNING=y +# end of Debug options + +# +# Lib +# +CONFIG_USE_COMPILE_CHAIN=y +# CONFIG_USE_NEWLIB is not set +# CONFIG_USE_USER_DEFINED is not set +# end of Lib + +# CONFIG_ENABLE_CXX is not set + +# +# Linker Options +# +CONFIG_DEFAULT_LINKER_SCRIPT=y +# CONFIG_USER_DEFINED_LD is not set +CONFIG_IMAGE_LOAD_ADDRESS=0xb0100000 +CONFIG_IMAGE_MAX_LENGTH=0x1000000 +CONFIG_HEAP_SIZE=1 +CONFIG_STACK_SIZE=0x4000 +# end of Linker Options +# end of Build setup diff --git a/example/peripherals/sec/rnd/sdkconfig.h b/example/peripherals/sec/rnd/sdkconfig.h new file mode 100644 index 0000000000000000000000000000000000000000..fee2503a8a5347a820adb354db5d3f5304eec620 --- /dev/null +++ b/example/peripherals/sec/rnd/sdkconfig.h @@ -0,0 +1,244 @@ +#ifndef SDK_CONFIG_H__ +#define SDK_CONFIG_H__ + +/* Project Configuration */ + +/* Baremetal Configuration */ + +#define CONFIG_TARGET_NAME "rnd" +/* end of Baremetal Configuration */ +/* end of Project Configuration */ +#define CONFIG_USE_BAREMETAL + +/* Arch configuration */ + +#define CONFIG_TARGET_ARMv8 +#define CONFIG_ARCH_NAME "armv8" + +/* Arm architecture configuration */ + +#define CONFIG_ARCH_ARMV8_AARCH64 +/* CONFIG_ARCH_ARMV8_AARCH32 is not set */ + +/* Compiler configuration */ + +#define CONFIG_ARM_GCC_SELECT +/* CONFIG_ARM_CLANG_SELECT is not set */ +#define CONFIG_TOOLCHAIN_NAME "gcc" +#define CONFIG_TARGET_ARMV8_AARCH64 +#define CONFIG_ARCH_EXECUTION_STATE "aarch64" +#define CONFIG_ARM_NEON +#define CONFIG_ARM_CRC +#define CONFIG_ARM_CRYPTO +#define CONFIG_ARM_FLOAT_POINT +/* CONFIG_GCC_CODE_MODEL_TINY is not set */ +#define CONFIG_GCC_CODE_MODEL_SMALL +/* CONFIG_GCC_CODE_MODEL_LARGE is not set */ +/* end of Compiler configuration */ +/* CONFIG_BOOT_WITH_FLUSH_CACHE is not set */ +/* CONFIG_MMU_DEBUG_PRINTS is not set */ +/* end of Arm architecture configuration */ + +/* multi-core system deployment framework */ + +/* CONFIG_USE_MSDF is not set */ +/* end of multi-core system deployment framework */ +#define CONFIG_MMU_PAGE_SIZE_4K +/* CONFIG_MMU_PAGE_SIZE_16K is not set */ +/* CONFIG_MMU_PAGE_SIZE_64K is not set */ +#define CONFIG_MMU_PAGE_SIZE 0x1000 +#define CONFIG_MAX_XLAT_TABLES 256 +/* CONFIG_ENABLE_GIC_ITS is not set */ +/* end of Arch configuration */ + +/* Soc configuration */ + +#define CONFIG_TARGET_PE2204 +/* CONFIG_TARGET_PE2202 is not set */ +/* CONFIG_TARGET_PE2201 is not set */ +/* CONFIG_TARGET_PD1904 is not set */ +/* CONFIG_TARGET_PD2008 is not set */ +/* CONFIG_TARGET_PD2308 is not set */ +/* CONFIG_TARGET_PS2316 is not set */ +/* CONFIG_TARGET_PD2408 is not set */ +/* CONFIG_TARGET_QEMU_VIRT is not set */ +#define CONFIG_SOC_NAME "pe220x" +#define CONFIG_TARGET_TYPE_NAME "pe2204" +#define CONFIG_SOC_CORE_NUM 4 +#define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 +#define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 +#define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 +#define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 +#define CONFIG_TARGET_PE220X +#define CONFIG_DEFAULT_DEBUG_PRINT_UART1 +/* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ +/* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ +/* end of Soc configuration */ + +/* Board Configuration */ + +#define CONFIG_BOARD_NAME "demo" +/* CONFIG_USE_SPI_IOPAD is not set */ +/* CONFIG_USE_GPIO_IOPAD is not set */ +/* CONFIG_USE_CAN_IOPAD is not set */ +/* CONFIG_USE_QSPI_IOPAD is not set */ +/* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_MIO_IOPAD is not set */ +/* CONFIG_USE_TACHO_IOPAD is not set */ +#define CONFIG_USE_UART_IOPAD +/* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ +#define CONFIG_E2000Q_DEMO_BOARD + +/* IO mux configuration when board start up */ + +/* end of IO mux configuration when board start up */ +/* CONFIG_PHYTIUMPI_FIREFLY_BOARD is not set */ +/* CONFIG_CUS_DEMO_BOARD is not set */ + +/* Build project name */ + +/* end of Build project name */ +/* end of Board Configuration */ + +/* Sdk common configuration */ + +#define CONFIG_ELOG_LINE_BUF_SIZE 0x100 +/* 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 */ +/* CONFIG_LOG_EXTRA_INFO is not set */ +/* CONFIG_LOG_DISPALY_CORE_NUM is not set */ +/* CONFIG_BOOTUP_DEBUG_PRINTS is not set */ +#define CONFIG_USE_NS_GTIMER +/* CONFIG_USE_VIRTUAL_GTIMER is not set */ +#define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ +/* CONFIG_INTERRUPT_ROLE_NONE is not set */ +/* end of Sdk common configuration */ + +/* Drivers configuration */ + +#define CONFIG_USE_IOMUX +/* CONFIG_ENABLE_IOCTRL is not set */ +#define CONFIG_ENABLE_IOPAD +/* CONFIG_USE_SPI is not set */ +/* CONFIG_USE_QSPI is not set */ +#define CONFIG_USE_SERIAL + +/* Usart Configuration */ + +#define CONFIG_ENABLE_Pl011_UART +/* end of Usart Configuration */ +/* CONFIG_USE_GPIO is not set */ +/* CONFIG_USE_ETH is not set */ +/* CONFIG_USE_CAN is not set */ +/* CONFIG_USE_I2C is not set */ +/* CONFIG_USE_TIMER is not set */ +/* CONFIG_USE_MIO 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_ADC is not set */ +/* CONFIG_USE_PWM is not set */ +/* CONFIG_USE_IPC is not set */ +/* CONFIG_USE_MEDIA is not set */ +#define CONFIG_USE_SEC + +/* SEC Configuration */ + +#define CONFIG_ENABLE_FRND +/* CONFIG_ENABLE_FSHA is not set */ +/* end of SEC Configuration */ +/* CONFIG_USE_SCMI_MHU is not set */ +/* CONFIG_USE_I2S is not set */ +/* CONFIG_USE_I3C is not set */ +/* CONFIG_USE_MSG is not set */ +/* CONFIG_USE_DEVICE is not set */ +/* end of Drivers configuration */ + +/* Third-party configuration */ + +/* CONFIG_USE_LWIP 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 */ +/* CONFIG_USE_AMP is not set */ +/* CONFIG_USE_YMODEM is not set */ +/* CONFIG_USE_SFUD is not set */ +/* CONFIG_USE_FATFS_0_1_4 is not set */ +/* CONFIG_USE_SPIFFS is not set */ +/* CONFIG_USE_LITTLE_FS is not set */ +/* CONFIG_USE_LVGL is not set */ +/* CONFIG_USE_FREEMODBUS is not set */ +/* CONFIG_USE_FSL_SDMMC is not set */ +/* CONFIG_USE_MICROPYTHON is not set */ +/* CONFIG_USE_TINYMAIX is not set */ +/* CONFIG_USE_CHERRY_USB is not set */ +/* CONFIG_USE_CMSIS is not set */ +/* end of Third-party configuration */ + +/* Build setup */ + +#define CONFIG_CHECK_DEPS +#define CONFIG_OUTPUT_BINARY + +/* Optimization options */ + +/* CONFIG_DEBUG_NOOPT is not set */ +/* CONFIG_DEBUG_CUSTOMOPT is not set */ +#define CONFIG_DEBUG_FULLOPT +#define CONFIG_DEBUG_OPT_UNUSED_SECTIONS +#define CONFIG_DEBUG_LINK_MAP +/* CONFIG_CCACHE is not set */ +/* CONFIG_ARCH_COVERAGE is not set */ +/* CONFIG_LTO_FULL is not set */ +/* end of Optimization options */ + +/* Debug options */ + +/* CONFIG_DEBUG_ENABLE_ALL_WARNING is not set */ +#define CONFIG_WALL_WARNING_ERROR +/* CONFIG_STRICT_PROTOTYPES is not set */ +#define CONFIG_DEBUG_SYMBOLS +/* CONFIG_FRAME_POINTER is not set */ +#define CONFIG_OUTPUT_ASM_DIS +/* CONFIG_ENABLE_WSHADOW is not set */ +/* CONFIG_ENABLE_WUNDEF is not set */ +#define CONFIG_DOWNGRADE_DIAG_WARNING +/* end of Debug options */ + +/* Lib */ + +#define CONFIG_USE_COMPILE_CHAIN +/* CONFIG_USE_NEWLIB is not set */ +/* CONFIG_USE_USER_DEFINED is not set */ +/* end of Lib */ +/* CONFIG_ENABLE_CXX is not set */ + +/* Linker Options */ + +#define CONFIG_DEFAULT_LINKER_SCRIPT +/* CONFIG_USER_DEFINED_LD is not set */ +#define CONFIG_IMAGE_LOAD_ADDRESS 0xb0100000 +#define CONFIG_IMAGE_MAX_LENGTH 0x1000000 +#define CONFIG_HEAP_SIZE 1 +#define CONFIG_STACK_SIZE 0x4000 +/* end of Linker Options */ +/* end of Build setup */ + +#endif diff --git a/example/system/amp/README.md b/example/system/amp/README.md index bee0cd9f61f0cd8cf824ae792486474776f644e2..81fd104f936d3181399f0df6f349f22a409fdd2a 100644 --- a/example/system/amp/README.md +++ b/example/system/amp/README.md @@ -144,19 +144,33 @@ $(SDK_DIR)/tools/build/ 1. 在json文件中,因为无法添加注释,所以创建两个对象,第一个对象{...}是配置举例,第二个对象{...}才是配置实例。 -2. `bootstrap`启动引导工程的配置,多核启动必须配置项。(bootstrap名称不可更改) +2. `configs`配置项集合,对象值可以只添加一个配置组合(`{}`中的内容表示一个配置组合,配置项组合内将会被打包成一个镜像组合,方便配置项组合中的openamp查找并主核动态加载从核镜像文件),也可以添加多个,如E2000D aarch32组成一种配置组合,E2000D aarch64组成另外一种配置组合。(configs名称不可更改) -3. `configs`配置项集合,对象值可以只添加一个配置组合,也可以添加多个,如E2000D aarch32组成一种配置组合,E2000D aarch64组成另外一种配置组合。(configs名称不可更改) +3. `bootstrap`启动引导工程的配置,多核启动必须配置项,一个配置项集合仅有一个bootstrap配置项,在所有其他镜像编译和打包完成后追加编译到此工程的镜像文件中,此工程`*.config` CONFIG_USE_MSDF必须配置。(bootstrap名称不可更改) - 具体配置说明如下所示: +amp_tools_example、libmetal_test例程中采用此结构(没有使用openamp库所带的关闭重启device核心功能): + ![json_pic](./amp_tools_example/figs/json_pic.png) > 1.注意区分配置文件的名字,本例程作为测试保持了一致,具体名字查阅`路径`例程中configs目录下的名称,以运行pe2204 AArch64到核心1为例,`"path1":["../amp1",1,0,"pe2204_aarch64_demo_template.config"]`,则是使用`pe2204_aarch64_demo_template.config`,因为在`../amp1`。你可以在`../amp1/configs`目录下找到pe2204_aarch64_demo_template.config文件,我们会以此配置编译此目录的代码。 -> 2.当master字段设置为1时,表示该例程镜像为openamp主核镜像,即不进行普通方式编译,需要插入`--add-section .my_amp_img=`从机镜像文件,并设置从机镜像字段。并且需要设置core_id字段,指定启动引导主机镜像在那个core上,不能为10000。同一配置项组合(配置项单个`{}`内)不能出现两个master为1的配置项,否则会导致编译失败。 -> 3.当master字段设置为0时,同一配置项组合(配置项单个`{}`内)不能全为10000,否则会导致编译失败。 +> 2.当master字段设置为1时,表示该例程镜像为openamp主核镜像,即不进行普通方式编译,需要插入`--add-section .my_amp_img=`从机镜像文件,并设置从机镜像字段。并且需要设置core_id字段,指定启动引导主机镜像在那个core上,不能为-1。同一配置项组合(配置项单个`{}`内)不能出现两个master为1的配置项,否则会导致编译失败。 +> 3.当master字段设置为0时,同一配置项组合(配置项单个`{}`内)不能全为-1,否则会导致编译失败。 > 4.当master字段设置为0时,core_id表示该例程镜像运行在指定core上。 -> 5.当配置项组合存在core_id字段设置为10000时,则配置项组合中必须存在一个master为1的配置项,否则编译失败。 +> 5.当配置项组合存在core_id字段设置为-1时,则配置项组合中必须存在一个master为1的配置项,否则编译失败。 + +- 根据amp_tools_example例程中的配置举例,我们编译启动框架如下图所示: + +![amp_make_boot_pic](./amp_tools_example/figs/amp_make_boot_pic.png) + +openamp、openamp_echo_remoteproc_load(使用openamp库的动态加载功能)例程中采用另外的结构: + +以下以openamp_echo_remoteproc_load例程为例,说明如何配置json文件: + +![openamp_echo_remoteproc_build](./openamp_echo_remoteproc_load/master/fig/openamp_echo_remoteproc_build.png) + +![openamp_echo_remoteproc_load](./openamp_echo_remoteproc_load/master/fig/openamp_echo_remoteproc_load.png) ### 4.2 如果不采用amp1或者amp2例程配置您的多核镜像,请 分别 在例程中进行以下操作 diff --git a/example/system/amp/amp_tools_example/amp/README.md b/example/system/amp/amp_tools_example/amp/README.md index 49b5d61a6efc9057d0214850a136787f2023ba00..c669040358ed36548f37673326b05fbe49af26ee 100644 --- a/example/system/amp/amp_tools_example/amp/README.md +++ b/example/system/amp/amp_tools_example/amp/README.md @@ -2,6 +2,8 @@ ## 1. 例程介绍 +!!!学习使用例程前,请先阅读《多元异构系统部署 V1.1》[《多元异构系统部署》](../../README.md),熟悉AMP的基本概念和使用方法。!!! + > ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作 `
` - 本例程作为AMP打包部署的主例程,主要起到运行脚本,编译打包其他例程的作用,您也可在其他例程中按照上层目录README.md的描述配置主例程 diff --git a/example/system/amp/amp_tools_example/figs/amp_make_boot_pic.png b/example/system/amp/amp_tools_example/figs/amp_make_boot_pic.png new file mode 100644 index 0000000000000000000000000000000000000000..4d744b28bfad528a5851b18ad396ddcf65bfa9a6 Binary files /dev/null and b/example/system/amp/amp_tools_example/figs/amp_make_boot_pic.png differ diff --git a/example/system/amp/amp_tools_example/figs/json_pic.png b/example/system/amp/amp_tools_example/figs/json_pic.png index 6df6fbe0d40dce117dbc3e7c054bf8a7dabb942b..63af3877d1491e72b0830b246765fae3808c736d 100644 Binary files a/example/system/amp/amp_tools_example/figs/json_pic.png and b/example/system/amp/amp_tools_example/figs/json_pic.png differ diff --git a/example/system/amp/libmetal_test/apu_running/README.md b/example/system/amp/libmetal_test/apu_running/README.md index 3b0eac07bfcb0f990498b29f05ac3262fafa4740..f67e3582ec35bebc962e7e9c54916b76ff600ea7 100644 --- a/example/system/amp/libmetal_test/apu_running/README.md +++ b/example/system/amp/libmetal_test/apu_running/README.md @@ -1,5 +1,7 @@ # LIBMETAL 测试 +!!!学习使用例程前,请先阅读《多元异构系统部署 V1.1》[《多元异构系统部署》](../../README.md),熟悉AMP的基本概念和使用方法。!!! + ## 1. 例程介绍 > ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作 `
` diff --git a/example/system/amp/libmetal_test/apu_running/build/amp_packed.c b/example/system/amp/libmetal_test/apu_running/build/amp_packed.c deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/example/system/amp/libmetal_test/apu_running/sdkconfig b/example/system/amp/libmetal_test/apu_running/sdkconfig index 59fbb2d94d6202401f158ec1601d8eec084ad60a..daaeb6cbb941e7801c7e3cda914020b533ae8ee6 100644 --- a/example/system/amp/libmetal_test/apu_running/sdkconfig +++ b/example/system/amp/libmetal_test/apu_running/sdkconfig @@ -82,6 +82,7 @@ CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # diff --git a/example/system/amp/libmetal_test/apu_running/sdkconfig.h b/example/system/amp/libmetal_test/apu_running/sdkconfig.h index b5d36e192ed043f6c6e478cac6ca69efb9551fac..ec65311744598b8cd93f97c8db4492d81b230779 100644 --- a/example/system/amp/libmetal_test/apu_running/sdkconfig.h +++ b/example/system/amp/libmetal_test/apu_running/sdkconfig.h @@ -75,6 +75,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ diff --git a/example/system/amp/libmetal_test/rpu_running/sdkconfig b/example/system/amp/libmetal_test/rpu_running/sdkconfig index 1384954bf430d6eca4d6031cb21c0c806419fde0..b54dd357a1842c4ea990a9dc68c17ac5a0e74605 100644 --- a/example/system/amp/libmetal_test/rpu_running/sdkconfig +++ b/example/system/amp/libmetal_test/rpu_running/sdkconfig @@ -78,6 +78,7 @@ CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # diff --git a/example/system/amp/libmetal_test/rpu_running/sdkconfig.h b/example/system/amp/libmetal_test/rpu_running/sdkconfig.h index f398b537d20861ab85543d5f2e5f68150c981634..a988a0bd41f9659be1118805e7742a5ceb2a37b8 100644 --- a/example/system/amp/libmetal_test/rpu_running/sdkconfig.h +++ b/example/system/amp/libmetal_test/rpu_running/sdkconfig.h @@ -71,6 +71,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ diff --git a/example/system/amp/openamp/README.md b/example/system/amp/openamp/README.md index 21005c3d8670eff1295140c31bbae3f80b0a257e..398efe23cbd8fc071b0085e25ddb59abbac35a90 100644 --- a/example/system/amp/openamp/README.md +++ b/example/system/amp/openamp/README.md @@ -1,5 +1,7 @@ # OPENAMP 测试 +!!!学习使用例程前,请先阅读《多元异构系统部署 V1.1》[《多元异构系统部署》](../README.md),熟悉AMP的基本概念和使用方法。!!! + ## 1. 例程介绍 > ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作 `
` @@ -30,16 +32,16 @@ #### 系统架构 - 角色介绍:管理核作为交互管理的核心,主要进行任务分配,也承担一部分的任务反馈功能,性能核作为任务的运算执行核心,主要承担接受管理核的指令和任务运算的工作。 -- 本例程中 `driver_core` 目录下的程序为管理核(模拟)程序、`device_core`目录下为性能核(模拟)程序。管理核程序功能为初始化创建platform和rpmsg_device(主VIRTIO_DEV_MASTER),创建成功后,创建管理endpoint节点与性能核构建通信机制。性能核功能为初始化创建platform和与管理核绑定的rpmsg_device(从VIRTIO_DEV_SLAVE),创建成功后,创建监听endpoint节点接收管理核的命令来运行相关的例程。 +- 本例程中 `driver_core` 目录下的程序为管理核(模拟)程序、`device_core`目录下为性能核(模拟)程序。管理核程序功能为初始化创建platform和rpmsg_device(主VIRTIO_DEV_DRIVER),创建成功后,创建管理endpoint节点与性能核构建通信机制。性能核功能为初始化创建platform和与管理核绑定的rpmsg_device(从VIRTIO_DEV_DEVICE),创建成功后,创建监听endpoint节点接收管理核的命令来运行相关的例程。 - 核心的分配以及架构参考amp_config.json文件 - common目录下为公共配置文件,方便管理核和性能核共用,也方便了解使用的资源以及修改配置。 - 创建流程以及参考文档 remoteproc-design: - [remoteproc-design](../../../../third-party/openamp/docs/remoteproc-design.md) + [remoteproc-design](../../../../third-party/openamp/doc/remoteproc-design.md) rpmsg-design: - [rpmsg-design](../../../../third-party/openamp/docs/rpmsg-design.md) + [rpmsg-design](../../../../third-party/openamp/doc/rpmsg-design.md) 2.demo介绍(模拟角色): diff --git a/example/system/amp/openamp/device_core/rpmsg-demo-listening.c b/example/system/amp/openamp/device_core/rpmsg-demo-listening.c index 6a8a9ca2c6cf17daff1dfeb4b4ab12635211fad7..f9f1ed483d4257bf56c2ea704e3e56a7dd5bdcb6 100644 --- a/example/system/amp/openamp/device_core/rpmsg-demo-listening.c +++ b/example/system/amp/openamp/device_core/rpmsg-demo-listening.c @@ -269,7 +269,7 @@ int slave_init(void) DEMO_LIST_SLAVE_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); - rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_SLAVE, NULL, NULL); + rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_DEVICE, NULL, NULL); if (!rpdev_slave_00) { DEMO_LIST_SLAVE_DEBUG_E("Failed to create rpmsg vdev for slave 00\r\n"); diff --git a/example/system/amp/openamp/device_core/rpmsg-sample-ping.c b/example/system/amp/openamp/device_core/rpmsg-sample-ping.c index 3bf46c2c36d20a3a8f274e2f80e187534b3b4156..659674c29b0e598a284bb0effadcb71c025ffbc2 100644 --- a/example/system/amp/openamp/device_core/rpmsg-sample-ping.c +++ b/example/system/amp/openamp/device_core/rpmsg-sample-ping.c @@ -24,10 +24,10 @@ #include "fdebug.h" /***************** Macros (Inline Functions) Definitions *********************/ -#define VIRTIO_DEV_MASTER_DEBUG_TAG " MASTER_02" -#define VIRTIO_DEV_MASTER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( VIRTIO_DEV_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define VIRTIO_DEV_MASTER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( VIRTIO_DEV_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) -#define VIRTIO_DEV_MASTER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( VIRTIO_DEV_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DRIVER_DEBUG_TAG " MASTER_02" +#define VIRTIO_DEV_DRIVER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( VIRTIO_DEV_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DRIVER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( VIRTIO_DEV_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DRIVER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( VIRTIO_DEV_DRIVER_DEBUG_TAG, format, ##__VA_ARGS__) #define HELLO_MSG "hello world!" #define BYE_MSG "goodbye!" @@ -54,7 +54,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, memset(payload, 0, RPMSG_BUFFER_SIZE); memcpy(payload, data, len); - VIRTIO_DEV_MASTER_DEBUG_I("received message %d: %s of size %lu \r\n", + VIRTIO_DEV_DRIVER_DEBUG_I("received message %d: %s of size %lu \r\n", rnum + 1, payload, (unsigned long)len); if (rnum == (MSG_LIMIT - 1)) @@ -62,15 +62,15 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, else sprintf (seed, "%s", HELLO_MSG); - VIRTIO_DEV_MASTER_DEBUG_I(" seed %s: \r\n", seed); + VIRTIO_DEV_DRIVER_DEBUG_I(" seed %s: \r\n", seed); if (strncmp(payload, seed, len)) { - VIRTIO_DEV_MASTER_DEBUG_E(" Invalid message is received.\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_E(" Invalid message is received.\r\n"); err_cnt++; return RPMSG_SUCCESS; } rnum++; - VIRTIO_DEV_MASTER_DEBUG_I(" rnum %d: \r\n", rnum); + VIRTIO_DEV_DRIVER_DEBUG_I(" rnum %d: \r\n", rnum); if (rnum == MSG_LIMIT) { ept_deleted = 1; @@ -82,16 +82,16 @@ static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; rpmsg_destroy_ept(&lept); - VIRTIO_DEV_MASTER_DEBUG_I("echo test: service is destroyed\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("echo test: service is destroyed\r\n"); ept_deleted = 1; } _UNUSED static void rpmsg_name_service_bind_cb(struct rpmsg_device *rdev, const char *name, uint32_t dest) { - VIRTIO_DEV_MASTER_DEBUG_I("new endpoint notification is received.\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("new endpoint notification is received.\r\n"); if (strcmp(name, RPMSG_SERVICE_NAME)) - VIRTIO_DEV_MASTER_DEBUG_E("Unexpected name service %s.\r\n", name); + VIRTIO_DEV_DRIVER_DEBUG_E("Unexpected name service %s.\r\n", name); else (void)rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, RPMSG_ADDR_ANY, dest, @@ -111,7 +111,7 @@ static int app(struct rpmsg_device *rdev, void *priv) err_cnt = 0; ept_deleted = 0; - VIRTIO_DEV_MASTER_DEBUG_I(" 1 - Send data to remote core, retrieve the echo"); + VIRTIO_DEV_DRIVER_DEBUG_I(" 1 - Send data to remote core, retrieve the echo"); /* Create RPMsg endpoint */ ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, @@ -119,17 +119,17 @@ static int app(struct rpmsg_device *rdev, void *priv) rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - VIRTIO_DEV_MASTER_DEBUG_E("Failed to create RPMsg endpoint.\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_E("Failed to create RPMsg endpoint.\r\n"); return ret; } while (!is_rpmsg_ept_ready(&lept)) { - VIRTIO_DEV_MASTER_DEBUG_I("start to wait platform_poll \r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("start to wait platform_poll \r\n"); platform_poll(priv); } - VIRTIO_DEV_MASTER_DEBUG_I("RPMSG endpoint is binded with remote.\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("RPMSG endpoint is binded with remote.\r\n"); for (i = 1; i <= MSG_LIMIT; i++) { @@ -139,10 +139,10 @@ static int app(struct rpmsg_device *rdev, void *priv) ret = rpmsg_send(&lept, BYE_MSG, strlen(BYE_MSG)); if (ret < 0) { - VIRTIO_DEV_MASTER_DEBUG_E("Failed to send data...\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_E("Failed to send data...\r\n"); break; } - VIRTIO_DEV_MASTER_DEBUG_I("rpmsg sample test: message %d sent\r\n", i); + VIRTIO_DEV_DRIVER_DEBUG_I("rpmsg sample test: message %d sent\r\n", i); do { platform_poll(priv); @@ -150,16 +150,16 @@ static int app(struct rpmsg_device *rdev, void *priv) } - VIRTIO_DEV_MASTER_DEBUG_I("**********************************\r\n"); - VIRTIO_DEV_MASTER_DEBUG_I(" Test Results: Error count = %d\r\n", err_cnt); - VIRTIO_DEV_MASTER_DEBUG_I("**********************************\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("**********************************\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I(" Test Results: Error count = %d\r\n", err_cnt); + VIRTIO_DEV_DRIVER_DEBUG_I("**********************************\r\n"); while (!ept_deleted) { platform_poll(priv); } rpmsg_destroy_ept(&lept); - VIRTIO_DEV_MASTER_DEBUG_I("Quitting application .. rpmsg sample test end.\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("Quitting application .. rpmsg sample test end.\r\n"); return 0; } @@ -170,16 +170,16 @@ int rpmsg_sample_ping(struct rpmsg_device *rdev, void *priv) metal_assert(priv); int ret; - VIRTIO_DEV_MASTER_DEBUG_I("Starting rpmsg_sample_ping application...\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("Starting rpmsg_sample_ping application...\r\n"); ret = app(rdev, priv); if (ret != 0) { - VIRTIO_DEV_MASTER_DEBUG_E("Rpmsg_sample_ping application error,code:0x%x",ret); + VIRTIO_DEV_DRIVER_DEBUG_E("Rpmsg_sample_ping application error,code:0x%x",ret); return ret; } - VIRTIO_DEV_MASTER_DEBUG_I("Stopping rpmsg_sample_ping application...\r\n"); + VIRTIO_DEV_DRIVER_DEBUG_I("Stopping rpmsg_sample_ping application...\r\n"); return ret; } diff --git a/example/system/amp/openamp/device_core/sdkconfig b/example/system/amp/openamp/device_core/sdkconfig index 3807408c7b031611caada1d3b1a08517936b58f9..1c9206898d7108c38780453cf318fc74dc131233 100644 --- a/example/system/amp/openamp/device_core/sdkconfig +++ b/example/system/amp/openamp/device_core/sdkconfig @@ -80,6 +80,7 @@ CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # diff --git a/example/system/amp/openamp/device_core/sdkconfig.h b/example/system/amp/openamp/device_core/sdkconfig.h index fa5bee6d3c2364c32c455cf9272163ab46fbf864..f7091fe5f2853317c3ee687a5cb2e4de268caeff 100644 --- a/example/system/amp/openamp/device_core/sdkconfig.h +++ b/example/system/amp/openamp/device_core/sdkconfig.h @@ -71,6 +71,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ diff --git a/example/system/amp/openamp/driver_core/amp_config.json b/example/system/amp/openamp/driver_core/amp_config.json index 62bb5b52af7c44eae576a8553c2064b17b325054..023444b18bfe4189081e9d3b47f1552112560d00 100644 --- a/example/system/amp/openamp/driver_core/amp_config.json +++ b/example/system/amp/openamp/driver_core/amp_config.json @@ -23,61 +23,61 @@ "config0":[ { "bootstrap":["./",2,1,"pe2204_aarch64_demo_openamp_driver_core.config"], - "path0":["../device_core",10000,0,"pe2204_aarch64_demo_openamp_device_core.config"] + "path0":["../device_core",-1,0,"pe2204_aarch64_demo_openamp_device_core.config"] } ], "config1":[ { "bootstrap":["./",2,1,"pe2204_aarch32_demo_openamp_driver_core.config"], - "path0":["../device_core",10000,0,"pe2204_aarch32_demo_openamp_device_core.config"] + "path0":["../device_core",-1,0,"pe2204_aarch32_demo_openamp_device_core.config"] } ], "config2":[ { "bootstrap":["./",0,1,"pe2202_aarch64_demo_openamp_driver_core.config"], - "path0":["../device_core",10000,0,"pe2202_aarch64_demo_openamp_device_core.config"] + "path0":["../device_core",-1,0,"pe2202_aarch64_demo_openamp_device_core.config"] } ], "config3":[ { "bootstrap":["./",0,1,"pe2202_aarch32_demo_openamp_driver_core.config"], - "path0":["../device_core",10000,0,"pe2202_aarch32_demo_openamp_device_core.config"] + "path0":["../device_core",-1,0,"pe2202_aarch32_demo_openamp_device_core.config"] } ], "config4":[ { "bootstrap":["./",2,1,"pe2204_aarch64_phytiumpi_openamp_driver_core.config"], - "path0":["../device_core",10000,0,"pe2204_aarch64_phytiumpi_openamp_device_core.config"] + "path0":["../device_core",-1,0,"pe2204_aarch64_phytiumpi_openamp_device_core.config"] } ], "config5":[ { "bootstrap":["./",2,1,"pe2204_aarch32_phytiumpi_openamp_driver_core.config"], - "path0":["../device_core",10000,0,"pe2204_aarch32_phytiumpi_openamp_device_core.config"] + "path0":["../device_core",-1,0,"pe2204_aarch32_phytiumpi_openamp_device_core.config"] } ], "config6":[ { "bootstrap":["./",0,1,"pd2008_aarch64_test_openamp_driver_core.config"], - "path0":["../device_core",10000,0,"pd2008_aarch64_test_openamp_device_core.config"] + "path0":["../device_core",-1,0,"pd2008_aarch64_test_openamp_device_core.config"] } ], "config7":[ { "bootstrap":["./",0,1,"pd2008_aarch32_test_openamp_driver_core.config"], - "path0":["../device_core",10000,0,"pd2008_aarch32_test_openamp_device_core.config"] + "path0":["../device_core",-1,0,"pd2008_aarch32_test_openamp_device_core.config"] } ], "config8":[ { "bootstrap":["./",0,1,"ps2316_aarch64_test16_openamp_driver_core.config"], - "path0":["../device_core",10000,0,"ps2316_aarch64_test16_openamp_device_core.config"] + "path0":["../device_core",-1,0,"ps2316_aarch64_test16_openamp_device_core.config"] } ], "config9":[ { "bootstrap":["./",0,1,"pd2408_aarch64_test_a_openamp_driver_core.config"], - "path0":["../device_core",10000,0,"pd2408_aarch64_test_a_openamp_device_core.config"] + "path0":["../device_core",-1,0,"pd2408_aarch64_test_a_openamp_device_core.config"] } ] } diff --git a/example/system/amp/openamp/driver_core/build/amp_packed.c b/example/system/amp/openamp/driver_core/build/amp_packed.c deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/example/system/amp/openamp/driver_core/configs/pe2204_aarch64_demo_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/pe2204_aarch64_demo_openamp_driver_core.config index 909aa2570526bde66ca388b6dc1c636437cd8dd1..33c0eeda80b4ed12f0d317293abf0e40ddb00cc6 100644 --- a/example/system/amp/openamp/driver_core/configs/pe2204_aarch64_demo_openamp_driver_core.config +++ b/example/system/amp/openamp/driver_core/configs/pe2204_aarch64_demo_openamp_driver_core.config @@ -7,4 +7,8 @@ CONFIG_USE_AMP=y CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y # CONFIG_OUTPUT_BINARY is not set +CONFIG_DEBUG_FULLOPT=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_FRAME_POINTER=y +CONFIG_OUTPUT_ASM_DIS=y CONFIG_DEFAULT_LINKER_SCRIPT=y diff --git a/example/system/amp/openamp/driver_core/rpmsg-demo-manager_cmd.c b/example/system/amp/openamp/driver_core/rpmsg-demo-manager_cmd.c index 20343c3b8f16100222e10a53b0ddc1942774fc6e..b047cad6c663c385770d383a1c157c84df46af4f 100644 --- a/example/system/amp/openamp/driver_core/rpmsg-demo-manager_cmd.c +++ b/example/system/amp/openamp/driver_core/rpmsg-demo-manager_cmd.c @@ -301,11 +301,7 @@ static int FOpenampClose(void *platform) DEMO_MANG_MASTER_DEBUG_E("Can't shutdown remoteproc,error code:0x%x.",ret); } - ret = platform_cleanup(platform); - if (ret != 0) - { - DEMO_MANG_MASTER_DEBUG_E("Can't remove platform,error code:0x%x.",ret); - } + platform_cleanup(platform); return ret; } @@ -373,7 +369,7 @@ int FOpenampExample(void) } DEMO_MANG_MASTER_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); // Create rpmsg virtual devices for communication - rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_MASTER, NULL, rpmsg_name_service_bind_cb); + rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_DRIVER, NULL, rpmsg_name_service_bind_cb); if (!rpdev_slave_00) { DEMO_MANG_MASTER_DEBUG_E("Failed to create rpmsg vdev for slave 00\r\n"); diff --git a/example/system/amp/openamp/driver_core/rpmsg-sample-echo.c b/example/system/amp/openamp/driver_core/rpmsg-sample-echo.c index 394b82f314cf25097aae9c0d5c962b74ceecb8ec..e644898e60ece9b7d5b6b72d8c6c70b3630a72ed 100644 --- a/example/system/amp/openamp/driver_core/rpmsg-sample-echo.c +++ b/example/system/amp/openamp/driver_core/rpmsg-sample-echo.c @@ -20,10 +20,10 @@ #include "rpmsg_service.h" #include "fdebug.h" -#define VIRTIO_DEV_SLAVE_DEBUG_TAG " SLAVE_02" -#define VIRTIO_DEV_SLAVE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( VIRTIO_DEV_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define VIRTIO_DEV_SLAVE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( VIRTIO_DEV_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define VIRTIO_DEV_SLAVE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( VIRTIO_DEV_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DEVICE_DEBUG_TAG " SLAVE_02" +#define VIRTIO_DEV_DEVICE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( VIRTIO_DEV_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DEVICE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( VIRTIO_DEV_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) +#define VIRTIO_DEV_DEVICE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( VIRTIO_DEV_DEVICE_DEBUG_TAG, format, ##__VA_ARGS__) #define MSG_LIMIT 100 @@ -45,10 +45,10 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, memcpy(payload, data, len); if (++count <= MSG_LIMIT) { - VIRTIO_DEV_SLAVE_DEBUG_I("echo message number %u: %s\r\n",(unsigned int)count, payload); + VIRTIO_DEV_DEVICE_DEBUG_I("echo message number %u: %s\r\n",(unsigned int)count, payload); if (rpmsg_send(ept, (char *)data, len) < 0) { - VIRTIO_DEV_SLAVE_DEBUG_E("rpmsg_send failed\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_E("rpmsg_send failed\r\n"); shutdown_req = 1; } } @@ -58,7 +58,7 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) { (void)ept; - VIRTIO_DEV_SLAVE_DEBUG_I("unexpected Remote endpoint destroy\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_I("unexpected Remote endpoint destroy\r\n"); shutdown_req = 1; } @@ -71,17 +71,17 @@ static int app(struct rpmsg_device *rdev, void *priv) shutdown_req = 0; count = 0; /* Initialize RPMSG framework */ - VIRTIO_DEV_SLAVE_DEBUG_I("Try to create rpmsg endpoint.\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_I("Try to create rpmsg endpoint.\r\n"); ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, RPMSG_ADDR_ANY, RPMSG_ADDR_ANY, rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { - VIRTIO_DEV_SLAVE_DEBUG_E("Failed to create endpoint.\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_E("Failed to create endpoint.\r\n"); return -1; } - VIRTIO_DEV_SLAVE_DEBUG_I("Successfully created rpmsg endpoint.\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_I("Successfully created rpmsg endpoint.\r\n"); while (1) { platform_poll(priv); @@ -105,16 +105,16 @@ int rpmsg_sample_echo(struct rpmsg_device *rdev, void *priv) metal_assert(priv); int ret; - VIRTIO_DEV_SLAVE_DEBUG_I("Starting rpmsg_sample_echo application...\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_I("Starting rpmsg_sample_echo application...\r\n"); ret = app(rdev, priv); if (ret != 0) { - VIRTIO_DEV_SLAVE_DEBUG_E("Rpmsg_sample_echo application error,code:0x%x",ret); + VIRTIO_DEV_DEVICE_DEBUG_E("Rpmsg_sample_echo application error,code:0x%x",ret); return ret; } - VIRTIO_DEV_SLAVE_DEBUG_I("Stopping rpmsg_sample_echo application...\r\n"); + VIRTIO_DEV_DEVICE_DEBUG_I("Stopping rpmsg_sample_echo application...\r\n"); return ret; } diff --git a/example/system/amp/openamp/driver_core/sdkconfig b/example/system/amp/openamp/driver_core/sdkconfig index 6e1a374a9a22b2027a5d7c78cd40f663a3732775..b240153923337fb723f945e24cb2e7f3076885a6 100644 --- a/example/system/amp/openamp/driver_core/sdkconfig +++ b/example/system/amp/openamp/driver_core/sdkconfig @@ -84,6 +84,7 @@ CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # diff --git a/example/system/amp/openamp/driver_core/sdkconfig.h b/example/system/amp/openamp/driver_core/sdkconfig.h index f6acea3b579d85324fa3bf67b704de80f442d8c0..f030fd44cdf6f400e9f3a36ddc885d587042e0b7 100644 --- a/example/system/amp/openamp/driver_core/sdkconfig.h +++ b/example/system/amp/openamp/driver_core/sdkconfig.h @@ -75,6 +75,7 @@ #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ diff --git a/example/system/amp/openamp_echo_remoteproc_load/master/README.md b/example/system/amp/openamp_echo_remoteproc_load/master/README.md index 2bb122da126273723e6ed4f1ef99915377a44d5f..0beec4f0ae7d4ebfc6a6730abbba91ce83b71f81 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/master/README.md +++ b/example/system/amp/openamp_echo_remoteproc_load/master/README.md @@ -1,5 +1,7 @@ # OpenAMP echo remoteproc load example +!!!学习使用例程前,请先阅读《多元异构系统部署 V1.1》[《多元异构系统部署》](../../README.md),熟悉AMP的基本概念和使用方法。!!! + ## 1. 例程介绍 > ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作 `
` diff --git a/example/system/amp/openamp_echo_remoteproc_load/master/amp_config.json b/example/system/amp/openamp_echo_remoteproc_load/master/amp_config.json index 1680e8cb8921386091c708cd0139ce98674c3c05..2307233e3b0c06537d4456e2d0719d1f9a2cb870 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/master/amp_config.json +++ b/example/system/amp/openamp_echo_remoteproc_load/master/amp_config.json @@ -23,86 +23,86 @@ "config0": [ { - "path0":["../slave_00",10000,0,"pe2204_aarch64_phytiumpi_openamp_device_core.config"], - "path1":["../slave_01",10000,0,"pe2204_aarch64_phytiumpi_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"pe2204_aarch64_phytiumpi_openamp_device_core.config"], + "path1":["../slave_01",-1,0,"pe2204_aarch64_phytiumpi_openamp_device_core.config"], "bootstrap":["./",2,1,"pe2204_aarch64_phytiumpi_openamp_driver_core.config"] } ], "config1": [ { - "path0":["../slave_00",10000,0,"pe2204_aarch32_phytiumpi_openamp_device_core.config"], - "path1":["../slave_01",10000,0,"pe2204_aarch32_phytiumpi_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"pe2204_aarch32_phytiumpi_openamp_device_core.config"], + "path1":["../slave_01",-1,0,"pe2204_aarch32_phytiumpi_openamp_device_core.config"], "bootstrap":["./",2,1,"pe2204_aarch32_phytiumpi_openamp_driver_core.config"] } ], "config2": [ { - "path0":["../slave_00",10000,0,"pe2204_aarch64_demo_openamp_device_core.config"], - "path1":["../slave_01",10000,0,"pe2204_aarch64_demo_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"pe2204_aarch64_demo_openamp_device_core.config"], + "path1":["../slave_01",-1,0,"pe2204_aarch64_demo_openamp_device_core.config"], "bootstrap":["./",2,1,"pe2204_aarch64_demo_openamp_driver_core.config"] } ], "config3": [ { - "path0":["../slave_00",10000,0,"pe2204_aarch32_demo_openamp_device_core.config"], - "path1":["../slave_01",10000,0,"pe2204_aarch32_demo_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"pe2204_aarch32_demo_openamp_device_core.config"], + "path1":["../slave_01",-1,0,"pe2204_aarch32_demo_openamp_device_core.config"], "bootstrap":["./",2,1,"pe2204_aarch32_demo_openamp_driver_core.config"] } ], "config4": [ { - "path0":["../slave_00",10000,0,"pe2202_aarch64_demo_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"pe2202_aarch64_demo_openamp_device_core.config"], "bootstrap":["./",0,1,"pe2202_aarch64_demo_openamp_driver_core.config"] } ], "config5": [ { - "path0":["../slave_00",10000,0,"pe2202_aarch32_demo_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"pe2202_aarch32_demo_openamp_device_core.config"], "bootstrap":["./",0,1,"pe2202_aarch32_demo_openamp_driver_core.config"] } ], "config6": [ { - "path0":["../slave_00",10000,0,"pd2008_aarch64_test_openamp_device_core.config"], - "path1":["../slave_01",10000,0,"pd2008_aarch64_test_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"pd2008_aarch64_test_openamp_device_core.config"], + "path1":["../slave_01",-1,0,"pd2008_aarch64_test_openamp_device_core.config"], "bootstrap":["./",0,1,"pd2008_aarch64_test_openamp_driver_core.config"] } ], "config7": [ { - "path0":["../slave_00",10000,0,"pd2008_aarch32_test_openamp_device_core.config"], - "path1":["../slave_01",10000,0,"pd2008_aarch32_test_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"pd2008_aarch32_test_openamp_device_core.config"], + "path1":["../slave_01",-1,0,"pd2008_aarch32_test_openamp_device_core.config"], "bootstrap":["./",0,1,"pd2008_aarch32_test_openamp_driver_core.config"] } ], "config8": [ { - "path0":["../slave_00",10000,0,"pd2308_aarch64_demo_openamp_device_core.config"], - "path1":["../slave_01",10000,0,"pd2308_aarch64_demo_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"pd2308_aarch64_demo_openamp_device_core.config"], + "path1":["../slave_01",-1,0,"pd2308_aarch64_demo_openamp_device_core.config"], "bootstrap":["./",0,1,"pd2308_aarch64_demo_openamp_driver_core.config"] } ], "config9": [ { - "path0":["../slave_00",10000,0,"ps2316_aarch64_test16_openamp_device_core.config"], - "path1":["../slave_01",10000,0,"ps2316_aarch64_test16_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"ps2316_aarch64_test16_openamp_device_core.config"], + "path1":["../slave_01",-1,0,"ps2316_aarch64_test16_openamp_device_core.config"], "bootstrap":["./",0,1,"ps2316_aarch64_test16_openamp_driver_core.config"] } ], "config10": [ { - "path0":["../slave_00",10000,0,"pd2408_aarch64_test_a_openamp_device_core.config"], - "path1":["../slave_01",10000,0,"pd2408_aarch64_test_a_openamp_device_core.config"], + "path0":["../slave_00",-1,0,"pd2408_aarch64_test_a_openamp_device_core.config"], + "path1":["../slave_01",-1,0,"pd2408_aarch64_test_a_openamp_device_core.config"], "bootstrap":["./",0,1,"pd2408_aarch64_test_a_openamp_driver_core.config"] } ] diff --git a/example/system/amp/openamp_echo_remoteproc_load/master/build/amp_packed.c b/example/system/amp/openamp_echo_remoteproc_load/master/build/amp_packed.c deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/example/system/amp/openamp_echo_remoteproc_load/master/fig/openamp_echo_remoteproc_build.png b/example/system/amp/openamp_echo_remoteproc_load/master/fig/openamp_echo_remoteproc_build.png new file mode 100644 index 0000000000000000000000000000000000000000..98bdc4d09318aee8559327fb18d501927e0186c8 Binary files /dev/null and b/example/system/amp/openamp_echo_remoteproc_load/master/fig/openamp_echo_remoteproc_build.png differ diff --git a/example/system/amp/openamp_echo_remoteproc_load/master/fig/openamp_echo_remoteproc_load.png b/example/system/amp/openamp_echo_remoteproc_load/master/fig/openamp_echo_remoteproc_load.png new file mode 100644 index 0000000000000000000000000000000000000000..f160972d7f91decb2958d957fe738944a1a0ac6c Binary files /dev/null and b/example/system/amp/openamp_echo_remoteproc_load/master/fig/openamp_echo_remoteproc_load.png differ diff --git a/example/system/amp/openamp_echo_remoteproc_load/master/sdkconfig b/example/system/amp/openamp_echo_remoteproc_load/master/sdkconfig index e0b270d4d41aa4debe4f99f91df75940c7125632..515535042a8e73ea2578fc2b4ff41d60624bfc10 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/master/sdkconfig +++ b/example/system/amp/openamp_echo_remoteproc_load/master/sdkconfig @@ -51,8 +51,8 @@ CONFIG_BOOT_WITH_FLUSH_CACHE=y CONFIG_USE_MSDF=y CONFIG_MSDF0=y # CONFIG_MSDF1 is not set -CONFIG_SOC_CORE_MAX_ID=15 -CONFIG_MSDF_CORE_ID=0 +CONFIG_SOC_CORE_MAX_ID=3 +CONFIG_MSDF_CORE_ID=2 # end of multi-core system deployment framework CONFIG_MMU_PAGE_SIZE_4K=y @@ -66,31 +66,51 @@ CONFIG_MAX_XLAT_TABLES=256 # # Soc configuration # -# CONFIG_TARGET_PE2204 is not set +CONFIG_TARGET_PE2204=y # CONFIG_TARGET_PE2202 is not set # CONFIG_TARGET_PE2201 is not set # CONFIG_TARGET_PD1904 is not set # CONFIG_TARGET_PD2008 is not set # CONFIG_TARGET_PD2308 is not set -CONFIG_TARGET_PS2316=y +# CONFIG_TARGET_PS2316 is not set # CONFIG_TARGET_PD2408 is not set # CONFIG_TARGET_QEMU_VIRT is not set -CONFIG_SOC_NAME="ps2316" -CONFIG_SOC_CORE_NUM=16 +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # # Board Configuration # -CONFIG_BOARD_NAME="test16" -CONFIG_CUS_DEMO_BOARD=y +CONFIG_BOARD_NAME="phytiumpi" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +# CONFIG_USE_UART_IOPAD is not set +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +# CONFIG_E2000Q_DEMO_BOARD is not set +CONFIG_PHYTIUMPI_FIREFLY_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set # # Build project name @@ -124,7 +144,7 @@ CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_USE_IOMUX=y # CONFIG_ENABLE_IOCTRL is not set -# CONFIG_ENABLE_IOPAD is not set +CONFIG_ENABLE_IOPAD=y # CONFIG_USE_SPI is not set # CONFIG_USE_QSPI is not set CONFIG_USE_SERIAL=y @@ -228,7 +248,7 @@ CONFIG_DEBUG_LINK_MAP=y # CONFIG_STRICT_PROTOTYPES is not set CONFIG_DEBUG_SYMBOLS=y CONFIG_FRAME_POINTER=y -CONFIG_OUTPUT_ASM_DIS=y +# CONFIG_OUTPUT_ASM_DIS is not set # CONFIG_ENABLE_WSHADOW is not set # CONFIG_ENABLE_WUNDEF is not set CONFIG_DOWNGRADE_DIAG_WARNING=y diff --git a/example/system/amp/openamp_echo_remoteproc_load/master/sdkconfig.h b/example/system/amp/openamp_echo_remoteproc_load/master/sdkconfig.h index 9f2cc49810093117f46f536325058a8b3b063933..0eb3882a00ce95ed51580931cffca2b807b2da65 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/master/sdkconfig.h +++ b/example/system/amp/openamp_echo_remoteproc_load/master/sdkconfig.h @@ -44,8 +44,8 @@ #define CONFIG_USE_MSDF #define CONFIG_MSDF0 /* CONFIG_MSDF1 is not set */ -#define CONFIG_SOC_CORE_MAX_ID 15 -#define CONFIG_MSDF_CORE_ID 0 +#define CONFIG_SOC_CORE_MAX_ID 3 +#define CONFIG_MSDF_CORE_ID 2 /* end of multi-core system deployment framework */ #define CONFIG_MMU_PAGE_SIZE_4K /* CONFIG_MMU_PAGE_SIZE_16K is not set */ @@ -57,30 +57,48 @@ /* Soc configuration */ -/* CONFIG_TARGET_PE2204 is not set */ +#define CONFIG_TARGET_PE2204 /* CONFIG_TARGET_PE2202 is not set */ /* CONFIG_TARGET_PE2201 is not set */ /* CONFIG_TARGET_PD1904 is not set */ /* CONFIG_TARGET_PD2008 is not set */ /* CONFIG_TARGET_PD2308 is not set */ -#define CONFIG_TARGET_PS2316 +/* CONFIG_TARGET_PS2316 is not set */ /* CONFIG_TARGET_PD2408 is not set */ /* CONFIG_TARGET_QEMU_VIRT is not set */ -#define CONFIG_SOC_NAME "ps2316" -#define CONFIG_SOC_CORE_NUM 16 +#define CONFIG_SOC_NAME "pe220x" +#define CONFIG_TARGET_TYPE_NAME "pe2204" +#define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 #define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 +#define CONFIG_TARGET_PE220X #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ -#define CONFIG_BOARD_NAME "test16" -#define CONFIG_CUS_DEMO_BOARD +#define CONFIG_BOARD_NAME "phytiumpi" +/* CONFIG_USE_SPI_IOPAD is not set */ +/* CONFIG_USE_GPIO_IOPAD is not set */ +/* CONFIG_USE_CAN_IOPAD is not set */ +/* CONFIG_USE_QSPI_IOPAD is not set */ +/* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_MIO_IOPAD is not set */ +/* CONFIG_USE_TACHO_IOPAD is not set */ +/* CONFIG_USE_UART_IOPAD is not set */ +/* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ +/* CONFIG_E2000Q_DEMO_BOARD is not set */ +#define CONFIG_PHYTIUMPI_FIREFLY_BOARD + +/* IO mux configuration when board start up */ + +/* end of IO mux configuration when board start up */ +/* CONFIG_CUS_DEMO_BOARD is not set */ /* Build project name */ @@ -111,7 +129,7 @@ #define CONFIG_USE_IOMUX /* CONFIG_ENABLE_IOCTRL is not set */ -/* CONFIG_ENABLE_IOPAD is not set */ +#define CONFIG_ENABLE_IOPAD /* CONFIG_USE_SPI is not set */ /* CONFIG_USE_QSPI is not set */ #define CONFIG_USE_SERIAL @@ -205,7 +223,7 @@ /* CONFIG_STRICT_PROTOTYPES is not set */ #define CONFIG_DEBUG_SYMBOLS #define CONFIG_FRAME_POINTER -#define CONFIG_OUTPUT_ASM_DIS +/* CONFIG_OUTPUT_ASM_DIS is not set */ /* CONFIG_ENABLE_WSHADOW is not set */ /* CONFIG_ENABLE_WUNDEF is not set */ #define CONFIG_DOWNGRADE_DIAG_WARNING diff --git a/example/system/amp/openamp_echo_remoteproc_load/master/src/remoteproc_00_example.c b/example/system/amp/openamp_echo_remoteproc_load/master/src/remoteproc_00_example.c index 0515f2fc736b57b275917b670ce4978fbf35d2d4..989789c0a3346f66f84d0f3214f530d019e5f395 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/master/src/remoteproc_00_example.c +++ b/example/system/amp/openamp_echo_remoteproc_load/master/src/remoteproc_00_example.c @@ -176,7 +176,7 @@ int master_00_init(void) } OPENAMP_MASTER_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); // Create rpmsg virtual devices for communication - rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_MASTER, NULL, rpmsg_name_service_bind_cb); + rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_DRIVER, NULL, rpmsg_name_service_bind_cb); if (!rpdev_slave_00) { OPENAMP_MASTER_DEBUG_E("Failed to create rpmsg vdev for slave 00\r\n"); diff --git a/example/system/amp/openamp_echo_remoteproc_load/master/src/remoteproc_01_example.c b/example/system/amp/openamp_echo_remoteproc_load/master/src/remoteproc_01_example.c index 80d56946a41f1a39684c9813c793a01337ff7172..2db47db4610d6fb347288898b5cf3a428208dd48 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/master/src/remoteproc_01_example.c +++ b/example/system/amp/openamp_echo_remoteproc_load/master/src/remoteproc_01_example.c @@ -182,7 +182,7 @@ int master_01_init(void) } OPENAMP_MASTER_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); // Create rpmsg virtual devices for communication - rpdev_slave_01 = platform_create_rpmsg_vdev(&remoteproc_slave_01, 0, VIRTIO_DEV_MASTER, NULL, rpmsg_name_service_bind_cb); + rpdev_slave_01 = platform_create_rpmsg_vdev(&remoteproc_slave_01, 0, VIRTIO_DEV_DRIVER, NULL, rpmsg_name_service_bind_cb); if (!rpdev_slave_01) { OPENAMP_MASTER_DEBUG_E("Failed to create rpmsg vdev for slave 01\r\n"); diff --git a/example/system/amp/openamp_echo_remoteproc_load/slave_00/sdkconfig b/example/system/amp/openamp_echo_remoteproc_load/slave_00/sdkconfig index a29dae1e46526d9d069450622b76448edab33d4e..f8e2a4e5d80e5b36306adc0cd46269833790d1c9 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/slave_00/sdkconfig +++ b/example/system/amp/openamp_echo_remoteproc_load/slave_00/sdkconfig @@ -62,31 +62,51 @@ CONFIG_MAX_XLAT_TABLES=256 # # Soc configuration # -# CONFIG_TARGET_PE2204 is not set +CONFIG_TARGET_PE2204=y # CONFIG_TARGET_PE2202 is not set # CONFIG_TARGET_PE2201 is not set # CONFIG_TARGET_PD1904 is not set # CONFIG_TARGET_PD2008 is not set # CONFIG_TARGET_PD2308 is not set -CONFIG_TARGET_PS2316=y +# CONFIG_TARGET_PS2316 is not set # CONFIG_TARGET_PD2408 is not set # CONFIG_TARGET_QEMU_VIRT is not set -CONFIG_SOC_NAME="ps2316" -CONFIG_SOC_CORE_NUM=16 +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # # Board Configuration # -CONFIG_BOARD_NAME="test16" -CONFIG_CUS_DEMO_BOARD=y +CONFIG_BOARD_NAME="phytiumpi" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +# CONFIG_USE_UART_IOPAD is not set +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +# CONFIG_E2000Q_DEMO_BOARD is not set +CONFIG_PHYTIUMPI_FIREFLY_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set # # Build project name @@ -110,8 +130,8 @@ CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y -# CONFIG_INTERRUPT_ROLE_MASTER is not set -CONFIG_INTERRUPT_ROLE_SLAVE=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set # CONFIG_INTERRUPT_ROLE_NONE is not set # end of Sdk common configuration @@ -120,7 +140,7 @@ CONFIG_INTERRUPT_ROLE_SLAVE=y # CONFIG_USE_IOMUX=y # CONFIG_ENABLE_IOCTRL is not set -# CONFIG_ENABLE_IOPAD is not set +CONFIG_ENABLE_IOPAD=y # CONFIG_USE_SPI is not set # CONFIG_USE_QSPI is not set CONFIG_USE_SERIAL=y diff --git a/example/system/amp/openamp_echo_remoteproc_load/slave_00/sdkconfig.h b/example/system/amp/openamp_echo_remoteproc_load/slave_00/sdkconfig.h index 3caa9c71ae288347fb71fe7efb9dff953f8507a8..988a6beff3d0813a778b4cbafb0fdf3e6a1bb07c 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/slave_00/sdkconfig.h +++ b/example/system/amp/openamp_echo_remoteproc_load/slave_00/sdkconfig.h @@ -53,30 +53,48 @@ /* Soc configuration */ -/* CONFIG_TARGET_PE2204 is not set */ +#define CONFIG_TARGET_PE2204 /* CONFIG_TARGET_PE2202 is not set */ /* CONFIG_TARGET_PE2201 is not set */ /* CONFIG_TARGET_PD1904 is not set */ /* CONFIG_TARGET_PD2008 is not set */ /* CONFIG_TARGET_PD2308 is not set */ -#define CONFIG_TARGET_PS2316 +/* CONFIG_TARGET_PS2316 is not set */ /* CONFIG_TARGET_PD2408 is not set */ /* CONFIG_TARGET_QEMU_VIRT is not set */ -#define CONFIG_SOC_NAME "ps2316" -#define CONFIG_SOC_CORE_NUM 16 +#define CONFIG_SOC_NAME "pe220x" +#define CONFIG_TARGET_TYPE_NAME "pe2204" +#define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 #define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 +#define CONFIG_TARGET_PE220X #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ -#define CONFIG_BOARD_NAME "test16" -#define CONFIG_CUS_DEMO_BOARD +#define CONFIG_BOARD_NAME "phytiumpi" +/* CONFIG_USE_SPI_IOPAD is not set */ +/* CONFIG_USE_GPIO_IOPAD is not set */ +/* CONFIG_USE_CAN_IOPAD is not set */ +/* CONFIG_USE_QSPI_IOPAD is not set */ +/* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_MIO_IOPAD is not set */ +/* CONFIG_USE_TACHO_IOPAD is not set */ +/* CONFIG_USE_UART_IOPAD is not set */ +/* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ +/* CONFIG_E2000Q_DEMO_BOARD is not set */ +#define CONFIG_PHYTIUMPI_FIREFLY_BOARD + +/* IO mux configuration when board start up */ + +/* end of IO mux configuration when board start up */ +/* CONFIG_CUS_DEMO_BOARD is not set */ /* Build project name */ @@ -98,8 +116,8 @@ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG -/* CONFIG_INTERRUPT_ROLE_MASTER is not set */ -#define CONFIG_INTERRUPT_ROLE_SLAVE +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ /* CONFIG_INTERRUPT_ROLE_NONE is not set */ /* end of Sdk common configuration */ @@ -107,7 +125,7 @@ #define CONFIG_USE_IOMUX /* CONFIG_ENABLE_IOCTRL is not set */ -/* CONFIG_ENABLE_IOPAD is not set */ +#define CONFIG_ENABLE_IOPAD /* CONFIG_USE_SPI is not set */ /* CONFIG_USE_QSPI is not set */ #define CONFIG_USE_SERIAL diff --git a/example/system/amp/openamp_echo_remoteproc_load/slave_00/src/slaver_00_rpmsg-ping.c b/example/system/amp/openamp_echo_remoteproc_load/slave_00/src/slaver_00_rpmsg-ping.c index 68d7857104eb2c63528e93e01b2fb45db4ffb6ac..1170360491a3b812d3fa698ea6b4473cf0904184 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/slave_00/src/slaver_00_rpmsg-ping.c +++ b/example/system/amp/openamp_echo_remoteproc_load/slave_00/src/slaver_00_rpmsg-ping.c @@ -212,7 +212,7 @@ int slave_init(void) SLAVER_00_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); - rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_SLAVE, NULL, NULL); + rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_DEVICE, NULL, NULL); if (!rpdev_slave_00) { SLAVER_00_DEBUG_E("Failed to create rpmsg vdev for slave 00\r\n"); diff --git a/example/system/amp/openamp_echo_remoteproc_load/slave_01/sdkconfig b/example/system/amp/openamp_echo_remoteproc_load/slave_01/sdkconfig index 725253c8c4d325afe7d3b7160b2e4e860e01e6a6..4533f1f18a187bb3c8730cf876c93a4217556e46 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/slave_01/sdkconfig +++ b/example/system/amp/openamp_echo_remoteproc_load/slave_01/sdkconfig @@ -62,31 +62,51 @@ CONFIG_MAX_XLAT_TABLES=256 # # Soc configuration # -# CONFIG_TARGET_PE2204 is not set +CONFIG_TARGET_PE2204=y # CONFIG_TARGET_PE2202 is not set # CONFIG_TARGET_PE2201 is not set # CONFIG_TARGET_PD1904 is not set # CONFIG_TARGET_PD2008 is not set # CONFIG_TARGET_PD2308 is not set -CONFIG_TARGET_PS2316=y +# CONFIG_TARGET_PS2316 is not set # CONFIG_TARGET_PD2408 is not set # CONFIG_TARGET_QEMU_VIRT is not set -CONFIG_SOC_NAME="ps2316" -CONFIG_SOC_CORE_NUM=16 +CONFIG_SOC_NAME="pe220x" +CONFIG_TARGET_TYPE_NAME="pe2204" +CONFIG_SOC_CORE_NUM=4 CONFIG_F32BIT_MEMORY_ADDRESS=0x80000000 CONFIG_F32BIT_MEMORY_LENGTH=0x80000000 CONFIG_F64BIT_MEMORY_ADDRESS=0x2000000000 CONFIG_F64BIT_MEMORY_LENGTH=0x800000000 +CONFIG_TARGET_PE220X=y CONFIG_DEFAULT_DEBUG_PRINT_UART1=y # CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set # CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set +# CONFIG_UART_INIT_NOT_CLR_INTR is not set # end of Soc configuration # # Board Configuration # -CONFIG_BOARD_NAME="test16" -CONFIG_CUS_DEMO_BOARD=y +CONFIG_BOARD_NAME="phytiumpi" +# CONFIG_USE_SPI_IOPAD is not set +# CONFIG_USE_GPIO_IOPAD is not set +# CONFIG_USE_CAN_IOPAD is not set +# CONFIG_USE_QSPI_IOPAD is not set +# CONFIG_USE_PWM_IOPAD is not set +# CONFIG_USE_MIO_IOPAD is not set +# CONFIG_USE_TACHO_IOPAD is not set +# CONFIG_USE_UART_IOPAD is not set +# CONFIG_USE_THIRD_PARTY_IOPAD is not set +# CONFIG_E2000Q_DEMO_BOARD is not set +CONFIG_PHYTIUMPI_FIREFLY_BOARD=y + +# +# IO mux configuration when board start up +# +# end of IO mux configuration when board start up + +# CONFIG_CUS_DEMO_BOARD is not set # # Build project name @@ -110,8 +130,8 @@ CONFIG_LOG_DISPALY_CORE_NUM=y CONFIG_USE_NS_GTIMER=y # CONFIG_USE_VIRTUAL_GTIMER is not set CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y -# CONFIG_INTERRUPT_ROLE_MASTER is not set -CONFIG_INTERRUPT_ROLE_SLAVE=y +CONFIG_INTERRUPT_ROLE_MASTER=y +# CONFIG_INTERRUPT_ROLE_SLAVE is not set # CONFIG_INTERRUPT_ROLE_NONE is not set # end of Sdk common configuration @@ -120,7 +140,7 @@ CONFIG_INTERRUPT_ROLE_SLAVE=y # CONFIG_USE_IOMUX=y # CONFIG_ENABLE_IOCTRL is not set -# CONFIG_ENABLE_IOPAD is not set +CONFIG_ENABLE_IOPAD=y # CONFIG_USE_SPI is not set # CONFIG_USE_QSPI is not set CONFIG_USE_SERIAL=y diff --git a/example/system/amp/openamp_echo_remoteproc_load/slave_01/sdkconfig.h b/example/system/amp/openamp_echo_remoteproc_load/slave_01/sdkconfig.h index 6bc1b3132aee072b1f6ab988c8f2a262c3330c39..25b6c3615e8a11e9431889aee776ed7ab026fb9c 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/slave_01/sdkconfig.h +++ b/example/system/amp/openamp_echo_remoteproc_load/slave_01/sdkconfig.h @@ -53,30 +53,48 @@ /* Soc configuration */ -/* CONFIG_TARGET_PE2204 is not set */ +#define CONFIG_TARGET_PE2204 /* CONFIG_TARGET_PE2202 is not set */ /* CONFIG_TARGET_PE2201 is not set */ /* CONFIG_TARGET_PD1904 is not set */ /* CONFIG_TARGET_PD2008 is not set */ /* CONFIG_TARGET_PD2308 is not set */ -#define CONFIG_TARGET_PS2316 +/* CONFIG_TARGET_PS2316 is not set */ /* CONFIG_TARGET_PD2408 is not set */ /* CONFIG_TARGET_QEMU_VIRT is not set */ -#define CONFIG_SOC_NAME "ps2316" -#define CONFIG_SOC_CORE_NUM 16 +#define CONFIG_SOC_NAME "pe220x" +#define CONFIG_TARGET_TYPE_NAME "pe2204" +#define CONFIG_SOC_CORE_NUM 4 #define CONFIG_F32BIT_MEMORY_ADDRESS 0x80000000 #define CONFIG_F32BIT_MEMORY_LENGTH 0x80000000 #define CONFIG_F64BIT_MEMORY_ADDRESS 0x2000000000 #define CONFIG_F64BIT_MEMORY_LENGTH 0x800000000 +#define CONFIG_TARGET_PE220X #define CONFIG_DEFAULT_DEBUG_PRINT_UART1 /* CONFIG_DEFAULT_DEBUG_PRINT_UART0 is not set */ /* CONFIG_DEFAULT_DEBUG_PRINT_UART2 is not set */ +/* CONFIG_UART_INIT_NOT_CLR_INTR is not set */ /* end of Soc configuration */ /* Board Configuration */ -#define CONFIG_BOARD_NAME "test16" -#define CONFIG_CUS_DEMO_BOARD +#define CONFIG_BOARD_NAME "phytiumpi" +/* CONFIG_USE_SPI_IOPAD is not set */ +/* CONFIG_USE_GPIO_IOPAD is not set */ +/* CONFIG_USE_CAN_IOPAD is not set */ +/* CONFIG_USE_QSPI_IOPAD is not set */ +/* CONFIG_USE_PWM_IOPAD is not set */ +/* CONFIG_USE_MIO_IOPAD is not set */ +/* CONFIG_USE_TACHO_IOPAD is not set */ +/* CONFIG_USE_UART_IOPAD is not set */ +/* CONFIG_USE_THIRD_PARTY_IOPAD is not set */ +/* CONFIG_E2000Q_DEMO_BOARD is not set */ +#define CONFIG_PHYTIUMPI_FIREFLY_BOARD + +/* IO mux configuration when board start up */ + +/* end of IO mux configuration when board start up */ +/* CONFIG_CUS_DEMO_BOARD is not set */ /* Build project name */ @@ -98,8 +116,8 @@ #define CONFIG_USE_NS_GTIMER /* CONFIG_USE_VIRTUAL_GTIMER is not set */ #define CONFIG_USE_DEFAULT_INTERRUPT_CONFIG -/* CONFIG_INTERRUPT_ROLE_MASTER is not set */ -#define CONFIG_INTERRUPT_ROLE_SLAVE +#define CONFIG_INTERRUPT_ROLE_MASTER +/* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ /* CONFIG_INTERRUPT_ROLE_NONE is not set */ /* end of Sdk common configuration */ @@ -107,7 +125,7 @@ #define CONFIG_USE_IOMUX /* CONFIG_ENABLE_IOCTRL is not set */ -/* CONFIG_ENABLE_IOPAD is not set */ +#define CONFIG_ENABLE_IOPAD /* CONFIG_USE_SPI is not set */ /* CONFIG_USE_QSPI is not set */ #define CONFIG_USE_SERIAL diff --git a/example/system/amp/openamp_echo_remoteproc_load/slave_01/src/slaver_01_rpmsg-ping.c b/example/system/amp/openamp_echo_remoteproc_load/slave_01/src/slaver_01_rpmsg-ping.c index 49d88817eb94c89c7366eab944b397dd9e32125d..b5f54dd638335827aaa48589ccc201f49a23865d 100644 --- a/example/system/amp/openamp_echo_remoteproc_load/slave_01/src/slaver_01_rpmsg-ping.c +++ b/example/system/amp/openamp_echo_remoteproc_load/slave_01/src/slaver_01_rpmsg-ping.c @@ -210,7 +210,7 @@ int slave_init(void) SLAVER_01_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); - rpdev_slave_01 = platform_create_rpmsg_vdev(&remoteproc_slave_01, 0, VIRTIO_DEV_SLAVE, NULL, NULL); + rpdev_slave_01 = platform_create_rpmsg_vdev(&remoteproc_slave_01, 0, VIRTIO_DEV_DEVICE, NULL, NULL); if (!rpdev_slave_01) { SLAVER_01_DEBUG_E("Failed to create rpmsg vdev for slave 01\r\n"); diff --git a/example/system/amp/openamp_for_linux/src/slaver_00_example.c b/example/system/amp/openamp_for_linux/src/slaver_00_example.c index 64c82aea314f3dacdf23e0616f59abda2608fc0b..49d8b30d9843ccb8d6d8135e0cee3720b8368ebb 100644 --- a/example/system/amp/openamp_for_linux/src/slaver_00_example.c +++ b/example/system/amp/openamp_for_linux/src/slaver_00_example.c @@ -253,7 +253,7 @@ static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) static int FRpmsgEchoApp(struct rpmsg_device *rdev, void *priv) { int ret = 0; - struct rpmsg_endpoint lept; + struct rpmsg_endpoint lept = {0}; shutdown_req = 0; /* Initialize RPMSG framework */ SLAVE_DEBUG_I("Try to create rpmsg endpoint.\r\n"); @@ -277,9 +277,8 @@ static int FRpmsgEchoApp(struct rpmsg_device *rdev, void *priv) break; } } - rpmsg_destroy_ept(&lept); - + SLAVE_DEBUG_I("Exiting rpmsg echo app.\r\n"); return ret; } @@ -314,7 +313,7 @@ int slave_init(void) SLAVE_DEBUG_I("Setup shared memory regions for both remoteproc instances is over \r\n"); - rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_SLAVE, NULL, NULL); + rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_DEVICE, NULL, NULL); if (!rpdev_slave_00) { SLAVE_DEBUG_E("Failed to create rpmsg vdev for slave 00\r\n"); @@ -330,11 +329,12 @@ int slave00_rpmsg_echo_process(void) SLAVE_DEBUG_I("Starting application..."); if(!slave_init()) { - FRpmsgEchoApp(rpdev_slave_00,&remoteproc_slave_00) ; + ret = FRpmsgEchoApp(rpdev_slave_00,&remoteproc_slave_00) ; if (ret) { SLAVE_DEBUG_E("Failed to running echoapp"); - return platform_cleanup(&remoteproc_slave_00); + platform_cleanup(&remoteproc_slave_00); + return -1; } platform_release_rpmsg_vdev(rpdev_slave_00, &remoteproc_slave_00); SLAVE_DEBUG_I("Stopping application..."); diff --git a/soc/pe220x/pe2202/fparameters.h b/soc/pe220x/pe2202/fparameters.h index d99b7724262490fe38f93a8d8e47fdfcbe81d2c2..d8c8065f5470d535df8c2906e86585b0af4a292d 100644 --- a/soc/pe220x/pe2202/fparameters.h +++ b/soc/pe220x/pe2202/fparameters.h @@ -146,6 +146,26 @@ extern "C" #define FSDIF_CLK_FREQ_HZ (1200000000UL) /* 1.2GHz */ +/* SEC */ + +#define HOST_OFFSET (0x5000) +#define SCE_STAT_OFFSET (0x00) + +#define RN_POOL_OFFSET (0x300) +#define HASH_OFFSET (0x280) +#define SCA_OFFSET (0x200) +#define ACA_OFFSET (0x00) + +#define FSEC_TRNG_MANAL_TRIGGER 0x0 +#define FSEC_TRNG_AUTO_TRIGGER (0x1) + +#define FSEC_TRNG_POOL_SIZE 32 +#define FSEC_RN_POOL_FILL_REQ 0x00000001 +#define FSEC_TRNG_CLOCK_ENABLE 0x00000002 + +#define FSEC_TRNG_BASEADDR 0x32a30000 + HOST_OFFSET +#define FSEC_TRNG_BASE 0x00 /*for later*/ +/*****************************************************************************/ /* register offset of iopad function / pull / driver strength */ #define FIOPAD_AN55_REG0_OFFSET 0x0000U #define FIOPAD_AW43_REG0_OFFSET 0x0004U diff --git a/third-party/libmetal/.checkpatch.conf b/third-party/libmetal/.checkpatch.conf deleted file mode 100644 index f147ba30d28f811ac3e2eadad8a43714d9aa04db..0000000000000000000000000000000000000000 --- a/third-party/libmetal/.checkpatch.conf +++ /dev/null @@ -1,23 +0,0 @@ ---emacs ---no-tree ---summary-file ---show-types ---max-line-length=80 ---min-conf-desc-length=1 - ---ignore BRACES ---ignore PRINTK_WITHOUT_KERN_LEVEL ---ignore SPLIT_STRING ---ignore VOLATILE ---ignore CONFIG_EXPERIMENTAL ---ignore AVOID_EXTERNS ---ignore NETWORKING_BLOCK_COMMENT_STYLE ---ignore DATE_TIME ---ignore MINMAX ---ignore CONST_STRUCT ---ignore FILE_PATH_CHANGES ---ignore BIT_MACRO ---ignore PREFER_KERNEL_TYPES ---ignore NEW_TYPEDEFS ---ignore ARRAY_SIZE ---ignore MACRO_ARG_REUSE \ No newline at end of file diff --git a/third-party/libmetal/.gitignore b/third-party/libmetal/.gitignore deleted file mode 100644 index 63a3ccdbdf577f91279b5928dd0d9050109a56e9..0000000000000000000000000000000000000000 --- a/third-party/libmetal/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -*.o -*~ -!libs/system/zc702evk/linux/lib/*/*.a -*.bin -*.map -*.out -*.log -*.swp -*.swo -*.d -build*/ - -/tags -/TAGS - -# cscope files -cscope.* -ncscope.* diff --git a/third-party/libmetal/.gitlint b/third-party/libmetal/.gitlint deleted file mode 100644 index 92d9e1b8db145a9bfe8c73c5de0066734faadbb0..0000000000000000000000000000000000000000 --- a/third-party/libmetal/.gitlint +++ /dev/null @@ -1,99 +0,0 @@ -# All these sections are optional, edit this file as you like. -[general] -# Ignore certain rules, you can reference them by their id or by their full name -ignore=title-trailing-punctuation, T3, title-max-length, T1, body-hard-tab, B1, B3 - -# verbosity should be a value between 1 and 3, the commandline -v flags take precedence over this -verbosity = 3 - -# By default gitlint will ignore merge commits. Set to 'false' to disable. -ignore-merge-commits=true - -# By default gitlint will ignore fixup commits. Set to 'false' to disable. -# ignore-fixup-commits=false - -# By default gitlint will ignore squash commits. Set to 'false' to disable. -# ignore-squash-commits=true - -# Ignore any data send to gitlint via stdin -# ignore-stdin=true - -# Enable debug mode (prints more output). Disabled by default. -debug=true - -# Enable community contributed rules -# See http://jorisroovers.github.io/gitlint/contrib_rules for details -# contrib=contrib-title-conventional-commits,CC1 - -# Set the extra-path where gitlint will search for user defined rules -# See http://jorisroovers.github.io/gitlint/user_defined_rules for details -extra-path=scripts/gitlint - -[title-max-length] -line-length=75 - -[body-min-line-count] -min-line-count=1 - -[body-max-line-count] -max-line-count=200 - -[title-must-not-contain-word] -# Comma-separated list of words that should not occur in the title. Matching is case -# insensitive. It's fine if the keyword occurs as part of a larger word (so "WIPING" -# will not cause a violation, but "WIP: my title" will. -words=wip - -# [title-match-regex] -# python like regex (https://docs.python.org/2/library/re.html) that the -# commit-msg title must be matched to. -# Note that the regex can contradict with other rules if not used correctly -# (e.g. title-must-not-contain-word). -# regex=^US[0-9]* - -[body-max-line-length] -# B1 = body-max-line-length -line-length=80 - -[body-min-length] -min-length=3 - -[body-is-missing] -# Whether to ignore this rule on merge commits (which typically only have a title) -# default = True -ignore-merge-commits=false - -# [body-changed-file-mention] -# List of files that need to be explicitly mentioned in the body when they are changed -# This is useful for when developers often erroneously edit certain files or git submodules. -# By specifying this rule, developers can only change the file when they explicitly reference -# it in the commit message. -# files=gitlint/rules.py,README.md - -# [author-valid-email] -# python like regex (https://docs.python.org/2/library/re.html) that the -# commit author email address should be matched to -# For example, use the following regex if you only want to allow email addresses from foo.com -# regex=[^@]+@foo.com - -# [ignore-by-title] -# Ignore certain rules for commits of which the title matches a regex -# E.g. Match commit titles that start with "Release" -# regex=^Release(.*) -# -# Ignore certain rules, you can reference them by their id or by their full name -# Use 'all' to ignore all rules -# ignore=T1,body-min-length - -# [ignore-by-body] -# Ignore certain rules for commits of which the body has a line that matches a regex -# E.g. Match bodies that have a line that that contain "release" -# regex=(.*)release(.*) -# -# Ignore certain rules, you can reference them by their id or by their full name -# Use 'all' to ignore all rules -# ignore=T1,body-min-length - -# [contrib-title-conventional-commits] -# Specify allowed commit types. For details see: https://www.conventionalcommits.org/ -# types = bugfix,user-story,epic \ No newline at end of file diff --git a/third-party/libmetal/CMakeLists.txt b/third-party/libmetal/CMakeLists.txt index 7ea8f7bc9945a2f7ea5fff17d2dc6e6402a9fd8e..eddbbfb5d79cb959ddca3cc41e4335a50d10be06 100644 --- a/third-party/libmetal/CMakeLists.txt +++ b/third-party/libmetal/CMakeLists.txt @@ -1,11 +1,4 @@ -cmake_minimum_required (VERSION 3.0.2) -if (POLICY CMP0048) - cmake_policy(SET CMP0048 NEW) -endif() - -if (POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() +cmake_minimum_required (VERSION 3.16) set (LIBMETAL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") @@ -43,4 +36,3 @@ if (WITH_EXAMPLES) add_subdirectory (examples) endif (WITH_EXAMPLES) -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/LICENSE.md b/third-party/libmetal/LICENSE.md index ec819a9622d3051a5abfd0578894c936f5152821..682bfd3a346a74d4207700a7684449297b26116c 100644 --- a/third-party/libmetal/LICENSE.md +++ b/third-party/libmetal/LICENSE.md @@ -29,12 +29,53 @@ 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. +Apache License :2.0 +======================================== + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +GPL 2.0 +======================================== + +Copyright (C) yyyy name of author + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +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 +GNU General Public License for more details. + +Linux Syscall Note +======================================== + +NOTE! This copyright does *not* cover user programs that use kernel services by normal system calls - this is merely considered normal use of the kernel, and does *not* fall under the heading of "derived work". Also note that the GPL below is copyrighted by the Free Software Foundation, but the instance of code that it refers to (the Linux kernel) is copyrighted by me and others who actually wrote it. + +Also note that the only valid version of the GPL as far as the kernel is concerned is _this_ particular version of the license (ie v2, not v2.2 or v3.x or whatever), unless explicitly otherwise stated. Notes ========================================= Use the following tag instead of the full license text in the individual files: SPDX-License-Identifier: BSD-3-Clause + SPDX-License-Identifier: Apache-2.0 + SPDX-License-Identifier: GPL-2.0 + SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note This enables machine processing of license information based on the SPDX License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/third-party/libmetal/MAINTAINERS.md b/third-party/libmetal/MAINTAINERS.md index 5f388dea0e3c787cb115bec71fa0bbaf5c852c5a..48dc8717ec052460fc7d1a11dbe93790b2a5c0ca 100644 --- a/third-party/libmetal/MAINTAINERS.md +++ b/third-party/libmetal/MAINTAINERS.md @@ -1,22 +1,15 @@ # libmetal Maintainers -libmetal project is maintained by the OpenAMP open source community. +The libmetal project is maintained by the OpenAMP open source community. Everyone is encouraged to submit issues and changes to improve libmetal. The intention of this file is to provide a set of names that developers can -consult when they have a question about OpenAMP and to provide a a set of -names to be CC'd when submitting a patch. +consult when they have a question about OpenAMP and to provide a set of names +to be CC'd when submitting a patch. ## Project Administration -Ed Mooring +Ed Mooring Arnaud Pouliquen ### All patches CC here openamp-rp@lists.openampproject.org - -## Machines -### Xilinx Platform - Zynq-7000 -Ed Mooring - -### Xilinx Platform - Zynq UltraScale+ MPSoC -Ed Mooring diff --git a/third-party/libmetal/README.md b/third-party/libmetal/README.md index d6be115f9b78818049205844e7be629b4139b3ac..0cc5181b2157041fbaba5a4fe840c520fdf03d1d 100644 --- a/third-party/libmetal/README.md +++ b/third-party/libmetal/README.md @@ -8,14 +8,18 @@ and request memory across the following operating environments: * RTOS (with and without virtual memory) * Bare-metal environments +For more details on the framework please refer to the +[OpenAMP Docs](https://openamp.readthedocs.io/en/latest/). + ## Project configuration -The configuration phase begins when the user invokes CMake. CMake begins by processing the CMakeLists.txt file and the cmake directory. -Some cmake options are available to help user to customize the libmetal to their -own project. + +The configuration phase begins when the user invokes CMake. CMake begins by +processing the CMakeLists.txt file and the cmake directory. Some cmake options +are available to help user to customize the libmetal to their own project. * **WITH_DOC** (default ON): Build with documentation. Add -DWITH_DOC=OFF in cmake command line to disable. -* **WITH_EXAMPLES** (default ON): Build with application exemples. Add +* **WITH_EXAMPLES** (default ON): Build with application examples. Add -DWITH_DOC=OFF in cmake command line to disable the option. * **WITH_TESTS** (default ON): Build with application tests. Add -DWITH_DOC=OFF in cmake command line to disable the option. @@ -40,9 +44,11 @@ in cmake command line to disable the option. ``` ### Cross Compiling for Linux Target + Use [meta-openamp](https://github.com/openamp/meta-openamp) to build libmetal library. -Use package `libmetal` in your yocto config file. + +Use package `libmetal` in your Yocto config file. ### Building for Baremetal @@ -77,16 +83,18 @@ xilmem and xilstandalone libraries in your build. These libraries were removed in 2019.1. ### Building for Zephyr + The [zephyr-libmetal](https://github.com/zephyrproject-rtos/libmetal) -implements the libmetal for the Zephyr project. It is mainly a fork of this repository, with some add-ons for integration in the Zephyr project. +implements the libmetal for the Zephyr project. It is mainly a fork of this +repository, with some add-ons for integration in the Zephyr project. -Following instruction is only to be able to run test application on a QEMU running -a Zephyr environment. +Following instruction is only to be able to run test application on a QEMU +running a Zephyr environment. -As Zephyr uses CMake, we build libmetal library and test application as -targets of Zephyr CMake project. Here is how to build libmetal for Zephyr: +As Zephyr uses CMake, we build libmetal library and test application as targets +of Zephyr CMake project. Here is how to build libmetal for Zephyr: ``` - $ export ZEPHYR_GCC_VARIANT=zephyr + $ export ZEPHYR_TOOLCHAIN_VARIANT=zephyr $ export ZEPHYR_SDK_INSTALL_DIR= $ source /zephyr-env.sh @@ -135,8 +143,9 @@ The following utilities are provided in lib/utilities.h: #### Version -The libmetal version interface allows user to get the version of the library. The version increment -follows the set of rule proposed in [Semantic Versioning specification](https://semver.org/). +The libmetal version interface allows user to get the version of the library. +The version increment follows the set of rule proposed in +[Semantic Versioning specification](https://semver.org/). ### Top Level Interfaces @@ -153,13 +162,12 @@ For the current release, libmetal provides Linux userspace and bare-metal implementation for metal_sys_init and metal_sys_finish. For Linux userspace, metal_sys_init sets up a table for available shared pages, -checks whether UIO/VFIO drivers are avail, and starts interrupt handling -thread. -Please note that on Linux, to access device's memory that is not page -aligned, an offset has to be added to the pointer returned by -mmap(). This `offset`, although it can be read from the device tree -property exposed by the uio driver, is not handled yet by the -library. +checks whether UIO/VFIO drivers are avail, and starts interrupt handling thread. + +Please note that on Linux, to access device's memory that is not page aligned, +an offset has to be added to the pointer returned by mmap(). This `offset`, +although it can be read from the device tree property exposed by the uio driver, +is not handled yet by the library. For bare-metal, metal_sys_init and metal_sys_finish just returns. @@ -207,12 +215,12 @@ sizes. libmetal has a static generic implementation. If your OS has a driver model implementation, you will need to port it for the OS. -The Linux userspace abstraction binds the devices to UIO or VFIO driver. -The user applications specify which device to use, e.g. bus "platform" bus, -device "f8000000.slcr", and then the abstraction will check if platform UIO -driver or platform VFIO driver is there. If platform VFIO driver exists, -it will bind the device to the platform VFIO driver, otherwise, if UIO driver -exists, it will bind the device to the platform UIO driver. +The Linux userspace abstraction binds the devices to UIO or VFIO driver. The +user applications specify which device to use, e.g. bus "platform" bus, device +"f8000000.slcr", and then the abstraction will check if platform UIO driver or +platform VFIO driver is there. If platform VFIO driver exists, it will bind the +device to the platform VFIO driver, otherwise, if UIO driver exists, it will +bind the device to the platform UIO driver. The VFIO support is not yet implemented. @@ -231,7 +239,7 @@ handler registered by the user application. libmetal provides APIs to flush and invalidate caches. The cache APIs for Linux userspace are empty functions for now as cache -operations system calls are not avaiable for all architectures. +operations system calls are not available for all architectures. ### DMA @@ -255,47 +263,74 @@ This API is for compiler dependent functions. For this release, there is only a GCC implementation, and compiler specific code is limited to atomic operations. -## How to contribute: -As an open-source project, we welcome and encourage the community to submit patches directly to the project. As a contributor you should be familiar with common developer tools such as Git and CMake, and platforms such as GitHub. +## Deprecated platforms + - AMD-Xilinx Zynq7000. Last known stable release - v2023.04 + +## How to contribute + +As an open-source project, we welcome and encourage the community to submit +patches directly to the project. As a contributor you should be familiar with +common developer tools such as Git and CMake, and platforms such as GitHub. + Then following points should be rescpected to facilitate the review process. ### Licencing -Code is contributed to OpenAMP under a number of licenses, but all code must be compatible with version the [BSD License](https://github.com/OpenAMP/libmetal/blob/master/LICENSE.md), which is the license covering the OpenAMP distribution as a whole. In practice, use the following tag instead of the full license text in the individual files: + +Code is contributed to OpenAMP under a number of licenses, but all code must be +compatible with version the +[BSD License](https://github.com/OpenAMP/libmetal/blob/master/LICENSE.md), which +is the license covering the OpenAMP distribution as a whole. In practice, use +the following tag instead of the full license text in the individual files: ``` SPDX-License-Identifier: BSD-3-Clause ``` ### Signed-off-by -Commit message must contain Signed-off-by: line and your email must match the change authorship information. Make sure your .gitconfig is set up correctly: + +Commit messages must contain Signed-off-by: line and your email must match the +change authorship information. Make sure your .gitconfig is set up correctly: ``` git config --global user.name "first-name Last-Namer" git config --global user.email "yourmail@company.com" ``` + ### gitlint -Before you submit a pull request to the project, verify your commit messages meet the requirements. The check can be performed locally using the the gitlint command. -Run gitlint locally in your tree and branch where your patches have been committed: +Before you submit a pull request to the project, verify your commit messages +meet the requirements. The check can be performed locally using the the gitlint +command. + +Run gitlint locally in your tree and branch where your patches have been +committed: ```gitlint``` -Note, gitlint only checks HEAD (the most recent commit), so you should run it after each commit, or use the --commits option to specify a commit range covering all the development patches to be submitted. + +Note, gitlint only checks HEAD (the most recent commit), so you should run it +after each commit, or use the --commits option to specify a commit range +covering all the development patches to be submitted. ### Code style + In general, follow the Linux kernel coding style, with the following exceptions: * Use /** */ for doxygen comments that need to appear in the documentation. -The Linux kernel GPL-licensed tool checkpatch is used to check coding style conformity.Checkpatch is available in the scripts directory. +The Linux kernel GPL-licensed tool checkpatch is used to check coding style +conformity. Checkpatch is available in the scripts directory. To check your \ commits in your git branch: + ``` ./scripts/checkpatch.pl --strict -g HEAD- ``` ### Send a pull request -We use standard github mechanism for pull request. Please refer to github documentation for help. + +We use standard GitHub mechanism for pull request. Please refer to GitHub +documentation for help. ## Communication and Collaboration -[Subscribe](https://lists.openampproject.org/mailman/listinfo/openamp-rp) to the OpenAMP mailing list(openamp-rp@lists.openampproject.org). -For more details on the framework please refer to the the [OpenAMP wiki](https://github.com/OpenAMP/open-amp/wiki). +[Subscribe](https://lists.openampproject.org/mailman3/lists/openamp-rp.lists.openampproject.org/) +to the OpenAMP mailing list (openamp-rp@lists.openampproject.org). diff --git a/third-party/libmetal/VERSION b/third-party/libmetal/VERSION index 28f0f0226d631c38af4d2c87b7129b592bd20f18..5f75d466746a95bf7f6b3b0ecb4f65be0cf36111 100644 --- a/third-party/libmetal/VERSION +++ b/third-party/libmetal/VERSION @@ -1,3 +1,3 @@ VERSION_MAJOR = 1 -VERSION_MINOR = 0 +VERSION_MINOR = 8 VERSION_PATCH = 0 diff --git a/third-party/libmetal/doc/CMakeLists.txt b/third-party/libmetal/doc/CMakeLists.txt index 89566381648d57d3d12f9b472f38d79f7469786e..094339e114a05634b18fabaf57f3ae73e17fab30 100644 --- a/third-party/libmetal/doc/CMakeLists.txt +++ b/third-party/libmetal/doc/CMakeLists.txt @@ -1,11 +1,23 @@ if (DOXYGEN_FOUND) - configure_file (Doxyfile.in Doxyfile @ONLY) + if (EXISTS ${CMAKE_SOURCE_DIR}/../_doxygen/openamp/Doxyfile-openamp.in) + set (OAMP_DOX_DIR ${CMAKE_SOURCE_DIR}/../_doxygen/openamp) + configure_file (Doxyfile.in Doxyfile1 @ONLY) + configure_file (${OAMP_DOX_DIR}/Doxyfile-openamp.in Doxyfile2 @ONLY) - add_custom_target (doc ALL - ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) + add_custom_target (doc ALL + COMMAND cat Doxyfile1 Doxyfile2 >Doxyfile + COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + else () + configure_file (Doxyfile.in Doxyfile @ONLY) + + add_custom_target (doc ALL + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + endif () install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc/${PROJECT_NAME}) @@ -16,4 +28,3 @@ install (FILES ${PROJECT_SOURCE_DIR}/LICENSE.md endif (DOXYGEN_FOUND) -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/doc/readthedocs-conf.py b/third-party/libmetal/doc/readthedocs-conf.py new file mode 100644 index 0000000000000000000000000000000000000000..05a20b6bfd0de4d55ea29a68877bab7757c8cd8f --- /dev/null +++ b/third-party/libmetal/doc/readthedocs-conf.py @@ -0,0 +1,14 @@ +# Although RTDs now requires sphinx: configuration: it does not pass it to the +# build command and it still looks for conf.py in the current dir. It is +# confusing to have a conf.py that will only work in the very specific RTDs +# dir structure so we don't do that. + +# So we supply a no-op config file and override the build command to run in the +# openamp-docs dir + +# Since we have our own build command now, we could eliminate this file +# completely but that also disables the predefined sphinx steps of +# create_environment and install. The current setup keeps the build +# environment closer to that used by the real openamp-docs build + +print("readthedocs-conf.py does nothing") diff --git a/third-party/libmetal/include.mk b/third-party/libmetal/include.mk index 3cb9fe74b3f2e7de58ad30f2af200540058f024f..bc4f3b0ac68b401dfe318c6150e6b7069ec36592 100644 --- a/third-party/libmetal/include.mk +++ b/third-party/libmetal/include.mk @@ -7,7 +7,7 @@ ifdef CONFIG_USE_LIBMETAL ifdef CONFIG_TARGET_ARMV8_AARCH32 - BUILD_INC_PATH_DIR += $(SDK_DIR)/third-party/libmetal/metal/processor/arm + BUILD_INC_PATH_DIR += $(SDK_DIR)/third-party/libmetal/metal/processor/generic endif ifdef CONFIG_TARGET_ARMV8_AARCH64 diff --git a/third-party/libmetal/metal/CMakeLists.txt b/third-party/libmetal/metal/CMakeLists.txt index 121e0c64f67279f5b51fd263f34a65b4544c0e1f..8b186dd646b420e90b277da49b8d77444c0ab2cf 100644 --- a/third-party/libmetal/metal/CMakeLists.txt +++ b/third-party/libmetal/metal/CMakeLists.txt @@ -65,6 +65,12 @@ if (WITH_DEFAULT_LOGGER) add_definitions (-DDEFAULT_LOGGER_ON) endif (WITH_DEFAULT_LOGGER) +if (WITH_FUNC_LINE_LOG) + add_definitions (-DML_FUNC_LINE) +endif (WITH_FUNC_LINE_LOG) + +get_property (_ec_flgs GLOBAL PROPERTY "PROJECT_EC_FLAGS") + if (WITH_ZEPHYR) zephyr_library_named(metal) add_dependencies(metal offsets_h) @@ -77,10 +83,7 @@ else (WITH_ZEPHYR) add_library (${_lib} SHARED ${_sources}) target_link_libraries (${_lib} ${_deps}) install (TARGETS ${_lib} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - if (PROJECT_EC_FLAGS) - string(REPLACE " " ";" _ec_flgs ${PROJECT_EC_FLAGS}) - target_compile_options (${_lib} PUBLIC ${_ec_flgs}) - endif (PROJECT_EC_FLAGS) + target_compile_options (${_lib} PUBLIC ${_ec_flgs}) set_target_properties (${_lib} PROPERTIES OUTPUT_NAME "${PROJECT_NAME}" VERSION "${PROJECT_VERSION}" @@ -93,14 +96,10 @@ else (WITH_ZEPHYR) set (_lib ${PROJECT_NAME}-static) add_library (${_lib} STATIC ${_sources}) install (TARGETS ${_lib} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - if (PROJECT_EC_FLAGS) - string(REPLACE " " ";" _ec_flgs ${PROJECT_EC_FLAGS}) - target_compile_options (${_lib} PUBLIC ${_ec_flgs}) - endif (PROJECT_EC_FLAGS) + target_compile_options (${_lib} PUBLIC ${_ec_flgs}) set_target_properties (${_lib} PROPERTIES OUTPUT_NAME "${PROJECT_NAME}" ) endif (WITH_STATIC_LIB) endif (WITH_ZEPHYR) -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/alloc.h b/third-party/libmetal/metal/alloc.h index 88d6dcfd1da35e5e0fdd20b2d924830b7a092b01..02f860b12f593b2e5cb8bfc4e5b6abcfd134d612 100644 --- a/third-party/libmetal/metal/alloc.h +++ b/third-party/libmetal/metal/alloc.h @@ -12,6 +12,8 @@ #ifndef __METAL_ALLOC__H__ #define __METAL_ALLOC__H__ +#include + #ifdef __cplusplus extern "C" { #endif @@ -27,16 +29,20 @@ extern "C" { * @param[in] size size in byte of requested memory * @return memory pointer, or 0 if it failed to allocate */ -static inline void *metal_allocate_memory(unsigned int size); +static inline void *metal_allocate_memory(unsigned int size) +{ + return __metal_allocate_memory(size); +} /** * @brief free the memory previously allocated * * @param[in] ptr pointer to memory */ -static inline void metal_free_memory(void *ptr); - -#include +static inline void metal_free_memory(void *ptr) +{ + __metal_free_memory(ptr); +} /** @} */ diff --git a/third-party/libmetal/metal/atomic.h b/third-party/libmetal/metal/atomic.h index fad9458d80662a8771cb4d5412122f2c95afa553..d49f133745082a2b9607a2b9cf2fa260d056a53f 100644 --- a/third-party/libmetal/metal/atomic.h +++ b/third-party/libmetal/metal/atomic.h @@ -26,6 +26,12 @@ # include using std::atomic_flag; using std::memory_order; +using std::memory_order_relaxed; +using std::memory_order_consume; +using std::memory_order_acquire; +using std::memory_order_release; +using std::memory_order_acq_rel; +using std::memory_order_seq_cst; using std::atomic_bool; using std::atomic_char; @@ -94,14 +100,18 @@ using std::atomic_fetch_and_explicit; using std::atomic_thread_fence; using std::atomic_signal_fence; -#elif defined(HAVE_STDATOMIC_H) && !defined(__CC_ARM) && \ - !defined(__STDC_NO_ATOMICS__) +#elif defined(HAVE_STDATOMIC_H) && !defined(__ARMCC_VERSION) && \ +!defined(__STDC_NO_ATOMICS__) # include # include #elif defined(__GNUC__) # include #else -# include +#if defined(HAVE_PROCESSOR_ATOMIC_H) +# include +#else +# include +#endif /* defined(HAVE_PROCESSOR_ATOMIC_H) */ #endif #endif /* __METAL_ATOMIC__H__ */ diff --git a/third-party/libmetal/metal/compiler.h b/third-party/libmetal/metal/compiler.h index 35dc490f72a8cf5a66bb14808c06edfcf77f18e5..b172824688f0c3cf168023ce539c400002167174 100644 --- a/third-party/libmetal/metal/compiler.h +++ b/third-party/libmetal/metal/compiler.h @@ -16,8 +16,8 @@ # include #elif defined(__ICCARM__) # include -#elif defined(__CC_ARM) -# error "MDK-ARM ARMCC compiler requires the GNU extentions to work correctly" +#elif defined(__ARMCC_VERSION) +# error "MDK-ARM ARMCC compiler requires the GNU extensions to work correctly" #else # error "Missing compiler support" #endif diff --git a/third-party/libmetal/metal/compiler/CMakeLists.txt b/third-party/libmetal/metal/compiler/CMakeLists.txt deleted file mode 100644 index 885b88cf2559aca2c7251d9e15332ef43459416a..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/compiler/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory (armcc) -add_subdirectory (gcc) -add_subdirectory (iar) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/compiler/armcc/CMakeLists.txt b/third-party/libmetal/metal/compiler/armcc/CMakeLists.txt deleted file mode 100644 index 9c93d81f653ca67ae60704f89fa53d3255024ba8..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/compiler/armcc/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -collect (PROJECT_LIB_HEADERS errno.h) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/compiler/armcc/errno.h b/third-party/libmetal/metal/compiler/armcc/errno.h deleted file mode 100644 index 43dab85d636e0d97246bc663c845ba420ecab1c0..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/compiler/armcc/errno.h +++ /dev/null @@ -1,58 +0,0 @@ -/*- - * Copyright (c) 2020 STMicroelectronics. All rights reserved. - * - * Copyright (c) 1982, 1986, 1989, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef __METAL_ARMCC_ERRNO__H__ -#define __METAL_ARMCC_ERRNO__H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define LIBMETAL_ERR_BASE 100 - -#define EPERM (LIBMETAL_ERR_BASE + 1) /* Operation not permitted */ -#define ENOENT (LIBMETAL_ERR_BASE + 2) /* No such file or directory */ -#define ESRCH (LIBMETAL_ERR_BASE + 3) /* No such process */ -#define EINTR (LIBMETAL_ERR_BASE + 4) /* Interrupted system call */ -#define EIO (LIBMETAL_ERR_BASE + 5) /* Input/output error */ -#define ENXIO (LIBMETAL_ERR_BASE + 6) /* Device not configured */ -#define E2BIG (LIBMETAL_ERR_BASE + 7) /* Argument list too long */ -#define ENOEXEC (LIBMETAL_ERR_BASE + 8) /* Exec format error */ -#define EBADF (LIBMETAL_ERR_BASE + 9) /* Bad file descriptor */ -#define ECHILD (LIBMETAL_ERR_BASE + 10) /* No child processes */ -#define EDEADLK (LIBMETAL_ERR_BASE + 11) /* Resource deadlock avoided */ -#define EACCES (LIBMETAL_ERR_BASE + 13) /* Permission denied */ -#define EFAULT (LIBMETAL_ERR_BASE + 14) /* Bad address */ -#define ENOTBLK (LIBMETAL_ERR_BASE + 15) /* Block device required */ -#define EBUSY (LIBMETAL_ERR_BASE + 16) /* Device busy */ -#define EEXIST (LIBMETAL_ERR_BASE + 17) /* File exists */ -#define EXDEV (LIBMETAL_ERR_BASE + 18) /* Cross-device link */ -#define ENODEV (LIBMETAL_ERR_BASE + 19) /* Operation not supported by device */ -#define ENOTDIR (LIBMETAL_ERR_BASE + 20) /* Not a directory */ -#define EISDIR (LIBMETAL_ERR_BASE + 21) /* Is a directory */ -#define ENFILE (LIBMETAL_ERR_BASE + 23) /* Too many open files in system */ -#define EMFILE (LIBMETAL_ERR_BASE + 24) /* Too many open files */ -#define ENOTTY (LIBMETAL_ERR_BASE + 25) /* Inappropriate ioctl for device */ -#define ETXTBSY (LIBMETAL_ERR_BASE + 26) /* Text file busy */ -#define EFBIG (LIBMETAL_ERR_BASE + 27) /* File too large */ -#define ENOSPC (LIBMETAL_ERR_BASE + 28) /* No space left on device */ -#define ESPIPE (LIBMETAL_ERR_BASE + 29) /* Illegal seek */ -#define EROFS (LIBMETAL_ERR_BASE + 30) /* Read-only filesystem */ -#define EMLINK (LIBMETAL_ERR_BASE + 31) /* Too many links */ -#define EPIPE (LIBMETAL_ERR_BASE + 32) /* Broken pipe */ -#define EAGAIN (LIBMETAL_ERR_BASE + 35) /* Resource temporarily unavailable */ - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_ARMCC_ERRNO__H__ */ diff --git a/third-party/libmetal/metal/compiler/gcc/CMakeLists.txt b/third-party/libmetal/metal/compiler/gcc/CMakeLists.txt index 06852b04d0f151049845c7b811dbbc67d5c79582..7835f4f1114097d47c2e5a5f7eaac7beed039126 100644 --- a/third-party/libmetal/metal/compiler/gcc/CMakeLists.txt +++ b/third-party/libmetal/metal/compiler/gcc/CMakeLists.txt @@ -1,4 +1,3 @@ collect (PROJECT_LIB_HEADERS atomic.h) collect (PROJECT_LIB_HEADERS compiler.h) -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/compiler/iar/CMakeLists.txt b/third-party/libmetal/metal/compiler/iar/CMakeLists.txt deleted file mode 100644 index 3dbec5ce3b19dcf1f7c57befbcdaec5aa6cc60d1..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/compiler/iar/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -collect (PROJECT_LIB_HEADERS compiler.h) -collect (PROJECT_LIB_HEADERS errno.h) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/compiler/iar/compiler.h b/third-party/libmetal/metal/compiler/iar/compiler.h deleted file mode 100644 index a6e8bd5c3c880844da15e35db25cbcecb427257d..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/compiler/iar/compiler.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2018, ST Microelectronics. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file iar/compiler.h - * @brief IAR specific primitives for libmetal. - */ - -#ifndef __METAL_IAR_COMPILER__H__ -#define __METAL_IAR_COMPILER__H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define restrict __restrict__ -#define metal_align(n) __attribute__((aligned(n))) -#define metal_weak __attribute__((weak)) -#define metal_asm asm - -#define METAL_PACKED_BEGIN __packed -#define METAL_PACKED_END - -#ifndef __deprecated -#define __deprecated __attribute__((deprecated)) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_IAR_COMPILER__H__ */ diff --git a/third-party/libmetal/metal/compiler/iar/errno.h b/third-party/libmetal/metal/compiler/iar/errno.h deleted file mode 100644 index 69cd86cb2d6c33ff08d74b55fa2879f5e42550f3..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/compiler/iar/errno.h +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * Copyright (c) 2020 STMicroelectronics. All rights reserved. - * - * Copyright (c) 1982, 1986, 1989, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef __METAL_IAR_ERRNO__H__ -#define __METAL_IAR_ERRNO__H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define LIBMETAL_ERR_BASE 100 - -#define EPERM (LIBMETAL_ERR_BASE + 1) /* Operation not permitted */ -#define ENOENT (LIBMETAL_ERR_BASE + 2) /* No such file or directory */ -#define ESRCH (LIBMETAL_ERR_BASE + 3) /* No such process */ -#define EINTR (LIBMETAL_ERR_BASE + 4) /* Interrupted system call */ -#define EIO (LIBMETAL_ERR_BASE + 5) /* Input/output error */ -#define ENXIO (LIBMETAL_ERR_BASE + 6) /* Device not configured */ -#define E2BIG (LIBMETAL_ERR_BASE + 7) /* Argument list too long */ -#define ENOEXEC (LIBMETAL_ERR_BASE + 8) /* Exec format error */ -#define EBADF (LIBMETAL_ERR_BASE + 9) /* Bad file descriptor */ -#define ECHILD (LIBMETAL_ERR_BASE + 10) /* No child processes */ -#define EDEADLK (LIBMETAL_ERR_BASE + 11) /* Resource deadlock avoided */ -#define ENOMEM (LIBMETAL_ERR_BASE + 12) /* Cannot allocate memory */ -#define EACCES (LIBMETAL_ERR_BASE + 13) /* Permission denied */ -#define EFAULT (LIBMETAL_ERR_BASE + 14) /* Bad address */ -#define ENOTBLK (LIBMETAL_ERR_BASE + 15) /* Block device required */ -#define EBUSY (LIBMETAL_ERR_BASE + 16) /* Device busy */ -#define EEXIST (LIBMETAL_ERR_BASE + 17) /* File exists */ -#define EXDEV (LIBMETAL_ERR_BASE + 18) /* Cross-device link */ -#define ENODEV (LIBMETAL_ERR_BASE + 19) /* Operation not supported by device */ -#define ENOTDIR (LIBMETAL_ERR_BASE + 20) /* Not a directory */ -#define EISDIR (LIBMETAL_ERR_BASE + 21) /* Is a directory */ -#define EINVAL (LIBMETAL_ERR_BASE + 22) /* Invalid argument */ -#define ENFILE (LIBMETAL_ERR_BASE + 23) /* Too many open files in system */ -#define EMFILE (LIBMETAL_ERR_BASE + 24) /* Too many open files */ -#define ENOTTY (LIBMETAL_ERR_BASE + 25) /* Inappropriate ioctl for device */ -#define ETXTBSY (LIBMETAL_ERR_BASE + 26) /* Text file busy */ -#define EFBIG (LIBMETAL_ERR_BASE + 27) /* File too large */ -#define ENOSPC (LIBMETAL_ERR_BASE + 28) /* No space left on device */ -#define ESPIPE (LIBMETAL_ERR_BASE + 29) /* Illegal seek */ -#define EROFS (LIBMETAL_ERR_BASE + 30) /* Read-only filesystem */ -#define EMLINK (LIBMETAL_ERR_BASE + 31) /* Too many links */ -#define EPIPE (LIBMETAL_ERR_BASE + 32) /* Broken pipe */ -#define EAGAIN (LIBMETAL_ERR_BASE + 35) /* Resource temporarily unavailable */ - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_IAR_ERRNO__H__ */ diff --git a/third-party/libmetal/metal/condition.h b/third-party/libmetal/metal/condition.h index 54f5b59ad01412aff20d610ed9ad74d1d6735ad3..b5c7b2dbec7ee9621c14c6a75a5cc5bc79c834d0 100644 --- a/third-party/libmetal/metal/condition.h +++ b/third-party/libmetal/metal/condition.h @@ -63,12 +63,12 @@ static inline int metal_condition_broadcast(struct metal_condition *cv); */ int metal_condition_wait(struct metal_condition *cv, metal_mutex_t *m); -#include - /** @} */ #ifdef __cplusplus } #endif +#include + #endif /* __METAL_CONDITION__H__ */ diff --git a/third-party/libmetal/metal/config.h b/third-party/libmetal/metal/config.h index a9da6546329dcbf63dc3acbd4d87ea399e56a56d..5d10b6edf07f61a9be22891b6e10cdfc68564a66 100644 --- a/third-party/libmetal/metal/config.h +++ b/third-party/libmetal/metal/config.h @@ -20,7 +20,7 @@ extern "C" { #define METAL_VER_MAJOR 1 /** Library minor version number. */ -#define METAL_VER_MINOR 0 +#define METAL_VER_MINOR 8 /** Library patch level. */ #define METAL_VER_PATCH 0 @@ -39,10 +39,6 @@ extern "C" { /** Machine type (zynq, zynqmp, ...). */ #define METAL_MACHINE "ft_platform" - - - - #ifdef __cplusplus } #endif diff --git a/third-party/libmetal/metal/cpu.h b/third-party/libmetal/metal/cpu.h index a65b38fcf0b471f02fd558c51462d396a358a709..3ee3596b1f8c56c6a87f927e1639315c1b9a477b 100644 --- a/third-party/libmetal/metal/cpu.h +++ b/third-party/libmetal/metal/cpu.h @@ -12,6 +12,12 @@ #ifndef __METAL_CPU__H__ #define __METAL_CPU__H__ -# include +#include + +#if defined(HAVE_PROCESSOR_CPU_H) +# include +#else +# include +#endif #endif /* __METAL_CPU__H__ */ diff --git a/third-party/libmetal/metal/device.c b/third-party/libmetal/metal/device.c index e59866c552d5573f757a60cdb1308742e0fa721f..45e08eccd6d6d5e07cc3a65eab46648cb0b5c155 100644 --- a/third-party/libmetal/metal/device.c +++ b/third-party/libmetal/metal/device.c @@ -102,8 +102,8 @@ int metal_generic_dev_open(struct metal_bus *bus, const char *dev_name, struct metal_device *dev; (void)bus; - metal_list_for_each(&_metal.common.generic_device_list, node) - { + + metal_list_for_each(&_metal.common.generic_device_list, node) { dev = metal_container_of(node, struct metal_device, node); if (strcmp(dev->name, dev_name) == 0) { *device = dev; diff --git a/third-party/libmetal/metal/device.h b/third-party/libmetal/metal/device.h index d80376dcde1634c57b1f4c1a572e87b4daa03f8e..366f20e8a39e3d3ab9c45e3e7b1babb4c52ad6ee 100644 --- a/third-party/libmetal/metal/device.h +++ b/third-party/libmetal/metal/device.h @@ -86,14 +86,14 @@ struct metal_device { * @param[in] bus Pre-initialized bus structure. * @return 0 on success, or -errno on failure. */ -extern int metal_bus_register(struct metal_bus *bus); +int metal_bus_register(struct metal_bus *bus); /** * @brief Unregister a libmetal bus. * @param[in] bus Pre-registered bus structure. * @return 0 on success, or -errno on failure. */ -extern int metal_bus_unregister(struct metal_bus *bus); +int metal_bus_unregister(struct metal_bus *bus); /** * @brief Find a libmetal bus by name. @@ -101,7 +101,7 @@ extern int metal_bus_unregister(struct metal_bus *bus); * @param[out] bus Returned bus handle. * @return 0 on success, or -errno on failure. */ -extern int metal_bus_find(const char *name, struct metal_bus **bus); +int metal_bus_find(const char *name, struct metal_bus **bus); /** * @brief Statically register a generic libmetal device. @@ -118,7 +118,7 @@ extern int metal_bus_find(const char *name, struct metal_bus **bus); * @param[in] device Generic device. * @return 0 on success, or -errno on failure. */ -extern int metal_register_generic_device(struct metal_device *device); +int metal_register_generic_device(struct metal_device *device); /** * @brief Open a libmetal device by name. @@ -127,14 +127,14 @@ extern int metal_register_generic_device(struct metal_device *device); * @param[out] device Returned device handle. * @return 0 on success, or -errno on failure. */ -extern int metal_device_open(const char *bus_name, const char *dev_name, - struct metal_device **device); +int metal_device_open(const char *bus_name, const char *dev_name, + struct metal_device **device); /** * @brief Close a libmetal device. * @param[in] device Device handle. */ -extern void metal_device_close(struct metal_device *device); +void metal_device_close(struct metal_device *device); /** * @brief Get an I/O region accessor for a device region. @@ -156,18 +156,14 @@ metal_device_io_region(struct metal_device *device, unsigned int index) #if 1 extern int metal_generic_dev_sys_open(struct metal_device *dev); extern int metal_generic_dev_open(struct metal_bus *bus, const char *dev_name, - struct metal_device **device); + struct metal_device **device); extern int metal_generic_dev_dma_map(struct metal_bus *bus, - struct metal_device *device, - uint32_t dir, - struct metal_sg *sg_in, - int nents_in, - struct metal_sg *sg_out); + struct metal_device *device, + uint32_t dir, struct metal_sg *sg_in, + int nents_in, struct metal_sg *sg_out); extern void metal_generic_dev_dma_unmap(struct metal_bus *bus, - struct metal_device *device, - uint32_t dir, - struct metal_sg *sg, - int nents); + struct metal_device *device, + uint32_t dir, struct metal_sg *sg, int nents); #endif /* METAL_INTERNAL */ #ifdef __cplusplus diff --git a/third-party/libmetal/metal/dma.h b/third-party/libmetal/metal/dma.h index 32554bded829032257d6794f1e0e826bc04b1846..9bb7e54c83f881b3a752455ee84d749227772c48 100644 --- a/third-party/libmetal/metal/dma.h +++ b/third-party/libmetal/metal/dma.h @@ -12,6 +12,9 @@ #ifndef __METAL_DMA__H__ #define __METAL_DMA__H__ +#include +#include + #ifdef __cplusplus extern "C" { #endif @@ -20,9 +23,6 @@ extern "C" { * @{ */ -#include -#include - #define METAL_DMA_DEV_R 1 /**< DMA direction, device read */ #define METAL_DMA_DEV_W 2 /**< DMA direction, device write */ #define METAL_DMA_DEV_WR 3 /**< DMA direction, device read/write */ diff --git a/third-party/libmetal/metal/errno.h b/third-party/libmetal/metal/errno.h index e84a2bc7d70d9f0f22e307281b669598ab957c37..fa8270dbf4ddc6ce835b2ae04a00b661ba7f8334 100644 --- a/third-party/libmetal/metal/errno.h +++ b/third-party/libmetal/metal/errno.h @@ -14,7 +14,7 @@ #if defined(__ICCARM__) # include -#elif defined(__CC_ARM) +#elif defined(__ARMCC_VERSION) # include #else # include diff --git a/third-party/libmetal/metal/init.c b/third-party/libmetal/metal/init.c index 315217741f693153a3667842cab4734b4b2f3587..5a6a0063d5c3a3f859e52479e8be13a688e56f5e 100644 --- a/third-party/libmetal/metal/init.c +++ b/third-party/libmetal/metal/init.c @@ -11,6 +11,9 @@ int metal_init(const struct metal_init_params *params) { int error = 0; + if (_metal.common.ref_count++ != 0) + return 0; + memset(&_metal, 0, sizeof(_metal)); _metal.common.log_handler = params->log_handler; @@ -24,11 +27,15 @@ int metal_init(const struct metal_init_params *params) if (error) return error; + ++_metal.common.ref_count; return error; } void metal_finish(void) { + if (--_metal.common.ref_count != 0) + return; + metal_sys_finish(); memset(&_metal, 0, sizeof(_metal)); } diff --git a/third-party/libmetal/metal/io.c b/third-party/libmetal/metal/io.c index 8376ded0db1d33dcb1aaa7d3fa7f9ff47f43e920..7faf40502e90c42ee20d2671a051c70d57ec9fd3 100644 --- a/third-party/libmetal/metal/io.c +++ b/third-party/libmetal/metal/io.c @@ -39,7 +39,7 @@ int metal_io_block_read(struct metal_io_region *io, unsigned long offset, unsigned char *dest = dst; int retlen; - if (offset >= io->size) + if (!ptr) return -ERANGE; if ((offset + len) > io->size) len = io->size - offset; @@ -76,7 +76,7 @@ int metal_io_block_write(struct metal_io_region *io, unsigned long offset, const unsigned char *source = src; int retlen; - if (offset >= io->size) + if (!ptr) return -ERANGE; if ((offset + len) > io->size) len = io->size - offset; @@ -112,7 +112,7 @@ int metal_io_block_set(struct metal_io_region *io, unsigned long offset, unsigned char *ptr = metal_io_virt(io, offset); int retlen = len; - if (offset >= io->size) + if (!ptr) return -ERANGE; if ((offset + len) > io->size) len = io->size - offset; diff --git a/third-party/libmetal/metal/io.h b/third-party/libmetal/metal/io.h index a337bb3c643f9c1c0e8b6333f4c0857e3fb5b5c1..e534d17653c3e875436a990a74d71ea71959ed77 100644 --- a/third-party/libmetal/metal/io.h +++ b/third-party/libmetal/metal/io.h @@ -132,7 +132,7 @@ static inline void * metal_io_virt(struct metal_io_region *io, unsigned long offset) { return (io->virt != METAL_BAD_VA && offset < io->size - ? (uint8_t *)io->virt + offset + ? (void *)((uintptr_t)io->virt + offset) : NULL); } @@ -145,7 +145,7 @@ metal_io_virt(struct metal_io_region *io, unsigned long offset) static inline unsigned long metal_io_virt_to_offset(struct metal_io_region *io, void *virt) { - size_t offset = (uint8_t *)virt - (uint8_t *)io->virt; + size_t offset = (uintptr_t)virt - (uintptr_t)io->virt; return (offset < io->size ? offset : METAL_BAD_OFFSET); } @@ -363,12 +363,12 @@ int metal_io_block_write(struct metal_io_region *io, unsigned long offset, int metal_io_block_set(struct metal_io_region *io, unsigned long offset, unsigned char value, int len); -#include - /** @} */ #ifdef __cplusplus } #endif +#include + #endif /* __METAL_IO__H__ */ diff --git a/third-party/libmetal/metal/irq.h b/third-party/libmetal/metal/irq.h index 727b16299de6b88acaa4fa69704f20221760423f..43562abe190e7993ec9d57ddfafa486d62067baf 100644 --- a/third-party/libmetal/metal/irq.h +++ b/third-party/libmetal/metal/irq.h @@ -12,6 +12,9 @@ #ifndef __METAL_IRQ__H__ #define __METAL_IRQ__H__ +#include +#include + #ifdef __cplusplus extern "C" { #endif @@ -20,9 +23,6 @@ extern "C" { * @{ */ -#include -#include - /** IRQ handled status */ #define METAL_IRQ_NOT_HANDLED 0 #define METAL_IRQ_HANDLED 1 diff --git a/third-party/libmetal/metal/irq_controller.h b/third-party/libmetal/metal/irq_controller.h index c0b4734b0d59fd2334f9805fec724e0bcc267061..c821ef48c38537e75590c2b9749ab9506800e06a 100644 --- a/third-party/libmetal/metal/irq_controller.h +++ b/third-party/libmetal/metal/irq_controller.h @@ -69,7 +69,7 @@ struct metal_irq_controller { */ int irq_num; /**< Number of IRQs managed by the IRQ controller */ void *arg; /**< Argument to pass to interrupt controller function */ - metal_irq_set_enable irq_set_enable; /**< function to set IRQ eanble */ + metal_irq_set_enable irq_set_enable; /**< function to set IRQ enable */ metal_cntr_irq_register irq_register; /**< function to register IRQ * handler */ diff --git a/third-party/libmetal/metal/list.h b/third-party/libmetal/metal/list.h index 055803a23c3b9660942b5eb2b9fcf8a4e685204e..3c7116a9cb6917cd7d168e60623a7a4b14baee15 100644 --- a/third-party/libmetal/metal/list.h +++ b/third-party/libmetal/metal/list.h @@ -12,6 +12,7 @@ #ifndef __METAL_LIST__H__ #define __METAL_LIST__H__ +#include #include #ifdef __cplusplus @@ -27,7 +28,7 @@ struct metal_list { }; /* - * METAL_INIT_LIST - used for initializing an list elmenet in a static struct + * METAL_INIT_LIST - used for initializing an list element in a static struct * or global */ #define METAL_INIT_LIST(name) { .next = &name, .prev = &name } @@ -92,10 +93,40 @@ static inline struct metal_list *metal_list_first(struct metal_list *list) return metal_list_is_empty(list) ? NULL : list->next; } +/** + * @brief Used for iterating over a list + * + * @param list Pointer to the head node of the list + * @param node Pointer to each node in the list during iteration + */ #define metal_list_for_each(list, node) \ for ((node) = (list)->next; \ (node) != (list); \ (node) = (node)->next) + +/** + * @brief Used for iterating over a list safely + * + * @param list Pointer to the head node of the list + * @param temp Pointer to the next node's address during iteration + * @param node Pointer to each node in the list during iteration + */ +#define metal_list_for_each_safe(list, temp, node) \ + for ((node) = (list)->next, (temp) = (node)->next; \ + (node) != (list); \ + (node) = (temp), (temp) = (node)->next) + +static inline bool metal_list_find_node(struct metal_list *list, + struct metal_list *node) +{ + struct metal_list *n; + + metal_list_for_each(list, n) { + if (n == node) + return true; + } + return false; +} /** @} */ #ifdef __cplusplus diff --git a/third-party/libmetal/metal/log.h b/third-party/libmetal/metal/log.h index f88669d191959b8292cf255984521178dbc7bcb3..f8587e8ec6d3b5bc5ebe126f118c2e9d86a5ad84 100644 --- a/third-party/libmetal/metal/log.h +++ b/third-party/libmetal/metal/log.h @@ -41,46 +41,69 @@ typedef void (*metal_log_handler)(enum metal_log_level level, * @param[in] handler log message handler. * @return 0 on success, or -errno on failure. */ -extern void metal_set_log_handler(metal_log_handler handler); +void metal_set_log_handler(metal_log_handler handler); /** * @brief Get the current libmetal log handler. * @return Current log handler. */ -extern metal_log_handler metal_get_log_handler(void); +metal_log_handler metal_get_log_handler(void); /** * @brief Set the level for libmetal logging. * @param[in] level log message level. */ -extern void metal_set_log_level(enum metal_log_level level); +void metal_set_log_level(enum metal_log_level level); /** * @brief Get the current level for libmetal logging. * @return Current log level. */ -extern enum metal_log_level metal_get_log_level(void); +enum metal_log_level metal_get_log_level(void); /** * @brief Default libmetal log handler. This handler prints libmetal log - * mesages to stderr. + * messages to stderr. * @param[in] level log message level. * @param[in] format log message format string. * @return 0 on success, or -errno on failure. */ -extern void metal_default_log_handler(enum metal_log_level level, - const char *format, ...); +void metal_default_log_handler(enum metal_log_level level, + const char *format, ...); /** - * Emit a log message if the log level permits. + * @internal + * + * @brief used by the metal_log() macro to update the format string + * + * If ML_FUNC_LINE is defined this macro generates a unified format + * string for metal_log() and its convenience metal_*() macros, i.e. it + * adds function-name:line-number prefix to all log messages. + * + * @param[in] fmt format string passed from the metal_log() macro + */ +#if defined(ML_FUNC_LINE) +#define metal_fmt(fmt) "%s:%u " fmt, __func__, __LINE__ +#else /* ML_FUNC_LINE */ +#define metal_fmt(fmt) fmt +#endif /* ML_FUNC_LINE */ + +/** + * @brief Emit a log message if the log level permits. * * @param level Log level. - * @param ... Format string and arguments. + * @param fmt Format string. + * @param ... Variable number of arguments. */ -#define metal_log(level, ...) \ - ((level <= _metal.common.log_level && _metal.common.log_handler) \ - ? (void)_metal.common.log_handler(level, __VA_ARGS__) \ - : (void)0) +#define metal_log(level, fmt, ...) ({ \ + if (_metal.common.log_handler && level <= _metal.common.log_level) \ + _metal.common.log_handler(level, metal_fmt(fmt), ## __VA_ARGS__); \ +}) + +#define metal_err(fmt, args...) metal_log(METAL_LOG_ERROR, fmt, ##args) +#define metal_warn(fmt, args...) metal_log(METAL_LOG_WARNING, fmt, ##args) +#define metal_info(fmt, args...) metal_log(METAL_LOG_INFO, fmt, ##args) +#define metal_dbg(fmt, args...) metal_log(METAL_LOG_DEBUG, fmt, ##args) /** @} */ diff --git a/third-party/libmetal/metal/mutex.h b/third-party/libmetal/metal/mutex.h index fd1a8a41a4c641279462dd97c6e11f61e9229210..71d9eaa210631a8271353a3f542d031fdd8e276e 100644 --- a/third-party/libmetal/metal/mutex.h +++ b/third-party/libmetal/metal/mutex.h @@ -12,6 +12,8 @@ #ifndef __METAL_MUTEX__H__ #define __METAL_MUTEX__H__ +#include + #ifdef __cplusplus extern "C" { #endif @@ -20,8 +22,6 @@ extern "C" { * @{ */ -#include - /** * @brief Initialize a libmetal mutex. * @param[in] mutex Mutex to initialize. diff --git a/third-party/libmetal/metal/processor/CMakeLists.txt b/third-party/libmetal/metal/processor/CMakeLists.txt deleted file mode 100644 index eea25097c5b82a2a67980cc7c98a820e3d7aacf7..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory (${PROJECT_PROCESSOR}) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/processor/aarch64/CMakeLists.txt b/third-party/libmetal/metal/processor/aarch64/CMakeLists.txt deleted file mode 100644 index 9e9c101f81ba74899a36298acbf3cd7bc5a22b37..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/aarch64/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -collect (PROJECT_LIB_HEADERS atomic.h) -collect (PROJECT_LIB_HEADERS cpu.h) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/processor/aarch64/atomic.h b/third-party/libmetal/metal/processor/aarch64/atomic.h deleted file mode 100644 index 410346c123c41cfa0255d18e9118e9e2f8c8ea7e..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/aarch64/atomic.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file gcc/atomic.h - * @brief GCC specific atomic primitives for libmetal. - */ - -#ifndef __METAL_AARCH64_ATOMIC__H__ -#define __METAL_AARCH64_ATOMIC__H__ - -#endif /* __METAL_ARM_ATOMIC__H__ */ diff --git a/third-party/libmetal/metal/processor/aarch64/cpu.h b/third-party/libmetal/metal/processor/aarch64/cpu.h index 88ae715a4fc4f46a300a8cbf80363b9c717ccc65..df9bc60aa41867ca951899fff3bb8548f238b996 100644 --- a/third-party/libmetal/metal/processor/aarch64/cpu.h +++ b/third-party/libmetal/metal/processor/aarch64/cpu.h @@ -6,7 +6,7 @@ /* * @file cpu.h - * @brief CPU specific primatives + * @brief CPU specific primitives */ #ifndef __METAL_AARCH64_CPU__H__ diff --git a/third-party/libmetal/metal/processor/arm/CMakeLists.txt b/third-party/libmetal/metal/processor/arm/CMakeLists.txt deleted file mode 100644 index 9e9c101f81ba74899a36298acbf3cd7bc5a22b37..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/arm/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -collect (PROJECT_LIB_HEADERS atomic.h) -collect (PROJECT_LIB_HEADERS cpu.h) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/processor/arm/atomic.h b/third-party/libmetal/metal/processor/arm/atomic.h deleted file mode 100644 index ab5ee406039da1783595b15977dd701f59425587..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/arm/atomic.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file arm/atomic.h - * @brief Arm specific atomic primitives for libmetal. - */ - -#ifndef __METAL_ARM_ATOMIC__H__ -#define __METAL_ARM_ATOMIC__H__ - -#endif /* __METAL_ARM_ATOMIC__H__ */ diff --git a/third-party/libmetal/metal/processor/ceva/CMakeLists.txt b/third-party/libmetal/metal/processor/ceva/CMakeLists.txt deleted file mode 100644 index c06e95176bb22e29106caedada02eee744040a9f..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/ceva/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -collect (PROJECT_LIB_HEADERS cpu.h) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/processor/ceva/cpu.h b/third-party/libmetal/metal/processor/ceva/cpu.h deleted file mode 100644 index 0274e33e326d30bee646df0a709fef8547e0d811..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/ceva/cpu.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2017, Pinecone Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file cpu.h - * @brief CPU specific primitives - */ - -#ifndef __METAL_CEVA_CPU__H__ -#define __METAL_CEVA_CPU__H__ - -#define metal_cpu_yield() - -/* - * The dummy implementation is enough here since - * ceva dsp don't support the out of order and multi core - */ -#define __sync_synchronize() - -#endif /* __METAL_CEVA_CPU__H__ */ diff --git a/third-party/libmetal/metal/processor/csky/CMakeLists.txt b/third-party/libmetal/metal/processor/csky/CMakeLists.txt deleted file mode 100644 index c06e95176bb22e29106caedada02eee744040a9f..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/csky/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -collect (PROJECT_LIB_HEADERS cpu.h) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/processor/generic/atomic.h b/third-party/libmetal/metal/processor/generic/atomic.h new file mode 100644 index 0000000000000000000000000000000000000000..9a2b252c6c5bd9acb013bd7485e43599b64755f5 --- /dev/null +++ b/third-party/libmetal/metal/processor/generic/atomic.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file generic/atomic.h + * @brief Generic environment atomic primitives for libmetal. + */ + +#ifndef __METAL_GENERIC_ATOMIC__H__ +#define __METAL_GENERIC_ATOMIC__H__ + +#endif /* __METAL_GENERIC_ATOMIC__H__ */ diff --git a/third-party/libmetal/metal/processor/generic/cpu.h b/third-party/libmetal/metal/processor/generic/cpu.h new file mode 100644 index 0000000000000000000000000000000000000000..60a72576b179a97c54debcaca0fac55f87515ea3 --- /dev/null +++ b/third-party/libmetal/metal/processor/generic/cpu.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file generic/cpu.h + * @brief Generic CPU specific primitives + */ + +#ifndef __METAL_GENERIC_CPU__H__ +#define __METAL_GENERIC_CPU__H__ + +#define metal_cpu_yield() + +#endif /* __METAL_GENERIC_CPU__H__ */ diff --git a/third-party/libmetal/metal/processor/microblaze/CMakeLists.txt b/third-party/libmetal/metal/processor/microblaze/CMakeLists.txt deleted file mode 100644 index 9e9c101f81ba74899a36298acbf3cd7bc5a22b37..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/microblaze/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -collect (PROJECT_LIB_HEADERS atomic.h) -collect (PROJECT_LIB_HEADERS cpu.h) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/processor/microblaze/atomic.h b/third-party/libmetal/metal/processor/microblaze/atomic.h deleted file mode 100644 index d576662f51b0d4dc589abf9d72b61b4335e71624..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/microblaze/atomic.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file microblaze/atomic.h - * @brief Microblaze specific atomic primitives for libmetal - */ - -#ifndef __METAL_MICROBLAZE_ATOMIC__H__ -#define __METAL_MICROBLAZE_ATOMIC__H__ - -#endif /* __METAL_MICROBLAZE_ATOMIC__H__ */ diff --git a/third-party/libmetal/metal/processor/microblaze/cpu.h b/third-party/libmetal/metal/processor/microblaze/cpu.h deleted file mode 100644 index 669c8da3d74554db9bc50028b62db121f069eaa0..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/microblaze/cpu.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file cpu.h - * @brief CPU specific primatives on microblaze platform. - */ - -#ifndef __METAL_MICROBLAZE__H__ -#define __METAL_MICROBLAZE__H__ - -#include -#include - -#define metal_cpu_yield() - -#endif /* __METAL_MICROBLAZE__H__ */ diff --git a/third-party/libmetal/metal/processor/riscv/CMakeLists.txt b/third-party/libmetal/metal/processor/riscv/CMakeLists.txt deleted file mode 100644 index c06e95176bb22e29106caedada02eee744040a9f..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/processor/riscv/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -collect (PROJECT_LIB_HEADERS cpu.h) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/shmem.h b/third-party/libmetal/metal/shmem.h index 81cd57d0637b4d95c170fd87b9eb9b149209e2d0..8353685e6bdced4c1160ba3bd4641c872a0b6cfc 100644 --- a/third-party/libmetal/metal/shmem.h +++ b/third-party/libmetal/metal/shmem.h @@ -41,8 +41,8 @@ struct metal_generic_shmem { * * @see metal_shmem_create */ -extern int metal_shmem_open(const char *name, size_t size, - struct metal_io_region **io); +int metal_shmem_open(const char *name, size_t size, + struct metal_io_region **io); /** * @brief Statically register a generic shared memory region. @@ -55,7 +55,7 @@ extern int metal_shmem_open(const char *name, size_t size, * @param[in] shmem Generic shmem structure. * @return 0 on success, or -errno on failure. */ -extern int metal_shmem_register_generic(struct metal_generic_shmem *shmem); +int metal_shmem_register_generic(struct metal_generic_shmem *shmem); #if 1 diff --git a/third-party/libmetal/metal/softirq.c b/third-party/libmetal/metal/softirq.c index 4ba745fa1493774735b048cf911e5117158b3388..ac481cccb6dbf58ecb7e07cd00c406f53296d0cc 100644 --- a/third-party/libmetal/metal/softirq.c +++ b/third-party/libmetal/metal/softirq.c @@ -72,8 +72,7 @@ int metal_softirq_allocate(int num) int irq_base; if ((metal_softirq_avail + num) >= metal_softirq_num) { - metal_log(METAL_LOG_ERROR, "No %d available soft irqs.\r\n", - num); + metal_log(METAL_LOG_ERROR, "No more available soft irqs\n"); return -EINVAL; } irq_base = metal_softirq_avail; diff --git a/third-party/libmetal/metal/softirq.h b/third-party/libmetal/metal/softirq.h index 4ad4d42d5b0736beefbe7c600e7a69f154192240..52ea00f18ca41751535f1025898952f21b0538d5 100644 --- a/third-party/libmetal/metal/softirq.h +++ b/third-party/libmetal/metal/softirq.h @@ -12,6 +12,8 @@ #ifndef __METAL_SOFTIRQ__H__ #define __METAL_SOFTIRQ__H__ +#include + #ifdef __cplusplus extern "C" { #endif @@ -20,8 +22,6 @@ extern "C" { * @{ */ -#include - /** * @brief metal_softirq_init * diff --git a/third-party/libmetal/metal/sys.h b/third-party/libmetal/metal/sys.h index 856899e8541fa50566d729d0eced20376535f5bd..ccaecce3e5617209c06717c1d65f084a34e069de 100644 --- a/third-party/libmetal/metal/sys.h +++ b/third-party/libmetal/metal/sys.h @@ -61,6 +61,9 @@ struct metal_init_params { * specific singleton data structure (@see _metal). */ struct metal_common_state { + /** reference count to track metal_init/metal_finish. */ + int ref_count; + /** Current log level. */ enum metal_log_level log_level; diff --git a/third-party/libmetal/metal/system/CMakeLists.txt b/third-party/libmetal/metal/system/CMakeLists.txt index a932d957c6697bd78c15dcbeb7ba6b52901f8b08..c760dca337adc9e9f813854212c70009e80907e1 100644 --- a/third-party/libmetal/metal/system/CMakeLists.txt +++ b/third-party/libmetal/metal/system/CMakeLists.txt @@ -1,3 +1 @@ add_subdirectory (${PROJECT_SYSTEM}) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/system/freertos/CMakeLists.txt b/third-party/libmetal/metal/system/freertos/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..9d31aa328a5d50090467337583b63080cc2c6330 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/CMakeLists.txt @@ -0,0 +1,24 @@ +collect (PROJECT_LIB_HEADERS alloc.h) +collect (PROJECT_LIB_HEADERS assert.h) +collect (PROJECT_LIB_HEADERS cache.h) +collect (PROJECT_LIB_HEADERS condition.h) +collect (PROJECT_LIB_HEADERS io.h) +collect (PROJECT_LIB_HEADERS irq.h) +collect (PROJECT_LIB_HEADERS log.h) +collect (PROJECT_LIB_HEADERS mutex.h) +collect (PROJECT_LIB_HEADERS sleep.h) +collect (PROJECT_LIB_HEADERS sys.h) + +collect (PROJECT_LIB_SOURCES condition.c) +collect (PROJECT_LIB_SOURCES device.c) +collect (PROJECT_LIB_SOURCES init.c) +collect (PROJECT_LIB_SOURCES io.c) +collect (PROJECT_LIB_SOURCES irq.c) +collect (PROJECT_LIB_SOURCES shmem.c) +collect (PROJECT_LIB_SOURCES time.c) + +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_VENDOR}) + add_subdirectory(${PROJECT_VENDOR}) +elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_MACHINE}) + add_subdirectory(${PROJECT_MACHINE}) +endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_VENDOR}) diff --git a/third-party/libmetal/metal/system/freertos/alloc.h b/third-party/libmetal/metal/system/freertos/alloc.h new file mode 100644 index 0000000000000000000000000000000000000000..58f2d268ad4fc4b9c84ec0379fb3fdc510063088 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/alloc.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/alloc.c + * @brief FreeRTOS libmetal memory allocattion definitions. + */ + +#ifndef __METAL_ALLOC__H__ +#error "Include metal/alloc.h instead of metal/freertos/alloc.h" +#endif + +#ifndef __METAL_FREERTOS_ALLOC__H__ +#define __METAL_FREERTOS_ALLOC__H__ + +#include "FreeRTOS.h" + +#ifdef __cplusplus +extern "C" { +#endif + +static inline void *__metal_allocate_memory(unsigned int size) +{ + return pvPortMalloc(size); +} + +static inline void __metal_free_memory(void *ptr) +{ + vPortFree(ptr); +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_FREERTOS_ALLOC__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/assert.h b/third-party/libmetal/metal/system/freertos/assert.h new file mode 100644 index 0000000000000000000000000000000000000000..49a80bf6a6ab42e3b99f2216d9ad961211321b8d --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/assert.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file assert.h + * @brief FreeRTOS assertion support. + */ +#ifndef __METAL_ASSERT__H__ +#error "Include metal/assert.h instead of metal/freertos/assert.h" +#endif + +#ifndef __METAL_FREERTOS_ASSERT__H__ +#define __METAL_FREERTOS_ASSERT__H__ + +#include + +/** + * @brief Assertion macro for FreeRTOS applications. + * @param cond Condition to evaluate. + */ +#define metal_sys_assert(cond) assert(cond) + +#endif /* __METAL_FREERTOS_ASSERT__H__ */ + diff --git a/third-party/libmetal/metal/system/freertos/cache.h b/third-party/libmetal/metal/system/freertos/cache.h new file mode 100644 index 0000000000000000000000000000000000000000..62775fbeacf34275ae1795ade16398c29444462f --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/cache.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/cache.h + * @brief FreeRTOS cache operation primitives for libmetal. + */ + +#ifndef __METAL_CACHE__H__ +#error "Include metal/cache.h instead of metal/freertos/cache.h" +#endif + +#ifndef __METAL_FREERTOS_CACHE__H__ +#define __METAL_FREERTOS_CACHE__H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void metal_machine_cache_flush(void *addr, unsigned int len); +void metal_machine_cache_invalidate(void *addr, unsigned int len); + +static inline void __metal_cache_flush(void *addr, unsigned int len) +{ + metal_machine_cache_flush(addr, len); +} + +static inline void __metal_cache_invalidate(void *addr, unsigned int len) +{ + metal_machine_cache_invalidate(addr, len); +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_FREERTOS_CACHE__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/condition.c b/third-party/libmetal/metal/system/freertos/condition.c new file mode 100644 index 0000000000000000000000000000000000000000..e3bebc9d25ee991cc0cc93804348d7c63b467c04 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/condition.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file generic/condition.c + * @brief Generic libmetal condition variable handling. + */ + +#include + +int metal_condition_wait(struct metal_condition *cv, + metal_mutex_t *m) +{ + /* TODO: Implement condition variable for FreeRTOS */ + (void)cv; + (void)m; + return 0; +} diff --git a/third-party/libmetal/metal/system/freertos/condition.h b/third-party/libmetal/metal/system/freertos/condition.h new file mode 100644 index 0000000000000000000000000000000000000000..87f13748b6f95545f9afa35c69648c89e4f1eec1 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/condition.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file generic/condition.h + * @brief Generic condition variable primitives for libmetal. + */ + +#ifndef __METAL_CONDITION__H__ +#error "Include metal/condition.h instead of metal/freertos/condition.h" +#endif + +#ifndef __METAL_FREERTOS_CONDITION__H__ +#define __METAL_FREERTOS_CONDITION__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct metal_condition { + metal_mutex_t *m; /**< mutex. + * The condition variable is attached to this mutex + * when it is waiting. It is also used to check + * correctness in case there are multiple waiters. + */ + + atomic_int v; /**< condition variable value. */ +}; + +/** Static metal condition variable initialization. */ +#define METAL_CONDITION_INIT { NULL, ATOMIC_VAR_INIT(0) } + +static inline void metal_condition_init(struct metal_condition *cv) +{ + /* TODO: Implement condition variable for FreeRTOS */ + (void)cv; +} + +static inline int metal_condition_signal(struct metal_condition *cv) +{ + /* TODO: Implement condition variable for FreeRTOS */ + (void)cv; + return 0; +} + +static inline int metal_condition_broadcast(struct metal_condition *cv) +{ + /* TODO: Implement condition variable for FreeRTOS */ + (void)cv; + return 0; +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_FREERTOS_CONDITION__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/device.c b/third-party/libmetal/metal/system/freertos/device.c new file mode 100644 index 0000000000000000000000000000000000000000..97246b89b53a20926ebb0e13e83b824052bbc63d --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/device.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/device.c + * @brief FreeRTOS device operations. + */ + +#include +#include +#include + +int metal_generic_dev_sys_open(struct metal_device *dev) +{ + struct metal_io_region *io; + unsigned int i; + + /* map I/O memory regions */ + for (i = 0; i < dev->num_regions; i++) { + io = &dev->regions[i]; + if (!io->size) + break; + metal_sys_io_mem_map(io); + } + + return 0; +} + diff --git a/third-party/libmetal/metal/system/freertos/init.c b/third-party/libmetal/metal/system/freertos/init.c new file mode 100644 index 0000000000000000000000000000000000000000..6641824420c72e999284cc40f9c7c090657589e4 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/init.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/init.c + * @brief FreeRTOS libmetal initialization. + */ + +#include +#include +#include + +struct metal_state _metal; + +int metal_sys_init(const struct metal_init_params *params) +{ + metal_unused(params); + metal_bus_register(&metal_generic_bus); + return 0; +} + +void metal_sys_finish(void) +{ + metal_bus_unregister(&metal_generic_bus); +} diff --git a/third-party/libmetal/metal/system/freertos/io.c b/third-party/libmetal/metal/system/freertos/io.c new file mode 100644 index 0000000000000000000000000000000000000000..5e4e2f9d127e8e2012f322fc3ed3961cfbc4c289 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/io.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/io.c + * @brief FreeRTOS libmetal io operations + */ + +#include + +void metal_sys_io_mem_map(struct metal_io_region *io) +{ + unsigned long p; + size_t psize; + size_t *va; + + va = io->virt; + psize = (size_t)io->size; + if (psize) { + if (psize >> io->page_shift) + psize = (size_t)1 << io->page_shift; + for (p = 0; p <= ((io->size - 1) >> io->page_shift); p++) { + metal_machine_io_mem_map(va, io->physmap[p], + psize, io->mem_flags); + va += psize; + } + } +} diff --git a/third-party/libmetal/metal/system/freertos/io.h b/third-party/libmetal/metal/system/freertos/io.h new file mode 100644 index 0000000000000000000000000000000000000000..3cfe797a82950c9c5c1ad7a98974abf1a7f9544e --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/io.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/io.h + * @brief FreeRTOS specific io definitions. + */ + +#ifndef __METAL_IO__H__ +#error "Include metal/io.h instead of metal/freertos/io.h" +#endif + +#ifndef __METAL_FREEROTS_IO__H__ +#define __METAL_FREEROTS_IO__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef METAL_INTERNAL + +/** + * @brief memory mapping for an I/O region + */ +void metal_sys_io_mem_map(struct metal_io_region *io); + +/** + * @brief memory mapping + */ +void *metal_machine_io_mem_map(void *va, metal_phys_addr_t pa, + size_t size, unsigned int flags); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_FREEROTS_IO__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/irq.c b/third-party/libmetal/metal/system/freertos/irq.c new file mode 100644 index 0000000000000000000000000000000000000000..3955e3f84fd5fddb8c12c2e1bfef3df73505ebc8 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/irq.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2016 - 2017, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/irq.c + * @brief FreeRTOS libmetal irq definitions. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +unsigned int metal_irq_save_disable(void) +{ + return sys_irq_save_disable(); +} + +void metal_irq_restore_enable(unsigned int flags) +{ + sys_irq_restore_enable(flags); +} + diff --git a/third-party/libmetal/metal/system/freertos/irq.h b/third-party/libmetal/metal/system/freertos/irq.h new file mode 100644 index 0000000000000000000000000000000000000000..72c11d421eea089ca4d359d50a4366564adf56f4 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/irq.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/irq.c + * @brief FreeRTOS libmetal irq definitions. + */ + +#ifndef __METAL_IRQ__H__ +#error "Include metal/irq.h instead of metal/freertos/irq.h" +#endif + +#ifndef __METAL_FREERTOS_IRQ__H__ +#define __METAL_FREERTOS_IRQ__H__ + +#endif /* __METAL_FREERTOS_IRQ__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/log.h b/third-party/libmetal/metal/system/freertos/log.h new file mode 100644 index 0000000000000000000000000000000000000000..f805c8d5ae194b43313f1166a9a948a450a2b4be --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/log.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. + * 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. Neither the name of Linaro nor the names of its contributors may be used + * to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS 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. + */ + +/* + * @file freertos/log.h + * @brief FreeRTOS libmetal log handler definition. + */ + +#ifndef __METAL_METAL_LOG__H__ +#error "Include metal/log.h instead of metal/freertos/log.h" +#endif + +#ifndef __METAL_FREERTOS_LOG__H__ +#define __METAL_FREERTOS_LOG__H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_FREERTOS_LOG__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/mutex.h b/third-party/libmetal/metal/system/freertos/mutex.h new file mode 100644 index 0000000000000000000000000000000000000000..6a70acb8abc4cdd6c9b9ad59ddf164fe892a7cba --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/mutex.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/mutex.h + * @brief FreeRTOS mutex primitives for libmetal. + */ + +#ifndef __METAL_MUTEX__H__ +#error "Include metal/mutex.h instead of metal/freertos/mutex.h" +#endif + +#ifndef __METAL_FREERTOS_MUTEX__H__ +#define __METAL_FREERTOS_MUTEX__H__ + +#include +#include "FreeRTOS.h" +#include "semphr.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + SemaphoreHandle_t m; +} metal_mutex_t; + +/* + * METAL_MUTEX_DEFINE - used for defining and initializing a global or + * static singleton mutex + */ +#define METAL_MUTEX_DEFINE(m) metal_mutex_t m = METAL_MUTEX_INIT(m) + +static inline void __metal_mutex_init(metal_mutex_t *mutex) +{ + metal_assert(mutex); + mutex->m = xSemaphoreCreateMutex(); + metal_assert(mutex->m); +} + +static inline void __metal_mutex_deinit(metal_mutex_t *mutex) +{ + metal_assert(mutex && mutex->m); + vSemaphoreDelete(mutex->m); + mutex->m = NULL; +} + +static inline int __metal_mutex_try_acquire(metal_mutex_t *mutex) +{ + metal_assert(mutex && mutex->m); + return xSemaphoreTake(mutex->m, (TickType_t)0); +} + +static inline void __metal_mutex_acquire(metal_mutex_t *mutex) +{ + metal_assert(mutex && mutex->m); + xSemaphoreTake(mutex->m, portMAX_DELAY); +} + +static inline void __metal_mutex_release(metal_mutex_t *mutex) +{ + metal_assert(mutex && mutex->m); + xSemaphoreGive(mutex->m); +} + +static inline int __metal_mutex_is_acquired(metal_mutex_t *mutex) +{ + metal_assert(mutex && mutex->m); + return (!xSemaphoreGetMutexHolder(mutex->m)) ? 0 : 1; +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_FREERTOS_MUTEX__H__ */ diff --git a/third-party/libmetal/metal/processor/arm/cpu.h b/third-party/libmetal/metal/system/freertos/shmem.c similarity index 35% rename from third-party/libmetal/metal/processor/arm/cpu.h rename to third-party/libmetal/metal/system/freertos/shmem.c index 2141fb39829157a6b6b5e5ff2d23d783a8558c1f..b0f29f605ddf83fb5c43519edb26e09fcf2946ed 100644 --- a/third-party/libmetal/metal/processor/arm/cpu.h +++ b/third-party/libmetal/metal/system/freertos/shmem.c @@ -5,13 +5,14 @@ */ /* - * @file cpu.h - * @brief CPU specific primatives + * @file freertos/shmem.c + * @brief FreeRTOS libmetal shared memory handling. */ -#ifndef __METAL_ARM_CPU__H__ -#define __METAL_ARM_CPU__H__ +#include -#define metal_cpu_yield() - -#endif /* __METAL_ARM_CPU__H__ */ +int metal_shmem_open(const char *name, size_t size, + struct metal_io_region **io) +{ + return metal_shmem_open_generic(name, size, io); +} diff --git a/third-party/libmetal/metal/system/freertos/sleep.h b/third-party/libmetal/metal/system/freertos/sleep.h new file mode 100644 index 0000000000000000000000000000000000000000..2ad9994a95d5931825831247c5bae2a3042de8c4 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/sleep.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/sleep.h + * @brief FreeRTOS sleep primitives for libmetal. + */ + +#ifndef __METAL_SLEEP__H__ +#error "Include metal/sleep.h instead of metal/freertos/sleep.h" +#endif + +#ifndef __METAL_FREERTOS_SLEEP__H__ +#define __METAL_FREERTOS_SLEEP__H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static inline int __metal_sleep_usec(unsigned int usec) +{ + const TickType_t xDelay = pdMS_TO_TICKS(usec/1000); + + vTaskDelay(xDelay ? xDelay : 1); + return 0; +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_FREERTOS_SLEEP__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/sys.h b/third-party/libmetal/metal/system/freertos/sys.h new file mode 100644 index 0000000000000000000000000000000000000000..b4350576d73ec7fd391ca9310e008b548c85b20e --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/sys.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. + * Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/sys.h + * @brief FreeRTOS system primitives for libmetal. + */ + +#ifndef __METAL_SYS__H__ +#error "Include metal/sys.h instead of metal/freertos/sys.h" +#endif + +#ifndef __METAL_FREERTOS_SYS__H__ +#define __METAL_FREERTOS_SYS__H__ + +#include +#include + +#ifdef XLNX_PLATFORM +#include +#else +#include "./@PROJECT_MACHINE@/sys.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef METAL_MAX_DEVICE_REGIONS +#define METAL_MAX_DEVICE_REGIONS 1 +#endif + +#define metal_yield() metal_cpu_yield() + +/** Structure for FreeRTOS libmetal runtime state. */ +struct metal_state { + + /** Common (system independent) data. */ + struct metal_common_state common; +}; + +#ifdef METAL_INTERNAL + +/** + * @brief restore interrupts to state before disable_global_interrupt() + */ +void sys_irq_restore_enable(unsigned int flags); + +/** + * @brief disable all interrupts + */ +unsigned int sys_irq_save_disable(void); + +#endif /* METAL_INTERNAL */ + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_FREERTOS_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/generic/zynqmp_r5/CMakeLists.txt b/third-party/libmetal/metal/system/freertos/template/CMakeLists.txt similarity index 39% rename from third-party/libmetal/metal/system/generic/zynqmp_r5/CMakeLists.txt rename to third-party/libmetal/metal/system/freertos/template/CMakeLists.txt index cf12dfe0206e620409729a34e4579d427b0e2c65..6da170df46ea4d5577631f71918da72746513185 100644 --- a/third-party/libmetal/metal/system/generic/zynqmp_r5/CMakeLists.txt +++ b/third-party/libmetal/metal/system/freertos/template/CMakeLists.txt @@ -2,5 +2,3 @@ collect (PROJECT_LIB_HEADERS sys.h) collect (PROJECT_LIB_SOURCES sys.c) -add_subdirectory(../xlnx_common ${CMAKE_CURRENT_BINARY_DIR}/../xlnx_common) -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/system/freertos/template/sys.c b/third-party/libmetal/metal/system/freertos/template/sys.c new file mode 100644 index 0000000000000000000000000000000000000000..e8970dc14d64c6e5192682d0d5987522ca8a8fb4 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/template/sys.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2018, Linaro Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/template/sys.c + * @brief machine specific system primitives implementation. + */ + +#include +#include +#include +#include + +void sys_irq_restore_enable(unsigned int flags) +{ + metal_unused(flags); + /* Add implementation here */ +} + +unsigned int sys_irq_save_disable(void) +{ + return 0; + /* Add implementation here */ +} + +void sys_irq_enable(unsigned int vector) +{ + metal_unused(vector); + + /* Add implementation here */ +} + +void sys_irq_disable(unsigned int vector) +{ + metal_unused(vector); + + /* Add implementation here */ +} + +void metal_machine_cache_flush(void *addr, unsigned int len) +{ + metal_unused(addr); + metal_unused(len); + + /* Add implementation here */ +} + +void metal_machine_cache_invalidate(void *addr, unsigned int len) +{ + metal_unused(addr); + metal_unused(len); + + /* Add implementation here */ +} + +void metal_generic_default_poll(void) +{ + /* Add implementation here */ +} + +void *metal_machine_io_mem_map(void *va, metal_phys_addr_t pa, + size_t size, unsigned int flags) +{ + metal_unused(pa); + metal_unused(size); + metal_unused(flags); + + /* Add implementation here */ + + return va; +} diff --git a/third-party/libmetal/metal/system/freertos/template/sys.h b/third-party/libmetal/metal/system/freertos/template/sys.h new file mode 100644 index 0000000000000000000000000000000000000000..7ce091b42e7f04d28ed5f2ea842125ef9da4bb3f --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/template/sys.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018, Linaro Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/template/sys.h + * @brief freertos template system primitives for libmetal. + */ + +#ifndef __METAL_FREERTOS_SYS__H__ +#error "Include metal/sys.h instead of metal/freertos/@PROJECT_MACHINE@/sys.h" +#endif + +#ifndef __METAL_FREERTOS_TEMPLATE_SYS__H__ +#define __METAL_FREERTOS_TEMPLATE_SYS__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define metal_yield() metal_cpu_yield() + +#ifdef METAL_INTERNAL + +void sys_irq_enable(unsigned int vector); + +void sys_irq_disable(unsigned int vector); + +#endif /* METAL_INTERNAL */ + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_FREERTOS_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/freertos/time.c b/third-party/libmetal/metal/system/freertos/time.c new file mode 100644 index 0000000000000000000000000000000000000000..03544eb3bbffe590d7522a919cc3a75ab36f4313 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/time.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/time.c + * @brief freertos libmetal time handling. + */ + +#include +#include +#include + +unsigned long long metal_get_timestamp(void) +{ + return (unsigned long long)(1000 * portTICK_PERIOD_MS * xTaskGetTickCount()); +} + diff --git a/third-party/libmetal/metal/system/generic/xlnx_common/CMakeLists.txt b/third-party/libmetal/metal/system/freertos/xlnx/CMakeLists.txt similarity index 65% rename from third-party/libmetal/metal/system/generic/xlnx_common/CMakeLists.txt rename to third-party/libmetal/metal/system/freertos/xlnx/CMakeLists.txt index c443fb20cca093dbdc2c46343dfbab7154aba868..704d85fc2029ea9c03388cf14399c0a6133583c8 100644 --- a/third-party/libmetal/metal/system/generic/xlnx_common/CMakeLists.txt +++ b/third-party/libmetal/metal/system/freertos/xlnx/CMakeLists.txt @@ -1,5 +1,5 @@ collect (PROJECT_LIB_HEADERS sys.h) collect (PROJECT_LIB_SOURCES irq.c) +collect (PROJECT_LIB_SOURCES sys.c) -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/system/freertos/xlnx/irq.c b/third-party/libmetal/metal/system/freertos/xlnx/irq.c new file mode 100644 index 0000000000000000000000000000000000000000..4c35f06a66706137deae6d6d45b7de0abd99a3d3 --- /dev/null +++ b/third-party/libmetal/metal/system/freertos/xlnx/irq.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016 - 2017, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file freertos/xlnx/irq.c + * @brief freertos libmetal Xilinx irq controller definitions. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX_IRQS XLNX_MAXIRQS + +static struct metal_irq irqs[MAX_IRQS]; /**< Linux IRQs array */ + +static void metal_xlnx_irq_set_enable(struct metal_irq_controller *irq_cntr, + int irq, unsigned int state) +{ + if (irq < irq_cntr->irq_base || + irq >= irq_cntr->irq_base + irq_cntr->irq_num) { + metal_log(METAL_LOG_ERROR, "%s: invalid irq %d\n", + __func__, irq); + return; + } else if (state == METAL_IRQ_ENABLE) { + sys_irq_enable((unsigned int)irq); + } else { + sys_irq_disable((unsigned int)irq); + } +} + +/**< Xilinx common platform IRQ controller */ +static METAL_IRQ_CONTROLLER_DECLARE(xlnx_irq_cntr, + 0, MAX_IRQS, + NULL, + metal_xlnx_irq_set_enable, NULL, + irqs); + +/** + * @brief default handler + */ +void metal_xlnx_irq_isr(void *arg) +{ + unsigned int vector; + + vector = (uintptr_t)arg; + if (vector >= MAX_IRQS) { + return; + } + (void)metal_irq_handle(&irqs[vector], (int)vector); +} + +int metal_xlnx_irq_init(void) +{ + int ret; + + ret = metal_irq_register_controller(&xlnx_irq_cntr); + if (ret < 0) { + metal_log(METAL_LOG_ERROR, "%s: register irq controller failed.\n", + __func__); + return ret; + } + return 0; +} diff --git a/third-party/libmetal/metal/system/generic/zynqmp_a53/sys.c b/third-party/libmetal/metal/system/freertos/xlnx/sys.c similarity index 39% rename from third-party/libmetal/metal/system/generic/zynqmp_a53/sys.c rename to third-party/libmetal/metal/system/freertos/xlnx/sys.c index d7f24bfd854ac81945b46c9cc19bd81536ac914d..26f44dddbcbad9c3ea95bac34900ad6748cbd178 100644 --- a/third-party/libmetal/metal/system/generic/zynqmp_a53/sys.c +++ b/third-party/libmetal/metal/system/freertos/xlnx/sys.c @@ -1,26 +1,40 @@ /* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. + * Copyright (C) 2024, Advanced Micro Devices, Inc. * * SPDX-License-Identifier: BSD-3-Clause */ /* - * @file generic/zynqmp_a53/sys.c + * @file freertos/xlnx/sys.c * @brief machine specific system primitives implementation. */ #include #include #include +#include #include #include "xil_cache.h" #include "xil_exception.h" +#include "xscugic.h" #include "xil_mmu.h" + +#if (defined(__aarch64__) || defined(ARMA53_32)) && !defined(SDT) + +#ifdef VERSAL_NET +#include "xcpu_cortexa78.h" +#elif defined(versal) +#include "xcpu_cortexa72.h" +#else #include "xreg_cortexa53.h" -#include "xscugic.h" +#endif /* defined(versal) */ + +#elif defined(ARMR5) + +#include "xil_mpu.h" +#include "xreg_cortexr5.h" -#define MB (1024 * 1024UL) -#define GB (1024 * 1024 * 1024UL) +#endif /* (defined(__aarch64__) || defined(ARMA53_32)) && !defined(SDT) */ void sys_irq_restore_enable(unsigned int flags) { @@ -61,45 +75,65 @@ void metal_weak metal_generic_default_poll(void) metal_asm volatile("wfi"); } +/* + * VERSAL_NET is used since XMpu_Config structure is + * different for r52(versal net) and r5(zynqmp) to avoid build failure + */ +#ifdef VERSAL_NET +void *metal_machine_io_mem_map_versal_net(void *va, metal_phys_addr_t pa, + size_t size, unsigned int flags) +{ + void *__attribute__((unused)) physaddr; + u32 req_end_addr = pa + size; + XMpu_Config mpu_config; + u32 req_addr = pa; + u32 mmap_req = 1; + u32 base_end_addr; + u32 cnt; + + /* Get the MPU Config enties */ + Xil_GetMPUConfig(mpu_config); + + for (cnt = 0; cnt < MAX_POSSIBLE_MPU_REGS; cnt++) { + + if (!(mpu_config[cnt].flags & XMPU_VALID_REGION)) + continue; + + base_end_addr = mpu_config[cnt].Size + mpu_config[cnt].BaseAddress; + + if (mpu_config[cnt].BaseAddress <= req_addr && base_end_addr >= req_end_addr) { + /* + * Mapping available for requested region in MPU table + * If no change in Attribute for region then additional + * mapping in MPU table is not required + */ + if (mpu_config[cnt].Attribute == flags) { + mmap_req = 0; + break; + } + } + } + + /* if mapping is required we call Xil_MemMap to get the mapping done */ + if (mmap_req == 1) { + physaddr = Xil_MemMap(pa, size, flags); + metal_assert(physaddr == (void *)pa); + } + + return va; +} +#endif + void *metal_machine_io_mem_map(void *va, metal_phys_addr_t pa, size_t size, unsigned int flags) { - unsigned long section_offset; - unsigned long ttb_addr; -#if defined(__aarch64__) - unsigned long ttb_size = (pa < 4*GB) ? 2*MB : 1*GB; -#else - unsigned long ttb_size = 1*MB; -#endif + void *__attribute__((unused)) physaddr; - if (!flags) - return va; - - /* Ensure alignement on a section boundary */ - pa &= ~(ttb_size-1UL); - - /* - * Loop through entire region of memory (one MMU section at a time). - * Each section requires a TTB entry. - */ - for (section_offset = 0; section_offset < size; ) { - /* Calculate translation table entry for this memory section */ - ttb_addr = (pa + section_offset); - - /* Write translation table entry value to entry address */ - Xil_SetTlbAttributes(ttb_addr, flags); - -#if defined(__aarch64__) - /* - * recalculate if we started below 4GB and going above in - * 64bit mode - */ - if (ttb_addr >= 4*GB) { - ttb_size = 1*GB; - } +#ifdef VERSAL_NET + va = metal_machine_io_mem_map_versal_net(va, pa, size, flags); +#else + physaddr = Xil_MemMap(pa, size, flags); + metal_assert(physaddr == (void *)pa); #endif - section_offset += ttb_size; - } - return va; } diff --git a/third-party/libmetal/metal/system/generic/xlnx_common/sys.h b/third-party/libmetal/metal/system/freertos/xlnx/sys.h similarity index 39% rename from third-party/libmetal/metal/system/generic/xlnx_common/sys.h rename to third-party/libmetal/metal/system/freertos/xlnx/sys.h index 405b52922c5d6299b0c0bada02768ffb808a69fa..7d27de23e5e0650c1fe4552d56f12a368e1bd422 100644 --- a/third-party/libmetal/metal/system/generic/xlnx_common/sys.h +++ b/third-party/libmetal/metal/system/freertos/xlnx/sys.h @@ -1,25 +1,41 @@ /* * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved. + * Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ /* - * @file generic/xlnx_common/sys.h - * @brief generic xlnx_common system primitives for libmetal. + * @file freertos/xlnx/sys.h + * @brief freertos Xilinx common system primitives for libmetal. */ -#ifndef __METAL_GENERIC_SYS__H__ -#error "Include metal/sys.h instead of metal/generic/ft_platform/sys.h" +#ifndef __METAL_FREERTOS_SYS__H__ +#error "Include metal/sys.h instead of metal/freertos/@PROJECT_MACHINE@/sys.h" #endif -#ifndef __METAL_GENERIC_XLNX_COMMON_SYS__H__ -#define __METAL_GENERIC_XLNX_COMMON_SYS__H__ +#ifndef __METAL_FREERTOS_XLNX_SYS__H__ +#define __METAL_FREERTOS_XLNX_SYS__H__ + +#include + +#include "xscugic.h" +#include "FreeRTOS.h" #ifdef __cplusplus extern "C" { #endif +#define metal_yield() metal_cpu_yield() + +#if defined(SDT) && defined(PLATFORM_ZYNQ) +#define XPAR_SCUGIC_0_DIST_BASEADDR XPAR_SCUGIC_DIST_BASEADDR +#endif + +#ifndef XLNX_MAXIRQS +#define XLNX_MAXIRQS XSCUGIC_MAX_NUM_INTR_INPUTS +#endif + /** * @brief metal_xlnx_irq_isr * @@ -40,8 +56,26 @@ void metal_xlnx_irq_isr(void *arg); */ int metal_xlnx_irq_init(void); +static inline void sys_irq_enable(unsigned int vector) +{ +#ifdef PLATFORM_ZYNQ + XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector); +#else + vPortEnableInterrupt(vector); +#endif +} + +static inline void sys_irq_disable(unsigned int vector) +{ +#ifdef PLATFORM_ZYNQ + XScuGic_DisableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector); +#else + vPortDisableInterrupt(vector); +#endif +} + #ifdef __cplusplus } #endif -#endif /* __METAL_GENERIC_XLNX_COMMON_SYS__H__ */ +#endif /* __METAL_FREERTOS_XLNX_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/generic/CMakeLists.txt b/third-party/libmetal/metal/system/generic/CMakeLists.txt index 98ca318c28edb34a3fff16f69326000d47659661..9d31aa328a5d50090467337583b63080cc2c6330 100644 --- a/third-party/libmetal/metal/system/generic/CMakeLists.txt +++ b/third-party/libmetal/metal/system/generic/CMakeLists.txt @@ -17,8 +17,8 @@ collect (PROJECT_LIB_SOURCES irq.c) collect (PROJECT_LIB_SOURCES shmem.c) collect (PROJECT_LIB_SOURCES time.c) -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_MACHINE}) +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_VENDOR}) + add_subdirectory(${PROJECT_VENDOR}) +elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_MACHINE}) add_subdirectory(${PROJECT_MACHINE}) -endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_MACHINE}) - -# vim: expandtab:ts=2:sw=2:smartindent +endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_VENDOR}) diff --git a/third-party/libmetal/metal/system/generic/alloc.h b/third-party/libmetal/metal/system/generic/alloc.h index 0729b4f88686330ea2ed11fdb61874ef5a6d1acf..f214707ef84f8f662f7a71b8cad6376d42aa8b67 100644 --- a/third-party/libmetal/metal/system/generic/alloc.h +++ b/third-party/libmetal/metal/system/generic/alloc.h @@ -22,12 +22,12 @@ extern "C" { #endif -static inline void *metal_allocate_memory(unsigned int size) +static inline void *__metal_allocate_memory(unsigned int size) { return malloc(size); } -static inline void metal_free_memory(void *ptr) +static inline void __metal_free_memory(void *ptr) { free(ptr); } diff --git a/third-party/libmetal/metal/system/generic/cache.h b/third-party/libmetal/metal/system/generic/cache.h index 962ffccfa98a6f485f0ec08584db269db1b00099..799d5776de96b852c80a23e7f4bcdd7387d547a8 100644 --- a/third-party/libmetal/metal/system/generic/cache.h +++ b/third-party/libmetal/metal/system/generic/cache.h @@ -20,8 +20,8 @@ extern "C" { #endif -extern void metal_machine_cache_flush(void *addr, unsigned int len); -extern void metal_machine_cache_invalidate(void *addr, unsigned int len); +void metal_machine_cache_flush(void *addr, unsigned int len); +void metal_machine_cache_invalidate(void *addr, unsigned int len); static inline void __metal_cache_flush(void *addr, unsigned int len) { diff --git a/third-party/libmetal/metal/system/generic/io.c b/third-party/libmetal/metal/system/generic/io.c index 966bfc561dd3efba43d642d9350da1dde2dfaa11..6fc5bb600ee15e13175d8c05ac9eaf2420bcdf93 100644 --- a/third-party/libmetal/metal/system/generic/io.c +++ b/third-party/libmetal/metal/system/generic/io.c @@ -22,7 +22,7 @@ void metal_sys_io_mem_map(struct metal_io_region *io) if (psize) { if (psize >> io->page_shift) psize = (size_t)1 << io->page_shift; - for (p = 0; p <= (io->size >> io->page_shift); p++) { + for (p = 0; p <= ((io->size - 1) >> io->page_shift); p++) { metal_machine_io_mem_map(va, io->physmap[p], psize, io->mem_flags); va += psize; diff --git a/third-party/libmetal/metal/system/generic/microblaze_generic/sys.h b/third-party/libmetal/metal/system/generic/microblaze_generic/sys.h deleted file mode 100644 index 3b364f8b4e476f4881b2f0d215d3472909ee837d..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/system/generic/microblaze_generic/sys.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file generic/microblaze_generic/sys.h - * @brief generic microblaze system primitives for libmetal. - */ - -#ifndef __METAL_GENERIC_SYS__H__ -#error "Include metal/sys.h instead of metal/generic/ft_platform/sys.h" -#endif - -#include - -#ifndef __METAL_GENERIC_MICROBLAZE_SYS__H__ -#define __METAL_GENERIC_MICROBLAZE_SYS__H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if 1 - -#ifndef XLNX_MAXIRQS -#define XLNX_MAXIRQS 32 -#endif - -void metal_weak sys_irq_enable(unsigned int vector); - -void metal_weak sys_irq_disable(unsigned int vector); - -#endif /* METAL_INTERNAL */ - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_GENERIC_MICROBLAZE_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/generic/sleep.h b/third-party/libmetal/metal/system/generic/sleep.h index aa86df492e23cbfc542e85dd423900ce2c8bfa3f..63d53088f416026b67a4684a3faa3f175a273daf 100644 --- a/third-party/libmetal/metal/system/generic/sleep.h +++ b/third-party/libmetal/metal/system/generic/sleep.h @@ -29,8 +29,6 @@ static inline int __metal_sleep_usec(unsigned int usec) return 0; } -/** @} */ - #ifdef __cplusplus } #endif diff --git a/third-party/libmetal/metal/system/generic/sys.h b/third-party/libmetal/metal/system/generic/sys.h index 35d26f54b1186f871668a4b6b2875a508c12530b..b48a28714d420b0f9cb2d5aef05c52c9f78a18b0 100644 --- a/third-party/libmetal/metal/system/generic/sys.h +++ b/third-party/libmetal/metal/system/generic/sys.h @@ -17,6 +17,7 @@ #define __METAL_GENERIC_SYS__H__ #include +#include #include #include #include @@ -40,6 +41,8 @@ struct metal_state { struct metal_common_state common; }; +#define metal_yield() metal_cpu_yield() + #if 1 /** diff --git a/third-party/libmetal/metal/system/generic/template/CMakeLists.txt b/third-party/libmetal/metal/system/generic/template/CMakeLists.txt index 7d824ce188b41158a7a45cc9337a0477f7a7e35d..f52db5e15f6d7841b74ba5a697447750b312b521 100644 --- a/third-party/libmetal/metal/system/generic/template/CMakeLists.txt +++ b/third-party/libmetal/metal/system/generic/template/CMakeLists.txt @@ -1,5 +1,3 @@ collect (PROJECT_LIB_HEADERS sys.h) collect (PROJECT_LIB_SOURCES sys.c) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/system/generic/template/sys.h b/third-party/libmetal/metal/system/generic/template/sys.h index 85e57031834f71b7cb109da8973a10bdc7e186a7..d5faf83c804102de5a72bb9dfca0546190730cce 100644 --- a/third-party/libmetal/metal/system/generic/template/sys.h +++ b/third-party/libmetal/metal/system/generic/template/sys.h @@ -10,7 +10,7 @@ */ #ifndef __METAL_GENERIC_SYS__H__ -#error "Include metal/sys.h instead of metal/generic/ft_platform/sys.h" +#error "Include metal/sys.h instead of metal/generic/@PROJECT_MACHINE@/sys.h" #endif #ifndef __METAL_GENERIC_TEMPLATE_SYS__H__ @@ -20,7 +20,7 @@ extern "C" { #endif -#if 1 +#ifdef METAL_INTERNAL void sys_irq_enable(unsigned int vector); diff --git a/third-party/libmetal/metal/system/generic/xlnx/CMakeLists.txt b/third-party/libmetal/metal/system/generic/xlnx/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..af02c7e1fe57f03afe94a6efa63fbc0433e2972f --- /dev/null +++ b/third-party/libmetal/metal/system/generic/xlnx/CMakeLists.txt @@ -0,0 +1,15 @@ +if ("${PROJECT_MACHINE}" STREQUAL "microblaze_generic") + add_subdirectory(microblaze_generic) +else() + collect (PROJECT_LIB_SOURCES sys.c) +endif() + +collect (PROJECT_LIB_HEADERS sys.h) + +collect (PROJECT_LIB_SOURCES irq.c) + +include(CheckSymbolExists) +check_symbol_exists(SDT "bspconfig.h" HAS_SYSTEM_DT) +if (HAS_SYSTEM_DT) + collect (PROJECT_LIB_HEADERS sys_devicetree.h) +endif() diff --git a/third-party/libmetal/metal/system/generic/xlnx_common/irq.c b/third-party/libmetal/metal/system/generic/xlnx/irq.c similarity index 92% rename from third-party/libmetal/metal/system/generic/xlnx_common/irq.c rename to third-party/libmetal/metal/system/generic/xlnx/irq.c index 82749d36ef6b8eeaa356c15ee75cb6f6f2c7dea9..356993a33e8af61c2e756f91fd7082094ff95630 100644 --- a/third-party/libmetal/metal/system/generic/xlnx_common/irq.c +++ b/third-party/libmetal/metal/system/generic/xlnx/irq.c @@ -5,20 +5,24 @@ */ /* - * @file generic/xlnx_common/irq.c + * @file generic/xlnx/irq.c * @brief generic libmetal Xilinx irq controller definitions. */ #include #include -#include #include #include #include -#include #include +#include +#include +#ifdef __MICROBLAZE__ +#define MAX_IRQS 32 +#else #define MAX_IRQS XLNX_MAXIRQS +#endif static struct metal_irq irqs[MAX_IRQS]; /**< Linux IRQs array */ diff --git a/third-party/libmetal/metal/system/generic/microblaze_generic/CMakeLists.txt b/third-party/libmetal/metal/system/generic/xlnx/microblaze_generic/CMakeLists.txt similarity index 47% rename from third-party/libmetal/metal/system/generic/microblaze_generic/CMakeLists.txt rename to third-party/libmetal/metal/system/generic/xlnx/microblaze_generic/CMakeLists.txt index 632af9c8aa4f2086c95c9d81400a69fe34804f4f..621e12c5171d1c7be5b5b37892304ea1906361f6 100644 --- a/third-party/libmetal/metal/system/generic/microblaze_generic/CMakeLists.txt +++ b/third-party/libmetal/metal/system/generic/xlnx/microblaze_generic/CMakeLists.txt @@ -1,11 +1,6 @@ -collect (PROJECT_LIB_HEADERS sys.h) - collect (PROJECT_LIB_SOURCES sys.c) check_include_files(xintc.h HAS_XINTC) if (HAS_XINTC) add_definitions(-DHAS_XINTC) endif(HAS_XINTC) - -add_subdirectory(../xlnx_common ${CMAKE_CURRENT_BINARY_DIR}/../xlnx_common) -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/system/generic/microblaze_generic/sys.c b/third-party/libmetal/metal/system/generic/xlnx/microblaze_generic/sys.c similarity index 66% rename from third-party/libmetal/metal/system/generic/microblaze_generic/sys.c rename to third-party/libmetal/metal/system/generic/xlnx/microblaze_generic/sys.c index 895dbb866dcbfe76113062fe2400c2d54cc4b18a..7d18bcf96cdc2fad0348c3c01332e94f7d98d57e 100644 --- a/third-party/libmetal/metal/system/generic/microblaze_generic/sys.c +++ b/third-party/libmetal/metal/system/generic/xlnx/microblaze_generic/sys.c @@ -5,22 +5,18 @@ */ /* - * @file generic/microblaze_generic/sys.c + * @file generic/xlnx/microblaze_generic/sys.c * @brief machine specific system primitives implementation. */ -#include -#include #include -#include -#include -#include +#include + #ifdef HAS_XINTC #include -#include #endif /* HAS_XINTC */ -#define MSR_IE 0x2UL /* MicroBlaze status register interrupt enable mask */ +#define MSR_IE 0x2UL /* MicroBlaze status register interrupt enable mask */ #if (XPAR_MICROBLAZE_USE_MSR_INSTR != 0) unsigned int sys_irq_save_disable(void) @@ -28,10 +24,10 @@ unsigned int sys_irq_save_disable(void) unsigned int state; metal_asm volatile(" mfs %0, rmsr\n" - " msrclr r0, %1\n" - : "=r"(state) - : "i"(MSR_IE) - : "memory"); + " msrclr r0, %1\n" + : "=r"(state) + : "i"(MSR_IE) + : "memory"); return state &= MSR_IE; } @@ -42,22 +38,22 @@ void sys_irq_restore_enable(unsigned int flags) if (flags) metal_asm volatile(" msrset %0, %1\n" - : "=r"(tmp) - : "i"(MSR_IE) - : "memory"); + : "=r"(tmp) + : "i"(MSR_IE) + : "memory"); } -#else /* XPAR_MICROBLAZE_USE_MSR_INSTR == 0 */ +#else /* XPAR_MICROBLAZE_USE_MSR_INSTR == 0 */ unsigned int sys_irq_save_disable(void) { unsigned int tmp, state; - metal_asm volatile(" mfs %0, rmsr\n" - " andi %1, %0, %2\n" - " mts rmsr, %1\n" - : "=r"(state), "=r"(tmp) - : "i"(~MSR_IE) - : "memory"); + metal_asm volatile (" mfs %0, rmsr\n" + " andi %1, %0, %2\n" + " mts rmsr, %1\n" + : "=r"(state), "=r"(tmp) + : "i"(~MSR_IE) + : "memory"); return state &= MSR_IE; } @@ -68,11 +64,11 @@ void sys_irq_restore_enable(unsigned int flags) if (flags) metal_asm volatile(" mfs %0, rmsr\n" - " or %0, %0, %1\n" - " mts rmsr, %0\n" - : "=r"(tmp) - : "r"(flags) - : "memory"); + " or %0, %0, %1\n" + " mts rmsr, %0\n" + : "=r"(tmp) + : "r"(flags) + : "memory"); } #endif /* XPAR_MICROBLAZE_USE_MSR_INSTR */ @@ -83,17 +79,17 @@ static void sys_irq_change(unsigned int vector, int is_enable) unsigned int ier; unsigned int mask; - mask = 1 >> ((vector % 32) - 1); /* set bit corresponding to interrupt */ + mask = 1 >> ((vector%32)-1); /* set bit corresponding to interrupt */ mask = is_enable ? mask : ~mask; /* if disable then turn off bit */ - cfgptr = XIntc_LookupConfig(vector / 32); + cfgptr = XIntc_LookupConfig(vector/32); Xil_AssertVoid(cfgptr != NULL); Xil_AssertVoid(vector < XPAR_INTC_MAX_NUM_INTR_INPUTS); ier = XIntc_In32(cfgptr->BaseAddress + XIN_IER_OFFSET); XIntc_Out32(cfgptr->BaseAddress + XIN_IER_OFFSET, - (ier | mask)); + (ier | mask)); #else (void)vector; (void)is_enable; @@ -111,26 +107,21 @@ void metal_weak sys_irq_disable(unsigned int vector) sys_irq_change(vector, 0); } + void metal_machine_cache_flush(void *addr, unsigned int len) { - if (!addr && !len) - { + if (!addr && !len) { Xil_DCacheFlush(); - } - else - { + } else{ Xil_DCacheFlushRange((intptr_t)addr, len); } } void metal_machine_cache_invalidate(void *addr, unsigned int len) { - if (!addr && !len) - { + if (!addr && !len) { Xil_DCacheInvalidate(); - } - else - { + } else { Xil_DCacheInvalidateRange((intptr_t)addr, len); } } @@ -144,7 +135,7 @@ void metal_weak metal_generic_default_poll(void) } void *metal_machine_io_mem_map(void *va, metal_phys_addr_t pa, - size_t size, unsigned int flags) + size_t size, unsigned int flags) { (void)pa; (void)size; diff --git a/third-party/libmetal/metal/system/generic/zynqmp_r5/sys.c b/third-party/libmetal/metal/system/generic/xlnx/sys.c similarity index 34% rename from third-party/libmetal/metal/system/generic/zynqmp_r5/sys.c rename to third-party/libmetal/metal/system/generic/xlnx/sys.c index 7e9c3c1f80b1f9d8e8f49e8a620b93fafce740b0..f5d12f4b761cfde4dad691e3e9428d9e2bd74bce 100644 --- a/third-party/libmetal/metal/system/generic/zynqmp_r5/sys.c +++ b/third-party/libmetal/metal/system/generic/xlnx/sys.c @@ -1,26 +1,37 @@ /* - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. + * Copyright (c) 2022, Xilinx Inc. and Contributors. All rights reserved. + * Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved. * * SPDX-License-Identifier: BSD-3-Clause */ /* - * @file generic/zynqmp_r5/sys.c + * @file generic/xlnx/sys.c * @brief machine specific system primitives implementation. */ -#include -#include #include -#include -#include "xil_cache.h" -#include "xil_exception.h" +#include + #include "xil_mmu.h" + +/* System Device Tree (SDT) flow does not have the files generated. */ +#if (defined(__aarch64__) || defined(ARMA53_32)) && !defined(SDT) + +#ifdef VERSAL_NET +#include "xcpu_cortexa78.h" +#elif defined(versal) +#include "xcpu_cortexa72.h" +#else +#include "xreg_cortexa53.h" +#endif /* defined(versal) */ + +#elif defined(ARMR5) + #include "xil_mpu.h" #include "xreg_cortexr5.h" -#include "xscugic.h" -#define MPU_REGION_SIZE_MIN 0x20 +#endif /* (defined(__aarch64__) || defined(ARMA53_32)) && !defined(SDT) */ void sys_irq_restore_enable(unsigned int flags) { @@ -32,9 +43,8 @@ unsigned int sys_irq_save_disable(void) unsigned int state = mfcpsr() & XIL_EXCEPTION_ALL; if (state != XIL_EXCEPTION_ALL) - { Xil_ExceptionDisableMask(XIL_EXCEPTION_ALL); - } + return state; } @@ -62,32 +72,65 @@ void metal_weak metal_generic_default_poll(void) metal_asm volatile("wfi"); } -void *metal_machine_io_mem_map(void *va, metal_phys_addr_t pa, - size_t size, unsigned int flags) +/* + * VERSAL_NET is used since XMpu_Config structure is + * different for r52(versal net) and r5(zynqmp) to avoid build failure + */ +#ifdef VERSAL_NET +void *metal_machine_io_mem_map_versal_net(void *va, metal_phys_addr_t pa, + size_t size, unsigned int flags) { - size_t rsize = MPU_REGION_SIZE_MIN; - metal_phys_addr_t base_pa; - - if (!flags) - return va; - while (1) - { - if (rsize < size) - { - rsize <<= 1; + void *__attribute__((unused)) physaddr; + u32 req_end_addr = pa + size; + XMpu_Config mpu_config; + u32 req_addr = pa; + u32 mmap_req = 1; + u32 base_end_addr; + u32 cnt; + + /* Get the MPU Config enties */ + Xil_GetMPUConfig(mpu_config); + + for (cnt = 0; cnt < MAX_POSSIBLE_MPU_REGS; cnt++) { + + if (!(mpu_config[cnt].flags & XMPU_VALID_REGION)) continue; - } - else - { - base_pa = pa & ~(rsize - 1); - if ((base_pa + rsize) < (pa + size)) - { - rsize <<= 1; - continue; + + base_end_addr = mpu_config[cnt].Size + mpu_config[cnt].BaseAddress; + + if (mpu_config[cnt].BaseAddress <= req_addr && base_end_addr >= req_end_addr) { + /* + * Mapping available for requested region in MPU table + * If no change in Attribute for region then additional + * mapping in MPU table is not required + */ + if (mpu_config[cnt].Attribute == flags) { + mmap_req = 0; + break; } - break; } } - Xil_SetMPURegion(base_pa, rsize, flags); + + /* if mapping is required we call Xil_MemMap to get the mapping done */ + if (mmap_req == 1) { + physaddr = Xil_MemMap(pa, size, flags); + metal_assert(physaddr == (void *)pa); + } + + return va; +} +#endif + +void *metal_machine_io_mem_map(void *va, metal_phys_addr_t pa, + size_t size, unsigned int flags) +{ + void *__attribute__((unused)) physaddr; + +#ifdef VERSAL_NET + va = metal_machine_io_mem_map_versal_net(va, pa, size, flags); +#else + physaddr = Xil_MemMap(pa, size, flags); + metal_assert(physaddr == (void *)pa); +#endif return va; } diff --git a/third-party/libmetal/metal/system/generic/xlnx/sys.h b/third-party/libmetal/metal/system/generic/xlnx/sys.h new file mode 100644 index 0000000000000000000000000000000000000000..0b352de6fa856608b229b9a85406365cb8160ab1 --- /dev/null +++ b/third-party/libmetal/metal/system/generic/xlnx/sys.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved. + * Copyright (C) 2023, Advanced Micro Devices, Inc. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file generic/xlnx/sys.h + * @brief generic xlnx system primitives for libmetal. + */ + +#ifndef __METAL_GENERIC_SYS__H__ +#error "Include metal/sys.h instead of metal/generic/@PROJECT_MACHINE@/sys.h" +#endif + +#ifndef __MICROBLAZE__ +#include "xscugic.h" +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef SDT +#include +#endif + +#ifndef __METAL_GENERIC_XLNX_SYS__H__ +#define __METAL_GENERIC_XLNX_SYS__H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __MICROBLAZE__ +#define XLNX_MAXIRQS XSCUGIC_MAX_NUM_INTR_INPUTS +#endif + +#if defined(SDT) && !defined(__MICROBLAZE__) +#define XPAR_SCUGIC_0_DIST_BASEADDR XPAR_SCUGIC_DIST_BASEADDR +#endif + +/** + * @brief metal_xlnx_irq_isr + * + * Xilinx interrupt ISR can be registered to the Xilinx embeddedsw + * IRQ controller driver. + * + * @param[in] arg input argument, interrupt vector id. + */ +void metal_xlnx_irq_isr(void *arg); + +/** + * @brief metal_xlnx_irq_int + * + * Xilinx interrupt controller initialization. It will initialize + * the metal Xilinx IRQ controller data structure. + * + * @return 0 for success, or negative value for failure + */ +int metal_xlnx_irq_init(void); + +/* Microblaze defines these routines */ +#ifdef __MICROBLAZE__ +void metal_weak sys_irq_enable(unsigned int vector); + +void metal_weak sys_irq_disable(unsigned int vector); +#else +static inline void sys_irq_enable(unsigned int vector) +{ + XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector); +} + +static inline void sys_irq_disable(unsigned int vector) +{ + XScuGic_DisableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector); +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_GENERIC_XLNX_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/generic/xlnx/sys_devicetree.h b/third-party/libmetal/metal/system/generic/xlnx/sys_devicetree.h new file mode 100644 index 0000000000000000000000000000000000000000..ee9d6c167519ce34eebe08f99198433fb6767f6d --- /dev/null +++ b/third-party/libmetal/metal/system/generic/xlnx/sys_devicetree.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file generic/xlnx/sys_devicetree.h + * @brief Xilinx-AMD Specific symbols for System Device Tree Flow + */ + +#ifndef __METAL_GENERIC_SYS_XLNX_SYS_DEVICETREE_H__ +#define __METAL_GENERIC_SYS_XLNX_SYS_DEVICETREE_H__ + +/* The Xilinx-AMD System Device Tree (SDT) Flow BSP provides this file. */ +#include "bspconfig.h" + +#ifndef XPAR_SCUGIC_0_DEVICE_ID +#define XPAR_SCUGIC_0_DEVICE_ID XPAR_SCUGIC_SINGLE_DEVICE_ID +#endif + +#ifndef XPAR_SCUGIC_0_DIST_BASEADDR +#define XPAR_SCUGIC_0_DIST_BASEADDR XPAR_SCUGIC_DIST_BASEADDR +#endif +#endif /* __METAL_GENERIC_SYS_XLNX_SYS_DEVICETREE_H__ */ diff --git a/third-party/libmetal/metal/system/generic/zynq7/CMakeLists.txt b/third-party/libmetal/metal/system/generic/zynq7/CMakeLists.txt deleted file mode 100644 index cf12dfe0206e620409729a34e4579d427b0e2c65..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/system/generic/zynq7/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -collect (PROJECT_LIB_HEADERS sys.h) - -collect (PROJECT_LIB_SOURCES sys.c) - -add_subdirectory(../xlnx_common ${CMAKE_CURRENT_BINARY_DIR}/../xlnx_common) -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/system/generic/zynq7/sys.c b/third-party/libmetal/metal/system/generic/zynq7/sys.c deleted file mode 100644 index 338be2518b135a16487dcfdd884bf102c26c9454..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/system/generic/zynq7/sys.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2014, Mentor Graphics Corporation - * Copyright (c) 2016, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file generic/zynq7/sys.c - * @brief machine specific system primitives implementation. - */ - -#include -#include -#include -#include -#include "xil_cache.h" -#include "xil_mmu.h" -#include "xil_exception.h" -#include "xscugic.h" - -/* Each TTB descriptor covers a 1MB region */ -#define ARM_AR_MEM_TTB_SECT_SIZE (1024*1024) - -/* Mask off lower bits of addr */ -#define ARM_AR_MEM_TTB_SECT_SIZE_MASK (~(ARM_AR_MEM_TTB_SECT_SIZE-1UL)) - -void sys_irq_restore_enable(unsigned int flags) -{ - Xil_ExceptionEnableMask(~flags); -} - -unsigned int sys_irq_save_disable(void) -{ - unsigned int state = mfcpsr() & XIL_EXCEPTION_ALL; - - if (state != XIL_EXCEPTION_ALL) { - Xil_ExceptionDisableMask(XIL_EXCEPTION_ALL); - } - return state; -} - -void metal_machine_cache_flush(void *addr, unsigned int len) -{ - if (!addr && !len) - Xil_DCacheFlush(); - else - Xil_DCacheFlushRange((intptr_t)addr, len); -} - -void metal_machine_cache_invalidate(void *addr, unsigned int len) -{ - if (!addr && !len) - Xil_DCacheInvalidate(); - else - Xil_DCacheInvalidateRange((intptr_t)addr, len); -} - -/** - * @brief poll function until some event happens - */ -void metal_weak metal_generic_default_poll(void) -{ - metal_asm volatile("wfi"); -} - -void *metal_machine_io_mem_map(void *va, metal_phys_addr_t pa, - size_t size, unsigned int flags) -{ - unsigned int section_offset; - unsigned int ttb_addr; - - if (!flags) - return va; - /* - * Ensure the virtual and physical addresses are aligned on a - * section boundary - */ - pa &= ARM_AR_MEM_TTB_SECT_SIZE_MASK; - - /* - * Loop through entire region of memory (one MMU section at a time). - * Each section requires a TTB entry. - */ - for (section_offset = 0; section_offset < size; - section_offset += ARM_AR_MEM_TTB_SECT_SIZE) { - - /* Calculate translation table entry for this memory section */ - ttb_addr = (pa + section_offset); - - /* Write translation table entry value to entry address */ - Xil_SetTlbAttributes(ttb_addr, flags); - } - - return va; -} diff --git a/third-party/libmetal/metal/system/generic/zynq7/sys.h b/third-party/libmetal/metal/system/generic/zynq7/sys.h deleted file mode 100644 index 2811efdca1bcb6ab4f94ae84b7f17e8c688d8787..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/system/generic/zynq7/sys.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file generic/zynq7/sys.h - * @brief generic zynq7 system primitives for libmetal. - */ - -#ifndef __METAL_GENERIC_SYS__H__ -#error "Include metal/sys.h instead of metal/generic/ft_platform/sys.h" -#endif - -#include -#include "xscugic.h" - -#ifndef __METAL_GENERIC_ZYNQ7_SYS__H__ -#define __METAL_GENERIC_ZYNQ7_SYS__H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#if 1 - -#define XLNX_MAXIRQS XSCUGIC_MAX_NUM_INTR_INPUTS - -static inline void sys_irq_enable(unsigned int vector) -{ - XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector); -} - -static inline void sys_irq_disable(unsigned int vector) -{ - XScuGic_DisableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector); -} - -#endif /* METAL_INTERNAL */ - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_GENERIC_ZYNQ7_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/generic/zynqmp_a53/CMakeLists.txt b/third-party/libmetal/metal/system/generic/zynqmp_a53/CMakeLists.txt deleted file mode 100644 index cf12dfe0206e620409729a34e4579d427b0e2c65..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/system/generic/zynqmp_a53/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -collect (PROJECT_LIB_HEADERS sys.h) - -collect (PROJECT_LIB_SOURCES sys.c) - -add_subdirectory(../xlnx_common ${CMAKE_CURRENT_BINARY_DIR}/../xlnx_common) -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/libmetal/metal/system/generic/zynqmp_a53/sys.h b/third-party/libmetal/metal/system/generic/zynqmp_a53/sys.h deleted file mode 100644 index 94593aab86a8691199edf821fe34375f4e2ac8dd..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/system/generic/zynqmp_a53/sys.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file generic/zynqmp_a53/sys.h - * @brief generic zynqmp_a53 system primitives for libmetal. - */ - -#ifndef __METAL_GENERIC_SYS__H__ -#error "Include metal/sys.h instead of metal/generic/ft_platform/sys.h" -#endif - -#include -#include "xscugic.h" - -#ifndef __METAL_GENERIC_ZYNQMP_A53_SYS__H__ -#define __METAL_GENERIC_ZYNQMP_A53_SYS__H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#if 1 - -#define XLNX_MAXIRQS XSCUGIC_MAX_NUM_INTR_INPUTS - -static inline void sys_irq_enable(unsigned int vector) -{ - XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector); -} - -static inline void sys_irq_disable(unsigned int vector) -{ - XScuGic_DisableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector); -} - -#endif /* METAL_INTERNAL */ - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_GENERIC_ZYNQMP_A53_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/generic/zynqmp_r5/sys.h b/third-party/libmetal/metal/system/generic/zynqmp_r5/sys.h deleted file mode 100644 index 410be4a7095e2c97442b37c522436ea767799c1c..0000000000000000000000000000000000000000 --- a/third-party/libmetal/metal/system/generic/zynqmp_r5/sys.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/* - * @file generic/zynqmp_r5/sys.h - * @brief generic zynqmp_r5 system primitives for libmetal. - */ - -#ifndef __METAL_GENERIC_SYS__H__ -#error "Include metal/sys.h instead of metal/system/generic/ft_platform/sys.h" -#endif - -#include -#include "xscugic.h" - -#ifndef __METAL_GENERIC_ZYNQMP_R5_SYS__H__ -#define __METAL_GENERIC_ZYNQMP_R5_SYS__H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#if 1 - -#define XLNX_MAXIRQS XSCUGIC_MAX_NUM_INTR_INPUTS - -static inline void sys_irq_enable(unsigned int vector) -{ - XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector); -} - -static inline void sys_irq_disable(unsigned int vector) -{ - XScuGic_DisableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector); -} - -#endif /* METAL_INTERNAL */ - -#ifdef __cplusplus -} -#endif - -#endif /* __METAL_GENERIC_ZYNQMP_R5_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/nuttx/CMakeLists.txt b/third-party/libmetal/metal/system/nuttx/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..3c29a4325b6003697092bac639767c670d499eac --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/CMakeLists.txt @@ -0,0 +1,19 @@ +collect (PROJECT_LIB_HEADERS alloc.h) +collect (PROJECT_LIB_HEADERS assert.h) +collect (PROJECT_LIB_HEADERS cache.h) +collect (PROJECT_LIB_HEADERS condition.h) +collect (PROJECT_LIB_HEADERS io.h) +collect (PROJECT_LIB_HEADERS irq.h) +collect (PROJECT_LIB_HEADERS log.h) +collect (PROJECT_LIB_HEADERS mutex.h) +collect (PROJECT_LIB_HEADERS sleep.h) +collect (PROJECT_LIB_HEADERS sys.h) + +collect (PROJECT_LIB_SOURCES condition.c) +collect (PROJECT_LIB_SOURCES device.c) +collect (PROJECT_LIB_SOURCES init.c) +collect (PROJECT_LIB_SOURCES io.c) +collect (PROJECT_LIB_SOURCES irq.c) +collect (PROJECT_LIB_SOURCES shmem.c) +collect (PROJECT_LIB_SOURCES time.c) + diff --git a/third-party/libmetal/metal/system/nuttx/alloc.h b/third-party/libmetal/metal/system/nuttx/alloc.h new file mode 100644 index 0000000000000000000000000000000000000000..0173cadd1130f983333ee0523560da1bc6d127f4 --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/alloc.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/alloc.h + * @brief nuttx libmetal memory allocattion definitions. + */ + +#ifndef __METAL_ALLOC__H__ +#error "Include metal/alloc.h instead of metal/nuttx/alloc.h" +#endif + +#ifndef __METAL_NUTTX_ALLOC__H__ +#define __METAL_NUTTX_ALLOC__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static inline void *__metal_allocate_memory(unsigned int size) +{ + return kmm_malloc(size); +} + +static inline void __metal_free_memory(void *ptr) +{ + kmm_free(ptr); +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_NUTTX_ALLOC__H__ */ diff --git a/third-party/libmetal/metal/system/nuttx/assert.h b/third-party/libmetal/metal/system/nuttx/assert.h new file mode 100644 index 0000000000000000000000000000000000000000..e14cb0b112d75fb7b7a70cd5f0ec37fe0b7d4f2f --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/assert.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file assert.h + * @brief NuttX assertion support. + */ + +#ifndef __METAL_ASSERT__H__ +#error "Include metal/assert.h instead of metal/nuttx/assert.h" +#endif + +#ifndef __METAL_NUTTX_ASSERT__H__ +#define __METAL_NUTTX_ASSERT__H__ + +#include + +/** + * @brief Assertion macro for NuttX-based applications. + * @param cond Condition to evaluate. + */ +#define metal_sys_assert(cond) DEBUGASSERT(cond) + +#endif /* __METAL_NUTTX_ASSERT__H__ */ diff --git a/third-party/libmetal/metal/system/nuttx/cache.h b/third-party/libmetal/metal/system/nuttx/cache.h new file mode 100644 index 0000000000000000000000000000000000000000..e3b60524234adb7bb3b4e75efff054cb7a517e07 --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/cache.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/cache.h + * @brief NuttX cache operation primitives for libmetal. + */ + +#ifndef __METAL_CACHE__H__ +#error "Include metal/cache.h instead of metal/nuttx/cache.h" +#endif + +#ifndef __METAL_NUTTX_CACHE__H__ +#define __METAL_NUTTX_CACHE__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static inline void __metal_cache_flush(void *addr, unsigned int len) +{ + up_clean_dcache((uintptr_t)addr, (uintptr_t)addr + len); +} + +static inline void __metal_cache_invalidate(void *addr, unsigned int len) +{ + up_invalidate_dcache((uintptr_t)addr, (uintptr_t)addr + len); +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_NUTTX_CACHE__H__ */ diff --git a/third-party/libmetal/metal/system/nuttx/condition.c b/third-party/libmetal/metal/system/nuttx/condition.c new file mode 100644 index 0000000000000000000000000000000000000000..b4c6cb019dbfd7fb295b50f370c86da6345bd2e6 --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/condition.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/condition.c + * @brief NuttX libmetal condition variable handling. + */ + +#include +#include + +int metal_condition_wait(struct metal_condition *cv, + metal_mutex_t *m) +{ + unsigned int flags; + + /* Check if the mutex has been acquired */ + if (!cv || !m || !metal_mutex_is_acquired(m)) + return -EINVAL; + + flags = metal_irq_save_disable(); + /* Release the mutex first. */ + metal_mutex_release(m); + nxsem_wait_uninterruptible(&cv->cond.sem); + metal_irq_restore_enable(flags); + /* Acquire the mutex again. */ + metal_mutex_acquire(m); + return 0; +} diff --git a/third-party/libmetal/metal/system/nuttx/condition.h b/third-party/libmetal/metal/system/nuttx/condition.h new file mode 100644 index 0000000000000000000000000000000000000000..22d65073b00d916a94e74b341522c051a43afb70 --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/condition.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/condition.h + * @brief NuttX condition variable primitives for libmetal. + */ + +#ifndef __METAL_CONDITION__H__ +#error "Include metal/condition.h instead of metal/nuttx/condition.h" +#endif + +#ifndef __METAL_NUTTX_CONDITION__H__ +#define __METAL_NUTTX_CONDITION__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct metal_condition { + pthread_cond_t cond; +}; + +/** Static metal condition variable initialization. */ +#define METAL_CONDITION_INIT {PTHREAD_COND_INITIALIZER} + +static inline void metal_condition_init(struct metal_condition *cv) +{ + pthread_cond_init(&cv->cond, NULL); +} + +static inline int metal_condition_signal(struct metal_condition *cv) +{ + return -pthread_cond_signal(&cv->cond); +} + +static inline int metal_condition_broadcast(struct metal_condition *cv) +{ + return -pthread_cond_broadcast(&cv->cond); +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_NUTTX_CONDITION__H__ */ diff --git a/third-party/libmetal/metal/processor/riscv/cpu.h b/third-party/libmetal/metal/system/nuttx/device.c similarity index 42% rename from third-party/libmetal/metal/processor/riscv/cpu.h rename to third-party/libmetal/metal/system/nuttx/device.c index ff02d9f871819396fdde1f27f34552dece35c7fa..9644231c597cfb6de6dd68c688c75acf7a9859bb 100644 --- a/third-party/libmetal/metal/processor/riscv/cpu.h +++ b/third-party/libmetal/metal/system/nuttx/device.c @@ -5,13 +5,15 @@ */ /* - * @file cpu.h - * @brief CPU specific primitives + * @file nuttx/device.c + * @brief NuttX libmetal device definitions. */ -#ifndef __METAL_RISCV_CPU__H__ -#define __METAL_RISCV_CPU__H__ +#include -#define metal_cpu_yield() +int metal_generic_dev_sys_open(struct metal_device *dev) +{ + metal_unused(dev); -#endif /* __METAL_RISCV_CPU__H__ */ + return 0; +} diff --git a/third-party/libmetal/metal/system/nuttx/init.c b/third-party/libmetal/metal/system/nuttx/init.c new file mode 100644 index 0000000000000000000000000000000000000000..26d3ebb7733da2a56b1d990404e2145b6e71877a --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/init.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/init.c + * @brief NuttX libmetal initialization. + */ + +#include +#include +#include + +struct metal_state _metal; + +int metal_sys_init(const struct metal_init_params *params) +{ + int ret = metal_cntr_irq_init(); + metal_unused(params); + + if (ret >= 0) + ret = metal_bus_register(&metal_generic_bus); + return ret; +} + +void metal_sys_finish(void) +{ + metal_bus_unregister(&metal_generic_bus); +} diff --git a/third-party/libmetal/metal/system/nuttx/io.c b/third-party/libmetal/metal/system/nuttx/io.c new file mode 100644 index 0000000000000000000000000000000000000000..9d4d6d382812d9be64bf2fa068a769850fbb2a12 --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/io.c @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include +#include +#include + +static uint64_t metal_io_read_(struct metal_io_region *io, + unsigned long offset, + memory_order order, + int width) +{ + uint64_t value = 0; + metal_unused(order); + + metal_io_block_read(io, offset, &value, width); + return value; +} + +static void metal_io_write_(struct metal_io_region *io, + unsigned long offset, + uint64_t value, + memory_order order, + int width) +{ + metal_unused(order); + + metal_io_block_write(io, offset, &value, width); +} + +static int metal_io_block_read_(struct metal_io_region *io, + unsigned long offset, + void *restrict dst, + memory_order order, + int len) +{ + void *va = metal_io_virt(io, offset); + metal_unused(order); + + metal_cache_invalidate(va, len); + if (len == 1) + *(uint8_t *)dst = *(uint8_t *)va; + else if (len == 2) + *(uint16_t *)dst = *(uint16_t *)va; + else if (len == 4) + *(uint32_t *)dst = *(uint32_t *)va; + else if (len == 8) { + *(uint32_t *)dst = *(uint32_t *)va; + *((uint32_t *)dst + 1) = *((uint32_t *)va + 1); + } else + memcpy(dst, va, len); + + return len; +} + +static int metal_io_block_write_(struct metal_io_region *io, + unsigned long offset, + const void *restrict src, + memory_order order, + int len) +{ + void *va = metal_io_virt(io, offset); + metal_unused(order); + + if (len == 1) + *(uint8_t *)va = *(uint8_t *)src; + else if (len == 2) + *(uint16_t *)va = *(uint16_t *)src; + else if (len == 4) + *(uint32_t *)va = *(uint32_t *)src; + else if (len == 8) { + *(uint32_t *)va = *(uint32_t *)src; + *((uint32_t *)va + 1) = *((uint32_t *)src + 1); + } else + memcpy(va, src, len); + + metal_cache_flush(va, len); + + return len; +} + +static void metal_io_block_set_(struct metal_io_region *io, + unsigned long offset, + unsigned char value, + memory_order order, + int len) +{ + void *va = metal_io_virt(io, offset); + metal_unused(order); + + memset(va, value, len); + metal_cache_flush(va, len); +} + +static void metal_io_close_(struct metal_io_region *io) +{ + metal_unused(io); +} + +static metal_phys_addr_t metal_io_offset_to_phys_(struct metal_io_region *io, + unsigned long offset) +{ + return up_addrenv_va_to_pa((void *)((uintptr_t)io->virt + offset)); +} + +static unsigned long metal_io_phys_to_offset_(struct metal_io_region *io, + metal_phys_addr_t phys) +{ + return (uintptr_t)up_addrenv_pa_to_va(phys) - (uintptr_t)io->virt; +} + +static metal_phys_addr_t metal_io_phys_start_; + +static struct metal_io_region metal_io_region_ = { + .virt = NULL, + .physmap = &metal_io_phys_start_, + .size = (size_t)-1, + .page_shift = sizeof(metal_phys_addr_t) * CHAR_BIT, + .page_mask = (metal_phys_addr_t)-1, + .mem_flags = 0, + .ops = { + .read = metal_io_read_, + .write = metal_io_write_, + .block_read = metal_io_block_read_, + .block_write = metal_io_block_write_, + .block_set = metal_io_block_set_, + .close = metal_io_close_, + .offset_to_phys = metal_io_offset_to_phys_, + .phys_to_offset = metal_io_phys_to_offset_, + }, +}; + +struct metal_io_ops *metal_io_get_ops(void) +{ + return &metal_io_region_.ops; +} + +struct metal_io_region *metal_io_get_region(void) +{ + return &metal_io_region_; +} diff --git a/third-party/libmetal/metal/system/nuttx/io.h b/third-party/libmetal/metal/system/nuttx/io.h new file mode 100644 index 0000000000000000000000000000000000000000..743b7b19ccdeb3ca2dd1d7def7a28742af65d6a4 --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/io.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/io.h + * @brief NuttX specific io definitions. + */ + +#ifndef __METAL_IO__H__ +#error "Include metal/io.h instead of metal/nuttx/io.h" +#endif + +#ifndef __METAL_NUTTX_IO__H__ +#define __METAL_NUTTX_IO__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Get the default global io ops. + * @return an io ops. + */ +struct metal_io_ops *metal_io_get_ops(void); + +/** + * @brief Get the default global io region. + * @return an io region. + */ +struct metal_io_region *metal_io_get_region(void); + +#ifdef METAL_INTERNAL + +/** + * @brief memory mapping for an I/O region + */ +static inline void metal_sys_io_mem_map(struct metal_io_region *io) +{ + metal_unused(io); +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_NUTTX_IO__H__ */ diff --git a/third-party/libmetal/metal/system/nuttx/irq.c b/third-party/libmetal/metal/system/nuttx/irq.c new file mode 100644 index 0000000000000000000000000000000000000000..34e0edbf4799af89f38014951d6cf9b1b66faaac --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/irq.c @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/irq.c + * @brief NuttX libmetal irq definitions. + */ + +#include +#include +#include +#include +#include + +unsigned int metal_irq_save_disable(void) +{ + return up_irq_save(); +} + +void metal_irq_restore_enable(unsigned int flags) +{ + up_irq_restore(flags); +} + +/* Implement the default irq controller */ +static void metal_cntr_irq_set_enable(struct metal_irq_controller *cntr, + int irq, unsigned int enable) +{ +#ifndef CONFIG_ARCH_NOINTC + if (irq >= 0 && irq < cntr->irq_num) { + if (enable == METAL_IRQ_ENABLE) + up_enable_irq(irq); + else + up_disable_irq(irq); + } +#endif +} + +static int metal_cntr_irq_handler(int irq, void *context, void *data) +{ + if (context != NULL) + return metal_irq_handle(data, irq); + + /* context == NULL mean unregister */ + irqchain_detach(irq, metal_cntr_irq_handler, data); + metal_free_memory(data); + return 0; +} + +static int metal_cntr_irq_attach(struct metal_irq_controller *cntr, + int irq, metal_irq_handler hd, void *arg) +{ + if (irq < 0 || irq >= cntr->irq_num) + return -EINVAL; + + if (hd) { + struct metal_irq *data; + + data = metal_allocate_memory(sizeof(*data)); + if (data == NULL) + return -ENOMEM; + + data->hd = hd; + data->arg = arg; + + irq_attach(irq, metal_cntr_irq_handler, data); + } else { + unsigned int flags; + + flags = metal_irq_save_disable(); + irq_dispatch(irq, NULL); /* fake a irq request */ + metal_irq_restore_enable(flags); + } + + return 0; +} + +int metal_cntr_irq_init(void) +{ + static METAL_IRQ_CONTROLLER_DECLARE(metal_cntr_irq, + 0, + NR_IRQS ? NR_IRQS : 1, + NULL, + metal_cntr_irq_set_enable, + metal_cntr_irq_attach, + NULL); + return metal_irq_register_controller(&metal_cntr_irq); +} diff --git a/third-party/libmetal/metal/system/nuttx/irq.h b/third-party/libmetal/metal/system/nuttx/irq.h new file mode 100644 index 0000000000000000000000000000000000000000..b9d5bc7c081f0071dbbf4532f19cb884588aba14 --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/irq.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/irq.h + * @brief NuttX libmetal irq definitions. + */ + +#ifndef __METAL_IRQ__H__ +#error "Include metal/irq.h instead of metal/nuttx/irq.h" +#endif + +#ifndef __METAL_NUTTX_IRQ__H__ +#define __METAL_NUTTX_IRQ__H__ + +#ifdef __cplusplus +extern "C" { +#endif + +int metal_cntr_irq_init(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_NUTTX_IRQ__H__ */ diff --git a/third-party/libmetal/metal/system/nuttx/log.h b/third-party/libmetal/metal/system/nuttx/log.h new file mode 100644 index 0000000000000000000000000000000000000000..5f318c7bfc092c468e81885eb1f31fee752ec81a --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/log.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/log.h + * @brief NuttX libmetal log handler definition. + */ + +#ifndef __METAL_METAL_LOG__H__ +#error "Include metal/log.h instead of metal/nuttx/log.h" +#endif + +#ifndef __METAL_NUTTX_LOG__H__ +#define __METAL_NUTTX_LOG__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_NUTTX_LOG__H__ */ diff --git a/third-party/libmetal/metal/system/nuttx/mutex.h b/third-party/libmetal/metal/system/nuttx/mutex.h new file mode 100644 index 0000000000000000000000000000000000000000..26ec4f9049f3f03e5d78123a78baf64fc69664f1 --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/mutex.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/mutex.h + * @brief NuttX mutex primitives for libmetal. + */ + +#ifndef __METAL_MUTEX__H__ +#error "Include metal/mutex.h instead of metal/nuttx/mutex.h" +#endif + +#ifndef __METAL_NUTTX_MUTEX__H__ +#define __METAL_NUTTX_MUTEX__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef mutex_t metal_mutex_t; + +/* + * METAL_MUTEX_INIT - used for initializing an mutex element in a static struct + * or global + */ +#define METAL_MUTEX_INIT(m) NXMUTEX_INITIALIZER +/* + * METAL_MUTEX_DEFINE - used for defining and initializing a global or + * static singleton mutex + */ +#define METAL_MUTEX_DEFINE(m) metal_mutex_t m = NXMUTEX_INITIALIZER + +static inline void __metal_mutex_init(metal_mutex_t *mutex) +{ + nxmutex_init(mutex); +} + +static inline void __metal_mutex_deinit(metal_mutex_t *mutex) +{ + nxmutex_destroy(mutex); +} + +static inline int __metal_mutex_try_acquire(metal_mutex_t *mutex) +{ + return nxmutex_trylock(mutex); +} + +static inline void __metal_mutex_acquire(metal_mutex_t *mutex) +{ + nxmutex_lock(mutex); +} + +static inline void __metal_mutex_release(metal_mutex_t *mutex) +{ + nxmutex_unlock(mutex); +} + +static inline int __metal_mutex_is_acquired(metal_mutex_t *mutex) +{ + return nxmutex_is_locked(mutex); +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_NUTTX_MUTEX__H__ */ diff --git a/third-party/libmetal/metal/processor/csky/cpu.h b/third-party/libmetal/metal/system/nuttx/shmem.c similarity index 36% rename from third-party/libmetal/metal/processor/csky/cpu.h rename to third-party/libmetal/metal/system/nuttx/shmem.c index a393848844000052eebd48539b2fbdf7abb7a23d..1db4481e2cbe363c29d6dee0131f28e78918c363 100644 --- a/third-party/libmetal/metal/processor/csky/cpu.h +++ b/third-party/libmetal/metal/system/nuttx/shmem.c @@ -5,13 +5,14 @@ */ /* - * @file cpu.h - * @brief CPU specific primitives + * @file nuttx/shmem.c + * @brief NuttX libmetal shared memory handling. */ -#ifndef __METAL_CSKY_CPU__H__ -#define __METAL_CSKY_CPU__H__ +#include -#define metal_cpu_yield() - -#endif /* __METAL_CSKY_CPU__H__ */ +int metal_shmem_open(const char *name, size_t size, + struct metal_io_region **io) +{ + return metal_shmem_open_generic(name, size, io); +} diff --git a/third-party/libmetal/metal/system/nuttx/sleep.h b/third-party/libmetal/metal/system/nuttx/sleep.h new file mode 100644 index 0000000000000000000000000000000000000000..c875ab666f8c8fef1780c8c5d55007004c2087cc --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/sleep.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/sleep.h + * @brief NuttX sleep primitives for libmetal. + */ + +#ifndef __METAL_SLEEP__H__ +#error "Include metal/sleep.h instead of metal/nuttx/sleep.h" +#endif + +#ifndef __METAL_NUTTX_SLEEP__H__ +#define __METAL_NUTTX_SLEEP__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static inline int __metal_sleep_usec(unsigned int usec) +{ + return nxsig_usleep(usec); +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_NUTTX_SLEEP__H__ */ diff --git a/third-party/libmetal/metal/system/nuttx/sys.h b/third-party/libmetal/metal/system/nuttx/sys.h new file mode 100644 index 0000000000000000000000000000000000000000..e188e866a11e0d4f44f38cc82a841cb8721ff6a9 --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/sys.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/sys.h + * @brief NuttX system primitives for libmetal. + */ + +#ifndef __METAL_SYS__H__ +#error "Include metal/sys.h instead of metal/nuttx/sys.h" +#endif + +#ifndef __METAL_NUTTX_SYS__H__ +#define __METAL_NUTTX_SYS__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define metal_yield() metal_sleep_usec(1000) + +#define METAL_INIT_DEFAULTS \ +{ \ + .log_handler = (metal_log_handler)syslog, \ + .log_level = METAL_LOG_INFO, \ +} + +/** Structure of nuttx libmetal runtime state. */ +struct metal_state { + + /** Common (system independent) data. */ + struct metal_common_state common; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_NUTTX_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/nuttx/time.c b/third-party/libmetal/metal/system/nuttx/time.c new file mode 100644 index 0000000000000000000000000000000000000000..986f1ba18f6d5d70780c23fe9bac7cc068ba9656 --- /dev/null +++ b/third-party/libmetal/metal/system/nuttx/time.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file nuttx/time.c + * @brief NuttX libmetal time handling. + */ + +#include +#include + +unsigned long long metal_get_timestamp(void) +{ + unsigned long long t = 0; + struct timespec tp; + int r; + + r = clock_systime_timespec(&tp); + if (!r) { + t = (unsigned long long)tp.tv_sec * NSEC_PER_SEC; + t += tp.tv_nsec; + } + return t; +} diff --git a/third-party/libmetal/metal/system/zephyr/CMakeLists.txt b/third-party/libmetal/metal/system/zephyr/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..cc1fd534b83b0d4b0cfa6a3ff95feb41a5c6ed1b --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/CMakeLists.txt @@ -0,0 +1,21 @@ +collect (PROJECT_LIB_HEADERS alloc.h) +collect (PROJECT_LIB_HEADERS assert.h) +collect (PROJECT_LIB_HEADERS cache.h) +collect (PROJECT_LIB_HEADERS condition.h) +collect (PROJECT_LIB_HEADERS io.h) +collect (PROJECT_LIB_HEADERS irq.h) +collect (PROJECT_LIB_HEADERS log.h) +collect (PROJECT_LIB_HEADERS mutex.h) +collect (PROJECT_LIB_HEADERS sleep.h) +collect (PROJECT_LIB_HEADERS sys.h) + +collect (PROJECT_LIB_SOURCES alloc.c) +collect (PROJECT_LIB_SOURCES condition.c) +collect (PROJECT_LIB_SOURCES device.c) +collect (PROJECT_LIB_SOURCES init.c) +collect (PROJECT_LIB_SOURCES irq.c) +collect (PROJECT_LIB_SOURCES log.c) +collect (PROJECT_LIB_SOURCES shmem.c) +collect (PROJECT_LIB_SOURCES time.c) +collect (PROJECT_LIB_SOURCES sys.c) + diff --git a/third-party/libmetal/metal/system/zephyr/alloc.c b/third-party/libmetal/metal/system/zephyr/alloc.c new file mode 100644 index 0000000000000000000000000000000000000000..da70e0ca4fe57a80d39e2c8a1901a5aed84e3fd3 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/alloc.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/alloc.c + * @brief Zephyr libmetal memory allocation handling. + */ + +#include +#include + +#if (K_HEAP_MEM_POOL_SIZE <= 0) + +void *metal_weak metal_zephyr_allocate_memory(unsigned int size) +{ + (void)size; + return NULL; +} + +void metal_weak metal_zephyr_free_memory(void *ptr) +{ + (void)ptr; +} + +#endif /* K_HEAP_MEM_POOL_SIZE */ diff --git a/third-party/libmetal/metal/system/zephyr/alloc.h b/third-party/libmetal/metal/system/zephyr/alloc.h new file mode 100644 index 0000000000000000000000000000000000000000..0064a53a2a5ace90b9d1d76ea9d1ff870e218127 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/alloc.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/alloc.h + * @brief zephyr libmetal memory allocattion definitions. + */ + +#ifndef __METAL_ALLOC__H__ +#error "Include metal/alloc.h instead of metal/zephyr/alloc.h" +#endif + +#ifndef __METAL_ZEPHYR_ALLOC__H__ +#define __METAL_ZEPHYR_ALLOC__H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if (K_HEAP_MEM_POOL_SIZE > 0) +static inline void *__metal_allocate_memory(unsigned int size) +{ + return k_malloc(size); +} + +static inline void __metal_free_memory(void *ptr) +{ + k_free(ptr); +} +#else + +void *metal_zephyr_allocate_memory(unsigned int size); +void metal_zephyr_free_memory(void *ptr); + +static inline void *__metal_allocate_memory(unsigned int size) +{ + return metal_zephyr_allocate_memory(size); +} + +static inline void __metal_free_memory(void *ptr) +{ + metal_zephyr_free_memory(ptr); +} +#endif /* K_HEAP_MEM_POOL_SIZE */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_ZEPHYR_ALLOC__H__ */ diff --git a/third-party/libmetal/metal/system/zephyr/assert.h b/third-party/libmetal/metal/system/zephyr/assert.h new file mode 100644 index 0000000000000000000000000000000000000000..2145778c7bf2210a3060d688ef0eed2ff493fdb9 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/assert.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file assert.h + * @brief Zephyr assertion support. + */ + +#ifndef __METAL_ASSERT__H__ +#error "Include metal/assert.h instead of metal/zephyr/assert.h" +#endif + +#ifndef __METAL_ZEPHYR_ASSERT__H__ +#define __METAL_ZEPHYR_ASSERT__H__ + +#include + +/** + * @brief Assertion macro for Zephyr-based applications. + * @param cond Condition to evaluate. + */ +#define metal_sys_assert(cond) __ASSERT_NO_MSG(cond) + +#endif /* __METAL_ZEPHYR_ASSERT__H__ */ + diff --git a/third-party/libmetal/metal/system/zephyr/cache.h b/third-party/libmetal/metal/system/zephyr/cache.h new file mode 100644 index 0000000000000000000000000000000000000000..36f6a166295498a5370ef0b1b5c174a2cc9cf02e --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/cache.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/cache.h + * @brief Zephyr cache operation primitives for libmetal. + */ + +#ifndef __METAL_CACHE__H__ +#error "Include metal/cache.h instead of metal/zephyr/cache.h" +#endif + +#ifndef __METAL_ZEPHYR_CACHE__H__ +#define __METAL_ZEPHYR_CACHE__H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static inline void __metal_cache_flush(void *addr, unsigned int len) +{ + sys_cache_data_flush_range(addr, len); +} + +static inline void __metal_cache_invalidate(void *addr, unsigned int len) +{ + sys_cache_data_invd_range(addr, len); +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_ZEPHYR_CACHE__H__ */ diff --git a/third-party/libmetal/metal/system/zephyr/condition.c b/third-party/libmetal/metal/system/zephyr/condition.c new file mode 100644 index 0000000000000000000000000000000000000000..17831e1bdba482ce41873a7cfda6cf72df783c1c --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/condition.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/condition.c + * @brief Zephyr libmetal condition variable handling. + */ + +#include +#include + +extern void metal_generic_default_poll(void); + +int metal_condition_wait(struct metal_condition *cv, + metal_mutex_t *m) +{ + uintptr_t tmpmptr = 0, mptr = (uintptr_t)m; + int v; + unsigned int flags; + + /* Check if the mutex has been acquired */ + if (!cv || !m || !metal_mutex_is_acquired(m)) { + return -EINVAL; + } + + if (!atomic_compare_exchange_strong(&cv->mptr, &tmpmptr, mptr)) { + if (tmpmptr != mptr) { + return -EINVAL; + } + } + + v = atomic_load(&cv->v); + + /* Release the mutex first. */ + metal_mutex_release(m); + do { + flags = metal_irq_save_disable(); + if (atomic_load(&cv->v) != v) { + metal_irq_restore_enable(flags); + break; + } + metal_generic_default_poll(); + metal_irq_restore_enable(flags); + } while (1); + /* Acquire the mutex again. */ + metal_mutex_acquire(m); + return 0; +} diff --git a/third-party/libmetal/metal/system/zephyr/condition.h b/third-party/libmetal/metal/system/zephyr/condition.h new file mode 100644 index 0000000000000000000000000000000000000000..f9dc7285fe1f733da0de56be7ffd55ca8c6285e7 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/condition.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/condition.h + * @brief Zephyr condition variable primitives for libmetal. + */ + +#ifndef __METAL_CONDITION__H__ +#error "Include metal/condition.h instead of metal/generic/condition.h" +#endif + +#ifndef __METAL_ZEPHYR_CONDITION__H__ +#define __METAL_ZEPHYR_CONDITION__H__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct metal_condition { + atomic_uintptr_t mptr; /**< mutex pointer. + * The condition variable is attached to + * this mutex when it is waiting. + * It is also used to check correctness + * in case there are multiple waiters. + */ + + atomic_int v; /**< condition variable value. */ +}; + +/** Static metal condition variable initialization. */ +#define METAL_CONDITION_INIT { ATOMIC_VAR_INIT(0), ATOMIC_VAR_INIT(0) } + +static inline void metal_condition_init(struct metal_condition *cv) +{ + atomic_init(&cv->mptr, 0); + atomic_init(&cv->v, 0); +} + +static inline int metal_condition_signal(struct metal_condition *cv) +{ + if (!cv) + return -EINVAL; + + /** wake up waiters if there are any. */ + atomic_fetch_add(&cv->v, 1); + return 0; +} + +static inline int metal_condition_broadcast(struct metal_condition *cv) +{ + return metal_condition_signal(cv); +} + + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_ZEPHYR_CONDITION__H__ */ diff --git a/third-party/libmetal/metal/system/zephyr/device.c b/third-party/libmetal/metal/system/zephyr/device.c new file mode 100644 index 0000000000000000000000000000000000000000..85f073bedf1eb5e38a7f21119216e82b4efef9cf --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/device.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/device.c + * @brief Zephyr libmetal device definitions. + */ + +#include +#include +#include + +int metal_generic_dev_sys_open(struct metal_device *dev) +{ + metal_unused(dev); + + /* Since Zephyr runs bare-metal there is no mapping that needs to be + * done of IO regions + */ + return 0; +} + +struct metal_bus metal_generic_bus = { + .name = "generic", + .ops = { + .bus_close = NULL, + .dev_open = metal_generic_dev_open, + .dev_close = NULL, + .dev_irq_ack = NULL, + .dev_dma_map = NULL, + .dev_dma_unmap = NULL, + }, +}; diff --git a/third-party/libmetal/metal/system/zephyr/init.c b/third-party/libmetal/metal/system/zephyr/init.c new file mode 100644 index 0000000000000000000000000000000000000000..8a860bb7d9439ff4e9cac7edd0047e5b66a171cf --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/init.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/init.c + * @brief Zephyr libmetal initialization. + */ + +#include +#include +#include + +struct metal_state _metal; + +int metal_sys_init(const struct metal_init_params *params) +{ + metal_bus_register(&metal_generic_bus); + return 0; +} + +void metal_sys_finish(void) +{ + metal_bus_unregister(&metal_generic_bus); +} diff --git a/third-party/libmetal/metal/system/zephyr/io.h b/third-party/libmetal/metal/system/zephyr/io.h new file mode 100644 index 0000000000000000000000000000000000000000..5dd87d148a23e6d5150d699682675dec20d6e786 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/io.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/io.h + * @brief Zephyr specific io definitions. + */ + +#ifndef __METAL_IO__H__ +#error "Include metal/io.h instead of metal/zephyr/io.h" +#endif + +#ifndef __METAL_ZEPHYR_IO__H__ +#define __METAL_ZEPHYR_IO__H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef METAL_INTERNAL + +/** + * @brief memory mapping for an I/O region + */ +static inline void metal_sys_io_mem_map(struct metal_io_region *io) +{ + metal_unused(io); +} + +/** + * @brief memory mapping + */ +static inline void *metal_machine_io_mem_map(void *va, metal_phys_addr_t pa, + size_t size, unsigned int flags) +{ + metal_unused(pa); + metal_unused(size); + metal_unused(flags); + + return va; +} + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_ZEPHYR_IO__H__ */ diff --git a/third-party/libmetal/metal/system/zephyr/irq.c b/third-party/libmetal/metal/system/zephyr/irq.c new file mode 100644 index 0000000000000000000000000000000000000000..9692734ccb971e78f2ffbc7ac9e6dfd36668486c --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/irq.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/irq.c + * @brief Zephyr libmetal irq definitions. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +unsigned int metal_irq_save_disable(void) +{ + return irq_lock(); +} + +void metal_irq_restore_enable(unsigned int flags) +{ + irq_unlock(flags); +} + diff --git a/third-party/libmetal/metal/system/zephyr/irq.h b/third-party/libmetal/metal/system/zephyr/irq.h new file mode 100644 index 0000000000000000000000000000000000000000..7f317943bdaaa2d0247aeceeed312ba7ac06ccdd --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/irq.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/irq.c + * @brief Zephyr libmetal irq definitions. + */ + +#ifndef __METAL_IRQ__H__ +#error "Include metal/irq.h instead of metal/zephyr/irq.h" +#endif + +#ifndef __METAL_ZEPHYR_IRQ__H__ +#define __METAL_ZEPHYR_IRQ__H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_ZEPHYR_IRQ__H__ */ diff --git a/third-party/libmetal/metal/system/zephyr/log.c b/third-party/libmetal/metal/system/zephyr/log.c new file mode 100644 index 0000000000000000000000000000000000000000..fddcd810457e2c55ccf1b0fd21c0a6abffc80651 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/log.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/log.c + * @brief Zephyr libmetal log handler. + */ + +#include +#include +#include + +static const char * const level_strs[] = { + "metal: emergency: ", + "metal: alert: ", + "metal: critical: ", + "metal: error: ", + "metal: warning: ", + "metal: notice: ", + "metal: info: ", + "metal: debug: ", +}; + +void metal_zephyr_log_handler(enum metal_log_level level, + const char *format, ...) +{ + va_list args; + + if (level <= METAL_LOG_EMERGENCY || level > METAL_LOG_DEBUG) + level = METAL_LOG_EMERGENCY; + printk("%s", level_strs[level]); + + va_start(args, format); + vprintk(format, args); + va_end(args); +} + diff --git a/third-party/libmetal/metal/system/zephyr/log.h b/third-party/libmetal/metal/system/zephyr/log.h new file mode 100644 index 0000000000000000000000000000000000000000..b4cef17a65e7127827d0a1157b521621753f6f89 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/log.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Xilinx Inc. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/log.h + * @brief Zephyr libmetal log handler definition. + */ + +#ifndef __METAL_METAL_LOG__H__ +#error "Include metal/log.h instead of metal/zephyr/log.h" +#endif + +#ifndef __METAL_ZEPHYR_LOG__H__ +#define __METAL_ZEPHYR_LOG__H__ + +#ifdef __cplusplus +extern "C" { +#endif + +void metal_zephyr_log_handler(enum metal_log_level level, + const char *format, ...); + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_ZEPHYR_LOG__H__ */ diff --git a/third-party/libmetal/metal/system/zephyr/mutex.h b/third-party/libmetal/metal/system/zephyr/mutex.h new file mode 100644 index 0000000000000000000000000000000000000000..a7876bc421f508cd71745ba459da04db00ef0731 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/mutex.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/mutex.h + * @brief Zephyr mutex primitives for libmetal. + */ + +#ifndef __METAL_MUTEX__H__ +#error "Include metal/mutex.h instead of metal/zephyr/mutex.h" +#endif + +#ifndef __METAL_ZEPHYR_MUTEX__H__ +#define __METAL_ZEPHYR_MUTEX__H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct k_sem metal_mutex_t; + +/* + * METAL_MUTEX_INIT - used for initializing an mutex element in a static struct + * or global + */ +#define METAL_MUTEX_INIT(m) _K_SEM_INITIALIZER(m, 1, 1) +/* + * METAL_MUTEX_DEFINE - used for defining and initializing a global or + * static singleton mutex + */ +#define METAL_MUTEX_DEFINE(m) K_SEM_DEFINE(m, 1, 1) + +static inline void __metal_mutex_init(metal_mutex_t *m) +{ + k_sem_init(m, 1, 1); +} + +static inline void __metal_mutex_deinit(metal_mutex_t *m) +{ + (void)m; +} + +static inline int __metal_mutex_try_acquire(metal_mutex_t *m) +{ + int key = irq_lock(), ret = 1; + + if (m->count) { + m->count = 0; + ret = 0; + } + + irq_unlock(key); + + return ret; +} + +static inline int __metal_mutex_is_acquired(metal_mutex_t *m) +{ + int key = irq_lock(), ret; + + ret = m->count; + + irq_unlock(key); + + return ret; +} + +static inline void __metal_mutex_acquire(metal_mutex_t *m) +{ + k_sem_take(m, K_FOREVER); +} + +static inline void __metal_mutex_release(metal_mutex_t *m) +{ + k_sem_give(m); +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_ZEPHYR_MUTEX__H__ */ diff --git a/third-party/libmetal/metal/system/zephyr/shmem.c b/third-party/libmetal/metal/system/zephyr/shmem.c new file mode 100644 index 0000000000000000000000000000000000000000..ecf26190eb94cb29c599f6210c7455f7b6e53615 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/shmem.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/shmem.c + * @brief Zephyr libmetal shared memory handling. + */ + +#include + +int metal_shmem_open(const char *name, size_t size, + struct metal_io_region **io) +{ + return metal_shmem_open_generic(name, size, io); +} diff --git a/third-party/libmetal/metal/system/zephyr/sleep.h b/third-party/libmetal/metal/system/zephyr/sleep.h new file mode 100644 index 0000000000000000000000000000000000000000..55b3b96f78f78b696d57830fc43ea22e8460b589 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/sleep.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/sleep.h + * @brief Zephyr sleep primitives for libmetal. + */ + +#ifndef __METAL_SLEEP__H__ +#error "Include metal/sleep.h instead of metal/zephyr/sleep.h" +#endif + +#ifndef __METAL_ZEPHYR_SLEEP__H__ +#define __METAL_ZEPHYR_SLEEP__H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static inline int __metal_sleep_usec(unsigned int usec) +{ + k_sleep(K_USEC(usec)); + return 0; +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_ZEPHYR_SLEEP__H__ */ diff --git a/third-party/libmetal/metal/system/zephyr/sys.c b/third-party/libmetal/metal/system/zephyr/sys.c new file mode 100644 index 0000000000000000000000000000000000000000..c2c96a25ec493b19d969250fdb772fd1c7bb887d --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/sys.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/sys.c + * @brief Zephyr system primitives for libmetal. + */ + +#include +#include + +#include + +/** + * @brief poll function until some event happens + */ +void metal_weak metal_generic_default_poll(void) +{ + k_cpu_idle(); +} diff --git a/third-party/libmetal/metal/system/zephyr/sys.h b/third-party/libmetal/metal/system/zephyr/sys.h new file mode 100644 index 0000000000000000000000000000000000000000..712fdfefe5da219b32a1be2e1b1d1dd755c86956 --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/sys.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/sys.h + * @brief Zephyr system primitives for libmetal. + */ + +#ifndef __METAL_SYS__H__ +#error "Include metal/sys.h instead of metal/zephyr/sys.h" +#endif + +#ifndef __METAL_ZEPHYR_SYS__H__ +#define __METAL_ZEPHYR_SYS__H__ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define metal_yield() metal_cpu_yield() + +#define METAL_INIT_DEFAULTS \ +{ \ + .log_handler = metal_zephyr_log_handler, \ + .log_level = METAL_LOG_INFO, \ +} + +#ifndef METAL_MAX_DEVICE_REGIONS +#define METAL_MAX_DEVICE_REGIONS 1 +#endif + +/** Structure of zephyr libmetal runtime state. */ +struct metal_state { + + /** Common (system independent) data. */ + struct metal_common_state common; +}; + +static inline void metal_wait_usec(uint32_t usec_to_wait) +{ + k_busy_wait(usec_to_wait); +} + +#ifdef __cplusplus +} +#endif + +#endif /* __METAL_ZEPHYR_SYS__H__ */ diff --git a/third-party/libmetal/metal/system/zephyr/time.c b/third-party/libmetal/metal/system/zephyr/time.c new file mode 100644 index 0000000000000000000000000000000000000000..16ef98057a15e17a120e38853f633ce587f13cca --- /dev/null +++ b/third-party/libmetal/metal/system/zephyr/time.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2017, Linaro Limited. and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/* + * @file zephyr/time.c + * @brief Zephyr libmetal time handling. + */ + +#include +#include + +unsigned long long metal_get_timestamp(void) +{ + return (unsigned long long)k_uptime_ticks(); +} + diff --git a/third-party/libmetal/metal/time.h b/third-party/libmetal/metal/time.h index 9e1762e089c4fd9948330b0fbc282e2e717b9148..bc24e61348394b1c9d1f5c0ca509545b66c88f45 100644 --- a/third-party/libmetal/metal/time.h +++ b/third-party/libmetal/metal/time.h @@ -12,6 +12,9 @@ #ifndef __METAL_TIME__H__ #define __METAL_TIME__H__ +#include +#include + #ifdef __cplusplus extern "C" { #endif @@ -20,9 +23,6 @@ extern "C" { * @{ */ -#include -#include - /** * @brief get timestamp * This function returns the timestampe as unsigned long long diff --git a/third-party/libmetal/metal/utilities.h b/third-party/libmetal/metal/utilities.h index 988170894639a0a031ff5ba5db99194bb3d0a9e0..624bb535c2796e9278094e670aa279bad3611a4a 100644 --- a/third-party/libmetal/metal/utilities.h +++ b/third-party/libmetal/metal/utilities.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved. + * Copyright (c) 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -24,6 +25,14 @@ extern "C" { * @{ */ +#ifndef MB +#define MB (1024UL << 10UL) +#endif + +#ifndef GB +#define GB (MB << 10UL) +#endif + /** Marker for unused function arguments/variables. */ #define metal_unused(x) do { (x) = (x); } while (0) @@ -125,10 +134,10 @@ metal_bitmap_next_clear_bit(unsigned long *bitmap, unsigned int start, unsigned int bit; for (bit = start; - bit < max && !metal_bitmap_is_bit_clear(bitmap, bit); + bit < max + start && !metal_bitmap_is_bit_clear(bitmap, bit % max); bit++) ; - return bit; + return bit % max; } #define metal_bitmap_for_each_clear_bit(bitmap, bit, max) \ diff --git a/third-party/libmetal/metal/version.h b/third-party/libmetal/metal/version.h index 32be7ae690a83a889bad43afe960bd399672a100..4ef160b9ee33dbdce2f36dd9c38e6e862ec58d85 100644 --- a/third-party/libmetal/metal/version.h +++ b/third-party/libmetal/metal/version.h @@ -30,7 +30,7 @@ extern "C" { * @return Library major version number. * @see METAL_VER_MAJOR */ -extern int metal_ver_major(void); +int metal_ver_major(void); /** * @brief Library minor version number. @@ -42,7 +42,7 @@ extern int metal_ver_major(void); * @return Library minor version number. * @see METAL_VER_MINOR */ -extern int metal_ver_minor(void); +int metal_ver_minor(void); /** * @brief Library patch level. @@ -54,7 +54,7 @@ extern int metal_ver_minor(void); * @return Library patch level. * @see METAL_VER_PATCH */ -extern int metal_ver_patch(void); +int metal_ver_patch(void); /** * @brief Library version string. @@ -66,7 +66,7 @@ extern int metal_ver_patch(void); * @return Library version string. * @see METAL_VER */ -extern const char *metal_ver(void); +const char *metal_ver(void); /** @} */ diff --git a/third-party/openamp/.checkpatch.conf b/third-party/openamp/.checkpatch.conf deleted file mode 100644 index 0c4fe8d5539dde95099baad364358ec00075e87b..0000000000000000000000000000000000000000 --- a/third-party/openamp/.checkpatch.conf +++ /dev/null @@ -1,22 +0,0 @@ ---emacs ---no-tree ---summary-file ---show-types ---max-line-length=80 ---min-conf-desc-length=1 - ---ignore BRACES ---ignore PRINTK_WITHOUT_KERN_LEVEL ---ignore SPLIT_STRING ---ignore VOLATILE ---ignore CONFIG_EXPERIMENTAL ---ignore AVOID_EXTERNS ---ignore NETWORKING_BLOCK_COMMENT_STYLE ---ignore DATE_TIME ---ignore MINMAX ---ignore CONST_STRUCT ---ignore FILE_PATH_CHANGES ---ignore BIT_MACRO ---ignore PREFER_KERNEL_TYPES ---ignore NEW_TYPEDEFS ---ignore ARRAY_SIZE \ No newline at end of file diff --git a/third-party/openamp/.gitignore b/third-party/openamp/.gitignore deleted file mode 100644 index 3678ab7abdc3737376fe63eef931d638e401b8b8..0000000000000000000000000000000000000000 --- a/third-party/openamp/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.o -*~ -!libs/system/zc702evk/linux/lib/*/*.a -*.bin -*.map -*.out -*.log -*.d - -/tags -/TAGS - -# cscope files -cscope.* -ncscope.* diff --git a/third-party/openamp/.gitlint b/third-party/openamp/.gitlint deleted file mode 100644 index 92d9e1b8db145a9bfe8c73c5de0066734faadbb0..0000000000000000000000000000000000000000 --- a/third-party/openamp/.gitlint +++ /dev/null @@ -1,99 +0,0 @@ -# All these sections are optional, edit this file as you like. -[general] -# Ignore certain rules, you can reference them by their id or by their full name -ignore=title-trailing-punctuation, T3, title-max-length, T1, body-hard-tab, B1, B3 - -# verbosity should be a value between 1 and 3, the commandline -v flags take precedence over this -verbosity = 3 - -# By default gitlint will ignore merge commits. Set to 'false' to disable. -ignore-merge-commits=true - -# By default gitlint will ignore fixup commits. Set to 'false' to disable. -# ignore-fixup-commits=false - -# By default gitlint will ignore squash commits. Set to 'false' to disable. -# ignore-squash-commits=true - -# Ignore any data send to gitlint via stdin -# ignore-stdin=true - -# Enable debug mode (prints more output). Disabled by default. -debug=true - -# Enable community contributed rules -# See http://jorisroovers.github.io/gitlint/contrib_rules for details -# contrib=contrib-title-conventional-commits,CC1 - -# Set the extra-path where gitlint will search for user defined rules -# See http://jorisroovers.github.io/gitlint/user_defined_rules for details -extra-path=scripts/gitlint - -[title-max-length] -line-length=75 - -[body-min-line-count] -min-line-count=1 - -[body-max-line-count] -max-line-count=200 - -[title-must-not-contain-word] -# Comma-separated list of words that should not occur in the title. Matching is case -# insensitive. It's fine if the keyword occurs as part of a larger word (so "WIPING" -# will not cause a violation, but "WIP: my title" will. -words=wip - -# [title-match-regex] -# python like regex (https://docs.python.org/2/library/re.html) that the -# commit-msg title must be matched to. -# Note that the regex can contradict with other rules if not used correctly -# (e.g. title-must-not-contain-word). -# regex=^US[0-9]* - -[body-max-line-length] -# B1 = body-max-line-length -line-length=80 - -[body-min-length] -min-length=3 - -[body-is-missing] -# Whether to ignore this rule on merge commits (which typically only have a title) -# default = True -ignore-merge-commits=false - -# [body-changed-file-mention] -# List of files that need to be explicitly mentioned in the body when they are changed -# This is useful for when developers often erroneously edit certain files or git submodules. -# By specifying this rule, developers can only change the file when they explicitly reference -# it in the commit message. -# files=gitlint/rules.py,README.md - -# [author-valid-email] -# python like regex (https://docs.python.org/2/library/re.html) that the -# commit author email address should be matched to -# For example, use the following regex if you only want to allow email addresses from foo.com -# regex=[^@]+@foo.com - -# [ignore-by-title] -# Ignore certain rules for commits of which the title matches a regex -# E.g. Match commit titles that start with "Release" -# regex=^Release(.*) -# -# Ignore certain rules, you can reference them by their id or by their full name -# Use 'all' to ignore all rules -# ignore=T1,body-min-length - -# [ignore-by-body] -# Ignore certain rules for commits of which the body has a line that matches a regex -# E.g. Match bodies that have a line that that contain "release" -# regex=(.*)release(.*) -# -# Ignore certain rules, you can reference them by their id or by their full name -# Use 'all' to ignore all rules -# ignore=T1,body-min-length - -# [contrib-title-conventional-commits] -# Specify allowed commit types. For details see: https://www.conventionalcommits.org/ -# types = bugfix,user-story,epic \ No newline at end of file diff --git a/third-party/openamp/.travis.yml b/third-party/openamp/.travis.yml deleted file mode 100644 index 8345ce822a5a9ea5e3aa3839ed45ea972789a24e..0000000000000000000000000000000000000000 --- a/third-party/openamp/.travis.yml +++ /dev/null @@ -1,88 +0,0 @@ -language: minimal # setting language to C will override cross-compiler and fail - -compiler: - - gcc - -sudo: required -dist: trusty - -env: - global: - - ZEPHYR_TOOLCHAIN_VARIANT=zephyr - - ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk - - ZEPHYR_BASE=$TRAVIS_BUILD_DIR/deps/zephyr - - ZEPHYR_SDK_VERSION=0.9.3 - - ZEPHYR_SDK_DOWNLOAD_FOLDER=https://github.com/zephyrproject-rtos/meta-zephyr-sdk/releases/download/$ZEPHYR_SDK_VERSION - - ZEPHYR_SDK_SETUP_BINARY=zephyr-sdk-$ZEPHYR_SDK_VERSION-setup.run - - ZEPHYR_SDK_DOWNLOAD_URL=$ZEPHYR_SDK_DOWNLOAD_FOLDER/$ZEPHYR_SDK_SETUP_BINARY - -matrix: - fast_finish: true - include: - - os: linux - env: TARGET="linux" -# - os: linux -# env: TARGET="zephyr" - -cache: - directories: - - $ZEPHYR_SDK_INSTALL_DIR - - /usr/local/bin - -before_install: - - if [[ "$TARGET" == "linux" ]]; then - sudo apt-get update -qq && - sudo apt-get install libsysfs-dev libhugetlbfs-dev make gcc && - sudo pip install pytest pexpect; - fi - - if [[ "$TARGET" == "zephyr" ]]; then - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && - sudo apt-get update -qq && - sudo apt-get install libc6-dev-i386 make gperf gcc g++ python3-ply python3-yaml python3-pip device-tree-compiler ncurses-dev uglifyjs -qq && - sudo pip3 install pyelftools; - fi - -install: > - if [[ "$TARGET" == "zephyr" && "$(cat $ZEPHYR_SDK_INSTALL_DIR/sdk_version)" != "$ZEPHYR_SDK_VERSION" ]]; then - wget $ZEPHYR_SDK_DOWNLOAD_URL && - chmod +x $ZEPHYR_SDK_SETUP_BINARY && - rm -rf $ZEPHYR_SDK_INSTALL_DIR && - ./$ZEPHYR_SDK_SETUP_BINARY --quiet -- -y -d $ZEPHYR_SDK_INSTALL_DIR > /dev/null; - fi - -before_script: > - if [[ "$TARGET" == "linux" ]]; then - cd $TRAVIS_BUILD_DIR/.. && - git clone --depth=1 git://github.com/OpenAMP/openamp-test-scripts.git && - git clone --depth=1 git://github.com/OpenAMP/libmetal.git; - fi; - if [[ "$TARGET" == "zephyr" ]]; then - git clone --depth=1 git://github.com/zephyrproject-rtos/zephyr.git && - cd zephyr && - source zephyr-env.sh; - fi - -script: - - if [[ "$TARGET" == "linux" ]]; then - cd $TRAVIS_BUILD_DIR && - mkdir -p build-linux && - mkdir -p ../libmetal/build-linux && - cd ../libmetal/build-linux && - cmake .. && - make VERBOSE=1 DESTDIR=$(pwd) install && - cd ../../open-amp/build-linux && - cmake .. -DCMAKE_LIBRARY_PATH=${TRAVIS_BUILD_DIR}/../libmetal/build-linux/usr/local/lib -DCMAKE_INCLUDE_PATH=${TRAVIS_BUILD_DIR}/../libmetal/build-linux/usr/local/include -DWITH_APPS=on && - make VERBOSE=1 DESTDIR=$(pwd) install && - LD_LIBRARY_PATH=../../libmetal/build-linux/usr/local/lib:usr/local/lib PATH=usr/local/bin:${PATH} PROMPT="travis@.*:" python -m pytest -s ../../openamp-test-scripts/test-rpmsg.py; - fi - - if [[ "$TARGET" == "zephyr" ]]; then - mkdir -p ../open-amp/build-zephyr && - mkdir -p ../libmetal/build-zephyr && - cd ../libmetal/build-zephyr && - cmake .. -DWITH_ZEPHYR=on -DBOARD=qemu_cortex_m3 && - make && - cd ../../open-amp/build-zephyr && - cmake .. -DWITH_ZEPHYR=ON -DWITH_PROXY=OFF -DBOARD=qemu_cortex_m3 -DLIBMETAL_INCLUDE_DIR=../../libmetal/build-zephyr/lib/include -DLIBMETAL_LIB=../../libmetal/build-zephyr/lib/libmetal.a && - make VERBOSE=1; - fi - diff --git a/third-party/openamp/CMakeLists.txt b/third-party/openamp/CMakeLists.txt deleted file mode 100644 index 0c742b8f667f9aae016f4b3e698fa1868143c19c..0000000000000000000000000000000000000000 --- a/third-party/openamp/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -cmake_minimum_required (VERSION 3.0.2) -if (POLICY CMP0048) - cmake_policy(SET CMP0048 NEW) -endif() - -if (POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() - -set (OPENAMP_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") -set (OPENAMP_BIN_ROOT "${CMAKE_CURRENT_BINARY_DIR}") - -list (APPEND CMAKE_MODULE_PATH - "${CMAKE_CURRENT_SOURCE_DIR}/cmake" - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/platforms") - -include (syscheck) -project (open_amp C) - -include (CheckIncludeFiles) -include (CheckCSourceCompiles) -include (collect) -include (options) -include (depends) -enable_testing () - - -if (WITH_OBSOLETE) - add_subdirectory (obsolete) -endif (WITH_OBSOLETE) - -add_subdirectory (lib) - -if (WITH_APPS) - add_subdirectory (apps) -endif (WITH_APPS) - -# vim: expandtab:ts=2:sw=2:smartindent diff --git a/third-party/openamp/LICENSE.md b/third-party/openamp/LICENSE.md index 41a8b8ad449a13e1da6f4ea8febca984b97045e1..94a2abc869a0181c0a0d4d1bffa5724424036185 100644 --- a/third-party/openamp/LICENSE.md +++ b/third-party/openamp/LICENSE.md @@ -15,7 +15,7 @@ modification, are permitted provided that the following conditions are met: this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -3. Neither the name of nor the names of its contributors +3. Neither the name of `` nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. BSD 2-Clause License ------------------------- -Copyright (c) . All rights reserved. +Copyright (c) ` `. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -57,12 +57,47 @@ 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. +Apache License :2.0 +------------------------- + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +GPL 2.0 +------------------------- + +Copyright (C) yyyy name of author + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +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 +GNU General Public License for more details. + + Notes ========================================= Use the following tag instead of the full license text in the individual files: SPDX-License-Identifier: BSD-3-Clause SPDX-License-Identifier: BSD-2-Clause + SPDX-License-Identifier: Apache-2.0 + SPDX-License-Identifier: GPL-2.0 This enables machine processing of license information based on the SPDX License Identifiers that are here available: http://spdx.org/licenses/ diff --git a/third-party/openamp/README.md b/third-party/openamp/README.md index f983c365790324541ef3c5dd7a3c2528d114f3a2..39b97e851169baf3cf064a917de2c1b02835df45 100644 --- a/third-party/openamp/README.md +++ b/third-party/openamp/README.md @@ -11,9 +11,9 @@ enable development of software applications for Asymmetric Multiprocessing environments 3. Compatibility with upstream Linux remoteproc and rpmsg components 4. Following AMP configurations supported - a. Linux master/Generic(Baremetal) remote - b. Generic(Baremetal) master/Linux remote -5. Proxy infrastructure and supplied demos showcase ability of proxy on master + a. Linux host/Generic(Baremetal) remote + b. Generic(Baremetal) host/Linux remote +5. Proxy infrastructure and supplied demos showcase ability of proxy on host to handle printf, scanf, open, close, read, write calls from Bare metal based remote contexts. @@ -82,10 +82,13 @@ library for it project: * **WITH_PROXY** (default OFF): Include proxy support in the library. * **WITH APPS** (default OFF): Build with sample applications. * **WITH_PROXY_APPS** (default OFF):Build with proxy sample applications. -* **WITH_VIRTIO_MASTER** (default ON): Build with virtio master enabled. +* **WITH_VIRTIO_DRIVER** (default ON): Build with virtio driver enabled. This option can be set to OFF if the only the remote mode is implemented. -* **WITH_VIRTIO_SLAVE** (default ON): Build with virtio slave enabled. - This option can be set to OFF if the only the master mode is implemented. +* **WITH_VIRTIO_DEVICE** (default ON): Build with virtio device enabled. + This option can be set to OFF if the only the driver mode is implemented. +* **WITH_VQ_RX_EMPTY_NOTIFY** (default OFF): Choose notify mode. When set to + ON, only notify when there are no more Message in the RX queue. When set to + OFF, notify for each RX buffer released. * **WITH_STATIC_LIB** (default ON): Build with a static library. * **WITH_SHARED_LIB** (default ON): Build with a shared library. * **WITH_ZEPHYR** (default OFF): Build open-amp as a zephyr library. This option @@ -94,9 +97,14 @@ library for it project: enabled on vrings. * **WITH_DCACHE_BUFFERS** (default OFF): Build with data cache operations enabled on buffers. +* **WITH_DCACHE_RSC_TABLE** (default OFF): Build with data cache operations + enabled on resource table. +* **WITH_DCACHE** (default OFF): Build with all cache operations + enabled. When set to ON, cache operations for vrings, buffers and resource + table are enabled. * **RPMSG_BUFFER_SIZE** (default 512): adjust the size of the RPMsg buffers. The default value of the RPMsg size is compatible with the Linux Kernel hard - coded value. If you AMP configuration is Linux kernel master/ OpenAMP remote, + coded value. If you AMP configuration is Linux kernel host/ OpenAMP remote, this option must not be used. ### Example to compile OpenAMP for Zephyr @@ -104,43 +112,29 @@ The [Zephyr open-amp repo](https://github.com/zephyrproject-rtos/open-amp) implements the open-amp library for the Zephyr project. It is mainly a fork of this repository, with some add-ons for integration in the Zephyr project. The standard way to compile OpenAMP for a Zephyr project is to use Zephyr build -environment. Please refer to [Zephyr OpenAMP samples](https://github.com/zephyrproject-rtos/zephyr/tree/master/samples/subsys/ipc) for examples. - -Nevertheless you can compile the OpenAMP project for Zephyr. -As OpenAMP uses libmetal, please refer to libmetal README to build libmetal -for Zephyr before building OpenAMP library for Zephyr. -As Zephyr uses CMake, we build OpenAMP library as a target of Zephyr CMake -project. Here is how to build libmetal for Zephyr: -``` - $ export ZEPHRY_GCC_VARIANT=zephyr - $ export ZEPHRY_SDK_INSTALL_DIR= - $ source /zephyr-env.sh - - $ cmake \ - -DWITH_ZEPHYR=on -DBOARD=qemu_cortex_m3 \ - -DCMAKE_INCLUDE_PATH="/lib/include" \ - -DCMAKE_LIBRARY_PATH="/lib" \ - $ make VERBOSE=1 all -``` +environment. Please refer to +[Zephyr OpenAMP samples](https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/ipc) +for examples and [Zephyr documentation](https://docs.zephyrproject.org/latest/) for the build +process. ### Example to compile OpenAMP for communication between Linux processes: * Install libsysfs devel and libhugetlbfs devel packages on your Linux host. * build libmetal library on your host as follows: - - ``` - $ mkdir -p build-libmetal - $ cd build-libmetal - $ cmake - $ make VERBOSE=1 DESTDIR= install - ``` + ``` + $ mkdir -p build-libmetal + $ cd build-libmetal + $ cmake + $ make VERBOSE=1 DESTDIR= install + ``` * build OpenAMP library on your host as follows: - - $ mkdir -p build-openamp - $ cd build-openamp - $ cmake -DCMAKE_INCLUDE_PATH= \ + ``` + $ mkdir -p build-openamp + $ cd build-openamp + $ cmake -DCMAKE_INCLUDE_PATH= \ -DCMAKE_LIBRARY_PATH= [-DWITH_APPS=ON] - $ make VERBOSE=1 DESTDIR=$(pwd) install + $ make VERBOSE=1 DESTDIR=$(pwd) install + ``` The OpenAMP library will be generated to `build/usr/local/lib` directory, headers will be generated to `build/usr/local/include` directory, and the @@ -152,76 +146,74 @@ directory. your Linux host as follows: * rpmsg echo demo: - ``` - # Start echo test server to wait for message to echo - $ sudo LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib \ - build/usr/local/bin/rpmsg-echo-shared - # Run echo test to send message to echo test server - $ sudo LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib \ - build/usr/local/bin/rpmsg-echo-ping-shared 1 - ``` + ``` + # Start echo test server to wait for message to echo + $ sudo LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib \ + build/usr/local/bin/rpmsg-echo-shared + # Run echo test to send message to echo test server + $ sudo LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib \ + build/usr/local/bin/rpmsg-echo-ping-shared 1 + ``` * rpmsg echo demo with the nocopy API: - ``` - # Start echo test server to wait for message to echo - $ sudo LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib \ - build/usr/local/bin/rpmsg-nocopy-echo-shared - # Run echo test to send message to echo test server - $ sudo LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib \ - build/usr/local/bin/rpmsg-nocopy-ping-shared 1 - ``` + ``` + # Start echo test server to wait for message to echo + $ sudo LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib \ + build/usr/local/bin/rpmsg-nocopy-echo-shared + # Run echo test to send message to echo test server + $ sudo LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib \ + build/usr/local/bin/rpmsg-nocopy-ping-shared 1 + ``` ### Example to compile Zynq UltraScale+ MPSoC R5 generic(baremetal) remote: * build libmetal library on your host as follows: * Create your on cmake toolchain file to compile libmetal for your generic (baremetal) platform. Here is the example of the toolchain file: + ``` + set (CMAKE_SYSTEM_PROCESSOR "arm" CACHE STRING "") + set (MACHINE "zynqmp_r5" CACHE STRING "") - ``` - set (CMAKE_SYSTEM_PROCESSOR "arm" CACHE STRING "") - set (MACHINE "zynqmp_r5" CACHE STRING "") + set (CROSS_PREFIX "armr5-none-eabi-" CACHE STRING "") + set (CMAKE_C_FLAGS "-mfloat-abi=soft -mcpu=cortex-r5 -Wall -Werror -Wextra \ + -flto -Os -I/ws/xsdk/r5_0_bsp/psu_cortexr5_0/include" CACHE STRING "") - set (CROSS_PREFIX "armr5-none-eabi-" CACHE STRING "") - set (CMAKE_C_FLAGS "-mfloat-abi=soft -mcpu=cortex-r5 -Wall -Werror -Wextra \ - -flto -Os -I/ws/xsdk/r5_0_bsp/psu_cortexr5_0/include" CACHE STRING "") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto") + SET(CMAKE_AR "gcc-ar" CACHE STRING "") + SET(CMAKE_C_ARCHIVE_CREATE " qcs ") + SET(CMAKE_C_ARCHIVE_FINISH true) - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto") - SET(CMAKE_AR "gcc-ar" CACHE STRING "") - SET(CMAKE_C_ARCHIVE_CREATE " qcs ") - SET(CMAKE_C_ARCHIVE_FINISH true) - - include (cross-generic-gcc) - ``` + include (cross-generic-gcc) + ``` * Compile libmetal library: - - ``` - $ mkdir -p build-libmetal - $ cd build-libmetal - $ cmake -DCMAKE_TOOLCHAIN_FILE= - $ make VERBOSE=1 DESTDIR= install - ``` + ``` + $ mkdir -p build-libmetal + $ cd build-libmetal + $ cmake -DCMAKE_TOOLCHAIN_FILE= + $ make VERBOSE=1 DESTDIR= install + ``` * build OpenAMP library on your host as follows: * Create your on cmake toolchain file to compile openamp for your generic (baremetal) platform. Here is the example of the toolchain file: - ``` - set (CMAKE_SYSTEM_PROCESSOR "arm" CACHE STRING "") - set (MACHINE "zynqmp_r5" CACHE STRING "") - set (CROSS_PREFIX "armr5-none-eabi-" CACHE STRING "") - set (CMAKE_C_FLAGS "-mfloat-abi=soft -mcpu=cortex-r5 -Os -flto \ + ``` + set (CMAKE_SYSTEM_PROCESSOR "arm" CACHE STRING "") + set (MACHINE "zynqmp_r5" CACHE STRING "") + set (CROSS_PREFIX "armr5-none-eabi-" CACHE STRING "") + set (CMAKE_C_FLAGS "-mfloat-abi=soft -mcpu=cortex-r5 -Os -flto \ -I/ws/libmetal-r5-generic/usr/local/include \ -I/ws/xsdk/r5_0_bsp/psu_cortexr5_0/include" CACHE STRING "") - set (CMAKE_ASM_FLAGS "-mfloat-abi=soft -mcpu=cortex-r5" CACHE STRING "") - set (PLATFORM_LIB_DEPS "-lxil -lc -lm" CACHE STRING "") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto") - SET(CMAKE_AR "gcc-ar" CACHE STRING "") - SET(CMAKE_C_ARCHIVE_CREATE " qcs ") - SET(CMAKE_C_ARCHIVE_FINISH true) - set (CMAKE_FIND_ROOT_PATH /ws/libmetal-r5-generic/usr/local/lib \ + set (CMAKE_ASM_FLAGS "-mfloat-abi=soft -mcpu=cortex-r5" CACHE STRING "") + set (PLATFORM_LIB_DEPS "-lxil -lc -lm" CACHE STRING "") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto") + SET(CMAKE_AR "gcc-ar" CACHE STRING "") + SET(CMAKE_C_ARCHIVE_CREATE " qcs ") + SET(CMAKE_C_ARCHIVE_FINISH true) + set (CMAKE_FIND_ROOT_PATH /ws/libmetal-r5-generic/usr/local/lib \ /ws/xsdk/r5_bsp/psu_cortexr5_0/lib ) - include (cross_generic_gcc) - ``` + include (cross_generic_gcc) + ``` * We use cmake `find_path` and `find_library` to check if libmetal includes and libmetal library is in the includes and library search paths. However, @@ -229,13 +221,12 @@ directory. `CMAKE_LIBRARY_PATH` variables, and thus, we need to specify those paths in the toolchain file with `CMAKE_C_FLAGS` and `CMAKE_FIND_ROOT_PATH`. * Compile the OpenAMP library: - - ``` - $ mkdir -p build-openamp - $ cd build-openamp - $ cmake -DCMAKE_TOOLCHAIN_FILE= - $ make VERBOSE=1 DESTDIR=$(pwd) install - ``` + ``` + $ mkdir -p build-openamp + $ cd build-openamp + $ cmake -DCMAKE_TOOLCHAIN_FILE= + $ make VERBOSE=1 DESTDIR=$(pwd) install + ``` The OpenAMP library will be generated to `build/usr/local/lib` directory, headers will be generated to `build/usr/local/include` directory, and the @@ -252,23 +243,24 @@ https://github.com/OpenAMP/meta-openamp `IMAGE_INSTALL_append` in the `local.conf` file. * You can also add OpenAMP demos Linux applications packages to your yocto packages list. OpenAMP demo examples recipes are also in `meta-openamp`: - https://github.com/OpenAMP/meta-openamp/tree/master/recipes-openamp/openamp-examples + https://github.com/OpenAMP/meta-openamp/tree/master/recipes-openamp/rpmsg-examples In order to user OpenAMP(RPMsg) in Linux userspace, you will need to have put the IPI device, vring memory and shared buffer memory to your Linux kernel device tree. The device tree example can be found here: - https://github.com/OpenAMP/open-amp/blob/master/apps/machine/zynqmp/openamp-linux-userspace.dtsi + https://github.com/OpenAMP/open-amp/blob/main/apps/machine/zynqmp/openamp-linux-userspace.dtsi ## Version -The OpenAMP version follows the set of rule proposed in [Semantic Versioning specification](https://semver.org/). +The OpenAMP version follows the set of rule proposed in +[Semantic Versioning specification](https://semver.org/). ## Supported System and Machines For now, it supports: -* Zynq generic slave -* Zynq UltraScale+ MPSoC R5 generic slave +* Zynq generic remote +* Zynq UltraScale+ MPSoC R5 generic remote * Linux host OpenAMP between Linux userspace processes -* Linux userspace OpenAMP RPMsg master -* Linux userspace OpenAMP RPMsg slave +* Linux userspace OpenAMP RPMsg host +* Linux userspace OpenAMP RPMsg remote * Linux userspace OpenAMP RPMsg and MicroBlaze bare metal remote ## Known Limitations: @@ -278,47 +270,57 @@ For now, it supports: it doesn't work on some systems if you are normal users. ## How to contribute: -As an open-source project, we welcome and encourage the community to submit patches directly to the project. As a contributor you should be familiar with common developer tools such as Git and CMake, and platforms such as GitHub. +As an open-source project, we welcome and encourage the community to submit patches directly to the +project. As a contributor you should be familiar with common developer tools such as Git and CMake, +and platforms such as GitHub. Then following points should be rescpected to facilitate the review process. ### Licencing -Code is contributed to the Linux kernel under a number of licenses, but all code must be compatible with version the [BSD License](https://github.com/OpenAMP/open-amp/blob/master/LICENSE.md), which is the license covering the OpenAMP distribution as a whole. In practice, use the following tag instead of the full license text in the individual files: - - ``` - SPDX-License-Identifier: BSD-3-Clause - SPDX-License-Identifier: BSD-2-Clause - ``` +Code is contributed to the Linux kernel under a number of licenses, but all code must be compatible +with version the [BSD License](https://github.com/OpenAMP/open-amp/blob/main/LICENSE.md), which is +the license covering the OpenAMP distribution as a whole. In practice, use the following tag +instead of the full license text in the individual files: + ``` + SPDX-License-Identifier: BSD-3-Clause + SPDX-License-Identifier: BSD-2-Clause + ``` ### Signed-off-by -Commit message must contain Signed-off-by: line and your email must match the change authorship information. Make sure your .gitconfig is set up correctly: - - ``` - git config --global user.name "first-name Last-Namer" - git config --global user.email "yourmail@company.com" - ``` +Commit message must contain Signed-off-by: line and your email must match the change authorship +information. Make sure your .gitconfig is set up correctly: + ``` + git config --global user.name "first-name Last-Namer" + git config --global user.email "yourmail@company.com" + ``` ### gitlint -Before you submit a pull request to the project, verify your commit messages meet the requirements. The check can be performed locally using the the gitlint command. +Before you submit a pull request to the project, verify your commit messages meet the requirements. +The check can be performed locally using the the gitlint command. Run gitlint locally in your tree and branch where your patches have been committed: - - ```gitlint``` -Note, gitlint only checks HEAD (the most recent commit), so you should run it after each commit, or use the --commits option to specify a commit range covering all the development patches to be submitted. + ``` + gitlint + ``` +Note, gitlint only checks HEAD (the most recent commit), so you should run it after each commit, or +use the --commits option to specify a commit range covering all the development patches to be +submitted. ### Code style In general, follow the Linux kernel coding style, with the following exceptions: * Use /** */ for doxygen comments that need to appear in the documentation. -The Linux kernel GPL-licensed tool checkpatch is used to check coding style conformity.Checkpatch is available in the scripts directory. +The Linux kernel GPL-licensed tool checkpatch is used to check coding style conformity.Checkpatch is +available in the scripts directory. To check your \ commits in your git branch: - ``` - ./scripts/checkpatch.pl --strict -g HEAD- - - ``` + ``` + ./scripts/checkpatch.pl --strict -g HEAD- + ``` ### Send a pull request We use standard github mechanism for pull request. Please refer to github documentation for help. ## Communication and Collaboration -[Subscribe](https://lists.openampproject.org/mailman/listinfo/openamp-rp) to the OpenAMP mailing list(openamp-rp@lists.openampproject.org). +[Subscribe](https://lists.openampproject.org/mailman3/lists/openamp-rp.lists.openampproject.org/) to +the OpenAMP mailing list(openamp-rp@lists.openampproject.org). -For more details on the framework please refer to the the [OpenAMP wiki](https://github.com/OpenAMP/open-amp/wiki). +For more details on the framework please refer to the +[OpenAMP Docs](https://openamp.readthedocs.io/en/latest/). diff --git a/third-party/openamp/VERSION b/third-party/openamp/VERSION index 61df8f44d67c074e9e7c9704b14ac1a116229ee6..5f75d466746a95bf7f6b3b0ecb4f65be0cf36111 100644 --- a/third-party/openamp/VERSION +++ b/third-party/openamp/VERSION @@ -1,3 +1,3 @@ VERSION_MAJOR = 1 -VERSION_MINOR = 1 +VERSION_MINOR = 8 VERSION_PATCH = 0 diff --git a/third-party/openamp/doc/CMakeLists.txt b/third-party/openamp/doc/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6a28de6eb7bf1930c79965e46093ad93b0c32e70 --- /dev/null +++ b/third-party/openamp/doc/CMakeLists.txt @@ -0,0 +1,29 @@ +if (DOXYGEN_FOUND) + + if (EXISTS ${CMAKE_SOURCE_DIR}/../_doxygen/openamp/Doxyfile-openamp.in) + set (OAMP_DOX_DIR ${CMAKE_SOURCE_DIR}/../_doxygen/openamp) + configure_file (Doxyfile.in Doxyfile1 @ONLY) + configure_file (${OAMP_DOX_DIR}/Doxyfile-openamp.in Doxyfile2 @ONLY) + + add_custom_target (doc ALL + COMMAND cat Doxyfile1 Doxyfile2 >Doxyfile + COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + else () + configure_file (Doxyfile.in Doxyfile @ONLY) + + add_custom_target (doc ALL + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + endif () + +install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html + DESTINATION share/doc/${PROJECT_NAME}) +install (FILES ${PROJECT_SOURCE_DIR}/README.md + DESTINATION share/doc/${PROJECT_NAME}) +install (FILES ${PROJECT_SOURCE_DIR}/LICENSE.md + DESTINATION share/doc/${PROJECT_NAME}) + +endif (DOXYGEN_FOUND) diff --git a/third-party/openamp/doc/Doxyfile.in b/third-party/openamp/doc/Doxyfile.in new file mode 100644 index 0000000000000000000000000000000000000000..70d3953226f01435b502330ce07de8e2a2388a0e --- /dev/null +++ b/third-party/openamp/doc/Doxyfile.in @@ -0,0 +1,2385 @@ +# Doxyfile 1.8.9.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = OpenAMP Library + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems does not +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = @PROJECT_SOURCE_DIR@/README.md +INPUT += @PROJECT_SOURCE_DIR@/LICENSE.md +INPUT += @PROJECT_SOURCE_DIR@/lib + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = *.c *.h + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = README.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /