Skip to content

Commit

Permalink
RPMsg-Lite update 07/2020
Browse files Browse the repository at this point in the history
- MISRA C-2012 violations fixed (7.4)
- Fixed missing lock in rpmsg_lite_rx_callback() for QNX env.
- Correction of rpmsg_lite_instance structure members description
- Address -Waddress-of-packed-member warnings in GCC9
- Clang update to v10.0.0, code re-formatted
- Added support for several new multicore platforms
- Updated version to 3.1.0
  • Loading branch information
MichalPrincNXP committed Jul 21, 2020
1 parent 13badb2 commit cb56a06
Show file tree
Hide file tree
Showing 30 changed files with 1,626 additions and 99 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2019 NXP
Copyright (c) 2016-2020 NXP
Copyright (c) 2014-2016 Freescale Semiconductor, Inc.
Copyright (c) 2014, Mentor Graphics Corporation
Copyright (c) 2015 Xilinx, Inc. All rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ The RPMsg-Lite can be configured at the compile time. The default configuration
We welcome and encourage the community to submit patches directly to the rpmsg-lite project placed on github. Contributing can be managed via pull-requests. Before a pull-request is created the code should be tested and properly formatted.

## How to format rpmsg-lite code
To format code, use the application developed by Google, named *clang-format*. This tool is part of the [llvm](http://llvm.org/) project. Currently, the clang-format 7.0.1 version is used for rpmsg-lite.
To format code, use the application developed by Google, named *clang-format*. This tool is part of the [llvm](http://llvm.org/) project. Currently, the clang-format 10.0.0 version is used for rpmsg-lite.
The set of style settings used for clang-format is defined in the `.clang-format` file, placed in a root of the rpmsg-lite directory where Python script ``run_clang_format.py`` can be executed.
This script executes the application named *clang-format.exe*. You need to have the path of this application in the OS's environment path, or you need to change the script.

Expand All @@ -106,4 +106,4 @@ This script executes the application named *clang-format.exe*. You need to have

---
Copyright © 2016 Freescale Semiconductor, Inc.
Copyright © 2016-2019 NXP
Copyright © 2016-2020 NXP
2 changes: 1 addition & 1 deletion doxygen/Doxyfile.rpmsglite
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "RPMsg-Lite User's Guide"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "Rev. 3.0.0"
PROJECT_NUMBER = "Rev. 3.1.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions doxygen/html_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul class="foot">
<li class="footer">&copy; 2016 NXP Semiconductors. All rights reserved.
<li class="footer">Copyright 2016-2020 NXP Semiconductors. All rights reserved.
</li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small>
&copy; 2016 NXP Semiconductors. All rights reserved.
Copyright 2016-2020 NXP Semiconductors. All rights reserved.
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
Expand Down
1 change: 1 addition & 0 deletions doxygen/mainpage_rpmsg_lite.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,5 @@ This table summarizes revisions of this document.
|5.0 | 09/2018 | Align porting layers to the updated MCUXpressoSDK feature files <p> Allow rpmsg-lite build by Keil MDK ArmClangV6 compiler |
|6.0 | 04/2019 | Added configuration macro RL_DEBUG_CHECK_BUFFERS <p> Several MISRA violations fixed <p> Added environment layers for QNX and Zephyr <p> Allow environment context required for some environments (controlled by the RL_USE_ENVIRONMENT_CONTEXT configuration macro). |
|7.0 | 11/2019 | MISRA C-2012 violations fixed, incl. data types consolidation <p> Code formatted. |
|8.0 | 04/2020 | MISRA C-2012 violations fixed (7.4) <p> Fix missing lock in rpmsg_lite_rx_callback() for QNX env <p> Correction of rpmsg_lite_instance structure members description <p> Address -Waddress-of-packed-member warnings in GCC9 <p> Clang update to v10.0.0, code re-formatted. |

6 changes: 3 additions & 3 deletions lib/include/platform/imx6sx_m4/rpmsg_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)

#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)

#define RL_PLATFORM_IMX6SX_M4_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (0U)

/* platform interrupt related functions */
int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
Expand Down
6 changes: 3 additions & 3 deletions lib/include/platform/imx7d_m4/rpmsg_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)

#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)

#define RL_PLATFORM_IMX7D_M4_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (0U)

/* platform interrupt related functions */
int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
Expand Down
6 changes: 3 additions & 3 deletions lib/include/platform/imx7ulp_m4/rpmsg_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)

