Skip to content

Commit f26ed32

Browse files
committed
Update OpenAmp Middleware to MP1 Cube version 1.6.0
Signed-off-by: Frederic Pillon <[email protected]>
1 parent e34e648 commit f26ed32

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1927
-372
lines changed

Diff for: system/Middlewares/OpenAMP/libmetal/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ if (POLICY CMP0077)
77
cmake_policy(SET CMP0077 NEW)
88
endif()
99

10+
set (LIBMETAL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
11+
1012
list (APPEND CMAKE_MODULE_PATH
1113
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
1214
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"

Diff for: system/Middlewares/OpenAMP/libmetal/MAINTAINERS.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
# libmetal Maintainers
22

3-
libmetal project is maintained by the OpenAMP open source community.
3+
The libmetal project is maintained by the OpenAMP open source community.
44
Everyone is encouraged to submit issues and changes to improve libmetal.
55

66
The intention of this file is to provide a set of names that developers can
77
consult when they have a question about OpenAMP and to provide a a set of
88
names to be CC'd when submitting a patch.
99

1010
## Project Administration
11-
Ed Mooring <ed.mooring@linaro.org>
11+
Ed Mooring <ed.mooring@gmail.com>
1212
Arnaud Pouliquen <[email protected]>
1313

1414
### All patches CC here
1515
16-
17-
## Machines
18-
### Xilinx Platform - Zynq-7000
19-
Ed Mooring <[email protected]>
20-
21-
### Xilinx Platform - Zynq UltraScale+ MPSoC
22-
Ed Mooring <[email protected]>

Diff for: system/Middlewares/OpenAMP/libmetal/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
VERSION_MAJOR = 1
2-
VERSION_MINOR = 0
2+
VERSION_MINOR = 1
33
VERSION_PATCH = 0

Diff for: system/Middlewares/OpenAMP/libmetal/cmake/options.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
file(READ ${CMAKE_SOURCE_DIR}/VERSION ver)
1+
file(READ ${LIBMETAL_ROOT_DIR}/VERSION ver)
22

33
string(REGEX MATCH "VERSION_MAJOR = ([0-9]*)" _ ${ver})
44
set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1})

Diff for: system/Middlewares/OpenAMP/libmetal/cmake/syscheck.cmake

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ if (WITH_ZEPHYR)
77
if (NOT WITH_ZEPHYR_LIB)
88
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
99
endif()
10-
if (CONFIG_CPU_CORTEX_M)
11-
set (MACHINE "cortexm" CACHE STRING "")
12-
endif (CONFIG_CPU_CORTEX_M)
10+
if (CONFIG_ARM)
11+
set (MACHINE "arm" CACHE STRING "")
12+
endif(CONFIG_ARM)
13+
1314
endif (WITH_ZEPHYR)

Diff for: system/Middlewares/OpenAMP/libmetal/lib/alloc.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ static inline void *metal_allocate_memory(unsigned int size);
3636
*/
3737
static inline void metal_free_memory(void *ptr);
3838

39-
#include <metal/system/@PROJECT_SYSTEM@/alloc.h>
40-
4139
/** @} */
4240

4341
#ifdef __cplusplus
4442
}
4543
#endif
4644

45+
#include <metal/system/@PROJECT_SYSTEM@/alloc.h>
46+
47+
4748
#endif /* __METAL_ALLOC__H__ */

Diff for: system/Middlewares/OpenAMP/libmetal/lib/condition.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ static inline int metal_condition_broadcast(struct metal_condition *cv);
6363
*/
6464
int metal_condition_wait(struct metal_condition *cv, metal_mutex_t *m);
6565

66-
#include <metal/system/@PROJECT_SYSTEM@/condition.h>
67-
6866
/** @} */
6967

7068
#ifdef __cplusplus
7169
}
7270
#endif
7371

72+
#include <metal/system/@PROJECT_SYSTEM@/condition.h>
73+
7474
#endif /* __METAL_CONDITION__H__ */

