Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __NITROX_CSR_H
0003 #define __NITROX_CSR_H
0004 
0005 #include <asm/byteorder.h>
0006 #include <linux/types.h>
0007 
0008 /* EMU clusters */
0009 #define NR_CLUSTERS     4
0010 /* Maximum cores per cluster,
0011  * varies based on partname
0012  */
0013 #define AE_CORES_PER_CLUSTER    20
0014 #define SE_CORES_PER_CLUSTER    16
0015 
0016 #define AE_MAX_CORES    (AE_CORES_PER_CLUSTER * NR_CLUSTERS)
0017 #define SE_MAX_CORES    (SE_CORES_PER_CLUSTER * NR_CLUSTERS)
0018 #define ZIP_MAX_CORES   5
0019 
0020 /* BIST registers */
0021 #define EMU_BIST_STATUSX(_i)    (0x1402700 + ((_i) * 0x40000))
0022 #define UCD_BIST_STATUS     0x12C0070
0023 #define NPS_CORE_BIST_REG   0x10000E8
0024 #define NPS_CORE_NPC_BIST_REG   0x1000128
0025 #define NPS_PKT_SLC_BIST_REG    0x1040088
0026 #define NPS_PKT_IN_BIST_REG 0x1040100
0027 #define POM_BIST_REG        0x11C0100
0028 #define BMI_BIST_REG        0x1140080
0029 #define EFL_CORE_BIST_REGX(_i)  (0x1240100 + ((_i) * 0x400))
0030 #define EFL_TOP_BIST_STAT   0x1241090
0031 #define BMO_BIST_REG        0x1180080
0032 #define LBC_BIST_STATUS     0x1200020
0033 #define PEM_BIST_STATUSX(_i)    (0x1080468 | ((_i) << 18))
0034 
0035 /* EMU registers */
0036 #define EMU_SE_ENABLEX(_i)  (0x1400000 + ((_i) * 0x40000))
0037 #define EMU_AE_ENABLEX(_i)  (0x1400008 + ((_i) * 0x40000))
0038 #define EMU_WD_INT_ENA_W1SX(_i) (0x1402318 + ((_i) * 0x40000))
0039 #define EMU_GE_INT_ENA_W1SX(_i) (0x1402518 + ((_i) * 0x40000))
0040 #define EMU_FUSE_MAPX(_i)   (0x1402708 + ((_i) * 0x40000))
0041 
0042 /* UCD registers */
0043 #define UCD_SE_EID_UCODE_BLOCK_NUMX(_i) (0x12C0000 + ((_i) * 0x1000))
0044 #define UCD_AE_EID_UCODE_BLOCK_NUMX(_i) (0x12C0008 + ((_i) * 0x800))
0045 #define UCD_UCODE_LOAD_BLOCK_NUM    0x12C0010
0046 #define UCD_UCODE_LOAD_IDX_DATAX(_i)    (0x12C0018 + ((_i) * 0x20))
0047 #define UCD_SE_CNTX(_i)         (0x12C0040 + ((_i) * 0x1000))
0048 #define UCD_AE_CNTX(_i)         (0x12C0048 + ((_i) * 0x800))
0049 
0050 /* AQM registers */
0051 #define AQM_CTL                         0x1300000
0052 #define AQM_INT                         0x1300008
0053 #define AQM_DBELL_OVF_LO                0x1300010
0054 #define AQM_DBELL_OVF_HI                0x1300018
0055 #define AQM_DBELL_OVF_LO_W1S            0x1300020
0056 #define AQM_DBELL_OVF_LO_ENA_W1C        0x1300028
0057 #define AQM_DBELL_OVF_LO_ENA_W1S        0x1300030
0058 #define AQM_DBELL_OVF_HI_W1S            0x1300038
0059 #define AQM_DBELL_OVF_HI_ENA_W1C        0x1300040
0060 #define AQM_DBELL_OVF_HI_ENA_W1S        0x1300048
0061 #define AQM_DMA_RD_ERR_LO               0x1300050
0062 #define AQM_DMA_RD_ERR_HI               0x1300058
0063 #define AQM_DMA_RD_ERR_LO_W1S           0x1300060
0064 #define AQM_DMA_RD_ERR_LO_ENA_W1C       0x1300068
0065 #define AQM_DMA_RD_ERR_LO_ENA_W1S       0x1300070
0066 #define AQM_DMA_RD_ERR_HI_W1S           0x1300078
0067 #define AQM_DMA_RD_ERR_HI_ENA_W1C       0x1300080
0068 #define AQM_DMA_RD_ERR_HI_ENA_W1S       0x1300088
0069 #define AQM_EXEC_NA_LO                  0x1300090
0070 #define AQM_EXEC_NA_HI                  0x1300098
0071 #define AQM_EXEC_NA_LO_W1S              0x13000A0
0072 #define AQM_EXEC_NA_LO_ENA_W1C          0x13000A8
0073 #define AQM_EXEC_NA_LO_ENA_W1S          0x13000B0
0074 #define AQM_EXEC_NA_HI_W1S              0x13000B8
0075 #define AQM_EXEC_NA_HI_ENA_W1C          0x13000C0
0076 #define AQM_EXEC_NA_HI_ENA_W1S          0x13000C8
0077 #define AQM_EXEC_ERR_LO                 0x13000D0
0078 #define AQM_EXEC_ERR_HI                 0x13000D8
0079 #define AQM_EXEC_ERR_LO_W1S             0x13000E0
0080 #define AQM_EXEC_ERR_LO_ENA_W1C         0x13000E8
0081 #define AQM_EXEC_ERR_LO_ENA_W1S         0x13000F0
0082 #define AQM_EXEC_ERR_HI_W1S             0x13000F8
0083 #define AQM_EXEC_ERR_HI_ENA_W1C         0x1300100
0084 #define AQM_EXEC_ERR_HI_ENA_W1S         0x1300108
0085 #define AQM_ECC_INT                     0x1300110
0086 #define AQM_ECC_INT_W1S                 0x1300118
0087 #define AQM_ECC_INT_ENA_W1C             0x1300120
0088 #define AQM_ECC_INT_ENA_W1S             0x1300128
0089 #define AQM_ECC_CTL                     0x1300130
0090 #define AQM_BIST_STATUS                 0x1300138
0091 #define AQM_CMD_INF_THRX(x)             (0x1300400 + ((x) * 0x8))
0092 #define AQM_CMD_INFX(x)                 (0x1300800 + ((x) * 0x8))
0093 #define AQM_GRP_EXECMSK_LOX(x)          (0x1300C00 + ((x) * 0x10))
0094 #define AQM_GRP_EXECMSK_HIX(x)          (0x1300C08 + ((x) * 0x10))
0095 #define AQM_ACTIVITY_STAT_LO            0x1300C80
0096 #define AQM_ACTIVITY_STAT_HI            0x1300C88
0097 #define AQM_Q_CMD_PROCX(x)              (0x1301000 + ((x) * 0x8))
0098 #define AQM_PERF_CTL_LO                 0x1301400
0099 #define AQM_PERF_CTL_HI                 0x1301408
0100 #define AQM_PERF_CNT                    0x1301410
0101 
0102 #define AQMQ_DRBLX(x)                   (0x20000 + ((x) * 0x40000))
0103 #define AQMQ_QSZX(x)                    (0x20008 + ((x) * 0x40000))
0104 #define AQMQ_BADRX(x)                   (0x20010 + ((x) * 0x40000))
0105 #define AQMQ_NXT_CMDX(x)                (0x20018 + ((x) * 0x40000))
0106 #define AQMQ_CMD_CNTX(x)                (0x20020 + ((x) * 0x40000))
0107 #define AQMQ_CMP_THRX(x)                (0x20028 + ((x) * 0x40000))
0108 #define AQMQ_CMP_CNTX(x)                (0x20030 + ((x) * 0x40000))
0109 #define AQMQ_TIM_LDX(x)                 (0x20038 + ((x) * 0x40000))
0110 #define AQMQ_TIMERX(x)                  (0x20040 + ((x) * 0x40000))
0111 #define AQMQ_ENX(x)                     (0x20048 + ((x) * 0x40000))
0112 #define AQMQ_ACTIVITY_STATX(x)          (0x20050 + ((x) * 0x40000))
0113 #define AQM_VF_CMP_STATX(x)             (0x28000 + ((x) * 0x40000))
0114 
0115 /* NPS core registers */
0116 #define NPS_CORE_GBL_VFCFG  0x1000000
0117 #define NPS_CORE_CONTROL    0x1000008
0118 #define NPS_CORE_INT_ACTIVE 0x1000080
0119 #define NPS_CORE_INT        0x10000A0
0120 #define NPS_CORE_INT_ENA_W1S    0x10000B8
0121 #define NPS_STATS_PKT_DMA_RD_CNT    0x1000180
0122 #define NPS_STATS_PKT_DMA_WR_CNT    0x1000190
0123 
0124 /* NPS packet registers */
0125 #define NPS_PKT_INT         0x1040018
0126 #define NPS_PKT_MBOX_INT_LO     0x1040020
0127 #define NPS_PKT_MBOX_INT_LO_ENA_W1C 0x1040030
0128 #define NPS_PKT_MBOX_INT_LO_ENA_W1S 0x1040038
0129 #define NPS_PKT_MBOX_INT_HI     0x1040040
0130 #define NPS_PKT_MBOX_INT_HI_ENA_W1C 0x1040050
0131 #define NPS_PKT_MBOX_INT_HI_ENA_W1S 0x1040058
0132 #define NPS_PKT_IN_RERR_HI      0x1040108
0133 #define NPS_PKT_IN_RERR_HI_ENA_W1S  0x1040120
0134 #define NPS_PKT_IN_RERR_LO      0x1040128
0135 #define NPS_PKT_IN_RERR_LO_ENA_W1S  0x1040140
0136 #define NPS_PKT_IN_ERR_TYPE     0x1040148
0137 #define NPS_PKT_IN_ERR_TYPE_ENA_W1S 0x1040160
0138 #define NPS_PKT_IN_INSTR_CTLX(_i)   (0x10060 + ((_i) * 0x40000))
0139 #define NPS_PKT_IN_INSTR_BADDRX(_i) (0x10068 + ((_i) * 0x40000))
0140 #define NPS_PKT_IN_INSTR_RSIZEX(_i) (0x10070 + ((_i) * 0x40000))
0141 #define NPS_PKT_IN_DONE_CNTSX(_i)   (0x10080 + ((_i) * 0x40000))
0142 #define NPS_PKT_IN_INSTR_BAOFF_DBELLX(_i)   (0x10078 + ((_i) * 0x40000))
0143 #define NPS_PKT_IN_INT_LEVELSX(_i)      (0x10088 + ((_i) * 0x40000))
0144 
0145 #define NPS_PKT_SLC_RERR_HI     0x1040208
0146 #define NPS_PKT_SLC_RERR_HI_ENA_W1S 0x1040220
0147 #define NPS_PKT_SLC_RERR_LO     0x1040228
0148 #define NPS_PKT_SLC_RERR_LO_ENA_W1S 0x1040240
0149 #define NPS_PKT_SLC_ERR_TYPE        0x1040248
0150 #define NPS_PKT_SLC_ERR_TYPE_ENA_W1S    0x1040260
0151 /* Mailbox PF->VF PF Accessible Data registers */
0152 #define NPS_PKT_MBOX_PF_VF_PFDATAX(_i)  (0x1040800 + ((_i) * 0x8))
0153 #define NPS_PKT_MBOX_VF_PF_PFDATAX(_i)  (0x1040C00 + ((_i) * 0x8))
0154 
0155 #define NPS_PKT_SLC_CTLX(_i)        (0x10000 + ((_i) * 0x40000))
0156 #define NPS_PKT_SLC_CNTSX(_i)       (0x10008 + ((_i) * 0x40000))
0157 #define NPS_PKT_SLC_INT_LEVELSX(_i) (0x10010 + ((_i) * 0x40000))
0158 
0159 /* POM registers */
0160 #define POM_INT_ENA_W1S     0x11C0018
0161 #define POM_GRP_EXECMASKX(_i)   (0x11C1100 | ((_i) * 8))
0162 #define POM_INT     0x11C0000
0163 #define POM_PERF_CTL    0x11CC400
0164 
0165 /* BMI registers */
0166 #define BMI_INT     0x1140000
0167 #define BMI_CTL     0x1140020
0168 #define BMI_INT_ENA_W1S 0x1140018
0169 #define BMI_NPS_PKT_CNT 0x1140070
0170 
0171 /* EFL registers */
0172 #define EFL_CORE_INT_ENA_W1SX(_i)       (0x1240018 + ((_i) * 0x400))
0173 #define EFL_CORE_VF_ERR_INT0X(_i)       (0x1240050 + ((_i) * 0x400))
0174 #define EFL_CORE_VF_ERR_INT0_ENA_W1SX(_i)   (0x1240068 + ((_i) * 0x400))
0175 #define EFL_CORE_VF_ERR_INT1X(_i)       (0x1240070 + ((_i) * 0x400))
0176 #define EFL_CORE_VF_ERR_INT1_ENA_W1SX(_i)   (0x1240088 + ((_i) * 0x400))
0177 #define EFL_CORE_SE_ERR_INTX(_i)        (0x12400A0 + ((_i) * 0x400))
0178 #define EFL_RNM_CTL_STATUS          0x1241800
0179 #define EFL_CORE_INTX(_i)           (0x1240000 + ((_i) * 0x400))
0180 
0181 /* BMO registers */
0182 #define BMO_CTL2        0x1180028
0183 #define BMO_NPS_SLC_PKT_CNT 0x1180078
0184 
0185 /* LBC registers */
0186 #define LBC_INT         0x1200000
0187 #define LBC_INVAL_CTL       0x1201010
0188 #define LBC_PLM_VF1_64_INT  0x1202008
0189 #define LBC_INVAL_STATUS    0x1202010
0190 #define LBC_INT_ENA_W1S     0x1203000
0191 #define LBC_PLM_VF1_64_INT_ENA_W1S  0x1205008
0192 #define LBC_PLM_VF65_128_INT        0x1206008
0193 #define LBC_ELM_VF1_64_INT      0x1208000
0194 #define LBC_PLM_VF65_128_INT_ENA_W1S    0x1209008
0195 #define LBC_ELM_VF1_64_INT_ENA_W1S  0x120B000
0196 #define LBC_ELM_VF65_128_INT        0x120C000
0197 #define LBC_ELM_VF65_128_INT_ENA_W1S    0x120F000
0198 
0199 #define RST_BOOT    0x10C1600
0200 #define FUS_DAT1    0x10C1408
0201 
0202 /* PEM registers */
0203 #define PEM0_INT 0x1080428
0204 
0205 /**
0206  * struct ucd_core_eid_ucode_block_num - Core Eid to Ucode Blk Mapping Registers
0207  * @ucode_len: Ucode length identifier 32KB or 64KB
0208  * @ucode_blk: Ucode Block Number
0209  */
0210 union ucd_core_eid_ucode_block_num {
0211     u64 value;
0212     struct {
0213 #if (defined(__BIG_ENDIAN_BITFIELD))
0214         u64 raz_4_63 : 60;
0215         u64 ucode_len : 1;
0216         u64 ucode_blk : 3;
0217 #else
0218         u64 ucode_blk : 3;
0219         u64 ucode_len : 1;
0220         u64 raz_4_63 : 60;
0221 #endif
0222     };
0223 };
0224 
0225 /**
0226  * struct aqm_grp_execmsk_lo - Available AE engines for the group
0227  * @exec_0_to_39: AE engines 0 to 39 status
0228  */
0229 union aqm_grp_execmsk_lo {
0230     u64 value;
0231     struct {
0232 #if (defined(__BIG_ENDIAN_BITFIELD))
0233         u64 raz_40_63 : 24;
0234         u64 exec_0_to_39 : 40;
0235 #else
0236         u64 exec_0_to_39 : 40;
0237         u64 raz_40_63 : 24;
0238 #endif
0239     };
0240 };
0241 
0242 /**
0243  * struct aqm_grp_execmsk_hi - Available AE engines for the group
0244  * @exec_40_to_79: AE engines 40 to 79 status
0245  */
0246 union aqm_grp_execmsk_hi {
0247     u64 value;
0248     struct {
0249 #if (defined(__BIG_ENDIAN_BITFIELD))
0250         u64 raz_40_63 : 24;
0251         u64 exec_40_to_79 : 40;
0252 #else
0253         u64 exec_40_to_79 : 40;
0254         u64 raz_40_63 : 24;
0255 #endif
0256     };
0257 };
0258 
0259 /**
0260  * struct aqmq_drbl - AQM Queue Doorbell Counter Registers
0261  * @dbell_count: Doorbell Counter
0262  */
0263 union aqmq_drbl {
0264     u64 value;
0265     struct {
0266 #if (defined(__BIG_ENDIAN_BITFIELD))
0267         u64 raz_32_63 : 32;
0268         u64 dbell_count : 32;
0269 #else
0270         u64 dbell_count : 32;
0271         u64 raz_32_63 : 32;
0272 #endif
0273     };
0274 };
0275 
0276 /**
0277  * struct aqmq_qsz - AQM Queue Host Queue Size Registers
0278  * @host_queue_size: Size, in numbers of 'aqmq_command_s' command
0279  * of the Host Ring.
0280  */
0281 union aqmq_qsz {
0282     u64 value;
0283     struct {
0284 #if (defined(__BIG_ENDIAN_BITFIELD))
0285         u64 raz_32_63 : 32;
0286         u64 host_queue_size : 32;
0287 #else
0288         u64 host_queue_size : 32;
0289         u64 raz_32_63 : 32;
0290 #endif
0291     };
0292 };
0293 
0294 /**
0295  * struct aqmq_cmp_thr - AQM Queue Commands Completed Threshold Registers
0296  * @commands_completed_threshold: Count of 'aqmq_command_s' commands executed
0297  * by AE engines for which completion interrupt is asserted.
0298  */
0299 union aqmq_cmp_thr {
0300     u64 value;
0301     struct {
0302 #if (defined(__BIG_ENDIAN_BITFIELD))
0303         u64 raz_32_63 : 32;
0304         u64 commands_completed_threshold : 32;
0305 #else
0306         u64 commands_completed_threshold : 32;
0307         u64 raz_32_63 : 32;
0308 #endif
0309     };
0310 };
0311 
0312 /**
0313  * struct aqmq_cmp_cnt - AQM Queue Commands Completed Count Registers
0314  * @resend: Bit to request completion interrupt Resend.
0315  * @completion_status: Command completion status of the ring.
0316  * @commands_completed_count: Count of 'aqmq_command_s' commands executed by
0317  * AE engines.
0318  */
0319 union aqmq_cmp_cnt {
0320     u64 value;
0321     struct {
0322 #if (defined(__BIG_ENDIAN_BITFIELD))
0323         u64 raz_34_63 : 30;
0324         u64 resend : 1;
0325         u64 completion_status : 1;
0326         u64 commands_completed_count : 32;
0327 #else
0328         u64 commands_completed_count : 32;
0329         u64 completion_status : 1;
0330         u64 resend : 1;
0331         u64 raz_34_63 : 30;
0332 #endif
0333     };
0334 };
0335 
0336 /**
0337  * struct aqmq_en - AQM Queue Enable Registers
0338  * @queue_status: 1 = AQMQ is enabled, 0 = AQMQ is disabled
0339  */
0340 union aqmq_en {
0341     u64 value;
0342     struct {
0343 #if (defined(__BIG_ENDIAN_BITFIELD))
0344         u64 raz_1_63 : 63;
0345         u64 queue_enable : 1;
0346 #else
0347         u64 queue_enable : 1;
0348         u64 raz_1_63 : 63;
0349 #endif
0350     };
0351 };
0352 
0353 /**
0354  * struct aqmq_activity_stat - AQM Queue Activity Status Registers
0355  * @queue_active: 1 = AQMQ is active, 0 = AQMQ is quiescent
0356  */
0357 union aqmq_activity_stat {
0358     u64 value;
0359     struct {
0360 #if (defined(__BIG_ENDIAN_BITFIELD))
0361         u64 raz_1_63 : 63;
0362         u64 queue_active : 1;
0363 #else
0364         u64 queue_active : 1;
0365         u64 raz_1_63 : 63;
0366 #endif
0367     };
0368 };
0369 
0370 /**
0371  * struct emu_fuse_map - EMU Fuse Map Registers
0372  * @ae_fuse: Fuse settings for AE 19..0
0373  * @se_fuse: Fuse settings for SE 15..0
0374  *
0375  * A set bit indicates the unit is fuse disabled.
0376  */
0377 union emu_fuse_map {
0378     u64 value;
0379     struct {
0380 #if (defined(__BIG_ENDIAN_BITFIELD))
0381         u64 valid : 1;
0382         u64 raz_52_62 : 11;
0383         u64 ae_fuse : 20;
0384         u64 raz_16_31 : 16;
0385         u64 se_fuse : 16;
0386 #else
0387         u64 se_fuse : 16;
0388         u64 raz_16_31 : 16;
0389         u64 ae_fuse : 20;
0390         u64 raz_52_62 : 11;
0391         u64 valid : 1;
0392 #endif
0393     } s;
0394 };
0395 
0396 /**
0397  * struct emu_se_enable - Symmetric Engine Enable Registers
0398  * @enable: Individual enables for each of the clusters
0399  *   16 symmetric engines.
0400  */
0401 union emu_se_enable {
0402     u64 value;
0403     struct {
0404 #if (defined(__BIG_ENDIAN_BITFIELD))
0405         u64 raz : 48;
0406         u64 enable : 16;
0407 #else
0408         u64 enable : 16;
0409         u64 raz : 48;
0410 #endif
0411     } s;
0412 };
0413 
0414 /**
0415  * struct emu_ae_enable - EMU Asymmetric engines.
0416  * @enable: Individual enables for each of the cluster's
0417  *   20 Asymmetric Engines.
0418  */
0419 union emu_ae_enable {
0420     u64 value;
0421     struct {
0422 #if (defined(__BIG_ENDIAN_BITFIELD))
0423         u64 raz : 44;
0424         u64 enable : 20;
0425 #else
0426         u64 enable : 20;
0427         u64 raz : 44;
0428 #endif
0429     } s;
0430 };
0431 
0432 /**
0433  * struct emu_wd_int_ena_w1s - EMU Interrupt Enable Registers
0434  * @ae_wd: Reads or sets enable for EMU(0..3)_WD_INT[AE_WD]
0435  * @se_wd: Reads or sets enable for EMU(0..3)_WD_INT[SE_WD]
0436  */
0437 union emu_wd_int_ena_w1s {
0438     u64 value;
0439     struct {
0440 #if (defined(__BIG_ENDIAN_BITFIELD))
0441         u64 raz2 : 12;
0442         u64 ae_wd : 20;
0443         u64 raz1 : 16;
0444         u64 se_wd : 16;
0445 #else
0446         u64 se_wd : 16;
0447         u64 raz1 : 16;
0448         u64 ae_wd : 20;
0449         u64 raz2 : 12;
0450 #endif
0451     } s;
0452 };
0453 
0454 /**
0455  * struct emu_ge_int_ena_w1s - EMU Interrupt Enable set registers
0456  * @ae_ge: Reads or sets enable for EMU(0..3)_GE_INT[AE_GE]
0457  * @se_ge: Reads or sets enable for EMU(0..3)_GE_INT[SE_GE]
0458  */
0459 union emu_ge_int_ena_w1s {
0460     u64 value;
0461     struct {
0462 #if (defined(__BIG_ENDIAN_BITFIELD))
0463         u64 raz_52_63 : 12;
0464         u64 ae_ge : 20;
0465         u64 raz_16_31: 16;
0466         u64 se_ge : 16;
0467 #else
0468         u64 se_ge : 16;
0469         u64 raz_16_31: 16;
0470         u64 ae_ge : 20;
0471         u64 raz_52_63 : 12;
0472 #endif
0473     } s;
0474 };
0475 
0476 /**
0477  * struct nps_pkt_slc_ctl - Solicited Packet Out Control Registers
0478  * @rh: Indicates whether to remove or include the response header
0479  *   1 = Include, 0 = Remove
0480  * @z: If set, 8 trailing 0x00 bytes will be added to the end of the
0481  *   outgoing packet.
0482  * @enb: Enable for this port.
0483  */
0484 union nps_pkt_slc_ctl {
0485     u64 value;
0486     struct {
0487 #if defined(__BIG_ENDIAN_BITFIELD)
0488         u64 raz : 61;
0489         u64 rh : 1;
0490         u64 z : 1;
0491         u64 enb : 1;
0492 #else
0493         u64 enb : 1;
0494         u64 z : 1;
0495         u64 rh : 1;
0496         u64 raz : 61;
0497 #endif
0498     } s;
0499 };
0500 
0501 /**
0502  * struct nps_pkt_slc_cnts - Solicited Packet Out Count Registers
0503  * @slc_int: Returns a 1 when:
0504  *   NPS_PKT_SLC(i)_CNTS[CNT] > NPS_PKT_SLC(i)_INT_LEVELS[CNT], or
0505  *   NPS_PKT_SLC(i)_CNTS[TIMER] > NPS_PKT_SLC(i)_INT_LEVELS[TIMET].
0506  *   To clear the bit, the CNTS register must be written to clear.
0507  * @in_int: Returns a 1 when:
0508  *   NPS_PKT_IN(i)_DONE_CNTS[CNT] > NPS_PKT_IN(i)_INT_LEVELS[CNT].
0509  *   To clear the bit, the DONE_CNTS register must be written to clear.
0510  * @mbox_int: Returns a 1 when:
0511  *   NPS_PKT_MBOX_PF_VF(i)_INT[INTR] is set. To clear the bit,
0512  *   write NPS_PKT_MBOX_PF_VF(i)_INT[INTR] with 1.
0513  * @timer: Timer, incremented every 2048 coprocessor clock cycles
0514  *   when [CNT] is not zero. The hardware clears both [TIMER] and
0515  *   [INT] when [CNT] goes to 0.
0516  * @cnt: Packet counter. Hardware adds to [CNT] as it sends packets out.
0517  *   On a write to this CSR, hardware subtracts the amount written to the
0518  *   [CNT] field from [CNT].
0519  */
0520 union nps_pkt_slc_cnts {
0521     u64 value;
0522     struct {
0523 #if defined(__BIG_ENDIAN_BITFIELD)
0524         u64 slc_int : 1;
0525         u64 uns_int : 1;
0526         u64 in_int : 1;
0527         u64 mbox_int : 1;
0528         u64 resend : 1;
0529         u64 raz : 5;
0530         u64 timer : 22;
0531         u64 cnt : 32;
0532 #else
0533         u64 cnt : 32;
0534         u64 timer : 22;
0535         u64 raz : 5;
0536         u64 resend : 1;
0537         u64 mbox_int : 1;
0538         u64 in_int : 1;
0539         u64 uns_int : 1;
0540         u64 slc_int : 1;
0541 #endif
0542     } s;
0543 };
0544 
0545 /**
0546  * struct nps_pkt_slc_int_levels - Solicited Packet Out Interrupt Levels
0547  *   Registers.
0548  * @bmode: Determines whether NPS_PKT_SLC_CNTS[CNT] is a byte or
0549  *   packet counter.
0550  * @timet: Output port counter time interrupt threshold.
0551  * @cnt: Output port counter interrupt threshold.
0552  */
0553 union nps_pkt_slc_int_levels {
0554     u64 value;
0555     struct {
0556 #if defined(__BIG_ENDIAN_BITFIELD)
0557         u64 bmode : 1;
0558         u64 raz : 9;
0559         u64 timet : 22;
0560         u64 cnt : 32;
0561 #else
0562         u64 cnt : 32;
0563         u64 timet : 22;
0564         u64 raz : 9;
0565         u64 bmode : 1;
0566 #endif
0567     } s;
0568 };
0569 
0570 /**
0571  * struct nps_pkt_inst - NPS Packet Interrupt Register
0572  * @in_err: Set when any NPS_PKT_IN_RERR_HI/LO bit and
0573  *    corresponding NPS_PKT_IN_RERR_*_ENA_* bit are bot set.
0574  * @uns_err: Set when any NSP_PKT_UNS_RERR_HI/LO bit and
0575  *    corresponding NPS_PKT_UNS_RERR_*_ENA_* bit are both set.
0576  * @slc_er: Set when any NSP_PKT_SLC_RERR_HI/LO bit and
0577  *    corresponding NPS_PKT_SLC_RERR_*_ENA_* bit are both set.
0578  */
0579 union nps_pkt_int {
0580     u64 value;
0581     struct {
0582 #if defined(__BIG_ENDIAN_BITFIELD)
0583         u64 raz : 54;
0584         u64 uns_wto : 1;
0585         u64 in_err : 1;
0586         u64 uns_err : 1;
0587         u64 slc_err : 1;
0588         u64 in_dbe : 1;
0589         u64 in_sbe : 1;
0590         u64 uns_dbe : 1;
0591         u64 uns_sbe : 1;
0592         u64 slc_dbe : 1;
0593         u64 slc_sbe : 1;
0594 #else
0595         u64 slc_sbe : 1;
0596         u64 slc_dbe : 1;
0597         u64 uns_sbe : 1;
0598         u64 uns_dbe : 1;
0599         u64 in_sbe : 1;
0600         u64 in_dbe : 1;
0601         u64 slc_err : 1;
0602         u64 uns_err : 1;
0603         u64 in_err : 1;
0604         u64 uns_wto : 1;
0605         u64 raz : 54;
0606 #endif
0607     } s;
0608 };
0609 
0610 /**
0611  * struct nps_pkt_in_done_cnts - Input instruction ring counts registers
0612  * @slc_cnt: Returns a 1 when:
0613  *    NPS_PKT_SLC(i)_CNTS[CNT] > NPS_PKT_SLC(i)_INT_LEVELS[CNT], or
0614  *    NPS_PKT_SLC(i)_CNTS[TIMER] > NPS_PKT_SCL(i)_INT_LEVELS[TIMET]
0615  *    To clear the bit, the CNTS register must be
0616  *    written to clear the underlying condition
0617  * @uns_int: Return a 1 when:
0618  *    NPS_PKT_UNS(i)_CNTS[CNT] > NPS_PKT_UNS(i)_INT_LEVELS[CNT], or
0619  *    NPS_PKT_UNS(i)_CNTS[TIMER] > NPS_PKT_UNS(i)_INT_LEVELS[TIMET]
0620  *    To clear the bit, the CNTS register must be
0621  *    written to clear the underlying condition
0622  * @in_int: Returns a 1 when:
0623  *    NPS_PKT_IN(i)_DONE_CNTS[CNT] > NPS_PKT_IN(i)_INT_LEVELS[CNT]
0624  *    To clear the bit, the DONE_CNTS register
0625  *    must be written to clear the underlying condition
0626  * @mbox_int: Returns a 1 when:
0627  *    NPS_PKT_MBOX_PF_VF(i)_INT[INTR] is set.
0628  *    To clear the bit, write NPS_PKT_MBOX_PF_VF(i)_INT[INTR]
0629  *    with 1.
0630  * @resend: A write of 1 will resend an MSI-X interrupt message if any
0631  *    of the following conditions are true for this ring "i".
0632  *    NPS_PKT_SLC(i)_CNTS[CNT] > NPS_PKT_SLC(i)_INT_LEVELS[CNT]
0633  *    NPS_PKT_SLC(i)_CNTS[TIMER] > NPS_PKT_SLC(i)_INT_LEVELS[TIMET]
0634  *    NPS_PKT_UNS(i)_CNTS[CNT] > NPS_PKT_UNS(i)_INT_LEVELS[CNT]
0635  *    NPS_PKT_UNS(i)_CNTS[TIMER] > NPS_PKT_UNS(i)_INT_LEVELS[TIMET]
0636  *    NPS_PKT_IN(i)_DONE_CNTS[CNT] > NPS_PKT_IN(i)_INT_LEVELS[CNT]
0637  *    NPS_PKT_MBOX_PF_VF(i)_INT[INTR] is set
0638  * @cnt: Packet counter. Hardware adds to [CNT] as it reads
0639  *    packets. On a write to this CSR, hardware substracts the
0640  *    amount written to the [CNT] field from [CNT], which will
0641  *    clear PKT_IN(i)_INT_STATUS[INTR] if [CNT] becomes <=
0642  *    NPS_PKT_IN(i)_INT_LEVELS[CNT]. This register should be
0643  *    cleared before enabling a ring by reading the current
0644  *    value and writing it back.
0645  */
0646 union nps_pkt_in_done_cnts {
0647     u64 value;
0648     struct {
0649 #if defined(__BIG_ENDIAN_BITFIELD)
0650         u64 slc_int : 1;
0651         u64 uns_int : 1;
0652         u64 in_int : 1;
0653         u64 mbox_int : 1;
0654         u64 resend : 1;
0655         u64 raz : 27;
0656         u64 cnt : 32;
0657 #else
0658         u64 cnt : 32;
0659         u64 raz : 27;
0660         u64 resend : 1;
0661         u64 mbox_int : 1;
0662         u64 in_int : 1;
0663         u64 uns_int : 1;
0664         u64 slc_int : 1;
0665 #endif
0666     } s;
0667 };
0668 
0669 /**
0670  * struct nps_pkt_in_instr_ctl - Input Instruction Ring Control Registers.
0671  * @is64b: If 1, the ring uses 64-byte instructions. If 0, the
0672  *   ring uses 32-byte instructions.
0673  * @enb: Enable for the input ring.
0674  */
0675 union nps_pkt_in_instr_ctl {
0676     u64 value;
0677     struct {
0678 #if (defined(__BIG_ENDIAN_BITFIELD))
0679         u64 raz : 62;
0680         u64 is64b : 1;
0681         u64 enb : 1;
0682 #else
0683         u64 enb : 1;
0684         u64 is64b : 1;
0685         u64 raz : 62;
0686 #endif
0687     } s;
0688 };
0689 
0690 /**
0691  * struct nps_pkt_in_instr_rsize - Input instruction ring size registers
0692  * @rsize: Ring size (number of instructions)
0693  */
0694 union nps_pkt_in_instr_rsize {
0695     u64 value;
0696     struct {
0697 #if (defined(__BIG_ENDIAN_BITFIELD))
0698         u64 raz : 32;
0699         u64 rsize : 32;
0700 #else
0701         u64 rsize : 32;
0702         u64 raz : 32;
0703 #endif
0704     } s;
0705 };
0706 
0707 /**
0708  * struct nps_pkt_in_instr_baoff_dbell - Input instruction ring
0709  *   base address offset and doorbell registers
0710  * @aoff: Address offset. The offset from the NPS_PKT_IN_INSTR_BADDR
0711  *   where the next pointer is read.
0712  * @dbell: Pointer list doorbell count. Write operations to this field
0713  *   increments the present value here. Read operations return the
0714  *   present value.
0715  */
0716 union nps_pkt_in_instr_baoff_dbell {
0717     u64 value;
0718     struct {
0719 #if (defined(__BIG_ENDIAN_BITFIELD))
0720         u64 aoff : 32;
0721         u64 dbell : 32;
0722 #else
0723         u64 dbell : 32;
0724         u64 aoff : 32;
0725 #endif
0726     } s;
0727 };
0728 
0729 /**
0730  * struct nps_core_int_ena_w1s - NPS core interrupt enable set register
0731  * @host_nps_wr_err: Reads or sets enable for
0732  *   NPS_CORE_INT[HOST_NPS_WR_ERR].
0733  * @npco_dma_malform: Reads or sets enable for
0734  *   NPS_CORE_INT[NPCO_DMA_MALFORM].
0735  * @exec_wr_timeout: Reads or sets enable for
0736  *   NPS_CORE_INT[EXEC_WR_TIMEOUT].
0737  * @host_wr_timeout: Reads or sets enable for
0738  *   NPS_CORE_INT[HOST_WR_TIMEOUT].
0739  * @host_wr_err: Reads or sets enable for
0740  *   NPS_CORE_INT[HOST_WR_ERR]
0741  */
0742 union nps_core_int_ena_w1s {
0743     u64 value;
0744     struct {
0745 #if (defined(__BIG_ENDIAN_BITFIELD))
0746         u64 raz4 : 55;
0747         u64 host_nps_wr_err : 1;
0748         u64 npco_dma_malform : 1;
0749         u64 exec_wr_timeout : 1;
0750         u64 host_wr_timeout : 1;
0751         u64 host_wr_err : 1;
0752         u64 raz3 : 1;
0753         u64 raz2 : 1;
0754         u64 raz1 : 1;
0755         u64 raz0 : 1;
0756 #else
0757         u64 raz0 : 1;
0758         u64 raz1 : 1;
0759         u64 raz2 : 1;
0760         u64 raz3 : 1;
0761         u64 host_wr_err : 1;
0762         u64 host_wr_timeout : 1;
0763         u64 exec_wr_timeout : 1;
0764         u64 npco_dma_malform : 1;
0765         u64 host_nps_wr_err : 1;
0766         u64 raz4 : 55;
0767 #endif
0768     } s;
0769 };
0770 
0771 /**
0772  * struct nps_core_gbl_vfcfg - Global VF Configuration Register.
0773  * @ilk_disable: When set, this bit indicates that the ILK interface has
0774  *    been disabled.
0775  * @obaf: BMO allocation control
0776  *    0 = allocate per queue
0777  *    1 = allocate per VF
0778  * @ibaf: BMI allocation control
0779  *    0 = allocate per queue
0780  *    1 = allocate per VF
0781  * @zaf: ZIP allocation control
0782  *    0 = allocate per queue
0783  *    1 = allocate per VF
0784  * @aeaf: AE allocation control
0785  *    0 = allocate per queue
0786  *    1 = allocate per VF
0787  * @seaf: SE allocation control
0788  *    0 = allocation per queue
0789  *    1 = allocate per VF
0790  * @cfg: VF/PF mode.
0791  */
0792 union nps_core_gbl_vfcfg {
0793     u64 value;
0794     struct {
0795 #if (defined(__BIG_ENDIAN_BITFIELD))
0796         u64  raz :55;
0797         u64  ilk_disable :1;
0798         u64  obaf :1;
0799         u64  ibaf :1;
0800         u64  zaf :1;
0801         u64  aeaf :1;
0802         u64  seaf :1;
0803         u64  cfg :3;
0804 #else
0805         u64  cfg :3;
0806         u64  seaf :1;
0807         u64  aeaf :1;
0808         u64  zaf :1;
0809         u64  ibaf :1;
0810         u64  obaf :1;
0811         u64  ilk_disable :1;
0812         u64  raz :55;
0813 #endif
0814     } s;
0815 };
0816 
0817 /**
0818  * struct nps_core_int_active - NPS Core Interrupt Active Register
0819  * @resend: Resend MSI-X interrupt if needs to handle interrupts
0820  *    Sofware can set this bit and then exit the ISR.
0821  * @ocla: Set when any OCLA(0)_INT and corresponding OCLA(0_INT_ENA_W1C
0822  *    bit are set
0823  * @mbox: Set when any NPS_PKT_MBOX_INT_LO/HI and corresponding
0824  *    NPS_PKT_MBOX_INT_LO_ENA_W1C/HI_ENA_W1C bits are set
0825  * @emu: bit i is set in [EMU] when any EMU(i)_INT bit is set
0826  * @bmo: Set when any BMO_INT bit is set
0827  * @bmi: Set when any BMI_INT bit is set or when any non-RO
0828  *    BMI_INT and corresponding BMI_INT_ENA_W1C bits are both set
0829  * @aqm: Set when any AQM_INT bit is set
0830  * @zqm: Set when any ZQM_INT bit is set
0831  * @efl: Set when any EFL_INT RO bit is set or when any non-RO EFL_INT
0832  *    and corresponding EFL_INT_ENA_W1C bits are both set
0833  * @ilk: Set when any ILK_INT bit is set
0834  * @lbc: Set when any LBC_INT RO bit is set or when any non-RO LBC_INT
0835  *    and corresponding LBC_INT_ENA_W1C bits are bot set
0836  * @pem: Set when any PEM(0)_INT RO bit is set or when any non-RO
0837  *    PEM(0)_INT and corresponding PEM(0)_INT_ENA_W1C bit are both set
0838  * @ucd: Set when any UCD_INT bit is set
0839  * @zctl: Set when any ZIP_INT RO bit is set or when any non-RO ZIP_INT
0840  *    and corresponding ZIP_INT_ENA_W1C bits are both set
0841  * @lbm: Set when any LBM_INT bit is set
0842  * @nps_pkt: Set when any NPS_PKT_INT bit is set
0843  * @nps_core: Set when any NPS_CORE_INT RO bit is set or when non-RO
0844  *    NPS_CORE_INT and corresponding NSP_CORE_INT_ENA_W1C bits are both set
0845  */
0846 union nps_core_int_active {
0847     u64 value;
0848     struct {
0849 #if (defined(__BIG_ENDIAN_BITFIELD))
0850         u64 resend : 1;
0851         u64 raz : 43;
0852         u64 ocla : 1;
0853         u64 mbox : 1;
0854         u64 emu : 4;
0855         u64 bmo : 1;
0856         u64 bmi : 1;
0857         u64 aqm : 1;
0858         u64 zqm : 1;
0859         u64 efl : 1;
0860         u64 ilk : 1;
0861         u64 lbc : 1;
0862         u64 pem : 1;
0863         u64 pom : 1;
0864         u64 ucd : 1;
0865         u64 zctl : 1;
0866         u64 lbm : 1;
0867         u64 nps_pkt : 1;
0868         u64 nps_core : 1;
0869 #else
0870         u64 nps_core : 1;
0871         u64 nps_pkt : 1;
0872         u64 lbm : 1;
0873         u64 zctl: 1;
0874         u64 ucd : 1;
0875         u64 pom : 1;
0876         u64 pem : 1;
0877         u64 lbc : 1;
0878         u64 ilk : 1;
0879         u64 efl : 1;
0880         u64 zqm : 1;
0881         u64 aqm : 1;
0882         u64 bmi : 1;
0883         u64 bmo : 1;
0884         u64 emu : 4;
0885         u64 mbox : 1;
0886         u64 ocla : 1;
0887         u64 raz : 43;
0888         u64 resend : 1;
0889 #endif
0890     } s;
0891 };
0892 
0893 /**
0894  * struct efl_core_int - EFL Interrupt Registers
0895  * @epci_decode_err: EPCI decoded a transacation that was unknown
0896  *    This error should only occurred when there is a micrcode/SE error
0897  *    and should be considered fatal
0898  * @ae_err: An AE uncorrectable error occurred.
0899  *    See EFL_CORE(0..3)_AE_ERR_INT
0900  * @se_err: An SE uncorrectable error occurred.
0901  *    See EFL_CORE(0..3)_SE_ERR_INT
0902  * @dbe: Double-bit error occurred in EFL
0903  * @sbe: Single-bit error occurred in EFL
0904  * @d_left: Asserted when new POM-Header-BMI-data is
0905  *    being sent to an Exec, and that Exec has Not read all BMI
0906  *    data associated with the previous POM header
0907  * @len_ovr: Asserted when an Exec-Read is issued that is more than
0908  *    14 greater in length that the BMI data left to be read
0909  */
0910 union efl_core_int {
0911     u64 value;
0912     struct {
0913 #if (defined(__BIG_ENDIAN_BITFIELD))
0914         u64 raz : 57;
0915         u64 epci_decode_err : 1;
0916         u64 ae_err : 1;
0917         u64 se_err : 1;
0918         u64 dbe : 1;
0919         u64 sbe : 1;
0920         u64 d_left : 1;
0921         u64 len_ovr : 1;
0922 #else
0923         u64 len_ovr : 1;
0924         u64 d_left : 1;
0925         u64 sbe : 1;
0926         u64 dbe : 1;
0927         u64 se_err : 1;
0928         u64 ae_err : 1;
0929         u64 epci_decode_err  : 1;
0930         u64 raz : 57;
0931 #endif
0932     } s;
0933 };
0934 
0935 /**
0936  * struct efl_core_int_ena_w1s - EFL core interrupt enable set register
0937  * @epci_decode_err: Reads or sets enable for
0938  *   EFL_CORE(0..3)_INT[EPCI_DECODE_ERR].
0939  * @d_left: Reads or sets enable for
0940  *   EFL_CORE(0..3)_INT[D_LEFT].
0941  * @len_ovr: Reads or sets enable for
0942  *   EFL_CORE(0..3)_INT[LEN_OVR].
0943  */
0944 union efl_core_int_ena_w1s {
0945     u64 value;
0946     struct {
0947 #if (defined(__BIG_ENDIAN_BITFIELD))
0948         u64 raz_7_63 : 57;
0949         u64 epci_decode_err : 1;
0950         u64 raz_2_5 : 4;
0951         u64 d_left : 1;
0952         u64 len_ovr : 1;
0953 #else
0954         u64 len_ovr : 1;
0955         u64 d_left : 1;
0956         u64 raz_2_5 : 4;
0957         u64 epci_decode_err : 1;
0958         u64 raz_7_63 : 57;
0959 #endif
0960     } s;
0961 };
0962 
0963 /**
0964  * struct efl_rnm_ctl_status - RNM Control and Status Register
0965  * @ent_sel: Select input to RNM FIFO
0966  * @exp_ent: Exported entropy enable for random number generator
0967  * @rng_rst: Reset to RNG. Setting this bit to 1 cancels the generation
0968  *    of the current random number.
0969  * @rnm_rst: Reset the RNM. Setting this bit to 1 clears all sorted numbers
0970  *    in the random number memory.
0971  * @rng_en: Enabled the output of the RNG.
0972  * @ent_en: Entropy enable for random number generator.
0973  */
0974 union efl_rnm_ctl_status {
0975     u64 value;
0976     struct {
0977 #if (defined(__BIG_ENDIAN_BITFIELD))
0978         u64 raz_9_63 : 55;
0979         u64 ent_sel : 4;
0980         u64 exp_ent : 1;
0981         u64 rng_rst : 1;
0982         u64 rnm_rst : 1;
0983         u64 rng_en : 1;
0984         u64 ent_en : 1;
0985 #else
0986         u64 ent_en : 1;
0987         u64 rng_en : 1;
0988         u64 rnm_rst : 1;
0989         u64 rng_rst : 1;
0990         u64 exp_ent : 1;
0991         u64 ent_sel : 4;
0992         u64 raz_9_63 : 55;
0993 #endif
0994     } s;
0995 };
0996 
0997 /**
0998  * struct bmi_ctl - BMI control register
0999  * @ilk_hdrq_thrsh: Maximum number of header queue locations
1000  *   that ILK packets may consume. When the threshold is
1001  *   exceeded ILK_XOFF is sent to the BMI_X2P_ARB.
1002  * @nps_hdrq_thrsh: Maximum number of header queue locations
1003  *   that NPS packets may consume. When the threshold is
1004  *   exceeded NPS_XOFF is sent to the BMI_X2P_ARB.
1005  * @totl_hdrq_thrsh: Maximum number of header queue locations
1006  *   that the sum of ILK and NPS packets may consume.
1007  * @ilk_free_thrsh: Maximum number of buffers that ILK packet
1008  *   flows may consume before ILK_XOFF is sent to the BMI_X2P_ARB.
1009  * @nps_free_thrsh: Maximum number of buffers that NPS packet
1010  *   flows may consume before NPS XOFF is sent to the BMI_X2p_ARB.
1011  * @totl_free_thrsh: Maximum number of buffers that bot ILK and NPS
1012  *   packet flows may consume before both NPS_XOFF and ILK_XOFF
1013  *   are asserted to the BMI_X2P_ARB.
1014  * @max_pkt_len: Maximum packet length, integral number of 256B
1015  *   buffers.
1016  */
1017 union bmi_ctl {
1018     u64 value;
1019     struct {
1020 #if (defined(__BIG_ENDIAN_BITFIELD))
1021         u64 raz_56_63 : 8;
1022         u64 ilk_hdrq_thrsh : 8;
1023         u64 nps_hdrq_thrsh : 8;
1024         u64 totl_hdrq_thrsh : 8;
1025         u64 ilk_free_thrsh : 8;
1026         u64 nps_free_thrsh : 8;
1027         u64 totl_free_thrsh : 8;
1028         u64 max_pkt_len : 8;
1029 #else
1030         u64 max_pkt_len : 8;
1031         u64 totl_free_thrsh : 8;
1032         u64 nps_free_thrsh : 8;
1033         u64 ilk_free_thrsh : 8;
1034         u64 totl_hdrq_thrsh : 8;
1035         u64 nps_hdrq_thrsh : 8;
1036         u64 ilk_hdrq_thrsh : 8;
1037         u64 raz_56_63 : 8;
1038 #endif
1039     } s;
1040 };
1041 
1042 /**
1043  * struct bmi_int_ena_w1s - BMI interrupt enable set register
1044  * @ilk_req_oflw: Reads or sets enable for
1045  *   BMI_INT[ILK_REQ_OFLW].
1046  * @nps_req_oflw: Reads or sets enable for
1047  *   BMI_INT[NPS_REQ_OFLW].
1048  * @fpf_undrrn: Reads or sets enable for
1049  *   BMI_INT[FPF_UNDRRN].
1050  * @eop_err_ilk: Reads or sets enable for
1051  *   BMI_INT[EOP_ERR_ILK].
1052  * @eop_err_nps: Reads or sets enable for
1053  *   BMI_INT[EOP_ERR_NPS].
1054  * @sop_err_ilk: Reads or sets enable for
1055  *   BMI_INT[SOP_ERR_ILK].
1056  * @sop_err_nps: Reads or sets enable for
1057  *   BMI_INT[SOP_ERR_NPS].
1058  * @pkt_rcv_err_ilk: Reads or sets enable for
1059  *   BMI_INT[PKT_RCV_ERR_ILK].
1060  * @pkt_rcv_err_nps: Reads or sets enable for
1061  *   BMI_INT[PKT_RCV_ERR_NPS].
1062  * @max_len_err_ilk: Reads or sets enable for
1063  *   BMI_INT[MAX_LEN_ERR_ILK].
1064  * @max_len_err_nps: Reads or sets enable for
1065  *   BMI_INT[MAX_LEN_ERR_NPS].
1066  */
1067 union bmi_int_ena_w1s {
1068     u64 value;
1069     struct {
1070 #if (defined(__BIG_ENDIAN_BITFIELD))
1071         u64 raz_13_63   : 51;
1072         u64 ilk_req_oflw : 1;
1073         u64 nps_req_oflw : 1;
1074         u64 raz_10 : 1;
1075         u64 raz_9 : 1;
1076         u64 fpf_undrrn  : 1;
1077         u64 eop_err_ilk : 1;
1078         u64 eop_err_nps : 1;
1079         u64 sop_err_ilk : 1;
1080         u64 sop_err_nps : 1;
1081         u64 pkt_rcv_err_ilk : 1;
1082         u64 pkt_rcv_err_nps : 1;
1083         u64 max_len_err_ilk : 1;
1084         u64 max_len_err_nps : 1;
1085 #else
1086         u64 max_len_err_nps : 1;
1087         u64 max_len_err_ilk : 1;
1088         u64 pkt_rcv_err_nps : 1;
1089         u64 pkt_rcv_err_ilk : 1;
1090         u64 sop_err_nps : 1;
1091         u64 sop_err_ilk : 1;
1092         u64 eop_err_nps : 1;
1093         u64 eop_err_ilk : 1;
1094         u64 fpf_undrrn  : 1;
1095         u64 raz_9 : 1;
1096         u64 raz_10 : 1;
1097         u64 nps_req_oflw : 1;
1098         u64 ilk_req_oflw : 1;
1099         u64 raz_13_63 : 51;
1100 #endif
1101     } s;
1102 };
1103 
1104 /**
1105  * struct bmo_ctl2 - BMO Control2 Register
1106  * @arb_sel: Determines P2X Arbitration
1107  * @ilk_buf_thrsh: Maximum number of buffers that the
1108  *    ILK packet flows may consume before ILK XOFF is
1109  *    asserted to the POM.
1110  * @nps_slc_buf_thrsh: Maximum number of buffers that the
1111  *    NPS_SLC packet flow may consume before NPS_SLC XOFF is
1112  *    asserted to the POM.
1113  * @nps_uns_buf_thrsh: Maximum number of buffers that the
1114  *    NPS_UNS packet flow may consume before NPS_UNS XOFF is
1115  *    asserted to the POM.
1116  * @totl_buf_thrsh: Maximum number of buffers that ILK, NPS_UNS and
1117  *    NPS_SLC packet flows may consume before NPS_UNS XOFF, NSP_SLC and
1118  *    ILK_XOFF are all asserted POM.
1119  */
1120 union bmo_ctl2 {
1121     u64 value;
1122     struct {
1123 #if (defined(__BIG_ENDIAN_BITFIELD))
1124         u64 arb_sel : 1;
1125         u64 raz_32_62 : 31;
1126         u64 ilk_buf_thrsh : 8;
1127         u64 nps_slc_buf_thrsh : 8;
1128         u64 nps_uns_buf_thrsh : 8;
1129         u64 totl_buf_thrsh : 8;
1130 #else
1131         u64 totl_buf_thrsh : 8;
1132         u64 nps_uns_buf_thrsh : 8;
1133         u64 nps_slc_buf_thrsh : 8;
1134         u64 ilk_buf_thrsh : 8;
1135         u64 raz_32_62 : 31;
1136         u64 arb_sel : 1;
1137 #endif
1138     } s;
1139 };
1140 
1141 /**
1142  * struct pom_int_ena_w1s - POM interrupt enable set register
1143  * @illegal_intf: Reads or sets enable for POM_INT[ILLEGAL_INTF].
1144  * @illegal_dport: Reads or sets enable for POM_INT[ILLEGAL_DPORT].
1145  */
1146 union pom_int_ena_w1s {
1147     u64 value;
1148     struct {
1149 #if (defined(__BIG_ENDIAN_BITFIELD))
1150         u64 raz2 : 60;
1151         u64 illegal_intf : 1;
1152         u64 illegal_dport : 1;
1153         u64 raz1 : 1;
1154         u64 raz0 : 1;
1155 #else
1156         u64 raz0 : 1;
1157         u64 raz1 : 1;
1158         u64 illegal_dport : 1;
1159         u64 illegal_intf : 1;
1160         u64 raz2 : 60;
1161 #endif
1162     } s;
1163 };
1164 
1165 /**
1166  * struct lbc_inval_ctl - LBC invalidation control register
1167  * @wait_timer: Wait timer for wait state. [WAIT_TIMER] must
1168  *   always be written with its reset value.
1169  * @cam_inval_start: Software should write [CAM_INVAL_START]=1
1170  *   to initiate an LBC cache invalidation. After this, software
1171  *   should read LBC_INVAL_STATUS until LBC_INVAL_STATUS[DONE] is set.
1172  *   LBC hardware clears [CAVM_INVAL_START] before software can
1173  *   observed LBC_INVAL_STATUS[DONE] to be set
1174  */
1175 union lbc_inval_ctl {
1176     u64 value;
1177     struct {
1178 #if (defined(__BIG_ENDIAN_BITFIELD))
1179         u64 raz2 : 48;
1180         u64 wait_timer : 8;
1181         u64 raz1 : 6;
1182         u64 cam_inval_start : 1;
1183         u64 raz0 : 1;
1184 #else
1185         u64 raz0 : 1;
1186         u64 cam_inval_start : 1;
1187         u64 raz1 : 6;
1188         u64 wait_timer : 8;
1189         u64 raz2 : 48;
1190 #endif
1191     } s;
1192 };
1193 
1194 /**
1195  * struct lbc_int_ena_w1s - LBC interrupt enable set register
1196  * @cam_hard_err: Reads or sets enable for LBC_INT[CAM_HARD_ERR].
1197  * @cam_inval_abort: Reads or sets enable for LBC_INT[CAM_INVAL_ABORT].
1198  * @over_fetch_err: Reads or sets enable for LBC_INT[OVER_FETCH_ERR].
1199  * @cache_line_to_err: Reads or sets enable for
1200  *   LBC_INT[CACHE_LINE_TO_ERR].
1201  * @cam_soft_err: Reads or sets enable for
1202  *   LBC_INT[CAM_SOFT_ERR].
1203  * @dma_rd_err: Reads or sets enable for
1204  *   LBC_INT[DMA_RD_ERR].
1205  */
1206 union lbc_int_ena_w1s {
1207     u64 value;
1208     struct {
1209 #if (defined(__BIG_ENDIAN_BITFIELD))
1210         u64 raz_10_63 : 54;
1211         u64 cam_hard_err : 1;
1212         u64 cam_inval_abort : 1;
1213         u64 over_fetch_err : 1;
1214         u64 cache_line_to_err : 1;
1215         u64 raz_2_5 : 4;
1216         u64 cam_soft_err : 1;
1217         u64 dma_rd_err : 1;
1218 #else
1219         u64 dma_rd_err : 1;
1220         u64 cam_soft_err : 1;
1221         u64 raz_2_5 : 4;
1222         u64 cache_line_to_err : 1;
1223         u64 over_fetch_err : 1;
1224         u64 cam_inval_abort : 1;
1225         u64 cam_hard_err : 1;
1226         u64 raz_10_63 : 54;
1227 #endif
1228     } s;
1229 };
1230 
1231 /**
1232  * struct lbc_int - LBC interrupt summary register
1233  * @cam_hard_err: indicates a fatal hardware error.
1234  *   It requires system reset.
1235  *   When [CAM_HARD_ERR] is set, LBC stops logging any new information in
1236  *   LBC_POM_MISS_INFO_LOG,
1237  *   LBC_POM_MISS_ADDR_LOG,
1238  *   LBC_EFL_MISS_INFO_LOG, and
1239  *   LBC_EFL_MISS_ADDR_LOG.
1240  *   Software should sample them.
1241  * @cam_inval_abort: indicates a fatal hardware error.
1242  *   System reset is required.
1243  * @over_fetch_err: indicates a fatal hardware error
1244  *   System reset is required
1245  * @cache_line_to_err: is a debug feature.
1246  *   This timeout interrupt bit tells the software that
1247  *   a cacheline in LBC has non-zero usage and the context
1248  *   has not been used for greater than the
1249  *   LBC_TO_CNT[TO_CNT] time interval.
1250  * @sbe: Memory SBE error. This is recoverable via ECC.
1251  *   See LBC_ECC_INT for more details.
1252  * @dbe: Memory DBE error. This is a fatal and requires a
1253  *   system reset.
1254  * @pref_dat_len_mismatch_err: Summary bit for context length
1255  *   mismatch errors.
1256  * @rd_dat_len_mismatch_err: Summary bit for SE read data length
1257  *   greater than data prefect length errors.
1258  * @cam_soft_err: is recoverable. Software must complete a
1259  *   LBC_INVAL_CTL[CAM_INVAL_START] invalidation sequence and
1260  *   then clear [CAM_SOFT_ERR].
1261  * @dma_rd_err: A context prefect read of host memory returned with
1262  *   a read error.
1263  */
1264 union lbc_int {
1265     u64 value;
1266     struct {
1267 #if (defined(__BIG_ENDIAN_BITFIELD))
1268         u64 raz_10_63 : 54;
1269         u64 cam_hard_err : 1;
1270         u64 cam_inval_abort : 1;
1271         u64 over_fetch_err : 1;
1272         u64 cache_line_to_err : 1;
1273         u64 sbe : 1;
1274         u64 dbe : 1;
1275         u64 pref_dat_len_mismatch_err : 1;
1276         u64 rd_dat_len_mismatch_err : 1;
1277         u64 cam_soft_err : 1;
1278         u64 dma_rd_err : 1;
1279 #else
1280         u64 dma_rd_err : 1;
1281         u64 cam_soft_err : 1;
1282         u64 rd_dat_len_mismatch_err : 1;
1283         u64 pref_dat_len_mismatch_err : 1;
1284         u64 dbe : 1;
1285         u64 sbe : 1;
1286         u64 cache_line_to_err : 1;
1287         u64 over_fetch_err : 1;
1288         u64 cam_inval_abort : 1;
1289         u64 cam_hard_err : 1;
1290         u64 raz_10_63 : 54;
1291 #endif
1292     } s;
1293 };
1294 
1295 /**
1296  * struct lbc_inval_status: LBC Invalidation status register
1297  * @cam_clean_entry_complete_cnt: The number of entries that are
1298  *   cleaned up successfully.
1299  * @cam_clean_entry_cnt: The number of entries that have the CAM
1300  *   inval command issued.
1301  * @cam_inval_state: cam invalidation FSM state
1302  * @cam_inval_abort: cam invalidation abort
1303  * @cam_rst_rdy: lbc_cam reset ready
1304  * @done: LBC clears [DONE] when
1305  *   LBC_INVAL_CTL[CAM_INVAL_START] is written with a one,
1306  *   and sets [DONE] when it completes the invalidation
1307  *   sequence.
1308  */
1309 union lbc_inval_status {
1310     u64 value;
1311     struct {
1312 #if (defined(__BIG_ENDIAN_BITFIELD))
1313         u64 raz3 : 23;
1314         u64 cam_clean_entry_complete_cnt : 9;
1315         u64 raz2 : 7;
1316         u64 cam_clean_entry_cnt : 9;
1317         u64 raz1 : 5;
1318         u64 cam_inval_state : 3;
1319         u64 raz0 : 5;
1320         u64 cam_inval_abort : 1;
1321         u64 cam_rst_rdy : 1;
1322         u64 done : 1;
1323 #else
1324         u64 done : 1;
1325         u64 cam_rst_rdy : 1;
1326         u64 cam_inval_abort : 1;
1327         u64 raz0 : 5;
1328         u64 cam_inval_state : 3;
1329         u64 raz1 : 5;
1330         u64 cam_clean_entry_cnt : 9;
1331         u64 raz2 : 7;
1332         u64 cam_clean_entry_complete_cnt : 9;
1333         u64 raz3 : 23;
1334 #endif
1335     } s;
1336 };
1337 
1338 /**
1339  * struct rst_boot: RST Boot Register
1340  * @jtcsrdis: when set, internal CSR access via JTAG TAP controller
1341  *   is disabled
1342  * @jt_tst_mode: JTAG test mode
1343  * @io_supply: I/O power supply setting based on IO_VDD_SELECT pin:
1344  *    0x1 = 1.8V
1345  *    0x2 = 2.5V
1346  *    0x4 = 3.3V
1347  *    All other values are reserved
1348  * @pnr_mul: clock multiplier
1349  * @lboot: last boot cause mask, resets only with PLL_DC_OK
1350  * @rboot: determines whether core 0 remains in reset after
1351  *    chip cold or warm or soft reset
1352  * @rboot_pin: read only access to REMOTE_BOOT pin
1353  */
1354 union rst_boot {
1355     u64 value;
1356     struct {
1357 #if (defined(__BIG_ENDIAN_BITFIELD))
1358         u64 raz_63 : 1;
1359         u64 jtcsrdis : 1;
1360         u64 raz_59_61 : 3;
1361         u64 jt_tst_mode : 1;
1362         u64 raz_40_57 : 18;
1363         u64 io_supply : 3;
1364         u64 raz_30_36 : 7;
1365         u64 pnr_mul : 6;
1366         u64 raz_12_23 : 12;
1367         u64 lboot : 10;
1368         u64 rboot : 1;
1369         u64 rboot_pin : 1;
1370 #else
1371         u64 rboot_pin : 1;
1372         u64 rboot : 1;
1373         u64 lboot : 10;
1374         u64 raz_12_23 : 12;
1375         u64 pnr_mul : 6;
1376         u64 raz_30_36 : 7;
1377         u64 io_supply : 3;
1378         u64 raz_40_57 : 18;
1379         u64 jt_tst_mode : 1;
1380         u64 raz_59_61 : 3;
1381         u64 jtcsrdis : 1;
1382         u64 raz_63 : 1;
1383 #endif
1384     };
1385 };
1386 
1387 /**
1388  * struct fus_dat1: Fuse Data 1 Register
1389  * @pll_mul: main clock PLL multiplier hardware limit
1390  * @pll_half_dis: main clock PLL control
1391  * @efus_lck: efuse lockdown
1392  * @zip_info: ZIP information
1393  * @bar2_sz_conf: when zero, BAR2 size conforms to
1394  *    PCIe specification
1395  * @efus_ign: efuse ignore
1396  * @nozip: ZIP disable
1397  * @pll_alt_matrix: select alternate PLL matrix
1398  * @pll_bwadj_denom: select CLKF denominator for
1399  *    BWADJ value
1400  * @chip_id: chip ID
1401  */
1402 union fus_dat1 {
1403     u64 value;
1404     struct {
1405 #if (defined(__BIG_ENDIAN_BITFIELD))
1406         u64 raz_57_63 : 7;
1407         u64 pll_mul : 3;
1408         u64 pll_half_dis : 1;
1409         u64 raz_43_52 : 10;
1410         u64 efus_lck : 3;
1411         u64 raz_26_39 : 14;
1412         u64 zip_info : 5;
1413         u64 bar2_sz_conf : 1;
1414         u64 efus_ign : 1;
1415         u64 nozip : 1;
1416         u64 raz_11_17 : 7;
1417         u64 pll_alt_matrix : 1;
1418         u64 pll_bwadj_denom : 2;
1419         u64 chip_id : 8;
1420 #else
1421         u64 chip_id : 8;
1422         u64 pll_bwadj_denom : 2;
1423         u64 pll_alt_matrix : 1;
1424         u64 raz_11_17 : 7;
1425         u64 nozip : 1;
1426         u64 efus_ign : 1;
1427         u64 bar2_sz_conf : 1;
1428         u64 zip_info : 5;
1429         u64 raz_26_39 : 14;
1430         u64 efus_lck : 3;
1431         u64 raz_43_52 : 10;
1432         u64 pll_half_dis : 1;
1433         u64 pll_mul : 3;
1434         u64 raz_57_63 : 7;
1435 #endif
1436     };
1437 };
1438 
1439 #endif /* __NITROX_CSR_H */