Skip to content

Commit

Permalink
Apply v5.1.1 release update
Browse files Browse the repository at this point in the history
  • Loading branch information
McuxCIBot authored and MichalPrincNXP committed Jan 18, 2024
1 parent 678deb9 commit c863759
Show file tree
Hide file tree
Showing 120 changed files with 14,366 additions and 104 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-2023 NXP
Copyright (c) 2016-2024 NXP
Copyright (c) 2014-2016 Freescale Semiconductor, Inc.
Copyright (c) 2014, Mentor Graphics Corporation
Copyright (c) 2015 Xilinx, Inc. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ This script executes the application named *clang-format.exe*. You need to have

---
Copyright © 2016 Freescale Semiconductor, Inc.
Copyright © 2016-2023 NXP
Copyright © 2016-2024 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. 5.1.0"
PROJECT_NUMBER = "Rev. 5.1.1"

# 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: 1 addition & 3 deletions lib/include/environment/bm/rpmsg_env_specific.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2021 NXP
* All rights reserved.
*
* Copyright 2021-2023 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
2 changes: 0 additions & 2 deletions lib/include/environment/freertos/rpmsg_env_specific.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2021-2023 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
4 changes: 1 addition & 3 deletions lib/include/environment/qnx/rpmsg_env_specific.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2021,2023 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down Expand Up @@ -37,7 +35,7 @@ typedef struct
} rpmsg_queue_rx_cb_data_t;

#if defined(RL_USE_STATIC_API) && (RL_USE_STATIC_API == 1)
#error "This RPMsg-Lite port requires RL_USE_STATIC_API set to 0"
#error "This RPMsg-Lite port requires RL_USE_STATIC_API set to 0"
#endif

#endif /* RPMSG_ENV_SPECIFIC_H_ */
2 changes: 0 additions & 2 deletions lib/include/environment/threadx/rpmsg_env_specific.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2021-2023 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
2 changes: 0 additions & 2 deletions lib/include/environment/xos/rpmsg_env_specific.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2021-2023 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
15 changes: 10 additions & 5 deletions lib/include/environment/zephyr/rpmsg_env_specific.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2021-2023 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand All @@ -21,11 +19,18 @@

#include "rpmsg_default_config.h"

typedef struct
{
uint32_t src;
void *data;
uint32_t len;
} rpmsg_queue_rx_cb_data_t;

#if defined(RL_USE_STATIC_API) && (RL_USE_STATIC_API == 1)
#include <zephyr.h>
#include <zephyr/kernel.h>

typedef k_sem LOCK_STATIC_CONTEXT;
typedef k_msgq rpmsg_static_queue_ctxt;
typedef struct k_sem LOCK_STATIC_CONTEXT;
typedef struct k_msgq rpmsg_static_queue_ctxt;
/* Queue object static storage size in bytes, should be defined as (2*RL_BUFFER_COUNT*sizeof(rpmsg_queue_rx_cb_data_t))
This macro helps the application to statically allocate the queue object static storage memory. Note, the
RL_BUFFER_COUNT is not applied for all instances when RL_ALLOW_CUSTOM_SHMEM_CONFIG is set to 1 ! */
Expand Down
4 changes: 1 addition & 3 deletions lib/include/platform/imx8mp_m7/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2019,2022 NXP
* All rights reserved.
*
* Copyright 2019-2023 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
107 changes: 107 additions & 0 deletions lib/include/platform/imx8ulp_fusionf1/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*
* Copyright 2021-2023 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef RPMSG_PLATFORM_H_
#define RPMSG_PLATFORM_H_

#include <stdint.h>

typedef struct rpmsg_platform_shmem_config
{
uint32_t buffer_payload_size; /* custom buffer payload size setting that overwrites RL_BUFFER_PAYLOAD_SIZE global
config, must be equal to (240, 496, 1008, ...) [2^n - 16] */
uint16_t buffer_count; /* custom buffer count setting that overwrites RL_BUFFER_COUNT global config, must be power
of two (2, 4, ...) */
uint32_t vring_size; /* custom vring size */
uint32_t vring_align; /* custom vring alignment */
} rpmsg_platform_shmem_config_t;

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

#if !(defined(RL_ALLOW_CUSTOM_SHMEM_CONFIG) && (RL_ALLOW_CUSTOM_SHMEM_CONFIG == 1))
/*
* No need to align the VRING as defined in Linux because the FUSION DSP is not intended
* to communicate with Linux.
*/
#ifndef VRING_ALIGN
#define VRING_ALIGN (0x10U)
#endif

