Skip to content

Commit ec4524e

Browse files
committed
Fix the OpenAMP initialisation issue for devices other than STM32MP157Cxx
Replace Device reference by Feature
1 parent 2c20ce8 commit ec4524e

17 files changed

Lines changed: 101 additions & 40 deletions

File tree

Middlewares/Third_Party/OpenAMP/mw_if/app_if/openamp_conf_template.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@
7474
#endif /* VIRTUAL_I2C_MODULE_ENABLED */
7575

7676

77+
/* ########################## Linux Master Selection ############################## */
78+
/**
79+
* @brief Due to Linux compatibility, it's important to distinguish if the MASTER is Linux or not.
80+
* In that case, the LINUX_RPROC_MASTER define is required
81+
*/
82+
//#define LINUX_RPROC_MASTER
83+
7784

7885
/* USER CODE BEGIN INCLUDE */
7986

@@ -154,7 +161,7 @@ extern int __OPENAMP_region_end__[]; /* defined by linker script */
154161

155162
#endif
156163

157-
#if defined STM32MP157Cxx
164+
#if defined LINUX_RPROC_MASTER
158165
#define VRING_RX_ADDRESS -1 /* allocated by Master processor: CA7 */
159166
#define VRING_TX_ADDRESS -1 /* allocated by Master processor: CA7 */
160167
#define VRING_BUFF_ADDRESS -1 /* allocated by Master processor: CA7 */

Middlewares/Third_Party/OpenAMP/mw_if/platform_if/rsc_table_template.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#define __resource __section_t(.resource_table)
6262
#endif
6363

64-
#if defined (STM32MP157Cxx)
64+
#if defined (LINUX_RPROC_MASTER)
6565
#ifdef VIRTIO_MASTER_ONLY
6666
#define CONST
6767
#else
@@ -82,7 +82,7 @@ extern char system_log_buf[];
8282
#endif
8383

8484
#if defined(__GNUC__)
85-
#if !defined (__CC_ARM) && !defined (STM32MP157Cxx)
85+
#if !defined (__CC_ARM) && !defined (LINUX_RPROC_MASTER)
8686

8787
/* Since GCC is not initializing the resource_table at startup, it is declared as volatile to avoid compiler optimization
8888
* for the CM4 (see resource_table_init() below)
@@ -95,7 +95,7 @@ CONST struct shared_resource_table __resource __attribute__((used)) resource_tab
9595
__root CONST struct shared_resource_table resource_table @ ".resource_table" = {
9696
#endif
9797

98-
#if defined(__ICCARM__) || defined (__CC_ARM) || defined (STM32MP157Cxx)
98+
#if defined(__ICCARM__) || defined (__CC_ARM) || defined (LINUX_RPROC_MASTER)
9999
.version = 1,
100100
#if defined (__LOG_TRACE_IO_)
101101
.num = 2,
@@ -130,7 +130,7 @@ __root CONST struct shared_resource_table resource_table @ ".resource_table" = {
130130
void resource_table_init(int RPMsgRole, void **table_ptr, int *length)
131131
{
132132

133-
#if !defined (STM32MP157Cxx)
133+
#if !defined (LINUX_RPROC_MASTER)
134134
#if defined (__GNUC__) && ! defined (__CC_ARM)
135135
#ifdef VIRTIO_MASTER_ONLY
136136

Middlewares/Third_Party/OpenAMP/mw_if/st_readme.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
******************************************************************************
1919
@endverbatim
2020

21+
### V1.0.3/08-November-2019 ##
22+
===============================
23+
+ openamp_conf_template.h:
24+
- replace the "STM32MP157Cxx" define macro with "LINUX_RPROC_MASTER" to support all STM32MP1 varieties
25+
2126
### V1.0.2/29-July-2019 ###
2227
============================
2328

Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo/Inc/openamp_conf.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@
7474
#endif /* VIRTUAL_I2C_MODULE_ENABLED */
7575

7676

77+
/* ########################## Linux Master Selection ############################## */
78+
/**
79+
* @brief Due to Linux compatibility, it's important to distinguish if the MASTER is Linux or not.
80+
* In that case, the LINUX_RPROC_MASTER define is required
81+
*/
82+
#define LINUX_RPROC_MASTER
83+
7784

7885
/* USER CODE BEGIN INCLUDE */
7986

@@ -154,7 +161,7 @@ extern int __OPENAMP_region_end__[]; /* defined by linker script */
154161

155162
#endif
156163

