diff options
Diffstat (limited to 'src/drivers/infiniband/hermon.h')
-rw-r--r-- | src/drivers/infiniband/hermon.h | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/src/drivers/infiniband/hermon.h b/src/drivers/infiniband/hermon.h index 959e6a9d..d9e3dd11 100644 --- a/src/drivers/infiniband/hermon.h +++ b/src/drivers/infiniband/hermon.h @@ -9,6 +9,7 @@ #include <stdint.h> #include <gpxe/uaccess.h> +#include <gpxe/process.h> #include "mlx_bitops.h" #include "MT25408_PRM.h" @@ -18,7 +19,7 @@ */ /* Ports in existence */ -#define HERMON_NUM_PORTS 1 +#define HERMON_NUM_PORTS 2 #define HERMON_PORT_BASE 1 /* PCI BARs */ @@ -48,6 +49,7 @@ #define HERMON_HCR_RST2INIT_QP 0x0019 #define HERMON_HCR_INIT2RTR_QP 0x001a #define HERMON_HCR_RTR2RTS_QP 0x001b +#define HERMON_HCR_RTS2RTS_QP 0x001c #define HERMON_HCR_2RST_QP 0x0021 #define HERMON_HCR_MAD_IFC 0x0024 #define HERMON_HCR_READ_MCG 0x0025 @@ -75,6 +77,14 @@ #define HERMON_PAGE_SIZE 4096 #define HERMON_DB_POST_SND_OFFSET 0x14 +#define HERMON_DB_EQ0_OFFSET 0x800 + +#define HERMON_QP_OPT_PARAM_QKEY 0x00000020UL + +#define HERMON_MAP_EQ_MAP ( 0UL << 31 ) +#define HERMON_MAP_EQ_UNMAP ( 1UL << 31 ) + +#define HERMON_EV_PORT_STATE_CHANGE 0x09 /* * Datatypes that seem to be missing from the autogenerated documentation @@ -108,12 +118,32 @@ struct hermonprm_send_db_register_st { pseudo_bit_t qn[0x00018]; } __attribute__ (( packed )); +struct hermonprm_event_db_register_st { + pseudo_bit_t ci[0x00018]; + pseudo_bit_t reserver[0x00007]; + pseudo_bit_t a[0x00001]; +} __attribute__ (( packed )); + struct hermonprm_scalar_parameter_st { pseudo_bit_t value_hi[0x00020]; /* -------------- */ pseudo_bit_t value[0x00020]; } __attribute__ (( packed )); +struct hermonprm_event_mask_st { + pseudo_bit_t reserved0[0x00020]; +/* -------------- */ + pseudo_bit_t completion[0x00001]; + pseudo_bit_t reserved1[0x0008]; + pseudo_bit_t port_state_change[0x00001]; + pseudo_bit_t reserved2[0x00016]; +} __attribute__ (( packed )); + +struct hermonprm_port_state_change_event_st { + pseudo_bit_t reserved[0x00020]; + struct hermonprm_port_state_change_st data; +} __attribute__ (( packed )); + /* * Wrapper structures for hardware datatypes * @@ -124,6 +154,9 @@ struct MLX_DECLARE_STRUCT ( hermonprm_completion_queue_entry ); struct MLX_DECLARE_STRUCT ( hermonprm_completion_with_error ); struct MLX_DECLARE_STRUCT ( hermonprm_cq_db_record ); struct MLX_DECLARE_STRUCT ( hermonprm_eqc ); +struct MLX_DECLARE_STRUCT ( hermonprm_event_db_register ); +struct MLX_DECLARE_STRUCT ( hermonprm_event_mask ); +struct MLX_DECLARE_STRUCT ( hermonprm_event_queue_entry ); struct MLX_DECLARE_STRUCT ( hermonprm_hca_command_register ); struct MLX_DECLARE_STRUCT ( hermonprm_init_hca ); struct MLX_DECLARE_STRUCT ( hermonprm_init_port ); @@ -132,6 +165,7 @@ struct MLX_DECLARE_STRUCT ( hermonprm_mcg_entry ); struct MLX_DECLARE_STRUCT ( hermonprm_mgm_hash ); struct MLX_DECLARE_STRUCT ( hermonprm_mpt ); struct MLX_DECLARE_STRUCT ( hermonprm_mtt ); +struct MLX_DECLARE_STRUCT ( hermonprm_port_state_change_event ); struct MLX_DECLARE_STRUCT ( hermonprm_qp_db_record ); struct MLX_DECLARE_STRUCT ( hermonprm_qp_ee_state_transitions ); struct MLX_DECLARE_STRUCT ( hermonprm_query_dev_cap ); @@ -175,8 +209,14 @@ union hermonprm_completion_entry { struct hermonprm_completion_with_error error; } __attribute__ (( packed )); +union hermonprm_event_entry { + struct hermonprm_event_queue_entry generic; + struct hermonprm_port_state_change_event port_state_change; +} __attribute__ (( packed )); + union hermonprm_doorbell_register { struct hermonprm_send_db_register send; + struct hermonprm_event_db_register event; uint32_t dword[1]; } __attribute__ (( packed )); @@ -362,6 +402,24 @@ struct hermon_completion_queue { */ #define HERMON_MAX_EQS 4 +/** A Hermon event queue */ +struct hermon_event_queue { + /** Event queue entries */ + union hermonprm_event_entry *eqe; + /** Size of event queue */ + size_t eqe_size; + /** MTT descriptor */ + struct hermon_mtt mtt; + /** Next event queue entry index */ + unsigned long next_idx; +}; + +/** Number of event queue entries + * + * This is a policy decision. + */ +#define HERMON_NUM_EQES 4 + /** A Hermon resource bitmask */ typedef uint32_t hermon_bitmask_t; @@ -397,6 +455,11 @@ struct hermon { */ unsigned long reserved_lkey; + /** Event queue */ + struct hermon_event_queue eq; + /** Event queue process */ + struct process event_process; + /** Completion queue in-use bitmask */ hermon_bitmask_t cq_inuse[ HERMON_BITMASK_SIZE ( HERMON_MAX_CQS ) ]; /** Queue pair in-use bitmask */ |