Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RPMI Message Protocol chapter #35

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

pathakraul
Copy link
Collaborator

This PR contains improvements to message protocol chapter.

@pathakraul
Copy link
Collaborator Author

@lftan I suggest getting this PR merged first before others since it changes the message format which will affect all service groups

message request being sent to the Platform Microcontroller for a specific
purpose. Each service may have an associated response message which enables the
Platform Microcontroller to provide the status or information for that request.
RPMI message protocol defines the message format and different messages
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The RPMI Message Protocol..."

missing 'The'

designated to perform a specific task. Multiple similar services are grouped
logically into a *Service Group* like Clock, Voltage, Power management, etc.
A service call results in a request message being sent on a transport
channel from application processor to platform micro-controller or vice-versa.
Copy link
Collaborator

@lftan lftan Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"channel from the application processor to the Platform Microcontroller or vice-versa."

logically into a *Service Group* like Clock, Voltage, Power management, etc.
A service call results in a request message being sent on a transport
channel from application processor to platform micro-controller or vice-versa.
If the request has an associated response, the platform micro-controller after
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we standardize to use "Platform Microcontroller" in other chapters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done the suggested changes


Not every request message needs an acknowledgement due the the nature of the
action requested by the application processor when taken by the platform
microcontroller may leave the application processor in a state where it cannot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to "Platform Microcontroller", can u search all in this adoc? Got 4 places need to update this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also for "Application Processor".
Other adoc files use "Application Processor" instead of 'application processor'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not expecting having first letter in caps in between the sentence for these names. Its will look odd, since these are not acronyms

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other chapters use these now. I am ok if not use capital letter for the first letter, just need to standardize for all.
Can have another commit to update them.

to any previous message request. Acknowledgment is dependent on the service and
each service dictates if acknowledgment is mandatory or not.
Messages which carry the status of the request message after its been processed
successfully. Acknowledgement message may also carry the additional data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The Acknowledgement message ..."

acknowledgment must follow byte ordering defined by the RPMI transport.
Size of message header is fixed, but size of data is implementation defined,
based on the transport queues layout. All fields message must follow byte
ordering defined by the RPMI transport.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All message fields must follow the byte order defined by the RPMI transport.

Message header has a fixed size of `12-byte` which further contains three
fields each of `4-byte`. Each message gets a unique identity in an RPMI instance
through its header.
image::message-format.png[700,900]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Figure title.


Both REQUEST and ACKNOWLEDGEMENT messages have the same message format.
==== Message layout tables
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message Layout Tables

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use capital letter for first character of each word for section title


