Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (c) 2003-2020, Intel Corporation. All rights reserved
0004  * Intel Management Engine Interface (Intel MEI) Linux driver
0005  */
0006 
0007 #ifndef _MEI_HW_TYPES_H_
0008 #define _MEI_HW_TYPES_H_
0009 
0010 #include <linux/uuid.h>
0011 
0012 /*
0013  * Timeouts in Seconds
0014  */
0015 #define MEI_HW_READY_TIMEOUT        2  /* Timeout on ready message */
0016 #define MEI_CONNECT_TIMEOUT         3  /* HPS: at least 2 seconds */
0017 
0018 #define MEI_CL_CONNECT_TIMEOUT     15  /* HPS: Client Connect Timeout */
0019 #define MEI_CLIENTS_INIT_TIMEOUT   15  /* HPS: Clients Enumeration Timeout */
0020 
0021 #define MEI_PGI_TIMEOUT             1  /* PG Isolation time response 1 sec */
0022 #define MEI_D0I3_TIMEOUT            5  /* D0i3 set/unset max response time */
0023 #define MEI_HBM_TIMEOUT             1  /* 1 second */
0024 
0025 /*
0026  * FW page size for DMA allocations
0027  */
0028 #define MEI_FW_PAGE_SIZE 4096UL
0029 
0030 /*
0031  * MEI Version
0032  */
0033 #define HBM_MINOR_VERSION                   2
0034 #define HBM_MAJOR_VERSION                   2
0035 
0036 /*
0037  * MEI version with PGI support
0038  */
0039 #define HBM_MINOR_VERSION_PGI               1
0040 #define HBM_MAJOR_VERSION_PGI               1
0041 
0042 /*
0043  * MEI version with Dynamic clients support
0044  */
0045 #define HBM_MINOR_VERSION_DC               0
0046 #define HBM_MAJOR_VERSION_DC               2
0047 
0048 /*
0049  * MEI version with immediate reply to enum request support
0050  */
0051 #define HBM_MINOR_VERSION_IE               0
0052 #define HBM_MAJOR_VERSION_IE               2
0053 
0054 /*
0055  * MEI version with disconnect on connection timeout support
0056  */
0057 #define HBM_MINOR_VERSION_DOT              0
0058 #define HBM_MAJOR_VERSION_DOT              2
0059 
0060 /*
0061  * MEI version with notification support
0062  */
0063 #define HBM_MINOR_VERSION_EV               0
0064 #define HBM_MAJOR_VERSION_EV               2
0065 
0066 /*
0067  * MEI version with fixed address client support
0068  */
0069 #define HBM_MINOR_VERSION_FA               0
0070 #define HBM_MAJOR_VERSION_FA               2
0071 
0072 /*
0073  * MEI version with OS ver message support
0074  */
0075 #define HBM_MINOR_VERSION_OS               0
0076 #define HBM_MAJOR_VERSION_OS               2
0077 
0078 /*
0079  * MEI version with dma ring support
0080  */
0081 #define HBM_MINOR_VERSION_DR               1
0082 #define HBM_MAJOR_VERSION_DR               2
0083 
0084 /*
0085  * MEI version with vm tag support
0086  */
0087 #define HBM_MINOR_VERSION_VT               2
0088 #define HBM_MAJOR_VERSION_VT               2
0089 
0090 /*
0091  * MEI version with capabilities message support
0092  */
0093 #define HBM_MINOR_VERSION_CAP              2
0094 #define HBM_MAJOR_VERSION_CAP              2
0095 
0096 /*
0097  * MEI version with client DMA support
0098  */
0099 #define HBM_MINOR_VERSION_CD               2
0100 #define HBM_MAJOR_VERSION_CD               2
0101 
0102 /* Host bus message command opcode */
0103 #define MEI_HBM_CMD_OP_MSK                  0x7f
0104 /* Host bus message command RESPONSE */
0105 #define MEI_HBM_CMD_RES_MSK                 0x80
0106 
0107 /*
0108  * MEI Bus Message Command IDs
0109  */
0110 #define HOST_START_REQ_CMD                  0x01
0111 #define HOST_START_RES_CMD                  0x81
0112 
0113 #define HOST_STOP_REQ_CMD                   0x02
0114 #define HOST_STOP_RES_CMD                   0x82
0115 
0116 #define ME_STOP_REQ_CMD                     0x03
0117 
0118 #define HOST_ENUM_REQ_CMD                   0x04
0119 #define HOST_ENUM_RES_CMD                   0x84
0120 
0121 #define HOST_CLIENT_PROPERTIES_REQ_CMD      0x05
0122 #define HOST_CLIENT_PROPERTIES_RES_CMD      0x85
0123 
0124 #define CLIENT_CONNECT_REQ_CMD              0x06
0125 #define CLIENT_CONNECT_RES_CMD              0x86
0126 
0127 #define CLIENT_DISCONNECT_REQ_CMD           0x07
0128 #define CLIENT_DISCONNECT_RES_CMD           0x87
0129 
0130 #define MEI_FLOW_CONTROL_CMD                0x08
0131 
0132 #define MEI_PG_ISOLATION_ENTRY_REQ_CMD      0x0a
0133 #define MEI_PG_ISOLATION_ENTRY_RES_CMD      0x8a
0134 #define MEI_PG_ISOLATION_EXIT_REQ_CMD       0x0b
0135 #define MEI_PG_ISOLATION_EXIT_RES_CMD       0x8b
0136 
0137 #define MEI_HBM_ADD_CLIENT_REQ_CMD          0x0f
0138 #define MEI_HBM_ADD_CLIENT_RES_CMD          0x8f
0139 
0140 #define MEI_HBM_NOTIFY_REQ_CMD              0x10
0141 #define MEI_HBM_NOTIFY_RES_CMD              0x90
0142 #define MEI_HBM_NOTIFICATION_CMD            0x11
0143 
0144 #define MEI_HBM_DMA_SETUP_REQ_CMD           0x12
0145 #define MEI_HBM_DMA_SETUP_RES_CMD           0x92
0146 
0147 #define MEI_HBM_CAPABILITIES_REQ_CMD        0x13
0148 #define MEI_HBM_CAPABILITIES_RES_CMD        0x93
0149 
0150 #define MEI_HBM_CLIENT_DMA_MAP_REQ_CMD      0x14
0151 #define MEI_HBM_CLIENT_DMA_MAP_RES_CMD      0x94
0152 
0153 #define MEI_HBM_CLIENT_DMA_UNMAP_REQ_CMD    0x15
0154 #define MEI_HBM_CLIENT_DMA_UNMAP_RES_CMD    0x95
0155 
0156 /*
0157  * MEI Stop Reason
0158  * used by hbm_host_stop_request.reason
0159  */
0160 enum mei_stop_reason_types {
0161     DRIVER_STOP_REQUEST = 0x00,
0162     DEVICE_D1_ENTRY = 0x01,
0163     DEVICE_D2_ENTRY = 0x02,
0164     DEVICE_D3_ENTRY = 0x03,
0165     SYSTEM_S1_ENTRY = 0x04,
0166     SYSTEM_S2_ENTRY = 0x05,
0167     SYSTEM_S3_ENTRY = 0x06,
0168     SYSTEM_S4_ENTRY = 0x07,
0169     SYSTEM_S5_ENTRY = 0x08
0170 };
0171 
0172 
0173 /**
0174  * enum mei_hbm_status  - mei host bus messages return values
0175  *
0176  * @MEI_HBMS_SUCCESS           : status success
0177  * @MEI_HBMS_CLIENT_NOT_FOUND  : client not found
0178  * @MEI_HBMS_ALREADY_EXISTS    : connection already established
0179  * @MEI_HBMS_REJECTED          : connection is rejected
0180  * @MEI_HBMS_INVALID_PARAMETER : invalid parameter
0181  * @MEI_HBMS_NOT_ALLOWED       : operation not allowed
0182  * @MEI_HBMS_ALREADY_STARTED   : system is already started
0183  * @MEI_HBMS_NOT_STARTED       : system not started
0184  *
0185  * @MEI_HBMS_MAX               : sentinel
0186  */
0187 enum mei_hbm_status {
0188     MEI_HBMS_SUCCESS           = 0,
0189     MEI_HBMS_CLIENT_NOT_FOUND  = 1,
0190     MEI_HBMS_ALREADY_EXISTS    = 2,
0191     MEI_HBMS_REJECTED          = 3,
0192     MEI_HBMS_INVALID_PARAMETER = 4,
0193     MEI_HBMS_NOT_ALLOWED       = 5,
0194     MEI_HBMS_ALREADY_STARTED   = 6,
0195     MEI_HBMS_NOT_STARTED       = 7,
0196 
0197     MEI_HBMS_MAX
0198 };
0199 
0200 
0201 /*
0202  * Client Connect Status
0203  * used by hbm_client_connect_response.status
0204  */
0205 enum mei_cl_connect_status {
0206     MEI_CL_CONN_SUCCESS          = MEI_HBMS_SUCCESS,
0207     MEI_CL_CONN_NOT_FOUND        = MEI_HBMS_CLIENT_NOT_FOUND,
0208     MEI_CL_CONN_ALREADY_STARTED  = MEI_HBMS_ALREADY_EXISTS,
0209     MEI_CL_CONN_OUT_OF_RESOURCES = MEI_HBMS_REJECTED,
0210     MEI_CL_CONN_MESSAGE_SMALL    = MEI_HBMS_INVALID_PARAMETER,
0211     MEI_CL_CONN_NOT_ALLOWED      = MEI_HBMS_NOT_ALLOWED,
0212 };
0213 
0214 /*
0215  * Client Disconnect Status
0216  */
0217 enum mei_cl_disconnect_status {
0218     MEI_CL_DISCONN_SUCCESS = MEI_HBMS_SUCCESS
0219 };
0220 
0221 /**
0222  * enum mei_ext_hdr_type - extended header type used in
0223  *    extended header TLV
0224  *
0225  * @MEI_EXT_HDR_NONE: sentinel
0226  * @MEI_EXT_HDR_VTAG: vtag header
0227  */
0228 enum mei_ext_hdr_type {
0229     MEI_EXT_HDR_NONE = 0,
0230     MEI_EXT_HDR_VTAG = 1,
0231 };
0232 
0233 /**
0234  * struct mei_ext_hdr - extend header descriptor (TLV)
0235  * @type: enum mei_ext_hdr_type
0236  * @length: length excluding descriptor
0237  * @ext_payload: payload of the specific extended header
0238  * @hdr: place holder for actual header
0239  */
0240 struct mei_ext_hdr {
0241     u8 type;
0242     u8 length;
0243     u8 data[];
0244 } __packed;
0245 
0246 /**
0247  * struct mei_ext_meta_hdr - extend header meta data
0248  * @count: number of headers
0249  * @size: total size of the extended header list excluding meta header
0250  * @reserved: reserved
0251  * @hdrs: extended headers TLV list
0252  */
0253 struct mei_ext_meta_hdr {
0254     u8 count;
0255     u8 size;
0256     u8 reserved[2];
0257     u8 hdrs[];
0258 } __packed;
0259 
0260 /**
0261  * struct mei_ext_hdr_vtag - extend header for vtag
0262  *
0263  * @hdr: standard extend header
0264  * @vtag: virtual tag
0265  * @reserved: reserved
0266  */
0267 struct mei_ext_hdr_vtag {
0268     struct mei_ext_hdr hdr;
0269     u8 vtag;
0270     u8 reserved;
0271 } __packed;
0272 
0273 /*
0274  * Extended header iterator functions
0275  */
0276 /**
0277  * mei_ext_hdr - extended header iterator begin
0278  *
0279  * @meta: meta header of the extended header list
0280  *
0281  * Return:
0282  *     The first extended header
0283  */
0284 static inline struct mei_ext_hdr *mei_ext_begin(struct mei_ext_meta_hdr *meta)
0285 {
0286     return (struct mei_ext_hdr *)meta->hdrs;
0287 }
0288 
0289 /**
0290  * mei_ext_last - check if the ext is the last one in the TLV list
0291  *
0292  * @meta: meta header of the extended header list
0293  * @ext: a meta header on the list
0294  *
0295  * Return: true if ext is the last header on the list
0296  */
0297 static inline bool mei_ext_last(struct mei_ext_meta_hdr *meta,
0298                 struct mei_ext_hdr *ext)
0299 {
0300     return (u8 *)ext >= (u8 *)meta + sizeof(*meta) + (meta->size * 4);
0301 }
0302 
0303 /**
0304  * mei_ext_next - following extended header on the TLV list
0305  *
0306  * @ext: current extend header
0307  *
0308  * Context: The function does not check for the overflows,
0309  *          one should call mei_ext_last before.
0310  *
0311  * Return: The following extend header after @ext
0312  */
0313 static inline struct mei_ext_hdr *mei_ext_next(struct mei_ext_hdr *ext)
0314 {
0315     return (struct mei_ext_hdr *)((u8 *)ext + (ext->length * 4));
0316 }
0317 
0318 /**
0319  * struct mei_msg_hdr - MEI BUS Interface Section
0320  *
0321  * @me_addr: device address
0322  * @host_addr: host address
0323  * @length: message length
0324  * @reserved: reserved
0325  * @extended: message has extended header
0326  * @dma_ring: message is on dma ring
0327  * @internal: message is internal
0328  * @msg_complete: last packet of the message
0329  * @extension: extension of the header
0330  */
0331 struct mei_msg_hdr {
0332     u32 me_addr:8;
0333     u32 host_addr:8;
0334     u32 length:9;
0335     u32 reserved:3;
0336     u32 extended:1;
0337     u32 dma_ring:1;
0338     u32 internal:1;
0339     u32 msg_complete:1;
0340     u32 extension[];
0341 } __packed;
0342 
0343 /* The length is up to 9 bits */
0344 #define MEI_MSG_MAX_LEN_MASK GENMASK(9, 0)
0345 
0346 struct mei_bus_message {
0347     u8 hbm_cmd;
0348     u8 data[];
0349 } __packed;
0350 
0351 /**
0352  * struct hbm_cl_cmd - client specific host bus command
0353  *  CONNECT, DISCONNECT, and FlOW CONTROL
0354  *
0355  * @hbm_cmd: bus message command header
0356  * @me_addr: address of the client in ME
0357  * @host_addr: address of the client in the driver
0358  * @data: generic data
0359  */
0360 struct mei_hbm_cl_cmd {
0361     u8 hbm_cmd;
0362     u8 me_addr;
0363     u8 host_addr;
0364     u8 data;
0365 };
0366 
0367 struct hbm_version {
0368     u8 minor_version;
0369     u8 major_version;
0370 } __packed;
0371 
0372 struct hbm_host_version_request {
0373     u8 hbm_cmd;
0374     u8 reserved;
0375     struct hbm_version host_version;
0376 } __packed;
0377 
0378 struct hbm_host_version_response {
0379     u8 hbm_cmd;
0380     u8 host_version_supported;
0381     struct hbm_version me_max_version;
0382 } __packed;
0383 
0384 struct hbm_host_stop_request {
0385     u8 hbm_cmd;
0386     u8 reason;
0387     u8 reserved[2];
0388 } __packed;
0389 
0390 struct hbm_host_stop_response {
0391     u8 hbm_cmd;
0392     u8 reserved[3];
0393 } __packed;
0394 
0395 struct hbm_me_stop_request {
0396     u8 hbm_cmd;
0397     u8 reason;
0398     u8 reserved[2];
0399 } __packed;
0400 
0401 /**
0402  * enum hbm_host_enum_flags - enumeration request flags (HBM version >= 2.0)
0403  *
0404  * @MEI_HBM_ENUM_F_ALLOW_ADD: allow dynamic clients add
0405  * @MEI_HBM_ENUM_F_IMMEDIATE_ENUM: allow FW to send answer immediately
0406  */
0407 enum hbm_host_enum_flags {
0408     MEI_HBM_ENUM_F_ALLOW_ADD = BIT(0),
0409     MEI_HBM_ENUM_F_IMMEDIATE_ENUM = BIT(1),
0410 };
0411 
0412 /**
0413  * struct hbm_host_enum_request - enumeration request from host to fw
0414  *
0415  * @hbm_cmd : bus message command header
0416  * @flags   : request flags
0417  * @reserved: reserved
0418  */
0419 struct hbm_host_enum_request {
0420     u8 hbm_cmd;
0421     u8 flags;
0422     u8 reserved[2];
0423 } __packed;
0424 
0425 struct hbm_host_enum_response {
0426     u8 hbm_cmd;
0427     u8 reserved[3];
0428     u8 valid_addresses[32];
0429 } __packed;
0430 
0431 /**
0432  * struct mei_client_properties - mei client properties
0433  *
0434  * @protocol_name: guid of the client
0435  * @protocol_version: client protocol version
0436  * @max_number_of_connections: number of possible connections.
0437  * @fixed_address: fixed me address (0 if the client is dynamic)
0438  * @single_recv_buf: 1 if all connections share a single receive buffer.
0439  * @vt_supported: the client support vtag
0440  * @reserved: reserved
0441  * @max_msg_length: MTU of the client
0442  */
0443 struct mei_client_properties {
0444     uuid_le protocol_name;
0445     u8 protocol_version;
0446     u8 max_number_of_connections;
0447     u8 fixed_address;
0448     u8 single_recv_buf:1;
0449     u8 vt_supported:1;
0450     u8 reserved:6;
0451     u32 max_msg_length;
0452 } __packed;
0453 
0454 struct hbm_props_request {
0455     u8 hbm_cmd;
0456     u8 me_addr;
0457     u8 reserved[2];
0458 } __packed;
0459 
0460 struct hbm_props_response {
0461     u8 hbm_cmd;
0462     u8 me_addr;
0463     u8 status;
0464     u8 reserved;
0465     struct mei_client_properties client_properties;
0466 } __packed;
0467 
0468 /**
0469  * struct hbm_add_client_request - request to add a client
0470  *     might be sent by fw after enumeration has already completed
0471  *
0472  * @hbm_cmd: bus message command header
0473  * @me_addr: address of the client in ME
0474  * @reserved: reserved
0475  * @client_properties: client properties
0476  */
0477 struct hbm_add_client_request {
0478     u8 hbm_cmd;
0479     u8 me_addr;
0480     u8 reserved[2];
0481     struct mei_client_properties client_properties;
0482 } __packed;
0483 
0484 /**
0485  * struct hbm_add_client_response - response to add a client
0486  *     sent by the host to report client addition status to fw
0487  *
0488  * @hbm_cmd: bus message command header
0489  * @me_addr: address of the client in ME
0490  * @status: if HBMS_SUCCESS then the client can now accept connections.
0491  * @reserved: reserved
0492  */
0493 struct hbm_add_client_response {
0494     u8 hbm_cmd;
0495     u8 me_addr;
0496     u8 status;
0497     u8 reserved;
0498 } __packed;
0499 
0500 /**
0501  * struct hbm_power_gate - power gate request/response
0502  *
0503  * @hbm_cmd: bus message command header
0504  * @reserved: reserved
0505  */
0506 struct hbm_power_gate {
0507     u8 hbm_cmd;
0508     u8 reserved[3];
0509 } __packed;
0510 
0511 /**
0512  * struct hbm_client_connect_request - connect/disconnect request
0513  *
0514  * @hbm_cmd: bus message command header
0515  * @me_addr: address of the client in ME
0516  * @host_addr: address of the client in the driver
0517  * @reserved: reserved
0518  */
0519 struct hbm_client_connect_request {
0520     u8 hbm_cmd;
0521     u8 me_addr;
0522     u8 host_addr;
0523     u8 reserved;
0524 } __packed;
0525 
0526 /**
0527  * struct hbm_client_connect_response - connect/disconnect response
0528  *
0529  * @hbm_cmd: bus message command header
0530  * @me_addr: address of the client in ME
0531  * @host_addr: address of the client in the driver
0532  * @status: status of the request
0533  */
0534 struct hbm_client_connect_response {
0535     u8 hbm_cmd;
0536     u8 me_addr;
0537     u8 host_addr;
0538     u8 status;
0539 } __packed;
0540 
0541 
0542 #define MEI_FC_MESSAGE_RESERVED_LENGTH           5
0543 
0544 struct hbm_flow_control {
0545     u8 hbm_cmd;
0546     u8 me_addr;
0547     u8 host_addr;
0548     u8 reserved[MEI_FC_MESSAGE_RESERVED_LENGTH];
0549 } __packed;
0550 
0551 #define MEI_HBM_NOTIFICATION_START 1
0552 #define MEI_HBM_NOTIFICATION_STOP  0
0553 /**
0554  * struct hbm_notification_request - start/stop notification request
0555  *
0556  * @hbm_cmd: bus message command header
0557  * @me_addr: address of the client in ME
0558  * @host_addr: address of the client in the driver
0559  * @start:  start = 1 or stop = 0 asynchronous notifications
0560  */
0561 struct hbm_notification_request {
0562     u8 hbm_cmd;
0563     u8 me_addr;
0564     u8 host_addr;
0565     u8 start;
0566 } __packed;
0567 
0568 /**
0569  * struct hbm_notification_response - start/stop notification response
0570  *
0571  * @hbm_cmd: bus message command header
0572  * @me_addr: address of the client in ME
0573  * @host_addr: - address of the client in the driver
0574  * @status: (mei_hbm_status) response status for the request
0575  *  - MEI_HBMS_SUCCESS: successful stop/start
0576  *  - MEI_HBMS_CLIENT_NOT_FOUND: if the connection could not be found.
0577  *  - MEI_HBMS_ALREADY_STARTED: for start requests for a previously
0578  *                         started notification.
0579  *  - MEI_HBMS_NOT_STARTED: for stop request for a connected client for whom
0580  *                         asynchronous notifications are currently disabled.
0581  *
0582  * @start:  start = 1 or stop = 0 asynchronous notifications
0583  * @reserved: reserved
0584  */
0585 struct hbm_notification_response {
0586     u8 hbm_cmd;
0587     u8 me_addr;
0588     u8 host_addr;
0589     u8 status;
0590     u8 start;
0591     u8 reserved[3];
0592 } __packed;
0593 
0594 /**
0595  * struct hbm_notification - notification event
0596  *
0597  * @hbm_cmd: bus message command header
0598  * @me_addr:  address of the client in ME
0599  * @host_addr:  address of the client in the driver
0600  * @reserved: reserved for alignment
0601  */
0602 struct hbm_notification {
0603     u8 hbm_cmd;
0604     u8 me_addr;
0605     u8 host_addr;
0606     u8 reserved;
0607 } __packed;
0608 
0609 /**
0610  * struct hbm_dma_mem_dscr - dma ring
0611  *
0612  * @addr_hi: the high 32bits of 64 bit address
0613  * @addr_lo: the low  32bits of 64 bit address
0614  * @size   : size in bytes (must be power of 2)
0615  */
0616 struct hbm_dma_mem_dscr {
0617     u32 addr_hi;
0618     u32 addr_lo;
0619     u32 size;
0620 } __packed;
0621 
0622 enum {
0623     DMA_DSCR_HOST = 0,
0624     DMA_DSCR_DEVICE = 1,
0625     DMA_DSCR_CTRL = 2,
0626     DMA_DSCR_NUM,
0627 };
0628 
0629 /**
0630  * struct hbm_dma_setup_request - dma setup request
0631  *
0632  * @hbm_cmd: bus message command header
0633  * @reserved: reserved for alignment
0634  * @dma_dscr: dma descriptor for HOST, DEVICE, and CTRL
0635  */
0636 struct hbm_dma_setup_request {
0637     u8 hbm_cmd;
0638     u8 reserved[3];
0639     struct hbm_dma_mem_dscr dma_dscr[DMA_DSCR_NUM];
0640 } __packed;
0641 
0642 /**
0643  * struct hbm_dma_setup_response - dma setup response
0644  *
0645  * @hbm_cmd: bus message command header
0646  * @status: 0 on success; otherwise DMA setup failed.
0647  * @reserved: reserved for alignment
0648  */
0649 struct hbm_dma_setup_response {
0650     u8 hbm_cmd;
0651     u8 status;
0652     u8 reserved[2];
0653 } __packed;
0654 
0655 /**
0656  * struct mei_dma_ring_ctrl - dma ring control block
0657  *
0658  * @hbuf_wr_idx: host circular buffer write index in slots
0659  * @reserved1: reserved for alignment
0660  * @hbuf_rd_idx: host circular buffer read index in slots
0661  * @reserved2: reserved for alignment
0662  * @dbuf_wr_idx: device circular buffer write index in slots
0663  * @reserved3: reserved for alignment
0664  * @dbuf_rd_idx: device circular buffer read index in slots
0665  * @reserved4: reserved for alignment
0666  */
0667 struct hbm_dma_ring_ctrl {
0668     u32 hbuf_wr_idx;
0669     u32 reserved1;
0670     u32 hbuf_rd_idx;
0671     u32 reserved2;
0672     u32 dbuf_wr_idx;
0673     u32 reserved3;
0674     u32 dbuf_rd_idx;
0675     u32 reserved4;
0676 } __packed;
0677 
0678 /* virtual tag supported */
0679 #define HBM_CAP_VT BIT(0)
0680 /* client dma supported */
0681 #define HBM_CAP_CD BIT(2)
0682 
0683 /**
0684  * struct hbm_capability_request - capability request from host to fw
0685  *
0686  * @hbm_cmd : bus message command header
0687  * @capability_requested: bitmask of capabilities requested by host
0688  */
0689 struct hbm_capability_request {
0690     u8 hbm_cmd;
0691     u8 capability_requested[3];
0692 } __packed;
0693 
0694 /**
0695  * struct hbm_capability_response - capability response from fw to host
0696  *
0697  * @hbm_cmd : bus message command header
0698  * @capability_granted: bitmask of capabilities granted by FW
0699  */
0700 struct hbm_capability_response {
0701     u8 hbm_cmd;
0702     u8 capability_granted[3];
0703 } __packed;
0704 
0705 /**
0706  * struct hbm_client_dma_map_request - client dma map request from host to fw
0707  *
0708  * @hbm_cmd: bus message command header
0709  * @client_buffer_id: client buffer id
0710  * @reserved: reserved
0711  * @address_lsb: DMA address LSB
0712  * @address_msb: DMA address MSB
0713  * @size: DMA size
0714  */
0715 struct hbm_client_dma_map_request {
0716     u8 hbm_cmd;
0717     u8 client_buffer_id;
0718     u8 reserved[2];
0719     u32 address_lsb;
0720     u32 address_msb;
0721     u32 size;
0722 } __packed;
0723 
0724 /**
0725  * struct hbm_client_dma_unmap_request
0726  *    client dma unmap request from the host to the firmware
0727  *
0728  * @hbm_cmd: bus message command header
0729  * @status: unmap status
0730  * @client_buffer_id: client buffer id
0731  * @reserved: reserved
0732  */
0733 struct hbm_client_dma_unmap_request {
0734     u8 hbm_cmd;
0735     u8 status;
0736     u8 client_buffer_id;
0737     u8 reserved;
0738 } __packed;
0739 
0740 /**
0741  * struct hbm_client_dma_response
0742  *   client dma unmap response from the firmware to the host
0743  *
0744  * @hbm_cmd: bus message command header
0745  * @status: command status
0746  */
0747 struct hbm_client_dma_response {
0748     u8 hbm_cmd;
0749     u8 status;
0750 } __packed;
0751 
0752 #endif