Browse Source

!166 更新并修复bug

* update sdk
pull/167/head
liushengming 4 months ago
committed by wangxiaodong
parent
commit
2225170813
  1. 16
      doc/ChangeLog.md
  2. 20
      example/peripherals/gicv3/amp_config.json
  3. 12
      example/peripherals/gicv3/master/main.c
  4. 4
      example/peripherals/gicv3/master/src/ppi_example.c
  5. 4
      example/peripherals/gicv3/master/src/sgi_example.c
  6. 4
      example/peripherals/gicv3/master/src/spi_example.c
  7. 39
      example/peripherals/serial/README.md
  8. BIN
      example/peripherals/serial/fig/ddma_example_result_1.png
  9. BIN
      example/peripherals/serial/fig/ddma_flow_example_result_1.png
  10. BIN
      example/peripherals/serial/fig/flow_example_result_1.png
  11. BIN
      example/peripherals/serial/fig/intr_example_result.png
  12. BIN
      example/peripherals/serial/fig/mio_example_result_1.png
  13. BIN
      example/peripherals/serial/fig/poll_example_result.png
  14. 2
      example/peripherals/serial/inc/serial_flow_example.h
  15. 1
      example/peripherals/serial/inc/serial_intr_example.h
  16. 2
      example/peripherals/serial/inc/serial_mio_example.h
  17. 2
      example/peripherals/serial/inc/serial_poll_example.h
  18. 3
      example/peripherals/serial/makefile
  19. 5
      example/peripherals/serial/src/serial_ddma_example.c
  20. 5
      example/peripherals/serial/src/serial_ddma_flow_example.c
  21. 7
      example/peripherals/serial/src/serial_ddma_mio_example.c
  22. 11
      example/peripherals/serial/src/serial_flow_example.c
  23. 4
      example/peripherals/serial/src/serial_intr_example.c
  24. 6
      example/peripherals/serial/src/serial_mio_example.c
  25. 9
      example/peripherals/serial/src/serial_poll_example.c
  26. 3
      example/system/amp/amp_tools_example/amp/main.c
  27. 1
      example/system/amp/amp_tools_example/amp2/main.c
  28. 20
      example/system/amp/libmetal_test/amp_config.json
  29. 5
      example/system/amp/libmetal_test/apu_running/main.c
  30. 36
      example/system/amp/libmetal_test/apu_running/src/cmd_apu_running.c
  31. 2
      example/system/amp/openamp/driver_core/main.c
  32. 25
      example/system/amp/openamp/driver_core/rpmsg-demo-manager_cmd.c
  33. 1
      example/system/amp/openamp/driver_core/rpmsg-echo.c
  34. 4
      example/system/amp/openamp_echo_remoteproc_load/master/amp_config.json
  35. 2
      example/system/amp/openamp_echo_remoteproc_load/master/main.c
  36. 52
      example/system/amp/openamp_echo_remoteproc_load/master/src/timer_loop.c
  37. 24
      example/system/arch/armv8/psci/amp_config.json
  38. 6
      example/system/arch/armv8/psci/psci_test/inc/psci_test.h
  39. 16
      example/system/arch/armv8/psci/psci_test/main.c
  40. 3
      example/system/arch/armv8/psci/psci_test/psci_slave/main.c
  41. 5
      example/system/arch/armv8/psci/psci_test/src/psci_test.c
  42. 12
      third-party/openamp/ports/helper.h
  43. 2
      tools/build/boot_code/sdkconfig
  44. 2
      tools/build/boot_code/sdkconfig.h

16
doc/ChangeLog.md

@ -1,3 +1,19 @@
# Phytium Standalone SDK 2024-07-09 ChangeLog
Change Log since 2024-07-08
## example
- fix bug: uart example timeout
# Phytium Standalone SDK 2024-07-08 ChangeLog
Change Log since 2024-07-05
## example
- modify the amp example to support auto-test mode
# Phytium Standalone SDK 2024-07-05 ChangeLog
Change Log since 2024-07-03

20
example/peripherals/gicv3/amp_config.json

@ -79,8 +79,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./master",0,0,"d2000_aarch64_test_gic_master.config"],
"path2":["./slave",1,0,"d2000_aarch64_test_gic_slave.config"]
"path0":["./master",0,0,"d2000_aarch64_test_gic_master.config"],
"path1":["./slave",1,0,"d2000_aarch64_test_gic_slave.config"]
}
],
"config7":[
@ -88,8 +88,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./master",0,0,"d2000_aarch32_test_gic_master.config"],
"path2":["./slave",1,0,"d2000_aarch32_test_gic_slave.config"]
"path0":["./master",0,0,"d2000_aarch32_test_gic_master.config"],
"path1":["./slave",1,0,"d2000_aarch32_test_gic_slave.config"]
}
],
"config8":[
@ -97,8 +97,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./master",0,0,"ft2004_aarch64_dsk_gic_master.config"],
"path2":["./slave",1,0,"ft2004_aarch64_dsk_gic_slave.config"]
"path0":["./master",0,0,"ft2004_aarch64_dsk_gic_master.config"],
"path1":["./slave",1,0,"ft2004_aarch64_dsk_gic_slave.config"]
}
],
"config9":[
@ -106,8 +106,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./master",0,0,"ft2004_aarch32_dsk_gic_master.config"],
"path2":["./slave",1,0,"ft2004_aarch32_dsk_gic_slave.config"]
"path0":["./master",0,0,"ft2004_aarch32_dsk_gic_master.config"],
"path1":["./slave",1,0,"ft2004_aarch32_dsk_gic_slave.config"]
}
],
"config10":[
@ -115,8 +115,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./master",0,0,"pd2308_aarch64_demo_gic_master.config"],
"path2":["./slave",1,0,"pd2308_aarch64_demo_gic_slave.config"]
"path0":["./master",0,0,"pd2308_aarch64_demo_gic_master.config"],
"path1":["./slave",1,0,"pd2308_aarch64_demo_gic_slave.config"]
}
]
}

