| .. | .. |
|---|
| 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. */ |
|---|
| 33 | 3 | |
|---|
| 34 | 4 | /* |
|---|
| 35 | 5 | * nfp_nffw.h |
|---|
| .. | .. |
|---|
| 61 | 31 | |
|---|
| 62 | 32 | /* Implemented in nfp_rtsym.c */ |
|---|
| 63 | 33 | |
|---|
| 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 | +}; |
|---|
| 68 | 40 | |
|---|
| 69 | 41 | #define NFP_RTSYM_TARGET_NONE 0 |
|---|
| 70 | 42 | #define NFP_RTSYM_TARGET_LMEM -1 |
|---|
| .. | .. |
|---|
| 83 | 55 | const char *name; |
|---|
| 84 | 56 | u64 addr; |
|---|
| 85 | 57 | u64 size; |
|---|
| 86 | | - int type; |
|---|
| 58 | + enum nfp_rtsym_type type; |
|---|
| 87 | 59 | int target; |
|---|
| 88 | 60 | int domain; |
|---|
| 89 | 61 | }; |
|---|
| .. | .. |
|---|
| 98 | 70 | const struct nfp_rtsym * |
|---|
| 99 | 71 | nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name); |
|---|
| 100 | 72 | |
|---|
| 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 | + |
|---|
| 101 | 99 | u64 nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, |
|---|
| 102 | 100 | int *error); |
|---|
| 103 | 101 | int nfp_rtsym_write_le(struct nfp_rtsym_table *rtbl, const char *name, |
|---|