New upstream version 18.08
[deb_dpdk.git] / drivers / net / nfp / nfpcore / nfp6000 / nfp6000.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Netronome Systems, Inc.
3  * All rights reserved.
4  */
5
6 #ifndef __NFP_NFP6000_H__
7 #define __NFP_NFP6000_H__
8
9 /* CPP Target IDs */
10 #define NFP_CPP_TARGET_INVALID          0
11 #define NFP_CPP_TARGET_NBI              1
12 #define NFP_CPP_TARGET_QDR              2
13 #define NFP_CPP_TARGET_ILA              6
14 #define NFP_CPP_TARGET_MU               7
15 #define NFP_CPP_TARGET_PCIE             9
16 #define NFP_CPP_TARGET_ARM              10
17 #define NFP_CPP_TARGET_CRYPTO           12
18 #define NFP_CPP_TARGET_ISLAND_XPB       14      /* Shared with CAP */
19 #define NFP_CPP_TARGET_ISLAND_CAP       14      /* Shared with XPB */
20 #define NFP_CPP_TARGET_CT_XPB           14
21 #define NFP_CPP_TARGET_LOCAL_SCRATCH    15
22 #define NFP_CPP_TARGET_CLS              NFP_CPP_TARGET_LOCAL_SCRATCH
23
24 #define NFP_ISL_EMEM0                   24
25
26 #define NFP_MU_ADDR_ACCESS_TYPE_MASK    3ULL
27 #define NFP_MU_ADDR_ACCESS_TYPE_DIRECT  2ULL
28
29 static inline int
30 nfp_cppat_mu_locality_lsb(int mode, int addr40)
31 {
32         switch (mode) {
33         case 0 ... 3:
34                 return addr40 ? 38 : 30;
35         default:
36                 return -EINVAL;
37         }
38 }
39
40 #endif /* NFP_NFP6000_H */