12
example/peripherals/gicv3/master/main.c

@ -41,15 +41,7 @@
#include "ppi_example.h"
#include "sgi_example.h"
#include "spi_example.h"
/************************** Constant Definitions *****************************/
/**************************** Type Definitions *******************************/
/************************** Variable Definitions *****************************/
/***************** Macros (Inline Functions) Definitions *********************/
/************************** Function Prototypes ******************************/
#include "fsleep.h"
/************************** Function *****************************************/
@ -62,8 +54,10 @@ int main()
FGicV3TestInit() ;
/* if shell command is not enabled, run example one by one */
FPpiExample();
fsleep_millisec(50);
#ifdef SLAVE_CORE_ID
FSgiExample();
fsleep_millisec(50);
FSpiExample();
#endif
#endif

4
example/peripherals/gicv3/master/src/ppi_example.c

@ -131,11 +131,11 @@ int FPpiExample(void)
/* print message on example run result */
if (FGIC_EXAMPLE_OK == err)
{
printf("%s@%d: ppi example success !!! \r\n", __func__, __LINE__);
printf("%s@%d: ppi example [success] !!! \r\n", __func__, __LINE__);
}
else
{
printf("%s@%d: ppi example failed !!!, err = %d \r\n", __func__, __LINE__, err);
printf("%s@%d: ppi example [failure] !!!, err = %d \r\n", __func__, __LINE__, err);
}
return FGIC_EXAMPLE_OK;

4
example/peripherals/gicv3/master/src/sgi_example.c

@ -248,11 +248,11 @@ exit:
/* print message on example run result */
if (err == FGIC_EXAMPLE_OK )
{
printf("%s@%d: sgi example success !!! \r\n", __func__, __LINE__);
printf("%s@%d: sgi example [success] !!! \r\n", __func__, __LINE__);
}
else
{
printf("%s@%d: sgi example failed !!!, err = %d \r\n", __func__, __LINE__, err);
printf("%s@%d: sgi example [failure] !!!, err = %d \r\n", __func__, __LINE__, err);
}
return 0;

4
example/peripherals/gicv3/master/src/spi_example.c

@ -318,11 +318,11 @@ exit:
/* print message on example run result */
if (0 == err)
{
printf("%s@%d: spi example success !!! \r\n", __func__, __LINE__);
printf("%s@%d: spi example [success] !!! \r\n", __func__, __LINE__);
}
else
{
printf("%s@%d: spi example failed !!!, ret = %d \r\n", __func__, __LINE__, err);
printf("%s@%d: spi example [failure] !!!, ret = %d \r\n", __func__, __LINE__, err);
}
return 0;

39
example/peripherals/serial/README.md

@ -158,9 +158,12 @@ uart poll_example
uart mio_example
```
SHELL界面显示
- SHELL界面显示
![mio_example_result_1](./fig/mio_example_result_1.png)
XCOM界面显示
- XCOM界面显示
![mio_example_result_2](./fig/mio_example_result_2.png)
#### 2.4.4 SERIAL流控测试例程 (serial_flow_example.c)
@ -172,9 +175,12 @@ XCOM界面显示
uart flow_example
```
SHELL界面显示
- SHELL界面显示
![flow_example_result_1](./fig/flow_example_result_1.png)
XCOM界面显示
- XCOM界面显示
![flow_example_result_2](./fig/flow_example_result_2.png)
#### 2.4.5 DDMA传输测试例程 (serial_ddma_example.c)
@ -186,9 +192,12 @@ XCOM界面显示
uart ddma_example
```
SHELL界面显示
- SHELL界面显示
![ddma_example_result_1](./fig/ddma_example_result_1.png)
XCOM界面显示
- XCOM界面显示
![ddma_example_result_2](./fig/ddma_example_result_2.png)
#### 2.4.6 DDMA传输流控测试例程 (serial_ddma_flow_example.c)
@ -200,23 +209,29 @@ XCOM界面显示
uart ddma_flow_example
```
SHELL界面显示
- SHELL界面显示
![ddma_flow_example_result_1](./fig/ddma_flow_example_result_1.png)
XCOM界面显示
- XCOM界面显示
![ddma_flow_example_result_2](./fig/ddma_flow_example_result_2.png)
#### 2.4.7 DDMA与MIO复用配合传输测试例程 (serial_ddma_mio_example.c)
> 默认使用线串口进行测试
> 默认使用线串口进行测试
需要配合使用XCOM软件,查看串口接收,点击发送
需要配合使用XCOM软件,需要特定固件支持,查看串口接收,点击发送
```
uart ddma_mio_example
```
SHELL界面显示
- SHELL界面显示
![ddma_mio_example_result_1](./fig/ddma_mio_example_result_1.png)
XCOM界面显示
- XCOM界面显示
![ddma_mio_example_result_2](./fig/ddma_mio_example_result_2.png)
## 3. 如何解决问题

