summaryrefslogtreecommitdiff
path: root/plat/sun50iw1p1/scp/include/arisc_messages.h
blob: 98c47b16227578396befa219b74ecc186d433d48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
 *  arch/arm/mach-sunxi/arisc/include/arisc_messages.h
 *
 * Copyright (c) 2012 Allwinner.
 * 2012-10-01 Written by superm (superm@allwinnertech.com).
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


#ifndef __ARISC_MESSAGES_H__
#define __ARISC_MESSAGES_H__

#include <arisc.h>

/* message states */
#define ARISC_MESSAGE_FREED         (0x0)   /* freed state       */
#define ARISC_MESSAGE_ALLOCATED     (0x1)   /* allocated state   */
#define ARISC_MESSAGE_INITIALIZED   (0x2)   /* initialized state */
#define ARISC_MESSAGE_RECEIVED      (0x3)   /* received state    */
#define ARISC_MESSAGE_PROCESSING    (0x4)   /* processing state  */
#define ARISC_MESSAGE_PROCESSED     (0x5)   /* processed state   */
#define ARISC_MESSAGE_FEEDBACKED    (0x6)   /* feedback state    */

/* call back struct */
typedef struct arisc_msg_cb
{
	arisc_cb_t   handler;
	void        *arg;
} arisc_msg_cb_t;

#ifdef CONFIG_ARCH_SUN50IW1P1
/*
 * the structure of message frame,
 * this structure will transfer between arisc and ac327.
 * sizeof(struct message) : 128Byte.
 */
typedef struct arisc_message
{
	volatile unsigned char           state;       /* identify the used status of message frame */
	volatile unsigned char           attr;        /* message attribute : SYN OR ASYN           */
	volatile unsigned char           type;        /* message type : DVFS_REQ                   */
	volatile unsigned char           result;      /* message process result                    */
	volatile unsigned char           reserved[4]; /* reserved for 8byte align */
	volatile struct arisc_message   *next;        /* pointer of next message frame             */
	volatile struct arisc_msg_cb     cb;          /* the callback function and arg of message  */
	volatile void                   *private;     /* message private data                      */
	volatile unsigned int            paras[22];   /* the parameters of message                 */
} arisc_message_t;
#else
/*
 * the structure of message frame,
 * this structure will transfer between arisc and ac327.
 * sizeof(struct message) : 64Byte.
 */
typedef struct arisc_message
{
	volatile unsigned char           state;     /* identify the used status of message frame */
	volatile unsigned char           attr;      /* message attribute : SYN OR ASYN           */
	volatile unsigned char           type;      /* message type : DVFS_REQ                   */
	volatile unsigned char           result;    /* message process result                    */
	volatile struct arisc_message   *next;      /* pointer of next message frame             */
	volatile struct arisc_msg_cb         cb;        /* the callback function and arg of message  */
	volatile void                   *private;   /* message private data                      */
	volatile unsigned int                paras[11]; /* the parameters of message                 */
} arisc_message_t;
#endif

#endif  /* __ARISC_MESSAGES_H */