Skip to content

Commit

Permalink
rpmi: performance: Add memory region service
Browse files Browse the repository at this point in the history
Add 'PERF_GET_FAST_CHANNEL_REGION' service to
get a continuous block of physical memory region
for fast channel access.

Signed-off-by: Joshua Yeong <[email protected]>
  • Loading branch information
Joshua Yeong committed Dec 9, 2024
1 parent 2674515 commit 2a28a69
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 13 deletions.
84 changes: 71 additions & 13 deletions src/srvgrp-performance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The following table lists the services in the PERFORMANCE service group:
| 0x07 | PERF_GET_LIMIT | NORMAL_REQUEST
| 0x08 | PERF_SET_LIMIT | NORMAL_REQUEST
| 0x09 | PERF_GET_FAST_CHANNEL_ATTRIBUTES | NORMAL_REQUEST
| 0x0A | PERF_GET_FAST_CHANNEL_REGION | NORMAL_REQUEST
|===

[#section-perf-level]
Expand Down Expand Up @@ -102,6 +103,10 @@ The fast-channel currently supports only the following PERFORMANCE services:
* If fast-channel support is available, retrieve fast-channel attributes for
specific PERFORMANCE service call using the `PERF_GET_FAST_CHANNEL_ATTRIBUTES`
service call.
* The `PERF_GET_FAST_CHANNEL_REGION` provides physical memory for Performance
Service Group. The offset of the physical address of the 'Performance Domain /
Service ID' paired is based on the starting address in
`PERF_GET_FAST_CHANNEL_REGION` service.


*Doorbell Support*::
Expand Down Expand Up @@ -661,7 +666,7 @@ performance domain in the system.
! RPMI_ERR_INVALID_PARAM
! `DOMAIN_ID` or `LEVEL` is invalid.

! RPMI_ERR_DENIED
! RPMI_ERR_DENIED
! Denied due to no permission.

! RPMI_ERR_HW_FAULT
Expand Down Expand Up @@ -881,45 +886,98 @@ specific performance domain and performance service.
!===

| 2
|PHYS_ADDR_LOW
| PHYS_ADDR_OFFSET
| uint32
| Lower 32-bit of physical address.
| Offset of physical address region.

| 3
| PHYS_ADDR_HIGH
| uint32
| Upper 32-bit of physical address.

| 4
| DB_ADDR_LOW
| uint32
| Lower 32-bit of doorbell address. This field is unused if the doorbell is not supported.

| 5
| 4
| DB_ADDR_HIGH
| uint32
| Upper 32-bit of doorbell address. This field is unused if the doorbell is not supported.

| 6
| 5
|DB_ID_LOW
| uint32
| Lower 32-bit of doorbell ID. This field is unused if the doorbell is not supported.

| 7
| 6
| DB_ID_HIGH
| uint32
| Upper 32-bit of doorbell ID. This field is unused if the doorbell is not supported.

| 8
| 7
| DB_PRESERVED_LOW
| uint32
| A lower 32-bit doorbell preserved mask to apply for this service before
ringing the doorbell. This field is unused if the doorbell is not supported.

| 9
| 8
| DB_PRESERVED_HIGH
| uint32
| An upper 32-bit doorbell preserved mask to apply for this service before
ringing the doorbell. This field is only valid if the doorbell register width
is 64-bit. This field is unused if the doorbell is not supported.
|===

==== Service: PERF_GET_FAST_CHANNEL_REGION (SERVICE_ID: 0x0A)
This service retrieves the physical address of the fast channel region used in
the performance service group. The fast channel region is grouped in a continuous
block of memory to ease the configuration of memory region protection such as
PMP or SPMP.

[#table_perf_getfastchanregion_request_data]
.Request Data
[cols="1", width=100%, align="center", options="header"]
|===
| NA
|===

[#table_perf_getfastchanregion_response_data]
.Response Data
[cols="1, 3, 1, 7a", width=100%, align="center", options="header"]
|===
| Word
| Name
| Type
| Description

| 0
| STATUS
| int32
| Return error code

[cols="6,5", options="header"]
!===
! Error Code
! Description

! RPMI_SUCCESS
! Service completed successfully.

! RPMI_ERR_NOT_SUPPORTED
! Fast-channel is not implemented.

!===
- Other errors <<table_error_codes>>

| 1
| PHYS_ADDR_LOW
| uint32
| Lower 32-bit of physical address.

| 2
| PHYS_ADDR_HIGH
| uint32
| Upper 32-bit of physical address.

| 3
| SIZE
| uint32
| Size of physical address of fast channel

|===
1 change: 1 addition & 0 deletions src/terms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
| PuC | Platform Microcontroller
| RAS | Reliability, Availability, and Serviceability
| SBI | Supervisor Binary Interface
| SPMP | S-mode Physical Memory Protection
|===

0 comments on commit 2a28a69

Please sign in to comment.