linux-imx/include/linux/imx_rpmsg.h
Richard Zhu 1cd9e0aaf0 rpmsg: imx: add the initial imx rpmsg support
Based on "virtio_rpmsg_bus" driver, This patch-set is used to set up
the communication mechanism between A core and M core on i.MX AMP SOCs.

Add the initial imx rpmsg support glue driver and one pingpong demo,
demonstrated the data transactions between A core and remote M core.
Distributed framework is used in IMX RPMSG implementation, refer to the
following requirements:
  - The CAN functions contained in M core and RTOS should be ready and
    complete functional in 50ms after AMP system is turned on.
  - Partition reset. System wouldn't be stalled by the exceptions (e.x
    the reset triggered by the system hang) occurred at the other side.
    And the RPMSG mechanism should be recovered automactilly after the
    partition reset is completed.
In this scenario, the M core and RTOS would be kicked off by bootloader
firstly, then A core and Linux would be loaded later. Both M core/RTOS
and A core/Linux are running independly.

One physical memory region used to store the vring is mandatory required
to pre-reserved and well-knowned by both A core and M core

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
2023-10-30 16:10:26 +08:00

44 lines
920 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2019 NXP.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/*
* @file linux/imx_rpmsg.h
*
* @brief Global header file for iMX RPMSG
*
* @ingroup RPMSG
*/
#ifndef __LINUX_IMX_RPMSG_H__
#define __LINUX_IMX_RPMSG_H__
/* Category define */
#define IMX_RMPSG_LIFECYCLE 1
#define IMX_RPMSG_PMIC 2
#define IMX_RPMSG_AUDIO 3
#define IMX_RPMSG_KEY 4
#define IMX_RPMSG_GPIO 5
#define IMX_RPMSG_RTC 6
#define IMX_RPMSG_SENSOR 7
/* rpmsg version */
#define IMX_RMPSG_MAJOR 1
#define IMX_RMPSG_MINOR 0
#define CIRC_ADD(idx, size, value) (((idx) + (value)) & ((size) - 1))
struct imx_rpmsg_head {
u8 cate;
u8 major;
u8 minor;
u8 type;
u8 cmd;
u8 reserved[5];
} __packed;
#endif /* __LINUX_IMX_RPMSG_H__ */