BIN
example/peripherals/serial/fig/ddma_example_result_1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 368 KiB

BIN
example/peripherals/serial/fig/ddma_flow_example_result_1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 382 KiB

BIN
example/peripherals/serial/fig/flow_example_result_1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 80 KiB

BIN
example/peripherals/serial/fig/intr_example_result.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 67 KiB

BIN
example/peripherals/serial/fig/mio_example_result_1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 82 KiB

BIN
example/peripherals/serial/fig/poll_example_result.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 60 KiB

2
example/peripherals/serial/inc/serial_flow_example.h

@ -34,7 +34,7 @@
#include "finterrupt.h"
#include "fparameters.h"
#include "fsleep.h"
#include "fpl011.h"
#ifdef __cplusplus

1
example/peripherals/serial/inc/serial_intr_example.h

@ -31,6 +31,7 @@
#include "fcpu_info.h"
#include "finterrupt.h"
#include "ftypes.h"
#include "fsleep.h"
#if defined(CONFIG_TARGET_E2000)
#endif
#include "fparameters.h"

2
example/peripherals/serial/inc/serial_mio_example.h

@ -34,7 +34,7 @@
#include "finterrupt.h"
#include "ftypes.h"
#include "fparameters.h"
#include "fsleep.h"
#include "fpl011.h"
#include "fmio.h"
#include "fmio_hw.h"

2
example/peripherals/serial/inc/serial_poll_example.h

@ -27,7 +27,7 @@
/***************************** Include Files *********************************/
#include <stdio.h>
#include <string.h>
#include "fsleep.h"
#include "ftypes.h"
#if defined(CONFIG_TARGET_E2000)
#endif

3
example/peripherals/serial/makefile

@ -42,6 +42,3 @@ image:
make clean
make all -j
cp ./$(IMAGE_OUT_NAME).elf $(USR_BOOT_DIR)/baremetal.elf

5
example/peripherals/serial/src/serial_ddma_example.c

