Skip to content

Latest commit

 

History

History
742 lines (612 loc) · 16.9 KB

srvgrp-cppc.adoc

File metadata and controls

742 lines (612 loc) · 16.9 KB

Service Group - CPPC (SERVICEGROUP_ID: 0x0005)

This service group defines the services to control application processor performance by managing a set of registers per application processor that are used for performance management and control. The ACPI CPPC (Collaborative Processor Performance Control) is an abstract and flexible mechanism that allows application processor to collaborate with the platform microcontroller to control the performance.

The CPPC extension defined in the RISC-V SBI specification cite:[SBI] defines the register IDs for the standard CPPC registers, along with additional registers also required by the application processor.

The ACPI CPPC specification cite:[ACPI] provides the details of the CPPC registers and also provides details on the performance control mechanism through CPPC.

This service group works with the abstract performance scale defined by the ACPI CPPC and is managed by the platform which is responsible for the conversion between the abstract performance level and the internal performance operating point.

The platform may have multiple application processors that share the actual performance controls like clock, voltage regulator and others depending on the platform. In such cases a performance level change for one application processor will affect the entire the group sharing the controls. Its the responsibility of the power and performance management software running on the application processor and the platform to coordinate and manage the group level performance changes.

The following table lists the services in the CPPC service group:

Table 1. CPPC Services
Service ID Service Name Request Type

0x01

CPPC_ENABLE_NOTIFICATION

NORMAL_REQUEST

0x02

CPPC_PROBE_REG

NORMAL_REQUEST

0x03

CPPC_READ_REG

NORMAL_REQUEST

0x04

CPPC_WRITE_REG

NORMAL_REQUEST

0x05

CPPC_GET_FAST_CHANNEL_REGION

NORMAL_REQUEST

0x06

CPPC_GET_FAST_CHANNEL_OFFSET

NORMAL_REQUEST

0x07

CPPC_GET_HART_LIST

NORMAL_REQUEST

CPPC Fast-channel

The CPPC service group defines the fast-channels to be used by the application processor to request performance changes and to obtain performance change feedback for an application processor from the platform microcontroller.

A fast-channel shared memory layout is specific to the CPPC service group. The data written in a fast-channel do not follow the conventional RPMI message format. The simple data format supported by the fast-channel allows faster processing of the performance change requests made through a fast-channel and faster read of the performance feedback values supported over the fast-channel.

The CPPC service group defines two types of fast-channel for each application processor. If fast-channels are supported then each application processor must be assigned both types fast-channel.

Performance Request Fast-channel

In this fast-channel the application processor will either write the desired performance level in case of normal mode or the minimum and maximum performance level in case of Autonomous (CPPC2) mode in the fast-channel. Otherwise the application processor can call the service CPPC_WRITE_REG for the DesiredPerformanceRegister or MinimumPerformanceRegister and MaximumPerformanceRegister.

The supported values in this fast-channel which depends on the CPPC mode, either normal or autonomous mode is discoverable through CPPC_GET_FAST_CHANNEL_REGION service.

The size of this fast-channel type is 8 bytes.

Table 2. CPPC Performance Request Fast-channel Layout
CPPC Mode Layout

Normal Mode

Offset Value (32-bit)

0x0

Desired performance level

0x4

Reserved and must be 0.

Autonomous (CPPC2) mode

Offset Value (32-bit)

0x0

Minimum performance level

0x4

Maximum performance level

Performance Feedback Fast-channel

In this fast-channel the application processor will read the supported value for estimating the delivered performance as performance feedback for an application processor. The application processor current frequency (Hz) is used for performance feedback in this fast-channel. The platform microcontroller must write the frequency of an application processor in the fast-channel whenever it changes.

The size of this fast-channel type is 8 bytes.

Table 3. CPPC Performance Feedback Fast-channel Layout
Offset Value (32-bit)

0x0

Current frequency low 32-bit (Hz)

0x4

Current frequency high 32-bit (Hz)

CPPC Fast-channel Shared Memory Region

In the shared memory region allocated by the platform for fast-channels, the Performance Request fast-channels must be grouped together for all the application processors. Similarly, the Performance Feedback fast-channels must be grouped together.

The size of the shared memory region for fast-channels for all the managed application processors must be a power-of-2. The base-address and size (bytes) of the fast-channels shared memory region can be discovered using the service CPPC_GET_FAST_CHANNEL_REGION. The base-address of the shared memory region must be aligned to 8 bytes which is maximum size of a fast-channel in both the types.