#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)

#define RL_PLATFORM_IMX7ULP_M4_SRTM_LINK_ID (0U)
#define RL_PLATFORM_IMX7ULP_M4_USER_LINK_ID (1U)
#define RL_PLATFORM_HIGHEST_LINK_ID (1U)
#define RL_PLATFORM_HIGHEST_LINK_ID (1U)

/* platform interrupt related functions */
int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
Expand Down
6 changes: 3 additions & 3 deletions lib/include/platform/imx8mm_m4/rpmsg_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)

#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)

#define RL_PLATFORM_IMX8MM_M4_USER_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (15U)
#define RL_PLATFORM_HIGHEST_LINK_ID (15U)

/* platform interrupt related functions */
int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
Expand Down
61 changes: 61 additions & 0 deletions lib/include/platform/imx8mn_m7/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2016 Freescale Semiconductor, Inc.
* Copyright 2016-2019 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef RPMSG_PLATFORM_H_
#define RPMSG_PLATFORM_H_

#include <stdint.h>

/* RPMSG MU channel index */
#define RPMSG_MU_CHANNEL (1)

/*
* Linux requires the ALIGN to 0x1000(4KB) instead of 0x80
*/
#ifndef VRING_ALIGN
#define VRING_ALIGN (0x1000U)
#endif

/* contains pool of descriptors and two circular buffers */
#ifndef VRING_SIZE
#define VRING_SIZE (0x8000UL)
#endif

/* size of shared memory + 2*VRING size */
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)

#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)

#define RL_PLATFORM_IMX8MN_M7_USER_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (15U)

/* platform interrupt related functions */
int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
int32_t platform_deinit_interrupt(uint32_t vector_id);
int32_t platform_interrupt_enable(uint32_t vector_id);
int32_t platform_interrupt_disable(uint32_t vector_id);
int32_t platform_in_isr(void);
void platform_notify(uint32_t vector_id);

/* platform low-level time-delay (busy loop) */
void platform_time_delay(uint32_t num_msec);

/* platform memory functions */
void platform_map_mem_region(uint32_t vrt_addr, uint32_t phy_addr, uint32_t size, uint32_t flags);
void platform_cache_all_flush_invalidate(void);
void platform_cache_disable(void);
uint32_t platform_vatopa(void *addr);
void *platform_patova(uint32_t addr);

/* platform init/deinit */
int32_t platform_init(void);
int32_t platform_deinit(void);

#endif /* RPMSG_PLATFORM_H_ */
6 changes: 3 additions & 3 deletions lib/include/platform/imx8mq_m4/rpmsg_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)

#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)

#define RL_PLATFORM_IMX8MQ_M4_USER_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (15U)
#define RL_PLATFORM_HIGHEST_LINK_ID (15U)

/* platform interrupt related functions */
int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
Expand Down
64 changes: 64 additions & 0 deletions lib/include/platform/imx8qx_cm4/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2016 Freescale Semiconductor, Inc.
* Copyright 2016-2019 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef RPMSG_PLATFORM_H_
#define RPMSG_PLATFORM_H_

#include <stdint.h>

/* RPMSG MU channel index */
#define RPMSG_MU_CHANNEL (1)

/*
* Linux requires the ALIGN to 0x1000(4KB) instead of 0x80
*/
#ifndef VRING_ALIGN
#define VRING_ALIGN (0x1000U)
#endif

/* contains pool of descriptors and two circular buffers */
#ifndef VRING_SIZE
#define VRING_SIZE (0x8000UL)
#endif

/* size of shared memory + 2*VRING size */
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)

#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)

#define RL_PLATFORM_IMX8QX_CM4_SRTM_LINK_ID (0U)
#define RL_PLATFORM_IMX8QX_CM4_USER_LINK_ID (1U)
#define RL_PLATFORM_HIGHEST_LINK_ID (15U)

/* platform interrupt related functions */
int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
int32_t platform_deinit_interrupt(uint32_t vector_id);
int32_t platform_interrupt_enable(uint32_t vector_id);
int32_t platform_interrupt_disable(uint32_t vector_id);
int32_t platform_in_isr(void);
void platform_notify(uint32_t vector_id);

/* platform low-level time-delay (busy loop) */
void platform_time_delay(uint32_t num_msec);