@ -39,6 +39,7 @@
/***************** Macros (Inline Functions) Definitions *********************/
/* user-defined parameters */
#define FDDMA_TX_RX_BUF_LEN 1024 /* change timeout when face large data */
#define TIMEOUT_MS 10000
#define UART_CONTROLLER_ID FUART2_ID
#define DDMA_CONTROLLER_ID FDDMA0_ID
#define TX_CHAN_ID 0
@ -128,7 +129,7 @@ static void FU32buff2U8buff(u8 *buff1, u32 *buff2, u32 size)
static FError FSerialDdmaTest()
{
FError ret = FT_SUCCESS;
int timeout = 1000;
u32 timeout = TIMEOUT_MS; /*传输超时时间,由传输的波特率与传输数据量决定,但是此例程需要主动输入数据,与fsleep_millisec构成等待10000ms超时时间*/
if (FDdmaIsChanRunning(ddma_instance.config.base_addr, TX_CHAN_ID) ||
FDdmaIsChanRunning(ddma_instance.config.base_addr, RX_CHAN_ID))
@ -159,7 +160,7 @@ static FError FSerialDdmaTest()
FSERIAL_ERROR("TX timeout!");
return FDDMA_ERR_WAIT_TIMEOUT;
}
printf("Wait for data comming in, put at least %d bytes data to trigger DDMA RX end intr... \r\n", trans_size);
printf("Wait %d ms for data comming in, put at least %d bytes data to trigger DDMA RX end intr... \r\n", timeout, trans_size);
while (FALSE == rx_dma_done)
{
if (--timeout == 0)

5
example/peripherals/serial/src/serial_ddma_flow_example.c

@ -40,6 +40,7 @@
/***************** Macros (Inline Functions) Definitions *********************/
/* user-defined parameters */
#define FDDMA_TX_RX_BUF_LEN 1024 /* change timeout when face large data */
#define TIMEOUT_MS 10000
#define UART_CONTROLLER_ID FUART2_ID
#define DDMA_CONTROLLER_ID FDDMA0_ID
#define TX_CHAN_ID 0
@ -129,7 +130,7 @@ static void FU32buff2U8buff(u8 *buff1, u32 *buff2, u32 size)
static FError FSerialDdmaFlowTest()
{
FError ret = FT_SUCCESS;
int timeout = 1000;
u32 timeout = TIMEOUT_MS; /*传输超时时间,由传输的波特率与传输数据量决定,但是此例程需要主动输入数据,与fsleep_millisec构成等待10000ms超时时间*/
if (FDdmaIsChanRunning(ddma_instance.config.base_addr, TX_CHAN_ID) ||
FDdmaIsChanRunning(ddma_instance.config.base_addr, RX_CHAN_ID))
@ -160,7 +161,7 @@ static FError FSerialDdmaFlowTest()
printf("TX timeout! \r\n");
return FDDMA_ERR_WAIT_TIMEOUT;
}
printf("Wait for data comming in, put at least %d bytes data to trigger DDMA RX end intr... \r\n", trans_size);
printf("Wait %d ms for data comming in, put at least %d bytes data to trigger DDMA RX end intr... \r\n", timeout, trans_size);
while (FALSE == rx_dma_done)
{
if (--timeout == 0)

7
example/peripherals/serial/src/serial_ddma_mio_example.c

@ -40,6 +40,7 @@
/***************** Macros (Inline Functions) Definitions *********************/
/* user-defined parameters */
#define FDDMA_TX_RX_BUF_LEN 1024 /* change timeout when face large data */
#define TIMEOUT_MS 10000
#define UART_CONTROLLER_ID FUART2_ID
#define DDMA_CONTROLLER_ID FDDMA1_ID
#define TX_CHAN_ID 0
@ -135,7 +136,7 @@ static void FU32buff2U8buff(u8 *buff1, u32 *buff2, u32 size)
static FError FSerialDdmaMioTest()
{
FError ret = FT_SUCCESS;
int timeout = 1000;
u32 timeout = TIMEOUT_MS; /*传输超时时间,由传输的波特率与传输数据量决定,但是此例程需要主动输入数据,与fsleep_millisec构成等待10000ms超时时间*/
if (FDdmaIsChanRunning(ddma_instance.config.base_addr, TX_CHAN_ID) ||
FDdmaIsChanRunning(ddma_instance.config.base_addr, RX_CHAN_ID))
@ -162,12 +163,12 @@ static FError FSerialDdmaMioTest()
fsleep_millisec(1);
}
if(timeout == 0)
if(timeout == 0)
{
printf("TX timeout! \r\n");
return FDDMA_ERR_WAIT_TIMEOUT;
}
printf("Wait for data comming in, put at least %d bytes data to trigger DDMA RX end intr... \r\n", trans_size);
printf("Wait %d ms for data comming in, put at least %d bytes data to trigger DDMA RX end intr... \r\n", timeout, trans_size);
while (FALSE == rx_dma_done)
{
if (--timeout == 0)

11
example/peripherals/serial/src/serial_flow_example.c

@ -38,6 +38,7 @@
/***************** Macros (Inline Functions) Definitions *********************/
/* user-defined parameters */
#define TEST_BUFFER_SIZE 10
#define TIMEOUT_MS 10000 /*传输超时时间,由传输的波特率与传输数据量决定,但是此例程需要主动输入数据,与fsleep_millisec构成等待10000ms超时时间*/
#define UART_CONTROLLER_ID FUART2_ID
/* FT-defined print form */
@ -127,7 +128,7 @@ static void IntrTestHandler(void *args, u32 event, u32 event_data)
static FError FSerialFlowTest()
{
int i;
int timeout = 1000;
u32 timeout = TIMEOUT_MS; /*传输超时时间,由传输的波特率与传输数据量决定,但是此例程需要主动输入数据,与fsleep_millisec构成等待10000ms超时时间*/
total_send_count = 0;
total_received_count = 0;
total_error_count = 0;
@ -148,7 +149,8 @@ static FError FSerialFlowTest()
if (--timeout == 0)
{
break;
}
}
fsleep_millisec(1);
}
if(timeout == 0)
{
@ -157,7 +159,7 @@ static FError FSerialFlowTest()
}
printf("UART send A~%c characters. \r\n", 'A' + TEST_BUFFER_SIZE - 1);
printf("Flow control RX start, please wait > 10 byte data coming in... \r\n");
printf("Flow control RX start, wait %d ms for data comming in,please put > 10 byte data coming in... \r\n",timeout);
while (total_received_count < TEST_BUFFER_SIZE)
{
total_received_count += FPl011Receive(&uart_instance,
@ -166,7 +168,8 @@ static FError FSerialFlowTest()
if (--timeout == 0)
{
break;
}
}
fsleep_millisec(1);
}
if(timeout == 0)
{

4
example/peripherals/serial/src/serial_intr_example.c

@ -52,6 +52,7 @@ FPl011Format format_default_intr =
/***************** Macros (Inline Functions) Definitions *********************/
#define INTR_TEST_BUFFER_SIZE 10000
#define TIMEOUT_MS 1000
/************************** Constant Definitions *****************************/
static u8 send_buffer_i[INTR_TEST_BUFFER_SIZE]; /*intr Buffer for Transmitting Data */
static u8 recv_buffer_i[INTR_TEST_BUFFER_SIZE]; /*intr Buffer for Receiving Data */
@ -121,7 +122,7 @@ static FError FSerialIntr(FPl011 *uart_ptr)
int i;
int bad_byte_count = 0;
total_received_count = 0;
int timeout = 1000;
u32 timeout = TIMEOUT_MS; /*由传输的波特率与传输数据量决定,与fsleep_millisec构成等待1000ms超时时间*/
u32 cpu_id;
GetCpuId(&cpu_id);
InterruptSetTargetCpus(uart_ptr->config.irq_num, cpu_id);
@ -161,6 +162,7 @@ static FError FSerialIntr(FPl011 *uart_ptr)
{
break;
}
fsleep_millisec(1);
}
if(timeout == 0)
{

6
example/peripherals/serial/src/serial_mio_example.c

@ -41,6 +41,7 @@
/***************** Macros (Inline Functions) Definitions *********************/
/* user-defined parameters */
#define TEST_BUFFER_SIZE 10
#define TIMEOUT_MS 10000
#define UART_CONTROLLER_ID FUART1_ID /* as a reference for MIO config */
#ifdef CONFIG_TARGET_PHYTIUMPI
@ -140,7 +141,7 @@ static FError FSerialMioTest()
int i;
u32 intr_mask;
u32 cpu_id;
u32 timeout = 10000000;
u32 timeout = TIMEOUT_MS; /*传输超时时间,由传输的波特率与传输数据量决定,但是此例程需要主动输入数据,与fsleep_millisec构成等待10000ms超时时间*/
total_received_count = 0;
total_error_count = 0;
@ -170,7 +171,7 @@ static FError FSerialMioTest()
recv_buffer[i] = 0;
}
printf("UART send A~%c characters. \r\n", 'A' + TEST_BUFFER_SIZE - 1);
printf("UART recv begin, you can put %d characters from uart to test. \r\n", TEST_BUFFER_SIZE);
printf("UART recv begin,wait %d ms for data comming in, you can put %d characters from uart to test. \r\n", timeout, TEST_BUFFER_SIZE);
FPl011Receive(&uart_instance, recv_buffer, TEST_BUFFER_SIZE);
total_send_count = FPl011Send(&uart_instance, send_buffer, TEST_BUFFER_SIZE);
@ -181,6 +182,7 @@ static FError FSerialMioTest()
{
break;
};
fsleep_millisec(1);
}
if(timeout == 0)
{

9
example/peripherals/serial/src/serial_poll_example.c

@ -50,6 +50,7 @@ FPl011Format format_default_poll =
/***************** Macros (Inline Functions) Definitions *********************/
#define POLL_TEST_BUFFER_SIZE 26
#define TIMEOUT_MS 1000
/************************** Constant Definitions *****************************/
static u8 send_buffer_p[POLL_TEST_BUFFER_SIZE]; /*poll Buffer for Transmitting Data */
static u8 recv_buffer_p[POLL_TEST_BUFFER_SIZE]; /*poll Buffer for Receiving Data */
@ -60,7 +61,7 @@ static FError FSerialPolled(FPl011 *uart_ptr)
{
int i = 0;
u32 poll_total_send_count, recv_count, poll_bad_byte_count = 0;
int timeout = 1000;
u32 timeout = TIMEOUT_MS; /*由传输的波特率与传输数据量决定,与fsleep_millisec构成等待1000ms超时时间*/
FError ret = FT_SUCCESS;
/* Use local loopback mode. */
FPl011SetOperMode(uart_ptr, FPL011_OPER_MODE_LOCAL_LOOP);
@ -76,7 +77,8 @@ static FError FSerialPolled(FPl011 *uart_ptr)
if (--timeout == 0)
{
break;
}
}
fsleep_millisec(1);
}
if(timeout == 0)
{
@ -96,7 +98,8 @@ static FError FSerialPolled(FPl011 *uart_ptr)
if (--timeout == 0)
{
break;
}
}
fsleep_millisec(1);
}
if(timeout == 0)
{

3
example/system/amp/amp_tools_example/amp/main.c

@ -80,6 +80,7 @@ int main()
cnt ++ ;
}
printf("core[%d] test is over **********\n",cpu_id);
fsleep_millisec(1000) ;/* 等待1000ms,确保其他核心打印完毕 */
printf("%s@%d: amp_tools_example example [success] !!! \r\n", __func__, __LINE__);
return 0;
}