The offsets of fast-channel of both types for an application processor are aligned to 8 bytes. The offset of both fast-channel types in the shared memory region can be discovered through service CPPC_GET_FAST_CHANNEL_OFFSET. The offsets discovered can be added into the base-address of the shared memory region to form the address of Performance Request fast-channel and Performance Feedback fast-channel for an application processor.

Performance Request Fast-channel Doorbell

A doorbell can also be supported for this fast-channel type which is shared between all the application processors. If a doorbell is available then it must be supported through a read-modify-write sequence to a memory-mapped register. The doorbell details and attributes can be discovered by the application processor through the CPPC_GET_FAST_CHANNEL_REGION service.

Notifications

This service group does not support any events for notification.

Service: CPPC_ENABLE_NOTIFICATION (SERVICE_ID: 0x01)

This service allows the application processor to subscribe to CPPC service group notifications. The platform may optionally support notifications for events that may occur. The platform microcontroller can send these notification messages to the application processor if they are implemented and the application processor has subscribed to them. The supported events are described in Notifications.

Table 4. Request Data
Word Name Type Description

0

EVENT_ID

uint32

The event to be subscribed for notification.

1

REQ_STATE

uint32

Requested event notification state
Change or query the current state of EVENT_ID notification.

0: Disable
1: Enable
2: Return current state.

Any other values of REQ_STATE field other than the defined ones are reserved for future use.

Table 5. Response Data
Word Name Type Description

0

STATUS

int32

Return error code

Error Code Description

RPMI_SUCCESS

Event is subscribed successfully.

RPMI_ERR_INVALID_PARAM

EVENT_ID or REQ_STATE is invalid.

RPMI_ERR_NOT_SUPPORTED

Notification is not supported.

1

CURRENT_STATE

uint32

Current EVENT_ID notification state

0: Notification is disabled
1: Notification is enabled.

In case of REQ_STATE = 0 or 1, the CURRENT_STATE will return the requested state.
In case of an error, the value of CURRENT_STATE is unspecified.

Service: CPPC_PROBE_REG (SERVICE_ID: 0x02)

This service is used to probe a CPPC register implementation status for a application processor. If the CPPC register reg_id is implemented then the length in bits is returned in REG_LENGTH field. If the register is not supported or invalid then the REG_LENGTH will be 0.

Table 6. Request Data
Word Name Type Description

0

REG_ID

uint32

CPPC register ID

1

HART_ID

uint32

Hart ID

Table 7. Response Data
Word Name Type Description

0

STATUS

int32

Return error code

Error Code Description

RPMI_SUCCESS

CPPC register probed successfully.

RPMI_ERR_INVALID_PARAM

HART_ID or REG_ID is invalid.

RPMI_ERR_NOT_SUPPORTED

REG_ID is not supported.

1

REG_LENGTH

uint32

Register length (bits)

Service: CPPC_READ_REG (SERVICE_ID: 0x03)

This service is used to read a CPPC register. If the fast-channels are supported, a read of the DesiredPerformanceRegister or MinimumPerformanceRegister and MaximumPerformanceRegister through this service will return the current desired performance level or minimum and maximum performance level limit depending on the CPPC mode from the fast-channel of a application processor.

Table 8. Request Data
Word Name Type Description

0

REG_ID

uint32

CPPC register ID

1

HART_ID

uint32

Hart ID

Table 9. Response Data
Word Name Type Description

0

STATUS

int32

Return error code

Error Code Description

RPMI_SUCCESS

Service completed successfully.

RPMI_ERR_INVALID_PARAM

HART_ID or REG_ID is invalid.

RPMI_ERR_NOT_SUPPORTED

REG_ID is not supported.

1

DATA_LOW

uint32

Lower 32-bit of the data.

2

DATA_HIGH

uint32

Upper 32-bit of data. This will be 0 if the register is of 32-bit length.

Service: CPPC_WRITE_REG (SERVICE_ID: 0x04)

This service is used to write a CPPC register.

If the fast-channels are supported the application processor must only write desired performance level in the fast-channel instead of writing into the DesiredPerformanceRegister through this service. Similarly, in case of the autonomous mode the application processor must write minimum and maximum limit levels into the fast-channel instead of calling this service for MinimumPerformanceRegister and MaximumPerformanceRegister. Otherwise the writes to these registers may be ignored.

Table 10. Request Data
Word Name Type Description

0

REG_ID

uint32

CPPC register ID

1

HART_ID

uint32

Hart ID

2

DATA_LOW

uint32

Lower 32-bit of data.

3

DATA_HIGH

uint32

Upper 32-bit of data. This is ignored if the register is of 32-bit length.

Table 11. Response Data
Word Name Type Description

