SlideShare a Scribd company logo
1 of 13
Download to read offline
Presented by
Date
OP-TEE
ARMv8-A PM integration
programmer’s view
Jorge A. Ramirez-Ortiz
4 Feb 2015
1
Agenda
● power management in arm64
● software stack
● psci requirements
● OP-TEE - system view
● psci - developer’s view
● use cases
○ CPU_ON/CPU_OFF/CPU_SUSPEND
2
Power Management in AArch64
■ arm32 lack of established firmware interfaces
○ platform specific code maintained in BSP trees
○ the code can’t be upstreamed
■ arm64 - clean sheet
○ single tree strategy
○ delegate the platform specific code to trusted firmware
○ define a generic interface to coordinate power control
across the concurrent supervisory systems
● idle, hotplug, system shutdown/reset, migration
○ leave peripheral and DVFS to the RichOS
ARM recommends:
○ Secure world: controls the power states
○ Normal world: implements the policy in power and performance management
Rich OS
Secure World
PowerController
cpu hotplug
secondary boot
idle management
bigLittle migration
3
AArch64 software stack
1. Normal World
a. RichOS kernels on EL1/EL2
b. Hypervisors on EL2
2. Secure World
a. Secure platform firmware
b. Trusted/Secure OS
PSCI details the interface between the Secure
and normal worlds
smc: requires EL3 being implemented.
hyp: option when EL3 is not present but EL2 is
The communication between the Secure Platform Firmware and the Secure OS is vendor dependent.
- OP-TEE integrates with the ARM Trusted Firmware as a runtime service
- https://github.com/ARM-software/arm-trusted-firmware/tree/master/services/spd/opteed
4
Power State Coordination IF requirements
■ Idle management:
○ standby,
○ retention,
○ power down
■ hotplug: switch processors on/off
■ bigLittle TrustedOS migration
■ save and restore execution states
■ system shutdown and reset hooks:
○ each silicon vendor must provide
its SoC implementation
1. standard function identifiers: no longer configurable via device
tree
a. different ids for 32-bit PSCI and 64-bit PSCI functions
allow for different ATF implementations
2. added the following functions
a. PSCI_VERSION
b. AFFINITY_INFO
c. MIGRATE_INFO_TYPE *
d. MIGRATE_INFO_UP_CPU
e. SYSTEM_OFF
f. SYSTEM_RESET
3. All functions except MIGRATE/MIGRATE_INFO_UP_CPU are
compulsory
4. various return code changes.
PSCI v0.2
5
OP-TEE - Systems View
■ OP-TEE OS runs in AArch32
■ the OP-TEE linux driver uses smc32
○ driver is out of tree
■ the PSCI linux driver uses smc32/smc64
○ driver is in kernel.org
■ STANDALONE ■ ARMv8-A: ARM-TF runtime service
6
PSCI - developer’s view
Linux Kernel
EL1
ARM-TF
EL3
smc interface
psci service
dispatcher
platform code
OP-TEE
s-EL1
psci
1
2
opteed
psci
- {0.1, 0.2}
- 32/64 calls
dtb
ARM-TF uses the opteed vector table provided during
OP-TEE initialization to be able to call the TrustedOS
(functions are platform dependent)
vector_std_smc_entry
vector_fast_smc_entry
vector_cpu_on_entry
vector_cpu_off_entry
vector_cpu_resume_entry
vector_cpu_suspend_entry
vector_fiq_entry
vector_system_off_entry
vector_system_reset_entry
static const struct thread_handlers handlers = {
.std_smc = main_tee_entry,
.fast_smc = main_tee_entry,
.fiq = main_fiq,
.svc = tee_svc_handler,
.abort = tee_pager_abort_handler,
.cpu_on = cpu_on_handler,
.cpu_off = main_cpu_off_handler,
.cpu_suspend = main_cpu_suspend_handler,
.cpu_resume = main_cpu_resume_handler,
.system_off = main_system_off_handler,
.system_reset = main_system_reset_handler,
};
platform dependent
optee dispatcher
aff {0}
aff {0, 1, 2}
7
AArch64 - use case CPU_ON
LINUX 3.19
NS-EL1
ARM-TF
EL3
smp.c psci.c
__cpu_up
boot_secondary
cpu_psci_cpu_boot
psci_cpu_on (secondary_entry)
smc//hyp
OP-TEE
S-EL1
CPU 1CPU 0
psci_afflvl_on.c
plat/../plat_pm.c
opteed_pm.c
psci_main.c
PMIC
RAM
NS- EL1
entry point
head.S: secondary_entry
psci_afflvl_on.c: psci_afflv{x}_on_finish
plat/../plat_pm.c
{0}
aff {0, 1, 2}
psci_common.c
platform handler
opteed_pm.c
aff {0, 1, 2}
{0}
8
AArch64 - use case CPU_OFF
LINUX 3.19
NS-EL1
ARM-TF
EL3
smp.c psci.c
cpu_die
cpu_psci_cpu_die
psci_cpu_off(POWER_DOWN)
smc//hyp
OP-TEE
S-EL1
psci_afflvl_off.c
psci_main.c
arm32/plat../main.c
plat/../plat_pm.c
opteed_pm.c
aff {0, 1, 2}
{0}
__cpu_die
cpu_psci_cpu_kill
psci_affinity_info(mpidr, 0)
smc//hyp
[1] After performing the platform operations, the trusted
firmware framework enters the WFI loop for the CPU; this
allows the external power controller to power it down.
[2] the cpu_kill kernel interface only checks the status of the
CPU (identified via the mpidr) and does not perform any
power actions with the PMIC.
this call does not return
9
AArch64 - use case CPU_SUSPEND
LINUX 3.19
NS-EL1
ARM-TF
EL3
suspend.c psci.c
cpu_suspend
cpu_psci_cpu_suspend
psci_cpu_suspend(STANDBY, entry)
smc//hyp
OP-TEE
S-EL1
plat/../plat_pm.c
psci_main.c
OP_TEE doesn’t need to
implement support for STANDBY
since the firmware will not call
Only STANDBY supported in kernel PSCI interface: all core
context is maintained by the processor and state is entered by
executing WFI in EL3. Changing from standby to running does
not require a reset of the processor.
Other PM states are currently implemented in NS-EL1 (Linux
kernel)
aff {0, 1, 2}
10
Juno Platform: Soc Power Control
http://infocenter.arm.com/help/topic/com.arm.doc.dto0038a/DTO0038A_juno_arm_development_platform_soc_technical_overview.pdf
11
Juno Platform: Software Overview
WFI
https://github.com/ARM-software/arm-trusted-firmware
SCPI - system control and power interface and NOT “Standard Commands for Programmable Instruments”
MHU hardware
(mailbox)
https://github.com/ARM-software/linux/blob/1.4-Juno/drivers/mailbox/arm_mhu.c
https://github.com/ARM-software/linux/blob/1.4-Juno/drivers/mailbox/scpi_protocol.
c
The SCPI is the generic runtime interface to the SCP from the AP
through the MHU. It includes:
● Inquiring capabilities of the system and individual
devices.
● Obtaining and setting the state of the entire system and
individual devices under SCP control. This includes a
thermal sensor interface.
● Obtaining and setting the performance level of the
processors and GPUs, that is, Digital Voltage and
Frequency Scaling(DVFS).
● Watchdog services to non-trusted AP software. The AP
non-trusted world does not have direct access to a
hardware watchdog in the ADP hardware architecture.
The SCP has access to a hardware watchdog and uses this
to help implement the interface.
● Reporting fault conditions.
PSCI
12
13