1
example/system/amp/amp_tools_example/amp2/main.c

@ -79,6 +79,5 @@ int main()
cnt ++ ;
}
printf("core[%d] test is over **********\n",cpu_id);
return 0;
}

20
example/system/amp/libmetal_test/amp_config.json

@ -79,8 +79,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./apu_running",0,0,"d2000_aarch64_test_apu.config"],
"path2":["./rpu_running",1,0,"d2000_aarch64_test_rpu.config"]
"path0":["./apu_running",0,0,"d2000_aarch64_test_apu.config"],
"path1":["./rpu_running",1,0,"d2000_aarch64_test_rpu.config"]
}
],
"config7":[
@ -88,8 +88,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./apu_running",0,0,"d2000_aarch32_test_apu.config"],
"path2":["./rpu_running",1,0,"d2000_aarch32_test_rpu.config"]
"path0":["./apu_running",0,0,"d2000_aarch32_test_apu.config"],
"path1":["./rpu_running",1,0,"d2000_aarch32_test_rpu.config"]
}
],
"config8":[
@ -97,8 +97,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./apu_running",0,0,"ft2004_aarch64_dsk_apu.config"],
"path2":["./rpu_running",1,0,"ft2004_aarch64_dsk_rpu.config"]
"path0":["./apu_running",0,0,"ft2004_aarch64_dsk_apu.config"],
"path1":["./rpu_running",1,0,"ft2004_aarch64_dsk_rpu.config"]
}
],
"config9":[
@ -106,8 +106,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./apu_running",0,0,"ft2004_aarch32_dsk_apu.config"],
"path2":["./rpu_running",1,0,"ft2004_aarch32_dsk_rpu.config"]
"path0":["./apu_running",0,0,"ft2004_aarch32_dsk_apu.config"],
"path1":["./rpu_running",1,0,"ft2004_aarch32_dsk_rpu.config"]
}
],
"config10":[
@ -115,8 +115,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./apu_running",0,0,"pd2308_aarch64_demo_apu.config"],
"path2":["./rpu_running",1,0,"pd2308_aarch64_demo_rpu.config"]
"path0":["./apu_running",0,0,"pd2308_aarch64_demo_apu.config"],
"path1":["./rpu_running",1,0,"pd2308_aarch64_demo_rpu.config"]
}
]
}

5
example/system/amp/libmetal_test/apu_running/main.c

