// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) /* Copyright (C) 2015-2017 Netronome Systems, Inc. */ /* * nfp_mip.c * Authors: Jakub Kicinski <[email protected]> * Jason McMullan <[email protected]> * Espen Skoglund <[email protected]> */ #include <linux/kernel.h> #include <linux/slab.h> #include "nfp.h" #include "nfp_cpp.h" #include "nfp_nffw.h" #define NFP_MIP_SIGNATURE … #define NFP_MIP_VERSION … #define NFP_MIP_MAX_OFFSET … struct nfp_mip { … }; /* Read memory and check if it could be a valid MIP */ static int nfp_mip_try_read(struct nfp_cpp *cpp, u32 cpp_id, u64 addr, struct nfp_mip *mip) { … } /* Try to locate MIP using the resource table */ static int nfp_mip_read_resource(struct nfp_cpp *cpp, struct nfp_mip *mip) { … } /** * nfp_mip_open() - Get device MIP structure * @cpp: NFP CPP Handle * * Copy MIP structure from NFP device and return it. The returned * structure is handled internally by the library and should be * freed by calling nfp_mip_close(). * * Return: pointer to mip, NULL on failure. */ const struct nfp_mip *nfp_mip_open(struct nfp_cpp *cpp) { … } void nfp_mip_close(const struct nfp_mip *mip) { … } const char *nfp_mip_name(const struct nfp_mip *mip) { … } /** * nfp_mip_symtab() - Get the address and size of the MIP symbol table * @mip: MIP handle * @addr: Location for NFP DDR address of MIP symbol table * @size: Location for size of MIP symbol table */ void nfp_mip_symtab(const struct nfp_mip *mip, u32 *addr, u32 *size) { … } /** * nfp_mip_strtab() - Get the address and size of the MIP symbol name table * @mip: MIP handle * @addr: Location for NFP DDR address of MIP symbol name table * @size: Location for size of MIP symbol name table */ void nfp_mip_strtab(const struct nfp_mip *mip, u32 *addr, u32 *size) { … }