Diff for: system/Middlewares/OpenAMP/libmetal/lib/dma.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#ifndef __METAL_DMA__H__
1313
#define __METAL_DMA__H__
1414

15+
#include <stdint.h>
16+
#include <metal/sys.h>
17+
1518
#ifdef __cplusplus
1619
extern "C" {
1720
#endif
@@ -20,9 +23,6 @@ extern "C" {
2023
* @{
2124
*/
2225

23-
#include <stdint.h>
24-
#include <metal/sys.h>
25-
2626
#define METAL_DMA_DEV_R 1 /**< DMA direction, device read */
2727
#define METAL_DMA_DEV_W 2 /**< DMA direction, device write */
2828
#define METAL_DMA_DEV_WR 3 /**< DMA direction, device read/write */

Diff for: system/Middlewares/OpenAMP/libmetal/lib/include/metal/alloc.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ static inline void *metal_allocate_memory(unsigned int size);
3636
*/
3737
static inline void metal_free_memory(void *ptr);
3838

39-
#ifdef METAL_FREERTOS
40-
#include <metal/system/freertos/alloc.h>
41-
#else
42-
#include <metal/system/generic/alloc.h>
43-
#endif
44-
4539
/** @} */
4640

4741
#ifdef __cplusplus
4842
}
4943
#endif
5044

45+
#ifdef METAL_FREERTOS
46+
#include <metal/system/freertos/alloc.h>
47+
#else
48+
#include <metal/system/generic/alloc.h>
49+
#endif
50+
5151
#endif /* __METAL_ALLOC__H__ */

Diff for: system/Middlewares/OpenAMP/libmetal/lib/include/metal/condition.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ static inline int metal_condition_broadcast(struct metal_condition *cv);
6363
*/
6464
int metal_condition_wait(struct metal_condition *cv, metal_mutex_t *m);
6565

66-
#ifdef METAL_FREERTOS
67-
#include <metal/system/freertos/condition.h>
68-
#else
69-
#include <metal/system/generic/condition.h>
70-
#endif
71-
7266
/** @} */
7367

7468
#ifdef __cplusplus
7569
}
7670
#endif
7771

72+
#ifdef METAL_FREERTOS
73+
#include <metal/system/freertos/condition.h>
74+
#else
75+
#include <metal/system/generic/condition.h>
76+
#endif
77+
7878
#endif /* __METAL_CONDITION__H__ */

Diff for: system/Middlewares/OpenAMP/libmetal/lib/include/metal/config.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ extern "C" {
2020
#define METAL_VER_MAJOR 1
2121

2222
/** Library minor version number. */
23-
#define METAL_VER_MINOR 0
23+
#define METAL_VER_MINOR 1
2424

2525
/** Library patch level. */
2626
#define METAL_VER_PATCH 0
2727

2828
/** Library version string. */
29-
#define METAL_VER "1.0.0"
29+
#define METAL_VER "1.1.0"
3030

3131
/** System type (linux, generic, ...). */
3232
#ifdef METAL_FREERTOS

Diff for: system/Middlewares/OpenAMP/libmetal/lib/include/metal/dma.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#ifndef __METAL_DMA__H__
1313
#define __METAL_DMA__H__
1414

15+
#include <stdint.h>
16+
#include <metal/sys.h>
17+
1518
#ifdef __cplusplus
1619
extern "C" {
1720
#endif
@@ -20,9 +23,6 @@ extern "C" {
2023
* @{
2124
*/
2225

23-
#include <stdint.h>
24-
#include <metal/sys.h>
25-
2626
#define METAL_DMA_DEV_R 1 /**< DMA direction, device read */
2727
#define METAL_DMA_DEV_W 2 /**< DMA direction, device write */
2828
#define METAL_DMA_DEV_WR 3 /**< DMA direction, device read/write */

Diff for: system/Middlewares/OpenAMP/libmetal/lib/include/metal/io.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static inline void *
132132
metal_io_virt(struct metal_io_region *io, unsigned long offset)
133133
{
134134
return (io->virt != METAL_BAD_VA && offset < io->size
135-
? (uint8_t *)io->virt + offset
135+
? (void *)((uintptr_t)io->virt + offset)
136136
: NULL);
137137
}
138138

@@ -145,7 +145,7 @@ metal_io_virt(struct metal_io_region *io, unsigned long offset)
145145
static inline unsigned long
146146
metal_io_virt_to_offset(struct metal_io_region *io, void *virt)
147147
{
148-
size_t offset = (uint8_t *)virt - (uint8_t *)io->virt;
148+
size_t offset = (uintptr_t)virt - (uintptr_t)io->virt;
149149

150150
return (offset < io->size ? offset : METAL_BAD_OFFSET);
151151
}
@@ -363,16 +363,16 @@ int metal_io_block_write(struct metal_io_region *io, unsigned long offset,
363363
int metal_io_block_set(struct metal_io_region *io, unsigned long offset,
364364
unsigned char value, int len);
365365

366-
#ifdef METAL_FREERTOS
367-
#include <metal/system/freertos/io.h>
368-
#else
369-
#include <metal/system/generic/io.h>
370-
#endif
371-
372366
/** @} */
373367

374368
#ifdef __cplusplus
375369
}
376370
#endif
377371

372+
#ifdef METAL_FREERTOS
373+
#include <metal/system/freertos/io.h>
374+
#else
375+
#include <metal/system/generic/io.h>
376+
#endif
377+
378378
#endif /* __METAL_IO__H__ */

Diff for: system/Middlewares/OpenAMP/libmetal/lib/include/metal/irq.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#ifndef __METAL_IRQ__H__
1313
#define __METAL_IRQ__H__
1414

15+
#include <metal/list.h>
16+
#include <stdlib.h>
17+
1518
#ifdef __cplusplus
1619
extern "C" {
1720
#endif
@@ -20,9 +23,6 @@ extern "C" {
2023
* @{
2124
*/
2225

23-
#include <metal/list.h>
24-
#include <stdlib.h>
25-
2626
/** IRQ handled status */
2727
#define METAL_IRQ_NOT_HANDLED 0
2828
#define METAL_IRQ_HANDLED 1

Diff for: system/Middlewares/OpenAMP/libmetal/lib/include/metal/softirq.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#ifndef __METAL_SOFTIRQ__H__
1313
#define __METAL_SOFTIRQ__H__
1414

15+
#include <metal/irq.h>
16+
1517
#ifdef __cplusplus
1618
extern "C" {
1719
#endif
@@ -20,8 +22,6 @@ extern "C" {
2022
* @{
2123
*/
2224

23-
#include <metal/irq.h>
24-
2525
/**
2626
* @brief metal_softirq_init
2727
*

Diff for: system/Middlewares/OpenAMP/libmetal/lib/include/metal/system/freertos/mutex.h

+10
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,17 @@ typedef struct {
3333
* METAL_MUTEX_INIT - used for initializing an mutex element in a static struct
3434
* or global
3535
*/
36+
#if defined(__GNUC__)
37+
#define METAL_MUTEX_INIT(m) { NULL }; \
38+
_Pragma("GCC warning\"static initialisation of the mutex is deprecated\"")
39+
#elif defined(__ICCARM__)
40+
#define DO_PRAGMA(x) _Pragma(#x)
41+
#define METAL_MUTEX_INIT(m) { NULL }; \
42+
DO_PRAGMA(message("Warning: static initialisation of the mutex is deprecated"))
43+
#else
3644
#define METAL_MUTEX_INIT(m) { NULL }
45+
#endif
46+
3747
/*
3848
* METAL_MUTEX_DEFINE - used for defining and initializing a global or
3949
* static singleton mutex

Diff for: system/Middlewares/OpenAMP/libmetal/lib/include/metal/time.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#ifndef __METAL_TIME__H__
1313
#define __METAL_TIME__H__
1414

15+
#include <stdint.h>
16+
#include <metal/sys.h>
17+
1518
#ifdef __cplusplus
1619
extern "C" {
1720
#endif
@@ -20,9 +23,6 @@ extern "C" {
2023
* @{
2124
*/
2225

23-
#include <stdint.h>
24-
#include <metal/sys.h>
25-
2626
/**
2727
* @brief get timestamp
2828
* This function returns the timestampe as unsigned long long

Diff for: system/Middlewares/OpenAMP/libmetal/lib/io.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int metal_io_block_read(struct metal_io_region *io, unsigned long offset,
3939
unsigned char *dest = dst;
4040
int retlen;
4141

42-
if (offset >= io->size)
42+
if (!ptr)
4343
return -ERANGE;
4444
if ((offset + len) > io->size)
4545
len = io->size - offset;
@@ -76,7 +76,7 @@ int metal_io_block_write(struct metal_io_region *io, unsigned long offset,
7676
const unsigned char *source = src;
7777
int retlen;
7878

79-
if (offset >= io->size)
79+
if (!ptr)
8080
return -ERANGE;
8181
if ((offset + len) > io->size)
8282
len = io->size - offset;
@@ -112,7 +112,7 @@ int metal_io_block_set(struct metal_io_region *io, unsigned long offset,
112112
unsigned char *ptr = metal_io_virt(io, offset);
113113
int retlen = len;
114114

115-
if (offset >= io->size)
115+
if (!ptr)
116116
return -ERANGE;
117117
if ((offset + len) > io->size)
118118
len = io->size - offset;

Diff for: system/Middlewares/OpenAMP/libmetal/lib/io.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static inline void *
132132
metal_io_virt(struct metal_io_region *io, unsigned long offset)
133133
{
134134
return (io->virt != METAL_BAD_VA && offset < io->size
135-
? (uint8_t *)io->virt + offset
135+
? (void *)((uintptr_t)io->virt + offset)
136136
: NULL);
137137
}
138138

@@ -145,7 +145,7 @@ metal_io_virt(struct metal_io_region *io, unsigned long offset)
145145
static inline unsigned long
146146
metal_io_virt_to_offset(struct metal_io_region *io, void *virt)
147147
{
148-
size_t offset = (uint8_t *)virt - (uint8_t *)io->virt;
148+
size_t offset = (uintptr_t)virt - (uintptr_t)io->virt;
149149

150150
return (offset < io->size ? offset : METAL_BAD_OFFSET);
151151
}
@@ -363,12 +363,12 @@ int metal_io_block_write(struct metal_io_region *io, unsigned long offset,
363363
int metal_io_block_set(struct metal_io_region *io, unsigned long offset,
364364
unsigned char value, int len);
365365

366-
#include <metal/system/@PROJECT_SYSTEM@/io.h>
367-
368366
/** @} */
369367

370368
#ifdef __cplusplus
371369
}
372370
#endif
373371

372+
#include <metal/system/@PROJECT_SYSTEM@/io.h>
373+
374374
#endif /* __METAL_IO__H__ */

Diff for: system/Middlewares/OpenAMP/libmetal/lib/irq.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
#ifndef __METAL_IRQ__H__
1313
#define __METAL_IRQ__H__
1414

15+
#include <metal/list.h>
16+
#include <stdlib.h>
17+
1518
#ifdef __cplusplus
1619
extern "C" {
1720
#endif
@@ -20,9 +23,6 @@ extern "C" {
2023
* @{
2124
*/
2225

23-
#include <metal/list.h>
24-
#include <stdlib.h>
25-
2626
/** IRQ handled status */
2727
#define METAL_IRQ_NOT_HANDLED 0
2828
#define METAL_IRQ_HANDLED 1

0 commit comments

Comments
 (0)