@ -25,10 +25,11 @@
#include <stdio.h>
#include "sdkconfig.h"
#include "ftypes.h"
#include "shell_port.h"
#include "fsleep.h"
#include "fdebug.h"
#ifdef CONFIG_USE_LETTER_SHELL
#include "shell_port.h"
#endif
extern int FLibmetalExample(void);

36
example/system/amp/libmetal_test/apu_running/src/cmd_apu_running.c

@ -25,7 +25,6 @@
#include "strto.h"
#include "ftypes.h"
#include "fpsci.h"
#include "shell.h"
#include "fdebug.h"
#include "fsleep.h"
#include "fprintk.h"
@ -33,6 +32,14 @@
#include "../common/sys_init.h"
#include "../inc/apu_running.h"
#ifndef SDK_CONFIG_H__
#warning "Please include sdkconfig.h"
#endif
#ifdef CONFIG_USE_LETTER_SHELL
#include "shell.h"
#endif
#define LIBMETAL_MAIN_DEBUG_TAG "LIBMETAL_MAIN"
#define LIBMETAL_MAIN_DEBUG_I(format, ...) FT_DEBUG_PRINT_I(LIBMETAL_MAIN_DEBUG_TAG, format, ##__VA_ARGS__)
#define LIBMETAL_MAIN_DEBUG_W(format, ...) FT_DEBUG_PRINT_W(LIBMETAL_MAIN_DEBUG_TAG, format, ##__VA_ARGS__)
@ -41,13 +48,6 @@
static int flag = 0;
static u32 core_mask = 0x0;
static void FLibmetalCmdUsage(void)
{
printf("Usage:\r\n");
printf(" libmetalapu \r\n");
printf(" -- Running libmetal test.\r\n");
}
int FLibmetalExample(void)
{
int ret ;
@ -153,9 +153,27 @@ int FLibmetalExample(void)
}
out:
FLibmetalSysCleanup();
fsleep_millisec(500);
if (ret != 0)
{
printf("%s@%d: libmetal example [failure] !!! \r\n", __func__, __LINE__);
}
else
{
printf("%s@%d: libmetal example [success] !!! \r\n", __func__, __LINE__);
}
return ret;
}
#ifdef CONFIG_USE_LETTER_SHELL
static void FLibmetalCmdUsage(void)
{
printf("Usage:\r\n");
printf(" libmetalapu \r\n");
printf(" -- Running libmetal test.\r\n");
}
static int FLibmetalApu(int argc, char *argv[])
{
int ret ;
@ -172,3 +190,5 @@ static int FLibmetalApu(int argc, char *argv[])
}
SHELL_EXPORT_CMD(SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), libmetalapu, FLibmetalApu,test libmetalapu);
#endif

2
example/system/amp/openamp/driver_core/main.c

@ -21,7 +21,9 @@
#include "fsleep.h"
#include "fdebug.h"
#include "sdkconfig.h"
#ifdef CONFIG_USE_LETTER_SHELL
#include "shell_port.h"
#endif
/************************** Function Prototypes ******************************/
extern int FOpenampExample(void);

25
example/system/amp/openamp/driver_core/rpmsg-demo-manager_cmd.c

@ -28,7 +28,6 @@
#include <metal/alloc.h>
#include <string.h>
#include "strto.h"
#include "shell.h"
#include "fparameters.h"
#include "platform_info.h"
#include "rpmsg_service.h"
@ -37,9 +36,20 @@
#include "helper.h"
#include "fdebug.h"
#include "felf.h"
#include "fsleep.h"
#include "sdkconfig.h"
#include "libmetal_configs.h"
#include "openamp_configs.h"
#ifndef SDK_CONFIG_H__
#warning "Please include sdkconfig.h"
#endif
#ifdef CONFIG_USE_LETTER_SHELL
#include "shell.h"
#endif
/************************** Constant Definitions *****************************/
/***************** Macros (Inline Functions) Definitions *********************/
@ -381,9 +391,20 @@ int FOpenampExample(void)
}
}
}
fsleep_millisec(100);
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;
}
#ifdef CONFIG_USE_LETTER_SHELL
static int FOpenampTest(int argc,char *argv[])
{
int ret = 0;
@ -405,3 +426,5 @@ static int FOpenampTest(int argc,char *argv[])
}
SHELL_EXPORT_CMD(SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), openamp, FOpenampTest, openamptest);
#endif

1
example/system/amp/openamp/driver_core/rpmsg-echo.c

@ -33,7 +33,6 @@
#include "rpmsg_service.h"
#include <metal/sleep.h>
#include "rsc_table.h"
#include "shell.h"
#include "fcache.h"
#include "fdebug.h"

4
example/system/amp/openamp_echo_remoteproc_load/master/amp_config.json

@ -71,7 +71,7 @@
},
{
"path0":["../slave_00",10000,0,"e2000d_aarch64_demo_openamp_device_core.config"],
"path2":["./",1,1,"e2000d_aarch64_demo_openamp_driver_core.config"]
"path1":["./",1,1,"e2000d_aarch64_demo_openamp_driver_core.config"]
}
],
"config5":
@ -81,7 +81,7 @@
},
{
"path0":["../slave_00",10000,0,"e2000d_aarch32_demo_openamp_device_core.config"],
"path2":["./",1,1,"e2000d_aarch32_demo_openamp_driver_core.config"]
"path1":["./",1,1,"e2000d_aarch32_demo_openamp_driver_core.config"]
}
],
"config6":

2
example/system/amp/openamp_echo_remoteproc_load/master/main.c

