1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Netronome Systems, Inc.
9 #include "nfp-common/nfp_platform.h"
13 * Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
14 * Lower IDs are reserved for target and loader IDs.
16 #define NFFW_FWID_EXT 3 /* For active MEs that we didn't load. */
17 #define NFFW_FWID_BASE 4
19 #define NFFW_FWID_ALL 255
21 /* Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
22 * Lower IDs are reserved for target and loader IDs.
24 #define NFFW_FWID_EXT 3 /* For active MEs that we didn't load. */
25 #define NFFW_FWID_BASE 4
27 #define NFFW_FWID_ALL 255
30 * NFFW_INFO_VERSION history:
31 * 0: This was never actually used (before versioning), but it refers to
32 * the previous struct which had FWINFO_CNT = MEINFO_CNT = 120 that later
34 * 1: First versioned struct, with
40 #define NFFW_INFO_VERSION_CURRENT 2
42 /* Enough for all current chip families */
43 #define NFFW_MEINFO_CNT_V1 120
44 #define NFFW_FWINFO_CNT_V1 120
45 #define NFFW_MEINFO_CNT_V2 200
46 #define NFFW_FWINFO_CNT_V2 200
49 uint32_t ctxmask__fwid__meid;
53 uint32_t loaded__mu_da__mip_off_hi;
54 uint32_t mip_cppid; /* 0 means no MIP */
55 uint32_t mip_offset_lo;
58 struct nfp_nffw_info_v1 {
59 struct nffw_meinfo meinfo[NFFW_MEINFO_CNT_V1];
60 struct nffw_fwinfo fwinfo[NFFW_FWINFO_CNT_V1];
63 struct nfp_nffw_info_v2 {
64 struct nffw_meinfo meinfo[NFFW_MEINFO_CNT_V2];
65 struct nffw_fwinfo fwinfo[NFFW_FWINFO_CNT_V2];
68 struct nfp_nffw_info_data {
71 struct nfp_nffw_info_v1 v1;
72 struct nfp_nffw_info_v2 v2;
76 struct nfp_nffw_info {
78 struct nfp_resource *res;
80 struct nfp_nffw_info_data fwinf;
83 struct nfp_nffw_info *nfp_nffw_info_open(struct nfp_cpp *cpp);
84 void nfp_nffw_info_close(struct nfp_nffw_info *state);