Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 IBM |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | * |
| 16 | */ |
| 17 | |
| 18 | #ifndef MBOXD_MSG_H |
| 19 | #define MBOXD_MSG_H |
| 20 | |
Suraj Jitindar Singh | 5a3a066 | 2017-04-27 11:55:26 +1000 | [diff] [blame] | 21 | #include "common.h" |
| 22 | |
| 23 | /* Estimate as to how long (milliseconds) it takes to access a MB from flash */ |
| 24 | #define FLASH_ACCESS_MS_PER_MB 8000 |
| 25 | |
| 26 | #define NO_BMC_EVENT false |
| 27 | #define SET_BMC_EVENT true |
Suraj Jitindar Singh | e39c916 | 2017-03-28 10:47:43 +1100 | [diff] [blame] | 28 | |
| 29 | struct mbox_msg { |
| 30 | uint8_t command; |
| 31 | uint8_t seq; |
| 32 | uint8_t args[MBOX_ARGS_BYTES]; |
| 33 | uint8_t response; |
| 34 | }; |
| 35 | |
| 36 | union mbox_regs { |
| 37 | char raw[MBOX_REG_BYTES]; |
| 38 | struct mbox_msg msg; |
| 39 | }; |
| 40 | |
| 41 | int set_bmc_events(struct mbox_context *context, uint8_t bmc_event, |
| 42 | bool write_back); |
| 43 | int clr_bmc_events(struct mbox_context *context, uint8_t bmc_event, |
| 44 | bool write_back); |
| 45 | int dispatch_mbox(struct mbox_context *context); |
| 46 | int init_mbox_dev(struct mbox_context *context); |
| 47 | void free_mbox_dev(struct mbox_context *context); |
| 48 | |
| 49 | #endif /* MBOXD_MSG_H */ |