Skip to content

Commit

Permalink
Release March 2019, version 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekNovakNXP committed Mar 19, 2019
1 parent 8207768 commit adc38df
Show file tree
Hide file tree
Showing 27 changed files with 2,947 additions and 545 deletions.
6 changes: 3 additions & 3 deletions lib/common/llist.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
*/
void add_to_list(struct llist **head, struct llist *node)
{
if (!node)
if (node == LIST_NULL)
{
return;
}

if (*head)
if (*head != LIST_NULL)
{
/* Place the new element at the start of list. */
node->next = *head;
Expand Down Expand Up @@ -88,7 +88,7 @@ void add_to_list(struct llist **head, struct llist *node)
*/
void remove_from_list(struct llist **head, struct llist *node)
{
if (!(*head) || !(node))
if ((*head == LIST_NULL) || (node == LIST_NULL))
{
return;
}
Expand Down
41 changes: 8 additions & 33 deletions lib/include/platform/imx6sx_m4/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
/*
* The Clear BSD License
* Copyright (c) 2016 Freescale Semiconductor, Inc.
* Copyright 2016 NXP
* Copyright 2016-2019 NXP
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the disclaimer below) provided
* that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: BSD-3-Clause
*/

#ifndef _MACHINE_SYSTEM_H
#define _MACHINE_SYSTEM_H
#ifndef _RPMSG_PLATFORM_H
#define _RPMSG_PLATFORM_H

/* RPMSG MU channel index */
#define RPMSG_MU_CHANNEL (1)
Expand Down Expand Up @@ -61,12 +36,12 @@
#define RL_PLATFORM_HIGHEST_LINK_ID (0)

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

/* platform low-level time-delay (busy loop) */
void platform_time_delay(int num_msec);
Expand All @@ -83,4 +58,4 @@ int platform_init(void);
int platform_deinit(void);
void rpmsg_handler(void);

#endif /* _MACHINE_SYSTEM_H */
#endif /* _RPMSG_PLATFORM_H */
43 changes: 9 additions & 34 deletions lib/include/platform/imx7d_m4/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
/*
* The Clear BSD License
* Copyright (c) 2016 Freescale Semiconductor, Inc.
* Copyright 2016 NXP
* Copyright 2016-2019 NXP
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the disclaimer below) provided
* that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: BSD-3-Clause
*/

#ifndef _MACHINE_SYSTEM_H
#define _MACHINE_SYSTEM_H
#ifndef _RPMSG_PLATFORM_H
#define _RPMSG_PLATFORM_H

/* RPMSG MU channel index */
#define RPMSG_MU_CHANNEL (1)
Expand All @@ -57,16 +32,16 @@
#define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFE) >> 1)
#define RL_GET_Q_ID(id) ((id)&0x1)

#define RL_PLATFORM_IMX6SX_M4_LINK_ID (0)
#define RL_PLATFORM_IMX7D_M4_LINK_ID (0)
#define RL_PLATFORM_HIGHEST_LINK_ID (0)

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

/* platform low-level time-delay (busy loop) */
void platform_time_delay(int num_msec);
Expand All @@ -83,4 +58,4 @@ int platform_init(void);
int platform_deinit(void);
void rpmsg_handler(void);

#endif /* _MACHINE_SYSTEM_H */
#endif /* _RPMSG_PLATFORM_H */
41 changes: 8 additions & 33 deletions lib/include/platform/lpc5410x/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
/*
* The Clear BSD License
* Copyright (c) 2016 Freescale Semiconductor, Inc.
* Copyright 2016 NXP
* Copyright 2016-2019 NXP
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the disclaimer below) provided
* that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: BSD-3-Clause
*/

#ifndef _MACHINE_SYSTEM_H
#define _MACHINE_SYSTEM_H
#ifndef _RPMSG_PLATFORM_H
#define _RPMSG_PLATFORM_H

/*
* No need to align the VRING as defined in Linux because LPC54102 is not intended
Expand All @@ -59,12 +34,12 @@
#define RL_PLATFORM_HIGHEST_LINK_ID (0)

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

/* platform low-level time-delay (busy loop) */
void platform_time_delay(int num_msec);
Expand All @@ -80,4 +55,4 @@ void *platform_patova(unsigned long addr);
int platform_init(void);
int platform_deinit(void);

#endif /* _MACHINE_SYSTEM_H */
#endif /* _RPMSG_PLATFORM_H */
43 changes: 9 additions & 34 deletions lib/include/platform/lpc5411x/rpmsg_platform.h
Original file line number Diff line number Diff line change
@@ -1,39 +1,14 @@
/*
* The Clear BSD License
* Copyright (c) 2016 Freescale Semiconductor, Inc.
* Copyright 2016 NXP
* Copyright 2016-2019 NXP
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the disclaimer below) provided
* that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* SPDX-License-Identifier: BSD-3-Clause
*/

#ifndef _MACHINE_SYSTEM_H
#define _MACHINE_SYSTEM_H
#ifndef _RPMSG_PLATFORM_H
#define _RPMSG_PLATFORM_H

/*
* No need to align the VRING as defined in Linux because LPC5411x is not intended
Expand All @@ -59,18 +34,18 @@
#define RL_PLATFORM_HIGHEST_LINK_ID (0)

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

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

/* platform memory functions */
void platform_map_mem_region(unsigned int va, unsigned int pa, unsigned int size, unsigned int flags);
void platform_map_mem_region(unsigned int vrt_addr, unsigned int phy_addr, unsigned int size, unsigned int flags);
void platform_cache_all_flush_invalidate(void);
void platform_cache_disable(void);
unsigned long platform_vatopa(void *addr);
Expand All @@ -80,4 +55,4 @@ void *platform_patova(unsigned long addr);
int platform_init(void);
int platform_deinit(void);

#endif /* _MACHINE_SYSTEM_H */
#endif /* _RPMSG_PLATFORM_H */
39 changes: 31 additions & 8 deletions lib/include/rpmsg_compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,33 @@
#define RL_PACKED_END
#endif

/* GNUC */
#elif defined(__GNUC__)
/* ARM GCC */
#elif defined(__CC_ARM) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))

#define MEM_BARRIER() asm volatile("dsb" : : : "memory")
#if (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
#include <arm_compat.h>
#endif

#define MEM_BARRIER() __schedule_barrier()

#ifndef RL_PACKED_BEGIN
#define RL_PACKED_BEGIN _Pragma("pack(1U)")
#endif

#ifndef RL_PACKED_END
#define RL_PACKED_END _Pragma("pack()")
#endif

/* XCC HiFi4 */
#elif defined(__XCC__)

/*
* The XCC HiFi4 compiler is compatible with GNU compiler, with restrictions.
* For ARM __schedule_barrier, there's no identical intrinsic in HiFi4.
* A complete synchronization barrier would require initialize and wait ops.
* Here use NOP instead, similar to ARM __nop.
*/
#define MEM_BARRIER() __asm__ __volatile__("nop" : : : "memory")

#ifndef RL_PACKED_BEGIN
#define RL_PACKED_BEGIN
Expand All @@ -70,17 +93,17 @@
#define RL_PACKED_END __attribute__((__packed__))
#endif

/* ARM GCC */
#elif defined(__CC_ARM)
/* GNUC */
#elif defined(__GNUC__)

#define MEM_BARRIER() __schedule_barrier()
#define MEM_BARRIER() __asm__ volatile("dsb" : : : "memory")

#ifndef RL_PACKED_BEGIN
#define RL_PACKED_BEGIN _Pragma("pack(1U)")
#define RL_PACKED_BEGIN
#endif

#ifndef RL_PACKED_END
#define RL_PACKED_END _Pragma("pack()")
#define RL_PACKED_END __attribute__((__packed__))
#endif

#else
Expand Down
Loading

0 comments on commit adc38df

Please sign in to comment.