blob: d911b7b5f943c1f8b5d7f01d340d21f06d5782e4 [file] [log] [blame]
Andrew Jeffery4fe996c2018-02-27 12:16:48 +10301/* SPDX-License-Identifier: Apache-2.0 */
2/* Copyright (C) 2018 IBM Corp. */
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +11003
4#ifndef MBOXD_MSG_H
5#define MBOXD_MSG_H
6
Suraj Jitindar Singh5a3a0662017-04-27 11:55:26 +10007#include "common.h"
Andrew Jefferycc0bd3c2018-03-22 16:47:56 +10308#include "mbox.h"
Suraj Jitindar Singh5a3a0662017-04-27 11:55:26 +10009
10/* Estimate as to how long (milliseconds) it takes to access a MB from flash */
11#define FLASH_ACCESS_MS_PER_MB 8000
12
13#define NO_BMC_EVENT false
14#define SET_BMC_EVENT true
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110015
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110016int set_bmc_events(struct mbox_context *context, uint8_t bmc_event,
17 bool write_back);
18int clr_bmc_events(struct mbox_context *context, uint8_t bmc_event,
19 bool write_back);
20int dispatch_mbox(struct mbox_context *context);
21int init_mbox_dev(struct mbox_context *context);
22void free_mbox_dev(struct mbox_context *context);
23
Andrew Jeffery943aba02018-03-26 15:37:33 +103024/* Command handlers */
25int mbox_handle_reset(struct mbox_context *context,
26 union mbox_regs *req, struct mbox_msg *resp);
27int mbox_handle_mbox_info(struct mbox_context *context,
28 union mbox_regs *req, struct mbox_msg *resp);
29int mbox_handle_flash_info(struct mbox_context *context,
30 union mbox_regs *req, struct mbox_msg *resp);
31int mbox_handle_read_window(struct mbox_context *context,
32 union mbox_regs *req, struct mbox_msg *resp);
33int mbox_handle_close_window(struct mbox_context *context,
34 union mbox_regs *req, struct mbox_msg *resp);
35int mbox_handle_write_window(struct mbox_context *context,
36 union mbox_regs *req, struct mbox_msg *resp);
37int mbox_handle_dirty_window(struct mbox_context *context,
38 union mbox_regs *req, struct mbox_msg *resp);
39int mbox_handle_flush_window(struct mbox_context *context,
40 union mbox_regs *req, struct mbox_msg *resp);
41int mbox_handle_ack(struct mbox_context *context, union mbox_regs *req,
42 struct mbox_msg *resp);
43int mbox_handle_erase_window(struct mbox_context *context,
44 union mbox_regs *req, struct mbox_msg *resp);
45
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110046#endif /* MBOXD_MSG_H */