/* contains pool of descriptors and two circular buffers */
#ifndef VRING_SIZE
/* set VRING_SIZE based on number of used buffers as calculated in vring_init */
#define VRING_DESC_SIZE (((RL_BUFFER_COUNT * sizeof(struct vring_desc)) + VRING_ALIGN - 1UL) & ~(VRING_ALIGN - 1UL))
#define VRING_AVAIL_SIZE \
(((sizeof(struct vring_avail) + (RL_BUFFER_COUNT * sizeof(uint16_t)) + sizeof(uint16_t)) + VRING_ALIGN - 1UL) & \
~(VRING_ALIGN - 1UL))
#define VRING_USED_SIZE \
(((sizeof(struct vring_used) + (RL_BUFFER_COUNT * sizeof(struct vring_used_elem)) + sizeof(uint16_t)) + \
VRING_ALIGN - 1UL) & \
~(VRING_ALIGN - 1UL))
#define VRING_SIZE (VRING_DESC_SIZE + VRING_AVAIL_SIZE + VRING_USED_SIZE)
#endif

/* define shared memory space for VRINGS per one channel */
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)
#endif

/* VQ_ID in 8ULP is defined as follows:
* com_id: [4:3] communication ID, used to identify the MU instance.
* vring_id: [2:1] vring ID, used to identify the vring.
* q_id: [0:0] queue ID, used to identify the tvq or rvq.
* com_id + vring_id = link_id
*/
#define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
#define RL_GET_LINK_ID(vq_id) (((vq_id)&0xFFFFFFFEU) >> 1U)
#define RL_GET_Q_ID(vq_id) ((vq_id)&0x1U)
#define RL_GEN_MU_MSG(vq_id) (uint32_t)(((vq_id)&0x7U) << 16U) /* com_id is discarded in msg */

#define RL_GEN_LINK_ID(com_id, vring_id) (((com_id) << 2U) | (vring_id))

#define RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_COM_ID (1U)
#define RL_PLATFORM_IMX8ULP_FUSION_SRTM_VRING_ID (0U)
#define RL_PLATFORM_IMX8ULP_FUSION_USER_VRING_ID (1U)

/* Use same link id with master/CM33. */
#define RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_SRTM_LINK_ID \
RL_GEN_LINK_ID(RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_COM_ID, RL_PLATFORM_IMX8ULP_FUSION_SRTM_VRING_ID)
#define RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_USER_LINK_ID \
RL_GEN_LINK_ID(RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_COM_ID, RL_PLATFORM_IMX8ULP_FUSION_USER_VRING_ID)

#define RL_PLATFORM_HIGHEST_LINK_ID \
RL_GEN_LINK_ID(RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_COM_ID, RL_PLATFORM_IMX8ULP_FUSION_USER_VRING_ID)

/* 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);
uintptr_t platform_vatopa(void *addr);
void *platform_patova(uintptr_t addr);

#if defined(RL_ALLOW_CUSTOM_SHMEM_CONFIG) && (RL_ALLOW_CUSTOM_SHMEM_CONFIG == 1)
#define RL_VRING_SIZE_M33_FUSION_DSP_COM (0x400UL)

#define RL_VRING_ALIGN_M33_FUSION_DSP_COM (0x10U)

int32_t platform_get_custom_shmem_config(uint32_t link_id, rpmsg_platform_shmem_config_t *cfg);
#endif /* defined(RL_ALLOW_CUSTOM_SHMEM_CONFIG) && (RL_ALLOW_CUSTOM_SHMEM_CONFIG == 1) */

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

#endif /* RPMSG_PLATFORM_H_ */
115 changes: 115 additions & 0 deletions lib/include/platform/imx8ulp_m33/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
* Copyright 2021-2023 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef RPMSG_PLATFORM_H_
#define RPMSG_PLATFORM_H_

#include <stdint.h>

typedef struct rpmsg_platform_shmem_config
{
uint32_t buffer_payload_size; /* custom buffer payload size setting that overwrites RL_BUFFER_PAYLOAD_SIZE global
config, must be equal to (240, 496, 1008, ...) [2^n - 16] */
uint16_t buffer_count; /* custom buffer count setting that overwrites RL_BUFFER_COUNT global config, must be power
of two (2, 4, ...) */
uint32_t vring_size; /* custom vring size */
uint32_t vring_align; /* custom vring alignment */
} rpmsg_platform_shmem_config_t;

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

#if !(defined(RL_ALLOW_CUSTOM_SHMEM_CONFIG) && (RL_ALLOW_CUSTOM_SHMEM_CONFIG == 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

/* define shared memory space for VRINGS per one channel */
#define RL_VRING_OVERHEAD (2UL * VRING_SIZE)
#endif

/* VQ_ID in 8ULP is defined as follows:
* com_id: [4:3] communication ID, used to identify the MU instance.
* vring_id: [2:1] vring ID, used to identify the vring.
* q_id: [0:0] queue ID, used to identify the tvq or rvq.
* com_id + vring_id = link_id
*/

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

#define RL_GEN_LINK_ID(com_id, vring_id) (((com_id) << 2U) | (vring_id))
#define RL_GEN_MU_MSG(vq_id) (uint32_t)(((vq_id)&0x7U) << 16U) /* com_id is discarded in msg */

