]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/powerpc/include/asm/vas.h
Revert "powerpc/powernv/vas: Define vas_rx_win_open() interface"
[mirror_ubuntu-artful-kernel.git] / arch / powerpc / include / asm / vas.h
1 /*
2 * Copyright 2016-17 IBM Corp.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10 #ifndef _ASM_POWERPC_VAS_H
11 #define _ASM_POWERPC_VAS_H
12
13 /*
14 * Min and max FIFO sizes are based on Version 1.05 Section 3.1.4.25
15 * (Local FIFO Size Register) of the VAS workbook.
16 */
17 #define VAS_RX_FIFO_SIZE_MIN (1 << 10) /* 1KB */
18 #define VAS_RX_FIFO_SIZE_MAX (8 << 20) /* 8MB */
19
20 /*
21 * Threshold Control Mode: Have paste operation fail if the number of
22 * requests in receive FIFO exceeds a threshold.
23 *
24 * NOTE: No special error code yet if paste is rejected because of these
25 * limits. So users can't distinguish between this and other errors.
26 */
27 #define VAS_THRESH_DISABLED 0
28 #define VAS_THRESH_FIFO_GT_HALF_FULL 1
29 #define VAS_THRESH_FIFO_GT_QTR_FULL 2
30 #define VAS_THRESH_FIFO_GT_EIGHTH_FULL 3
31
32 /*
33 * Get/Set bit fields
34 */
35 #define GET_FIELD(m, v) (((v) & (m)) >> MASK_LSH(m))
36 #define MASK_LSH(m) (__builtin_ffsl(m) - 1)
37 #define SET_FIELD(m, v, val) \
38 (((v) & ~(m)) | ((((typeof(v))(val)) << MASK_LSH(m)) & (m)))
39
40 /*
41 * Co-processor Engine type.
42 */
43 enum vas_cop_type {
44 VAS_COP_TYPE_FAULT,
45 VAS_COP_TYPE_842,
46 VAS_COP_TYPE_842_HIPRI,
47 VAS_COP_TYPE_GZIP,
48 VAS_COP_TYPE_GZIP_HIPRI,
49 VAS_COP_TYPE_FTW,
50 VAS_COP_TYPE_MAX,
51 };
52
53 #endif /* __ASM_POWERPC_VAS_H */