forked from Mirrors/opensbi

The RISC-V Platform Management Interface (RPMI) defines a messaging protocol and shared memory based transport for bi-directional communication with an on-chip or external microcontroller. To support RPMI in OpenSBI, add: 1) The RPMI messaging protocol defines and helper macros 2) A FDT mailbox driver for the RPMI shared memory transport Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com> Co-developed-by: Subrahmanya Lingappa <slingappa@ventanamicro.com> Signed-off-by: Subrahmanya Lingappa <slingappa@ventanamicro.com> Co-developed-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Anup Patel <apatel@ventanamicro.com>
33 lines
898 B
C
33 lines
898 B
C
/*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*
|
|
* Copyright (c) 2023 Ventana Micro Systems Inc.
|
|
*
|
|
* Authors:
|
|
* Anup Patel <apatel@ventanamicro.com>
|
|
*/
|
|
|
|
#ifndef __RPMI_MAILBOX_H__
|
|
#define __RPMI_MAILBOX_H__
|
|
|
|
#include <sbi/sbi_error.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__ */
|