image::message-format.png[700,900]
[#table_message_layout_table_example]
.Message layout table example
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message Layout Table Example

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use capital letter for first character of each word for table title.

Both REQUEST and ACKNOWLEDGEMENT messages have the same message format.
==== Message layout tables
Message layout which includes header and data is represented in the form of
tables like below. Some columns mentioned below may be omitted from some of the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"..... tables as shown below."


Both REQUEST and ACKNOWLEDGEMENT messages have the same message format.
==== Message layout tables
Message layout which includes header and data is represented in the form of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The message layout ..."


| Every message is indexed with *Word* starting from `0` and each index
represents a `4-byte` portion of a message.
| Name of a `4-byte` size portion of a message.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have Name for a struct, so need change description here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont understand this comment

|===

==== Message Header
Message header of `8-byte` has a fixed layout which consists of multiple fields.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can change to :

The 8-byte message header has a fixed layout composed of multiple fields. Each message is uniquely identified within an RPMI instance by its header.


FLAGS[3]: DOORBELL
0b0: Doorbell interrupt enabled.
0b1: Doorbell interrupt disabled. PuC will not ring the doorbell to AP.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PuC will not ring the doorbell to the AP.

`FLAGS` with notification `MESSAGE_TYPE` marked. Notification messages do not
require any acknowledgement and how data from notification messages is utilized
is dependent on the implementation.
In case of normal request which require acknowledgement, platform
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"In the case of normal ...."

require any acknowledgement and how data from notification messages is utilized
is dependent on the implementation.
In case of normal request which require acknowledgement, platform
microcontroller must preserve the `TOKEN`, `SERVICEGROUP_ID`, `SERVICE_ID`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the Platform Microcontroller"

is dependent on the implementation.
In case of normal request which require acknowledgement, platform
microcontroller must preserve the `TOKEN`, `SERVICEGROUP_ID`, `SERVICE_ID`
from the request message header and use these fields in acknowledgement message
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" ... in the acknowledgement message ...."

In case of normal request which require acknowledgement, platform
microcontroller must preserve the `TOKEN`, `SERVICEGROUP_ID`, `SERVICE_ID`
from the request message header and use these fields in acknowledgement message
header. Platform microcontroller must mark the message type as
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The Platform Microcontroller ....."

In case of normal request which require acknowledgement, platform
microcontroller must preserve the `TOKEN`, `SERVICEGROUP_ID`, `SERVICE_ID`
from the request message header and use these fields in acknowledgement message
header. Platform microcontroller must mark the message type as
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change 'mark' to 'set' is better

from the request message header and use these fields in acknowledgement message
header. Platform microcontroller must mark the message type as
`ACKNOWLEDGEMENT` in the `FLAGS` and update the `DATALEN` depending on the
data supported by that acknowledgement.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

".... this acknowledgement."

header. Platform microcontroller must mark the message type as
`ACKNOWLEDGEMENT` in the `FLAGS` and update the `DATALEN` depending on the
data supported by that acknowledgement.
In case of notification, the platform microcontroller will generate the `TOKEN`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"In the case of a notification, ..."

In case of notification, the platform microcontroller will generate the `TOKEN`
and set the `SERVICEGROUP_ID` and fixed `SERVICE_ID=0x00` assigned for each
notification message in each service group and set the
`FLAGS` with message type as `NOTIFICATION`. Notification messages do not
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" ... with the message type"


==== Message Data
Request message data format and acknowledgement data format depends on each
Message data for any message type if present must be multiple of `4-byte`. Each
Copy link
Collaborator

@lftan lftan Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"... must be a multiple of 4-bytes."


==== Message Data
Request message data format and acknowledgement data format depends on each
Message data for any message type if present must be multiple of `4-byte`. Each
of that `4-byte` portion is called a *Word*. +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Each of these 4-bytes .... "

Request message data format and acknowledgement data format depends on each
Message data for any message type if present must be multiple of `4-byte`. Each
of that `4-byte` portion is called a *Word*. +
Data format for request and acknowledgement message depends on each
Copy link
Collaborator

@lftan lftan Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The data format for the request and .."


Message data formats in this specification are tabulated with a list of `32 bits`
wide Word in each of the service groups section as depicted below.
respective service groups. Maximum size of data each message can accommodate
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The maximum size .."

.Return Status Codes
[cols="4, 2, 6", width=100%, align="center", options="header"]
|===
| Name | Status Code | Description
| RPMI_SUCCESS | 0 | Successful operation
| RPMI_SUCCESS | 0 | Successful operation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary change

Apart from status code, an acknowledgement may encode more data as response to
the request message and details are subsequently present in each service section
below.
Acknowledgement message data contains `32-bit` STATUS code which represents the
Copy link
Collaborator

@lftan lftan Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STATUS, so that align with STATUS in line 169

notification messages. Notification message will only be sent for events which
the application processor has subscribed. When there are multiple events
supported in each service group, the application processor has to subscribe to
each event individually through reserved enable notification service in each
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think " reserved enable notification service" can be changed to "_ENABLE_NOTIFICATION" service"


[#img-notification-format]
.Notification Format
image::notification-format.png[500,600]

==== Events
Event consists of header containing two fields to
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An event consists of a header containing two fields to identify an event:

The number of events which can be accommodated in the message data depends on
the message data field size. The `DATALEN` field in the message header
represents the data size in bytes present in the message which is the aggregate
of all events size. Then the application processor must parse each event and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The Application Processor must then parse each .... "

of all events size. Then the application processor must parse each event and
its data according to the event header.

Event data and its format are specific to each service group and details are
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Event data and its format are specific to each service group, and details are provided in the respective
Service Group sections.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add "EVENT_HDR" for Word 0.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"EVENT_DATALEN-byte" here means in byte, rights?

If yes, then change to "EVENT_DATALEN (bytes)" is better.

!===
| 1 : (*EVENT_DATALEN* - 1) | *EVENT_DATA* | Event Data
| 1:(*EVENT_DATALEN/4*) | *EVENT_DATA* | Event Data
|===

Above table represents the format for one event with its data. Subsequent events
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The table above shows ....."

!===
| 1 : (*EVENT_DATALEN* - 1) | *EVENT_DATA* | Event Data
| 1:(*EVENT_DATALEN/4*) | *EVENT_DATA* | Event Data
|===

Above table represents the format for one event with its data. Subsequent events
will be packed in the same manner. This spec does not define any ordering of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This specification ....."

probable error codes for each service are also provided in each service response
message format. AP must check for each error code and action based on that is
dependent on the AP.
Below table lists all the error codes which can be returned by any service in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The following table lists .... "


[#table_error_codes]
[#table_rpmi_error_codes]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks the reference link from all the services.

.Return Status Codes
[cols="4, 2, 6", width=100%, align="center", options="header"]
|===
| Name | Status Code | Description
| RPMI_SUCCESS | 0 | Successful operation
| RPMI_SUCCESS | 0 | Successful operation
| RPMI_ERROR_FAILED | -1 | Failed due to general error
| RPMI_ERROR_NOT_SUPPORTED | -2 | Service or feature not supported
| RPMI_ERROR_INVALID_PARAMETER | -3 | One or more parameters passed are
Copy link
Collaborator

@lftan lftan Jul 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we can use ChatGPT to check the grammar or fine-tune any sentence. You can try. :)

or can use this website: https://www.deepl.com/en/write

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, DATALEN (bytes)

@pathakraul pathakraul force-pushed the messageformat branch 5 times, most recently from a06b0c8 to a0acb19 Compare August 7, 2024 04:04
dependent on the AP.
=== Return Error Codes
The table below lists all the error codes that can be returned by any service
in the in the `STATUS' word of the acknowledgement message.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after generating pdf doc, it shows word `STATUS'.

Should be STATUS, should be "`".

@lftan lftan merged commit e8f9258 into riscv-non-isa:main Aug 8, 2024
1 check passed
@pathakraul pathakraul deleted the messageformat branch November 9, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants