1
2
3
4
5
6#ifndef _ASM_POWERPC_VAS_H
7#define _ASM_POWERPC_VAS_H
8
9struct vas_window;
10
11
12
13
14
15#define VAS_RX_FIFO_SIZE_MIN (1 << 10)
16#define VAS_RX_FIFO_SIZE_MAX (8 << 20)
17
18
19
20
21
22
23
24
25#define VAS_THRESH_DISABLED 0
26#define VAS_THRESH_FIFO_GT_HALF_FULL 1
27#define VAS_THRESH_FIFO_GT_QTR_FULL 2
28#define VAS_THRESH_FIFO_GT_EIGHTH_FULL 3
29
30
31
32
33#define GET_FIELD(m, v) (((v) & (m)) >> MASK_LSH(m))
34#define MASK_LSH(m) (__builtin_ffsl(m) - 1)
35#define SET_FIELD(m, v, val) \
36 (((v) & ~(m)) | ((((typeof(v))(val)) << MASK_LSH(m)) & (m)))
37
38
39
40
41enum vas_cop_type {
42 VAS_COP_TYPE_FAULT,
43 VAS_COP_TYPE_842,
44 VAS_COP_TYPE_842_HIPRI,
45 VAS_COP_TYPE_GZIP,
46 VAS_COP_TYPE_GZIP_HIPRI,
47 VAS_COP_TYPE_FTW,
48 VAS_COP_TYPE_MAX,
49};
50
51
52
53
54struct vas_rx_win_attr {
55 void *rx_fifo;
56 int rx_fifo_size;
57 int wcreds_max;
58
59 bool pin_win;
60 bool rej_no_credit;
61 bool tx_wcred_mode;
62 bool rx_wcred_mode;
63 bool tx_win_ord_mode;
64 bool rx_win_ord_mode;
65 bool data_stamp;
66 bool nx_win;
67 bool fault_win;
68 bool user_win;
69 bool notify_disable;
70 bool intr_disable;
71 bool notify_early;
72
73 int lnotify_lpid;
74 int lnotify_pid;
75 int lnotify_tid;
76 u32 pswid;
77
78 int tc_mode;
79};
80
81
82
83
84struct vas_tx_win_attr {
85 enum vas_cop_type cop;
86 int wcreds_max;
87 int lpid;
88 int pidr;
89 int pid;
90 int pswid;
91 int rsvd_txbuf_count;
92 int tc_mode;
93
94 bool user_win;
95 bool pin_win;
96 bool rej_no_credit;
97 bool rsvd_txbuf_enable;
98 bool tx_wcred_mode;
99 bool rx_wcred_mode;
100 bool tx_win_ord_mode;
101 bool rx_win_ord_mode;
102};
103
104
105
106
107
108
109
110
111int chip_to_vas_id(int chipid);
112
113
114
115
116
117void vas_init_rx_win_attr(struct vas_rx_win_attr *rxattr, enum vas_cop_type cop);
118
119
120
121
122
123
124
125struct vas_window *vas_rx_win_open(int vasid, enum vas_cop_type cop,
126 struct vas_rx_win_attr *attr);
127
128
129
130
131extern void vas_init_tx_win_attr(struct vas_tx_win_attr *txattr,
132 enum vas_cop_type cop);
133
134
135
136
137
138
139
140
141
142
143
144struct vas_window *vas_tx_win_open(int vasid, enum vas_cop_type cop,
145 struct vas_tx_win_attr *attr);
146
147
148
149
150
151
152int vas_win_close(struct vas_window *win);
153
154
155
156
157int vas_copy_crb(void *crb, int offset);
158
159
160
161
162
163
164int vas_paste_crb(struct vas_window *win, int offset, bool re);
165
166#endif
167