Move the function declaration into the header file, and sync some
logic from kernel driver.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
drivers/net/nfp/nfpcore/nfp6000/nfp6000.h | 20 --------------------
drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 1 +
drivers/net/nfp/nfpcore/nfp_cppcore.c | 1 +
drivers/net/nfp/nfpcore/nfp_mutex.c | 2 +-
drivers/net/nfp/nfpcore/nfp_nsp_eth.c | 1 -
drivers/net/nfp/nfpcore/nfp_resource.c | 2 +-
drivers/net/nfp/nfpcore/nfp_rtsym.c | 1 +
drivers/net/nfp/nfpcore/nfp_target.c | 7 ++++---
drivers/net/nfp/nfpcore/nfp_target.h | 22 ++++++++++++++++++++++
9 files changed, 31 insertions(+), 26 deletions(-)
@@ -6,21 +6,6 @@
#ifndef __NFP_NFP6000_H__
#define __NFP_NFP6000_H__
-/* CPP Target IDs */
-#define NFP_CPP_TARGET_INVALID 0
-#define NFP_CPP_TARGET_NBI 1
-#define NFP_CPP_TARGET_QDR 2
-#define NFP_CPP_TARGET_ILA 6
-#define NFP_CPP_TARGET_MU 7
-#define NFP_CPP_TARGET_PCIE 9
-#define NFP_CPP_TARGET_ARM 10
-#define NFP_CPP_TARGET_CRYPTO 12
-#define NFP_CPP_TARGET_ISLAND_XPB 14 /* Shared with CAP */
-#define NFP_CPP_TARGET_ISLAND_CAP 14 /* Shared with XPB */
-#define NFP_CPP_TARGET_CT_XPB 14
-#define NFP_CPP_TARGET_LOCAL_SCRATCH 15
-#define NFP_CPP_TARGET_CLS NFP_CPP_TARGET_LOCAL_SCRATCH
-
#define NFP_ISL_EMEM0 24
#define NFP_MU_ADDR_ACCESS_TYPE_MASK 3ULL
@@ -52,9 +37,4 @@ nfp_cppat_mu_locality_lsb(int mode, int addr40)
}
}
-int nfp_target_pushpull(uint32_t cpp_id, uint64_t address);
-int nfp_target_cpp(uint32_t cpp_island_id, uint64_t cpp_island_address,
- uint32_t *cpp_target_id, uint64_t *cpp_target_address,
- const uint32_t *imb_table);
-
#endif /* NFP_NFP6000_H */
@@ -34,6 +34,7 @@
#include "nfp_cpp.h"
#include "nfp_logs.h"
+#include "nfp_target.h"
#include "nfp6000/nfp6000.h"
#include "../nfp_logs.h"
@@ -16,6 +16,7 @@
#include "nfp_cpp.h"
#include "nfp_logs.h"
+#include "nfp_target.h"
#include "nfp6000/nfp6000.h"
#include "nfp6000/nfp_xpb.h"
#include "nfp_nffw.h"
@@ -9,7 +9,7 @@
#include "nfp_cpp.h"
#include "nfp_logs.h"
-#include "nfp6000/nfp6000.h"
+#include "nfp_target.h"
#define MUTEX_LOCKED(interface) ((((uint32_t)(interface)) << 16) | 0x000f)
#define MUTEX_UNLOCK(interface) (0 | 0x0000)
@@ -9,7 +9,6 @@
#include "nfp_cpp.h"
#include "nfp_logs.h"
#include "nfp_nsp.h"
-#include "nfp6000/nfp6000.h"
#define NSP_ETH_NBI_PORT_COUNT 24
#define NSP_ETH_MAX_COUNT (2 * NSP_ETH_NBI_PORT_COUNT)
@@ -7,7 +7,7 @@
#include "nfp_crc.h"
#include "nfp_logs.h"
-#include "nfp6000/nfp6000.h"
+#include "nfp_target.h"
#define NFP_RESOURCE_TBL_TARGET NFP_CPP_TARGET_MU
#define NFP_RESOURCE_TBL_BASE 0x8100000000ULL
@@ -14,6 +14,7 @@
#include "nfp_logs.h"
#include "nfp_mip.h"
+#include "nfp_target.h"
#include "nfp6000/nfp6000.h"
enum nfp_rtsym_type {
@@ -3,6 +3,8 @@
* All rights reserved.
*/
+#include "nfp_target.h"
+
#include "nfp_cpp.h"
#include "nfp6000/nfp6000.h"
@@ -315,8 +317,7 @@ nfp6000_mu(uint32_t cpp_id,
} else if (island == 1 ||
(island >= 4 && island <= 7) ||
(island >= 12 && island <= 13) ||
- (island >= 32 && island <= 47) ||
- (island >= 48 && island <= 51)) {
+ (island >= 32 && island <= 51)) {
pp = nfp6000_mu_ctm(cpp_id);
} else {
pp = -EINVAL;
@@ -510,7 +511,7 @@ nfp_target_pushpull(uint32_t cpp_id,
return nfp6000_cap_xpb(cpp_id);
case NFP_CPP_TARGET_CLS:
return nfp6000_cls(cpp_id);
- case 0:
+ case NFP_CPP_TARGET_INVALID:
return target_rw(cpp_id, P32, 4, 4);
default:
return -EINVAL;
@@ -6,4 +6,26 @@
#ifndef __NFP_TARGET_H__
#define __NFP_TARGET_H__
+#include <stdint.h>
+
+/* CPP Target IDs */
+#define NFP_CPP_TARGET_INVALID 0
+#define NFP_CPP_TARGET_NBI 1
+#define NFP_CPP_TARGET_QDR 2
+#define NFP_CPP_TARGET_ILA 6
+#define NFP_CPP_TARGET_MU 7
+#define NFP_CPP_TARGET_PCIE 9
+#define NFP_CPP_TARGET_ARM 10
+#define NFP_CPP_TARGET_CRYPTO 12
+#define NFP_CPP_TARGET_ISLAND_XPB 14 /* Shared with CAP */
+#define NFP_CPP_TARGET_ISLAND_CAP 14 /* Shared with XPB */
+#define NFP_CPP_TARGET_CT_XPB 14
+#define NFP_CPP_TARGET_LOCAL_SCRATCH 15
+#define NFP_CPP_TARGET_CLS NFP_CPP_TARGET_LOCAL_SCRATCH
+
+int nfp_target_pushpull(uint32_t cpp_id, uint64_t address);
+int nfp_target_cpp(uint32_t cpp_island_id, uint64_t cpp_island_address,
+ uint32_t *cpp_target_id, uint64_t *cpp_target_address,
+ const uint32_t *imb_table);
+
#endif /* __NFP_TARGET_H__ */