diff --git a/docs/ChangeLog.md b/docs/ChangeLog.md index 81bd5f9198a5c23e7fa4a50de80416308a2ce41f..7c60497018b6392373d3ab14be9dba0e94b87e7f 100644 --- a/docs/ChangeLog.md +++ b/docs/ChangeLog.md @@ -1,3 +1,20 @@ +# Phytium Standalone SDK 2024-07-23 ChangeLog + +Change Log since 2024-07-12 + +## example + +- modify the openamp example to support linux +- modify the openamp driver and device role + +# Phytium Standalone SDK 2024-07-12 ChangeLog + +Change Log since 2024-07-10 + +## example + +- modify the example with no device attached + # Phytium Standalone SDK 2024-07-10 ChangeLog Change Log since 2024-07-10 diff --git a/example/peripheral/can/can/src/can_id_filter_example.c b/example/peripheral/can/can/src/can_id_filter_example.c index 38ce3cba428f06ec89494c4735cc90d6be6e09d1..5477b834c50373e1dec572b3ee7c5c0c42e7b0ff 100644 --- a/example/peripheral/can/can/src/can_id_filter_example.c +++ b/example/peripheral/can/can/src/can_id_filter_example.c @@ -355,7 +355,7 @@ static FError FFreeRTOSCanSendThenRecvData(int mode) return ret; } count[instance_id]++; - + ret = CAN_UNKNOWN_STATE; /* wait recv interrupt */ xReturn = xQueueReceive(xQueue_irq, &xReceiveStructure, RECV_TIMER_OUT); if (xReturn == pdPASS) diff --git a/example/peripheral/can/can/src/can_intr_loopback_mode_example.c b/example/peripheral/can/can/src/can_intr_loopback_mode_example.c index e38530ea8bc0801f340b5865fd7d088fb773b98f..f7b59e7a9a58dbb9105950b99769d6873c75c16a 100644 --- a/example/peripheral/can/can/src/can_intr_loopback_mode_example.c +++ b/example/peripheral/can/can/src/can_intr_loopback_mode_example.c @@ -353,12 +353,13 @@ static FError FFreeRTOSCanSendThenRecvData(int ide) return ret; } count[instance_id]++; - + ret = CAN_UNKNOWN_STATE; /* wait recv interrupt */ xReturn = xQueueReceive(xQueue_irq, &xReceiveStructure, TIMER_OUT); if (xReturn == pdFAIL) { FCAN_TEST_ERROR("xQueue_irq receive timeout."); + ret = CAN_RECV_FAILURE; return ret; } diff --git a/example/peripheral/can/canfd/src/canfd_intr_loopback_mode_example.c b/example/peripheral/can/canfd/src/canfd_intr_loopback_mode_example.c index e00650cad2d9a568dcb1b81600007179c635707d..108007f547c36fa6d43f0b58ea384fd5bc82158e 100644 --- a/example/peripheral/can/canfd/src/canfd_intr_loopback_mode_example.c +++ b/example/peripheral/can/canfd/src/canfd_intr_loopback_mode_example.c @@ -344,6 +344,7 @@ static FError FFreeRTOSCanfdSendThenRecvData(int ide) if (xReturn == pdFAIL) { FCAN_TEST_ERROR("xQueue_irq receive timeout."); + ret = CANFD_RECV_FAILURE; return ret; } diff --git a/example/peripheral/dma/ddma/src/cmd_ddma.c b/example/peripheral/dma/ddma/src/cmd_ddma.c index f5d7a2975fd1ef38fc036337f4efea0fd883f157..22d11197dcc37dd5089bde16c4f14a41dc928765 100755 --- a/example/peripheral/dma/ddma/src/cmd_ddma.c +++ b/example/peripheral/dma/ddma/src/cmd_ddma.c @@ -48,7 +48,7 @@ static void DdmaCmdUsage(void) printf("ddma spi-loopback\r\n"); printf("-- Run ddma spi loopback example, default transfer 32 bytes\r\n"); printf("ddma spi-loopback N\r\n"); - printf("-- Run ddma spi loopback example, N is a number, N <= 128 =bytes, default transfer N bytes\r\n"); + printf("-- Run ddma spi loopback example, N is a number, N <= 128 =bytes, N % 4 == 0, default transfer N bytes\r\n"); } static int DdmaCmdEntry(int argc, char *argv[]) diff --git a/example/peripheral/i2s/src/i2s_example.c b/example/peripheral/i2s/src/i2s_example.c index 9c2d234cae5d806216cfe41310fb0f64bdd7eefd..9216cc4ac5ddf918b94e1fb3470c3e677f0dc74a 100644 --- a/example/peripheral/i2s/src/i2s_example.c +++ b/example/peripheral/i2s/src/i2s_example.c @@ -74,7 +74,8 @@ static FDdmaBdlDescConfig bdl_desc_config[100];/*bdl_desc_config []根据TX_RX_B static FDdmaBdlDesc *bdl_desc_list_g; #define per_buffer 16384/*录制时每个buffer的大小,单位字节*/ #define TX_RX_BUF_LEN 100* 16384/*录制时总buffer的大小,一共10个buff,单位字节*/ -static u32 data_buf = 0xa0000000; + +static u32 data_buf[TX_RX_BUF_LEN] __attribute__((aligned(FDDMA_DDR_ADDR_ALIGMENT))) = {0}; /***************** Macros (Inline Functions) Definitions *********************/ #define FI2S_DEBUG_TAG "FI2S-TRANS" #define FI2S_ERROR(format, ...) FT_DEBUG_PRINT_E(FI2S_DEBUG_TAG, format, ##__VA_ARGS__) @@ -227,7 +228,6 @@ static FError DdmaInit(void) { FDdmaClearChanIrq(ddma->ctrl.config.base_addr, chan, ddma->ctrl.config.caps); u32 status = FDdmaReadReg(ddma->ctrl.config.base_addr, FDDMA_STA_OFFSET); - } /* set BDL descriptors */ for (fsize_t loop = 0; loop < bdl_num; loop++) @@ -272,6 +272,9 @@ static FError DdmaInit(void) tx_request.valid_desc_num = bdl_num; ret = FFreeRTOSDdmaSetupBDLChannel(ddma, tx_chan_id, &tx_request); + printf("ddma id = %d, tx_chan_id = %d, rx_chan_id = %d\r\n",FDDMA2_I2S_ID, tx_chan_id, rx_chan_id); + printf("bdl_num = %d, per_buffer = %d, TX_RX_BUF_LEN = %d\r\n",bdl_num, per_buffer, TX_RX_BUF_LEN); + printf("the buffer address is %p\r\n", data_buf); if (ret != FT_SUCCESS) { FI2S_ERROR("Ddma set config failed."); diff --git a/example/peripheral/media/lvgl_demo/src/lv_demo_test.c b/example/peripheral/media/lvgl_demo/src/lv_demo_test.c index 89ec7176ccc2163d915cd6680f2a6e5515dc09e9..8ec76ed9437d8dc508304827debc332f3afae426 100644 --- a/example/peripheral/media/lvgl_demo/src/lv_demo_test.c +++ b/example/peripheral/media/lvgl_demo/src/lv_demo_test.c @@ -47,7 +47,7 @@ #define FMEDIA_EVT_INTR(index) BIT(index) #define FMEDIA_CHANNEL_0 0 #define FMEDIA_CHANNEL_1 1 -static u8 *static_frame_buffer_address = (u8 *)0xa0000000 ; +static u8 static_frame_buffer_address[1920 * 1080 * 4] __attribute__((aligned(128))) = {0};/*Framebuffer 大小 (字节) = 屏幕宽度 (像素) × 屏幕高度 (像素) × 每像素位数 (bpp) / 8*/ static EventGroupHandle_t media_event = NULL; static FFreeRTOSMedia os_media; /**********************Macros (Inline Functions) Definitions *********************/ diff --git a/example/peripheral/media/lvgl_indev/src/lv_indev_test.c b/example/peripheral/media/lvgl_indev/src/lv_indev_test.c index 493542eb2376dc3200d559a99ba3e92587eafef4..30c8f71371dcae0eaacc147f4da7d108e2d973d8 100644 --- a/example/peripheral/media/lvgl_indev/src/lv_indev_test.c +++ b/example/peripheral/media/lvgl_indev/src/lv_indev_test.c @@ -50,7 +50,7 @@ static FFreeRTOSMedia os_media; static EventGroupHandle_t media_event = NULL; -static u8 *static_frame_buffer_address = (u8 *)0xa0000000 ; +static u8 static_frame_buffer_address[1920 * 1080 * 4] __attribute__((aligned(128))) = {0};/*Framebuffer 大小 (字节) = 屏幕宽度 (像素) × 屏幕高度 (像素) × 每像素位数 (bpp) / 8*/ /************************** functions Definitions *****************************/ static void FFreeRTOSMediaSendEvent(u32 evt_bits) { diff --git a/example/peripheral/media/lvgl_ui/src/lv_indev_test.c b/example/peripheral/media/lvgl_ui/src/lv_indev_test.c index 16c4d47042ec367d7704edf157ca46ce7cbca0aa..38ddc78f05d1f05975d0976aed9a6cb4b3426138 100644 --- a/example/peripheral/media/lvgl_ui/src/lv_indev_test.c +++ b/example/peripheral/media/lvgl_ui/src/lv_indev_test.c @@ -50,7 +50,7 @@ static FFreeRTOSMedia os_media; static EventGroupHandle_t media_event = NULL; -static u8 *static_frame_buffer_address = (u8 *)0xa0000000 ; +static u8 static_frame_buffer_address[1920 * 1080 * 4] __attribute__((aligned(128))) = {0};/*Framebuffer 大小 (字节) = 屏幕宽度 (像素) × 屏幕高度 (像素) × 每像素位数 (bpp) / 8*/ /************************** functions Definitions *****************************/ static void FFreeRTOSMediaSendEvent(u32 evt_bits) { diff --git a/example/peripheral/media/media_test/src/media_example.c b/example/peripheral/media/media_test/src/media_example.c index 832daea4b4863629f2a53b74fe0a309fba914d6f..748e957a1821ccc48679e6e67be92061a1721056 100644 --- a/example/peripheral/media/media_test/src/media_example.c +++ b/example/peripheral/media/media_test/src/media_example.c @@ -55,7 +55,7 @@ static FFreeRTOSMedia os_media; static EventGroupHandle_t media_event = NULL; static GraphicsTest blt_buffer; -static u8 *static_frame_buffer_address = (u8 *)0xa0000000 ; +static u8 static_frame_buffer_address[1920 * 1080 * 4] __attribute__((aligned(128))) = {0};/*Framebuffer 大小 (字节) = 屏幕宽度 (像素) × 屏幕高度 (像素) × 每像素位数 (bpp) / 8*/ /************************** Function Prototypes ******************************/ static void FFreeRTOSMediaSendEvent(u32 evt_bits) { diff --git a/example/peripheral/spi/README.md b/example/peripheral/spi/README.md index 03a59a1a9d9e21a2084a6607ca4e8ecb7391204b..4beb2536cd92d15cbf92aab0d08d83008b8eb222 100644 --- a/example/peripheral/spi/README.md +++ b/example/peripheral/spi/README.md @@ -9,7 +9,7 @@ ## 2. 如何使用例程 本例程需要用到 -- Phytium开发板(E2000D/E2000Q/FT2000-4/D2000/PhytiumPi) +- Phytium开发板(E2000D/E2000Q/PhytiumPi) - [Phytium FreeRTOS SDK](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk) - [Phytium Standalone SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) - Flash芯片 @@ -18,14 +18,12 @@ 本例程支持的硬件平台包括 -- E2000D,E2000Q,FT2000/4,D2000,PhytiumPi +- E2000D,E2000Q,PhytiumPi 对应的配置项是, - CONFIG_TARGET_E2000D - CONFIG_TARGET_E2000Q -- CONFIG_TARGET_FT2004 -- CONFIG_TARGET_D2000 - CONFIG_TARGET_PHYTIUMPI ### 2.1.1 E2000 diff --git a/example/system/amp/README.md b/example/system/amp/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c7847098b18408caad49de3f3db1fde08fea9ec5 --- /dev/null +++ b/example/system/amp/README.md @@ -0,0 +1,35 @@ +# 多元异构系统部署 + +## 1. 例程介绍 + +> ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作 `
` + +1. 随着硬件技术的快速发展,嵌入式芯片的硬件能力越来越强大,从单核到多核、从多核到异构多核,为在一个片上系统(SoC)中部署多个OS提供了坚实的物理基础。多元异构系统部署是为了在多核片上实现多个操作系统镜像打包并同时运行,包含了裸机、freertos等多种实现形态。不同的形态有各自的特点,例如裸机可以得到最佳的性能、嵌入式系统具有更好的易用性与灵活性等等。实践中也往往需要将不同形态根据用户的需求构建选项(芯片类型,功能特性等等),创建出定制化的镜像文件。 +2. 部署方案可以在飞腾E2000Q/D系列,PHYTIUMPI,D2000上进行部署操作,但例程实际是否可运行需要具体到芯片是否支持,可以查阅例程目录的 ./configs 配置项 +3. 部署方案可以指定程序运行在那个核心,所以也支持单例程任务镜像运行在设定核心(特别是E2000Q、PHYTIUMPI这类大小核心配置,boot启动运行默认在小核心,但是需要程序运行在大核的需求)。 +4. 通过多重打包技术,可以将不同形态的程序打包到一个镜像文件中。 +5. 适配openamp的动态加载过程,可以实现openamp生命周期管理,动态加载镜像文件,并在运行过程中动态加载用户态程序。 +6. 自由组合,可以自由组合不同形态的程序,例如将裸机程序、freertos程序、linux程序等等同时运行在同一个CPU上。 + +> 注:目前freertos 1个例程 `openamp` 支持(更多例程可参阅裸机standalone [Phytium-Standalone-SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk)),`openamp_for_linux` 暂时需要分开生成单个镜像用于linux系统加载。 + +7. 例程介绍: + +- `openamp`:本例程演示了如何使用openamp库在多核片上运行。 +- `openamp_for_linux`:本例程演示了如何使用编译好的基于freertos的 openamp例程镜像,在linux系统加载下运行(需要linux系统支持)。 + +> 注:建议学习顺序:先裸机standalone,再freertos,最后linux。 + +## 2. 资源分配 + +主要集中在common文件中,以使用openamp库的例程为例,包含三个文件: + +- `libmetal_configs.h`:包含了libmetal库的配置,如Device name、irq_info等。 +- `memory_layout.h`:包含了openamp多核在系统内存分配,如共享内存位置、内存属性、资源表位置、vrings传输通道等。 +- `openamp_configs.h`:包含了openamp库的配置,如rpmsg的name service、address等。 + +## 3. 构建方式 + +- 参阅裸机standalone [Phytium-Standalone-SDK](https://gitee.com/phytium_embedded/phytium-standalone-sdk) +- 文档路径:`/example/system/amp/README.md` +- 编译命令见具体例程的README.md文件 diff --git a/example/system/amp/openamp/README.md b/example/system/amp/openamp/README.md index 6a1913718ed545e6b859210cd9c14daa87b4b4ec..02dc1526a5c2225e62eb6681288f9831421d0a9e 100644 --- a/example/system/amp/openamp/README.md +++ b/example/system/amp/openamp/README.md @@ -1,229 +1,3 @@ -# OPENAMP 测试 +# AMP 多元异构系统部署 -## 1. 例程介绍 - -> ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作 `
` - -- OpenAMP(Open Asymmetric Multi-processing) 是一个软件架构,为多核之间非对称运行提供软件支持 。 - -### 1.1 OpenAMP 提供了以下关键特性 - -1. 提供生命周期管理 -2. 兼容裸跑、RTOS等不同的软件环境 -3. 当前此目录不兼容linux系统中的 remoteproc, rpmsg and VirtIO 模块,兼容版本已经移动至openamp_for_linux目录中 - -### 1.2 OpenAMP组件 - -1. RPMsg (Remote Processor Messaging) -2. VirtIO (Virtualization Module) -3. remoteproc - -### 1.3 driver_core与device_core - -- 本例程基于开源openamp项目 - [OpenAMP](https://github.com/OpenAMP/open-amp.git) - -1. 例程结构介绍(与裸机类似): - -- 本例程主要提供了D2000/FT2004/E2000/firefly开发板 freertos与freertos之间的测试例程,也很容易实现freertos与裸机。 -- 角色介绍:管理核作为交互管理的核心,主要进行任务分配,也承担一部分的任务反馈功能,性能核作为任务的运算执行核心,主要承担接受管理核的指令和任务运算的工作。 -- 本例程中 `driver_core` 目录下的程序为管理核程序、`device_core`目录下为性能核程序。管理核程序功能为初始化创建platform和rpmsg_device(主VIRTIO_DEV_MASTER),创建成功后,创建管理endpoint节点与性能核构建通信机制。性能核功能为初始化创建platform和与管理核绑定的rpmsg_device(从VIRTIO_DEV_SLAVE),创建成功后,创建监听endpoint节点接收管理核的命令来运行相关的例程。 -- 创建流程以及参考文档 - -remoteproc-design: - [remoteproc-design](../../../../standalone/third-party/openamp/docs/remoteproc-design.md) - -rpmsg-design: - [rpmsg-design](../../../../standalone/third-party/openamp/docs/rpmsg-design.md) - -OpenAMP回调与中断通知机制: - ![OpenAMP回调与中断通知机制](./figs/OpenAMP回调与中断通知机制.svg) - -openamp初始化运行图: - ![openamp运行图](./figs/openamp运行图.svg) - -2.demo介绍: - -- demo1:管理核rpmsg-echo.c与性能核rpmsg-ping.c - -- demo2:管理核rpmsg-sample-echo.c与性能核rpmsg-sample-ping.c - -- demo3:管理核matrix_multiplyd.c与性能核matrix_multiply.c - -- demo4:管理核rpmsg-nocopy-echo.c与性能核rpmsg-nocopy-ping.c - -具体功能可以阅读 管理核`driver_core`对应.c文件的头描述 Description - -## 2. 如何使用例程 - -> 描述开发平台准备,使用例程配置,构建和下载镜像的过程
- -### 2.1 硬件配置方法 - -> 哪些硬件平台是支持的,需要哪些外设,例程与开发板哪些IO口相关等(建议附录开发板照片,展示哪些IO口被引出)
- -1. 准备一块d2000 或者 E2000Q/D 或者 firefly 或者FT2004开发板 -2. 将串口连接好电脑,波特率设为 115200-8-1-N - -### 2.2 SDK配置方法 - -> 依赖哪些驱动、库和第三方组件,如何完成配置(列出需要使能的关键配置项)
- -- 本例子已经提供好具体的编译指令,以下进行介绍(快速测试,使用默认部署请看2.4): - - 1. make clean_driver_core 将./driver_core 目录下的工程进行清理 - 2. make clean_device_core 将./device_core 目录下的工程进行清理 - 3. make config_d2000_aarch64 将预设64bit d2000 下的配置分别加载至 ./driver_core ./device_core - 4. make config_d2000_aarch32 将预设32bit d2000 下的配置分别加载至 ./driver_core ./device_core - 5. make config_ft2004_aarch64 将预设64bit ft2004 下的配置分别加载至 ./driver_core ./device_core - 6. make config_ft2004_aarch32 将预设32bit ft2004 下的配置分别加载至 ./driver_core ./device_core - 7. make config_e2000d_aarch64 将预设64bit e2000d 下的配置分别加载至 ./driver_core ./device_core - 8. make config_e2000d_aarch32 将预设32bit e2000d 下的配置分别加载至 ./driver_core ./device_core - 9. make config_e2000q_aarch64 将预设64bit e2000q 下的配置分别加载至 ./driver_core ./device_core - 10. make config_e2000q_aarch32 将预设32bit e2000q 下的配置分别加载至 ./driver_core ./device_core - 11. make config_phytiumpi_aarch64 将预设64bit phytiumpi 下的配置分别加载至 ./driver_core ./device_core - 12. make config_phytiumpi_aarch32 将预设32bit phytiumpi 下的配置分别加载至 ./driver_core ./device_core - 13. make menuconfig_driver_core 配置 ./driver_core 目录下的配置变量 - 14. make menuconfig_device_core 配置 ./device_core 目录下的配置变量 - 15. make backupconfig 将 ./driver_core ./device_core 的当前配置保存为 config 文件 - 16. make clean 清理 ./driver_core ./device_core 下的编译结果 - 17. make image 将 ./driver_core ./device_core 下的工程清理、编译并将目录下的编译后的 .elf 文件复制到目标路径下 - -- 具体使用方法为: - - - 在 /example/system/amp/openamp 下 - - 执行以上指令 - -### 2.3 构建和下载 - -> 描述构建、烧录下载镜像的过程,列出相关的命令
- -#### OpenAMP 配置 - -以 driver_core 管理核为例:` make menuconfig_driver_core ` - -![OpenAMP配置](./figs/OpenAmpConfig.png) - -#### driver_core 构建配置 - -e2000d driver_core配置,`Destination CPU id`=1设置启动core1核心(自身运行在core0),`Destination IPI cpu mask` = 2 表示 1 << `Destination CPU id` - -![driver_core构建](figs/driver_core_BUILD_.png) - -e2000q driver_core配置,`Destination CPU id`=3设置启动core3核心(小核)(自身运行在core2(小核)),`Destination IPI cpu mask` = 8 表示 1 << `Destination CPU id` - -![20240307172016](./figs/20240307172016.png) - -#### device_core 构建配置 - -以 device_core 性能核为例:` make menuconfig_device_core ` - -e2000d device_core配置,上面e2000q driver_core运行在core0,所以`Destination CPU id` = 0,`Destination IPI mask` = 1 表示 1 << `Destination CPU id` - -![device_core构建](figs/device_core_BUILD_.png) - -e2000q device_core配置,上面e2000q driver_core运行在core2,所以`Destination CPU id` = 2,`Destination IPI mask` = 4 表示 1 << `Destination CPU id` - -![20240307172429](./figs/20240307172429.png) - -aarch32状态下还需要在 device_core 的 config 中关闭 CONFIG_USE_AARCH64_L1_TO_AARCH32 选项: - -![20240307172837](./figs/20240307172837.png) - -device_core 的 elf 文件加载地址需要修改为 0xe0100000 : - -![20240307172918](./figs/20240307172918.png) - -- Remoteproc use ipi : 使用ipi 中断模式进行提醒 -- Openamp resource address : OpenAMP 中共享资源表中地址 -- Vring tx address : 共享发送缓冲区的起始地址,同时也是共享buffer 区域的起始地址 -- Vring rx address : 共享接收缓冲区的起始地址 -- table of base physical address of each of the pages in the I/O region : 用于核心间提醒机制的共享内存初始点 -- DEBUG_CODE : 增加裸跑shell 功能 -- Destination CPU communication mask : 主核心用于唤醒从核的掩码 -- Destination IPI mask : ipi 中断中,用于唤醒其他核心的掩码 -- Spin-lock shared memory : 互斥锁中关注的共享内存 -- Select mem default attribute : 提供内存属性选择 - -### 2.4 输出与实验现象 - -> 描述输入输出情况,列出存在哪些输入,对应的输出是什么(建议附录相关现象图片)
- -#### aarch32 裸跑程序测试 (rtos间) - -以E2000D为例 - -1. 在编译环境下,切换至 phytium-free-rtos-sdk/example/system/amp/openamp 目录 - 1.1 输入 'make config_e2000d_aarch32' 加载默认配置信息 - 1.2 输入 'make clean' 清理 ./driver_core ./device_core 下的编译结果 - 1.3 输入 'make image' 编译driver_core / device_core 代码,生成对应的elf 文件,并拷贝至 tftp 目录下 - 1.4 先将 ./driver_core/makefile 与 ./device_core/makefile 中 的 USR_BOOT_DIR 修改为您的 tftp 所覆盖的目录 - -2. 使用串口连接E2000开发板 ,并且打开串口终端工具 - 2.1 复位开发板之后,将E2000开发板的网络与tftp 服务器在同一局域网中 - 2.2 在板子串口终端工具下输入以下命令 - -``` - setenv ipaddr 192.168.4.20 - setenv serverip 192.168.4.50 - setenv gatewayip 192.168.4.1 - tftpboot f0000000 openamp_driver_core.elf - tftpboot f1000000 openamp_device_core.elf - bootelf -p f0000000 -``` - -- 2.3 会显示如下内容 - -![E2000D_aarch32_openamp_startup](./figs/E2000D_aarch32_openamp_startup.png) - -- 2.4 输入 'openamp auto' 运行openamp 测试程序 -- 2.5 结果显示为(openamp和libmetal版本号可能存在区别) - -![aarch32运行结果](figs/aarch32_runtime.png) -![aarch32运行结果](figs/aarch32_runtime1.png) - -#### aarch64 裸跑程序测试 (rtos间) - -以E2000D为例 - -1. 在编译环境下,切换至 phytium-standalone-sdk/example/system/amp/openamp 目录 - 1.1 输入 'make config_e2000d_aarch64' 加载默认配置信息 - 1.2 输入 'make clean' 清理 ./driver_core ./device_core 下的编译结果 - 1.3 输入 'make image' 编译driver_core / device_core 代码,生成对应的elf 文件,并拷贝至 tftp 目录下 - 1.4 先将 ./driver_core/makefile 与 ./device_core/makefile 中 的 USR_BOOT_DIR 修改为您的tftp 所覆盖的目录 - -2. 使用串口连接E2000开发板 ,并且打开串口终端工具 - 2.1 复位开发板之后,将E2000开发板的网络与tftp 服务器在同一局域网中 - 2.2 在板子串口终端工具下输入以下命令 - -``` - setenv ipaddr 192.168.4.20 ; - setenv serverip 192.168.4.50; - setenv gatewayip 192.168.4.1; - tftpboot f0000000 openamp_driver_core.elf; - tftpboot f1000000 openamp_device_core.elf; - bootelf -p f0000000 -``` - -- 2.3 会显示如下内容 - -![E2000D_aarch64_openamp_startup](./figs/E2000D_aarch64_openamp_startup.png) - -- 2.4 输入 'openamp auto' 运行openamp 测试程序 -- 2.5 结果显示为(openamp和libmetal版本号可能存在区别) - -![aarch64_runtime](figs/aarch64_runtime.png) -![aarch64_runtime](figs/aarch64_runtime1.png) - -## 3. 如何解决问题 (Q&A) - -> 主要记录使用例程中可能会遇到的问题,给出相应的解决方案 - -## 4. 修改历史记录 - -> 记录例程的重大修改记录,标明修改发生的版本号 - -- 2021-03-21 :v0.1.0 初始化项目 -- 2023-03-09 : v0.2.0 增加对e2000 的支持 -- 2023-10-26 : v0.3.0 openamp所以测试例程适配 -- 2024-03-07 :v0.3.1 修复命令错误描述 \ No newline at end of file +请进入`driver_core`目录,此目录存放了多元异构系统部署的核心代码以及主要文档。 diff --git a/example/system/amp/openamp/common/libmetal_configs.h b/example/system/amp/openamp/common/libmetal_configs.h new file mode 100644 index 0000000000000000000000000000000000000000..35bf28d6f4da8002e342e9e1e3a62efdde1702d6 --- /dev/null +++ b/example/system/amp/openamp/common/libmetal_configs.h @@ -0,0 +1,50 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: libmetal_configs.h + * Created Date: 2024-05-17 10:18:19 + * Last Modified: 2024-07-15 18:44:39 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + * 1.0 liusm 2024-05-17 first version + */ + +#ifndef LIBMETAL_CONFIGS_H +#define LIBMETAL_CONFIGS_H + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include +#include +#include + +#define KICK_BUS_NAME "generic" +#define KICK_SGI_NUM_1 1 +#define KICK_SGI_NUM_2 2 +#define KICK_SGI_NUM_3 3 +#define KICK_SGI_NUM_4 4 +/* device name for slave 00 */ +#define SLAVE_00_KICK_DEV_NAME "slave_00_kick" +#define SLAVE_00_SGI KICK_SGI_NUM_1 + +#ifdef __cplusplus +} +#endif + +#endif /* LIBMETAL_CONFIGS_H */ diff --git a/example/system/amp/openamp/common/memory_layout.h b/example/system/amp/openamp/common/memory_layout.h new file mode 100644 index 0000000000000000000000000000000000000000..3cb51f7d3b2b8e8bd9d8aae761692a211a4c90b6 --- /dev/null +++ b/example/system/amp/openamp/common/memory_layout.h @@ -0,0 +1,56 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: memory_layout.h + * Created Date: 2024-04-29 14:22:47 + * Last Modified: 2024-07-22 17:01:37 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + * 1.0 liusm 2024-05-17 first version + */ + +#ifndef MEMORY_LAYOUT_H +#define MEMORY_LAYOUT_H + + + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*slave core0*/ +#define SLAVE00_IMAGE_NUM 0 /*镜像位置与amp_config.json中编译排序对应*/ +#define SLAVE00_SOURCE_TABLE_ADDR 0xc0000000 +#define SLAVE00_SOURCE_TABLE_SIZE SLAVE00_KICK_IO_ADDR - SLAVE00_SOURCE_TABLE_ADDR +#define SLAVE00_KICK_IO_ADDR 0xc0020000 +#define SLAVE00_KICK_IO_SIZE SLAVE00_SHARE_MEM_ADDR - SLAVE00_KICK_IO_ADDR +/* MEM = |tx vring|rx vring|share buffer| */ +#define SLAVE00_SHARE_MEM_ADDR 0xc1000000 +#define SLAVE00_SHARE_MEM_SIZE 0x1000000 +#define SLAVE00_VRING_SIZE (SLAVE00_SHARE_MEM_SIZE >> 2) +#define SLAVE00_VRING_NUM 0x100 +#define SLAVE00_TX_VRING_ADDR 0xc1000000 +#define SLAVE00_RX_VRING_ADDR (SLAVE00_TX_VRING_ADDR + SLAVE00_VRING_SIZE/2) + +#define SLAVE00_SOURCE_TABLE_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_RW) +#define SLAVE00_SHARE_BUFFER_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_RW) + +#ifdef __cplusplus +} +#endif + +#endif /* MEMORY_LAYOUT_H */ diff --git a/example/system/amp/openamp/common/openamp_configs.h b/example/system/amp/openamp/common/openamp_configs.h new file mode 100644 index 0000000000000000000000000000000000000000..3be1b14db5f8df468cdb822fbe4b87dbc6585b1f --- /dev/null +++ b/example/system/amp/openamp/common/openamp_configs.h @@ -0,0 +1,59 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: openamp_configs.h + * Created Date: 2024-05-06 19:20:51 + * Last Modified: 2024-07-22 14:49:16 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + * 1.0 liusm 2024-05-17 first version + */ + +#ifndef OPENAMP_CONFIGS_H +#define OPENAMP_CONFIGS_H + +#include "fmmu.h" +#include "memory_layout.h" +#include "sdkconfig.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +/*记录当前系统中有多少个remoteproc设备*/ +static u32 remoteproc_online_mask = 0 ; + +#define MASTER_DRIVER_EPT_ADDR (0x3 + 1024) +#define SLAVE_DEVICE_00_EPT_ADDR (0x4 + 1024) + +#define RPMSG_SERVICE_00_NAME "rpmsg_service_name_00" + +/* 从核发送消息时,需要指定发送的cpu的核号,用来确定软件中断的发送到哪个核上 */ +#ifdef CONFIG_TARGET_E2000D +#define MASTER_DRIVER_CORE 1 /* 与amp_config.json中的管理(主)核配置保持一致 */ +#else +#define MASTER_DRIVER_CORE 2 /* 与amp_config.json中的管理(主)核配置保持一致 */ +#endif +/* 主核给从核发送消息时,需要指定接收的cpu的核号,用来确定软件中断的发送到哪个核上,以及主核指定启动镜像在那个核心上运行 */ +#define SLAVE_DEVICE_CORE_00 0 + +#ifdef __cplusplus +} +#endif + +#endif /* OPENAMP_CONFIGS_H */ + diff --git a/example/system/amp/openamp/device_core/Kconfig b/example/system/amp/openamp/device_core/Kconfig index c6ce31355234e67da138f9ce033e790cf80e3253..eac6e5776e68e1722896aed14767b4a2c675977f 100644 --- a/example/system/amp/openamp/device_core/Kconfig +++ b/example/system/amp/openamp/device_core/Kconfig @@ -6,32 +6,4 @@ mainmenu "Phytium FreeRTOS Configuration" - menu "Project Configuration" - - menu "Amp Config" - - config IPI_IRQ_NUM - int "Communication interruption number between multiple cores" - default 0 - - config IPI_IRQ_NUM_PRIORITY - int "Priority of internuclear communication interruption" - default 1 - - config SPIN_MEM - hex "Spin-lock shared memory" - default 0x80000000 - - config IPI_CHN_BITMASK - int "Destination IPI mask" - default 2 - help - Each bit represents a CPU, for example, 0x3 represents CPU 0 and CPU 3 in the code. - - - endmenu - -endmenu - source "$(SDK_DIR)/../freertos.kconfig" - diff --git a/example/system/amp/openamp/device_core/configs/d2000_aarch32_test_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/d2000_aarch32_test_openamp_device_core.config index 93daa0fe01bb6ea0f454040c8b19a7d2b3b1930f..2c1ee11ea2a15c7a7c5bde0d6964e72795b60220 100644 --- a/example/system/amp/openamp/device_core/configs/d2000_aarch32_test_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/d2000_aarch32_test_openamp_device_core.config @@ -1,18 +1,3 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=1 -# end of Amp Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -116,12 +101,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -325,21 +304,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/device_core/configs/d2000_aarch64_test_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/d2000_aarch64_test_openamp_device_core.config index f6e82e6573c4ff15b9e31995aa9ce068ded0b906..0f0b2fbd0594d532ac2a2cc5c6916b37ff64e834 100644 --- a/example/system/amp/openamp/device_core/configs/d2000_aarch64_test_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/d2000_aarch64_test_openamp_device_core.config @@ -1,18 +1,3 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=1 -# end of Amp Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -110,12 +95,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -314,21 +293,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/device_core/configs/e2000d_aarch32_demo_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/e2000d_aarch32_demo_openamp_device_core.config index af43e7be3a2cd91756fcb52ac207c8254f7c4078..24bb819cd98bea3ba41ed2029077a5077005acb0 100644 --- a/example/system/amp/openamp/device_core/configs/e2000d_aarch32_demo_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/e2000d_aarch32_demo_openamp_device_core.config @@ -1,18 +1,3 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=1 -# end of Amp Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -129,12 +114,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -338,21 +317,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/device_core/configs/e2000d_aarch64_demo_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/e2000d_aarch64_demo_openamp_device_core.config index 4509af93efad9e937089dde75b73efa50f6bbea4..1b726a00ae71d5ba9052507fe4152bbb552aedc2 100644 --- a/example/system/amp/openamp/device_core/configs/e2000d_aarch64_demo_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/e2000d_aarch64_demo_openamp_device_core.config @@ -1,18 +1,3 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=1 -# end of Amp Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -123,12 +108,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -327,21 +306,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/device_core/configs/e2000q_aarch32_demo_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/e2000q_aarch32_demo_openamp_device_core.config index c42b68abd334ff748c15dadeb2ed0a5a60567a47..30481f99d968a8bf0ab525149a1d6bf1cca72c7e 100644 --- a/example/system/amp/openamp/device_core/configs/e2000q_aarch32_demo_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/e2000q_aarch32_demo_openamp_device_core.config @@ -1,18 +1,3 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=4 -# end of Amp Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -128,12 +113,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -337,21 +316,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/device_core/configs/e2000q_aarch64_demo_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/e2000q_aarch64_demo_openamp_device_core.config index a7670293f1ee99e7e230580ff2e6ed2505d7ff6f..aa9b0e71317569abbca3c36737e420eead5e6394 100644 --- a/example/system/amp/openamp/device_core/configs/e2000q_aarch64_demo_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/e2000q_aarch64_demo_openamp_device_core.config @@ -1,18 +1,3 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=4 -# end of Amp Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -122,12 +107,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -218,7 +197,7 @@ CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 CONFIG_IMAGE_MAX_LENGTH=0x2000000 CONFIG_HEAP_SIZE=1 -CONFIG_STACK_SIZE=0x400 +CONFIG_STACK_SIZE=0x4000 # end of Linker Options # end of Build setup @@ -326,21 +305,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/device_core/configs/ft2004_aarch32_dsk_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/ft2004_aarch32_dsk_openamp_device_core.config deleted file mode 100644 index d36932a8f522f4833d410f3de1218c9ee518ea4a..0000000000000000000000000000000000000000 --- a/example/system/amp/openamp/device_core/configs/ft2004_aarch32_dsk_openamp_device_core.config +++ /dev/null @@ -1,381 +0,0 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=1 -# end of Amp Config -# end of Project Configuration - -CONFIG_USE_FREERTOS=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_L3CACHE is not set -# CONFIG_USE_AARCH64_L1_TO_AARCH32 is not set -# 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_E2000D is not set -# CONFIG_TARGET_E2000S is not set -CONFIG_TARGET_FT2004=y -# CONFIG_TARGET_D2000 is not set -# CONFIG_TARGET_PD2308 is not set -CONFIG_SOC_NAME="ft2004" -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_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="dsk" -CONFIG_FT2004_DSK_BOARD=y - -# -# IO mux configuration when board start up -# -# CONFIG_CUS_DEMO_BOARD is not set - -# -# Build project name -# -CONFIG_TARGET_NAME="openamp_device_core" -# end of Build project name -# end of Board Configuration - -# -# Sdk common configuration -# -CONFIG_ELOG_LINE_BUF_SIZE=0x100 -CONFIG_LOG_VERBOS=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set -# CONFIG_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 -# end of Sdk common configuration - -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - -# -# Drivers configuration -# -CONFIG_USE_IOMUX=y -CONFIG_ENABLE_IOCTRL=y -# CONFIG_ENABLE_IOPAD is not set -# 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_USB 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_SCMI_MHU is not set -# CONFIG_USE_I2S is not set -# CONFIG_USE_I3C is not set -# end of Drivers 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 is not set -# 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=0xe0100000 -CONFIG_IMAGE_MAX_LENGTH=0x2000000 -CONFIG_HEAP_SIZE=1 -CONFIG_SVC_STACK_SIZE=0x1000 -CONFIG_SYS_STACK_SIZE=0x1000 -CONFIG_IRQ_STACK_SIZE=0x1000 -CONFIG_ABORT_STACK_SIZE=0x1000 -CONFIG_FIQ_STACK_SIZE=0x1000 -CONFIG_UNDEF_STACK_SIZE=0x1000 -# end of Linker Options -# end of Build setup - -# -# Component Configuration -# - -# -# Freertos Uart Drivers -# -CONFIG_FREERTOS_USE_UART=y -# end of Freertos Uart Drivers - -# -# Freertos Pwm Drivers -# -# CONFIG_FREERTOS_USE_PWM is not set -# end of Freertos Pwm Drivers - -# -# Freertos Qspi Drivers -# -# CONFIG_FREERTOS_USE_QSPI is not set -# end of Freertos Qspi Drivers - -# -# Freertos Wdt Drivers -# -# CONFIG_FREERTOS_USE_WDT is not set -# end of Freertos Wdt Drivers - -# -# Freertos Eth Drivers -# -# CONFIG_FREERTOS_USE_XMAC is not set -# CONFIG_FREERTOS_USE_GMAC is not set -# end of Freertos Eth Drivers - -# -# Freertos Spim Drivers -# -# CONFIG_FREERTOS_USE_FSPIM is not set -# end of Freertos Spim Drivers - -# -# Freertos DMA Drivers -# -# CONFIG_FREERTOS_USE_FDDMA is not set -# CONFIG_FREERTOS_USE_FGDMA is not set -# end of Freertos DMA Drivers - -# -# Freertos Adc Drivers -# -# CONFIG_FREERTOS_USE_ADC is not set -# end of Freertos Adc Drivers - -# -# Freertos Can Drivers -# -# CONFIG_FREERTOS_USE_CAN is not set -# end of Freertos Can Drivers - -# -# Freertos I2c Drivers -# -# CONFIG_FREERTOS_USE_I2C is not set -# end of Freertos I2c Drivers - -# -# Freertos Mio Drivers -# -# CONFIG_FREERTOS_USE_MIO is not set -# end of Freertos Mio Drivers - -# -# Freertos Timer Drivers -# -# CONFIG_FREERTOS_USE_TIMER is not set -# end of Freertos Timer Drivers - -# -# Freertos Media Drivers -# -# CONFIG_FREERTOS_USE_MEDIA is not set -# end of Freertos Media Drivers - -# -# Freertos I2s Drivers -# -# CONFIG_FREERTOS_USE_I2S is not set -# end of Freertos I2s Drivers -# end of Component Configuration - -# -# Third-party configuration -# -# CONFIG_USE_LWIP is not set -# CONFIG_USE_LETTER_SHELL is not set -CONFIG_USE_AMP=y -CONFIG_USE_LIBMETAL=y - -# -# OpenAmp -# -CONFIG_USE_OPENAMP=y -CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 -# CONFIG_SKIP_SHBUF_IO_WRITE is not set -# CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config -# end of OpenAmp - -# CONFIG_USE_YMODEM is not set -# CONFIG_USE_SFUD is not set -CONFIG_USE_BACKTRACE=y -# CONFIG_USE_FATFS_0_1_4 is not set -# CONFIG_USE_TLSF 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_CHERRY_USB is not set -# CONFIG_USE_FSL_SDMMC is not set -# CONFIG_USE_FSL_WIFI is not set -# end of Third-party configuration - -# -# FreeRTOS Kernel Configuration -# -CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y -CONFIG_FREERTOS_HZ=1000 -CONFIG_FREERTOS_MAX_PRIORITIES=32 -CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=13 -CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=11 -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_MINIMAL_TASK_STACKSIZE=1024 -CONFIG_FREERTOS_MAX_TASK_NAME_LEN=32 -CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 -CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 -CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 -CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y -CONFIG_FREERTOS_USE_TRACE_FACILITY=y -CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y -# CONFIG_FREERTOS_USE_TICKLESS_IDLE is not set -CONFIG_FREERTOS_TOTAL_HEAP_SIZE=10240 -CONFIG_FREERTOS_TASK_FPU_SUPPORT=1 -# CONFIG_FREERTOS_USE_POSIX is not set -# end of FreeRTOS Kernel Configuration diff --git a/example/system/amp/openamp/device_core/configs/ft2004_aarch64_dsk_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/ft2004_aarch64_dsk_openamp_device_core.config deleted file mode 100644 index 8d4acbfcd98ab32ad40dbe6efff4cef87458cb32..0000000000000000000000000000000000000000 --- a/example/system/amp/openamp/device_core/configs/ft2004_aarch64_dsk_openamp_device_core.config +++ /dev/null @@ -1,370 +0,0 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=1 -# end of Amp Config -# end of Project Configuration - -CONFIG_USE_FREERTOS=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_USE_L3CACHE is not set -# 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_E2000D is not set -# CONFIG_TARGET_E2000S is not set -CONFIG_TARGET_FT2004=y -# CONFIG_TARGET_D2000 is not set -# CONFIG_TARGET_PD2308 is not set -CONFIG_SOC_NAME="ft2004" -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_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="dsk" -CONFIG_FT2004_DSK_BOARD=y - -# -# IO mux configuration when board start up -# -# CONFIG_CUS_DEMO_BOARD is not set - -# -# Build project name -# -CONFIG_TARGET_NAME="openamp_device_core" -# end of Build project name -# end of Board Configuration - -# -# Sdk common configuration -# -CONFIG_ELOG_LINE_BUF_SIZE=0x100 -CONFIG_LOG_VERBOS=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set -# CONFIG_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 -# end of Sdk common configuration - -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - -# -# Drivers configuration -# -CONFIG_USE_IOMUX=y -CONFIG_ENABLE_IOCTRL=y -# CONFIG_ENABLE_IOPAD is not set -# 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_USB 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_SCMI_MHU is not set -# CONFIG_USE_I2S is not set -# CONFIG_USE_I3C is not set -# end of Drivers 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 is not set -# 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=0xe0100000 -CONFIG_IMAGE_MAX_LENGTH=0x2000000 -CONFIG_HEAP_SIZE=1 -CONFIG_STACK_SIZE=0x400 -# end of Linker Options -# end of Build setup - -# -# Component Configuration -# - -# -# Freertos Uart Drivers -# -CONFIG_FREERTOS_USE_UART=y -# end of Freertos Uart Drivers - -# -# Freertos Pwm Drivers -# -# CONFIG_FREERTOS_USE_PWM is not set -# end of Freertos Pwm Drivers - -# -# Freertos Qspi Drivers -# -# CONFIG_FREERTOS_USE_QSPI is not set -# end of Freertos Qspi Drivers - -# -# Freertos Wdt Drivers -# -# CONFIG_FREERTOS_USE_WDT is not set -# end of Freertos Wdt Drivers - -# -# Freertos Eth Drivers -# -# CONFIG_FREERTOS_USE_XMAC is not set -# CONFIG_FREERTOS_USE_GMAC is not set -# end of Freertos Eth Drivers - -# -# Freertos Spim Drivers -# -# CONFIG_FREERTOS_USE_FSPIM is not set -# end of Freertos Spim Drivers - -# -# Freertos DMA Drivers -# -# CONFIG_FREERTOS_USE_FDDMA is not set -# CONFIG_FREERTOS_USE_FGDMA is not set -# end of Freertos DMA Drivers - -# -# Freertos Adc Drivers -# -# CONFIG_FREERTOS_USE_ADC is not set -# end of Freertos Adc Drivers - -# -# Freertos Can Drivers -# -# CONFIG_FREERTOS_USE_CAN is not set -# end of Freertos Can Drivers - -# -# Freertos I2c Drivers -# -# CONFIG_FREERTOS_USE_I2C is not set -# end of Freertos I2c Drivers - -# -# Freertos Mio Drivers -# -# CONFIG_FREERTOS_USE_MIO is not set -# end of Freertos Mio Drivers - -# -# Freertos Timer Drivers -# -# CONFIG_FREERTOS_USE_TIMER is not set -# end of Freertos Timer Drivers - -# -# Freertos Media Drivers -# -# CONFIG_FREERTOS_USE_MEDIA is not set -# end of Freertos Media Drivers - -# -# Freertos I2s Drivers -# -# CONFIG_FREERTOS_USE_I2S is not set -# end of Freertos I2s Drivers -# end of Component Configuration - -# -# Third-party configuration -# -# CONFIG_USE_LWIP is not set -# CONFIG_USE_LETTER_SHELL is not set -CONFIG_USE_AMP=y -CONFIG_USE_LIBMETAL=y - -# -# OpenAmp -# -CONFIG_USE_OPENAMP=y -CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 -# CONFIG_SKIP_SHBUF_IO_WRITE is not set -# CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config -# end of OpenAmp - -# CONFIG_USE_YMODEM is not set -# CONFIG_USE_SFUD is not set -CONFIG_USE_BACKTRACE=y -# CONFIG_USE_FATFS_0_1_4 is not set -# CONFIG_USE_TLSF 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_CHERRY_USB is not set -# CONFIG_USE_FSL_SDMMC is not set -# CONFIG_USE_FSL_WIFI is not set -# end of Third-party configuration - -# -# FreeRTOS Kernel Configuration -# -CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y -CONFIG_FREERTOS_HZ=1000 -CONFIG_FREERTOS_MAX_PRIORITIES=32 -CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=13 -CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=11 -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_MINIMAL_TASK_STACKSIZE=1024 -CONFIG_FREERTOS_MAX_TASK_NAME_LEN=32 -CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 -CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 -CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 -CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y -CONFIG_FREERTOS_USE_TRACE_FACILITY=y -CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y -# CONFIG_FREERTOS_USE_TICKLESS_IDLE is not set -CONFIG_FREERTOS_TOTAL_HEAP_SIZE=10240 -CONFIG_FREERTOS_TASK_FPU_SUPPORT=1 -# CONFIG_FREERTOS_USE_POSIX is not set -# end of FreeRTOS Kernel Configuration diff --git a/example/system/amp/openamp/device_core/configs/phytiumpi_aarch32_firefly_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/phytiumpi_aarch32_firefly_openamp_device_core.config index 5576aa691aade1be64b8024e90e9be223dbe6321..1561e4e1f54b7d43f41a5cc884564591a9fcfafe 100644 --- a/example/system/amp/openamp/device_core/configs/phytiumpi_aarch32_firefly_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/phytiumpi_aarch32_firefly_openamp_device_core.config @@ -1,18 +1,3 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=4 -# end of Amp Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -127,12 +112,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -336,21 +315,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/device_core/configs/phytiumpi_aarch64_firefly_openamp_device_core.config b/example/system/amp/openamp/device_core/configs/phytiumpi_aarch64_firefly_openamp_device_core.config index 87382c8449cdd1e05efdd49331808ac27637c89c..473dcd80208f0031eca4f4a0585f5d5ba6be59f9 100644 --- a/example/system/amp/openamp/device_core/configs/phytiumpi_aarch64_firefly_openamp_device_core.config +++ b/example/system/amp/openamp/device_core/configs/phytiumpi_aarch64_firefly_openamp_device_core.config @@ -1,18 +1,3 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=4 -# end of Amp Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -121,12 +106,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -217,7 +196,7 @@ CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 CONFIG_IMAGE_MAX_LENGTH=0x2000000 CONFIG_HEAP_SIZE=1 -CONFIG_STACK_SIZE=0x400 +CONFIG_STACK_SIZE=0x4000 # end of Linker Options # end of Build setup @@ -325,21 +304,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/third-party/openamp/ports/ft_openamp.ld b/example/system/amp/openamp/device_core/ft_openamp.ld similarity index 35% rename from third-party/openamp/ports/ft_openamp.ld rename to example/system/amp/openamp/device_core/ft_openamp.ld index 9c747d43755b63f5816fbff3562f1b1f10f42e55..585b201e01d48c49943b05206cdaa3e33060756a 100644 --- a/third-party/openamp/ports/ft_openamp.ld +++ b/example/system/amp/openamp/device_core/ft_openamp.ld @@ -1,6 +1,6 @@ +#include "memory_layout.h" - - .resource_table CONFIG_OPENAMP_RESOURCES_ADDR: { + .resource_table SLAVE00_SOURCE_TABLE_ADDR: { . = ALIGN(4); *(.resource_table) } diff --git a/example/system/amp/openamp/device_core/inc/rpmsg-demo-listening.h b/example/system/amp/openamp/device_core/inc/rpmsg-demo-listening.h new file mode 100644 index 0000000000000000000000000000000000000000..a1bfb7497c21a82c35e6df02c3ae9ef629fa7f37 --- /dev/null +++ b/example/system/amp/openamp/device_core/inc/rpmsg-demo-listening.h @@ -0,0 +1,42 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: rpmsg-demo-listening.h + * Created Date: 2024-07-19 10:26:11 + * Last Modified: 2024-07-19 10:31:27 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + */ + +#ifndef RPMSG_DEMO_LISTENING_H_ +#define RPMSG_DEMO_LISTENING_H_ + +#include "FreeRTOS.h" +#include "ftypes.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +int FFreeRTOSOpenAMPSlaveInit(void); +int rpmsg_listening_func(void); + +#ifdef __cplusplus +} +#endif + +#endif /* RPMSG_DEMO_LISTENING_H_ */ diff --git a/example/system/amp/openamp/device_core/main.c b/example/system/amp/openamp/device_core/main.c index db4b6a262141cd29c9cb3c995107b05752cb0eb1..78c6362fb6cc86cb47593c2ea84e29c8c88e7d29 100644 --- a/example/system/amp/openamp/device_core/main.c +++ b/example/system/amp/openamp/device_core/main.c @@ -13,7 +13,7 @@ * * FilePath: main.c * Created Date: 2022-02-25 13:25:14 - * Last Modified: 2024-05-06 17:56:58 + * Last Modified: 2024-07-19 14:47:05 * Description: This file is for main * * Modify History: @@ -31,22 +31,21 @@ #include "fdebug.h" #include "FreeRTOS.h" #include "task.h" +#include "rpmsg-demo-listening.h" #define OPENAMP_MAIN_DEBUG_TAG "OPENAMP_MAIN" #define OPENAMP_MAIN_DEBUG_I(format, ...) FT_DEBUG_PRINT_I(OPENAMP_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) #define OPENAMP_MAIN_DEBUG_W(format, ...) FT_DEBUG_PRINT_W(OPENAMP_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) #define OPENAMP_MAIN_DEBUG_E(format, ...) FT_DEBUG_PRINT_E(OPENAMP_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) -extern int rpmsg_listening_func(void); int main(void) { BaseType_t ret; - ret = rpmsg_listening_func(); if(ret != pdPASS) goto FAIL_EXIT; OPENAMP_MAIN_DEBUG_I("Create task OK!"); - + /* 开启任务调度前确保主核不会提前发送消息过来,否则会导致IPI模式中断被屏蔽,无法接收到消息中断 */ vTaskStartScheduler(); /* 启动任务,开启调度 */ while (1); /* 正常不会执行到这里 */ diff --git a/example/system/amp/openamp/device_core/makefile b/example/system/amp/openamp/device_core/makefile index 92fcd29fde27360cda1f31915826ba8ba7f5a0c5..e5c4f589c5565bc755f90e7d6ed5ff4747d7f997 100644 --- a/example/system/amp/openamp/device_core/makefile +++ b/example/system/amp/openamp/device_core/makefile @@ -4,7 +4,9 @@ FREERTOS_SDK_DIR = $(CURDIR)/../../../../../ USER_CSRC := main.c USER_CSRC += $(wildcard src/*.c) -USER_INCLUDE := $(PROJECT_DIR) +USER_INCLUDE += $(PROJECT_DIR) \ + $(PROJECT_DIR)/inc \ + $(PROJECT_DIR)/../common include $(FREERTOS_SDK_DIR)/tools/makeall.mk diff --git a/example/system/amp/openamp/device_core/sdkconfig b/example/system/amp/openamp/device_core/sdkconfig index 87382c8449cdd1e05efdd49331808ac27637c89c..473dcd80208f0031eca4f4a0585f5d5ba6be59f9 100644 --- a/example/system/amp/openamp/device_core/sdkconfig +++ b/example/system/amp/openamp/device_core/sdkconfig @@ -1,18 +1,3 @@ - -# -# Project Configuration -# - -# -# Amp Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_IPI_CHN_BITMASK=4 -# end of Amp Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -121,12 +106,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -217,7 +196,7 @@ CONFIG_DEFAULT_LINKER_SCRIPT=y CONFIG_IMAGE_LOAD_ADDRESS=0xe0100000 CONFIG_IMAGE_MAX_LENGTH=0x2000000 CONFIG_HEAP_SIZE=1 -CONFIG_STACK_SIZE=0x400 +CONFIG_STACK_SIZE=0x4000 # end of Linker Options # end of Build setup @@ -325,21 +304,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/device_core/sdkconfig.h b/example/system/amp/openamp/device_core/sdkconfig.h index ba7d94e63c7c93e4cb4dce857df66c9a9065fdc1..29929dae70ef4c8a534e080e8e4296cd599d19b8 100644 --- a/example/system/amp/openamp/device_core/sdkconfig.h +++ b/example/system/amp/openamp/device_core/sdkconfig.h @@ -1,16 +1,6 @@ #ifndef SDK_CONFIG_H__ #define SDK_CONFIG_H__ -/* Project Configuration */ - -/* Amp Config */ - -#define CONFIG_IPI_IRQ_NUM 9 -#define CONFIG_IPI_IRQ_NUM_PRIORITY 1 -#define CONFIG_SPIN_MEM 0x80000000 -#define CONFIG_IPI_CHN_BITMASK 4 -/* end of Amp Config */ -/* end of Project Configuration */ #define CONFIG_USE_FREERTOS /* Arch configuration */ @@ -108,11 +98,6 @@ #define CONFIG_INTERRUPT_ROLE_SLAVE /* end of Sdk common configuration */ -/* Image information configuration */ - -/* CONFIG_IMAGE_INFO is not set */ -/* end of Image information configuration */ - /* Drivers configuration */ #define CONFIG_USE_IOMUX @@ -194,7 +179,7 @@ #define CONFIG_IMAGE_LOAD_ADDRESS 0xe0100000 #define CONFIG_IMAGE_MAX_LENGTH 0x2000000 #define CONFIG_HEAP_SIZE 1 -#define CONFIG_STACK_SIZE 0x400 +#define CONFIG_STACK_SIZE 0x4000 /* end of Linker Options */ /* end of Build setup */ @@ -284,20 +269,9 @@ #define CONFIG_USE_OPENAMP #define CONFIG_USE_OPENAMP_IPI -#define CONFIG_OPENAMP_RESOURCES_ADDR 0xc0000000 -#define CONFIG_VRING_TX_ADDR 0xc0020000 -#define CONFIG_VRING_RX_ADDR 0xc0024000 -#define CONFIG_VRING_SIZE 0x100 -#define CONFIG_POLL_BASE_ADDR 0xc0224000 /* CONFIG_SKIP_SHBUF_IO_WRITE is not set */ /* CONFIG_USE_MASTER_VRING_DEFINE is not set */ - -/* Baremetal config */ - -/* CONFIG_MEM_NO_CACHE is not set */ -/* CONFIG_MEM_WRITE_THROUGH is not set */ -#define CONFIG_MEM_NORMAL -/* end of Baremetal config */ +/* CONFIG_USE_CACHE_COHERENCY is not set */ /* end of OpenAmp */ /* CONFIG_USE_YMODEM is not set */ /* CONFIG_USE_SFUD is not set */ diff --git a/example/system/amp/openamp/device_core/src/rpmsg-demo-listening.c b/example/system/amp/openamp/device_core/src/rpmsg-demo-listening.c index 859f932b72d7731f2dd7ac070027b508685eb3d7..e5ce1f4d2354081dbb4f79a1c92844ac185f202c 100644 --- a/example/system/amp/openamp/device_core/src/rpmsg-demo-listening.c +++ b/example/system/amp/openamp/device_core/src/rpmsg-demo-listening.c @@ -31,6 +31,8 @@ #include #include #include "platform_info.h" +#include "rsc_table.h" +#include "helper.h" #include "rpmsg_service.h" #include "fcache.h" #include "fdebug.h" @@ -38,6 +40,9 @@ #include "FreeRTOS.h" #include "task.h" +#include "rpmsg-demo-listening.h" +#include "openamp_configs.h" +#include "libmetal_configs.h" /************************** Constant Definitions *****************************/ /***************** Macros (Inline Functions) Definitions *********************/ @@ -45,19 +50,68 @@ #define SHUTDOWN_MSG 0xEF56A55A #define RECV_MSG 0xE5E5E5E5 -#define DEMO_LIST_SLAVE_DEBUG_TAG " DEMO_LIST_SLAVE" +#define DEMO_LIST_SLAVE_DEBUG_TAG "DEMO_LIST_SLAVE" #define DEMO_LIST_SLAVE_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( DEMO_LIST_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) #define DEMO_LIST_SLAVE_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( DEMO_LIST_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) #define DEMO_LIST_SLAVE_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( DEMO_LIST_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) -#define DEMO_LISTENING_ADDR (RPMSG_RESERVED_ADDRESSES - 2) - #define RPMSG_PING_DEMO 0x1 #define RPMSG_SAM_PING_DEMO 0X2 #define RPMSG_MAT_MULT_DEMO 0X3 #define RPMSG_NO_COPY_DEMO 0X4 -static struct rpmsg_endpoint lept; +static struct remote_resource_table __resource resources __attribute__((used)) = { + /* Version */ + 1, + + /* NUmber of table entries */ + NUM_TABLE_ENTRIES, + /* reserved fields */ + {0, 0,}, + + /* Offsets of rsc entries */ + { + offsetof(struct remote_resource_table, rpmsg_vdev), + }, + + /* Virtio device entry */ + { + RSC_VDEV, VIRTIO_ID_RPMSG_, VDEV_NOTIFYID, RPMSG_IPU_C0_FEATURES, 0, 0, 0, + NUM_VRINGS, {0, 0}, + }, + + /* Vring rsc entry - part of vdev rsc entry */ + {SLAVE00_TX_VRING_ADDR, VRING_ALIGN, SLAVE00_VRING_NUM, 1, 0}, + {SLAVE00_RX_VRING_ADDR, VRING_ALIGN, SLAVE00_VRING_NUM, 2, 0}, +}; + +struct metal_device kick_driver_00 = { + .name = SLAVE_00_KICK_DEV_NAME, + .bus = NULL, + .irq_num = 1,/* Number of IRQs per device */ + .irq_info = (void *)SLAVE_00_SGI, +} ; + + +struct remoteproc_priv slave_00_priv = { + .kick_dev_name = SLAVE_00_KICK_DEV_NAME , + .kick_dev_bus_name = KICK_BUS_NAME , + .cpu_id = MASTER_DRIVER_CORE , + + .src_table_attribute = SLAVE00_SOURCE_TABLE_ATTRIBUTE , + + /* |rx vring|tx vring|share buffer| */ + .share_mem_va = SLAVE00_SHARE_MEM_ADDR , + .share_mem_pa = SLAVE00_SHARE_MEM_ADDR , + .share_buffer_offset = SLAVE00_VRING_SIZE , + .share_mem_size = SLAVE00_SHARE_MEM_SIZE , + .share_mem_attribute = SLAVE00_SHARE_BUFFER_ATTRIBUTE +} ; + +struct remoteproc remoteproc_slave_00; +static struct rpmsg_device *rpdev_slave_00 = NULL; +struct rpmsg_endpoint ept_slave_00; + static volatile u32 flag_req = 0; static volatile int demo_flag = 0; /************************** Function Prototypes ******************************/ @@ -82,9 +136,6 @@ static int rpmsg_endpoint_cb(struct rpmsg_endpoint *ept, void *data, size_t len, } demo_flag = (*(unsigned int *)data); -#ifdef CONFIG_MEM_NORMAL - FCacheDCacheInvalidateRange((intptr)data, len); -#endif /* Send data back to master */ if (rpmsg_send(ept, data, len) < 0) { @@ -97,7 +148,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; - rpmsg_destroy_ept(&lept); + rpmsg_destroy_ept(&ept_slave_00); DEMO_LIST_SLAVE_DEBUG_I("Unexpected remote endpoint destroy.\r\n"); flag_req = SHUTDOWN_MSG; } @@ -109,7 +160,7 @@ static int app(struct rpmsg_device *rdev, void *priv) { int ret; /* Initialize RPMSG framework */ - ret = rpmsg_create_ept(&lept, rdev, DEMO_SERVICE_NAME, DEMO_LISTENING_ADDR, RPMSG_ADDR_ANY, rpmsg_endpoint_cb, rpmsg_service_unbind); + ret = rpmsg_create_ept(&ept_slave_00, rdev, RPMSG_SERVICE_00_NAME, SLAVE_DEVICE_00_EPT_ADDR, MASTER_DRIVER_EPT_ADDR, rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { DEMO_LIST_SLAVE_DEBUG_E("Failed to create endpoint. %d \r\n", ret); @@ -192,47 +243,64 @@ static int app(struct rpmsg_device *rdev, void *priv) return ret; } +int FFreeRTOSOpenAMPSlaveInit(void) +{ + init_system(); /* Initialize the system resources and environment */ + + if (!platform_create_proc(&remoteproc_slave_00, &slave_00_priv, &kick_driver_00)) + { + DEMO_LIST_SLAVE_DEBUG_E("Failed to create remoteproc instance for slave 00\r\n"); + return -1; /* Return with an error if creation fails */ + } + /* Setup resource tables for the created remoteproc instances */ + remoteproc_slave_00.rsc_table = &resources; + /* 在主核创建rpmsg之前,保证从核已经初始化资源表,否则会导致主核发送中断,从核进入中断服务函数后,获取异常指针资源表 */ + if (platform_setup_src_table(&remoteproc_slave_00,remoteproc_slave_00.rsc_table)) + { + DEMO_LIST_SLAVE_DEBUG_E("Failed to setup src table for slave 00\r\n"); + return -1; /* Return with an error if setup fails */ + } + + DEMO_LIST_SLAVE_DEBUG_I("Setup resource tables for the created remoteproc instances is over \r\n"); + + if (platform_setup_share_mems(&remoteproc_slave_00)) + { + DEMO_LIST_SLAVE_DEBUG_E("Failed to setup shared memory for slave 00\r\n"); + return -1; /* Return with an error if setup fails */ + } + + 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); + if (!rpdev_slave_00) + { + DEMO_LIST_SLAVE_DEBUG_E("Failed to create rpmsg vdev for slave 00\r\n"); + return -1; /* Return with an error if creation fails */ + } + + return 0 ; +} + void rpmsg_listening_task(void *args) { - void *platform; - struct rpmsg_device *rpdev; - int ret; + int ret = 0; while (!ret) { - DEMO_LIST_SLAVE_DEBUG_I("Starting application...\r\n"); - /* Initialize platform */ - ret = platform_init(0, NULL, &platform); - if (ret) + DEMO_LIST_SLAVE_DEBUG_I("SLAVER Starting application...\r\n"); + if(!FFreeRTOSOpenAMPSlaveInit()) { - DEMO_LIST_SLAVE_DEBUG_E("Failed to initialize platform.\r\n"); - ret = -1; - break; + ret = app(rpdev_slave_00,&remoteproc_slave_00) ; } else { - rpdev = platform_create_rpmsg_vdev(platform, 0, VIRTIO_DEV_SLAVE, NULL,NULL); - if (!rpdev) - { - DEMO_LIST_SLAVE_DEBUG_E("Failed to create rpmsg virtio device.\r\n"); - ret = -1; - break; - } - else - { - ret = app(rpdev, platform); - if (ret != 0) - { - DEMO_LIST_SLAVE_DEBUG_E("App listening running error."); - ret = -1; - break; - } - platform_release_rpmsg_vdev(rpdev, platform); - } + DEMO_LIST_SLAVE_DEBUG_E("Failed to init remoteproc.\r\n"); + break; } - + platform_release_rpmsg_vdev(rpdev_slave_00, &remoteproc_slave_00); DEMO_LIST_SLAVE_DEBUG_I("Stopping application...\r\n"); - platform_cleanup(platform); + platform_cleanup(&remoteproc_slave_00); } + DEMO_LIST_SLAVE_DEBUG_E("SLAVER Exiting...\r\n"); vTaskDelete(NULL); } diff --git a/example/system/amp/openamp/driver_core/Kconfig b/example/system/amp/openamp/driver_core/Kconfig index 191415678dee1c8e04bda94f713e3f05bfa285e9..c12dca42842e046755eacf5e16cf3e97bf13835b 100644 --- a/example/system/amp/openamp/driver_core/Kconfig +++ b/example/system/amp/openamp/driver_core/Kconfig @@ -6,35 +6,5 @@ mainmenu "Phytium FreeRTOS Configuration" - menu "Project Configuration" - - menu "AMP Config" - - config IPI_IRQ_NUM - int "Communication interruption number between multiple cores" - default 0 - - config IPI_IRQ_NUM_PRIORITY - int "Priority of internuclear communication interruption" - default 1 - - config SPIN_MEM - hex "Spin-lock shared memory" - default 0x80000000 - - config TARGET_CPU_MASK - int "Destination CPU id" - default 1 - - config IPI_CHN_BITMASK - int "Destination IPI mask" - default 1 - help - Each bit represents a CPU, for example, 0x3 represents CPU 0 and CPU 3 in the code. - - endmenu - -endmenu - source "$(SDK_DIR)/../freertos.kconfig" diff --git a/example/system/amp/openamp/driver_core/README.md b/example/system/amp/openamp/driver_core/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2c41951f0177f73a8f1223f8c4093aa07eb0957f --- /dev/null +++ b/example/system/amp/openamp/driver_core/README.md @@ -0,0 +1,216 @@ +# OPENAMP 测试 + +## 1. 例程介绍 + +> ``介绍例程的用途,使用场景,相关基本概念,描述用户可以使用例程完成哪些工作 `
` + +- OpenAMP(Open Asymmetric Multi-processing) 是一个软件架构,为多核之间非对称运行提供软件支持 。 + +### 1.1 OpenAMP 提供了以下关键特性 + +1. 提供生命周期管理 +2. 兼容裸跑、RTOS等不同的软件环境 +3. 当前此目录不兼容linux系统中的 remoteproc, rpmsg and VirtIO 模块,兼容版本已经移动至openamp_for_linux目录中 + +### 1.2 OpenAMP组件 + +1. RPMsg (Remote Processor Messaging) +2. VirtIO (Virtualization Module) +3. remoteproc + +### 1.3 driver_core与device_core + +- 本例程基于开源openamp项目 + [OpenAMP](https://github.com/OpenAMP/open-amp.git) + +1. 例程结构介绍: + +- 本例程主要提供了D2000/E2000/firefly开发板 freertos系统的openamp驱动测试例程 + +#### 系统架构 + +- 角色介绍:管理核作为交互管理的核心,主要进行任务分配,也承担一部分的任务反馈功能,性能核作为任务的运算执行核心,主要承担接受管理核的指令和任务运算的工作。 +- 本例程中 `driver_core` 目录下的程序为管理核(模拟)程序、`device_core`目录下为性能核(模拟)程序。管理核程序功能为初始化创建platform和rpmsg_device(主VIRTIO_DEV_MASTER),创建成功后,创建管理endpoint节点与性能核构建通信机制。性能核功能为初始化创建platform和与管理核绑定的rpmsg_device(从VIRTIO_DEV_SLAVE),创建成功后,创建监听endpoint节点接收管理核的命令来运行相关的例程。 +- 核心的分配以及架构参考amp_config.json文件(具体描述参考 `Phytium-Standalone-SDK/example/system/amp/README.md` 的介绍) +- common目录下为公共配置文件,方便管理核和性能核共用,也方便了解使用的资源以及修改配置。 +- rpmsg 创建流程以及参考文档 + +rpmsg-design: + [rpmsg-design](../../../../../standalone/third-party/openamp/docs/rpmsg-design.md) + +2.demo介绍(模拟角色): + +- demo1:管理核rpmsg-echo.c与性能核rpmsg-ping.c + +- demo2:管理核rpmsg-sample-echo.c与性能核rpmsg-sample-ping.c + +- demo3:管理核matrix_multiplyd.c与性能核matrix_multiply.c + +- demo4:管理核rpmsg-nocopy-echo.c与性能核rpmsg-nocopy-ping.c + +具体功能可以阅读 管理核`driver_core`对应.c文件的头描述 Description + +## 2. 如何使用例程 + +> ``描述开发平台准备,使用例程配置,构建和下载镜像的过程 `
` + +### 2.1 硬件配置方法 + +> ``哪些硬件平台是支持的,需要哪些外设,例程与开发板哪些IO口相关等(建议附录开发板照片,展示哪些IO口被引出)`
` + +1. 准备一块d2000 或者 E2000Q/D 或者 firefly 开发板 +2. 将串口连接好电脑,波特率设为 115200-8-1-N + +### 2.2 SDK配置方法 + +> ``依赖哪些驱动、库和第三方组件,如何完成配置(列出需要使能的关键配置项)`
` + +- 本例子driver_core目录与device_core目录已经提供好具体的编译指令,以下进行介绍(快速测试,使用默认部署请看2.4): + + 1. make menuconfig 配置目录下的参数变量 + 2. make clean 将目录下的工程进行清理 + 3. make backup_kconfig 如果对上述的项目配置修改后需要分别重新保存到默认配置目录中 + 4. make list_kconfig 当前工程支持哪些配置文件 + 5. make amp_make AMP_CONFIG=config`[num]` 将当前目录下的amp_config.json定义的配置项编译打包,config`[num]`为配置项的名称(在driver_core目录下有效支持) +- 具体使用方法为: + 6. 为了方便快速配置测试,本项目配置文件列举了8个默认配置项目,会同时加载apu、rpu的默认配置,然后使用make amp_make AMP_CONFIG=config`[num]` 命令进行对应soc的对应aarch编译 + +- 具体使用方法为: + + - 在 /example/system/amp/openamp 对应 目录 下 + - 执行上述指令 + +### 2.3 构建和下载 + +> ``描述构建、烧录下载镜像的过程,列出相关的命令 `
` + +#### driver_core 构建配置 + +- 以driver_core管理核(主)为例:` make menuconfig ` + +![OpenAMP配置](./fig/OpenAMPConfig.png) + +- 选择要编译的配置项,如上图所示,选择配置项后,保存并退出,`make backup_kconfig`保存到默认项,才能被`amp_make`打包编译。 + +#### device_core 构建配置 + +- 以 device_core 设备核(从)为例:在 `../device_core` 目录下 ` make menuconfig ` + +![OpenAMP配置](./fig/OpenAMPConfig1.png) + +- 选择要编译的配置项,如上图所示,选择配置项后,保存并退出 ,`make backup_kconfig`保存到默认项,才能被`amp_make`打包编译。 + +#### 用户自定义修改配置项 + +- 因为多核采用的是脚本自动寻找 `amp_config.json` 文件描述的工程目录,加载配置好的配置项(在目标路径的 configs 目录下),进行编译。所以,需要先保存修改好的配置项到默认配置目录中。 + +- 可以单个进入子工程目录中,单个调试完工程后再组合编译(遇到启动问题,推荐此构建方式排查调试多核启动问题)(注意:aarch32模式单个调试启动需要打开CONFIG_USE_AARCH64_L1_TO_AARCH32)。 + +> aarch32需要注意的点 + +![USE_AARCH64_L1_TO_AARCH32](./fig/OpenAMPConfig0.png) + +- 单个工程目录中使用`make backup_kconfig`保存调试好的AARCH32配置到默认配置,别忘了在工程中关闭CONFIG_USE_AARCH64_L1_TO_AARCH32,否则会导致启动失败。 +- 注意:混合异构部署启动中,各个工程都不需要打开(可以看工程的configs目录下凡是aarch32的配置都没打开),否则会导致启动失败,因为bootcode启动阶段已经做了此转换操作。 + +#### 编译 + +- 输入 `make clean` 清理 `./` 目录下的编译结果 +- 编译指令:` make amp_make AMP_CONFIG=config[num] ` +- 其中,config`[num]`为配置项的名称,如上述步骤中选择的配置项名称。 + +### 2.4 输出与实验现象 + +> ``描述输入输出情况,列出存在哪些输入,对应的输出是什么(建议附录相关现象图片)`
` + +#### aarch64 程序测试 (freeRTOS 间) + +以E2000Q为例 + +1. 在编译环境下,切换至 phytium-free-rtos-sdk/example/system/amp/openamp/driver_core 目录 + +- 1.1 输入` make clean ` 清理 `./` 目录下的编译结果 +- 1.2 输入` make amp_make AMP_CONFIG=config0 ` 编译config0配置项代码,并且生成对应的elf 文件 + +2. 使用串口连接E2000开发板 ,并且打开串口终端工具 + +- 2.1 复位开发板之后,将E2000开发板的网络与tftp 服务器在同一局域网中 +- 2.2 在板子串口终端工具下输入以下命令 + +``` + setenv ipaddr 192.168.4.20 + setenv serverip 192.168.4.50 + setenv gatewayip 192.168.4.1 + tftpboot f0000000 freertos.elf + bootelf -p f0000000 +``` + +2.3 会显示如下内容 + +![e2000_aarch64_openamp_startup](./fig/e2000_aarch64_openamp_startup.png) + +2.4 输入 'openamp' 运行openamp 命令程序示例,结果显示为: + +![1677585960509](./fig/1677585960509.png) + +- 其中 "openamp auto" 表示命令的完整格式,一次性测试4个demo,红色方框为核2调用函数启动核心0的过程 + +![20230512192325](./fig/20230512192325.png) + + +- 其中 "Test Results:Error count =" 表示通信过程中出现错误的次数 + +![20231017160632](./fig/20231017160632.png) + +#### aarch32 程序测试 (freeRTOS 间) + +以E2000Q为例 + +1. 在编译环境下,切换至 phytium-free-rtos-sdk/example/system/amp/openamp/driver_core 目录 + +- 1.1 输入` make clean ` 清理 `./` 目录下的编译结果 +- 1.2 输入` make amp_make AMP_CONFIG=config1 ` 编译config1配置项代码,并且生成对应的elf 文件 + +2. 使用串口连接E2000开发板 ,并且打开串口终端工具 + +- 2.1 复位开发板之后,将E2000开发板的网络与tftp 服务器在同一局域网中 +- 2.2 在板子串口终端工具下输入以下命令 + +``` + setenv ipaddr 192.168.4.20 + setenv serverip 192.168.4.50 + setenv gatewayip 192.168.4.1 + tftpboot f0000000 freertos.elf + bootelf -p f0000000 +``` + +2.3 会显示如下内容 + +![e2000_aarch32_openamp_startup](./fig/e2000_aarch32_openamp_startup.png) + +2.5 输入 'openamp' 运行openamp 命令程序示例 + +![20230512195526](./fig/20230512195526.png) + +2.6 输入 'openamp auto' 表示命令的完整格式,一次性测试4个demo + +![20230512200435](./fig/20230512200435.png) + +- 其中 "Test Results:Error count =" 表示通信过程中出现错误的次数 + +![20231017165755](./fig/20231017165755.png) + +## 3. 如何解决问题 (Q&A) + +> ``主要记录使用例程中可能会遇到的问题,给出相应的解决方案 `
` + +- 在首次使用'openamp auto'命令时候,由于会有核心启动得打印,造成乱码,可以再次运行'openamp auto'来看效果 +- 在修改例程中,注意从核和主核两者在任务的创建和调度临界时发生中断屏蔽的情况,避免在此时发送数据导致通信异常。 + +## 4. 修改历史记录 + +> ``记录例程的重大修改记录,标明修改发生的版本号 `
` + +- 2023-05-12 :v0.1.0 初始化项目 +- 2023-05-31 : v0.1.1 增加自动加载从核elf并启动的功能 +- 2024-07-18 : v0.1.2 完善openamp生命周期管理,修改配置方式 diff --git a/example/system/amp/openamp/driver_core/amp_config.json b/example/system/amp/openamp/driver_core/amp_config.json new file mode 100644 index 0000000000000000000000000000000000000000..d18061670c0135c028b84c77131b0378b6d8ace0 --- /dev/null +++ b/example/system/amp/openamp/driver_core/amp_config.json @@ -0,0 +1,97 @@ + +[ + { + "举例":{ + "configs":{ + "_config[num]_":"镜像配置,每一个镜像配置由多个例程路径的配置组合构成,是需要保证芯片型号以及aarch架构一致性", + "config[num]":[ + { + "bootstrap":"boot_code文件启动引导的链接地址,由此代码启动多核镜像" + }, + { + "_path[num]_":"AMP关联路径配置,每个路径指定一个核心的镜像工程所需指定的配置,具体含义可参看 裸机standalone工程的example/system/amp/README.md", + "path[num]":["amp例程路径(字符串):相对于project_directory的工程路径","core_id(常量):指定此镜像运行在指定CPU_ID号的core上","master(常量):默认0","配置文件名称(字符串):第一个参数工程路径下configs目录中配置文件名,用来加载配置编译选项"], + "...":"..." + } + ] + } + } + }, + { + "configs": + { + "config0":[ + { + "bootstrap":"0x90120000" + }, + { + "path0":["../device_core",10000,0,"e2000q_aarch64_demo_openamp_device_core.config"], + "path1":["./",2,1,"e2000q_aarch64_demo_openamp_driver_core.config"] + } + ], + "config1":[ + { + "bootstrap":"0x90120000" + }, + { + "path0":["../device_core",10000,0,"e2000q_aarch32_demo_openamp_device_core.config"], + "path1":["./",2,1,"e2000q_aarch32_demo_openamp_driver_core.config"] + } + ], + "config2":[ + { + "bootstrap":"0x90120000" + }, + { + "path0":["../device_core",10000,0,"e2000d_aarch64_demo_openamp_device_core.config"], + "path1":["./",1,1,"e2000d_aarch64_demo_openamp_driver_core.config"] + } + ], + "config3":[ + { + "bootstrap":"0x90120000" + }, + { + "path0":["../device_core",10000,0,"e2000d_aarch32_demo_openamp_device_core.config"], + "path1":["./",1,1,"e2000d_aarch32_demo_openamp_driver_core.config"] + } + ], + "config4":[ + { + "bootstrap":"0x90120000" + }, + { + "path0":["../device_core",10000,0,"phytiumpi_aarch64_firefly_openamp_device_core.config"], + "path1":["./",2,1,"phytiumpi_aarch64_firefly_openamp_driver_core.config"] + } + ], + "config5":[ + { + "bootstrap":"0x90120000" + }, + { + "path0":["../device_core",10000,0,"phytiumpi_aarch32_firefly_openamp_device_core.config"], + "path1":["./",2,1,"phytiumpi_aarch32_firefly_openamp_driver_core.config"] + } + ], + "config6":[ + { + "bootstrap":"0x90120000" + }, + { + "path0":["../device_core",10000,0,"d2000_aarch64_test_openamp_device_core.config"], + "path1":["./",2,1,"d2000_aarch64_test_openamp_driver_core.config"] + } + ], + "config7":[ + { + "bootstrap":"0x90120000" + }, + { + "path1":["../device_core",10000,0,"d2000_aarch32_test_openamp_device_core.config"], + "path0":["./",2,1,"d2000_aarch32_test_openamp_driver_core.config"] + } + ] + } + } +] diff --git a/example/system/amp/openamp/driver_core/configs/d2000_aarch32_test_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/d2000_aarch32_test_openamp_driver_core.config index dfa9544b88e5e32181810669e479479fe6543ad2..e047321a7642787ff444ae7a10de6e3279f8f5d0 100644 --- a/example/system/amp/openamp/driver_core/configs/d2000_aarch32_test_openamp_driver_core.config +++ b/example/system/amp/openamp/driver_core/configs/d2000_aarch32_test_openamp_driver_core.config @@ -1,19 +1,3 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=2 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -52,8 +36,8 @@ CONFIG_ARM_MFLOAT_ABI="hard" # end of Fpu configuration # end of Compiler configuration -CONFIG_USE_L3CACHE=y -CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# CONFIG_USE_L3CACHE is not set +# CONFIG_USE_AARCH64_L1_TO_AARCH32 is not set # end of Arm architecture configuration CONFIG_MMU_PAGE_SIZE=0x1000 @@ -117,12 +101,6 @@ CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -336,21 +314,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/driver_core/configs/d2000_aarch64_test_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/d2000_aarch64_test_openamp_driver_core.config index 72700c79a12f8fc99cf35a4ca0b3bf9904353b0e..a5688373f4eb29c7491ec51b40c67646544d42a0 100644 --- a/example/system/amp/openamp/driver_core/configs/d2000_aarch64_test_openamp_driver_core.config +++ b/example/system/amp/openamp/driver_core/configs/d2000_aarch64_test_openamp_driver_core.config @@ -1,19 +1,3 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=2 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -45,7 +29,7 @@ CONFIG_GCC_CODE_MODEL_SMALL=y # CONFIG_GCC_CODE_MODEL_LARGE is not set # end of Compiler configuration -CONFIG_USE_L3CACHE=y +# CONFIG_USE_L3CACHE is not set # CONFIG_BOOT_WITH_FLUSH_CACHE is not set # CONFIG_MMU_DEBUG_PRINTS is not set # end of Arm architecture configuration @@ -111,12 +95,6 @@ CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -325,21 +303,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/driver_core/configs/e2000d_aarch32_demo_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/e2000d_aarch32_demo_openamp_driver_core.config index 76bd1d1d691742e848c3a73cff9557d69f23693f..cda3ee86e68bc828bc1841ffcd6cbffd56b999a7 100644 --- a/example/system/amp/openamp/driver_core/configs/e2000d_aarch32_demo_openamp_driver_core.config +++ b/example/system/amp/openamp/driver_core/configs/e2000d_aarch32_demo_openamp_driver_core.config @@ -1,19 +1,3 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=1 -CONFIG_IPI_CHN_BITMASK=2 -# end of AMP Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -52,7 +36,7 @@ CONFIG_ARM_MFLOAT_ABI="hard" # end of Fpu configuration # end of Compiler configuration -CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# CONFIG_USE_AARCH64_L1_TO_AARCH32 is not set # end of Arm architecture configuration CONFIG_MMU_PAGE_SIZE=0x1000 @@ -130,12 +114,6 @@ CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -349,21 +327,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/driver_core/configs/e2000d_aarch64_demo_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/e2000d_aarch64_demo_openamp_driver_core.config index f94a813062653db31ec8a5f05b807fea00bf1a2e..e47d20e155284329e6fe9715aa43cf80a2e1bace 100644 --- a/example/system/amp/openamp/driver_core/configs/e2000d_aarch64_demo_openamp_driver_core.config +++ b/example/system/amp/openamp/driver_core/configs/e2000d_aarch64_demo_openamp_driver_core.config @@ -1,19 +1,3 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=1 -CONFIG_IPI_CHN_BITMASK=2 -# end of AMP Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -124,12 +108,6 @@ CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -338,21 +316,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/driver_core/configs/e2000q_aarch32_demo_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/e2000q_aarch32_demo_openamp_driver_core.config index ff7f4a7988135931457717dd5d9a9b5cf253bd9c..c97cf00ec9629e6b47b9b1a60eb73b9db154f440 100644 --- a/example/system/amp/openamp/driver_core/configs/e2000q_aarch32_demo_openamp_driver_core.config +++ b/example/system/amp/openamp/driver_core/configs/e2000q_aarch32_demo_openamp_driver_core.config @@ -1,19 +1,3 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=3 -CONFIG_IPI_CHN_BITMASK=8 -# end of AMP Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -52,7 +36,7 @@ CONFIG_ARM_MFLOAT_ABI="hard" # end of Fpu configuration # end of Compiler configuration -CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# CONFIG_USE_AARCH64_L1_TO_AARCH32 is not set # end of Arm architecture configuration CONFIG_MMU_PAGE_SIZE=0x1000 @@ -129,12 +113,6 @@ CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -348,21 +326,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/driver_core/configs/e2000q_aarch64_demo_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/e2000q_aarch64_demo_openamp_driver_core.config index 5ae566cef22e17e25403ce879ec3adea53e3f3b6..ad8e9e31fecc234648796e7e9ccdb58c2b0a408a 100644 --- a/example/system/amp/openamp/driver_core/configs/e2000q_aarch64_demo_openamp_driver_core.config +++ b/example/system/amp/openamp/driver_core/configs/e2000q_aarch64_demo_openamp_driver_core.config @@ -1,19 +1,3 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=3 -CONFIG_IPI_CHN_BITMASK=8 -# end of AMP Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -123,12 +107,6 @@ CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -337,21 +315,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/driver_core/configs/ft2004_aarch32_dsk_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/ft2004_aarch32_dsk_openamp_driver_core.config deleted file mode 100644 index d0c2758ac609aabb9884db1214a89a897e0c1ae7..0000000000000000000000000000000000000000 --- a/example/system/amp/openamp/driver_core/configs/ft2004_aarch32_dsk_openamp_driver_core.config +++ /dev/null @@ -1,392 +0,0 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=1 -CONFIG_IPI_CHN_BITMASK=2 -# end of AMP Config -# end of Project Configuration - -CONFIG_USE_FREERTOS=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_L3CACHE=y -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_E2000D is not set -# CONFIG_TARGET_E2000S is not set -CONFIG_TARGET_FT2004=y -# CONFIG_TARGET_D2000 is not set -# CONFIG_TARGET_PD2308 is not set -CONFIG_SOC_NAME="ft2004" -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_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="dsk" -CONFIG_FT2004_DSK_BOARD=y - -# -# IO mux configuration when board start up -# -# CONFIG_CUS_DEMO_BOARD is not set - -# -# Build project name -# -CONFIG_TARGET_NAME="openamp_driver_core" -# end of Build project name -# end of Board Configuration - -# -# Sdk common configuration -# -CONFIG_ELOG_LINE_BUF_SIZE=0x100 -CONFIG_LOG_VERBOS=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set -# CONFIG_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 -# end of Sdk common configuration - -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - -# -# Drivers configuration -# -CONFIG_USE_IOMUX=y -CONFIG_ENABLE_IOCTRL=y -# CONFIG_ENABLE_IOPAD is not set -# 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_USB 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_SCMI_MHU is not set -# CONFIG_USE_I2S is not set -# CONFIG_USE_I3C is not set -# end of Drivers 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 is not set -# 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=0x80100000 -CONFIG_IMAGE_MAX_LENGTH=0x2000000 -CONFIG_HEAP_SIZE=1 -CONFIG_SVC_STACK_SIZE=0x1000 -CONFIG_SYS_STACK_SIZE=0x1000 -CONFIG_IRQ_STACK_SIZE=0x1000 -CONFIG_ABORT_STACK_SIZE=0x1000 -CONFIG_FIQ_STACK_SIZE=0x1000 -CONFIG_UNDEF_STACK_SIZE=0x1000 -# end of Linker Options -# end of Build setup - -# -# Component Configuration -# - -# -# Freertos Uart Drivers -# -CONFIG_FREERTOS_USE_UART=y -# end of Freertos Uart Drivers - -# -# Freertos Pwm Drivers -# -# CONFIG_FREERTOS_USE_PWM is not set -# end of Freertos Pwm Drivers - -# -# Freertos Qspi Drivers -# -# CONFIG_FREERTOS_USE_QSPI is not set -# end of Freertos Qspi Drivers - -# -# Freertos Wdt Drivers -# -# CONFIG_FREERTOS_USE_WDT is not set -# end of Freertos Wdt Drivers - -# -# Freertos Eth Drivers -# -# CONFIG_FREERTOS_USE_XMAC is not set -# CONFIG_FREERTOS_USE_GMAC is not set -# end of Freertos Eth Drivers - -# -# Freertos Spim Drivers -# -# CONFIG_FREERTOS_USE_FSPIM is not set -# end of Freertos Spim Drivers - -# -# Freertos DMA Drivers -# -# CONFIG_FREERTOS_USE_FDDMA is not set -# CONFIG_FREERTOS_USE_FGDMA is not set -# end of Freertos DMA Drivers - -# -# Freertos Adc Drivers -# -# CONFIG_FREERTOS_USE_ADC is not set -# end of Freertos Adc Drivers - -# -# Freertos Can Drivers -# -# CONFIG_FREERTOS_USE_CAN is not set -# end of Freertos Can Drivers - -# -# Freertos I2c Drivers -# -# CONFIG_FREERTOS_USE_I2C is not set -# end of Freertos I2c Drivers - -# -# Freertos Mio Drivers -# -# CONFIG_FREERTOS_USE_MIO is not set -# end of Freertos Mio Drivers - -# -# Freertos Timer Drivers -# -# CONFIG_FREERTOS_USE_TIMER is not set -# end of Freertos Timer Drivers - -# -# Freertos Media Drivers -# -# CONFIG_FREERTOS_USE_MEDIA is not set -# end of Freertos Media Drivers - -# -# Freertos I2s Drivers -# -# CONFIG_FREERTOS_USE_I2S is not set -# end of Freertos I2s Drivers -# end of Component 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=y -CONFIG_USE_LIBMETAL=y - -# -# OpenAmp -# -CONFIG_USE_OPENAMP=y -CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 -# CONFIG_SKIP_SHBUF_IO_WRITE is not set -# CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config -# end of OpenAmp - -# CONFIG_USE_YMODEM is not set -# CONFIG_USE_SFUD is not set -CONFIG_USE_BACKTRACE=y -# CONFIG_USE_FATFS_0_1_4 is not set -CONFIG_USE_TLSF=y -# 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_CHERRY_USB is not set -# CONFIG_USE_FSL_SDMMC is not set -# CONFIG_USE_FSL_WIFI is not set -# end of Third-party configuration - -# -# FreeRTOS Kernel Configuration -# -CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y -CONFIG_FREERTOS_HZ=1000 -CONFIG_FREERTOS_MAX_PRIORITIES=32 -CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=13 -CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=11 -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_MINIMAL_TASK_STACKSIZE=1024 -CONFIG_FREERTOS_MAX_TASK_NAME_LEN=32 -CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 -CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 -CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 -CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y -CONFIG_FREERTOS_USE_TRACE_FACILITY=y -CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y -# CONFIG_FREERTOS_USE_TICKLESS_IDLE is not set -CONFIG_FREERTOS_TOTAL_HEAP_SIZE=10240 -CONFIG_FREERTOS_TASK_FPU_SUPPORT=1 -# CONFIG_FREERTOS_USE_POSIX is not set -# end of FreeRTOS Kernel Configuration diff --git a/example/system/amp/openamp/driver_core/configs/ft2004_aarch64_dsk_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/ft2004_aarch64_dsk_openamp_driver_core.config deleted file mode 100644 index edf4585af9a3185641a5dea361026757c85b947e..0000000000000000000000000000000000000000 --- a/example/system/amp/openamp/driver_core/configs/ft2004_aarch64_dsk_openamp_driver_core.config +++ /dev/null @@ -1,381 +0,0 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=1 -CONFIG_IPI_CHN_BITMASK=2 -# end of AMP Config -# end of Project Configuration - -CONFIG_USE_FREERTOS=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_USE_L3CACHE=y -# 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_E2000D is not set -# CONFIG_TARGET_E2000S is not set -CONFIG_TARGET_FT2004=y -# CONFIG_TARGET_D2000 is not set -# CONFIG_TARGET_PD2308 is not set -CONFIG_SOC_NAME="ft2004" -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_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="dsk" -CONFIG_FT2004_DSK_BOARD=y - -# -# IO mux configuration when board start up -# -# CONFIG_CUS_DEMO_BOARD is not set - -# -# Build project name -# -CONFIG_TARGET_NAME="openamp_driver_core" -# end of Build project name -# end of Board Configuration - -# -# Sdk common configuration -# -CONFIG_ELOG_LINE_BUF_SIZE=0x100 -CONFIG_LOG_VERBOS=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set -# CONFIG_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 -# end of Sdk common configuration - -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - -# -# Drivers configuration -# -CONFIG_USE_IOMUX=y -CONFIG_ENABLE_IOCTRL=y -# CONFIG_ENABLE_IOPAD is not set -# 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_USB 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_SCMI_MHU is not set -# CONFIG_USE_I2S is not set -# CONFIG_USE_I3C is not set -# end of Drivers 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 is not set -# 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=0x80100000 -CONFIG_IMAGE_MAX_LENGTH=0x2000000 -CONFIG_HEAP_SIZE=1 -CONFIG_STACK_SIZE=0x400 -# end of Linker Options -# end of Build setup - -# -# Component Configuration -# - -# -# Freertos Uart Drivers -# -CONFIG_FREERTOS_USE_UART=y -# end of Freertos Uart Drivers - -# -# Freertos Pwm Drivers -# -# CONFIG_FREERTOS_USE_PWM is not set -# end of Freertos Pwm Drivers - -# -# Freertos Qspi Drivers -# -# CONFIG_FREERTOS_USE_QSPI is not set -# end of Freertos Qspi Drivers - -# -# Freertos Wdt Drivers -# -# CONFIG_FREERTOS_USE_WDT is not set -# end of Freertos Wdt Drivers - -# -# Freertos Eth Drivers -# -# CONFIG_FREERTOS_USE_XMAC is not set -# CONFIG_FREERTOS_USE_GMAC is not set -# end of Freertos Eth Drivers - -# -# Freertos Spim Drivers -# -# CONFIG_FREERTOS_USE_FSPIM is not set -# end of Freertos Spim Drivers - -# -# Freertos DMA Drivers -# -# CONFIG_FREERTOS_USE_FDDMA is not set -# CONFIG_FREERTOS_USE_FGDMA is not set -# end of Freertos DMA Drivers - -# -# Freertos Adc Drivers -# -# CONFIG_FREERTOS_USE_ADC is not set -# end of Freertos Adc Drivers - -# -# Freertos Can Drivers -# -# CONFIG_FREERTOS_USE_CAN is not set -# end of Freertos Can Drivers - -# -# Freertos I2c Drivers -# -# CONFIG_FREERTOS_USE_I2C is not set -# end of Freertos I2c Drivers - -# -# Freertos Mio Drivers -# -# CONFIG_FREERTOS_USE_MIO is not set -# end of Freertos Mio Drivers - -# -# Freertos Timer Drivers -# -# CONFIG_FREERTOS_USE_TIMER is not set -# end of Freertos Timer Drivers - -# -# Freertos Media Drivers -# -# CONFIG_FREERTOS_USE_MEDIA is not set -# end of Freertos Media Drivers - -# -# Freertos I2s Drivers -# -# CONFIG_FREERTOS_USE_I2S is not set -# end of Freertos I2s Drivers -# end of Component 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=y -CONFIG_USE_LIBMETAL=y - -# -# OpenAmp -# -CONFIG_USE_OPENAMP=y -CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 -# CONFIG_SKIP_SHBUF_IO_WRITE is not set -# CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config -# end of OpenAmp - -# CONFIG_USE_YMODEM is not set -# CONFIG_USE_SFUD is not set -CONFIG_USE_BACKTRACE=y -# CONFIG_USE_FATFS_0_1_4 is not set -CONFIG_USE_TLSF=y -# 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_CHERRY_USB is not set -# CONFIG_USE_FSL_SDMMC is not set -# CONFIG_USE_FSL_WIFI is not set -# end of Third-party configuration - -# -# FreeRTOS Kernel Configuration -# -CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y -CONFIG_FREERTOS_HZ=1000 -CONFIG_FREERTOS_MAX_PRIORITIES=32 -CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=13 -CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=11 -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_MINIMAL_TASK_STACKSIZE=1024 -CONFIG_FREERTOS_MAX_TASK_NAME_LEN=32 -CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 -CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 -CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 -CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y -CONFIG_FREERTOS_USE_TRACE_FACILITY=y -CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y -# CONFIG_FREERTOS_USE_TICKLESS_IDLE is not set -CONFIG_FREERTOS_TOTAL_HEAP_SIZE=10240 -CONFIG_FREERTOS_TASK_FPU_SUPPORT=1 -# CONFIG_FREERTOS_USE_POSIX is not set -# end of FreeRTOS Kernel Configuration diff --git a/example/system/amp/openamp/driver_core/configs/phytiumpi_aarch32_firefly_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/phytiumpi_aarch32_firefly_openamp_driver_core.config index f384f2ff5268e8a2b7af70555b8f774cac190be2..ac25d0a3c422d9b1402c3b0ac959b049203c4e7c 100644 --- a/example/system/amp/openamp/driver_core/configs/phytiumpi_aarch32_firefly_openamp_driver_core.config +++ b/example/system/amp/openamp/driver_core/configs/phytiumpi_aarch32_firefly_openamp_driver_core.config @@ -1,19 +1,3 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=3 -CONFIG_IPI_CHN_BITMASK=8 -# end of AMP Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -52,7 +36,7 @@ CONFIG_ARM_MFLOAT_ABI="hard" # end of Fpu configuration # end of Compiler configuration -CONFIG_USE_AARCH64_L1_TO_AARCH32=y +# CONFIG_USE_AARCH64_L1_TO_AARCH32 is not set # end of Arm architecture configuration CONFIG_MMU_PAGE_SIZE=0x1000 @@ -128,12 +112,6 @@ CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -347,21 +325,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/driver_core/configs/phytiumpi_aarch64_firefly_openamp_driver_core.config b/example/system/amp/openamp/driver_core/configs/phytiumpi_aarch64_firefly_openamp_driver_core.config index 267524d89624340ee8a625140368742f8dab45c5..5efd3bade64695b37180a822f898d4603a008df0 100644 --- a/example/system/amp/openamp/driver_core/configs/phytiumpi_aarch64_firefly_openamp_driver_core.config +++ b/example/system/amp/openamp/driver_core/configs/phytiumpi_aarch64_firefly_openamp_driver_core.config @@ -1,19 +1,3 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=3 -CONFIG_IPI_CHN_BITMASK=8 -# end of AMP Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -122,12 +106,6 @@ CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -336,21 +314,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/driver_core/fig/1677585960509.png b/example/system/amp/openamp/driver_core/fig/1677585960509.png new file mode 100644 index 0000000000000000000000000000000000000000..38ac275275e61d89fb31211a2b7cd2116b561935 Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/1677585960509.png differ diff --git a/example/system/amp/openamp/driver_core/fig/20230512192325.png b/example/system/amp/openamp/driver_core/fig/20230512192325.png new file mode 100644 index 0000000000000000000000000000000000000000..683cdf3f2d2b2b50a7bf928ce6a3e6f7ec738209 Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/20230512192325.png differ diff --git a/example/system/amp/openamp/driver_core/fig/20230512195526.png b/example/system/amp/openamp/driver_core/fig/20230512195526.png new file mode 100644 index 0000000000000000000000000000000000000000..bf31250f4ce2a60311d724dd61c4c17230e2c66b Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/20230512195526.png differ diff --git a/example/system/amp/openamp/driver_core/fig/20230512200435.png b/example/system/amp/openamp/driver_core/fig/20230512200435.png new file mode 100644 index 0000000000000000000000000000000000000000..c61f70c440846f6910a7c0eefbe1a1385dbecc8f Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/20230512200435.png differ diff --git a/example/system/amp/openamp/driver_core/fig/20231017160632.png b/example/system/amp/openamp/driver_core/fig/20231017160632.png new file mode 100644 index 0000000000000000000000000000000000000000..6f81301fa6f47f78b86cdf3f5de10673cd33f58e Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/20231017160632.png differ diff --git a/example/system/amp/openamp/driver_core/fig/20231017165755.png b/example/system/amp/openamp/driver_core/fig/20231017165755.png new file mode 100644 index 0000000000000000000000000000000000000000..e4310e296efa50cf9aaba42da1f0bfac2764e03d Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/20231017165755.png differ diff --git a/example/system/amp/openamp/driver_core/fig/OpenAMPConfig.png b/example/system/amp/openamp/driver_core/fig/OpenAMPConfig.png new file mode 100644 index 0000000000000000000000000000000000000000..c8fd33a1d3d01bbefec2e532f4f14016a5d92697 Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/OpenAMPConfig.png differ diff --git a/example/system/amp/openamp/driver_core/fig/OpenAMPConfig0.png b/example/system/amp/openamp/driver_core/fig/OpenAMPConfig0.png new file mode 100644 index 0000000000000000000000000000000000000000..e3ca17958d633631dd3ba95cca2d5df4706de0c9 Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/OpenAMPConfig0.png differ diff --git a/example/system/amp/openamp/driver_core/fig/OpenAMPConfig1.png b/example/system/amp/openamp/driver_core/fig/OpenAMPConfig1.png new file mode 100644 index 0000000000000000000000000000000000000000..5fdf22356fde79c24dea10defb39d104f57e0dd2 Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/OpenAMPConfig1.png differ diff --git a/example/system/amp/openamp/driver_core/fig/e2000_aarch32_openamp_startup.png b/example/system/amp/openamp/driver_core/fig/e2000_aarch32_openamp_startup.png new file mode 100644 index 0000000000000000000000000000000000000000..4f50f3d124425b8371e2229b0ea639bc1393d504 Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/e2000_aarch32_openamp_startup.png differ diff --git a/example/system/amp/openamp/driver_core/fig/e2000_aarch64_openamp_startup.png b/example/system/amp/openamp/driver_core/fig/e2000_aarch64_openamp_startup.png new file mode 100644 index 0000000000000000000000000000000000000000..ece3508b32dd54a48b4d98832cec77edff4549c6 Binary files /dev/null and b/example/system/amp/openamp/driver_core/fig/e2000_aarch64_openamp_startup.png differ diff --git a/example/system/amp/openamp/driver_core/ft_openamp.ld b/example/system/amp/openamp/driver_core/ft_openamp.ld new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/example/system/amp/openamp/driver_core/inc/rpmsg_demo_manager.h b/example/system/amp/openamp/driver_core/inc/rpmsg_demo_manager.h new file mode 100644 index 0000000000000000000000000000000000000000..fc37d93d3fa65ab8d9276b330962c6dcd91e1bff --- /dev/null +++ b/example/system/amp/openamp/driver_core/inc/rpmsg_demo_manager.h @@ -0,0 +1,41 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: rpmsg_demo_manager.h.h + * Created Date: 2024-07-11 11:01:57 + * Last Modified: 2024-07-11 15:27:33 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + */ + +#ifndef RPMSG_DEMO_MANAGER_H_ +#define RPMSG_DEMO_MANAGER_H_ + +#include "FreeRTOS.h" +#include "ftypes.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +BaseType_t FFreeRTOSOpenampExample(void); + +#ifdef __cplusplus +} +#endif + +#endif /* RPMSG_DEMO_MANAGER_H_ */ diff --git a/example/system/amp/openamp/driver_core/main.c b/example/system/amp/openamp/driver_core/main.c index bf1caa3343e2309958a9991f34d8a3fb772dac54..8bc8e775e03d022b8f43ad073fb8b3441ce2635f 100644 --- a/example/system/amp/openamp/driver_core/main.c +++ b/example/system/amp/openamp/driver_core/main.c @@ -23,30 +23,47 @@ * 1.1 huanghe 2023/03/09 Adapt OpenAMP routines based on e2000D/Q */ - +#include +#include "FreeRTOS.h" #include "ftypes.h" -#include "fpsci.h" -#include "shell.h" -#include "fsleep.h" -#include "fprintk.h" -#include "fdebug.h" +#include "sdkconfig.h" +#ifdef CONFIG_USE_LETTER_SHELL #include "shell_port.h" +#include "shell.h" +#else +#include "task.h" +#include "rpmsg_demo_manager.h" + +void OpenampExampleTaskEntry(void) +{ + /*Demo read and write by sfud*/ + FFreeRTOSOpenampExample(); -#define OPENAMP_MAIN_DEBUG_TAG "OPENAMP_MAIN" -#define OPENAMP_MAIN_DEBUG_I(format, ...) FT_DEBUG_PRINT_I(OPENAMP_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) -#define OPENAMP_MAIN_DEBUG_W(format, ...) FT_DEBUG_PRINT_W(OPENAMP_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) -#define OPENAMP_MAIN_DEBUG_E(format, ...) FT_DEBUG_PRINT_E(OPENAMP_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) + printf("[test_end]\r\n"); + + vTaskDelete(NULL); +} +#endif extern int FOpenampCmdEntry(int argc, char *argv[]) ; int main(void) { - BaseType_t ret; - - ret = LSUserShellTask() ; + BaseType_t ret = pdPASS; /* 定义一个创建信息返回值,默认为 pdPASS */ +#ifdef CONFIG_USE_LETTER_SHELL + ret = LSUserShellTask(); if(ret != pdPASS) goto FAIL_EXIT; - +#else + taskENTER_CRITICAL(); /* no schedule when create task */ + ret = xTaskCreate((TaskFunction_t )OpenampExampleTaskEntry, /* 任务入口函数 */ + (const char* )"OpenampExampleTaskEntry",/* 任务名字 */ + (uint16_t )(4096*2), /* 任务栈大小 */ + (void* )NULL,/* 任务入口函数参数 */ + (UBaseType_t )4, /* 任务的优先级 */ + NULL); /* 任务控制块指针 */ + taskEXIT_CRITICAL(); /* allow schedule since task created */ +#endif vTaskStartScheduler(); /* 启动任务,开启调度 */ while (1); /* 正常不会执行到这里 */ diff --git a/example/system/amp/openamp/driver_core/makefile b/example/system/amp/openamp/driver_core/makefile index a8c4d39fb09210f7ed25cddf004edd805b15c514..0f6667a9bef0fbd5ae65ce8c0dcb112d7a4f2a76 100644 --- a/example/system/amp/openamp/driver_core/makefile +++ b/example/system/amp/openamp/driver_core/makefile @@ -4,7 +4,9 @@ FREERTOS_SDK_DIR = $(CURDIR)/../../../../../ USER_CSRC := main.c USER_CSRC += $(wildcard src/*.c) -USER_INCLUDE := $(PROJECT_DIR) +USER_INCLUDE += $(PROJECT_DIR) \ + $(PROJECT_DIR)/inc \ + $(PROJECT_DIR)/../common include $(FREERTOS_SDK_DIR)/tools/makeall.mk diff --git a/example/system/amp/openamp/driver_core/sdkconfig b/example/system/amp/openamp/driver_core/sdkconfig index 267524d89624340ee8a625140368742f8dab45c5..5efd3bade64695b37180a822f898d4603a008df0 100644 --- a/example/system/amp/openamp/driver_core/sdkconfig +++ b/example/system/amp/openamp/driver_core/sdkconfig @@ -1,19 +1,3 @@ - -# -# Project Configuration -# - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_SPIN_MEM=0x80000000 -CONFIG_TARGET_CPU_MASK=3 -CONFIG_IPI_CHN_BITMASK=8 -# end of AMP Config -# end of Project Configuration - CONFIG_USE_FREERTOS=y # @@ -122,12 +106,6 @@ CONFIG_INTERRUPT_ROLE_MASTER=y # CONFIG_INTERRUPT_ROLE_SLAVE is not set # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -336,21 +314,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xc0020000 -CONFIG_VRING_RX_ADDR=0xc0024000 -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 # CONFIG_SKIP_SHBUF_IO_WRITE is not set # CONFIG_USE_MASTER_VRING_DEFINE is not set - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +# CONFIG_USE_CACHE_COHERENCY is not set # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp/driver_core/sdkconfig.h b/example/system/amp/openamp/driver_core/sdkconfig.h index 3b30086f338502acfab3c245b2a109aa3d7bf064..0a34d7f2ac1bc48395cb4fa661f368bb8b467d35 100644 --- a/example/system/amp/openamp/driver_core/sdkconfig.h +++ b/example/system/amp/openamp/driver_core/sdkconfig.h @@ -1,17 +1,6 @@ #ifndef SDK_CONFIG_H__ #define SDK_CONFIG_H__ -/* Project Configuration */ - -/* AMP Config */ - -#define CONFIG_IPI_IRQ_NUM 9 -#define CONFIG_IPI_IRQ_NUM_PRIORITY 1 -#define CONFIG_SPIN_MEM 0x80000000 -#define CONFIG_TARGET_CPU_MASK 3 -#define CONFIG_IPI_CHN_BITMASK 8 -/* end of AMP Config */ -/* end of Project Configuration */ #define CONFIG_USE_FREERTOS /* Arch configuration */ @@ -109,11 +98,6 @@ /* CONFIG_INTERRUPT_ROLE_SLAVE is not set */ /* end of Sdk common configuration */ -/* Image information configuration */ - -/* CONFIG_IMAGE_INFO is not set */ -/* end of Image information configuration */ - /* Drivers configuration */ #define CONFIG_USE_IOMUX @@ -293,20 +277,9 @@ #define CONFIG_USE_OPENAMP #define CONFIG_USE_OPENAMP_IPI -#define CONFIG_OPENAMP_RESOURCES_ADDR 0xc0000000 -#define CONFIG_VRING_TX_ADDR 0xc0020000 -#define CONFIG_VRING_RX_ADDR 0xc0024000 -#define CONFIG_VRING_SIZE 0x100 -#define CONFIG_POLL_BASE_ADDR 0xc0224000 /* CONFIG_SKIP_SHBUF_IO_WRITE is not set */ /* CONFIG_USE_MASTER_VRING_DEFINE is not set */ - -/* Baremetal config */ - -/* CONFIG_MEM_NO_CACHE is not set */ -/* CONFIG_MEM_WRITE_THROUGH is not set */ -#define CONFIG_MEM_NORMAL -/* end of Baremetal config */ +/* CONFIG_USE_CACHE_COHERENCY is not set */ /* end of OpenAmp */ /* CONFIG_USE_YMODEM is not set */ /* CONFIG_USE_SFUD is not set */ diff --git a/example/system/amp/openamp/driver_core/src/rpmsg-demo-manager_cmd.c b/example/system/amp/openamp/driver_core/src/rpmsg-demo-manager_cmd.c index aa218b8fc4afae21019bed028d558261beb0eb38..e8f9f78903205586fe1ba8d8789c804633157f4c 100644 --- a/example/system/amp/openamp/driver_core/src/rpmsg-demo-manager_cmd.c +++ b/example/system/amp/openamp/driver_core/src/rpmsg-demo-manager_cmd.c @@ -30,25 +30,29 @@ #include #include #include "strto.h" -#include "shell.h" + #include "platform_info.h" #include "rpmsg_service.h" -#include #include "rsc_table.h" +#include "helper.h" +#include "load_fw.h" +#include "fparameters.h" #include "fdebug.h" -#include "fkernel.h" #include "felf.h" #include "sdkconfig.h" +#include "libmetal_configs.h" +#include "openamp_configs.h" +#include "fsleep.h" #include "FreeRTOS.h" #include "task.h" -#include "finterrupt.h" -#include "fpsci.h" - +#ifdef CONFIG_USE_LETTER_SHELL +#include "shell.h" +#endif /************************** Constant Definitions *****************************/ /***************** Macros (Inline Functions) Definitions *********************/ -#define DEMO_MANG_MASTER_DEBUG_TAG " DEMO_MANG_MASTER" +#define DEMO_MANG_MASTER_DEBUG_TAG "DEMO_MANG_MASTER" #define DEMO_MANG_MASTER_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( DEMO_MANG_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) #define DEMO_MANG_MASTER_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( DEMO_MANG_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) #define DEMO_MANG_MASTER_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( DEMO_MANG_MASTER_DEBUG_TAG, format, ##__VA_ARGS__) @@ -58,36 +62,47 @@ #define MANAGE_READ 1 #define MANAGE_WAIT 0 -#define DEMO_MANAGER_ADDR (RPMSG_RESERVED_ADDRESSES - 1) - #define RPMSG_PING_DEMO 0x1 #define RPMSG_SAM_PING_DEMO 0X2 #define RPMSG_MAT_MULT_DEMO 0X3 #define RPMSG_NO_COPY_DEMO 0X4 #define RPMSG_DEMO_MAX 0x5 -#define REMOTEPROC_MASK BIT(CONFIG_TARGET_CPU_MASK) -#define ELF_LOAD_ADDR 0xf1000000U /************************** Variable Definitions *****************************/ -/* Globals */ - -static struct rpmsg_endpoint lept; -static struct rpmsg_device *rpdev = NULL; - +struct metal_device kick_device_00 = { + .name = SLAVE_00_KICK_DEV_NAME, + .bus = NULL, + .irq_num = 1, + .irq_info = (void *)SLAVE_00_SGI, +} ; + +struct remoteproc_priv slave_00_priv = { + .kick_dev_name = SLAVE_00_KICK_DEV_NAME , + .kick_dev_bus_name = KICK_BUS_NAME , + .cpu_id = SLAVE_DEVICE_CORE_00 ,/* 设置CPU ID */ + + .src_table_attribute = SLAVE00_SOURCE_TABLE_ATTRIBUTE , + + /* |rx vring|tx vring|share buffer| */ + .share_mem_va = SLAVE00_SHARE_MEM_ADDR , + .share_mem_pa = SLAVE00_SHARE_MEM_ADDR , + .share_buffer_offset = SLAVE00_VRING_SIZE , + .share_mem_size = SLAVE00_SHARE_MEM_SIZE , + .share_mem_attribute = SLAVE00_SHARE_BUFFER_ATTRIBUTE , +} ; +/*OpenAMP 相关定义*/ +struct remoteproc remoteproc_slave_00 ; +static struct rpmsg_device *rpdev_slave_00 = NULL; +static struct rpmsg_endpoint ept_master_slave_00; +/* 标志相关定义 */ static int volatile cmd_ok = MANAGE_WAIT; static u32 demo_flag = RPMSG_PING_DEMO; -static void *platform = NULL; static u32 elf_boot_flag = 0; - -extern struct image_store_ops mem_image_store_ops; -struct mem_file { - const void *base; -}; - -static struct mem_file image = { - .base = (void *)ELF_LOAD_ADDR, -}; - +/* 镜像相关定义 */ +extern const struct image_store_ops mem_image_store_ops; +static struct mem_file image[FCORE_NUM] = {(void *)0}; +extern void * amp_img_start; +extern void * amp_img_end; /************************** Function Prototypes ******************************/ extern int rpmsg_echo(struct rpmsg_device *rdev, void *priv); extern int rpmsg_sample_echo(struct rpmsg_device *rdev, void *priv) ; @@ -95,53 +110,6 @@ extern int matrix_multiplyd(struct rpmsg_device *rdev, void *priv) ; extern int rpmsg_nocopy_echo(struct rpmsg_device *rdev, void *priv) ; static int FOpenampClose(void *platform); -static void FOpenampCmdUsage() -{ - printf("Usage:\r\n"); - printf("openamp auto \r\n"); - printf("-- Auto running.\r\n"); - printf("-- [1] This application echoes back data that was sent to it by the master core.\r\n"); - printf("-- [2] This application simulate sample rpmsg driver. For this it echo 100 time message sent by the rpmsg sample client available in distribution.\r\n"); - printf("-- [3] This application receives two matrices from the master, multiplies them and returns the result to the master core.\r\n"); - printf("-- [4] This application echoes back data that was sent to it by the master core.\r\n"); -} - -/*-----------------------------------------------------------------------------* - * Image Function - *-----------------------------------------------------------------------------*/ -static int FLoadelfRemoteproc(struct image_store_ops *store_ops,void *platform) -{ - int ret = 0; - struct remoteproc *rproc = platform; - struct remoteproc_priv *prproc = rproc->priv; - - prproc->cpu_mask = REMOTEPROC_MASK; - if (rproc == NULL) - return -1; - /* Configure remoteproc to get ready to load executable */ - remoteproc_config(rproc, NULL); - - /* Load remoteproc executable */ - DEMO_MANG_MASTER_DEBUG_I("Start to load executable with remoteproc_load(0x%x) \r\n",(unsigned long)image.base); - - rproc->bootaddr = ElfLoadElfImagePhdr((unsigned long)image.base); - if (!rproc->bootaddr) - { - rproc->state = RPROC_READY; - } - /* Start the processor */ - ret = remoteproc_start(rproc); - if (ret) - { - remoteproc_shutdown(rproc); - DEMO_MANG_MASTER_DEBUG_E("failed to start processor\r\n"); - return ret; - } - DEMO_MANG_MASTER_DEBUG_I("successfully started the processor\r\n"); - - return ret; -} - /*-----------------------------------------------------------------------------* * RPMSG endpoint callbacks *-----------------------------------------------------------------------------*/ @@ -169,7 +137,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; - rpmsg_destroy_ept(&lept); + rpmsg_destroy_ept(&ept_master_slave_00); DEMO_MANG_MASTER_DEBUG_E("Echo test: service is destroyed.\r\n"); } @@ -177,13 +145,13 @@ static void rpmsg_name_service_bind_cb(struct rpmsg_device *rdev, const char *name, uint32_t dest) { DEMO_MANG_MASTER_DEBUG_I("New endpoint notification is received.\r\n"); - if (strcmp(name, DEMO_SERVICE_NAME)) + if (strcmp(name, RPMSG_SERVICE_00_NAME)) { DEMO_MANG_MASTER_DEBUG_E("Unexpected name service %s.\r\n", name); } else - (void)rpmsg_create_ept(&lept, rdev, DEMO_SERVICE_NAME, - DEMO_MANAGER_ADDR, dest, + (void)rpmsg_create_ept(&ept_master_slave_00, rdev, RPMSG_SERVICE_00_NAME, + MASTER_DRIVER_EPT_ADDR, dest, rpmsg_endpoint_cb, rpmsg_service_unbind); } @@ -196,15 +164,15 @@ static int FManageEptCreat(struct rpmsg_device *rdev, void *priv) int ret = 0; /* Create RPMsg endpoint */ - ret = rpmsg_create_ept(&lept, rdev, DEMO_SERVICE_NAME, - DEMO_MANAGER_ADDR, RPMSG_ADDR_ANY, + ret = rpmsg_create_ept(&ept_master_slave_00, rdev, RPMSG_SERVICE_00_NAME, + MASTER_DRIVER_EPT_ADDR, SLAVE_DEVICE_00_EPT_ADDR, rpmsg_endpoint_cb, rpmsg_service_unbind); if (ret) { DEMO_MANG_MASTER_DEBUG_E("Failed to create endpoint. %d \r\n", ret); return -1; } - while (!is_rpmsg_ept_ready(&lept)) + while (!is_rpmsg_ept_ready(&ept_master_slave_00)) { DEMO_MANG_MASTER_DEBUG_I("start to wait platform_poll \r\n"); platform_poll(priv); @@ -217,7 +185,7 @@ int FRunningApp(struct rpmsg_device *rdev, void *priv) { int ret = 0; - ret = rpmsg_send(&lept, &demo_flag, sizeof(u32)); + ret = rpmsg_send(&ept_master_slave_00, &demo_flag, sizeof(u32)); if (ret < 0) { DEMO_MANG_MASTER_DEBUG_E("Failed to send data,ret:%d...\r\n",ret); @@ -296,37 +264,18 @@ int FRunningApp(struct rpmsg_device *rdev, void *priv) /*-----------------------------------------------------------------------------* * Application entry point *-----------------------------------------------------------------------------*/ -static int FRpmsgDemoManager(void *platform) -{ - int ret = 0; - rpdev = platform_create_rpmsg_vdev(platform, 0, VIRTIO_DEV_MASTER, NULL, rpmsg_name_service_bind_cb); - if (!rpdev) - { - DEMO_MANG_MASTER_DEBUG_E("Failed to create rpmsg virtio device.\r\n"); - ret = platform_cleanup(platform); - return ret; - } - else - { - ret = FManageEptCreat(rpdev, platform); - } - return ret; -} - - - static int FOpenampClose(void *platform) { int ret = 0; struct remoteproc *rproc = platform; if (rproc == NULL) return -1; - if (rpdev == NULL) + if (rpdev_slave_00 == NULL) return -1; - rpmsg_destroy_ept(&lept); + rpmsg_destroy_ept(&ept_master_slave_00); - platform_release_rpmsg_vdev(rpdev, platform); + platform_release_rpmsg_vdev(rpdev_slave_00, platform); ret = remoteproc_shutdown(rproc); if (ret != 0) @@ -343,49 +292,106 @@ static int FOpenampClose(void *platform) return ret; } +static void * CheckElfStartAddress(void * address) +{ + if(ElfIsImageValid((unsigned long)address)) + { + return address; + } + return NULL; +} + + int FOpenampExample(void) { int ret = 0; - demo_flag = RPMSG_PING_DEMO; - + printf("amp_img_start is 0x%x \r\n",&_img_start); + printf("amp_img_end is 0x%x \r\n",&_img_end); if (elf_boot_flag == 0) { - /* Initialize platform */ - ret = platform_init(1, 0, &platform); - if (ret) + void *temp_address = &_img_start; + u32 i = 0; + while (temp_address < (void *)&_img_end) { - DEMO_MANG_MASTER_DEBUG_E("Failed to initialize platform.\r\n"); - platform_cleanup(platform); + void * boot_elf_address = CheckElfStartAddress((void *)temp_address); + if(boot_elf_address != NULL) + { + image[i].base = temp_address; + i++ ; + } + temp_address++; + } + for (u32 j = 0; j< i; j++) + { + printf("boot_elf_address is 0x%x. \r\n",image[j].base); + } + + init_system(); /* Initialize the system resources and environment */ + /* Initialize remoteproc */ + if (!platform_create_proc(&remoteproc_slave_00, &slave_00_priv, &kick_device_00)) + { + DEMO_MANG_MASTER_DEBUG_E("Failed to create remoteproc instance for slave 00\r\n"); + platform_cleanup(&remoteproc_slave_00); return -1; } - - ret = FLoadelfRemoteproc(&mem_image_store_ops,platform); - if (ret) + /*加载镜像,并启动,镜像的序号对应为 amp_config.json中 一个配置项 的索引位置*/ + if(load_exectuable_block(&remoteproc_slave_00, &mem_image_store_ops, &image[SLAVE00_IMAGE_NUM].base, NULL)) { - DEMO_MANG_MASTER_DEBUG_E("Failed to FLoadelfRemoteproc.\r\n"); - platform_cleanup(platform); return -1; } - - ret = FRpmsgDemoManager(platform); + /* Setup resource tables for the created remoteproc instances*/ + if (platform_setup_src_table(&remoteproc_slave_00, remoteproc_slave_00.rsc_table)) + { + DEMO_MANG_MASTER_DEBUG_E("Failed to setup src table for slave 00\r\n"); + return -1; + } + DEMO_MANG_MASTER_DEBUG_I("Setup resource tables for the created remoteproc instances is over \r\n"); + /* Setup shared memory regions for both remoteproc instances */ + if (platform_setup_share_mems(&remoteproc_slave_00)) + { + DEMO_MANG_MASTER_DEBUG_E("Failed to setup shared memory for slave 00\r\n"); + return -1; + } + 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); + if (!rpdev_slave_00) + { + DEMO_MANG_MASTER_DEBUG_E("Failed to create rpmsg vdev for slave 00\r\n"); + platform_cleanup(&remoteproc_slave_00); + return -1; + } + DEMO_MANG_MASTER_DEBUG_I("Create rpmsg virtual devices for communication \r\n"); + ret = FManageEptCreat(rpdev_slave_00, &remoteproc_slave_00); if (ret) { - return FOpenampClose(platform); + return FOpenampClose(&remoteproc_slave_00); } elf_boot_flag = 1; + fsleep_millisec(1000);/*等待slave 00 启动完成,并完成初始化任务调度*/ } if (elf_boot_flag == 1) { while (demo_flag < RPMSG_DEMO_MAX) { - ret = FRunningApp(rpdev, platform); + ret = FRunningApp(rpdev_slave_00, &remoteproc_slave_00); if (ret) { - return FOpenampClose(platform); + return FOpenampClose(&remoteproc_slave_00); } } } + vTaskDelay(pdMS_TO_TICKS(100)); + DEMO_MANG_MASTER_DEBUG_I("Stopping application...\r\n"); + if (ret != 0 && elf_boot_flag == 1 && demo_flag == (RPMSG_DEMO_MAX-1)) + { + printf("%s@%d: openamp example [failure] !!! \r\n", __func__, __LINE__); + } + else + { + printf("%s@%d: openamp example [success] !!! \r\n", __func__, __LINE__); + } return ret; } @@ -410,14 +416,43 @@ void RpmsgEchoTask( void * args ) /* Initialize platform */ DEMO_MANG_MASTER_DEBUG_I("start application"); ret = FOpenampExample(); - if (ret) + if (ret) { DEMO_MANG_MASTER_DEBUG_E("Failed to running example.\r\n"); } - DEMO_MANG_MASTER_DEBUG_I("Stopping application...\r\n"); vTaskDelete(NULL); } +BaseType_t FFreeRTOSOpenampExample(void) +{ + BaseType_t xReturn = pdPASS; + + xReturn = xTaskCreate((TaskFunction_t )RpmsgEchoTask, /* 任务入口函数 */ + (const char* )"RpmsgEchoTask",/* 任务名字 */ + (uint16_t )(4096*2), /* 任务栈大小 */ + (void* )NULL,/* 任务入口函数参数 */ + (UBaseType_t )4, /* 任务的优先级 */ + NULL); /* 任务控制块指针 */ + + if(xReturn != pdPASS) + { + DEMO_MANG_MASTER_DEBUG_E("Failed to create a RpmsgEchoTask task "); + return -1; + } + return xReturn; +} + +#ifdef CONFIG_USE_LETTER_SHELL +static void FOpenampCmdUsage() +{ + printf("Usage:\r\n"); + printf("openamp auto \r\n"); + printf("-- Auto running.\r\n"); + printf("-- [1] This application echoes back data that was sent to it by the master core.\r\n"); + printf("-- [2] This application simulate sample rpmsg driver. For this it echo 100 time message sent by the rpmsg sample client available in distribution.\r\n"); + printf("-- [3] This application receives two matrices from the master, multiplies them and returns the result to the master core.\r\n"); + printf("-- [4] This application echoes back data that was sent to it by the master core.\r\n"); +} BaseType_t FOpenampCmdEntry(int argc, char *argv[]) { @@ -425,21 +460,7 @@ BaseType_t FOpenampCmdEntry(int argc, char *argv[]) if (!strcmp(argv[1], "auto")) { - taskENTER_CRITICAL(); /* no schedule when create task */ - - ret = xTaskCreate((TaskFunction_t )RpmsgEchoTask, /* 任务入口函数 */ - (const char* )"RpmsgEchoTask",/* 任务名字 */ - (uint16_t )(4096*2), /* 任务栈大小 */ - (void* )NULL,/* 任务入口函数参数 */ - (UBaseType_t )4, /* 任务的优先级 */ - NULL); /* 任务控制块指针 */ - taskEXIT_CRITICAL(); /* allow schedule since task created */ - - if(ret != pdPASS) - { - DEMO_MANG_MASTER_DEBUG_E("Failed to create a RpmsgEchoTask task "); - return -1; - } + ret = FFreeRTOSOpenampExample(); } else { @@ -451,3 +472,4 @@ BaseType_t FOpenampCmdEntry(int argc, char *argv[]) } SHELL_EXPORT_CMD(SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), openamp, FOpenampCmdEntry, test freertos openamp); +#endif diff --git a/example/system/amp/openamp/driver_core/src/rpmsg-echo.c b/example/system/amp/openamp/driver_core/src/rpmsg-echo.c index c15fa7109943d081dd6fd542fdff39c0c785d950..a7742a8bca4fa1ddff344a564a63d6f08e594a9c 100644 --- a/example/system/amp/openamp/driver_core/src/rpmsg-echo.c +++ b/example/system/amp/openamp/driver_core/src/rpmsg-echo.c @@ -33,7 +33,6 @@ #include "rpmsg_service.h" #include #include "rsc_table.h" -#include "shell.h" #include "fcache.h" #include "fdebug.h" diff --git a/example/system/amp/openamp/figs/20240307172016.png b/example/system/amp/openamp/figs/20240307172016.png deleted file mode 100644 index 263037242b8f96ab44aa8c03cc5df1b795f30ed9..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/20240307172016.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/20240307172429.png b/example/system/amp/openamp/figs/20240307172429.png deleted file mode 100644 index 7d2cd500e34a6df0bc485842ba1dd90be8e50816..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/20240307172429.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/20240307172837.png b/example/system/amp/openamp/figs/20240307172837.png deleted file mode 100644 index bb860f4f7c99363951f4e2b5f0ac2178613121a7..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/20240307172837.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/20240307172918.png b/example/system/amp/openamp/figs/20240307172918.png deleted file mode 100644 index 0b7030a34bd573bb6948628b60d4f4deef8d751f..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/20240307172918.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/E2000D_aarch32_openamp_reault.png b/example/system/amp/openamp/figs/E2000D_aarch32_openamp_reault.png deleted file mode 100644 index d52ab0f09d0913295991f1dbd33d7fc0b674e311..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/E2000D_aarch32_openamp_reault.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/E2000D_aarch32_openamp_startup.png b/example/system/amp/openamp/figs/E2000D_aarch32_openamp_startup.png deleted file mode 100644 index dd80dc2589d50aea7e55fd06b629b0d016f21862..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/E2000D_aarch32_openamp_startup.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/E2000D_aarch64_openamp_startup.png b/example/system/amp/openamp/figs/E2000D_aarch64_openamp_startup.png deleted file mode 100644 index 051a9d85af291d2e080ab420ea3faa8adfe213ec..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/E2000D_aarch64_openamp_startup.png and /dev/null differ diff --git "a/example/system/amp/openamp/figs/OpenAMP\345\233\236\350\260\203\344\270\216\344\270\255\346\226\255\351\200\232\347\237\245\346\234\272\345\210\266.svg" "b/example/system/amp/openamp/figs/OpenAMP\345\233\236\350\260\203\344\270\216\344\270\255\346\226\255\351\200\232\347\237\245\346\234\272\345\210\266.svg" deleted file mode 100644 index f24298eacb7530489d2e4e49ec2e56a6b9ef3059..0000000000000000000000000000000000000000 --- "a/example/system/amp/openamp/figs/OpenAMP\345\233\236\350\260\203\344\270\216\344\270\255\346\226\255\351\200\232\347\237\245\346\234\272\345\210\266.svg" +++ /dev/null @@ -1,4 +0,0 @@ -
struct rpmsg_virtio_device {
struct rpmsg_device rdev;
struct virtio_device *vdev;
struct virtqueue *rvq;
struct virtqueue *svq;
struct metal_io_region *shbuf_io;
struct rpmsg_virtio_shm_pool *shpool;
};
struct rpmsg_virtio_device {...
struct virtio_device {
uint32_t notifyid; /**< unique position on the virtio bus */
struct virtio_device_id id; /* the device type identification (used to match it with a driver*/
uint64_t features; /* the features supported by both ends. */
unsigned int role; /* if it is virtio backend or front end. */
virtio_dev_reset_cb reset_cb; /* user registered device callback */
const struct virtio_dispatch *func; /* Virtio dispatch table */
void *priv; /*TODO: remove pointer to virtio_device private data */
unsigned int vrings_num; /* number of vrings */
struct virtio_vring_info *vrings_info;
};
struct virtio_device {...
struct rpmsg_device {
struct metal_list endpoints;
struct rpmsg_endpoint ns_ept;
unsigned long bitmap[metal_bitmap_longs(RPMSG_ADDR_BMP_SIZE)];
metal_mutex_t lock;
rpmsg_ns_bind_cb ns_bind_cb;
struct rpmsg_device_ops ops;
bool support_ns;
};
struct rpmsg_device {...
struct virtqueue {
struct virtio_device *vq_dev;
const char *vq_name;
uint16_t vq_queue_index;
uint16_t vq_nentries;
void (*callback)(struct virtqueue *vq);
void (*notify)(struct virtqueue *vq);
struct vring vq_ring;
uint16_t vq_free_cnt;
uint16_t vq_queued_cnt;
void *shm_io; /* opaque pointer to data needed to allow v2p & p2v */
/*
* Head of the free chain in the descriptor table. If
* there are no free descriptors, this will be set to
* VQ_RING_DESC_CHAIN_END.
*/
uint16_t vq_desc_head_idx;
/*
* Last consumed descriptor in the used table,
* trails vq_ring.used->idx.
*/
uint16_t vq_used_cons_idx;
/*
* Last consumed descriptor in the available table -
* used by the consumer side.
*/
uint16_t vq_available_idx;
#ifdef VQUEUE_DEBUG
bool vq_inuse;
#endif
/*
* Used by the host side during callback. Cookie
* holds the address of buffer received from other side.
* Other fields in this structure are not used currently.
*/
struct vq_desc_extra vq_descx[0];
};
struct virtqueue {...
 * struct rpmsg_virtio_device - representation of a rpmsg device based on virtio
 * @rdev: rpmsg device, first property in the struct
 * @vdev: pointer to the virtio device
 * @rvq: pointer to receive virtqueue
 * @svq: pointer to send virtqueue
 * @shbuf_io: pointer to the shared buffer I/O region
 * @shpool: pointer to the shared buffers pool
* struct rpmsg_virtio_device - representation of a rpmsg device based...
struct rpmsg_virtio_shm_pool {
void *base;
size_t avail;
size_t size;
};
struct rpmsg_virtio_shm_pool {...
struct metal_io_region {
void *virt;      /* base virtual address */
const metal_phys_addr_t *physmap;   /* table of base physical address of each of the pages in the I/O region */
size_t size;       /**< size of the I/O region */
unsigned long page_shift; /**< page shift of I/O region */
metal_phys_addr_t page_mask;  /**< page mask of I/O region */
unsigned int mem_flags;  /* memory attribute of the I/O region */
struct metal_io_ops ops;        /**< I/O region operations */
};
struct metal_io_region {...
rpmsg_virtio
rpmsg_virtio
rproc_virtio_set_status()
rproc_virtio_set_status()
rproc_virtio_write_config()
rproc_virtio_write_config()
rproc_virtio_set_features()
=
rvdev->vdev->func->set_features
rproc_virtio_set_features()...
rpvdev->notify(rpvdev->priv, vdev->notifyid)
rpvdev->notify(rpvdev->priv, vdev->notifyid)
rpmsg_virtio_set_status()
=
rvdev->vdev->func->set_status()
rpmsg_virtio_set_status()...
rproc_virtio_negotiate_features()
=
rvdev->vdev->func->negotiate_features
rproc_virtio_negotiate_features()...
rproc_virtio_create_vdev(remoteproc_create_virtio)
rproc_virtio_create_vdev(remoteproc_create_virtio)
rpmsg_virtio_write_config()
=
rvdev->vdev->func->write_config
rpmsg_virtio_write_config()...
rproc_virtio_reset_device()
rproc_virtio_reset_device()

IPI interrupt = PhytiumProcNotify

PhytiumProcNotify 接口函数表
truct remoteproc_ops phytium_proc_ops = {
    .init = PhytiumProcInit,
    .remove = PhytiumProcRemove,
    .mmap = PhytiumProcMmap,
    .notify = PhytiumProcNotify,
    .start = NULL,
    .stop = NULL,
    .shutdown = NULL,
};
IPI interrupt = PhytiumProcNotify...

Call_back

rpmsg_create_ept()创建过程中

rpmsg_endpoint_cb 绑定以及回调流程

platform_create_rpmsg_vdev(cb)绑定以及回调

Call_back...
rpmsg_create_ept(cb)
rpmsg_create_ept(cb)
rpmsg_initialize_ept(cb)
rpmsg_initialize_ept(cb)
ept->cb = rpmsg_endpoint_cb
ept->cb = rpmsg_endpoint_cb
rpmsg_virtio_rx_callback()
rpmsg_virtio_rx_callback()
callback[i] = rpmsg_virtio_rx_callback
rpmsg_virtio_create_virtqueues(callbacks)
callback[i] = rpmsg_virtio_rx_callback...
rpmsg_init_vdev()
rpmsg_init_vdev()
struct virtqueue
{
    void (*callback)(struct virtqueue *vq);
    void (*notify)(struct virtqueue *vq);
}
struct virtqueue...
rproc_virtio_notified
rproc_virtio_notified
remoteproc_get_notification()
remoteproc_get_notification()
platform_poll()
platform_poll()
vq->callback = callback
vq->callback = callback
virtqueue_create(callbacks)
virtqueue_create(callbacks)
virtio_create_virtqueues(callbacks)
virtio_create_virtqueues(callbacks)
绑定
绑定
PhytiumProcInit()
PhytiumProcInit()
rproc = ops->init(rproc, ops, priv)
rproc = ops->init(rproc, ops, priv)
remoteproc_init(&phytium_proc_ops)
remoteproc_init(&phytium_proc_ops)
platform_create_proc()
platform_create_proc()
vq->callback(vq);
vq->callback(vq);
virtqueue_notification(vq)
virtqueue_notification(vq)
调用
调用
调用
调用
调用
调用
调用
调用
rpvdev->notify = notify;//remoteproc_virtio_notify
rpvdev->notify = notify;//remoteproc_virtio_notify
remoteproc_create_virtio()
remoteproc_create_virtio()
vdev->func = &remoteproc_virtio_dispatch_funcs
vdev->func = &remoteproc_virtio_dispatch_funcs -
rproc->ops = ops;//&phytium_proc_ops
rproc->ops = ops;//&phytium_proc_ops
接口函数绑定过程
接口函数绑定过程
.notify = PhytiumProcNotify
负责发送中断信号进行通知
.notify = PhytiumProcNotify...
static const struct virtio_dispatch remoteproc_virtio_dispatch_funcs = {
    .get_status = rproc_virtio_get_status,
    .get_features = rproc_virtio_get_features,
    .read_config = rproc_virtio_read_config,
    .notify = rproc_virtio_virtqueue_notify,
#ifndef VIRTIO_SLAVE_ONLY
    /*
     * We suppose here that the vdev is in a shared memory so that can
     * be access only by one core: the master. In this case salve core has
     * only read access right.
     */
    .set_status = rproc_virtio_set_status,
    .set_features = rproc_virtio_set_features,
    .negotiate_features = rproc_virtio_negotiate_features,
    .write_config = rproc_virtio_write_config,
    .reset_device = rproc_virtio_reset_device,
#endif
}
static const struct virtio_dispatch remoteproc_virtio_dispatch_funcs = {...
remoteproc_virtio_notify()
remoteproc_virtio_notify()
绑定
绑定
仅master调用
仅master调用
绑定
绑定
调用
调用
初始化调用
初始化调用
platform_init()
platform_init()
调用
调用
调用
调用
调用
调用
调用
调用
调用
调用
调用
调用
绑定
绑定
传递
传递
phytium_proc_ops
phytium_proc_ops
rproc->ops->notify()
rproc->ops->notify()
调用
调用
调用
调用
调用
调用
ept->cb = rpmsg_endpoint_cb
ept->cb = rpmsg_endpoint_cb
rpmsg_virtio_rx_callback()
rpmsg_virtio_rx_callback()
callback[i] = rpmsg_virtio_rx_callback
rpmsg_virtio_create_virtqueues(callbacks)
callback[i] = rpmsg_virtio_rx_callback...
rpmsg_init_vdev()
rpmsg_init_vdev()
struct virtqueue
{
    void (*callback)(struct virtqueue *vq);
    void (*notify)(struct virtqueue *vq);
}
struct virtqueue...
rproc_virtio_notified
rproc_virtio_notified
remoteproc_get_notification()
remoteproc_get_notification()
platform_poll()
platform_poll()
vq->callback = callback
vq->callback = callback
virtqueue_create(callbacks)
virtqueue_create(callbacks)
virtio_create_virtqueues(callbacks)
virtio_create_virtqueues(callbacks)
vq->callback(vq);
vq->callback(vq);
virtqueue_notification(vq)
virtqueue_notification(vq)
调用
调用
ept->cb = rpmsg_endpoint_cb
ept->cb = rpmsg_endpoint_cb
rpmsg_virtio_rx_callback()
rpmsg_virtio_rx_callback()
callback[i] = rpmsg_virtio_rx_callback
rpmsg_virtio_create_virtqueues(callbacks)
callback[i] = rpmsg_virtio_rx_callback...
rpmsg_init_vdev()
rpmsg_init_vdev()
struct virtqueue
{
    void (*callback)(struct virtqueue *vq);
    void (*notify)(struct virtqueue *vq);
}
struct virtqueue...
rproc_virtio_notified
rproc_virtio_notified
remoteproc_get_notification()
remoteproc_get_notification()
platform_poll()
platform_poll()
vq->callback = callback
vq->callback = callback
virtqueue_create(callbacks)
virtqueue_create(callbacks)
virtio_create_virtqueues(callbacks)
virtio_create_virtqueues(callbacks)
vq->callback(vq);
vq->callback(vq);
virtqueue_notification(vq)
virtqueue_notification(vq)
ept->cb = rpmsg_endpoint_cb()
ept->cb = rpmsg_endpoint_cb()
rpmsg_virtio_rx_callback()
rpmsg_virtio_rx_callback()
callback[i] = rpmsg_virtio_rx_callback
rpmsg_virtio_create_virtqueues(callbacks)
callback[i] = rpmsg_virtio_rx_callback...
rpmsg_init_vdev()
rpmsg_init_vdev()
struct virtqueue
{
    void (*callback)(struct virtqueue *vq);
    void (*notify)(struct virtqueue *vq);
}
struct virtqueue...
rproc_virtio_notified
rproc_virtio_notified
remoteproc_get_notification()
remoteproc_get_notification()
platform_poll()
platform_poll()
vq->callback = callback
vq->callback = callback
virtqueue_create(callbacks)
virtqueue_create(callbacks)
virtio_create_virtqueues(callbacks)
virtio_create_virtqueues(callbacks)
调用
调用
绑定
绑定
调用
调用
传递
传递
传递
传递
vq->callback(vq);
vq->callback(vq);
virtqueue_notification(vq)
virtqueue_notification(vq)
调用
调用
调用
调用
绑定
绑定
PhytiumProcNotify
PhytiumProcNotify
发送中断通知
发送中断通知
资源表
资源表
struct remote_resource_table {
    unsigned int version;
    unsigned int num;
    unsigned int reserved[2];
    unsigned int offset[NO_RESOURCE_ENTRIES];
    /* rpmsg vdev entry */
    struct fw_rsc_vdev rpmsg_vdev;
    struct fw_rsc_vdev_vring rpmsg_vring0;
    struct fw_rsc_vdev_vring rpmsg_vring1;
}__attribute__((packed, aligned(0x100)));
struct remote_resource_tabl...
struct remote_resource_table __resource resources = {
    1, /* Version */
    NUM_TABLE_ENTRIES, /* NUmber of table entries */
    {0, 0,}, /* reserved fields */
    {
     offsetof(struct remote_resource_table, rpmsg_vdev),
    }, /* Offsets of rsc entries */
    {
     RSC_VDEV, VIRTIO_ID_RPMSG_, 0, RPMSG_IPU_C0_FEATURES, 0, 0, 0,
     NUM_VRINGS, {0, 0},
    }, /* Virtio device entry */
    {RING_TX, VRING_ALIGN, VRING_SIZE, 1, 0},/* Vring rsc entry - part of vdev rsc entry */
    {RING_RX, VRING_ALIGN, VRING_SIZE, 2, 0},/* Vring rsc entry - part of vdev rsc entry */
};
struct remote_resource_table __resource resources = {...
实例化
实例化
rproc_virtio_virtqueue_notify()
rproc_virtio_virtqueue_notify()
vq_ring_notify() -> vq->notify(vq)
vq_ring_notify() -> vq->notify(vq)
virtqueue_kick()
virtqueue_kick()
调用
调用
调用通知
调用通知
virtqueue_create(vdev->func->notify)
virtqueue_create(vdev->func->notify) -
绑定
绑定
rpmsg_virtio_create_virtqueues()
rpmsg_virtio_create_virtqueues()
调用自己编写的函数
调用自己编写的函数
调用
调用
调用
调用
struct remoteproc {
metal_mutex_t lock;
void *rsc_table;
size_t rsc_len;
struct metal_io_region *rsc_io;
struct metal_list mems;
struct metal_list vdevs;
unsigned long bitmap;
struct remoteproc_ops *ops;
metal_phys_addr_t bootaddr;
struct loader_ops *loader;
unsigned int state;
void *priv;
};
struct remoteproc {...
Remoteproc
Remoteproc
Step5
Step5
Step4
Step4
Step3
Step3
Step1 :platform_create_proc()
Step1 :platform_create_proc()
Step2 :remoteproc_create_virtio()
Step2 :remoteproc_create_virtio()
运行调用
运行调用

platform_create_rpmsg_vdev(rpmsg_name_service_bind_cb)

platform_create_rpmsg_vdev(rpmsg_name_service_bind_cb)
ept->cb = rpmsg_virtio_ns_callback();
ept->cb = rpmsg_virtio_ns_callback(); -
if (rdev->support_ns)
if (rdev->support_ns)
调用
调用
rpmsg_register_endpoint(rdev, &rdev->ns_ept);
rpmsg_register_endpoint(rdev, &rdev->ns_ept);
调用
调用
rpmsg_create_ept(struct rpmsg_endpoint *ept, struct rpmsg_device *rdev,const char *name, uint32_t src, uint32_t dest,,rpmsg_ept_cb cb, rpmsg_ns_unbind_cb unbind_cb)
rpmsg_create_ept(struct rpmsg_endpoint *ept, struct rpmsg_device *rdev,const char *name, uint32_t src,...
ept创建
ept创建

rpmsg在通信过程中需要注意的方面:

1.rpmsg_endpoint作为核心结构体必须存在

2.service name不同的通信连接,通过name来进行区分分组,用来命名。

3.src 本地endpoint通信的源地址,会出现在远端rpmsg_endpoint_cb()回调函数的src变量上,也影响rpmsg_destroy_ept()的调用,当使用自己定义的地址时,不会触发RPMSG_NS_DESTROY事件,无法产生rpmsg_service_unbind()回调, 造成远程核无法退出的情况。

4.dest 要建立连接的目标地址,也就是另外一端的通信源地址,只有当dest_addr == RPMSG_ADDR_ANY成立的时候,才会产生RPMSG_NS_CREATE事件,通知RPMSG_NS_EPT_ADDR进行创建操作,通常在建立链接前,与while (!is_rpmsg_ept_ready(&lept))一起使用,来等待链接建立,此时ept->dest_addr的值会发生变化,变成远程endpoint的源地址。当使用自己定义的地址时候,则默认已经完成链接的创建。

5.cb 当建立的链接远程endpoint发送消息过来,则会调用此函数。

6.rpmsg_ns_unbind_cb 当远程endpoint销毁并且远程的src >= RPMSG_RESERVED_ADDRESSES时,会调用此回调函数。

rpmsg在通信过程中需要注意的方面:...
Create a RPMsg endpoint, initialize it with a name, source address,remoteproc address, endpoint callback, and destroy endpoint callback,and register it to the RPMsg device.
Create a RPMsg endpoint, initialize it with a name,...
rpmsg_device创建
rpmsg_device创建
It will create rpmsg virtio device, and returns the rpmsg virtio device pointer.
@platform: pointer to the private data
@vdev_index: index of the virtio device, there can more than one vdev on the platform.
@role: virtio master or virtio slave of the vdev
@rst_cb: virtio device reset callback
@ns_bind_cb: rpmsg name service bind callback
It will create rpmsg virtio device, and returns the...
struct rpmsg_device *platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index, unsigned int role,void (*rst_cb)(struct virtio_device *vdev), rpmsg_ns_bind_cb ns_bind_cb)
struct rpmsg_device *platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index, unsigned int r...
弄清此函数的回调函数触发以及使用,我们需要首先了解一下platform_poll()函数的调用。
rpmsg_virtio_rx_callback()函数中,通过远程端发过来的rp_hdr->dst,查询对应地址的ept,遍历链表rpmsg_endpoint,调用注册的rpmsg_virtio_ns_callback函数,读取虚拟内存中rpmsg_ns_msg,匹配对应的name of remote service信息是否一致,不一致,则会调用回调函数rpmsg_name_service_bind_cb():
send callback to application, that can
* - create the associated endpoints.
* - store information for future use.
* - just ignore the request as service not supported.
弄清此函数的回调函数触发以及使用,我们需要首先了解一下platform_poll()函数的调用。...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/example/system/amp/openamp/figs/OpenAmpConfig.png b/example/system/amp/openamp/figs/OpenAmpConfig.png deleted file mode 100644 index 402fbf75033d23729e47679929d3cd26ef9d108c..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/OpenAmpConfig.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/aarch32_runtime.png b/example/system/amp/openamp/figs/aarch32_runtime.png deleted file mode 100644 index 83c9077b78cd77399b2a622ecbd77ba3a94e0590..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/aarch32_runtime.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/aarch32_runtime1.png b/example/system/amp/openamp/figs/aarch32_runtime1.png deleted file mode 100644 index c2f5ce7f561c131b166982b5e5c0358964b003b2..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/aarch32_runtime1.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/aarch64_runtime.png b/example/system/amp/openamp/figs/aarch64_runtime.png deleted file mode 100644 index 09754fbf403d16e26c6dcef451f5aae1a101f412..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/aarch64_runtime.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/aarch64_runtime1.png b/example/system/amp/openamp/figs/aarch64_runtime1.png deleted file mode 100644 index 35dcd065c6bca81ac6d9b1d6f46e563891b2a04c..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/aarch64_runtime1.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/device_core_BUILD_.png b/example/system/amp/openamp/figs/device_core_BUILD_.png deleted file mode 100644 index 925b02fd190123b6dc292a1987b09448e12b4e63..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/device_core_BUILD_.png and /dev/null differ diff --git a/example/system/amp/openamp/figs/driver_core_BUILD_.png b/example/system/amp/openamp/figs/driver_core_BUILD_.png deleted file mode 100644 index f65bdfdb7e6c841ed823583e1e408c039d53cc07..0000000000000000000000000000000000000000 Binary files a/example/system/amp/openamp/figs/driver_core_BUILD_.png and /dev/null differ diff --git "a/example/system/amp/openamp/figs/openamp\350\277\220\350\241\214\345\233\276.svg" "b/example/system/amp/openamp/figs/openamp\350\277\220\350\241\214\345\233\276.svg" deleted file mode 100644 index bdc91044df2a83089e4a592917358e9351c64b5f..0000000000000000000000000000000000000000 --- "a/example/system/amp/openamp/figs/openamp\350\277\220\350\241\214\345\233\276.svg" +++ /dev/null @@ -1 +0,0 @@ -

1. rproc_inst 初始化

1. rproc_inst 初始化

1. 初始化rsc_table,并且纳入mems

2. 将vring[0].da 的地址纳入mems

3. 将kick_device 关联至rproc->priv

1. 初始化rsc_table,并且纳入mems...

2. 初始化sharebuf

2. 初始化sharebuf
3. 初始化virtio_device
中的配置信息
3. 初始化virtio_device...

1. 如果采用linux kernel  通信方式,sharebuf 由linux 进行定义

1. 如果采用linux kernel  通信方式,sharebuf 由linux 进行定义

1.  使用资源表中的rpmsg_vdev初始化vdev

2. 将rpmsg_vdev 与rpvdev 进行管理

3. 由于master 与 slave 同时操作同一个share_table ,主机优先进行vdev 中vring_info 的初始化(原因是,从机如果完成整个资源的初始化后,会发送ns 消息,有可能主机没有准备好,从机后续使用住的分配好的资源)

1.  使用资源表中的rpmsg_vdev初始化vdev...
4. 初始化shpool
4. 初始化shpool

初始化与amp core 约定好的内存空间,使用struct rpmsg_virtio_shm_pool * 进行管理

初始化与amp core 约定好的内存空间,使用struct rpmsg_virtio_shm_pool * 进行管理
5. 初始化vring 中的buffer
5. 初始化vring 中的buffer

仅主机分配rvq 的buffer资源,存放至

vq->vq_ring.desc 中
仅主机分配rvq 的buffer资源,存放至...
6. 初始化NS endpoint
6. 初始化NS endpoint

主机置位 VIRTIO_CONFIG_STATUS_DRIVER_OK

允许从机继续3 流程

主机置位 VIRTIO_CONFIG_STATUS_DRIVER_OK...
7. 开发者自定义endpoint
7. 开发者自定义endpoint
8. 轮询vq 数据包,并且将其路由至不同endpoint
8. 轮询vq 数据包,并且将其路由至不同endpoint
9. 释放资源
9. 释放资源
1.
platform_init()
初始化得到实例:
remoteproc *rproc
1....
/* Initialize HW system components */
init_system();
/* Initialize HW system components */...
初始化libmetal
初始化libmetal
platform_create_proc(proc_id, rsc_id);
platform_create_proc(proc_id, rsc_id);
创建远程处理器实例,传入远程处理器ID和分配给远程处理器使用的资源表
创建远程处理器实例,传入远程处理器ID和分配给远程处理器使用的资源表
函数
函数
结构体变量
结构体变量
2.
platform_create_rpmsg_vdev()
创建完成得到实例:
struct rpmsg_device *rpdev
2....
shbuf = metal_io_phys_to_virt(shbuf_io, SHARED_MEM_PA + SHARED_BUF_OFFSET);
shbuf = metal_io_phys_to_virt(shbuf_...
shbuf_io = remoteproc_get_io_with_pa(rproc, SHARED_MEM_PA);
shbuf_io = remoteproc_get_io_with_pa...
将libmetal初始化好的bus,io以及共享内存等信息纳入mems,以待后续通过pa、da、va地址调用出来
将libmetal初始化好的bus,io以及共享内存等信息纳入mems,以待后续通过pa、da、v...
vdev = remoteproc_create_virtio(rproc, vdev_index, role, rst_cb);
vdev = remoteproc_create_virtio(rpro...
rpmsg_virtio_init_shm_pool(&shpool, shbuf, (SHARED_MEM_SIZE - SHARED_BUF_OFFSET));
rpmsg_virtio_init_shm_pool(&shpool,...
rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb, shbuf_io, &shpool);
rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb, shbuf_io, &shpool);
函数中会与remote做同步
rproc_virtio_wait_remote_ready(vdev);
函数中会与remote做同步...
return rpmsg_virtio_get_rpmsg_device(rpmsg_vdev);
return rpmsg_virtio_get_rpmsg_device(rpmsg_vdev);
初始化流程
初始化流程
Text is not SVG - cannot display
\ No newline at end of file diff --git a/example/system/amp/openamp/makefile b/example/system/amp/openamp/makefile deleted file mode 100644 index 97291dacd62898e630bc13c963adc00ba9edb37e..0000000000000000000000000000000000000000 --- a/example/system/amp/openamp/makefile +++ /dev/null @@ -1,66 +0,0 @@ -# Compiling for specific instance - -.PHONY: all clean boot menuconfig_driver_core menuconfig_device_core - -clean_driver_core: - $(MAKE) -s -C ./driver_core clean - -clean_device_core: - $(MAKE) -s -C ./device_core clean - -clean: clean_driver_core clean_device_core - -config_d2000_aarch64: - $(MAKE) -C ./driver_core load_kconfig LOAD_CONFIG_NAME=d2000_aarch64_test_openamp_driver_core - $(MAKE) -C ./device_core load_kconfig LOAD_CONFIG_NAME=d2000_aarch64_test_openamp_device_core - -config_d2000_aarch32: - $(MAKE) -C ./driver_core load_kconfig LOAD_CONFIG_NAME=d2000_aarch32_test_openamp_driver_core - $(MAKE) -C ./device_core load_kconfig LOAD_CONFIG_NAME=d2000_aarch32_test_openamp_device_core - -config_ft2004_aarch64: - $(MAKE) -C ./driver_core load_kconfig LOAD_CONFIG_NAME=ft2004_aarch64_DSK_openamp_driver_core - $(MAKE) -C ./device_core load_kconfig LOAD_CONFIG_NAME=ft2004_aarch64_DSK_openamp_device_core - -config_ft2004_aarch32: - $(MAKE) -C ./driver_core load_kconfig LOAD_CONFIG_NAME=ft2004_aarch32_DSK_openamp_driver_core - $(MAKE) -C ./device_core load_kconfig LOAD_CONFIG_NAME=ft2004_aarch32_DSK_openamp_device_core - -config_e2000d_aarch64: - $(MAKE) -C ./driver_core load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_openamp_driver_core - $(MAKE) -C ./device_core load_kconfig LOAD_CONFIG_NAME=e2000d_aarch64_demo_openamp_device_core - -config_e2000d_aarch32: - $(MAKE) -C ./driver_core load_kconfig LOAD_CONFIG_NAME=e2000d_aarch32_demo_openamp_driver_core - $(MAKE) -C ./device_core load_kconfig LOAD_CONFIG_NAME=e2000d_aarch32_demo_openamp_device_core - -config_e2000q_aarch64: - $(MAKE) -C ./driver_core load_kconfig LOAD_CONFIG_NAME=e2000q_aarch64_demo_openamp_driver_core - $(MAKE) -C ./device_core load_kconfig LOAD_CONFIG_NAME=e2000q_aarch64_demo_openamp_device_core - -config_e2000q_aarch32: - $(MAKE) -C ./driver_core load_kconfig LOAD_CONFIG_NAME=e2000q_aarch32_demo_openamp_driver_core - $(MAKE) -C ./device_core load_kconfig LOAD_CONFIG_NAME=e2000q_aarch32_demo_openamp_device_core - -config_phytiumpi_aarch64: - $(MAKE) -C ./driver_core load_kconfig LOAD_CONFIG_NAME=phytiumpi_aarch64_firefly_openamp_driver_core - $(MAKE) -C ./device_core load_kconfig LOAD_CONFIG_NAME=phytiumpi_aarch64_firefly_openamp_device_core - -config_phytiumpi_aarch32: - $(MAKE) -C ./driver_core load_kconfig LOAD_CONFIG_NAME=phytiumpi_aarch32_firefly_openamp_driver_core - $(MAKE) -C ./device_core load_kconfig LOAD_CONFIG_NAME=phytiumpi_aarch32_firefly_openamp_device_core - -menuconfig_driver_core: - $(MAKE) -C ./driver_core menuconfig - -menuconfig_device_core: - $(MAKE) -C ./device_core menuconfig - -image: - $(MAKE) -s -C ./driver_core image - $(MAKE) -s -C ./device_core image - -backupconfig: - $(MAKE) -C ./driver_core backup_kconfig - $(MAKE) -C ./device_core backup_kconfig - diff --git a/example/system/amp/openamp_for_linux/Kconfig b/example/system/amp/openamp_for_linux/Kconfig index 2a352a7b65f99f9bfef2788e6613bdfd10e94c7f..c5e5cfaee4af83bd25bb6d018d4650e5f99f9327 100644 --- a/example/system/amp/openamp_for_linux/Kconfig +++ b/example/system/amp/openamp_for_linux/Kconfig @@ -17,25 +17,6 @@ mainmenu "Phytium Freertos Configuration" endmenu - - menu "AMP Config" - - config IPI_IRQ_NUM - int "Communication interruption number between multiple cores" - default 0 - - config IPI_IRQ_NUM_PRIORITY - int "Priority of internuclear communication interruption" - default 16 - - config IPI_CHN_BITMASK - int "Destination IPI mask" - default 255 - help - Each bit represents a CPU, for example, 0x3 represents CPU 0 and CPU 3 in the code. - - endmenu - endmenu source "$(SDK_DIR)/../freertos.kconfig" diff --git a/example/system/amp/openamp_for_linux/README.md b/example/system/amp/openamp_for_linux/README.md index 62b952cb3e08c37ec26c9e8d6926bd9e82ea489c..2f6f903bd0434aa45f050f760b5ff4a74807545f 100644 --- a/example/system/amp/openamp_for_linux/README.md +++ b/example/system/amp/openamp_for_linux/README.md @@ -13,14 +13,16 @@ - 本例程基于开源openamp项目 [OpenAMP](https://github.com/OpenAMP/open-amp.git) -- 本例程主要提供了D2000/FT2004/E2000D/E2000Q/PHYTIUMPI Linux与RTOS之间的测试例程 +- 本例程主要提供了D2000/E2000D/E2000Q/PHYTIUMPI Linux与RTOS之间的测试例程 - 本例程演示rpmsg用法的示例演示应用程序。此应用core0 中的程序为从机程序,core1 中的程序为主机linux程序,其目标是从核程序工作在echo 模式下,主核主动发送数据之后,从机程序会将收到的数据重新回复发送回去 - 如果需要添加其他应用任务,则要求应用任务优先级比RpmsgEchoTask优先级(默认是4)高,否则应用任务无法执行。 -- 参阅《飞腾嵌入式OpenAMP技术解决方案与用户操作手册v1.0》配置好linux环境,本例程只提供编译镜像 +- 参阅《飞腾嵌入式OpenAMP技术解决方案与用户操作手册v1.4》配置好linux环境,本例程只提供编译镜像 [手册链接](https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/open-amp) - 注意linux4.19内核只支持aarch32编译的镜像 *.elf 文件,linux5.1内核支持aarch64和32位编译的镜像。 +- 多核共享资源的调整主要集中在 `common` 目录下,可以根据需要进行修改。 + ## 2. 如何使用例程 > 描述开发平台准备,使用例程配置,构建和下载镜像的过程
@@ -29,7 +31,7 @@ > 哪些硬件平台是支持的,需要哪些外设,例程与开发板哪些IO口相关等(建议附录开发板照片,展示哪些IO口被引出)
-1. 准备一块 D2000 、FT2004 、 E2000Q/D 、firefly开发板中任意一款 +1. 准备一块 D2000 、 E2000Q/D 、firefly开发板中任意一款 2. 将串口连接好电脑,波特率设为 115200-8-1-N ### 2.2 SDK配置方法 @@ -57,18 +59,12 @@ - 以E2000D为例,加载E2000D aarch32位,输入 ` make config_e2000d_aarch32 ` -![OpenAMP配置](./figs/OpenAmpConfig.png) - -- Destination IPI mask : ipi 中断中,用于唤醒其他核心的掩码 - ![Core0构建](figs/Core0_BUILD_.png) -- Baremetal config -> Select mem default attribute : 提供内存属性选择 - Remoteproc use ipi : 使用ipi 中断模式进行提醒 -- Openamp resource address : OpenAMP 中共享资源表中地址 -- Vring tx address : 共享发送缓冲区的起始地址,同时也是共享buffer 区域的起始地址(由linux分配,初始值设置全f) -- Vring rx address : 共享接收缓冲区的起始地址(由linux分配,初始值设置全f) -- table of base physical address of each of the pages in the I/O region : 用于核心间提醒机制的共享内存初始点 +- Skip local rvdev->shbuf_io +- Use the Vring definition in the master +- Use cache coherency ### 2.4 输出与实验现象 @@ -80,11 +76,12 @@ 1. 进入amp/openamp_for_linux 目录 2. 输入 ` make config_e2000d_aarch32 ` 加载E2000D默认配置项目,其他配置项可以输入 ` make config_ ` 后按tab键查看支持哪些默认配置项目 -3. 在 Sdk common configuration → Use default interrupt configuration → Interrupt role select 选项中选择 use slave role +3. 选择好配置项目后,输入 `make menuconfig` 打开配置项目 +4. 在 Sdk common configuration → Use default interrupt configuration → Interrupt role select 选项中选择 use slave role(默认配置好的) ![interrupt_set](./figs/interrupt_set.png) -4. 目录下输入 "make clean" "make image" ,生成openamp_core0.elf 文件之后,将其拷贝至linux 指定目录下(注意linux加载的镜像名称必须是openamp_core0.elf,否则无法识别到) +5. 目录下输入 "make clean" "make image" ,生成openamp_core0.elf 文件之后,将其拷贝至linux 指定目录下(注意linux加载的镜像名称必须是openamp_core0.elf,否则无法识别到) #### E2000 aarch64 freertos程序测试 (仅适用于linux 5.10) @@ -92,11 +89,12 @@ 1. 进入amp/openamp_for_linux 目录 2. 输入 ` make config_e2000d_aarch64 ` 加载E2000D默认配置项目,其他配置项可以输入 ` make config_ ` 后按tab键查看支持哪些默认配置项目 -3. 在 Sdk common configuration → Use default interrupt configuration → Interrupt role select 选项中选择 use slave role +3. 选择好配置项目后,输入 `make menuconfig` 打开配置项目 +4. 在 Sdk common configuration → Use default interrupt configuration → Interrupt role select 选项中选择 use slave role(默认配置好的) ![interrupt_set](./figs/interrupt_set.png) -4. 目录下输入 "make clean" "make image" ,生成openamp_core0.elf 文件之后,将其拷贝至linux 指定目录下(注意linux加载的镜像名称必须是openamp_core0.elf,否则无法识别到) +5. 目录下输入 "make clean" "make image" ,生成openamp_core0.elf 文件之后,将其拷贝至linux 指定目录下(注意linux加载的镜像名称必须是openamp_core0.elf,否则无法识别到) ## 3. 如何解决问题 (Q&A) > 主要记录使用例程中可能会遇到的问题,给出相应的解决方案 diff --git a/example/system/amp/openamp_for_linux/common/libmetal_configs.h b/example/system/amp/openamp_for_linux/common/libmetal_configs.h new file mode 100644 index 0000000000000000000000000000000000000000..86e0dfa114097699ce159d45eb152c5da25c7826 --- /dev/null +++ b/example/system/amp/openamp_for_linux/common/libmetal_configs.h @@ -0,0 +1,52 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: libmetal_configs.h + * Created Date: 2024-05-17 10:18:19 + * Last Modified: 2024-07-23 09:45:24 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + * 1.0 liusm 2024-05-17 first version + */ + +#ifndef LIBMETAL_CONFIGS_H +#define LIBMETAL_CONFIGS_H + +#if defined __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#define KICK_BUS_NAME "generic" +#define KICK_SGI_NUM_9 9 +/* 备用 */ +/* #define KICK_SGI_NUM_10 10 */ + +/* device name for slave 00 */ +#define SLAVE_00_KICK_DEV_NAME "slave_00_kick" +#define SLAVE_00_SGI KICK_SGI_NUM_9 /* 采用SGI9中断进行消息提醒,需要与linux协商好 */ +/* 备用 */ +/* #define SLAVE_01_KICK_DEV_NAME "slave_01_kick" */ +/* #define SLAVE_01_SGI KICK_SGI_NUM_10 */ + +#if defined __cplusplus +} +#endif + +#endif /* LIBMETAL_CONFIGS_H */ diff --git a/example/system/amp/openamp_for_linux/common/memory_layout.h b/example/system/amp/openamp_for_linux/common/memory_layout.h new file mode 100644 index 0000000000000000000000000000000000000000..86169fe9becb97f55b41403a12f3cda862f555dd --- /dev/null +++ b/example/system/amp/openamp_for_linux/common/memory_layout.h @@ -0,0 +1,54 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: memory_layout.h + * Created Date: 2024-04-29 14:22:47 + * Last Modified: 2024-07-22 17:02:12 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + * 1.0 liusm 2024-05-17 first version + */ + +#ifndef MEMORY_LAYOUT_H +#define MEMORY_LAYOUT_H + + + +#if defined __cplusplus +extern "C" { +#endif + +/*slave core0*/ +/* 与linux共享的内存 */ +#define SLAVE00_SOURCE_TABLE_ADDR 0xc0000000 /*与linux协商好的地址*/ +#define SLAVE00_KICK_IO_ADDR 0xc0224000 + +/* MEM = |tx vring|rx vring|share buffer| */ +#define SLAVE00_SHARE_MEM_ADDR 0xffffffff /*全F表示等待linux分配*/ +#define SLAVE00_SHARE_MEM_SIZE 0x100000 /*共享内存大小*/ +#define SLAVE00_VRING_SIZE 0x8000UL +#define SLAVE00_VRING_NUM 0x100 +#define SLAVE00_TX_VRING_ADDR 0xffffffff /*全F表示等待linux分配*/ +#define SLAVE00_RX_VRING_ADDR 0xffffffff /*全F表示等待linux分配*/ + +#define SLAVE00_SOURCE_TABLE_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_RW) +#define SLAVE00_SHARE_BUFFER_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_RW) + +#if defined __cplusplus +} +#endif + +#endif /* MEMORY_LAYOUT_H */ diff --git a/example/system/amp/openamp_for_linux/common/openamp_configs.h b/example/system/amp/openamp_for_linux/common/openamp_configs.h new file mode 100644 index 0000000000000000000000000000000000000000..b7d9650193566ae288a4712bfd43cd9b611d6f79 --- /dev/null +++ b/example/system/amp/openamp_for_linux/common/openamp_configs.h @@ -0,0 +1,43 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: memory_attr.h + * Created Date: 2024-05-06 19:20:51 + * Last Modified: 2024-07-22 17:02:32 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + * 1.0 liusm 2024-05-17 first version + */ + +#ifndef OPENAMP_CONFIGS_H +#define OPENAMP_CONFIGS_H + +#include "fmmu.h" +#include "memory_layout.h" + +#if defined __cplusplus +extern "C" { +#endif + +/* 从核发送消息时,需要指定发送的cpu的核号,用来确定软件中断的发送到哪个核上 */ + +#define MASTER_CORE_MASK 255 /* 采用协商好的方式,给所有核心都发送中断,注意:openamp 的freeRTOS 接口层PhytiumProcNotify()做了区分 */ + +#if defined __cplusplus +} +#endif + +#endif /* OPENAMP_CONFIGS_H */ diff --git a/example/system/amp/openamp_for_linux/configs/d2000_aarch32_test_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/d2000_aarch32_test_openamp_for_linux.config index 08b60d0f5c42a8f8518e224088b76e8e9474c1aa..3051a328090f569c1e13dbd18465e7a0fa92a3a9 100644 --- a/example/system/amp/openamp_for_linux/configs/d2000_aarch32_test_openamp_for_linux.config +++ b/example/system/amp/openamp_for_linux/configs/d2000_aarch32_test_openamp_for_linux.config @@ -8,14 +8,6 @@ # CONFIG_TARGET_NAME="openamp_for_linux" # end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config # end of Project Configuration CONFIG_USE_FREERTOS=y @@ -120,12 +112,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -339,21 +325,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 CONFIG_SKIP_SHBUF_IO_WRITE=y CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +CONFIG_USE_CACHE_COHERENCY=y # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp_for_linux/configs/d2000_aarch64_test_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/d2000_aarch64_test_openamp_for_linux.config index 7ccb21e8a87a3014e67e39d3295d365341f3226d..5a088ecf0780e543f50aec13085e80817402db7f 100644 --- a/example/system/amp/openamp_for_linux/configs/d2000_aarch64_test_openamp_for_linux.config +++ b/example/system/amp/openamp_for_linux/configs/d2000_aarch64_test_openamp_for_linux.config @@ -8,14 +8,6 @@ # CONFIG_TARGET_NAME="openamp_for_linux" # end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config # end of Project Configuration CONFIG_USE_FREERTOS=y @@ -114,12 +106,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -328,21 +314,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 CONFIG_SKIP_SHBUF_IO_WRITE=y CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +CONFIG_USE_CACHE_COHERENCY=y # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp_for_linux/configs/e2000d_aarch32_demo_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/e2000d_aarch32_demo_openamp_for_linux.config index 9fbcccca1a36f1f95df51c8a08ba14679094a853..c3b16b6827564adb1d50ad5035b85e0638b39884 100644 --- a/example/system/amp/openamp_for_linux/configs/e2000d_aarch32_demo_openamp_for_linux.config +++ b/example/system/amp/openamp_for_linux/configs/e2000d_aarch32_demo_openamp_for_linux.config @@ -8,14 +8,6 @@ # CONFIG_TARGET_NAME="openamp_for_linux" # end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config # end of Project Configuration CONFIG_USE_FREERTOS=y @@ -133,12 +125,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -187,9 +173,9 @@ CONFIG_CHECK_DEPS=y # # Optimization options # -CONFIG_DEBUG_NOOPT=y +# CONFIG_DEBUG_NOOPT is not set # CONFIG_DEBUG_CUSTOMOPT is not set -# CONFIG_DEBUG_FULLOPT is not set +CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y CONFIG_DEBUG_LINK_MAP=y # CONFIG_CCACHE is not set @@ -342,21 +328,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 CONFIG_SKIP_SHBUF_IO_WRITE=y CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +CONFIG_USE_CACHE_COHERENCY=y # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp_for_linux/configs/e2000d_aarch64_demo_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/e2000d_aarch64_demo_openamp_for_linux.config index 66445be6bf996235406472e8ddb159e45fae2cbe..9a1387b6c2625e551b4bf2d838b6d088c1f9f1e1 100644 --- a/example/system/amp/openamp_for_linux/configs/e2000d_aarch64_demo_openamp_for_linux.config +++ b/example/system/amp/openamp_for_linux/configs/e2000d_aarch64_demo_openamp_for_linux.config @@ -8,14 +8,6 @@ # CONFIG_TARGET_NAME="openamp_for_linux" # end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config # end of Project Configuration CONFIG_USE_FREERTOS=y @@ -127,12 +119,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -331,21 +317,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 CONFIG_SKIP_SHBUF_IO_WRITE=y CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +CONFIG_USE_CACHE_COHERENCY=y # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp_for_linux/configs/e2000q_aarch32_demo_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/e2000q_aarch32_demo_openamp_for_linux.config index 4192df2ae0b6eb821d85ceaf219d8b53eea48d1a..fb7cd7855904eb03d238be308ccc5c82b2ffc242 100644 --- a/example/system/amp/openamp_for_linux/configs/e2000q_aarch32_demo_openamp_for_linux.config +++ b/example/system/amp/openamp_for_linux/configs/e2000q_aarch32_demo_openamp_for_linux.config @@ -8,14 +8,6 @@ # CONFIG_TARGET_NAME="openamp_for_linux" # end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config # end of Project Configuration CONFIG_USE_FREERTOS=y @@ -132,12 +124,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -186,9 +172,9 @@ CONFIG_CHECK_DEPS=y # # Optimization options # -CONFIG_DEBUG_NOOPT=y +# CONFIG_DEBUG_NOOPT is not set # CONFIG_DEBUG_CUSTOMOPT is not set -# CONFIG_DEBUG_FULLOPT is not set +CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y CONFIG_DEBUG_LINK_MAP=y # CONFIG_CCACHE is not set @@ -341,21 +327,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 CONFIG_SKIP_SHBUF_IO_WRITE=y CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +CONFIG_USE_CACHE_COHERENCY=y # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp_for_linux/configs/e2000q_aarch64_demo_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/e2000q_aarch64_demo_openamp_for_linux.config index 44abc5b1ac5894d25facaa48252b3eea82ecdda5..c3cf49452a0e667f9d2162d1151c9421c2c30f40 100644 --- a/example/system/amp/openamp_for_linux/configs/e2000q_aarch64_demo_openamp_for_linux.config +++ b/example/system/amp/openamp_for_linux/configs/e2000q_aarch64_demo_openamp_for_linux.config @@ -8,14 +8,6 @@ # CONFIG_TARGET_NAME="openamp_for_linux" # end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config # end of Project Configuration CONFIG_USE_FREERTOS=y @@ -126,12 +118,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -330,21 +316,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 CONFIG_SKIP_SHBUF_IO_WRITE=y CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +CONFIG_USE_CACHE_COHERENCY=y # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp_for_linux/configs/ft2004_aarch32_dsk_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/ft2004_aarch32_dsk_openamp_for_linux.config deleted file mode 100644 index f51b6442d54c724ae06220d6df6adc1046fa2868..0000000000000000000000000000000000000000 --- a/example/system/amp/openamp_for_linux/configs/ft2004_aarch32_dsk_openamp_for_linux.config +++ /dev/null @@ -1,395 +0,0 @@ - -# -# Project Configuration -# - -# -# Freertos Configuration -# -CONFIG_TARGET_NAME="openamp_for_linux" -# end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config -# end of Project Configuration - -CONFIG_USE_FREERTOS=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_L3CACHE=y -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_E2000D is not set -# CONFIG_TARGET_E2000S is not set -CONFIG_TARGET_FT2004=y -# CONFIG_TARGET_D2000 is not set -# CONFIG_TARGET_PD2308 is not set -CONFIG_SOC_NAME="ft2004" -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_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="dsk" -CONFIG_FT2004_DSK_BOARD=y - -# -# 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=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set -# CONFIG_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 -# end of Sdk common configuration - -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - -# -# Drivers configuration -# -CONFIG_USE_IOMUX=y -CONFIG_ENABLE_IOCTRL=y -# CONFIG_ENABLE_IOPAD is not set -# 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_USB 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_SCMI_MHU is not set -# CONFIG_USE_I2S is not set -# CONFIG_USE_I3C is not set -# end of Drivers configuration - -# -# Build setup -# -CONFIG_CHECK_DEPS=y -# CONFIG_OUTPUT_BINARY is not set - -# -# Optimization options -# -CONFIG_DEBUG_NOOPT=y -# CONFIG_DEBUG_CUSTOMOPT is not set -# CONFIG_DEBUG_FULLOPT is not set -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 is not set -# 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=0x2000000 -CONFIG_HEAP_SIZE=1 -CONFIG_SVC_STACK_SIZE=0x1000 -CONFIG_SYS_STACK_SIZE=0x1000 -CONFIG_IRQ_STACK_SIZE=0x1000 -CONFIG_ABORT_STACK_SIZE=0x1000 -CONFIG_FIQ_STACK_SIZE=0x1000 -CONFIG_UNDEF_STACK_SIZE=0x1000 -# end of Linker Options -# end of Build setup - -# -# Component Configuration -# - -# -# Freertos Uart Drivers -# -CONFIG_FREERTOS_USE_UART=y -# end of Freertos Uart Drivers - -# -# Freertos Pwm Drivers -# -# CONFIG_FREERTOS_USE_PWM is not set -# end of Freertos Pwm Drivers - -# -# Freertos Qspi Drivers -# -# CONFIG_FREERTOS_USE_QSPI is not set -# end of Freertos Qspi Drivers - -# -# Freertos Wdt Drivers -# -# CONFIG_FREERTOS_USE_WDT is not set -# end of Freertos Wdt Drivers - -# -# Freertos Eth Drivers -# -# CONFIG_FREERTOS_USE_XMAC is not set -# CONFIG_FREERTOS_USE_GMAC is not set -# end of Freertos Eth Drivers - -# -# Freertos Spim Drivers -# -# CONFIG_FREERTOS_USE_FSPIM is not set -# end of Freertos Spim Drivers - -# -# Freertos DMA Drivers -# -# CONFIG_FREERTOS_USE_FDDMA is not set -# CONFIG_FREERTOS_USE_FGDMA is not set -# end of Freertos DMA Drivers - -# -# Freertos Adc Drivers -# -# CONFIG_FREERTOS_USE_ADC is not set -# end of Freertos Adc Drivers - -# -# Freertos Can Drivers -# -# CONFIG_FREERTOS_USE_CAN is not set -# end of Freertos Can Drivers - -# -# Freertos I2c Drivers -# -# CONFIG_FREERTOS_USE_I2C is not set -# end of Freertos I2c Drivers - -# -# Freertos Mio Drivers -# -# CONFIG_FREERTOS_USE_MIO is not set -# end of Freertos Mio Drivers - -# -# Freertos Timer Drivers -# -# CONFIG_FREERTOS_USE_TIMER is not set -# end of Freertos Timer Drivers - -# -# Freertos Media Drivers -# -# CONFIG_FREERTOS_USE_MEDIA is not set -# end of Freertos Media Drivers - -# -# Freertos I2s Drivers -# -# CONFIG_FREERTOS_USE_I2S is not set -# end of Freertos I2s Drivers -# end of Component 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=y -CONFIG_USE_LIBMETAL=y - -# -# OpenAmp -# -CONFIG_USE_OPENAMP=y -CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 -CONFIG_SKIP_SHBUF_IO_WRITE=y -CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config -# end of OpenAmp - -# CONFIG_USE_YMODEM is not set -# CONFIG_USE_SFUD is not set -CONFIG_USE_BACKTRACE=y -# CONFIG_USE_FATFS_0_1_4 is not set -CONFIG_USE_TLSF=y -# 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_CHERRY_USB is not set -# CONFIG_USE_FSL_SDMMC is not set -# CONFIG_USE_FSL_WIFI is not set -# end of Third-party configuration - -# -# FreeRTOS Kernel Configuration -# -CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y -CONFIG_FREERTOS_HZ=1000 -CONFIG_FREERTOS_MAX_PRIORITIES=32 -CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=13 -CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=11 -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_MINIMAL_TASK_STACKSIZE=1024 -CONFIG_FREERTOS_MAX_TASK_NAME_LEN=32 -CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 -CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 -CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 -CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y -CONFIG_FREERTOS_USE_TRACE_FACILITY=y -CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y -# CONFIG_FREERTOS_USE_TICKLESS_IDLE is not set -CONFIG_FREERTOS_TOTAL_HEAP_SIZE=10240 -CONFIG_FREERTOS_TASK_FPU_SUPPORT=1 -# CONFIG_FREERTOS_USE_POSIX is not set -# end of FreeRTOS Kernel Configuration diff --git a/example/system/amp/openamp_for_linux/configs/ft2004_aarch64_dsk_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/ft2004_aarch64_dsk_openamp_for_linux.config deleted file mode 100644 index 94f6efb6cc10a54834b974ee966979de4af5ed5d..0000000000000000000000000000000000000000 --- a/example/system/amp/openamp_for_linux/configs/ft2004_aarch64_dsk_openamp_for_linux.config +++ /dev/null @@ -1,384 +0,0 @@ - -# -# Project Configuration -# - -# -# Freertos Configuration -# -CONFIG_TARGET_NAME="openamp_for_linux" -# end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config -# end of Project Configuration - -CONFIG_USE_FREERTOS=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_USE_L3CACHE=y -CONFIG_BOOT_WITH_FLUSH_CACHE=y -# 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_E2000D is not set -# CONFIG_TARGET_E2000S is not set -CONFIG_TARGET_FT2004=y -# CONFIG_TARGET_D2000 is not set -# CONFIG_TARGET_PD2308 is not set -CONFIG_SOC_NAME="ft2004" -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_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="dsk" -CONFIG_FT2004_DSK_BOARD=y - -# -# 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=y -# CONFIG_LOG_DEBUG is not set -# CONFIG_LOG_INFO is not set -# CONFIG_LOG_WARN is not set -# CONFIG_LOG_ERROR is not set -# CONFIG_LOG_NONE is not set -# CONFIG_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 -# end of Sdk common configuration - -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - -# -# Drivers configuration -# -CONFIG_USE_IOMUX=y -CONFIG_ENABLE_IOCTRL=y -# CONFIG_ENABLE_IOPAD is not set -# 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_USB 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_SCMI_MHU is not set -# CONFIG_USE_I2S is not set -# CONFIG_USE_I3C is not set -# end of Drivers configuration - -# -# Build setup -# -CONFIG_CHECK_DEPS=y -# CONFIG_OUTPUT_BINARY is not set - -# -# Optimization options -# -CONFIG_DEBUG_NOOPT=y -# CONFIG_DEBUG_CUSTOMOPT is not set -# CONFIG_DEBUG_FULLOPT is not set -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 is not set -# 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=0x2000000 -CONFIG_HEAP_SIZE=1 -CONFIG_STACK_SIZE=0x400 -# end of Linker Options -# end of Build setup - -# -# Component Configuration -# - -# -# Freertos Uart Drivers -# -CONFIG_FREERTOS_USE_UART=y -# end of Freertos Uart Drivers - -# -# Freertos Pwm Drivers -# -# CONFIG_FREERTOS_USE_PWM is not set -# end of Freertos Pwm Drivers - -# -# Freertos Qspi Drivers -# -# CONFIG_FREERTOS_USE_QSPI is not set -# end of Freertos Qspi Drivers - -# -# Freertos Wdt Drivers -# -# CONFIG_FREERTOS_USE_WDT is not set -# end of Freertos Wdt Drivers - -# -# Freertos Eth Drivers -# -# CONFIG_FREERTOS_USE_XMAC is not set -# CONFIG_FREERTOS_USE_GMAC is not set -# end of Freertos Eth Drivers - -# -# Freertos Spim Drivers -# -# CONFIG_FREERTOS_USE_FSPIM is not set -# end of Freertos Spim Drivers - -# -# Freertos DMA Drivers -# -# CONFIG_FREERTOS_USE_FDDMA is not set -# CONFIG_FREERTOS_USE_FGDMA is not set -# end of Freertos DMA Drivers - -# -# Freertos Adc Drivers -# -# CONFIG_FREERTOS_USE_ADC is not set -# end of Freertos Adc Drivers - -# -# Freertos Can Drivers -# -# CONFIG_FREERTOS_USE_CAN is not set -# end of Freertos Can Drivers - -# -# Freertos I2c Drivers -# -# CONFIG_FREERTOS_USE_I2C is not set -# end of Freertos I2c Drivers - -# -# Freertos Mio Drivers -# -# CONFIG_FREERTOS_USE_MIO is not set -# end of Freertos Mio Drivers - -# -# Freertos Timer Drivers -# -# CONFIG_FREERTOS_USE_TIMER is not set -# end of Freertos Timer Drivers - -# -# Freertos Media Drivers -# -# CONFIG_FREERTOS_USE_MEDIA is not set -# end of Freertos Media Drivers - -# -# Freertos I2s Drivers -# -# CONFIG_FREERTOS_USE_I2S is not set -# end of Freertos I2s Drivers -# end of Component 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=y -CONFIG_USE_LIBMETAL=y - -# -# OpenAmp -# -CONFIG_USE_OPENAMP=y -CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 -CONFIG_SKIP_SHBUF_IO_WRITE=y -CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config -# end of OpenAmp - -# CONFIG_USE_YMODEM is not set -# CONFIG_USE_SFUD is not set -CONFIG_USE_BACKTRACE=y -# CONFIG_USE_FATFS_0_1_4 is not set -CONFIG_USE_TLSF=y -# 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_CHERRY_USB is not set -# CONFIG_USE_FSL_SDMMC is not set -# CONFIG_USE_FSL_WIFI is not set -# end of Third-party configuration - -# -# FreeRTOS Kernel Configuration -# -CONFIG_FREERTOS_OPTIMIZED_SCHEDULER=y -CONFIG_FREERTOS_HZ=1000 -CONFIG_FREERTOS_MAX_PRIORITIES=32 -CONFIG_FREERTOS_KERNEL_INTERRUPT_PRIORITIES=13 -CONFIG_FREERTOS_MAX_API_CALL_INTERRUPT_PRIORITIES=11 -CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 -CONFIG_FREERTOS_MINIMAL_TASK_STACKSIZE=1024 -CONFIG_FREERTOS_MAX_TASK_NAME_LEN=32 -CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 -CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 -CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 -CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 -CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y -CONFIG_FREERTOS_USE_TRACE_FACILITY=y -CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y -# CONFIG_FREERTOS_USE_TICKLESS_IDLE is not set -CONFIG_FREERTOS_TOTAL_HEAP_SIZE=10240 -CONFIG_FREERTOS_TASK_FPU_SUPPORT=1 -# CONFIG_FREERTOS_USE_POSIX is not set -# end of FreeRTOS Kernel Configuration diff --git a/example/system/amp/openamp_for_linux/configs/phytiumpi_aarch32_firefly_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/phytiumpi_aarch32_firefly_openamp_for_linux.config index d1a83c771b2db43a6ae26b893a1f4a7f5a006b89..e5ac3f54e33613fa1a243b1fd37ce7d959a36619 100644 --- a/example/system/amp/openamp_for_linux/configs/phytiumpi_aarch32_firefly_openamp_for_linux.config +++ b/example/system/amp/openamp_for_linux/configs/phytiumpi_aarch32_firefly_openamp_for_linux.config @@ -8,14 +8,6 @@ # CONFIG_TARGET_NAME="openamp_for_linux" # end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config # end of Project Configuration CONFIG_USE_FREERTOS=y @@ -131,12 +123,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -185,9 +171,9 @@ CONFIG_CHECK_DEPS=y # # Optimization options # -CONFIG_DEBUG_NOOPT=y +# CONFIG_DEBUG_NOOPT is not set # CONFIG_DEBUG_CUSTOMOPT is not set -# CONFIG_DEBUG_FULLOPT is not set +CONFIG_DEBUG_FULLOPT=y CONFIG_DEBUG_OPT_UNUSED_SECTIONS=y CONFIG_DEBUG_LINK_MAP=y # CONFIG_CCACHE is not set @@ -340,21 +326,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 CONFIG_SKIP_SHBUF_IO_WRITE=y CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +CONFIG_USE_CACHE_COHERENCY=y # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp_for_linux/configs/phytiumpi_aarch64_firefly_openamp_for_linux.config b/example/system/amp/openamp_for_linux/configs/phytiumpi_aarch64_firefly_openamp_for_linux.config index f37fee23c492a4e8a12ec675e11a1fd99e7c4dba..129b09a8ff29e3858180e88981f6439cae82e382 100644 --- a/example/system/amp/openamp_for_linux/configs/phytiumpi_aarch64_firefly_openamp_for_linux.config +++ b/example/system/amp/openamp_for_linux/configs/phytiumpi_aarch64_firefly_openamp_for_linux.config @@ -8,14 +8,6 @@ # CONFIG_TARGET_NAME="openamp_for_linux" # end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config # end of Project Configuration CONFIG_USE_FREERTOS=y @@ -125,12 +117,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -329,21 +315,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 CONFIG_SKIP_SHBUF_IO_WRITE=y CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +CONFIG_USE_CACHE_COHERENCY=y # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp_for_linux/figs/Core0_BUILD_.png b/example/system/amp/openamp_for_linux/figs/Core0_BUILD_.png index 9ff221c0e15f5ed626bf38eea5e9cce6c2787528..7e84df07d12c2ee658b77881aa25628af986c09e 100644 Binary files a/example/system/amp/openamp_for_linux/figs/Core0_BUILD_.png and b/example/system/amp/openamp_for_linux/figs/Core0_BUILD_.png differ diff --git a/example/system/amp/openamp_for_linux/ft_openamp.ld b/example/system/amp/openamp_for_linux/ft_openamp.ld new file mode 100644 index 0000000000000000000000000000000000000000..585b201e01d48c49943b05206cdaa3e33060756a --- /dev/null +++ b/example/system/amp/openamp_for_linux/ft_openamp.ld @@ -0,0 +1,6 @@ +#include "memory_layout.h" + + .resource_table SLAVE00_SOURCE_TABLE_ADDR: { + . = ALIGN(4); + *(.resource_table) + } diff --git a/example/system/amp/openamp_for_linux/inc/slaver_00_example.h b/example/system/amp/openamp_for_linux/inc/slaver_00_example.h new file mode 100644 index 0000000000000000000000000000000000000000..01c3785daa49043f1f1f16ff315007fcad738f11 --- /dev/null +++ b/example/system/amp/openamp_for_linux/inc/slaver_00_example.h @@ -0,0 +1,31 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: slaver_00_example.h + * Created Date: 2024-04-29 16:17:53 + * Last Modified: 2024-07-17 09:15:29 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + */ + +#ifndef SLAVER_00_EXAMPLE_H +#define SLAVER_00_EXAMPLE_H + +#include "ftypes.h" + +int rpmsg_echo_task(void); + +#endif /* SLAVER_00_EXAMPLE_H */ diff --git a/example/system/amp/openamp_for_linux/main.c b/example/system/amp/openamp_for_linux/main.c index def6248fa216e330a30945100bb1cfbfceaecd01..4dbe2fc18a4ef153a9a79d9eda3be9a248802bf6 100644 --- a/example/system/amp/openamp_for_linux/main.c +++ b/example/system/amp/openamp_for_linux/main.c @@ -13,7 +13,7 @@ * * FilePath: main.c * Created Date: 2022-02-24 16:56:46 - * Last Modified: 2024-04-11 09:36:01 + * Last Modified: 2024-07-17 09:15:15 * Description: This file is for This file is for AMP example that running rpmsg_echo_task and open scheduler * * Modify History: @@ -31,8 +31,7 @@ #include "portmacro.h" #include "FreeRTOS.h" #include "task.h" - -extern int rpmsg_echo_task(void); +#include "slaver_00_example.h" int main(void) { diff --git a/example/system/amp/openamp_for_linux/makefile b/example/system/amp/openamp_for_linux/makefile index 7ee4621179bf5ee690c3855f89adb77d874460ed..2330c3df03f012382674825d337ebddcbfcec550 100644 --- a/example/system/amp/openamp_for_linux/makefile +++ b/example/system/amp/openamp_for_linux/makefile @@ -4,7 +4,9 @@ FREERTOS_SDK_DIR = $(CURDIR)/../../../.. USER_CSRC := main.c USER_CSRC += $(wildcard src/*.c) -USER_INCLUDE := $(PROJECT_DIR) +USER_INCLUDE += $(PROJECT_DIR) \ + $(PROJECT_DIR)/inc \ + $(PROJECT_DIR)/common include $(FREERTOS_SDK_DIR)/tools/makeall.mk diff --git a/example/system/amp/openamp_for_linux/sdkconfig b/example/system/amp/openamp_for_linux/sdkconfig index f37fee23c492a4e8a12ec675e11a1fd99e7c4dba..129b09a8ff29e3858180e88981f6439cae82e382 100644 --- a/example/system/amp/openamp_for_linux/sdkconfig +++ b/example/system/amp/openamp_for_linux/sdkconfig @@ -8,14 +8,6 @@ # CONFIG_TARGET_NAME="openamp_for_linux" # end of Freertos Configuration - -# -# AMP Config -# -CONFIG_IPI_IRQ_NUM=9 -CONFIG_IPI_IRQ_NUM_PRIORITY=1 -CONFIG_IPI_CHN_BITMASK=255 -# end of AMP Config # end of Project Configuration CONFIG_USE_FREERTOS=y @@ -125,12 +117,6 @@ CONFIG_USE_DEFAULT_INTERRUPT_CONFIG=y CONFIG_INTERRUPT_ROLE_SLAVE=y # end of Sdk common configuration -# -# Image information configuration -# -# CONFIG_IMAGE_INFO is not set -# end of Image information configuration - # # Drivers configuration # @@ -329,21 +315,9 @@ CONFIG_USE_LIBMETAL=y # CONFIG_USE_OPENAMP=y CONFIG_USE_OPENAMP_IPI=y -CONFIG_OPENAMP_RESOURCES_ADDR=0xc0000000 -CONFIG_VRING_TX_ADDR=0xffffffff -CONFIG_VRING_RX_ADDR=0xffffffff -CONFIG_VRING_SIZE=0x100 -CONFIG_POLL_BASE_ADDR=0xc0224000 CONFIG_SKIP_SHBUF_IO_WRITE=y CONFIG_USE_MASTER_VRING_DEFINE=y - -# -# Baremetal config -# -# CONFIG_MEM_NO_CACHE is not set -# CONFIG_MEM_WRITE_THROUGH is not set -CONFIG_MEM_NORMAL=y -# end of Baremetal config +CONFIG_USE_CACHE_COHERENCY=y # end of OpenAmp # CONFIG_USE_YMODEM is not set diff --git a/example/system/amp/openamp_for_linux/sdkconfig.h b/example/system/amp/openamp_for_linux/sdkconfig.h index 5348a0ec42002623d4caafbc8520697f68704016..afb0048d66674fad48174c4ea8ec503bb1aacc32 100644 --- a/example/system/amp/openamp_for_linux/sdkconfig.h +++ b/example/system/amp/openamp_for_linux/sdkconfig.h @@ -7,13 +7,6 @@ #define CONFIG_TARGET_NAME "openamp_for_linux" /* end of Freertos Configuration */ - -/* AMP Config */ - -#define CONFIG_IPI_IRQ_NUM 9 -#define CONFIG_IPI_IRQ_NUM_PRIORITY 1 -#define CONFIG_IPI_CHN_BITMASK 255 -/* end of AMP Config */ /* end of Project Configuration */ #define CONFIG_USE_FREERTOS @@ -111,11 +104,6 @@ #define CONFIG_INTERRUPT_ROLE_SLAVE /* end of Sdk common configuration */ -/* Image information configuration */ - -/* CONFIG_IMAGE_INFO is not set */ -/* end of Image information configuration */ - /* Drivers configuration */ #define CONFIG_USE_IOMUX @@ -287,20 +275,9 @@ #define CONFIG_USE_OPENAMP #define CONFIG_USE_OPENAMP_IPI -#define CONFIG_OPENAMP_RESOURCES_ADDR 0xc0000000 -#define CONFIG_VRING_TX_ADDR 0xffffffff -#define CONFIG_VRING_RX_ADDR 0xffffffff -#define CONFIG_VRING_SIZE 0x100 -#define CONFIG_POLL_BASE_ADDR 0xc0224000 #define CONFIG_SKIP_SHBUF_IO_WRITE #define CONFIG_USE_MASTER_VRING_DEFINE - -/* Baremetal config */ - -/* CONFIG_MEM_NO_CACHE is not set */ -/* CONFIG_MEM_WRITE_THROUGH is not set */ -#define CONFIG_MEM_NORMAL -/* end of Baremetal config */ +#define CONFIG_USE_CACHE_COHERENCY /* end of OpenAmp */ /* CONFIG_USE_YMODEM is not set */ /* CONFIG_USE_SFUD is not set */ diff --git a/example/system/amp/openamp_for_linux/src/rpmsg-echo_os.c b/example/system/amp/openamp_for_linux/src/rpmsg-echo_os.c index af9bffb8c844bf2a0b35e8f5a05ad3d9fcbbf829..71ab630dd7efbbc6d015726d4c5d7ccfa9d5cd26 100644 --- a/example/system/amp/openamp_for_linux/src/rpmsg-echo_os.c +++ b/example/system/amp/openamp_for_linux/src/rpmsg-echo_os.c @@ -13,7 +13,7 @@ * * FilePath: rpmsg-echo_os.c * Created Date: 2022-02-25 09:12:07 - * Last Modified: 2024-03-13 18:54:24 + * Last Modified: 2024-07-17 09:17:44 * Description: This file is for This file is for a sample demonstration application that showcases usage of rpmsg. * This application is meant to run on the remote CPU running freertos code. * This application echoes back data that was sent to it by the master core. @@ -42,15 +42,14 @@ #include "finterrupt.h" #include "fpsci.h" #include "fdebug.h" - -/************************** Constant Definitions *****************************/ +#include "helper.h" +#include "openamp_configs.h" +#include "rsc_table.h" +#include "libmetal_configs.h" +#include "slaver_00_example.h" /**************************** Type Definitions *******************************/ -/************************** Variable Definitions *****************************/ - -/***************** Macros (Inline Functions) Definitions *********************/ - #define OPENAMP_SLAVE_DEBUG_TAG "OPENAMP_SLAVE" #define OPENAMP_SLAVE_ERROR(format, ...) FT_DEBUG_PRINT_E(OPENAMP_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) #define OPENAMP_SLAVE_WARN(format, ...) FT_DEBUG_PRINT_W(OPENAMP_SLAVE_DEBUG_TAG, format, ##__VA_ARGS__) @@ -59,10 +58,74 @@ #define SHUTDOWN_MSG 0xEF56A55A +/************************** 资源表定义,与linux协商一致 **********/ +static struct remote_resource_table __resource resources __attribute__((used)) = { + /* Version */ + 1, + + /* NUmber of table entries */ + NUM_TABLE_ENTRIES, + /* reserved fields */ + {0, 0,}, + + /* Offsets of rsc entries */ + { + offsetof(struct remote_resource_table, rpmsg_vdev), + }, + + /* Virtio device entry */ + { + RSC_VDEV, VIRTIO_ID_RPMSG_, VDEV_NOTIFYID, RPMSG_IPU_C0_FEATURES, 0, 0, 0, + NUM_VRINGS, {0, 0}, + }, + + /* Vring rsc entry - part of vdev rsc entry */ + {SLAVE00_TX_VRING_ADDR, VRING_ALIGN, SLAVE00_VRING_NUM, 1, 0}, + {SLAVE00_RX_VRING_ADDR, VRING_ALIGN, SLAVE00_VRING_NUM, 2, 0}, +}; + +/********** 共享内存定义,与linux协商一致 **********/ +static metal_phys_addr_t poll_phys_addr = SLAVE00_KICK_IO_ADDR; +struct metal_device kick_driver_00 = { + .name = SLAVE_00_KICK_DEV_NAME, + .bus = NULL, + .num_regions = 1, + .regions = { + { + .virt = (void *)SLAVE00_KICK_IO_ADDR, + .physmap = &poll_phys_addr, + .size = 0x1000, + .page_shift = -1UL, + .page_mask = -1UL, + .mem_flags = SLAVE00_SOURCE_TABLE_ATTRIBUTE, + .ops = {NULL}, + } + }, + .irq_num = 1,/* Number of IRQs per device */ + .irq_info = (void *)SLAVE_00_SGI, +} ; + +struct remoteproc_priv slave_00_priv = { + .kick_dev_name = SLAVE_00_KICK_DEV_NAME , + .kick_dev_bus_name = KICK_BUS_NAME , + .cpu_id = MASTER_CORE_MASK,/* 给所有core发送中断 */ + + .src_table_attribute = SLAVE00_SOURCE_TABLE_ATTRIBUTE , + + /* |rx vring|tx vring|share buffer| */ + .share_mem_va = SLAVE00_SHARE_MEM_ADDR , + .share_mem_pa = SLAVE00_SHARE_MEM_ADDR , + .share_buffer_offset = SLAVE00_VRING_SIZE , + .share_mem_size = SLAVE00_SHARE_MEM_SIZE , + .share_mem_attribute = SLAVE00_SHARE_BUFFER_ATTRIBUTE +} ; + +/*******************例程全局变量***********************************************/ +struct remoteproc remoteproc_slave_00; +static struct rpmsg_device *rpdev_slave_00 = NULL; static int shutdown_req; static char temp_data[RPMSG_BUFFER_SIZE]; /************************** Function Prototypes ******************************/ - /*-----------------------------------------------------------------------------* * RPMSG endpoint callbacks *-----------------------------------------------------------------------------*/ @@ -99,97 +162,113 @@ static void rpmsg_service_unbind(struct rpmsg_endpoint *ept) /*-----------------------------------------------------------------------------* * Application *-----------------------------------------------------------------------------*/ -int FRpmsgEchoApp(struct rpmsg_device *rdev, void *priv) +static int FRpmsgEchoApp(struct rpmsg_device *rdev, void *priv) { - int ret; - struct rpmsg_endpoint lept; - shutdown_req = 0; - OPENAMP_SLAVE_INFO("Try to create rpmsg endpoint."); - /* Initialize RPMSG framework */ - ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, 0, RPMSG_ADDR_ANY, rpmsg_endpoint_cb, rpmsg_service_unbind); - if (ret) - { - OPENAMP_SLAVE_ERROR("Failed to create endpoint,ret = %d.\r\n", ret); - return -1; - } + int ret = 0; + struct rpmsg_endpoint lept; + shutdown_req = 0; + /* Initialize RPMSG framework */ + OPENAMP_SLAVE_INFO("Try to create rpmsg endpoint.\r\n"); - while (1) - { - platform_poll(priv); + ret = rpmsg_create_ept(&lept, rdev, RPMSG_SERVICE_NAME, 0, RPMSG_ADDR_ANY, rpmsg_endpoint_cb, rpmsg_service_unbind); + if (ret) + { + OPENAMP_SLAVE_ERROR("Failed to create endpoint. %d \r\n", ret); + return -1; + } + + OPENAMP_SLAVE_INFO("Successfully created rpmsg endpoint.\r\n"); + + while (1) + { + platform_poll(priv); /* we got a shutdown request, exit */ if (shutdown_req) - { - break; - } - } + { + break; + } + } - rpmsg_destroy_ept(&lept); - return 0; -} + rpmsg_destroy_ept(&lept); + return ret; +} /*-----------------------------------------------------------------------------* * Application entry point *-----------------------------------------------------------------------------*/ -int rpmsg_echo(int argc, char *argv[]) +int slave_init(void) { - void *platform; - struct rpmsg_device *rpdev; - int ret = 0; + init_system(); // Initialize the system resources and environment + + if (!platform_create_proc(&remoteproc_slave_00, &slave_00_priv, &kick_driver_00)) + { + OPENAMP_SLAVE_ERROR("Failed to create remoteproc instance for slave 00\r\n"); + return -1; // Return with an error if creation fails + } + + remoteproc_slave_00.rsc_table = &resources; - OPENAMP_SLAVE_INFO("openamp lib version: %s (", openamp_version()); - OPENAMP_SLAVE_INFO("Major: %d, ", openamp_version_major()); - OPENAMP_SLAVE_INFO("Minor: %d, ", openamp_version_minor()); - OPENAMP_SLAVE_INFO("Patch: %d)\r\n", openamp_version_patch()); + if (platform_setup_src_table(&remoteproc_slave_00,remoteproc_slave_00.rsc_table)) + { + OPENAMP_SLAVE_ERROR("Failed to setup src table for slave 00\r\n"); + return -1; // Return with an error if setup fails + } + + OPENAMP_SLAVE_INFO("Setup resource tables for the created remoteproc instances is over \r\n"); - OPENAMP_SLAVE_INFO("libmetal lib version: %s (", metal_ver()); - OPENAMP_SLAVE_INFO("Major: %d, ", metal_ver_major()); - OPENAMP_SLAVE_INFO("Minor: %d, ", metal_ver_minor()); - OPENAMP_SLAVE_INFO("Patch: %d)\r\n", metal_ver_patch()); + if (platform_setup_share_mems(&remoteproc_slave_00)) + { + OPENAMP_SLAVE_ERROR("Failed to setup shared memory for slave 00\r\n"); + return -1; // Return with an error if setup fails + } - /* Initialize platform */ - OPENAMP_SLAVE_INFO("start application..."); - ret = platform_init(argc, argv, &platform); - if (ret) - { - OPENAMP_SLAVE_ERROR("Failed to initialize platform.\r\n"); - platform_cleanup(platform); - ret = -1; - } - - rpdev = platform_create_rpmsg_vdev(platform, 0, VIRTIO_DEV_SLAVE, NULL, NULL); - if (!rpdev) - { - OPENAMP_SLAVE_ERROR("Failed to create rpmsg virtio device.\r\n"); - platform_cleanup(platform); - ret = -1; - } + OPENAMP_SLAVE_INFO("Setup shared memory regions for both remoteproc instances is over \r\n"); - ret = FRpmsgEchoApp(rpdev, platform); - if (ret) - { - OPENAMP_SLAVE_ERROR("Failed to running echoapp.\r\n"); - platform_cleanup(platform); - ret = -1; - } - - platform_release_rpmsg_vdev(rpdev, platform); - OPENAMP_SLAVE_INFO("Stopping application..."); - platform_cleanup(platform); + rpdev_slave_00 = platform_create_rpmsg_vdev(&remoteproc_slave_00, 0, VIRTIO_DEV_SLAVE, NULL, NULL); + if (!rpdev_slave_00) + { + OPENAMP_SLAVE_ERROR("Failed to create rpmsg vdev for slave 00\r\n"); + return -1; // Return with an error if creation fails + } - return ret; -} - + return 0 ; +} -void RpmsgEchoTask(void * args) +int RpmsgEchoTask(void * args) { int ret; - ret = rpmsg_echo(0, NULL); - if (ret) - { - OPENAMP_SLAVE_ERROR("Failed to running rpmsg_echo.\r\n"); - } + printf("openamp lib version: %s (", openamp_version()); + printf("Major: %d, ", openamp_version_major()); + printf("Minor: %d, ", openamp_version_minor()); + printf("Patch: %d)\r\n", openamp_version_patch()); + + printf("libmetal lib version: %s (", metal_ver()); + printf("Major: %d, ", metal_ver_major()); + printf("Minor: %d, ", metal_ver_minor()); + printf("Patch: %d)\r\n", metal_ver_patch()); + + /* Initialize platform */ + OPENAMP_SLAVE_INFO("start application..."); + if(!slave_init()) + { + FRpmsgEchoApp(rpdev_slave_00,&remoteproc_slave_00) ; + if (ret) + { + OPENAMP_SLAVE_ERROR("Failed to running echoapp"); + return platform_cleanup(&remoteproc_slave_00); + } + platform_release_rpmsg_vdev(rpdev_slave_00, &remoteproc_slave_00); + OPENAMP_SLAVE_INFO("Stopping application..."); + platform_cleanup(&remoteproc_slave_00); + return ret; + } + else + { + platform_cleanup(&remoteproc_slave_00); + OPENAMP_SLAVE_ERROR("Failed to init remoteproc.\r\n"); + } vTaskDelete(NULL); } diff --git a/install.py b/install.py index b2fa330a51b11f1e13f79d3ef3c8e32e40adc954..cd9546c92a7369d58a370610d6c6c95cd7a38faa 100755 --- a/install.py +++ b/install.py @@ -64,6 +64,7 @@ if not os.path.exists(standalone_path): /third-party \ !/third-party/lwip-2.1.2/ports/arch \ /tools \ + /standalone.kconfig \ /soc") os.system("git checkout {}".format(standalone_sdk_v)) diff --git a/third-party/openamp/include.mk b/third-party/openamp/include.mk index 8b65b59ced4df163bb51f67db01aad0810190b50..853c4b26fa8a526e115cf0f97e2fa77c58882676 100644 --- a/third-party/openamp/include.mk +++ b/third-party/openamp/include.mk @@ -12,7 +12,6 @@ BUILD_INC_PATH_DIR += $(SDK_DIR)/third-party/openamp/lib \ $(SDK_DIR)/third-party/openamp/lib/include \ $(SDK_DIR)/third-party/openamp/lib/include/openamp \ $(SDK_DIR)/third-party/openamp/lib/rpmsg \ - $(SDK_DIR)/third-party/openamp/ports \ $(SDK_DIR)/third-party/openamp/lib/remoteproc \ $(SDK_DIR)/third-party/openamp/lib/rpmsg \ $(SDK_DIR)/third-party/openamp/lib/service/rpmsg/rpc \ diff --git a/third-party/openamp/ports/Kconfig b/third-party/openamp/ports/Kconfig index 31809012af40898536e3de82566d962688eaf512..e8e4500071b9ef424361248f488754db32d92422 100644 --- a/third-party/openamp/ports/Kconfig +++ b/third-party/openamp/ports/Kconfig @@ -11,26 +11,6 @@ menu "OpenAmp" bool "Remoteproc use ipi" help This configuration enables IPI working mode in OpenAMP mode - - config OPENAMP_RESOURCES_ADDR - hex "Openamp resource address" - default "0xa0000000" - - config VRING_TX_ADDR - hex "Vring tx address" - default "0xa0020000" - - config VRING_RX_ADDR - hex "Vring rx address" - default "0xa0024000" - - config VRING_SIZE - hex "Vring size" - default "0x100" - - config POLL_BASE_ADDR - hex "table of base physical address of each of the pages in the I/O region" - default "0xa0224000" config SKIP_SHBUF_IO_WRITE bool @@ -46,19 +26,10 @@ menu "OpenAmp" menu "Baremetal config" - choice - prompt "Select mem default attribute" - default MEM_NO_CACHE - config MEM_NO_CACHE - bool "Outer and Inner Non-cacheable , Outer Shareable" - config MEM_WRITE_THROUGH - bool "Outer and Inner Write-Through, Read-Allocate No Write-Allocate , Outer Shareable" - config MEM_NORMAL - bool "Outer and Inner Write-Back, Read-Allocate Write-Allocate , Outer Shareable" - endchoice - endmenu - - + config USE_CACHE_COHERENCY + bool + prompt "Use cache coherency" + default n endif endmenu \ No newline at end of file diff --git a/third-party/openamp/ports/helper.h b/third-party/openamp/ports/helper.h new file mode 100644 index 0000000000000000000000000000000000000000..6ef864eff29692467e03215dbe97ca65a4f5232b --- /dev/null +++ b/third-party/openamp/ports/helper.h @@ -0,0 +1,41 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: helper.h + * Created Date: 2024-07-03 11:19:49 + * Last Modified: 2024-07-10 17:05:29 + * Description: This file is for helper functions. + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + */ + +#ifndef HELPER_H_ +#define HELPER_H_ + +#include "ftypes.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +int init_system(void); +void cleanup_system(void); + +#ifdef __cplusplus +} +#endif + +#endif /* */ diff --git a/third-party/openamp/ports/load_fw.c b/third-party/openamp/ports/load_fw.c new file mode 100644 index 0000000000000000000000000000000000000000..79d4fc673ee29136b63a4757313f3afad3b07710 --- /dev/null +++ b/third-party/openamp/ports/load_fw.c @@ -0,0 +1,80 @@ +/* + * Load firmware example + * + * Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "platform_info.h" +#include "load_fw.h" +#include "rsc_table.h" + +extern const struct image_store_ops mem_image_store_ops; + + +void print_vring(const struct fw_rsc_vdev_vring *vring) { + printf("Vring da: 0x%x\n", vring->da); + printf("Vring align: 0x%x\n", vring->align); + printf("Vring num: 0x%x\n", vring->num); + printf("Vring notifyid: 0x%x\n", vring->notifyid); + printf("Vring reserved: 0x%x\n", vring->reserved); +} + +/* 打印 vdev 结构 */ +void print_vdev(const struct fw_rsc_vdev *vdev) { + printf("Vdev type: 0x%x\n", vdev->type); + printf("Vdev id: 0x%x\n", vdev->id); + printf("Vdev notifyid: 0x%x\n", vdev->notifyid); + printf("Vdev dfeatures: 0x%x\n", vdev->dfeatures); + printf("Vdev gfeatures: 0x%x\n", vdev->gfeatures); + printf("Vdev config_len: 0x%x\n", vdev->config_len); + printf("Vdev status: 0x%x\n", vdev->status); + printf("Vdev num_of_vrings: 0x%x\n", vdev->num_of_vrings); + + for (int i = 0; i < vdev->num_of_vrings; i++) { + print_vring(&(vdev->vring[i])); + } +} + +/* 打印整个资源表结构 */ +void print_resource_table(const struct remote_resource_table *table) { + printf("Resource table version: 0x%x\n", table->version); + printf("Resource table num: 0x%x\n", table->num); + printf("Resource table reserved: 0x%x 0x%x\n", table->reserved[0], table->reserved[1]); + printf("Resource table offsets: 0x%x 0x%x\n", table->offset[0], table->offset[1]); + + print_vdev(&(table->rpmsg_vdev)); + print_vring(&(table->rpmsg_vring0)); + print_vring(&(table->rpmsg_vring1)); +} + +int load_exectuable_block(struct remoteproc *rproc, + const struct image_store_ops *store_ops, void *store, + const char *img_path) +{ + int ret; + + (void)img_path; + if (rproc == NULL) + return -EINVAL; + /* Configure remoteproc to get ready to load executable */ + remoteproc_config(rproc, NULL); + + /* Load remoteproc executable */ + printf("Start to load executable with remoteproc_load() \r\n"); + ret = remoteproc_load(rproc, NULL, store, (struct image_store_ops *)store_ops, NULL); + if (ret) { + printf("failed to load firmware\r\n"); + return ret; + } + + /* Start the processor */ + ret = remoteproc_start(rproc); + if (ret) { + printf("failed to start processor\r\n"); + return ret; + } + printf("successfully started the processor\r\n"); + + return 0; +} diff --git a/third-party/openamp/ports/load_fw.h b/third-party/openamp/ports/load_fw.h new file mode 100644 index 0000000000000000000000000000000000000000..e0e1611477b6ddf3ee6af59ad19579648a67494c --- /dev/null +++ b/third-party/openamp/ports/load_fw.h @@ -0,0 +1,53 @@ +/* + * Copyright : (C) 2024 Phytium Information Technology, Inc. + * All Rights Reserved. + * + * This program is OPEN SOURCE software: you can redistribute it and/or modify it + * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, + * either version 1.0 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the Phytium Public License for more details. + * + * + * FilePath: load_fw.h + * Created Date: 2024-05-06 14:48:29 + * Last Modified: 2024-07-10 17:05:10 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- + */ + +#ifndef LOAD_FW_H_ +#define LOAD_FW_H_ + +/***************************** Include Files *********************************/ +#include "platform_info.h" +#include "rsc_table.h" +/************************** Constant Definitions *****************************/ + +/************************** Variable Definitions *****************************/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct mem_file { + const void *base; +}; + +int load_exectuable_block(struct remoteproc *rproc, + const struct image_store_ops *store_ops, void *store, + const char *img_path) ; +void print_resource_table(const struct remote_resource_table *table); + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/third-party/openamp/ports/mem_image_store.c b/third-party/openamp/ports/mem_image_store.c new file mode 100644 index 0000000000000000000000000000000000000000..0f866f445617d6c1b5239bfd091fd96b412cb6ad --- /dev/null +++ b/third-party/openamp/ports/mem_image_store.c @@ -0,0 +1,80 @@ +/* + * Memory based image store Operation + * + * Copyright(c) 2018 Xilinx Ltd. + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include "load_fw.h" +#include + + +int mem_image_open(void *store, const char *path, const void **image_data) +{ + struct mem_file *image = store; + const void *fw_base = image->base; + + (void)(path); + if (image_data == NULL) { + printf("%s: input image_data is NULL\r\n", __func__); + return -EINVAL; + } + *image_data = fw_base; + /* return an abitrary length, as the whole firmware is in memory */ + return 0x100; +} + +void mem_image_close(void *store) +{ + /* The image is in memory, does nothing */ + (void)store; +} + +int mem_image_load(void *store, size_t offset, size_t size, + const void **data, metal_phys_addr_t pa, + struct metal_io_region *io, + char is_blocking) +{ + struct mem_file *image = store; + const void *fw_base = image->base; + + (void)is_blocking; + + printf("%s: offset=0x%x, size=0x%x\n\r", + __func__, offset, size); + if (pa == METAL_BAD_PHYS) { + if (data == NULL) { + printf("%s: data is NULL while pa is ANY\r\n", + __func__); + return -EINVAL; + } + *data = (const void *)((const char *)fw_base + offset); + } else { + void *va; + + if (io == NULL) { + printf("%s, io is NULL while pa is not ANY\r\n", + __func__); + return -EINVAL; + } + va = metal_io_phys_to_virt(io, pa); + if (va == NULL) { + printf("%s: no va is found\r\n", __func__); + return -EINVAL; + } + memcpy(va, (const void *)((const char *)fw_base + offset), size); + } + + return (int)size; +} + +const struct image_store_ops mem_image_store_ops = { + .open = mem_image_open, + .close = mem_image_close, + .load = mem_image_load, + .features = SUPPORT_SEEK, +}; + diff --git a/third-party/openamp/ports/phytium_os_rproc.c b/third-party/openamp/ports/phytium_os_rproc.c index 38c1215d91c3f556215f2f3d2550c60f21855322..960782da2ffac2ab72cfa5700f1a97df0de2e80c 100644 --- a/third-party/openamp/ports/phytium_os_rproc.c +++ b/third-party/openamp/ports/phytium_os_rproc.c @@ -1,25 +1,26 @@ /* - * Copyright : (C) 2022 Phytium Information Technology, Inc. + * Copyright : (C) 2024 Phytium Information Technology, Inc. * All Rights Reserved. - * + * * This program is OPEN SOURCE software: you can redistribute it and/or modify it * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, * either version 1.0 of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the Phytium Public License for more details. - * - * + * + * * FilePath: phytium_os_rproc.c - * Date: 2022-02-25 09:59:08 - * LastEditTime: 2022-02-25 09:59:08 - * Description:  This file is for defining phytium platform specific remoteproc implementation. - * - * Modify History: - * Ver   Who        Date         Changes - * ----- ------     --------    -------------------------------------- + * Created Date: 2024-07-02 16:01:32 + * Last Modified: 2024-07-19 10:23:10 + * Description: This file is for + * + * Modify History: + * Ver Who Date Changes + * ----- ---------- -------- --------------------------------- * 1.0 huanghe 2022/04/21 first release + * 2.0 liusm 2024/07/03 modify for phytium platform */ /***************************** Include Files *********************************/ @@ -40,7 +41,7 @@ #include "fcpu_info.h" #include "fpsci.h" #include "fcache.h" - +#include "sdkconfig.h" /************************** Constant Definitions *****************************/ /**************************** Type Definitions *******************************/ @@ -49,43 +50,43 @@ /***************** Macros (Inline Functions) Definitions *********************/ -#define PHYTIUM_RPROC_MAIN_DEBUG_TAG " PHYTIUM_RPROC_MAIN" -#define PHYTIUM_RPROC_MAIN_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( PHYTIUM_RPROC_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) -#define PHYTIUM_RPROC_MAIN_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( PHYTIUM_RPROC_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) -#define PHYTIUM_RPROC_MAIN_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( PHYTIUM_RPROC_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) +#define PHYTIUM_RPROC_DEBUG_TAG "PHYTIUM_RPROC" +#define PHYTIUM_RPROC_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( PHYTIUM_RPROC_DEBUG_TAG, format, ##__VA_ARGS__) +#define PHYTIUM_RPROC_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( PHYTIUM_RPROC_DEBUG_TAG, format, ##__VA_ARGS__) +#define PHYTIUM_RPROC_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( PHYTIUM_RPROC_DEBUG_TAG, format, ##__VA_ARGS__) /************************** Function Prototypes ******************************/ - -#ifdef CONFIG_MEM_NORMAL - #define DEFAULT_MEM_ATTRIBUTE (MT_NORMAL|MT_P_RW_U_RW) -#endif - -#ifdef CONFIG_MEM_WRITE_THROUGH - #define DEFAULT_MEM_ATTRIBUTE (MT_NORMAL_WT|MT_P_RW_U_RW) -#endif - -#ifdef CONFIG_MEM_NO_CACHE - #define DEFAULT_MEM_ATTRIBUTE (MT_NORMAL_NC|MT_P_RW_U_RW) -#endif - #ifdef CONFIG_USE_OPENAMP_IPI static void PhytiumIrqhandler(s32 vector, void *param) { struct remoteproc *rproc = param; - struct remoteproc_priv *prproc; - u32 cpu_id; + struct remoteproc_priv *prproc; + prproc = rproc->priv; (void)vector; - if (!rproc) - { - PHYTIUM_RPROC_MAIN_DEBUG_E("rproc is empty \r\n") ; + if(!rproc) + { + PHYTIUM_RPROC_DEBUG_E("rproc is empty.") ; return ; } + + if (prproc->src_table_ready_flag != 1) + { + goto exit; + } - prproc = rproc->priv; - atomic_flag_clear(&prproc->ipi_nokick); + if (rproc_check_rsc_table_stop(rproc)) + { + PHYTIUM_RPROC_DEBUG_E("stop flag found, cpu down!.\n\r") ; + rproc_set_stop_flag(); + FPsciCpuOff(); + return; + } + +exit: + atomic_flag_clear(&prproc->ipi_nokick); } #endif @@ -108,31 +109,29 @@ PhytiumProcInit(struct remoteproc *rproc,struct remoteproc_ops *ops, &kick_dev); if (ret) { - PHYTIUM_RPROC_MAIN_DEBUG_E("Failed to open polling device: %d.\r\n", ret); + PHYTIUM_RPROC_DEBUG_E("Failed to open polling device: %d.\r\n", ret); return NULL; } rproc->priv = prproc; prproc->kick_dev = kick_dev; - prproc->kick_io = metal_device_io_region(kick_dev, 0); - if (!prproc->kick_io) - { - goto err1; - } #ifdef CONFIG_USE_OPENAMP_IPI u32 cpu_id; atomic_store(&prproc->ipi_nokick, 1); GetCpuId(&cpu_id); + PHYTIUM_RPROC_DEBUG_I("CPU ID : %d.", cpu_id) ; /* Register interrupt handler and enable interrupt */ irq_vect = (uintptr_t)kick_dev->irq_info; - PHYTIUM_RPROC_MAIN_DEBUG_I("irq_vect is %d \r\n", irq_vect) ; - PHYTIUM_RPROC_MAIN_DEBUG_I("current %d \r\n", cpu_id) ; - - InterruptSetPriority(irq_vect, 16) ; + PHYTIUM_RPROC_DEBUG_I("irq_vect is %d .", irq_vect) ; + InterruptSetPriority(irq_vect, IRQ_PRIORITY_VALUE_0) ; InterruptInstall(irq_vect, PhytiumIrqhandler, rproc, "phytium_rproc") ; - InterruptUmask(irq_vect) ; #else + prproc->kick_io = metal_device_io_region(kick_dev, 0); + if (!prproc->kick_io) + { + goto err1; + } (void)irq_vect; metal_io_write32(prproc->kick_io, 0, !POLL_STOP); #endif /* !CONFIG_USE_OPENAMP_IPI */ @@ -161,7 +160,7 @@ static void PhytiumProcRemove(struct remoteproc *rproc) dev = prproc->kick_dev; if (dev) { - PHYTIUM_RPROC_MAIN_DEBUG_I("Start to remove \r\n") ; + PHYTIUM_RPROC_DEBUG_I("Start to remove \r\n") ; InterruptMask((uintptr_t)dev->irq_info); } #else /* RPMSG_NO_IPI */ @@ -183,23 +182,15 @@ PhytiumProcMmap(struct remoteproc *rproc, metal_phys_addr_t *pa, lpa = *pa; lda = *da; - if (lpa == METAL_BAD_PHYS && lda == METAL_BAD_PHYS) - { - return NULL; - } - if (lpa == METAL_BAD_PHYS) - { - lpa = lda; - } - if (lda == METAL_BAD_PHYS) - { - lda = lpa; - } + if (lpa == METAL_BAD_PHYS && lda == METAL_BAD_PHYS) + return NULL; + if (lpa == METAL_BAD_PHYS) + lpa = lda; + if (lda == METAL_BAD_PHYS) + lda = lpa; - if (!attribute) - { - attribute = DEFAULT_MEM_ATTRIBUTE; - } + if (!attribute) + attribute = (MT_NORMAL|MT_P_RW_U_RW); mem = metal_allocate_memory(sizeof(*mem)); if (!mem) @@ -214,8 +205,7 @@ PhytiumProcMmap(struct remoteproc *rproc, metal_phys_addr_t *pa, } remoteproc_init_mem(mem, NULL, lpa, lda, size, tmpio); /* va is the same as pa in this platform */ - metal_io_init(tmpio, (void *)lpa, &mem->pa, size, - -1, attribute, NULL); + metal_io_init(tmpio, (void *)lpa, &mem->pa, size, -1, attribute, NULL); remoteproc_add_mem(rproc, mem); *pa = lpa; *da = lda; @@ -242,9 +232,11 @@ static int PhytiumProcNotify(struct remoteproc *rproc, uint32_t id) #ifndef CONFIG_USE_OPENAMP_IPI metal_io_write32(prproc->kick_io, 0, POLL_STOP); #else - u32 cpu_id; - GetCpuId(&cpu_id); - InterruptCoreInterSend((uintptr)(prproc->kick_dev->irq_info), prproc->ipi_chn_mask); +#ifdef CONFIG_USE_MASTER_VRING_DEFINE + InterruptCoreInterSend((uintptr)(prproc->kick_dev->irq_info), prproc->cpu_id); +#else + InterruptCoreInterSend((uintptr)(prproc->kick_dev->irq_info), 1 << prproc->cpu_id); +#endif #endif /* RPMSG_NO_IPI */ return 0; @@ -257,9 +249,9 @@ static int Phytium_rproc_start(struct remoteproc *rproc) priv = rproc->priv; FCacheDCacheFlush(); - ret = FPsciCpuMaskOn(priv->cpu_mask, (uintptr_t)rproc->bootaddr); + ret = FPsciCpuMaskOn(1 << priv->cpu_id , (uintptr_t)rproc->bootaddr); if (ret != 0) { - PHYTIUM_RPROC_MAIN_DEBUG_E("Failed to start core mask 0x%x, ret=0x%x\n\r", priv->cpu_mask, ret); + PHYTIUM_RPROC_DEBUG_E("Failed to start core id 0x%x, ret=0x%x\n\r", priv->cpu_id, ret); return -1; } diff --git a/third-party/openamp/ports/platform_info.c b/third-party/openamp/ports/platform_info.c index fe15cc9682c9ad64151516986ea216a0e6779195..3f1cc0d472d07be040258774eee75f7585952e18 100644 --- a/third-party/openamp/ports/platform_info.c +++ b/third-party/openamp/ports/platform_info.c @@ -20,6 +20,7 @@ * Ver   Who        Date         Changes * ----- ------     --------    -------------------------------------- * 1.0 huanghe 2022/04/21 first release + * 1.1 liusm 2024/07/05 modify for phytium platform */ /***************************** Include Files *********************************/ @@ -31,253 +32,164 @@ #include #include #include +#include #include "platform_info.h" #include "rsc_table.h" #include "sdkconfig.h" -#include "fmmu.h" #include "fdebug.h" -#include - -/************************** Constant Definitions *****************************/ - -/**************************** Type Definitions *******************************/ - -/***************** Macros (Inline Functions) Definitions *********************/ - -#define FT_PLAT_INFO_MAIN_DEBUG_TAG " FT_PLAT_INFO_MAIN" -#define FT_PLAT_INFO_MAIN_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( FT_PLAT_INFO_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) -#define FT_PLAT_INFO_MAIN_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( FT_PLAT_INFO_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) -#define FT_PLAT_INFO_MAIN_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( FT_PLAT_INFO_MAIN_DEBUG_TAG, format, ##__VA_ARGS__) - - -#define KICK_DEV_NAME "poll_dev" -#define KICK_BUS_NAME "generic" +#include "helper.h" +#define FT_PLAT_INFO_DEBUG_TAG "FT_PLAT_INFO" +#define FT_PLAT_INFO_DEBUG_I(format, ...) FT_DEBUG_PRINT_I( FT_PLAT_INFO_DEBUG_TAG, format, ##__VA_ARGS__) +#define FT_PLAT_INFO_DEBUG_W(format, ...) FT_DEBUG_PRINT_W( FT_PLAT_INFO_DEBUG_TAG, format, ##__VA_ARGS__) +#define FT_PLAT_INFO_DEBUG_E(format, ...) FT_DEBUG_PRINT_E( FT_PLAT_INFO_DEBUG_TAG, format, ##__VA_ARGS__) #ifdef CONFIG_USE_OPENAMP_IPI #define _rproc_wait() asm volatile("wfi") #endif /* !RPMSG_NO_IPI */ -#ifdef CONFIG_MEM_NORMAL - #define MEM_ATTR_ACESS (MT_NORMAL|MT_P_RW_U_RW) -#endif - -#ifdef CONFIG_MEM_WRITE_THROUGH - #define MEM_ATTR_ACESS (MT_NORMAL_WT|MT_P_RW_U_RW) -#endif - -#ifdef CONFIG_MEM_NO_CACHE - #define MEM_ATTR_ACESS (MT_NORMAL_NC|MT_P_RW_U_RW) -#endif - - /************************** Variable Definitions *****************************/ - -/* Polling information used by remoteproc operations. - */ -static metal_phys_addr_t poll_phys_addr = POLL_BASE_ADDR; -struct metal_device kick_device = -{ - .name = "poll_dev", - .bus = NULL, - .num_regions = 1, - .regions = { - { - .virt = (void *)POLL_BASE_ADDR, - .physmap = &poll_phys_addr, - .size = 0x1000, - .page_shift = -1UL, - .page_mask = -1UL, - .mem_flags = MEM_ATTR_ACESS, - .ops = {NULL}, - } - }, - .node = {NULL}, -#ifdef CONFIG_USE_OPENAMP_IPI - .irq_num = 1, - .irq_info = (void *)CONFIG_IPI_IRQ_NUM, -#endif /* !RPMSG_NO_IPI */ -}; - -static struct remoteproc_priv rproc_priv = -{ - .kick_dev_name = KICK_DEV_NAME, - .kick_dev_bus_name = KICK_BUS_NAME, -#ifdef CONFIG_USE_OPENAMP_IPI - .ipi_chn_mask = CONFIG_IPI_CHN_BITMASK,//IPI_CHN_BITMASK, -#endif /* !RPMSG_NO_IPI */ -}; +static volatile unsigned int stop_flag = 0; +extern struct remoteproc_ops phytium_proc_ops ; #ifdef CONFIG_USE_MASTER_VRING_DEFINE - static metal_phys_addr_t linux_share_buffer; +static metal_phys_addr_t linux_share_buffer; #endif -static struct remoteproc rproc_inst; -/* notification operation and remote processor managementi operations. */ -extern struct remoteproc_ops phytium_proc_ops; -/* RPMsg virtio shared buffer pool */ -static struct rpmsg_virtio_shm_pool shpool; - -extern struct remote_resource_table resources; - - /************************** Function Prototypes ******************************/ - -static struct remoteproc *platform_create_proc(int proc_index, int rsc_index) +#ifdef CONFIG_USE_OPENAMP_IPI +unsigned int rproc_check_rsc_table_stop(struct remoteproc *rproc) { - void *rsc_table; - int rsc_size; - int ret; - u32 cpu_id; - metal_phys_addr_t pa; - - (void)proc_index; - - rsc_table = (void *)&resources; //get_resource_table(rsc_index, &rsc_size); - rsc_size = sizeof(resources); - /* resource_table_dump(); */ - /* Register IPI device */ - if (metal_register_generic_device(&kick_device)) - { - return NULL; + if (!rproc) { + FT_PLAT_INFO_DEBUG_E("rproc NULL! \r\n"); + return 0; } - /* Initialize remoteproc instance */ - if (!remoteproc_init(&rproc_inst, &phytium_proc_ops, &rproc_priv)) - { - return NULL; - } - - /* Mmap shared memories Or shall we constraint that they will be set as carved out in the resource table?. mmap resource table */ - pa = (metal_phys_addr_t)rsc_table; - (void *)remoteproc_mmap(&rproc_inst, &pa, NULL, rsc_size, MEM_ATTR_ACESS, &rproc_inst.rsc_io); - /* mmap shared memory */ - pa = SHARED_MEM_PA; - (void *)remoteproc_mmap(&rproc_inst, &pa, NULL, SHARED_MEM_SIZE, MEM_ATTR_ACESS, NULL); + struct remote_resource_table *table_ptr = rproc->rsc_table; + unsigned int *flag = table_ptr->reserved; - /* linux kernel malloc addr */ -#ifdef CONFIG_USE_MASTER_VRING_DEFINE - pa = resources.rpmsg_vdev.vring[0].da; /* 默认kernel vring[0].da 的首地址是整个sharebuffer 的起始位置 */ - (void *)remoteproc_mmap(&rproc_inst, &pa, NULL, SHARED_MEM_SIZE * 2, MEM_ATTR_ACESS, NULL); - linux_share_buffer = pa; -#endif - /* parse resource table to remoteproc */ - ret = remoteproc_set_rsc_table(&rproc_inst, rsc_table, rsc_size); - if (ret) - { - FT_PLAT_INFO_MAIN_DEBUG_E("Failed to intialize remoteproc %d \r\n", ret); - remoteproc_remove(&rproc_inst); - return NULL; + if (*flag & REMOTE_PROC_STOP) { + return 1; + } else { + return 0; } - - FT_PLAT_INFO_MAIN_DEBUG_I("Initialize remoteproc successfully.\r\n"); - - return &rproc_inst; } +#endif -extern int init_system(void); -extern void cleanup_system(void); - -int platform_init(int argc, char *argv[], void **platform) +unsigned int rproc_get_stop_flag(void) { - unsigned long proc_id = 0; - unsigned long rsc_id = 0; - struct remoteproc *rproc; + return stop_flag; +} - if (!platform) - { - FT_PLAT_INFO_MAIN_DEBUG_E("Failed to initialize platform, NULL pointer to store platform data.\r\n"); - return -EINVAL; - } +void rproc_set_stop_flag(void) +{ + stop_flag |= REMOTE_PROC_STOP; +} - /* Initialize HW system components */ - init_system(); +void rproc_clear_stop_flag(void) +{ + stop_flag &= ~REMOTE_PROC_STOP; +} - if (argc >= 2) - { - proc_id = strtoul(argv[1], NULL, 0); - } +struct remoteproc *platform_create_proc(struct remoteproc * rproc_inst,struct remoteproc_priv *priv ,struct metal_device *kick_dev) +{ + struct remoteproc * rproc; - if (argc >= 3) + if (metal_register_generic_device(kick_dev)) { - rsc_id = strtoul(argv[2], NULL, 0); - } - rproc = platform_create_proc(proc_id, rsc_id); - if (!rproc) - { - FT_PLAT_INFO_MAIN_DEBUG_E("Failed to create remoteproc device.\r\n"); - return -EINVAL; + return NULL; } - *platform = rproc; - - return 0; + /* Initialize remoteproc instance */ + /* metal_device_open(KICK_BUS_NAME,KICK_DEV_NAME,rproc_inst->priv->kick_dev) */ + /* rproc_inst->priv->kick_io = metal_device_io_region(rproc_inst->priv->kick_dev, 0); */ + rproc = remoteproc_init(rproc_inst, &phytium_proc_ops, priv) ; + + return rproc; } -struct rpmsg_device *platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index, unsigned int role, void (*rst_cb)(struct virtio_device *vdev), rpmsg_ns_bind_cb ns_bind_cb) +int platform_setup_src_table(struct remoteproc *rproc_inst,metal_phys_addr_t *rsc_table) { - struct remoteproc *rproc = platform; - struct rpmsg_virtio_device *rpmsg_vdev; - struct virtio_device *vdev; - void *shbuf; - struct metal_io_region *shbuf_io; + metal_phys_addr_t pa; + struct remoteproc_priv *priv = rproc_inst->priv; int ret; + // metal_phys_addr_t *rsc_table = priv->src_table_va ; + size_t rsc_size = sizeof(struct remote_resource_table) ; + unsigned int attribute = priv->src_table_attribute ; + + pa = (metal_phys_addr_t)rsc_table; + /* rproc_inst.mems rproc_inst.rsc_io*/ + /* 在OpenAMP应用中,通常需要通过remoteproc_mmap()函数将远程处理器中的共享内存映射到本地主机中,以便应用程序进行读写操作。*/ + (void *)remoteproc_mmap(rproc_inst, &pa, NULL, rsc_size, attribute, &rproc_inst->rsc_io); - rpmsg_vdev = metal_allocate_memory(sizeof(*rpmsg_vdev)); - if (!rpmsg_vdev) + ret = remoteproc_set_rsc_table(rproc_inst, (struct resource_table *)rsc_table, rsc_size); + if (ret) { - return NULL; - } + FT_PLAT_INFO_DEBUG_E("Failed to intialize remoteproc %d \r\n",ret); + remoteproc_remove(rproc_inst); + return -1; + } + priv->src_table_ready_flag = 1;/* 标记src_table已经准备好了 */ + return 0 ; +} +int platform_setup_share_mems(struct remoteproc *rproc_inst) +{ + int ret; + struct remoteproc_priv *priv = rproc_inst->priv; #ifdef CONFIG_USE_MASTER_VRING_DEFINE - shbuf_io = remoteproc_get_io_with_pa(rproc, linux_share_buffer); - if (!shbuf_io) - { - goto err1; - } - FT_PLAT_INFO_MAIN_DEBUG_I("linux_share_buffer is %p \r\n", linux_share_buffer); - shbuf = metal_io_phys_to_virt(shbuf_io, linux_share_buffer + SHARED_BUF_OFFSET); + struct remote_resource_table *table_ptr = rproc_inst->rsc_table; + priv->share_mem_pa = table_ptr->rpmsg_vdev.vring[0].da;/* 默认kernel vring[0].da 的首地址是整个sharebuffer 的起始位置 */ + (void *)remoteproc_mmap(rproc_inst, &priv->share_mem_pa, NULL, priv->share_mem_size, priv->share_mem_attribute, NULL); #else - shbuf_io = remoteproc_get_io_with_pa(rproc, SHARED_MEM_PA); - FT_PLAT_INFO_MAIN_DEBUG_I("shbuf_io is %p \r\n", shbuf_io); - if (!shbuf_io) - { - goto err1; - } - - shbuf = metal_io_phys_to_virt(shbuf_io, SHARED_MEM_PA + SHARED_BUF_OFFSET); + (void *)remoteproc_mmap(rproc_inst, &priv->share_mem_pa, &priv->share_mem_va, priv->share_mem_size, priv->share_mem_attribute, NULL); #endif + return 0 ; +} - FT_PLAT_INFO_MAIN_DEBUG_I("Creating remoteproc virtio\r\n"); - /* TODO: can we have a wrapper for the following two functions? */ - vdev = remoteproc_create_virtio(rproc, vdev_index, role, rst_cb); - if (!vdev) - { - FT_PLAT_INFO_MAIN_DEBUG_E("Failed remoteproc_create_virtio\r\n"); - goto err1; - } - - FT_PLAT_INFO_MAIN_DEBUG_I("Initializing rpmsg shared buffer pool\r\n"); - /* Only RPMsg virtio master needs to initialize the shared buffers pool */ - rpmsg_virtio_init_shm_pool(&shpool, shbuf, (SHARED_MEM_SIZE - SHARED_BUF_OFFSET)); - - - FT_PLAT_INFO_MAIN_DEBUG_I("Initializing rpmsg vdev\r\n"); - /* RPMsg virtio slave can set shared buffers pool argument to NULL */ - ret = rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb, shbuf_io, &shpool); - if (ret) - { - FT_PLAT_INFO_MAIN_DEBUG_E("Failed rpmsg_init_vdev\r\n"); - goto err2; - } - - FT_PLAT_INFO_MAIN_DEBUG_I("Initializing rpmsg vdev\r\n"); - return rpmsg_virtio_get_rpmsg_device(rpmsg_vdev); +struct rpmsg_device *platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index, unsigned int role, + void (*rst_cb)(struct virtio_device *vdev), rpmsg_ns_bind_cb ns_bind_cb) +{ + struct remoteproc *rproc = platform; + struct rpmsg_virtio_device *rpmsg_vdev; + struct virtio_device *vdev; + void *shbuf; + struct metal_io_region *shbuf_io; + struct remoteproc_priv *priv = rproc->priv; + int ret; + + rpmsg_vdev = metal_allocate_memory(sizeof(*rpmsg_vdev)); + if (!rpmsg_vdev) + return NULL; + + shbuf_io = remoteproc_get_io_with_pa(rproc, priv->share_mem_pa); + if (!shbuf_io) + goto err1; + FT_PLAT_INFO_DEBUG_I("share_mem_pa is %p \r\n",priv->share_mem_pa); + shbuf = metal_io_phys_to_virt(shbuf_io, priv->share_mem_pa + priv->share_buffer_offset); + /* TODO: can we have a wrapper for the following two functions? */ + vdev = remoteproc_create_virtio(rproc, vdev_index, role, rst_cb); + if (!vdev) { + FT_PLAT_INFO_DEBUG_E("failed remoteproc_create_virtio\r\n"); + goto err1; + } + + /* Only RPMsg virtio master needs to initialize the shared buffers pool */ + rpmsg_virtio_init_shm_pool(&priv->shpool, shbuf, priv->share_mem_size - priv->share_buffer_offset); + + /* RPMsg virtio slave can set shared buffers pool argument to NULL */ + ret = rpmsg_init_vdev(rpmsg_vdev, vdev, ns_bind_cb, shbuf_io, &priv->shpool); + if (ret) { + FT_PLAT_INFO_DEBUG_E("failed rpmsg_init_vdev ret is %d \r\n",ret); + goto err2; + } + FT_PLAT_INFO_DEBUG_I("initializing rpmsg vdev\r\n"); + return rpmsg_virtio_get_rpmsg_device(rpmsg_vdev); err2: - remoteproc_remove_virtio(rproc, vdev); + remoteproc_remove_virtio(rproc, vdev); err1: - metal_free_memory(rpmsg_vdev); - return NULL; + metal_free_memory(rpmsg_vdev); + return NULL; } int platform_poll(void *priv) @@ -287,7 +199,6 @@ int platform_poll(void *priv) unsigned int flags; int ret; - prproc = rproc->priv; while (1) { @@ -318,6 +229,37 @@ int platform_poll(void *priv) } +int platform_poll_nonblocking(void *priv) +{ + struct remoteproc *rproc = priv; + struct remoteproc_priv *prproc; + unsigned int flags; + int ret; + + prproc = rproc->priv; + +#ifndef CONFIG_USE_OPENAMP_IPI + if (metal_io_read32(prproc->kick_io, 0) & POLL_STOP) //RPROC_M2S_SHIFT + { + ret = remoteproc_get_notification(rproc,RSC_NOTIFY_ID_ANY); + if (ret) + return ret; + } + (void)flags; +#else /* !RPMSG_NO_IPI */ + flags = metal_irq_save_disable(); + if (!(atomic_flag_test_and_set(&prproc->ipi_nokick))) + { + metal_irq_restore_enable(flags); + ret = remoteproc_get_notification(rproc,RSC_NOTIFY_ID_ANY); + if (ret) + return ret; + } + metal_irq_restore_enable(flags); +#endif /* RPMSG_NO_IPI */ + return 0; +} + void platform_release_rpmsg_vdev(struct rpmsg_device *rpdev, void *platform) { struct rpmsg_virtio_device *rpvdev; diff --git a/third-party/openamp/ports/platform_info.h b/third-party/openamp/ports/platform_info.h index d7bf0177d73440167384c012c2a2d336cb67ca71..085bdd4b5d9c2b2e6bb8c036e1c091c3a36e744b 100644 --- a/third-party/openamp/ports/platform_info.h +++ b/third-party/openamp/ports/platform_info.h @@ -21,7 +21,6 @@ * ----- ------     --------    -------------------------------------- */ - #ifndef PLATFORM_INFO_H_ #define PLATFORM_INFO_H_ @@ -29,115 +28,73 @@ #include #include #include +#include #include "sdkconfig.h" +#include "ftypes.h" +#ifdef __cplusplus +extern "C" +{ +#endif +#define POLL_STOP 0x1U +/* 需要宇linux 进行沟通 */ +#define REMOTE_PROC_STOP 0x0001U -/************************** Constant Definitions *****************************/ +/**************************** Type Definitions *******************************/ -/************************** Variable Definitions *****************************/ +struct remoteproc_priv { + const char *kick_dev_name; + const char *kick_dev_bus_name; + struct metal_device *kick_dev; + struct metal_io_region *kick_io; +#ifdef CONFIG_USE_OPENAMP_IPI + atomic_int ipi_nokick; +#endif /* !RPMSG_NO_IPI */ + unsigned int cpu_id ; + /* remoteproc elf address */ + metal_phys_addr_t elf_addr; + unsigned int src_table_ready_flag ; + /* src_table memory */ + u32 src_table_attribute ; + /* share_mem_size = |tx vring|rx vring|share buffer| */ + metal_phys_addr_t share_mem_va ; + metal_phys_addr_t share_mem_pa ; + u32 share_mem_size ; + u32 share_buffer_offset ; + u32 share_mem_attribute ; + struct rpmsg_virtio_shm_pool shpool; +}; +/************************** Function Prototypes ******************************/ -#if defined __cplusplus -extern "C" { -#endif +struct remoteproc *platform_create_proc(struct remoteproc * rproc_inst,struct remoteproc_priv *priv ,struct metal_device *kick_dev) ; - /***************** Macros (Inline Functions) Definitions *********************/ +int platform_setup_src_table(struct remoteproc *rproc_inst,metal_phys_addr_t *rsc_table) ; - /* Cortex R5 memory attributes */ -#define DEVICE_SHARED 0x00000001U /* device, shareable */ -#define DEVICE_NONSHARED 0x00000010U /* device, non shareable */ -#define NORM_NSHARED_NCACHE 0x00000008U /* Non cacheable non shareable */ -#define NORM_SHARED_NCACHE 0x0000000CU /* Non cacheable shareable */ -#define PRIV_RW_USER_RW (0x00000003U<<8U) /* Full Access */ +int platform_setup_share_mems(struct remoteproc *rproc_inst); +struct rpmsg_device *platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index, unsigned int role, + void (*rst_cb)(struct virtio_device *vdev), rpmsg_ns_bind_cb ns_bind_cb) ; +int platform_poll(void *priv); -#define SHARED_MEM_PA CONFIG_VRING_TX_ADDR -#define POLL_BASE_ADDR CONFIG_POLL_BASE_ADDR +int platform_poll_nonblocking(void *priv) ; -#define SHARED_MEM_SIZE 0x100000UL /* 必须要和kernel 进行约定 */ -#define SHARED_BUF_OFFSET 0x8000UL +void platform_release_rpmsg_vdev(struct rpmsg_device *rpdev, void *platform); -#ifndef CONFIG_USE_OPENAMP_IPI -#define POLL_STOP 0x1U +int platform_cleanup(void *platform); + +#ifdef CONFIG_USE_OPENAMP_IPI +unsigned int rproc_check_rsc_table_stop(struct remoteproc *rproc); #endif - /**************************** Type Definitions *******************************/ +unsigned int rproc_get_stop_flag(void); - struct remoteproc_priv - { - const char *kick_dev_name; - const char *kick_dev_bus_name; - struct metal_device *kick_dev; - struct metal_io_region *kick_io; -#ifdef CONFIG_USE_OPENAMP_IPI - unsigned int ipi_chn_mask; /**< IPI channel mask */ - atomic_int ipi_nokick; -#endif /* !RPMSG_NO_IPI */ - unsigned int cpu_mask; - }; - - /************************** Function Prototypes ******************************/ - - /** - * platform_init - initialize the platform - * - * It will initialize the platform. - * - * @argc: number of arguments - * @argv: array of the input arguements - * @platform: pointer to store the platform data pointer - * - * return 0 for success or negative value for failure - */ - int platform_init(int argc, char *argv[], void **platform); - - /** - * platform_create_rpmsg_vdev - create rpmsg vdev - * - * It will create rpmsg virtio device, and returns the rpmsg virtio - * device pointer. - * - * @platform: pointer to the private data - * @vdev_index: index of the virtio device, there can more than one vdev - * on the platform. - * @role: virtio master or virtio slave of the vdev - * @rst_cb: virtio device reset callback - * @ns_bind_cb: rpmsg name service bind callback - * - * return pointer to the rpmsg virtio device - */ - struct rpmsg_device * - platform_create_rpmsg_vdev(void *platform, unsigned int vdev_index, - unsigned int role, - void (*rst_cb)(struct virtio_device *vdev), - rpmsg_ns_bind_cb ns_bind_cb); - - /** - * platform_poll - platform poll function - * - * @platform: pointer to the platform - * - * return negative value for errors, otherwise 0. - */ - int platform_poll(void *platform); - - /** - * platform_release_rpmsg_vdev - release rpmsg virtio device - * - * @rpdev: pointer to the rpmsg device - */ - void platform_release_rpmsg_vdev(struct rpmsg_device *rpdev, void *platform); - - /** - * platform_cleanup - clean up the platform resource - * - * @platform: pointer to the platform - */ - int platform_cleanup(void *platform); - - -#if defined __cplusplus +void rproc_set_stop_flag(void); + +void rproc_clear_stop_flag(void); + +#ifdef __cplusplus } #endif diff --git a/third-party/openamp/ports/rpmsg_service.h b/third-party/openamp/ports/rpmsg_service.h index 2636910a08d1d7d3d1d191129161e760a4fae9d2..8af4c53f660a663d2642f2c31f8e3d6a53d7c8b6 100644 --- a/third-party/openamp/ports/rpmsg_service.h +++ b/third-party/openamp/ports/rpmsg_service.h @@ -12,7 +12,6 @@ extern "C" /* name service of endpoint */ #define RPMSG_SERVICE_NAME "rpmsg-openamp-demo-channel" -#define DEMO_SERVICE_NAME "demo-openamp-channel" #ifdef __cplusplus } diff --git a/third-party/openamp/ports/rsc_table.c b/third-party/openamp/ports/rsc_table.c deleted file mode 100644 index 7f342b93c6d00a90636277c63276fe6350e63051..0000000000000000000000000000000000000000 --- a/third-party/openamp/ports/rsc_table.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright : (C) 2022 Phytium Information Technology, Inc. - * All Rights Reserved. - * - * This program is OPEN SOURCE software: you can redistribute it and/or modify it - * under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd, - * either version 1.0 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the Phytium Public License for more details. - * - * - * FilePath: rsc_table.c - * Date: 2022-02-23 11:24:12 - * LastEditTime: 2022-02-23 11:43:59 - * Description:  This file populates resource table for BM remote - * - * Modify History: - * Ver   Who        Date         Changes - * ----- ------     --------    -------------------------------------- - * 1.0 huanghe 2022/04/21 first release - */ - - -/***************************** Include Files *********************************/ - -#include -#include "rsc_table.h" -#include -#include "sdkconfig.h" -#include "fdebug.h" - -#define RSC_TABLE_DEBUG_TAG "RSC_TABLE" -#define RSC_TABLE_DEBUG(format, ...) FT_DEBUG_PRINT_D(RSC_TABLE_DEBUG_TAG, format, ##__VA_ARGS__) -#define RSC_TABLE_INFO(format, ...) FT_DEBUG_PRINT_I(RSC_TABLE_DEBUG_TAG, format, ##__VA_ARGS__) -#define RSC_TABLE_WARN(format, ...) FT_DEBUG_PRINT_W(RSC_TABLE_DEBUG_TAG, format, ##__VA_ARGS__) -#define RSC_TABLE_ERROR(format, ...) FT_DEBUG_PRINT_E(RSC_TABLE_DEBUG_TAG, format, ##__VA_ARGS__) - -/***************** Macros (Inline Functions) Definitions *********************/ - -/* Place resource table in special ELF section */ -#define __section_t(S) __attribute__((__section__(#S))) -#define __resource __section_t(.resource_table) - -#define RPMSG_IPU_C0_FEATURES 1 - -/* VirtIO rpmsg device id */ -#define VIRTIO_ID_RPMSG_ 7 - -/* Remote supports Name Service announcement */ -#define VIRTIO_RPMSG_F_NS 0 - -#define NUM_VRINGS 0x02 -#define VRING_ALIGN 0x1000 -#define RING_TX CONFIG_VRING_TX_ADDR -#define RING_RX CONFIG_VRING_RX_ADDR -#define VRING_SIZE CONFIG_VRING_SIZE - -#define NUM_TABLE_ENTRIES 1 - -/************************** Constant Definitions *****************************/ - -/**************************** Type Definitions *******************************/ - -/************************** Variable Definitions *****************************/ - -struct remote_resource_table __resource resources = -{ - /* Version */ - 1, - - /* NUmber of table entries */ - NUM_TABLE_ENTRIES, - /* reserved fields */ - {0, 0,}, - - /* Offsets of rsc entries */ - { - offsetof(struct remote_resource_table, rpmsg_vdev), - }, - - /* Virtio device entry */ - { - RSC_VDEV, VIRTIO_ID_RPMSG_, 0, RPMSG_IPU_C0_FEATURES, 0, 0, 0, - NUM_VRINGS, {0, 0}, - }, - - /* Vring rsc entry - part of vdev rsc entry */ - {RING_TX, VRING_ALIGN, VRING_SIZE, 1, 0}, - {RING_RX, VRING_ALIGN, VRING_SIZE, 2, 0}, -}; - -void *get_resource_table(int rsc_id, int *len) -{ - (void) rsc_id; - *len = sizeof(resources); - return &resources; -} - - - - -/************************** Function Prototypes ******************************/ - -void resource_table_dump(void) -{ - RSC_TABLE_DEBUG("version is %d .\r\n", resources.version); - RSC_TABLE_DEBUG("num is %d .\r\n", resources.num); - RSC_TABLE_DEBUG("offset is %d .\r\n", resources.offset[0]); - RSC_TABLE_DEBUG("rpmsg_vdev.type is %d .\r\n", resources.rpmsg_vdev.type); - RSC_TABLE_DEBUG("rpmsg_vdev.id is %d .\r\n", resources.rpmsg_vdev.id); - RSC_TABLE_DEBUG("rpmsg_vdev.notifyid is %d .\r\n", resources.rpmsg_vdev.notifyid); - RSC_TABLE_DEBUG("rpmsg_vdev.dfeatures is %d .\r\n", resources.rpmsg_vdev.dfeatures); - RSC_TABLE_DEBUG("rpmsg_vdev.gfeatures is %d .\r\n", resources.rpmsg_vdev.gfeatures); - RSC_TABLE_DEBUG("rpmsg_vdev.config_len is %d .\r\n", resources.rpmsg_vdev.config_len); - RSC_TABLE_DEBUG("rpmsg_vdev.status is %d .\r\n", resources.rpmsg_vdev.status); - RSC_TABLE_DEBUG("rpmsg_vdev.num_of_vrings is %d .\r\n", resources.rpmsg_vdev.num_of_vrings); - RSC_TABLE_DEBUG("rpmsg_vdev.vring[0].da is %x .\r\n", resources.rpmsg_vdev.vring[0].da); - RSC_TABLE_DEBUG("rpmsg_vdev.vring[0].align is %d .\r\n", resources.rpmsg_vdev.vring[0].align); - RSC_TABLE_DEBUG("rpmsg_vdev.vring[0].num is %d .\r\n", resources.rpmsg_vdev.vring[0].num); - RSC_TABLE_DEBUG("rpmsg_vdev.vring[0].notifyid is %d .\r\n", resources.rpmsg_vdev.vring[0].notifyid); - RSC_TABLE_DEBUG("rpmsg_vdev.vring[0].reserved is %d .\r\n", resources.rpmsg_vdev.vring[0].reserved); - RSC_TABLE_DEBUG("rpmsg_vdev.vring[1].da is %x .\r\n", resources.rpmsg_vdev.vring[1].da); - RSC_TABLE_DEBUG("rpmsg_vdev.vring[1].align is %d .\r\n", resources.rpmsg_vdev.vring[1].align); - RSC_TABLE_DEBUG("rpmsg_vdev.vring[1].num is %d .\r\n", resources.rpmsg_vdev.vring[1].num); - RSC_TABLE_DEBUG("rpmsg_vdev.vring[1].notifyid is %d .\r\n", resources.rpmsg_vdev.vring[1].notifyid); - RSC_TABLE_DEBUG("rpmsg_vdev.vring[1].reserved is %d .\r\n", resources.rpmsg_vdev.vring[1].reserved); -} diff --git a/third-party/openamp/ports/rsc_table.h b/third-party/openamp/ports/rsc_table.h index ed1a499409080b2c3cfcb0ed60228edcddf9e596..023a112672f7b0f2ab07e8375a3d1621ca6e2f2c 100644 --- a/third-party/openamp/ports/rsc_table.h +++ b/third-party/openamp/ports/rsc_table.h @@ -35,33 +35,44 @@ extern "C" { #endif - /************************** Constant Definitions *****************************/ +#define NO_RESOURCE_ENTRIES 8 - /************************** Variable Definitions *****************************/ +/* Place resource table in special ELF section */ +#define __section_t(S) __attribute__((__section__(#S))) +#define __resource __section_t(.resource_table) - /************************** Function Prototypes ******************************/ +#define RPMSG_IPU_C0_FEATURES 1 - /***************** Macros (Inline Functions) Definitions *********************/ +/* VirtIO rpmsg device id */ +#define VIRTIO_ID_RPMSG_ 7 +/* notifyid is a unique rproc-wide notify index for this vdev */ +#define VDEV_NOTIFYID 0 +/* Remote supports Name Service announcement */ +#define VIRTIO_RPMSG_F_NS 0 -#define NO_RESOURCE_ENTRIES 8 +#define NUM_VRINGS 0x02 +#define VRING_ALIGN 0x1000 +#define RING_TX CONFIG_VRING_TX_ADDR +#define RING_RX CONFIG_VRING_RX_ADDR + +#define NUM_TABLE_ENTRIES 1 + +/**************************** Type Definitions *******************************/ + +/* Resource table for the given remote */ +struct remote_resource_table +{ + unsigned int version; + unsigned int num; + unsigned int reserved[2]; + unsigned int offset[NO_RESOURCE_ENTRIES]; + /* rpmsg vdev entry */ + struct fw_rsc_vdev rpmsg_vdev; + struct fw_rsc_vdev_vring rpmsg_vring0; + struct fw_rsc_vdev_vring rpmsg_vring1; +} __attribute__((packed, aligned(0x1000))); - /**************************** Type Definitions *******************************/ - - /* Resource table for the given remote */ - struct remote_resource_table - { - unsigned int version; - unsigned int num; - unsigned int reserved[2]; - unsigned int offset[NO_RESOURCE_ENTRIES]; - /* rpmsg vdev entry */ - struct fw_rsc_vdev rpmsg_vdev; - struct fw_rsc_vdev_vring rpmsg_vring0; - struct fw_rsc_vdev_vring rpmsg_vring1; - } __attribute__((packed, aligned(0x100))); - - void *get_resource_table(int rsc_id, int *len); #if defined __cplusplus } diff --git a/tools/makeall.mk b/tools/makeall.mk index 892659fbb96ad7bc2acab817b894ae458f29da4a..fb441d6ae763b2a0de53e302c01931722a185072 100644 --- a/tools/makeall.mk +++ b/tools/makeall.mk @@ -19,6 +19,9 @@ export SDK_DIR # config path SDK_KCONFIG_DIR ?= $(SDK_DIR)/tools/build/Kconfiglib +# Pyhthon 工具目录 +SDK_PYTHON_TOOLS_DIR ?= $(SDK_DIR)/tools/build/py_tools + # 编译中间文件输出的路径 BUILD_OUT_PATH ?= $(PROJECT_DIR)/build @@ -40,4 +43,8 @@ include $(SDK_DIR)/tools/build/build.mk # make menuconfig tools include $(SDK_DIR)/tools/build/menuconfig/preconfig.mk -include $(SDK_DIR)/tools/build/menuconfig/menuconfig.mk \ No newline at end of file +include $(SDK_DIR)/tools/build/menuconfig/menuconfig.mk + +amp_make: + $(PYTHON) $(SDK_PYTHON_TOOLS_DIR)/amp_parse_config.py + cp ./packed_image.elf $(USR_BOOT_DIR)/freertos.elf