1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2 /* Copyright (C) 2015-2017 Netronome Systems, Inc. */
4 #ifndef NFP6000_NFP6000_H
5 #define NFP6000_NFP6000_H
7 #include <linux/errno.h>
8 #include <linux/types.h>
11 #define NFP_CPP_TARGET_INVALID 0
12 #define NFP_CPP_TARGET_NBI 1
13 #define NFP_CPP_TARGET_QDR 2
14 #define NFP_CPP_TARGET_ILA 6
15 #define NFP_CPP_TARGET_MU 7
16 #define NFP_CPP_TARGET_PCIE 9
17 #define NFP_CPP_TARGET_ARM 10
18 #define NFP_CPP_TARGET_CRYPTO 12
19 #define NFP_CPP_TARGET_ISLAND_XPB 14 /* Shared with CAP */
20 #define NFP_CPP_TARGET_ISLAND_CAP 14 /* Shared with XPB */
21 #define NFP_CPP_TARGET_CT_XPB 14
22 #define NFP_CPP_TARGET_LOCAL_SCRATCH 15
23 #define NFP_CPP_TARGET_CLS NFP_CPP_TARGET_LOCAL_SCRATCH
25 #define NFP_ISL_EMEM0 24
27 #define NFP_MU_ADDR_ACCESS_TYPE_MASK 3ULL
28 #define NFP_MU_ADDR_ACCESS_TYPE_DIRECT 2ULL
30 #define PUSHPULL(_pull, _push) ((_pull) << 4 | (_push) << 0)
31 #define PUSH_WIDTH(_pushpull) pushpull_width((_pushpull) >> 0)
32 #define PULL_WIDTH(_pushpull) pushpull_width((_pushpull) >> 4)
34 static inline int pushpull_width(int pp)
43 static inline int nfp_cppat_mu_locality_lsb(int mode, bool addr40)
47 return addr40 ? 38 : 30;
53 int nfp_target_pushpull(u32 cpp_id, u64 address);
54 int nfp_target_cpp(u32 cpp_island_id, u64 cpp_island_address,
55 u32 *cpp_target_id, u64 *cpp_target_address,
56 const u32 *imb_table);
58 #endif /* NFP6000_NFP6000_H */