summaryrefslogtreecommitdiff
path: root/include/sbi_utils/mailbox/rpmi_mailbox.h
blob: a23ad8ca10356af263b29dfcab59999836edd505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Copyright (c) 2023 Ventana Micro Systems Inc.
 *
 * Authors:
 *   Anup Patel <[email protected]>
 */

#ifndef __RPMI_MAILBOX_H__
#define __RPMI_MAILBOX_H__

#include <sbi/sbi_error.h>
#include <sbi_utils/mailbox/mailbox.h>
#include <sbi_utils/mailbox/rpmi_msgprot.h>

#define rpmi_u32_count(__var)	(sizeof(__var) / sizeof(u32))

/** Convert RPMI error to SBI error */
int rpmi_xlate_error(enum rpmi_error error);

/** Typical RPMI normal request with at least status code in response */
int rpmi_normal_request_with_status(
			struct mbox_chan *chan, u32 service_id,
			void *req, u32 req_words, u32 req_endian_words,
			void *resp, u32 resp_words, u32 resp_endian_words);

/* RPMI posted request which is without any response*/
int rpmi_posted_request(
		struct mbox_chan *chan, u32 service_id,
		void *req, u32 req_words, u32 req_endian_words);

#endif /* !__RPMI_MAILBOX_H__ */