2 * Copyright (C) 2015-2017 Netronome Systems, Inc.
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.
9 * The BSD 2-Clause License:
11 * Redistribution and use in source and binary forms, with or
12 * without modification, are permitted provided that the following
15 * 1. Redistributions of source code must retain the above
16 * copyright notice, this list of conditions and the following
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.
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
36 * Authors: Jason McMullan <jason.mcmullan@netronome.com>
37 * Francois H. Theron <francois.theron@netronome.com>
43 /* Implemented in nfp_nffw.c */
47 struct nfp_nffw_info *nfp_nffw_info_open(struct nfp_cpp *cpp);
48 void nfp_nffw_info_close(struct nfp_nffw_info *state);
49 int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, u32 *cpp_id, u64 *off);
51 /* Implemented in nfp_mip.c */
55 const struct nfp_mip *nfp_mip_open(struct nfp_cpp *cpp);
56 void nfp_mip_close(const struct nfp_mip *mip);
58 const char *nfp_mip_name(const struct nfp_mip *mip);
59 void nfp_mip_symtab(const struct nfp_mip *mip, u32 *addr, u32 *size);
60 void nfp_mip_strtab(const struct nfp_mip *mip, u32 *addr, u32 *size);
62 /* Implemented in nfp_rtsym.c */
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
69 #define NFP_RTSYM_TARGET_NONE 0
70 #define NFP_RTSYM_TARGET_LMEM -1
71 #define NFP_RTSYM_TARGET_EMU_CACHE -7
74 * struct nfp_rtsym - RTSYM descriptor
76 * @addr: Address in the domain/target's address space
77 * @size: Size (in bytes) of the symbol
78 * @type: NFP_RTSYM_TYPE_* of the symbol
79 * @target: CPP Target identifier, or NFP_RTSYM_TARGET_*
80 * @domain: CPP Target Domain (island)
91 struct nfp_rtsym_table;
93 struct nfp_rtsym_table *nfp_rtsym_table_read(struct nfp_cpp *cpp);
94 struct nfp_rtsym_table *
95 __nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip);
96 int nfp_rtsym_count(struct nfp_rtsym_table *rtbl);
97 const struct nfp_rtsym *nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx);
98 const struct nfp_rtsym *
99 nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name);
101 u64 nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name,
104 nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name, const char *id,
105 unsigned int min_size, struct nfp_cpp_area **area);
107 #endif /* NFP_NFFW_H */