@ -13,7 +13,7 @@
*
* FilePath: main.c
* Created Date: 2024-04-29 10:08:18
* Last Modified: 2024-06-20 10:19:18
* Last Modified: 2024-07-01 17:27:26
* Description: This file is for
*
* Modify History:

52
example/system/amp/openamp_echo_remoteproc_load/master/src/timer_loop.c

@ -13,7 +13,7 @@
*
* FilePath: timer_loop.c
* Created Date: 2023-09-20 11:29:05
* Last Modified: 2024-05-29 11:22:06
* Last Modified: 2024-07-02 14:23:12
* Description: This file is for amp loop timer function implementation.
*
* Modify History:
@ -31,6 +31,8 @@
#include "finterrupt.h"
#include "fassert.h"
#include "master_example.h"
#include "openamp_configs.h"
#include "fsleep.h"
#ifdef CONFIG_USE_LETTER_SHELL
#include "shell_port.h"
@ -115,29 +117,51 @@ void TimerLoop(void)
}
}
#else
void TimerLoop(void)
{
u32 _5ms_appear = 0;
u32 base_cnt_back = 0;
TimerLoopInit();
if(!master_00_init())
{
master_00_ept_create();
}
else
{
printf("%s@%d: openamp_echo_remoteproc_load example [failure] !!! \r\n", __func__, __LINE__);
}
while (1)
{
master_00_rpmsg_echo_process() ;
master_01_rpmsg_echo_process() ;
if (((timer_base_cnt % 5) == 0) && (_5ms_appear == 0)) /*5ms task */
{
_5ms_appear = 1;
}
else if ((timer_base_cnt % 5) != 0)
master_00_rpmsg_echo_process() ; /*轮询rpmsg消息*/
if ((timer_base_cnt % 500) == 0) /*500ms 等待传输测试完成 */
{
_5ms_appear = 0;
timer_base_cnt = 0;
break;
}
if(timer_base_cnt != base_cnt_back)
}
master_00_destroy_remoteproc(RPMSG_SERVICE_00_NAME) ;
#ifndef CONFIG_TARGET_E2000D
fsleep_millisec(100); /*等待shutdown打印完成*/
if(!master_01_init())
{
master_01_ept_create();
}
else
{
printf("%s@%d: openamp_echo_remoteproc_load example [failure] !!! \r\n", __func__, __LINE__);
}
while (1)
{
master_01_rpmsg_echo_process() ; /*轮询rpmsg消息*/
if ((timer_base_cnt % 500) == 0) /*500ms 等待传输测试完成 */
{
base_cnt_back = timer_base_cnt;
timer_base_cnt = 0;
break;
}
}
master_01_destroy_remoteproc(RPMSG_SERVICE_01_NAME) ;
#endif
fsleep_millisec(100);
printf("%s@%d: openamp_echo_remoteproc_load example [success] !!! \r\n", __func__, __LINE__);
}
#endif

24
example/system/arch/armv8/psci/amp_config.json

@ -25,8 +25,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./psci_test",0,0,"e2000q_aarch64_demo_psci.config"],
"path2":["./psci_test/psci_slave",1,0,"e2000q_aarch64_demo_psci_slave.config"]
"path0":["./psci_test",0,0,"e2000q_aarch64_demo_psci.config"],
"path1":["./psci_test/psci_slave",1,0,"e2000q_aarch64_demo_psci_slave.config"]
}
],
"config1":[
@ -34,8 +34,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./psci_test",0,0,"e2000q_aarch32_demo_psci.config"],
"path2":["./psci_test/psci_slave",1,0,"e2000q_aarch32_demo_psci_slave.config"]
"path0":["./psci_test",0,0,"e2000q_aarch32_demo_psci.config"],
"path1":["./psci_test/psci_slave",1,0,"e2000q_aarch32_demo_psci_slave.config"]
}
],
"config2":[
@ -61,8 +61,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./psci_test",0,0,"phytiumpi_aarch64_firefly_psci.config"],
"path2":["./psci_test/psci_slave",1,0,"phytiumpi_aarch64_firefly_psci_slave.config"]
"path0":["./psci_test",0,0,"phytiumpi_aarch64_firefly_psci.config"],
"path1":["./psci_test/psci_slave",1,0,"phytiumpi_aarch64_firefly_psci_slave.config"]
}
],
"config5":[
@ -70,8 +70,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./psci_test",0,0,"phytiumpi_aarch32_firefly_psci.config"],
"path2":["./psci_test/psci_slave",1,0,"phytiumpi_aarch32_firefly_psci_slave.config"]
"path0":["./psci_test",0,0,"phytiumpi_aarch32_firefly_psci.config"],
"path1":["./psci_test/psci_slave",1,0,"phytiumpi_aarch32_firefly_psci_slave.config"]
}
],
"config6":[
@ -79,8 +79,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./psci_test",0,0,"d2000_aarch64_test_psci.config"],
"path2":["./psci_test/psci_slave",1,0,"d2000_aarch64_test_psci_slave.config"]
"path0":["./psci_test",0,0,"d2000_aarch64_test_psci.config"],
"path1":["./psci_test/psci_slave",1,0,"d2000_aarch64_test_psci_slave.config"]
}
],
"config7":[
@ -88,8 +88,8 @@
"bootstrap":"0xb0120000"
},
{
"path1":["./psci_test",0,0,"d2000_aarch32_test_psci.config"],
"path2":["./psci_test/psci_slave",1,0,"d2000_aarch32_test_psci_slave.config"]
"path0":["./psci_test",0,0,"d2000_aarch32_test_psci.config"],
"path1":["./psci_test/psci_slave",1,0,"d2000_aarch32_test_psci_slave.config"]
}
]
}

