42#include "debug/SCMI.hh"
54 readMessageEvent([
this]{ readMessage(); },
name()),
55 handleMessageEvent([
this]{ handleMessage(); },
name())
66 DPRINTF(SCMI,
"Pending message\n");
87 DPRINTF(SCMI,
"SCMI Virtual channel %u, channel.status: %u\n",
113 DPRINTF(SCMI,
"SCMI Virtual channel %u, message.length: %u\n",
126 "SCMI Virtual channel %u, message.header: %#x\n",
138 notifyAgentEvent([
this]{ notifyAgent(); },
name()),
139 completeEvent([
this]{ complete(); },
name()),
141 platformDoorbellVal(0)
148 "SCMI Virtual channel %u, writing back message %u"
149 " with status code: %d\n",
167 "SCMI Virtual channel %u, clearing doorbell\n",
185 "SCMI Virtual channel %u, notifying agent\n",
209 for (
auto comm :
comms) {
210 comm->agentChan->dmaPort = &
dmaPort;
211 comm->agentChan->setPlatform(
this);
213 comm->platformChan->dmaPort = &
dmaPort;
214 comm->platformChan->setPlatform(
this);
218 "The number of instantiated protocols are not matching the"
219 " architected limit");
232 if (if_name ==
"dma") {
246 "Unimplemented SCMI protocol: %u\n", prot_id);
261 DPRINTF(SCMI,
"Raise interrupt in SCMI platform\n");
267 for (
auto comm :
comms) {
268 auto channel = comm->agentChan;
269 if (channel->doorbell == doorbell) {
272 channel->initiateRead();
277 panic(
"No matching virtual channel\n");
283 DPRINTF(SCMI,
"Clear interrupt in SCMI platform\n");
289 for (
auto comm :
comms) {
290 if (comm->platformChan == platform) {
291 return comm->agentChan;
301 for (
auto comm :
comms) {
302 if (comm->agentChan == agent) {
303 return comm->platformChan;
void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, Tick delay, Request::Flags flag=0)
Generic doorbell interface.
Addr clearAddress() const
Ports are used to interface objects to each other.
@ UNCACHEABLE
The request is to an uncacheable address.
This is a Agent to Platform channel (The agent is the initiator)
AgentChannel(const ScmiChannelParams &p)
EventFunctionWrapper handleMessageEvent
EventFunctionWrapper readLengthEvent
EventFunctionWrapper readMessageEvent
This protocol describes the properties of the implementation and provides generic error management.
virtual void handleMessage(Message &msg)=0
Generic communication channel between the Agent and the Platform.
Addr start() const
Get the start address of the range.
#define panic(...)
This implements a cprintf based panic() function.
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
static const uint8_t PROTOCOL_MAX
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
const std::string & name()