diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2017-06-08 20:56:13 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-09 12:52:08 -0400 |
commit | 0be40e66e72a544e2d4a5bca9328463ebf2c55df (patch) | |
tree | 13d2e602f834290655f835198676995ca9fbd129 /drivers/net/ethernet/netronome/nfp/nfpcore | |
parent | 9baa48859bd31f06b9170e86afd92585ff0bbb1f (diff) | |
download | lwn-0be40e66e72a544e2d4a5bca9328463ebf2c55df.tar.gz lwn-0be40e66e72a544e2d4a5bca9328463ebf2c55df.zip |
nfp: keep MIP object around
Microcode Information Page contains some useful information, like
application firmware build name. Keep it around, similar to RTSym
and HWInfo.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfpcore')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.h index f845cf5dd762..c7266baec0eb 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.h +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.h @@ -90,6 +90,8 @@ struct nfp_rtsym { struct nfp_rtsym_table; struct nfp_rtsym_table *nfp_rtsym_table_read(struct nfp_cpp *cpp); +struct nfp_rtsym_table * +__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip); int nfp_rtsym_count(struct nfp_rtsym_table *rtbl); const struct nfp_rtsym *nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx); const struct nfp_rtsym * diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c index ef3566163cb0..203f9cbae0fb 100644 --- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c +++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_rtsym.c @@ -109,21 +109,31 @@ nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache, u32 strtab_size, struct nfp_rtsym_table *nfp_rtsym_table_read(struct nfp_cpp *cpp) { + struct nfp_rtsym_table *rtbl; + const struct nfp_mip *mip; + + mip = nfp_mip_open(cpp); + rtbl = __nfp_rtsym_table_read(cpp, mip); + nfp_mip_close(mip); + + return rtbl; +} + +struct nfp_rtsym_table * +__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip) +{ const u32 dram = NFP_CPP_ID(NFP_CPP_TARGET_MU, NFP_CPP_ACTION_RW, 0) | NFP_ISL_EMEM0; u32 strtab_addr, symtab_addr, strtab_size, symtab_size; struct nfp_rtsym_entry *rtsymtab; struct nfp_rtsym_table *cache; - const struct nfp_mip *mip; int err, n, size; - mip = nfp_mip_open(cpp); if (!mip) return NULL; nfp_mip_strtab(mip, &strtab_addr, &strtab_size); nfp_mip_symtab(mip, &symtab_addr, &symtab_size); - nfp_mip_close(mip); if (!symtab_size || !strtab_size || symtab_size % sizeof(*rtsymtab)) return NULL; |