Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0
0002  *
0003  * Copyright 2019-2020 HabanaLabs, Ltd.
0004  * All Rights Reserved.
0005  *
0006  */
0007 
0008 #ifndef GAUDI_FW_IF_H
0009 #define GAUDI_FW_IF_H
0010 
0011 #define GAUDI_EVENT_QUEUE_MSI_IDX   8
0012 #define GAUDI_NIC_PORT1_MSI_IDX     10
0013 #define GAUDI_NIC_PORT3_MSI_IDX     12
0014 #define GAUDI_NIC_PORT5_MSI_IDX     14
0015 #define GAUDI_NIC_PORT7_MSI_IDX     16
0016 #define GAUDI_NIC_PORT9_MSI_IDX     18
0017 
0018 #define UBOOT_FW_OFFSET         0x100000    /* 1MB in SRAM */
0019 #define LINUX_FW_OFFSET         0x800000    /* 8MB in HBM */
0020 
0021 /* HBM thermal delta in [Deg] added to composite (CTemp) */
0022 #define HBM_TEMP_ADJUST_COEFF       6
0023 
0024 enum gaudi_nic_axi_error {
0025     RXB,
0026     RXE,
0027     TXS,
0028     TXE,
0029     QPC_RESP,
0030     NON_AXI_ERR,
0031     TMR,
0032 };
0033 
0034 /*
0035  * struct eq_nic_sei_event - describes an AXI error cause.
0036  * @axi_error_cause: one of the events defined in enum gaudi_nic_axi_error.
0037  * @id: can be either 0 or 1, to further describe unit with interrupt cause
0038  *      (i.e. TXE0 or TXE1).
0039  * @pad[6]: padding structure to 64bit.
0040  */
0041 struct eq_nic_sei_event {
0042     __u8 axi_error_cause;
0043     __u8 id;
0044     __u8 pad[6];
0045 };
0046 
0047 /*
0048  * struct gaudi_nic_status - describes the status of a NIC port.
0049  * @port: NIC port index.
0050  * @bad_format_cnt: e.g. CRC.
0051  * @responder_out_of_sequence_psn_cnt: e.g NAK.
0052  * @high_ber_reinit_cnt: link reinit due to high BER.
0053  * @correctable_err_cnt: e.g. bit-flip.
0054  * @uncorrectable_err_cnt: e.g. MAC errors.
0055  * @retraining_cnt: re-training counter.
0056  * @up: is port up.
0057  * @pcs_link: has PCS link.
0058  * @phy_ready: is PHY ready.
0059  * @auto_neg: is Autoneg enabled.
0060  * @timeout_retransmission_cnt: timeout retransmission events
0061  * @high_ber_cnt: high ber events
0062  */
0063 struct gaudi_nic_status {
0064     __u32 port;
0065     __u32 bad_format_cnt;
0066     __u32 responder_out_of_sequence_psn_cnt;
0067     __u32 high_ber_reinit;
0068     __u32 correctable_err_cnt;
0069     __u32 uncorrectable_err_cnt;
0070     __u32 retraining_cnt;
0071     __u8 up;
0072     __u8 pcs_link;
0073     __u8 phy_ready;
0074     __u8 auto_neg;
0075     __u32 timeout_retransmission_cnt;
0076     __u32 high_ber_cnt;
0077 };
0078 
0079 struct gaudi_cold_rst_data {
0080     union {
0081         struct {
0082             u32 spsram_init_done : 1;
0083             u32 reserved : 31;
0084         };
0085         __le32 data;
0086     };
0087 };
0088 
0089 #define GAUDI_PLL_FREQ_LOW      200000000 /* 200 MHz */
0090 
0091 #endif /* GAUDI_FW_IF_H */