0

STATUS

int32

Return error code

Error Code Description

RPMI_SUCCESS

Service completed successfully.

RPMI_ERR_INVALID_PARAM

HART_ID or REG_ID is invalid.

RPMI_ERR_NOT_SUPPORTED

REG_ID is not supported.

RPMI_ERR_DENIED

REG_ID is read only.

Service: CPPC_GET_FAST_CHANNEL_REGION (SERVICE_ID: 0x05)

This service is used to get the details of the shared memory region containing all the fast-channels, attributes of the fast-channel and the details of the doorbell.

Table 12. Request Data
NA
Table 13. Response Data
Word Name Type Description

0

STATUS

int32

Return error code

Error Code Description

RPMI_SUCCESS

Service completed successfully.

RPMI_ERR_NOT_SUPPORTED

Fast-channels not supported.

1

FLAGS

uint32

Bits Description

[31:5]

Reserved and must be 0.

[4:3]

CPPC mode

0b00: Normal mode.
Desired performance level for performance change.
0b01: Autonomous mode.
Performance limit change. Platform can choose the level in the requested
limit.
0b10 - 0b11: Reserved

[2:1]

Performance Request fast-channel doorbell register width.

0b00: 8-bit
0b01: 16-bit
0b10: 32-bit
0b11: 64-bit

[0]

Performance Request fast-channel doorbell support.

0b1: Supported
0b0: Not supported

2

REGION_ADDR_LOW

uint32

Lower 32-bit of the fast-channels shared memory region physical address.

3

REGION_ADDR_HIGH

uint32

Upper 32-bit of the fast-channels shared memory region physical address.

4

REGION_SIZE_LOW

uint32

Lower 32-bit of the fast-channels shared memory region size.

5

REGION_SIZE_HIGH

uint32

Upper 32-bit of the fast-channels shared memory region size.

6

DB_ADDR_LOW

uint32

Lower 32-bit of doorbell address.

7

DB_ADDR_HIGH

uint32

Upper 32-bit of doorbell address.

8

DB_SETMASK_LOW

uint32

Lower 32-bit of doorbell set mask.

9

DB_SETMASK_HIGH

uint32

Upper 32-bit of doorbell set mask.

10

DB_PRESERVEMASK_LOW

uint32

Lower 32-bit doorbell preserve mask.

11

DB_PRESERVEMASK_HIGH

uint32

Upper 32-bit doorbell preserve mask.

Service: CPPC_GET_FAST_CHANNEL_OFFSET (SERVICE_ID: 0x06)

This service is used to get the offsets of Performance Request fast-channel and Performance Feedback fast-channel for an application processor in the shared memory region containing all the fast-channels.

Table 14. Request Data
Word Name Type Description

0

HART_ID

uint32

Hart ID

Table 15. Response Data
Word Name Type Description

0

STATUS

int32

Return error code

Error Code Description

RPMI_SUCCESS

Service completed successfully.

RPMI_ERR_INVALID_PARAM

HART_ID is invalid.

RPMI_ERR_NOT_SUPPORTED

Fast-channels not supported.

1

PERF_REQUEST_OFFSET_LOW

uint32

Lower 32-bit of a Performance Request fast-channel offset.

2

PERF_REQUEST_OFFSET_HIGH

uint32

Upper 32-bit of a Performance Request fast-channel offset.

3

PERF_FEEDBACK_OFFSET_LOW

uint32

Lower 32-bit of a Performance Feedback fast-channel offset.

4

PERF_FEEDBACK_OFFSET_HIGH

uint32

Upper 32-bit of a Performance Feedback fast-channel offset.

Service: CPPC_GET_HART_LIST (SERVICE_ID: 0x07)

This service retrieves the list of Hart IDs managed by this service group for performance control.

If the number of words required for all available Hart IDs exceeds the number of words that can be returned in one acknowledgement message then the platform microcontroller will set the REMAINING and RETURNED fields accordingly and only return the Hart IDs which can be accommodated. The application processor may need to call this service again with the appropriate START_INDEX until the REMAINING field returns 0.

Table 16. Request Data
Word Name Type Description

0

START_INDEX

uint32

Starting index of Hart ID.

Table 17. Response Data
Word Name Type Description

0

STATUS

int32

Return error code

Error Code Description

RPMI_SUCCESS

Service completed successfully.

RPMI_ERR_INVALID_PARAM

START_INDEX is invalid.

1

REMAINING

uint32

Remaining number of Hart IDs to be returned.

2

RETURNED

uint32

Number of Hart IDs returned in this request.

3

HART_ID[N]

uint32

Hart IDs