blob: 7d81d7a2b157d93b2d4ce648cdeabf96bb19f6c7 [file] [log] [blame]
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +11001/*
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 Singh5a3a0662017-04-27 11:55:26 +100021#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 Singhe39c9162017-03-28 10:47:43 +110028
29struct mbox_msg {
30 uint8_t command;
31 uint8_t seq;
32 uint8_t args[MBOX_ARGS_BYTES];
33 uint8_t response;
34};
35
36union mbox_regs {
37 char raw[MBOX_REG_BYTES];
38 struct mbox_msg msg;
39};
40
41int set_bmc_events(struct mbox_context *context, uint8_t bmc_event,
42 bool write_back);
43int clr_bmc_events(struct mbox_context *context, uint8_t bmc_event,
44 bool write_back);
45int dispatch_mbox(struct mbox_context *context);
46int init_mbox_dev(struct mbox_context *context);
47void free_mbox_dev(struct mbox_context *context);
48
49#endif /* MBOXD_MSG_H */