Andrew Jeffery | 4fe996c | 2018-02-27 12:16:48 +1030 | [diff] [blame] | 1 | /* SPDX-License-Identifier: Apache-2.0 */ |
| 2 | /* Copyright (C) 2018 IBM Corp. */ |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 3 | |
| 4 | #ifndef MBOXD_MSG_H |
| 5 | #define MBOXD_MSG_H |
| 6 | |
Suraj Jitindar Singh | 5a3a066 | 2017-04-27 11:55:26 +1000 | [diff] [blame] | 7 | #include "common.h" |
| 8 | |
| 9 | /* Estimate as to how long (milliseconds) it takes to access a MB from flash */ |
| 10 | #define FLASH_ACCESS_MS_PER_MB 8000 |
| 11 | |
| 12 | #define NO_BMC_EVENT false |
| 13 | #define SET_BMC_EVENT true |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 14 | |
| 15 | struct mbox_msg { |
| 16 | uint8_t command; |
| 17 | uint8_t seq; |
| 18 | uint8_t args[MBOX_ARGS_BYTES]; |
| 19 | uint8_t response; |
| 20 | }; |
| 21 | |
| 22 | union mbox_regs { |
| 23 | char raw[MBOX_REG_BYTES]; |
| 24 | struct mbox_msg msg; |
| 25 | }; |
| 26 | |
| 27 | int set_bmc_events(struct mbox_context *context, uint8_t bmc_event, |
| 28 | bool write_back); |
| 29 | int clr_bmc_events(struct mbox_context *context, uint8_t bmc_event, |
| 30 | bool write_back); |
| 31 | int dispatch_mbox(struct mbox_context *context); |
| 32 | int init_mbox_dev(struct mbox_context *context); |
| 33 | void free_mbox_dev(struct mbox_context *context); |
| 34 | |
| 35 | #endif /* MBOXD_MSG_H */ |