6
example/system/arch/armv8/psci/psci_test/inc/psci_test.h

@ -13,7 +13,7 @@
*
* FilePath: psci_test.h
* Created Date: 2023-06-16 15:42:14
* Last Modified: 2023-07-05 20:04:40
* Last Modified: 2024-06-28 17:14:23
* Description: This file is for example header.
*
* Modify History:
@ -29,8 +29,8 @@ extern "C"
{
#endif
void FPsciFeatureTest(void) ;
void FPsciHotplugTest(void) ;
int FPsciFeatureTest(void) ;
int FPsciHotplugTest(void) ;
#ifdef __cplusplus
}

16
example/system/arch/armv8/psci/psci_test/main.c

@ -13,7 +13,7 @@
*
* FilePath: main.c
* Created Date: 2023-06-16 13:26:03
* Last Modified: 2024-04-09 19:23:34
* Last Modified: 2024-06-28 17:18:41
* Description: This file is for
*
* Modify History:
@ -36,13 +36,23 @@
int main(void)
{
int ret = 0 ;
fsleep_seconds(6) ;/*wait slave core shutdown*/
#if defined(CONFIG_USE_LETTER_SHELL)
LSUserShellLoop();
#else
FPsciFeatureTest() ;
fsleep_seconds(10) ;
FPsciHotplugTest() ;
fsleep_seconds(1) ;
ret = FPsciHotplugTest() ;
fsleep_millisec(10) ;/*等待从核启动打印完成*/
if (ret < 0)
{
printf("\n%s@%d: FPsciHotplugTest example [failure] !!!, err = %d \r\n", __func__, __LINE__, ret);
}
else
{
printf("\n%s@%d: FPsciHotplugTest example [success].\r\n", __func__, __LINE__);
}
#endif
}

3
example/system/arch/armv8/psci/psci_test/psci_slave/main.c

@ -13,7 +13,7 @@
*
* FilePath: main.c
* Created Date: 2023-06-16 13:26:03
* Last Modified: 2024-06-27 09:57:30
* Last Modified: 2024-07-05 10:09:50
* Description: This file is for
*
* Modify History:
@ -27,7 +27,6 @@
#include <stdio.h>
#include "sdkconfig.h"
#include "ftypes.h"
#include "shell_port.h"
#include "fpsci.h"
#include "fsleep.h"

5
example/system/arch/armv8/psci/psci_test/src/psci_test.c

@ -13,7 +13,7 @@
*
* FilePath: psci_test.c
* Created Date: 2023-06-25 09:27:28
* Last Modified: 2024-06-27 09:58:17
* Last Modified: 2024-06-28 17:20:24
* Description: This file is for
*
* Modify History:
@ -53,7 +53,6 @@ int FPsciFeatureTest(void)
int FPsciHotplugTest(void)
{
printf("core %d is hotunplugged , load address is 0x%x \r\n", CONFIG_IMAGE_CORE, CONFIG_IMAGE_LOAD_ADDRESS) ;
FPsciCpuMaskOn(1 << CONFIG_IMAGE_CORE, CONFIG_IMAGE_LOAD_ADDRESS) ;
printf("\n%s@%d: FPsciHotplugTest example [success].\r\n", __func__, __LINE__);
return FPsciCpuMaskOn(1 << CONFIG_IMAGE_CORE, CONFIG_IMAGE_LOAD_ADDRESS) ;
}

12
third-party/openamp/ports/helper.h

@ -13,7 +13,7 @@
*
* FilePath: helper.h
* Created Date: 2024-05-14 10:51:06
* Last Modified: 2024-05-14 10:57:33
* Last Modified: 2024-07-03 11:21:58
* Description: This file is for helper functions.
*
* Modify History:
@ -25,7 +25,17 @@
#ifndef HELPER_H_
#define HELPER_H_
#include "ftypes.h"
#if defined __cplusplus
extern "C" {
#endif
int init_system(void);
void cleanup_system(void);
#if defined __cplusplus
}
#endif
#endif /* */

2
tools/build/boot_code/sdkconfig

@ -206,7 +206,7 @@ CONFIG_USE_COMPILE_CHAIN=y
#
CONFIG_DEFAULT_LINKER_SCRIPT=y
# CONFIG_USER_DEFINED_LD is not set
CONFIG_IMAGE_LOAD_ADDRESS=0xb0120000
CONFIG_IMAGE_LOAD_ADDRESS=0x90120000
CONFIG_IMAGE_MAX_LENGTH=0x2000000
CONFIG_HEAP_SIZE=1
CONFIG_STACK_SIZE=0x400

2
tools/build/boot_code/sdkconfig.h

@ -185,7 +185,7 @@
#define CONFIG_DEFAULT_LINKER_SCRIPT
/* CONFIG_USER_DEFINED_LD is not set */
#define CONFIG_IMAGE_LOAD_ADDRESS 0xb0120000
#define CONFIG_IMAGE_LOAD_ADDRESS 0x90120000
#define CONFIG_IMAGE_MAX_LENGTH 0x2000000
#define CONFIG_HEAP_SIZE 1
#define CONFIG_STACK_SIZE 0x400

Loading…
Cancel
Save