/* platform memory functions */
void platform_map_mem_region(uint32_t vrt_addr, uint32_t phy_addr, uint32_t size, uint32_t flags);
void platform_cache_all_flush_invalidate(void);
void platform_cache_disable(void);
uint32_t platform_vatopa(void *addr);
void *platform_patova(uint32_t addr);

/* platform init/deinit */
int32_t platform_init(void);
int32_t platform_deinit(void);

int32_t LSIO_MU5_INT_B_IRQHandler(void);

#endif /* RPMSG_PLATFORM_H_ */
64 changes: 64 additions & 0 deletions lib/include/platform/imxrt600_hifi4/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright 2019 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/

#ifndef RPMSG_PLATFORM_H_
#define RPMSG_PLATFORM_H_

#include <stdint.h>

/* RPMSG MU channel index */
#define RPMSG_MU_CHANNEL (1)

#define RPMSG_LITE_LINK_ID 0x1

/*
* No need to align the VRING as defined in Linux because LPCNEXT0 is not intended
* to run the Linux
*/
#ifndef VRING_ALIGN
#define VRING_ALIGN (0x10U)
#endif

/* contains pool of descriptos and two circular buffers */
#ifndef VRING_SIZE
#define VRING_SIZE (0x400UL)
#endif

/* size of shared memory + 2*VRING size */
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)

#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)

#define RL_PLATFORM_LPCNEXT0_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (1U)

/* platform interrupt related functions */
int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
int32_t platform_deinit_interrupt(uint32_t vector_id);
int32_t platform_interrupt_enable(uint32_t vector_id);
int32_t platform_interrupt_disable(uint32_t vector_id);
int32_t platform_in_isr(void);
void platform_notify(uint32_t vector_id);

/* platform low-level time-delay (busy loop) */
void platform_time_delay(uint32_t num_msec);

/* platform memory functions */
void platform_map_mem_region(uint32_t vrt_addr, uint32_t phy_addr, uint32_t size, uint32_t flags);
void platform_cache_all_flush_invalidate(void);
void platform_cache_disable(void);
uint32_t platform_vatopa(void *addr);
void *platform_patova(uint32_t addr);

/* platform init/deinit */
int32_t platform_init(void);
int32_t platform_deinit(void);

#endif /* RPMSG_PLATFORM_H_ */
61 changes: 61 additions & 0 deletions lib/include/platform/imxrt600_m33/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright 2019 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef RPMSG_PLATFORM_H_
#define RPMSG_PLATFORM_H_

#include <stdint.h>

/* RPMSG MU channel index */
#define RPMSG_MU_CHANNEL (1)

/*
* No need to align the VRING as defined in Linux because LPC6324 is not intended
* to run the Linux
*/
#ifndef VRING_ALIGN
#define VRING_ALIGN (0x10U)
#endif

/* contains pool of descriptos and two circular buffers */
#ifndef VRING_SIZE
#define VRING_SIZE (0x400UL)
#endif

/* size of shared memory + 2*VRING size */
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)

#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)

#define RL_PLATFORM_LPC6324_M33_DSP_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (0U)

/* platform interrupt related functions */
int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
int32_t platform_deinit_interrupt(uint32_t vector_id);
int32_t platform_interrupt_enable(uint32_t vector_id);
int32_t platform_interrupt_disable(uint32_t vector_id);
int32_t platform_in_isr(void);
void platform_notify(uint32_t vector_id);

/* platform low-level time-delay (busy loop) */
void platform_time_delay(uint32_t num_msec);

/* platform memory functions */
void platform_map_mem_region(uint32_t vrt_addr, uint32_t phy_addr, uint32_t size, uint32_t flags);
void platform_cache_all_flush_invalidate(void);
void platform_cache_disable(void);
uint32_t platform_vatopa(void *addr);
void *platform_patova(uint32_t addr);

/* platform init/deinit */
int32_t platform_init(void);
int32_t platform_deinit(void);

#endif /* RPMSG_PLATFORM_H_ */
6 changes: 3 additions & 3 deletions lib/include/platform/k32l3a6/rpmsg_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)

#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(id) ((id)&0x1U)

#define RL_PLATFORM_K32L3A60_M4_M0_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (0U)
#define RL_PLATFORM_HIGHEST_LINK_ID (0U)

/* platform interrupt related functions */
int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
Expand Down
Loading

0 comments on commit cb56a06

Please sign in to comment.