18
SCMIv2.0 What’s new Souvik Chakravarty

Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

SCMIv2.0What’s new

Souvik Chakravarty

Page 2: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

2 © 2019 Arm Limited

Agenda

• What is SCMI

• Power Management Models enabled by SCMI

• SCMIv2.0 – FastChannels

• SCMIv2.0 – Agent specific permission Configuration

• SCMIv2.0 – Other Features

• SCMI.next Roadmap - New Features

• Evolution & Roadmap* – High level view

• Status & Next Steps

• Useful Links

Page 3: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

3 © 2019 Arm Limited

What is System Control & Management Interface (SCMI)Publicly available ARM specification

• Standard messaging interface to a System Controller for

– System Control– Power & Performance Mgmt.

• System Controller may be– Firmware in Secure World.– Firmware + microcontroller.

• New features in SCMIv2.0:– SMC/HVC Based standard SCMI

Channels– Reset domain management– Pre-Notifications – FastChannel Support

▪ Register or Shared memory-based Channel

– Agent-specific Permission Configuration & Reset

Page 4: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

4 © 2019 Arm Limited

Power Management Models enabled by SCMISystem Control firmware on a Cortex M based Microcontroller

Normal World Secure World

EL3 Firmware

Operating System

H/W Mb

Driver

SCMI

DriverTrusted OS

Tru

stZ

one Iso

lation B

oundar

y

AppAppApp

AppAppApp

System & Power

Control uC

System & Power Control uC

SCP

SCP

Tru

stZ

one Iso

lation

Boundar

y

System & Power Control uC

TF-M

Cortex-Mx

Cortex-M3x

System & Power Control uC

1a

1b

Physical Channel Physical Channel

Page 5: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

5 © 2019 Arm Limited

Power Management Models enabled by SCMISystem Control firmware in Cortex-A Secure World

Normal World Secure World

EL3 Firmware

Operating System

SPCI/SMC

SPCI/SMC-Mb

Driver

SCMI

Driver

Trusted OS (OP-TEE)

Tru

stZ

one Iso

lation B

oundar

y

AppAppApp

AppAppApp

SCPSystem & Power

Control Unit

Normal World Secure World

EL3 Firmware

Operating System

SPCI/SMC

SPCI/SMC-Mb

Driver

SCMI

Driver

Tru

stZ

one Iso

lation B

oundar

y

AppAppApp

AppAppApp

SCP*System & Power

Control Unit

Recommended Model Only recommended if no Secure-EL1 Payload is present

Page 6: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

6 © 2019 Arm Limited

Power Management Models enabled by SCMISystem Control firmware in Virtualized Systems

Normal World Secure World

Hypervisor

EL3 Firmware

Operating System

MbDriver

SCMIDriver Trusted OS

AppAppApp

AppAppApp

System & Power

Control uC Physical ChannelPhysical Channel

EL3 Firmware

vSCP

Operating System

MbDriver

SCMIDriver

Tru

stZ

one Iso

lation B

oundar

y

AppAppApp

AppAppApp

VM1 VM2

Normal World Secure World

Hypervisor

EL3 Firmware

Operating System

MbDriver

SCMIDriver

AppAppApp

AppAppApp

vSCP

Operating System

MbDriver

SCMIDriver

Tru

stZ

one Iso

lation B

oundar

y

AppAppApp

AppAppApp

VM1 VM2

SPCI/SMC

Any secure world deployment scenario

Page 7: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

7 © 2019 Arm Limited

Power Management Models enabled by SCMISystem Control firmware in Hardware-assisted Virtualized Systems

Normal World Secure World

Hypervisor

EL3 Firmware

Operating System

MbDriver

SCMIDriver Trusted OS

AppAppApp

AppAppApp

System & Power

Control uC Physical ChannelPhysical Channel

EL3 Firmware

vSCP

Operating System

MbDriver

SCMIDriver

Tru

stZ

one Iso

lation B

oundar

y

AppAppApp

AppAppApp

VM1 VM2

Physical Channel

Physical Channel

Page 8: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

8 © 2019 Arm Limited

SCMIv2.0 – FastChannels• Introduced to reduce latency during certain latency-sensitive operations like DVFS.

• FastChannel is Per-Message Per-Domain dedicated channel for Performance Protocol.

• Different command types cannot be multiplexed over the same FastChannel.

