forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.h
....@@ -1,35 +1,5 @@
1
-/*
2
- * Copyright (C) 2015-2017 Netronome Systems, Inc.
3
- *
4
- * This software is dual licensed under the GNU General License Version 2,
5
- * June 1991 as shown in the file COPYING in the top-level directory of this
6
- * source tree or the BSD 2-Clause License provided below. You have the
7
- * option to license this software under the complete terms of either license.
8
- *
9
- * The BSD 2-Clause License:
10
- *
11
- * Redistribution and use in source and binary forms, with or
12
- * without modification, are permitted provided that the following
13
- * conditions are met:
14
- *
15
- * 1. Redistributions of source code must retain the above
16
- * copyright notice, this list of conditions and the following
17
- * disclaimer.
18
- *
19
- * 2. Redistributions in binary form must reproduce the above
20
- * copyright notice, this list of conditions and the following
21
- * disclaimer in the documentation and/or other materials
22
- * provided with the distribution.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
- * SOFTWARE.
32
- */
1
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2
+/* Copyright (C) 2015-2018 Netronome Systems, Inc. */
333
344 /*
355 * nfp_nffw.h
....@@ -61,10 +31,12 @@
6131
6232 /* Implemented in nfp_rtsym.c */
6333
64
-#define NFP_RTSYM_TYPE_NONE 0
65
-#define NFP_RTSYM_TYPE_OBJECT 1
66
-#define NFP_RTSYM_TYPE_FUNCTION 2
67
-#define NFP_RTSYM_TYPE_ABS 3
34
+enum nfp_rtsym_type {
35
+ NFP_RTSYM_TYPE_NONE = 0,
36
+ NFP_RTSYM_TYPE_OBJECT = 1,
37
+ NFP_RTSYM_TYPE_FUNCTION = 2,
38
+ NFP_RTSYM_TYPE_ABS = 3,
39
+};
6840
6941 #define NFP_RTSYM_TARGET_NONE 0
7042 #define NFP_RTSYM_TARGET_LMEM -1
....@@ -83,7 +55,7 @@
8355 const char *name;
8456 u64 addr;
8557 u64 size;
86
- int type;
58
+ enum nfp_rtsym_type type;
8759 int target;
8860 int domain;
8961 };
....@@ -98,6 +70,32 @@
9870 const struct nfp_rtsym *
9971 nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name);
10072
73
+u64 nfp_rtsym_size(const struct nfp_rtsym *rtsym);
74
+int __nfp_rtsym_read(struct nfp_cpp *cpp, const struct nfp_rtsym *sym,
75
+ u8 action, u8 token, u64 off, void *buf, size_t len);
76
+int nfp_rtsym_read(struct nfp_cpp *cpp, const struct nfp_rtsym *sym, u64 off,
77
+ void *buf, size_t len);
78
+int __nfp_rtsym_readl(struct nfp_cpp *cpp, const struct nfp_rtsym *sym,
79
+ u8 action, u8 token, u64 off, u32 *value);
80
+int nfp_rtsym_readl(struct nfp_cpp *cpp, const struct nfp_rtsym *sym, u64 off,
81
+ u32 *value);
82
+int __nfp_rtsym_readq(struct nfp_cpp *cpp, const struct nfp_rtsym *sym,
83
+ u8 action, u8 token, u64 off, u64 *value);
84
+int nfp_rtsym_readq(struct nfp_cpp *cpp, const struct nfp_rtsym *sym, u64 off,
85
+ u64 *value);
86
+int __nfp_rtsym_write(struct nfp_cpp *cpp, const struct nfp_rtsym *sym,
87
+ u8 action, u8 token, u64 off, void *buf, size_t len);
88
+int nfp_rtsym_write(struct nfp_cpp *cpp, const struct nfp_rtsym *sym, u64 off,
89
+ void *buf, size_t len);
90
+int __nfp_rtsym_writel(struct nfp_cpp *cpp, const struct nfp_rtsym *sym,
91
+ u8 action, u8 token, u64 off, u32 value);
92
+int nfp_rtsym_writel(struct nfp_cpp *cpp, const struct nfp_rtsym *sym, u64 off,
93
+ u32 value);
94
+int __nfp_rtsym_writeq(struct nfp_cpp *cpp, const struct nfp_rtsym *sym,
95
+ u8 action, u8 token, u64 off, u64 value);
96
+int nfp_rtsym_writeq(struct nfp_cpp *cpp, const struct nfp_rtsym *sym, u64 off,
97
+ u64 value);
98
+
10199 u64 nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name,
102100 int *error);
103101 int nfp_rtsym_write_le(struct nfp_rtsym_table *rtbl, const char *name,