More Related Content

What's hot

Mixed-critical adaptive AUTOSAR stack based on VxWorks, Linux, and virtualiza...
Mixed-critical adaptive AUTOSAR stack based on VxWorks, Linux, and virtualiza...Mixed-critical adaptive AUTOSAR stack based on VxWorks, Linux, and virtualiza...
Mixed-critical adaptive AUTOSAR stack based on VxWorks, Linux, and virtualiza...
Andrei Kholodnyi
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
 

What's hot (20)

Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0Linux Internals - Interview essentials 4.0
Linux Internals - Interview essentials 4.0
 
Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
 
HKG15-107: ACPI Power Management on ARM64 Servers (v2)
HKG15-107: ACPI Power Management on ARM64 Servers (v2)HKG15-107: ACPI Power Management on ARM64 Servers (v2)
HKG15-107: ACPI Power Management on ARM64 Servers (v2)
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Linux Kernel Module - For NLKB
Linux Kernel Module - For NLKBLinux Kernel Module - For NLKB
Linux Kernel Module - For NLKB
 
HKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting ReviewHKG15-311: OP-TEE for Beginners and Porting Review
HKG15-311: OP-TEE for Beginners and Porting Review
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Qemu Introduction
Qemu IntroductionQemu Introduction
Qemu Introduction
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Linux : PSCI
Linux : PSCILinux : PSCI
Linux : PSCI
 