• May be any memory location shared between SCP & AP Domain (e.g. SRAM). May be non-secure.

• Optional Doorbell Support -> Location; Register size; Set/Preserve/Clear mask.

• Dynamic discovery. Cpufreq driver can check FastChannel bit per performance domain and discover them via a command.

• No Response back from Channel. Asynchronous Mode of operation (fire-and-forget).• Use Shared Stats region to read existing frequency. • If Synchronous behavior is required, use normal SCMI channels. Since hardware delays for Synchronous behavior (PLL Lock + Voltage Ramp) is of order of 10’s of us, normal

SCMI channel should be sufficient.

CPU SCP

write per domain fast channel

Read Fast ChannelRead

Yielding Loop (if doorbell is not supported)

Fast Channel

scmi_cpufreq_set_target(policy, target)

Write

Set perf_level requested

Doorbell (optional)

Page 9: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

9 © 2019 Arm Limited

SCMIv2.0 – Agent specific permission Configuration Direct assignment in Virtualized systems

System Controller

VM2

Channel1 Channel2 Channel3 Channel4

HYP/VMM VM1 VM3

Configure Resource Isolation

Resource Manager

R1 R2 R3 R4 R5 R6 R7

RESOURCE ISOLATION

Software Running on PEs

Domain1

RESOURCE ISOLATION

Domain2

Shared Resources to

Control/Manage

Channels to access Power

Controller

Agent 1 Agent 2 Agent 3 Agent 4Resource Isolation

• Hypervisor has access to all channels.• Each channel has a unique agent-id allocated by System

Controller.– Discoverable by BASE_DISCOVER_AGENT command

• Hypervisor chooses channels to allocate to VMs.• Hypervisor configures access permissions of agents

– BASE_SET_DEVICE_PERMISSIONS– BASE_SET_PROTOCOL_PERMISSIONS– BASE_RESET_AGENT_CONFIGURATION– Only one control channel has permissions to use above commands.

Access control imposed at boot by System Controller.– Control channel identification is done through firmware tables and is

not discoverable.

• Hypervisors maps configured channels into VM space and starts VM.

• VM can use channel mapped to its space.– Can send commands to access resources allowed by the hypervisor

over the channel.

Page 10: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

10 © 2019 Arm Limited

SCMIv2.0 – Agent specific permission Configuration How Direct Assignment works

• Hypervisor configures access permissions of agents– BASE_SET_DEVICE_PERMISSIONS

▪ System Controller Firmware groups resources into Devices.– Devices can be logical.

▪ Devices uniquely identified by 32 bit device-identifiers.▪ Devices are mapped through firmware tables.

– Device Dynamic discovery is planned for SCMI.next▪ If agent has access to a device, it gets access to all resources

associated with the device.– BASE_SET_PROTOCOL_PERMISSIONS

▪ Access to specific protocols for a particular device for an agent– BASE_RESET_AGENT_CONFIGURATION

▪ Reset all permissions of an agent.▪ Reset all device specific configurations done by an agent.

• The VM can send commands to access resources allowed by the hypervisor over the channel.

– E.g., it can directly access a Power Domain if it is associated with a device the agent has access to.

DEVICEAbstracted

Power Domain

Performance Domain

Clocks

Reset Domain

GPIOs etc

Page 11: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

11 © 2019 Arm Limited

SCMIv2.0 – Agent specific permission Configuration Multi-Master Systems

“A+M” Class SoCs

SCP

Shared Resources

Master 1 Master 2

SCMI Channel1

SCMI Channel2

Resource Manager

R1 R2 R3 R4 R5 R6 R7

RESOURCE ISOLATION Channel 2

RESOURCE ISOLATION Channel 1

Page 12: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

12 © 2019 Arm Limited

SCMIv2.0 – Other FeaturesReset Domain Management & SMC based doorbell

• Reset Domain Management Protocol– Reset domains are defined by the System Controller– Reset domains can be reset

▪ Explicitly by toggling the reset signal low and high.▪ Autonomously by asking for a Reset. Firmware does the reset.

– Compatible with Linux Reset Framework.

• SMC/HVC Based doorbells– SCMV2.0 introduces the possibility of doorbell being SMC/HVC based to enable secure world firmware deployment.– Parameters are {SMC FN_ID, 32-bit Mailbox Identifier}– Mailbox identifier identifies a memory region shared between normal and secure world which serves as Mailbox.– Secure and Normal world need to view the same map of Mailbox identifiers.