157-
#if defined STM32MP157Cxx
164+
#if defined LINUX_RPROC_MASTER
158165
#define VRING_RX_ADDRESS -1 /* allocated by Master processor: CA7 */
159166
#define VRING_TX_ADDRESS -1 /* allocated by Master processor: CA7 */
160167
#define VRING_BUFF_ADDRESS -1 /* allocated by Master processor: CA7 */

Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo/Src/rsc_table.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#define __resource __section_t(.resource_table)
6262
#endif
6363

64-
#if defined (STM32MP157Cxx)
64+
#if defined (LINUX_RPROC_MASTER)
6565
#ifdef VIRTIO_MASTER_ONLY
6666
#define CONST
6767
#else
@@ -82,7 +82,7 @@ extern char system_log_buf[];
8282
#endif
8383

8484
#if defined(__GNUC__)
85-
#if !defined (__CC_ARM) && !defined (STM32MP157Cxx)
85+
#if !defined (__CC_ARM) && !defined (LINUX_RPROC_MASTER)
8686

8787
/* Since GCC is not initializing the resource_table at startup, it is declared as volatile to avoid compiler optimization
8888
* for the CM4 (see resource_table_init() below)
@@ -95,7 +95,7 @@ CONST struct shared_resource_table __resource __attribute__((used)) resource_tab
9595
__root CONST struct shared_resource_table resource_table @ ".resource_table" = {
9696
#endif
9797

98-
#if defined(__ICCARM__) || defined (__CC_ARM) || defined (STM32MP157Cxx)
98+
#if defined(__ICCARM__) || defined (__CC_ARM) || defined (LINUX_RPROC_MASTER)
9999
.version = 1,
100100
#if defined (__LOG_TRACE_IO_)
101101
.num = 2,
@@ -130,7 +130,7 @@ __root CONST struct shared_resource_table resource_table @ ".resource_table" = {
130130
void resource_table_init(int RPMsgRole, void **table_ptr, int *length)
131131
{
132132

133-
#if !defined (STM32MP157Cxx)
133+
#if !defined (LINUX_RPROC_MASTER)
134134
#if defined (__GNUC__) && ! defined (__CC_ARM)
135135
#ifdef VIRTIO_MASTER_ONLY
136136

Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo_wakeup/Inc/openamp_conf.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@
7474
#endif /* VIRTUAL_I2C_MODULE_ENABLED */
7575

7676

77+
/* ########################## Linux Master Selection ############################## */
78+
/**
79+
* @brief Due to Linux compatibility, it's important to distinguish if the MASTER is Linux or not.
80+
* In that case, the LINUX_RPROC_MASTER define is required
81+
*/
82+
#define LINUX_RPROC_MASTER
83+
7784

7885
/* USER CODE BEGIN INCLUDE */
7986

@@ -154,7 +161,7 @@ extern int __OPENAMP_region_end__[]; /* defined by linker script */
154161

155162
#endif
156163

157-
#if defined STM32MP157Cxx
164+
#if defined LINUX_RPROC_MASTER
158165
#define VRING_RX_ADDRESS -1 /* allocated by Master processor: CA7 */
159166
#define VRING_TX_ADDRESS -1 /* allocated by Master processor: CA7 */
160167
#define VRING_BUFF_ADDRESS -1 /* allocated by Master processor: CA7 */

Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_TTY_echo_wakeup/Src/rsc_table.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#define __resource __section_t(.resource_table)
6262
#endif
6363

64-
#if defined (STM32MP157Cxx)
64+
#if defined (LINUX_RPROC_MASTER)
6565
#ifdef VIRTIO_MASTER_ONLY
6666
#define CONST
6767
#else
@@ -82,7 +82,7 @@ extern char system_log_buf[];
8282
#endif
8383

8484
#if defined(__GNUC__)
85-
#if !defined (__CC_ARM) && !defined (STM32MP157Cxx)
85+
#if !defined (__CC_ARM) && !defined (LINUX_RPROC_MASTER)
8686

8787
/* Since GCC is not initializing the resource_table at startup, it is declared as volatile to avoid compiler optimization
8888
* for the CM4 (see resource_table_init() below)
@@ -95,7 +95,7 @@ CONST struct shared_resource_table __resource __attribute__((used)) resource_tab
9595
__root CONST struct shared_resource_table resource_table @ ".resource_table" = {
9696
#endif
9797

98-
#if defined(__ICCARM__) || defined (__CC_ARM) || defined (STM32MP157Cxx)
98+
#if defined(__ICCARM__) || defined (__CC_ARM) || defined (LINUX_RPROC_MASTER)
9999
.version = 1,
100100
#if defined (__LOG_TRACE_IO_)
101101
.num = 2,
@@ -130,7 +130,7 @@ __root CONST struct shared_resource_table resource_table @ ".resource_table" = {
130130
void resource_table_init(int RPMsgRole, void **table_ptr, int *length)
131131
{
132132

133-
#if !defined (STM32MP157Cxx)
133+
#if !defined (LINUX_RPROC_MASTER)
134134
#if defined (__GNUC__) && ! defined (__CC_ARM)
135135
#ifdef VIRTIO_MASTER_ONLY
136136

Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_raw/Inc/openamp_conf.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@
7474
#endif /* VIRTUAL_I2C_MODULE_ENABLED */
7575

