]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/open-amp.git/blob - lib/include/openamp/remoteproc_plat.h
Add remoteproc platform APIs
[processor-sdk/open-amp.git] / lib / include / openamp / remoteproc_plat.h
1 #ifndef _REMOTEPROC_PLAT_H_
2 #define _REMOTEPROC_PLAT_H_
4 /*
5  * Copyright (c) 2016 Xilinx, Inc.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  *    this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  *    this list of conditions and the following disclaimer in the documentation
15  *    and/or other materials provided with the distribution.
16  * 3. Neither the name of the <ORGANIZATION> nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
33 /**************************************************************************
34  * FILE NAME
35  *
36  *       remoteproc_platform.h
37  *
38  * DESCRIPTION
39  *
40  *       This file defines the platform data structure, user can use those
41  *       structures to specify platform dependent data. Remoteproc drivers
42  *       can use them to get the platform data.
43  *
44  ***************************************************************************/
46 #include "openamp/hil.h"
47 #include "metal/list.h"
48 #include "metal/io.h"
51 /** Platform data resource type */
52 enum plat_rsc_type {
53         PLAT_RSC_VRING = 0,
54         PLAT_RSC_SHM = 1,
55         PLAT_RSC_RPMSG_CHANNEL = 2,
56         PLAT_RSC_LAST = 3,
57 };
59 /** vring data structure */
60 struct plat_vring {
61         unsigned int type;
62         char *ipi_bus_name;
63         char *ipi_dev_name;
64         void *ipi_dev_data;
65         char *vdev_bus_name;
66         char *vdev_name;
67 };
69 /** shared memory structure */
70 struct plat_shm {
71         unsigned int type;
72         char *shm_name;
73         size_t size;
74 };
76 /** RPMSG channel structure */
77 struct plat_rpmsg_chnl {
78         unsigned int type;
79         char *name;
80 };
82 /**
83  * rproc_init_plat_data
84  *
85  * setup remoteproc common data based on the input platform data.
86  *
87  * @param[in] pdata     - input platform data
88  * @param[in] proc      - hil proc to set with the platform data
89  *
90  * @returns - 0 for success, non-zero for errors.
91  *
92  */
93 int rproc_init_plat_data(void *pdata, struct hil_proc *proc);
95 /**
96  * rproc_close_plat
97  *
98  * close remoteproc platform resource
99  *
100  * @param[in] proc      - hil proc which holds the platform data
101  *
102  */
103 void rproc_close_plat(struct hil_proc *proc);
105 #endif                          /* _REMOTEPROC_PLAT_H_ */