▪ Mailbox ID discovery is through firmware tables.

Page 13: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

13 © 2019 Arm Limited

SCMI.next Roadmap - New FeaturesThe Device View

*CPU Power Management is still over PSCI

Device advertises

• Power State*• Performance levels• Reset States

System Controller• Abstracts and Manages

platform specific details• Creates device attributes

from constituent domains• Manages/Resolves Domain

Dependencies for SCMI Device Management calls

OS Responsibility & ViewSystem Controller Responsibility & View

DEVICE

POWER STATE

PERFORMANCE LEVEL

RESET

Abstracted Operatives

SCMI v1.0

Power Domain

Performance Domain

Clocks

Reset Domain

GPIOs etc

SCMI.next

Latency Power

Per-State Attributes

ID

Latency

Per-State Attributes

ID

Notification Support

Sync/Async Support

Latency Power

Per-State Attributes

ID

Page 14: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

14 © 2019 Arm Limited

SCMI.next Roadmap - New FeaturesPSA-FF-A (previously known as SPCI) Interface based Transport

A Secure Partition (SP) is a Secure world sandbox

• Can host a Trusted OS or a driver stack• Exports services to Normal world clients

and other partitions

PSA-FF-A generalizes communication with SPs

• Describes ABIs to access services in a SP

• Secure World resident SCMI Server in SP• Fixed-Function hardware or

microcontroller-based design

PSA-FF-A overview SCMI transport over PSA-FF-A

Client Partition Sandboxed Power Management

& Control Partition

Operating System

SPCI

SPCI

Driver

SCMI

Driver

SCMI & Support

Infrastructure

Isola

tion B

oundar

y

AppAppApp

AppAppApp

Secure Partition Manager

SCMI ServerSystem & Power

Control Mailbox

SPCI

System & Power

Control uC

Physical Channel

Control & PM

Logic

Alternate Path

Page 15: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

15 © 2019 Arm Limited

Status & Next Steps

• Device Management• Migration Path (Short Term) and Long-Term kernel

framework under analysis.• Proof of Concept tentatively targeted at ARM JUNO board.

• SCMIv3.0 (Concept)• Device Management Protocol• Autonomous Power & Performance Management• QoS Support SCMI

Flexible System Controller

Deployment via FFH, Secure partition or

Microcontroller

Long Term spec. maintenance &

upstream support

Standardised and portable OS

Power Management & System Control

Virtualization friendly

Easier Multi-OS Deployment

Page 16: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

16 © 2019 Arm Limited

Useful Links• SCMI: https://developer.arm.com/architectures/system-architectures/software-standards/scmi

• SCMI Specification v2.0: http://infocenter.arm.com/help/topic/com.arm.doc.den0056b/DEN0056B_System_Control_and_Management_Interface_v2_0.pdf

• Improved Power Management and System Control through SCMI (Blog) -https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/improved-power-management-system-control-through-scmi?_ga=2.156623154.880774273.1565962961-2100565651.1542271883

• Power and Performance Management using Arm ACMI Specification (Whitepaper) https://developer.arm.com/-/media/Arm%20Developer%20Community/PDF/Arm_Power_and_Performance_Management_SCMI_White_Paper.pdf?revision=15e9d3dd-ecc6-40ab-a8c5-6bb4fa3fc060

• SCP Reference Firmware: https://github.com/ARM-software/SCP-firmware

• ARM Trusted Firmware: https://github.com/ARM-software/arm-trusted-firmware

Page 17: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

Thank YouDankeMerci谢谢

ありがとうGracias

Kiitos감사합니다

धन्यवाद

شكًراתודה

© 2019 Arm Limited

Page 18: Souvik Chakravarty - Linaro...2 © 2019 Arm Limited Agenda • What is SCMI • Power Management Models enabled by SCMI • SCMIv2.0 –FastChannels • SCMIv2.0 –Agent specific

The Arm trademarks featured in this presentation are registered trademarks or trademarks of Arm Limited (or its subsidiaries) in

the US and/or elsewhere. All rights reserved. All other marks featured may be trademarks of their respective owners.

www.arm.com/company/policies/trademarks