Skip to content

Latest commit

 

History

History
285 lines (240 loc) · 9.6 KB

srvgrp-cppc.adoc

File metadata and controls

285 lines (240 loc) · 9.6 KB

Service Group - CPPC (servicegroup_id: 0x00005)

This service group defines the services to control CPU performance by managing a set of registers and a dedicated physical memory block, which will define fast channel access to each hart in the system. Hart writes a specific 32-Bit desired performance number in fast channel memory. PuC decodes the request and performs the corresponding CPPC operations.

CPPC physical memory will have enough space to accommodate all available harts. Hart can send an RPMI message GET_CPPC_PERF_CHAN_ADDR to query the physical address of that particular hart.

Once Hart receives the physical address of the REQ-ACK registers, Hart clears the acknowledgement register and writes a performance counter value in the request register and a sequence number in the sequence number register. On observing this request, PuC changes the performance state and writes the sequence number value of the original request in the Acknowledgement register. That completes the request.

PROBE_CPPC_REG service can be used to check if a particular CPPC register is implemented. The service READ_CPPC_REG can be used to read all implemented CPPC register values and WRITE_CPPC_REG can be used to write the registers.

For extra debugging, Hart can send a GET_CPPC_PERF_POKE message to exclusively request PuC to process the pending CPPC requests, if any.

For more information on CPPC, refer ACPI and CPPC.

CPPC Fast Channel REQ-ACK Memory Entry per Hart:

Table 1. CPPC Fast Channel Memory Entry
Word Description Entity which writes the word

0

Request Sequence Number Register

AP

1

Request Register

AP

2

Acknowledgement Register

PuC

3

Reserved

None

Below table lists the services in this group:

Table 2. CPPC Services
Service ID Service Name Request Type

0x01

ENABLE_NOTIFICATION

NORMAL_REQUEST

0x02

PROBE_REG

NORMAL_REQUEST

0x03

READ_REG

NORMAL_REQUEST

0x04

WRITE_REG

NORMAL_REQUEST

0x05

GET_FAST_CHANNEL_ADDR

NORMAL_REQUEST

0x06

POKE_FAST_CHANNEL

NORMAL_REQUEST

0x07

GET_HART_LIST

NORMAL_REQUEST

CPPC Notifications

This service group does not support any event for notification.

Service: ENABLE_NOTIFICATION

This service allows AP to subscribe to CPPC service group notifications. Platform can optionally support notifications of events which might occur in the platform. PuC can send these notification messages to AP if they are implemented and AP has subscribed to these. Events supported are described above in CPPC Notifications.

Table 3. Request Data
Word Name Type Description

0

EVENT_ID

uint32

Event to be subscribed for notification.

Table 4. Response Data
Word Name Type Description

0

STATUS

int32

Return Status Code

Error Code

Description

RPMI_SUCCESS

Notifications are subscribed successfully.

RPMI_ERROR_NOT_FOUND

EVENT_ID is not supported or invalid.

RPMI_ERROR_NOT_SUPPORTED

Notifications not supported.

Service: PROBE_REG

Probe for CPPC register and get its length in bytes. If the register is not implemented, REG_LENGTH returned will be zero.

Table 5. Request Data
Word Name Type Description

0

HART_ID

uint32

Hart ID

1

REG_ID

uint32

Register ID (refer register ids in SBI Spec)

Table 6. Response Data
Word Name Type Description

0

STATUS

int32

Return Status Code

Error Code

Description

RPMI_SUCCESS

Service completed successfully and probing details returned.

RPMI_ERROR_NOT_FOUND

HART_ID not found

1

REG_LENGTH

uint32

Register Length

Service: READ_REG

Read CPPC register value

Table 7. Request Data
Word Name Type Description

0

HART_ID

uint32

Hart ID

1

REG_ID

uint32

Register ID (refer register ids in SBI Spec)

Table 8. Response Data
Word Name Type Description

0

STATUS

int32

Return Status Code

Error Code

Description

RPMI_SUCCESS

Service completed successfully.

RPMI_ERROR_NOT_FOUND

HART_ID not found

RPMI_ERROR_INVALID_PARAMETER

REG_ID is invalid or not implemented. AP must probe the REG_ID before reading.

1

DATA_LOW

uint32

Low 32 bit of data

2

DATA_HIGH

uint32

High 32 bit of data

Service: WRITE_REG

Write a CPPC register

Table 9. Request Data
Word Name Type Description

0

HART_ID

uint32

Hart ID

1

REG_ID

uint32

Register ID (refer register ids in SBI Spec)

2

DATA_LOW

uint32

Low 32 bit of data

3

DATA_HIGH

uint32

High 32 bit of data

Table 10. Response Data
Word Name Type Description

0

STATUS

int32

Return Status Code

Error Code

Description

RPMI_SUCCESS

Service completed successfully.

RPMI_ERROR_NOT_FOUND

HART_ID not found

RPMI_ERROR_INVALID_PARAMETER

REG_ID is invalid or not implemented. AP must probe the REG_ID before reading.

Service: GET_FAST_CHANNEL_ADDR

Request for physical address of CPPC fast channel for the hart ID specified, this physical address shall be used to write the value of CPPC Desired Performance Register.

Table 11. Request Data
Word Name Type Description

0

HART_ID

uint32

Hart ID

Table 12. Response Data
Word Name Type Description

0

STATUS

int32

Return Status Code

Error Code

Description

RPMI_SUCCESS

Service completed successfully.

RPMI_ERROR_NOT_FOUND

HART_ID not found

RPMI_ERROR_NOT_SUPPORTED

Fast channel not implemented

1

FLAGS

uint32

Bits

Description

[31:3]

Reserved

[2:1]

Doorbell Register Width

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

[0]

0b0: Doorbell not supported
0b1: Doorbell supported

2

PHYS_ADDR_LOW

uint32

Low 32 bit of physical address

3

PHYS_ADDR_HIGH

uint32

High 32 bit of physical address

4

DB_ADDR_LOW

uint32

Low 32 bit of doorbell address

5

DB_ADDR_HIGH

uint32

High 32 bit of doorbell address

6

DB_ID_LOW

uint32

Low 32 bit of doorbell ID

7

DB_ID_HIGH

uint32

High 32 bit of doorbell ID

Service: POKE_FAST_CHANNEL

Debug request message to poke the PuC FW to process the pending CPPC messages if any.

Request Data
  • NA

Table 13. Response Data
Word Name Type Description

0

STATUS

int32

Return Status Code

Error Code

Description

RPMI_SUCCESS

Fast channel poked and service completed successfully.

Service: GET_HART_LIST

This service gets the list of a hart with a specified hart ID start index.

Table 14. Request Data
Word Name Type Description

0

START_INDEX

uint32

Starting index of Hart ID

Table 15. Response Data
Word Name Type Description

0

STATUS

int32

Return Status Code

Error Code

Description

RPMI_SUCCESS

Service completed successfully.

RPMI_ERROR_INVALID_PARAMETER

Invalid START_INDEX

1

REMAINING

uint32

Remaining number of items to be returned

2

RETURNED

uint32

Total number of items returned so far.

3

HART_ID[0]

uint32

Hart ID

4

HART_ID[1]

uint32

Hart ID

5

HART_ID[N-1]

uint32

Hart ID