xref: /openbmc/linux/drivers/misc/mei/hbm.h (revision c55bf542e91b5c9156d57fd0461aa257b7d20858)
10edb23fcSTomas Winkler /*
20edb23fcSTomas Winkler  *
30edb23fcSTomas Winkler  * Intel Management Engine Interface (Intel MEI) Linux driver
40edb23fcSTomas Winkler  * Copyright (c) 2003-2012, Intel Corporation.
50edb23fcSTomas Winkler  *
60edb23fcSTomas Winkler  * This program is free software; you can redistribute it and/or modify it
70edb23fcSTomas Winkler  * under the terms and conditions of the GNU General Public License,
80edb23fcSTomas Winkler  * version 2, as published by the Free Software Foundation.
90edb23fcSTomas Winkler  *
100edb23fcSTomas Winkler  * This program is distributed in the hope it will be useful, but WITHOUT
110edb23fcSTomas Winkler  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
120edb23fcSTomas Winkler  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
130edb23fcSTomas Winkler  * more details.
140edb23fcSTomas Winkler  *
150edb23fcSTomas Winkler  */
160edb23fcSTomas Winkler 
170edb23fcSTomas Winkler #ifndef _MEI_HBM_H_
180edb23fcSTomas Winkler #define _MEI_HBM_H_
190edb23fcSTomas Winkler 
209b0d5efcSTomas Winkler struct mei_device;
219b0d5efcSTomas Winkler struct mei_msg_hdr;
229b0d5efcSTomas Winkler struct mei_cl;
239b0d5efcSTomas Winkler 
249b0d5efcSTomas Winkler /**
259b0d5efcSTomas Winkler  * enum mei_hbm_state - host bus message protocol state
269b0d5efcSTomas Winkler  *
279b0d5efcSTomas Winkler  * @MEI_HBM_IDLE : protocol not started
28cb02efc3SAlexander Usyskin  * @MEI_HBM_STARTING : start request message was sent
29*c55bf542STomas Winkler  * @MEI_HBM_DR_SETUP : dma ring setup request message was sent
309b0d5efcSTomas Winkler  * @MEI_HBM_ENUM_CLIENTS : enumeration request was sent
319b0d5efcSTomas Winkler  * @MEI_HBM_CLIENT_PROPERTIES : acquiring clients properties
325ebdc364STomas Winkler  * @MEI_HBM_STARTED : enumeration was completed
33cb02efc3SAlexander Usyskin  * @MEI_HBM_STOPPED : stopping exchange
349b0d5efcSTomas Winkler  */
359b0d5efcSTomas Winkler enum mei_hbm_state {
369b0d5efcSTomas Winkler 	MEI_HBM_IDLE = 0,
37cb02efc3SAlexander Usyskin 	MEI_HBM_STARTING,
38*c55bf542STomas Winkler 	MEI_HBM_DR_SETUP,
399b0d5efcSTomas Winkler 	MEI_HBM_ENUM_CLIENTS,
409b0d5efcSTomas Winkler 	MEI_HBM_CLIENT_PROPERTIES,
415ebdc364STomas Winkler 	MEI_HBM_STARTED,
42544f9460STomas Winkler 	MEI_HBM_STOPPED,
439b0d5efcSTomas Winkler };
449b0d5efcSTomas Winkler 
451beeb4b9SAlexander Usyskin const char *mei_hbm_state_str(enum mei_hbm_state state);
461beeb4b9SAlexander Usyskin 
47544f9460STomas Winkler int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr);
480edb23fcSTomas Winkler 
4966ae460bSTomas Winkler void mei_hbm_idle(struct mei_device *dev);
5084b3294aSTomas Winkler void mei_hbm_reset(struct mei_device *dev);
519b0d5efcSTomas Winkler int mei_hbm_start_req(struct mei_device *dev);
529b0d5efcSTomas Winkler int mei_hbm_start_wait(struct mei_device *dev);
530edb23fcSTomas Winkler int mei_hbm_cl_flow_control_req(struct mei_device *dev, struct mei_cl *cl);
540edb23fcSTomas Winkler int mei_hbm_cl_disconnect_req(struct mei_device *dev, struct mei_cl *cl);
556bb948c9STomas Winkler int mei_hbm_cl_disconnect_rsp(struct mei_device *dev, struct mei_cl *cl);
560edb23fcSTomas Winkler int mei_hbm_cl_connect_req(struct mei_device *dev, struct mei_cl *cl);
572c9b48acSTomas Winkler bool mei_hbm_version_is_supported(struct mei_device *dev);
584fcbc99bSTomas Winkler int mei_hbm_pg(struct mei_device *dev, u8 pg_cmd);
59859ef2ffSAlexander Usyskin void mei_hbm_pg_resume(struct mei_device *dev);
60965ae37aSTomas Winkler int mei_hbm_cl_notify_req(struct mei_device *dev,
61965ae37aSTomas Winkler 			  struct mei_cl *cl, u8 request);
620edb23fcSTomas Winkler 
630edb23fcSTomas Winkler #endif /* _MEI_HBM_H_ */
640edb23fcSTomas Winkler 
65