#define RL_PLATFORM_IMX8ULP_M33_A35_COM_ID (0U)
#define RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_COM_ID (1U)
#define RL_PLATFORM_IMX8ULP_M33_HIFI4_COM_ID (2U)

#define RL_PLATFORM_IMX8ULP_M33_SRTM_VRING_ID (0U)
#define RL_PLATFORM_IMX8ULP_M33_USER_VRING_ID (1U)

#define RL_PLATFORM_HIGHEST_LINK_ID \
RL_GEN_LINK_ID(RL_PLATFORM_IMX8ULP_M33_HIFI4_COM_ID, RL_PLATFORM_IMX8ULP_M33_USER_VRING_ID)

#define RL_PLATFORM_IMX8ULP_M33_A35_SRTM_LINK_ID \
RL_GEN_LINK_ID(RL_PLATFORM_IMX8ULP_M33_A35_COM_ID, RL_PLATFORM_IMX8ULP_M33_SRTM_VRING_ID)
#define RL_PLATFORM_IMX8ULP_M33_A35_USER_LINK_ID \
RL_GEN_LINK_ID(RL_PLATFORM_IMX8ULP_M33_A35_COM_ID, RL_PLATFORM_IMX8ULP_M33_USER_VRING_ID)

#define RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_SRTM_LINK_ID \
RL_GEN_LINK_ID(RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_COM_ID, RL_PLATFORM_IMX8ULP_M33_SRTM_VRING_ID)
#define RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_USER_LINK_ID \
RL_GEN_LINK_ID(RL_PLATFORM_IMX8ULP_M33_FUSION_DSP_COM_ID, RL_PLATFORM_IMX8ULP_M33_USER_VRING_ID)

#define RL_PLATFORM_IMX8ULP_M33_HIFI4_SRTM_LINK_ID \
RL_GEN_LINK_ID(RL_PLATFORM_IMX8ULP_M33_HIFI4_COM_ID, RL_PLATFORM_IMX8ULP_M33_SRTM_VRING_ID)
#define RL_PLATFORM_IMX8ULP_M33_HIFI4_USER_LINK_ID \
RL_GEN_LINK_ID(RL_PLATFORM_IMX8ULP_M33_HIFI4_COM_ID, RL_PLATFORM_IMX8ULP_M33_USER_VRING_ID)

/* 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);
uintptr_t platform_vatopa(void *addr);
void *platform_patova(uintptr_t addr);

#if defined(RL_ALLOW_CUSTOM_SHMEM_CONFIG) && (RL_ALLOW_CUSTOM_SHMEM_CONFIG == 1)
#define RL_VRING_SIZE_M33_A35_COM (0x8000UL) /* contains pool of descriptors and two circular buffers */
#define RL_VRING_SIZE_M33_FUSION_DSP_COM (0x400UL)
#define RL_VRING_SIZE_M33_HIFI4_COM (0x400UL)

#define RL_VRING_ALIGN_M33_A35_COM (0x1000U) /* Linux requires the ALIGN to 0x1000(4KB) instead of 0x80 */
#define RL_VRING_ALIGN_M33_FUSION_DSP_COM (0x10U)
#define RL_VRING_ALIGN_M33_HIFI4_COM (0x10U)

int32_t platform_get_custom_shmem_config(uint32_t link_id, rpmsg_platform_shmem_config_t *cfg);
#endif /* defined(RL_ALLOW_CUSTOM_SHMEM_CONFIG) && (RL_ALLOW_CUSTOM_SHMEM_CONFIG == 1) */

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

#endif /* RPMSG_PLATFORM_H_ */
4 changes: 1 addition & 3 deletions lib/include/platform/imxrt500_fusionf1/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2019-2022 NXP
* All rights reserved.
*
* Copyright 2019-2023 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
4 changes: 1 addition & 3 deletions lib/include/platform/imxrt500_m33/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2019-2022 NXP
* All rights reserved.
*
* Copyright 2019-2023 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
4 changes: 1 addition & 3 deletions lib/include/platform/imxrt600_hifi4/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2019-2022 NXP
* All rights reserved.
*
* Copyright 2019-2023 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
4 changes: 1 addition & 3 deletions lib/include/platform/imxrt600_m33/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2019-2022 NXP
* All rights reserved.
*
* Copyright 2019-2023 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
4 changes: 1 addition & 3 deletions lib/include/platform/lpc55s69/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*
* Copyright 2018-2022 NXP
* All rights reserved.
*
* Copyright 2018-2023 NXP
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/include/rpmsg_lite.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern "C" {
* Definitions
******************************************************************************/

#define RL_VERSION "5.1.0" /*!< Current RPMsg Lite version */
#define RL_VERSION "5.1.1" /*!< Current RPMsg Lite version */

/* Shared memory "allocator" parameters */
#define RL_WORD_SIZE (sizeof(uint32_t))
Expand Down
Loading

0 comments on commit c863759

Please sign in to comment.