Mixed-critical adaptive AUTOSAR stack based on VxWorks, Linux, and virtualiza...
Mixed-critical adaptive AUTOSAR stack based on VxWorks, Linux, and virtualiza...Mixed-critical adaptive AUTOSAR stack based on VxWorks, Linux, and virtualiza...
Mixed-critical adaptive AUTOSAR stack based on VxWorks, Linux, and virtualiza...
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VStatic partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 

Viewers also liked

LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
Linaro
 
Foto denuncia estado via publica a 2 de febrero de 2013
Foto denuncia estado via publica a 2 de febrero de 2013Foto denuncia estado via publica a 2 de febrero de 2013
Foto denuncia estado via publica a 2 de febrero de 2013
PSOE FUENTE DEL MAESTRE
 
LCU14-103: How to create and run Trusted Applications on OP-TEE
LCU14-103: How to create and run Trusted Applications on OP-TEELCU14-103: How to create and run Trusted Applications on OP-TEE
LCU14-103: How to create and run Trusted Applications on OP-TEE
Linaro
 

Viewers also liked (20)

BKK16-200 Designing Security into low cost IO T Systems
BKK16-200 Designing Security into low cost IO T SystemsBKK16-200 Designing Security into low cost IO T Systems
BKK16-200 Designing Security into low cost IO T Systems
 
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
LAS16-111: Easing Access to ARM TrustZone – OP-TEE and Raspberry Pi 3
 
Foto denuncia estado via publica a 2 de febrero de 2013
Foto denuncia estado via publica a 2 de febrero de 2013Foto denuncia estado via publica a 2 de febrero de 2013
Foto denuncia estado via publica a 2 de febrero de 2013
 
LCA14: George Grey Keynote - LCA14
LCA14: George Grey Keynote - LCA14LCA14: George Grey Keynote - LCA14
LCA14: George Grey Keynote - LCA14
 
BKK16-211 Internet of Tiny Linux (io tl)- Status and Progress
BKK16-211 Internet of Tiny Linux (io tl)- Status and ProgressBKK16-211 Internet of Tiny Linux (io tl)- Status and Progress
BKK16-211 Internet of Tiny Linux (io tl)- Status and Progress
 
BKK16-309A Open Platform support in UEFI
BKK16-309A Open Platform support in UEFIBKK16-309A Open Platform support in UEFI
BKK16-309A Open Platform support in UEFI
 
BKK16-505 Kernel and Bootloader Consolidation and Upstreaming
BKK16-505 Kernel and Bootloader Consolidation and UpstreamingBKK16-505 Kernel and Bootloader Consolidation and Upstreaming
BKK16-505 Kernel and Bootloader Consolidation and Upstreaming
 
Io t security-ameba-ppt
Io t security-ameba-pptIo t security-ameba-ppt
Io t security-ameba-ppt
 
LAS16-306: Exploring the Open Trusted Protocol
LAS16-306: Exploring the Open Trusted ProtocolLAS16-306: Exploring the Open Trusted Protocol
LAS16-306: Exploring the Open Trusted Protocol
 
SFO15-200: Linux kernel generic TEE driver
SFO15-200: Linux kernel generic TEE driverSFO15-200: Linux kernel generic TEE driver
SFO15-200: Linux kernel generic TEE driver
 