7676

77+
/* ########################## Linux Master Selection ############################## */
78+
/**
79+
* @brief Due to Linux compatibility, it's important to distinguish if the MASTER is Linux or not.
80+
* In that case, the LINUX_RPROC_MASTER define is required
81+
*/
82+
#define LINUX_RPROC_MASTER
83+
7784

7885
/* USER CODE BEGIN INCLUDE */
7986

@@ -154,7 +161,7 @@ extern int __OPENAMP_region_end__[]; /* defined by linker script */
154161

155162
#endif
156163

157-
#if defined STM32MP157Cxx
164+
#if defined LINUX_RPROC_MASTER
158165
#define VRING_RX_ADDRESS -1 /* allocated by Master processor: CA7 */
159166
#define VRING_TX_ADDRESS -1 /* allocated by Master processor: CA7 */
160167
#define VRING_BUFF_ADDRESS -1 /* allocated by Master processor: CA7 */

Projects/STM32MP157C-DK2/Applications/OpenAMP/OpenAMP_raw/Src/rsc_table.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#define __resource __section_t(.resource_table)
6262
#endif
6363

64-
#if defined (STM32MP157Cxx)
64+
#if defined (LINUX_RPROC_MASTER)
6565
#ifdef VIRTIO_MASTER_ONLY
6666
#define CONST
6767
#else
@@ -82,7 +82,7 @@ extern char system_log_buf[];
8282
#endif
8383

8484
#if defined(__GNUC__)
85-
#if !defined (__CC_ARM) && !defined (STM32MP157Cxx)
85+
#if !defined (__CC_ARM) && !defined (LINUX_RPROC_MASTER)
8686

8787
/* Since GCC is not initializing the resource_table at startup, it is declared as volatile to avoid compiler optimization
8888
* for the CM4 (see resource_table_init() below)
@@ -95,7 +95,7 @@ CONST struct shared_resource_table __resource __attribute__((used)) resource_tab
9595
__root CONST struct shared_resource_table resource_table @ ".resource_table" = {
9696
#endif
9797

98-
#if defined(__ICCARM__) || defined (__CC_ARM) || defined (STM32MP157Cxx)
98+
#if defined(__ICCARM__) || defined (__CC_ARM) || defined (LINUX_RPROC_MASTER)
9999
.version = 1,
100100
#if defined (__LOG_TRACE_IO_)
101101
.num = 2,
@@ -130,7 +130,7 @@ __root CONST struct shared_resource_table resource_table @ ".resource_table" = {
130130
void resource_table_init(int RPMsgRole, void **table_ptr, int *length)
131131
{
132132

133-
#if !defined (STM32MP157Cxx)
133+
#if !defined (LINUX_RPROC_MASTER)
134134
#if defined (__GNUC__) && ! defined (__CC_ARM)
135135
#ifdef VIRTIO_MASTER_ONLY
136136

Projects/STM32MP157C-EV1/Applications/OpenAMP/OpenAMP_Dynamic_ResMgr/Inc/openamp_conf.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@
7474
#endif /* VIRTUAL_I2C_MODULE_ENABLED */
7575

7676

77+
/* ########################## Linux Master Selection ############################## */
78+
/**
79+
* @brief Due to Linux compatibility, it's important to distinguish if the MASTER is Linux or not.
80+
* In that case, the LINUX_RPROC_MASTER define is required
81+
*/
82+
#define LINUX_RPROC_MASTER
83+
7784

7885
/* USER CODE BEGIN INCLUDE */
7986

@@ -154,7 +161,7 @@ extern int __OPENAMP_region_end__[]; /* defined by linker script */
154161

155162
#endif
156163

157-
#if defined STM32MP157Cxx
164+
#if defined LINUX_RPROC_MASTER
158165
#define VRING_RX_ADDRESS -1 /* allocated by Master processor: CA7 */
159166
#define VRING_TX_ADDRESS -1 /* allocated by Master processor: CA7 */
160167
#define VRING_BUFF_ADDRESS -1 /* allocated by Master processor: CA7 */

0 commit comments

Comments
 (0)