BKK16-201 Play Ready OPTEE Integration with Secure Video Path lhg-1
BKK16-201 Play Ready OPTEE Integration with Secure Video Path lhg-1BKK16-201 Play Ready OPTEE Integration with Secure Video Path lhg-1
BKK16-201 Play Ready OPTEE Integration with Secure Video Path lhg-1
 
ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!
 
LAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEE
 
SFO15-503: Secure storage in OP-TEE
SFO15-503: Secure storage in OP-TEESFO15-503: Secure storage in OP-TEE
SFO15-503: Secure storage in OP-TEE
 
LCA13: Power State Coordination Interface
LCA13: Power State Coordination InterfaceLCA13: Power State Coordination Interface
LCA13: Power State Coordination Interface
 
LAS16-203: Platform security architecture for embedded devices
LAS16-203: Platform security architecture for embedded devicesLAS16-203: Platform security architecture for embedded devices
LAS16-203: Platform security architecture for embedded devices
 
LCU14-103: How to create and run Trusted Applications on OP-TEE
LCU14-103: How to create and run Trusted Applications on OP-TEELCU14-103: How to create and run Trusted Applications on OP-TEE
LCU14-103: How to create and run Trusted Applications on OP-TEE
 
BUD17-400: Secure Data Path with OPTEE
BUD17-400: Secure Data Path with OPTEE BUD17-400: Secure Data Path with OPTEE
BUD17-400: Secure Data Path with OPTEE
 
Hardware accelerated Virtualization in the ARM Cortex™ Processors
Hardware accelerated Virtualization in the ARM Cortex™ ProcessorsHardware accelerated Virtualization in the ARM Cortex™ Processors
Hardware accelerated Virtualization in the ARM Cortex™ Processors
 
BUD17-DF15 - Optimized Android N MR1 + 4.9 Kernel
BUD17-DF15 - Optimized Android N MR1 + 4.9 KernelBUD17-DF15 - Optimized Android N MR1 + 4.9 Kernel
BUD17-DF15 - Optimized Android N MR1 + 4.9 Kernel
 

Similar to HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware

Information Gathering 2
Information Gathering 2Information Gathering 2
Information Gathering 2
Aero Plane
 

Similar to HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware (20)

Nvidia tegra K1 Presentation
Nvidia tegra K1 PresentationNvidia tegra K1 Presentation
Nvidia tegra K1 Presentation
 
LCA13: CPUIDLE: One driver to rule them all?
LCA13: CPUIDLE: One driver to rule them all?LCA13: CPUIDLE: One driver to rule them all?
LCA13: CPUIDLE: One driver to rule them all?
 
SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016
 
Realization of high performance run time loadable mips soft-core processor
Realization of high performance run time loadable mips soft-core processorRealization of high performance run time loadable mips soft-core processor
Realization of high performance run time loadable mips soft-core processor
 
Information Gathering 2
Information Gathering 2Information Gathering 2
Information Gathering 2
 
Atmega8u2 mur
Atmega8u2 murAtmega8u2 mur
Atmega8u2 mur
 
Control Memory
Control MemoryControl Memory
Control Memory
 
Q2.12: Power Management Across OSs
Q2.12: Power Management Across OSsQ2.12: Power Management Across OSs
Q2.12: Power Management Across OSs
 
Gl embedded starterkit_ethernet
Gl embedded starterkit_ethernetGl embedded starterkit_ethernet
Gl embedded starterkit_ethernet
 
Arm architecture overview
Arm architecture overviewArm architecture overview
Arm architecture overview
 
Ccna day2
Ccna day2Ccna day2
Ccna day2
 
Ccna 2
Ccna 2Ccna 2
Ccna 2
 
Ccna day2
Ccna day2Ccna day2
Ccna day2
 
Ccna day2-140715152313-phpapp02
Ccna day2-140715152313-phpapp02Ccna day2-140715152313-phpapp02
Ccna day2-140715152313-phpapp02
 
Ccna day2
Ccna day2Ccna day2
Ccna day2
 
LCA13: ARMv8 Status and Updates
LCA13: ARMv8 Status and UpdatesLCA13: ARMv8 Status and Updates
LCA13: ARMv8 Status and Updates
 
unit 1ARM INTRODUCTION.pptx
unit 1ARM INTRODUCTION.pptxunit 1ARM INTRODUCTION.pptx
unit 1ARM INTRODUCTION.pptx
 
Ccna day2
Ccna day2Ccna day2
Ccna day2
 
Ccna PPT2
Ccna PPT2Ccna PPT2
Ccna PPT2
 
ELC North America 2021 Introduction to pin muxing and gpio control under linux
ELC  North America 2021 Introduction to pin muxing and gpio control under linuxELC  North America 2021 Introduction to pin muxing and gpio control under linux
ELC North America 2021 Introduction to pin muxing and gpio control under linux
 

More from Linaro

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Linaro
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
Linaro
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Linaro
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
Linaro
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
Linaro
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
Linaro
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
Linaro
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
Linaro
 

More from Linaro (20)

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
 
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaArm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
 
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraHuawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
 
Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qa
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening Keynote
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8M
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 

Recently uploaded

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 

HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware

  • 1. Presented by Date OP-TEE ARMv8-A PM integration programmer’s view Jorge A. Ramirez-Ortiz 4 Feb 2015 1
  • 2. Agenda ● power management in arm64 ● software stack ● psci requirements ● OP-TEE - system view ● psci - developer’s view ● use cases ○ CPU_ON/CPU_OFF/CPU_SUSPEND 2
  • 3. Power Management in AArch64 ■ arm32 lack of established firmware interfaces ○ platform specific code maintained in BSP trees ○ the code can’t be upstreamed ■ arm64 - clean sheet ○ single tree strategy ○ delegate the platform specific code to trusted firmware ○ define a generic interface to coordinate power control across the concurrent supervisory systems ● idle, hotplug, system shutdown/reset, migration ○ leave peripheral and DVFS to the RichOS ARM recommends: ○ Secure world: controls the power states ○ Normal world: implements the policy in power and performance management Rich OS Secure World PowerController cpu hotplug secondary boot idle management bigLittle migration 3
  • 4. AArch64 software stack 1. Normal World a. RichOS kernels on EL1/EL2 b. Hypervisors on EL2 2. Secure World a. Secure platform firmware b. Trusted/Secure OS PSCI details the interface between the Secure and normal worlds smc: requires EL3 being implemented. hyp: option when EL3 is not present but EL2 is The communication between the Secure Platform Firmware and the Secure OS is vendor dependent. - OP-TEE integrates with the ARM Trusted Firmware as a runtime service - https://github.com/ARM-software/arm-trusted-firmware/tree/master/services/spd/opteed 4
  • 5. Power State Coordination IF requirements ■ Idle management: ○ standby, ○ retention, ○ power down ■ hotplug: switch processors on/off ■ bigLittle TrustedOS migration ■ save and restore execution states ■ system shutdown and reset hooks: ○ each silicon vendor must provide its SoC implementation 1. standard function identifiers: no longer configurable via device tree a. different ids for 32-bit PSCI and 64-bit PSCI functions allow for different ATF implementations 2. added the following functions a. PSCI_VERSION b. AFFINITY_INFO c. MIGRATE_INFO_TYPE * d. MIGRATE_INFO_UP_CPU e. SYSTEM_OFF f. SYSTEM_RESET 3. All functions except MIGRATE/MIGRATE_INFO_UP_CPU are compulsory 4. various return code changes. PSCI v0.2 5
  • 6. OP-TEE - Systems View ■ OP-TEE OS runs in AArch32 ■ the OP-TEE linux driver uses smc32 ○ driver is out of tree ■ the PSCI linux driver uses smc32/smc64 ○ driver is in kernel.org ■ STANDALONE ■ ARMv8-A: ARM-TF runtime service 6
  • 7. PSCI - developer’s view Linux Kernel EL1 ARM-TF EL3 smc interface psci service dispatcher platform code OP-TEE s-EL1 psci 1 2 opteed psci - {0.1, 0.2} - 32/64 calls dtb ARM-TF uses the opteed vector table provided during OP-TEE initialization to be able to call the TrustedOS (functions are platform dependent) vector_std_smc_entry vector_fast_smc_entry vector_cpu_on_entry vector_cpu_off_entry vector_cpu_resume_entry vector_cpu_suspend_entry vector_fiq_entry vector_system_off_entry vector_system_reset_entry static const struct thread_handlers handlers = { .std_smc = main_tee_entry, .fast_smc = main_tee_entry, .fiq = main_fiq, .svc = tee_svc_handler, .abort = tee_pager_abort_handler, .cpu_on = cpu_on_handler, .cpu_off = main_cpu_off_handler, .cpu_suspend = main_cpu_suspend_handler, .cpu_resume = main_cpu_resume_handler, .system_off = main_system_off_handler, .system_reset = main_system_reset_handler, }; platform dependent optee dispatcher aff {0} aff {0, 1, 2} 7
  • 8. AArch64 - use case CPU_ON LINUX 3.19 NS-EL1 ARM-TF EL3 smp.c psci.c __cpu_up boot_secondary cpu_psci_cpu_boot psci_cpu_on (secondary_entry) smc//hyp OP-TEE S-EL1 CPU 1CPU 0 psci_afflvl_on.c plat/../plat_pm.c opteed_pm.c psci_main.c PMIC RAM NS- EL1 entry point head.S: secondary_entry psci_afflvl_on.c: psci_afflv{x}_on_finish plat/../plat_pm.c {0} aff {0, 1, 2} psci_common.c platform handler opteed_pm.c aff {0, 1, 2} {0} 8
  • 9. AArch64 - use case CPU_OFF LINUX 3.19 NS-EL1 ARM-TF EL3 smp.c psci.c cpu_die cpu_psci_cpu_die psci_cpu_off(POWER_DOWN) smc//hyp OP-TEE S-EL1 psci_afflvl_off.c psci_main.c arm32/plat../main.c plat/../plat_pm.c opteed_pm.c aff {0, 1, 2} {0} __cpu_die cpu_psci_cpu_kill psci_affinity_info(mpidr, 0) smc//hyp [1] After performing the platform operations, the trusted firmware framework enters the WFI loop for the CPU; this allows the external power controller to power it down. [2] the cpu_kill kernel interface only checks the status of the CPU (identified via the mpidr) and does not perform any power actions with the PMIC. this call does not return 9
  • 10. AArch64 - use case CPU_SUSPEND LINUX 3.19 NS-EL1 ARM-TF EL3 suspend.c psci.c cpu_suspend cpu_psci_cpu_suspend psci_cpu_suspend(STANDBY, entry) smc//hyp OP-TEE S-EL1 plat/../plat_pm.c psci_main.c OP_TEE doesn’t need to implement support for STANDBY since the firmware will not call Only STANDBY supported in kernel PSCI interface: all core context is maintained by the processor and state is entered by executing WFI in EL3. Changing from standby to running does not require a reset of the processor. Other PM states are currently implemented in NS-EL1 (Linux kernel) aff {0, 1, 2} 10
  • 11. Juno Platform: Soc Power Control http://infocenter.arm.com/help/topic/com.arm.doc.dto0038a/DTO0038A_juno_arm_development_platform_soc_technical_overview.pdf 11
  • 12. Juno Platform: Software Overview WFI https://github.com/ARM-software/arm-trusted-firmware SCPI - system control and power interface and NOT “Standard Commands for Programmable Instruments” MHU hardware (mailbox) https://github.com/ARM-software/linux/blob/1.4-Juno/drivers/mailbox/arm_mhu.c https://github.com/ARM-software/linux/blob/1.4-Juno/drivers/mailbox/scpi_protocol. c The SCPI is the generic runtime interface to the SCP from the AP through the MHU. It includes: ● Inquiring capabilities of the system and individual devices. ● Obtaining and setting the state of the entire system and individual devices under SCP control. This includes a thermal sensor interface. ● Obtaining and setting the performance level of the processors and GPUs, that is, Digital Voltage and Frequency Scaling(DVFS). ● Watchdog services to non-trusted AP software. The AP non-trusted world does not have direct access to a hardware watchdog in the ADP hardware architecture. The SCP has access to a hardware watchdog and uses this to help implement the interface. ● Reporting fault conditions. PSCI 12
  • 13. 13