What is pwr in linux

PWR internal peripheral

It has 6 input pins (named wakeup pins) which can be programmed to wake the system up from low power. The wakeup pins are listed with WKUP prefix in the STM32MP15 Datasheet.

These pins can be used by the Cortex ® -A7 non secure (via Cortex ® -A7 secure services) or the Cortex ® -M4.

The PWR peripheral provides 2 output hardware lines named PWR_ON and PWR_LP:

  • In STPMIC1 configuration, PWR_ON allows to select the register bank (active or low power). PWR_LP is not used.
  • In the power discrete solution they drive VDDcore which feeds the Cortex ® -A7, the Cortex ® -M4 and the peripherals. They also control the DDR power supplies (VDD_DDR, VREF_DDR, VTT_DDR).

Features

Refer to the STM32MP15 reference manuals for the complete list of features, and to the software components, introduced below, to see which features are implemented.

Security support

The PWR is secure aware with the security control managed via RCC TZEN bit.

Peripheral usage and associated software

Boot time

The PWR is closely configured together with RCC by all the boot components: the ROM code, the FSBL, the SSBL and up to Linux ® kernel. Its configuration is carried by the device tree.

Runtime

Overview

The PWR peripheral is shared at runtime:

A concurrent control from each context is possible because the described management is realized via independent registers.

Software frameworks

Domain Peripheral Software frameworks Comment
Cortex-A7
secure
(OP-TEE)
Cortex-A7
non-secure
(Linux)
Cortex-M4

Peripheral configuration

The configuration is applied by the firmware running in the context to which the peripheral is assigned. The configuration can be done alone via the STM32CubeMX tool for all internal peripherals, and then manually completed (particularly for external peripherals), according to the information given in the corresponding software framework article.

Peripheral assignment

How to go further

The PWR is interfaced with the hardware debug port (HDP) of the STM32MP15. This link offers the flexibility to observe the main PWR state signals on debug pins.

Please refer to STM32MP15 reference manuals for the exact list of signals that can be monitored.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Quick Power-Management Tool for Linux

License

emctague/pwr

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

This is a program designed for laptops. It can easily switch between power-saving and performance modes using simple, shorthand commands. It will also restart the current display manager unless the -n flag is selected, allowing for all changes to take effect.

What it switches (if available):

  • CPU Performance Governor ( powersave vs. performance )
  • NVIDIA PRIME GPU ( intel vs. nvidia )
  • Wireless card power-saving state ( on vs. off )

To switch into Performance mode:

To switch to power-saving mode:

And to check the current state (gives perform or powersave ):

You can also use the shorthand pe for performance, ps for power-saving, to for toggle, and qu for query.

If you don’t want your display manager to restart, add the -n flag on the end of the command.

Check out the Releases. You can either run the .sh -based installer (a self-extracting archive) as root, or unpack the .tar.gz file and install its contents manually. Be aware that the installer and tarball don’t automatically set the script as setuid — you may have to add the +s flag manually.

Ensure you have git and cmake installed, as well as an appropriate C compiler such as gcc .

git clone https://github.com/emctague/pwr cd pwr mkdir build cd build cmake .. make make install 

You can also download a tarball of the latest release and use that instead of the git repo.

Copyright 2018 Ethan McTague.

This program is licensed under the MIT license. See LICENSE for full license text.

About

Quick Power-Management Tool for Linux

Источник

How to configure PWR Wake-up pins

This article describes the configuration of the PWR wake-up pins for a usage in Linux , based on OP-TEE driver.
The PWR Wake-up pins are used to wake-up from Standby from an external device.
This article does not describe how to configure a wake-up pin to use it internally in OP-TEE .

This article is applicable only if the PWR peripherals is assigned only to OP-TEE , for STM32MP13x lines .

For STM32MP15x lines , the PWR Wake-up is handled in EXTI_pwr irqchip driver.

2 Overview [ edit ]

Alternate text

  • Button: one external device plugged to a wake-up pin. Could also be a PMIC .
  • PWR: PWR internal peripheral
  • OP-TEE PWR IRQ driver: driver in charge of PWR peripheral that provides access to the wake-up pin via an interrupts interface.
  • OP-TEE PWR IRQ user driver: PWR IRQ consumer used to enable one wake-up pin and forward events as notifications to the non-secure world.
  • OP-TEE notification: stack in charge of communication with the non secure world.
  • Linux Linaro optee driver: stack in charge of communication with secure world. Transform OP-TEE notifications to interrupts.
  • GPIO keys: Linux driver using a wake-up pin handled by OP-TEE . Could be any driver able to handle Linux interrupts.

3 Wake-up pin configuration [ edit ]

3.1 OP-TEE configuration [ edit ]

Wake-up pins are configured in OP-TEE via device-tree. A pwr-irq-user can be instantiated to handle the desired wake-up pin and send a OP-TEE notification to Linux in case of event.

3.2 Linux configuration [ edit ]

Linux does not handle wake-up pin, but it can handle an OP-TEE notification as an interrupt. This is configured via device-tree.

4 Example with wake-up pin 2 [ edit ]

In the example below, the wake-up pin number 2 is configured by OP-TEE , forwarded as notification number 4 to Linux , and used by «gpio-keys» driver in Linux to generate a key-press.

wakeup_button: wakeup-button < compatible = "st,stm32mp1,pwr-irq-user"; st,wakeup-pin-number = ; st,notif-it-id = ; status = "okay"; >;
wake_up < compatible = "gpio-keys"; status = "okay"; button < label = "wake-up"; linux,code = ; interrupts-extended = ; status = "okay"; >; >;

5 References [ edit ]

Linux ® is a registered trademark of Linus Torvalds.

Open portable trusted execution environment

Power management integrated circuit

General-purpose input/output (A realization of open ended transmission between devices on an embedded level. These pins available on a processor can be programmed to be used to either accept input or provide output to external devices depending on user desires and applications requirements.)

Источник

How to configure PWR Wake-up pins

This article describes the configuration of the PWR wake-up pins for a usage in Linux , based on OP-TEE driver.
The PWR Wake-up pins are used to wake-up from Standby from an external device.
This article does not describe how to configure a wake-up pin to use it internally in OP-TEE .

This article is applicable only if the PWR peripherals is assigned only to OP-TEE , for STM32MP13x lines .

For STM32MP15x lines , the PWR Wake-up is handled in EXTI_pwr irqchip driver.

2 Overview [ edit ]

Alternate text

  • Button: one external device plugged to a wake-up pin. Could also be a PMIC .
  • PWR: PWR internal peripheral
  • OP-TEE PWR IRQ driver: driver in charge of PWR peripheral that provides access to the wake-up pin via an interrupts interface.
  • OP-TEE PWR IRQ user driver: PWR IRQ consumer used to enable one wake-up pin and forward events as notifications to the non-secure world.
  • OP-TEE notification: stack in charge of communication with the non secure world.
  • Linux Linaro optee driver: stack in charge of communication with secure world. Transform OP-TEE notifications to interrupts.
  • GPIO keys: Linux driver using a wake-up pin handled by OP-TEE . Could be any driver able to handle Linux interrupts.

3 Wake-up pin configuration [ edit ]

3.1 OP-TEE configuration [ edit ]

Wake-up pins are configured in OP-TEE via device-tree. A pwr-irq-user can be instantiated to handle the desired wake-up pin and send a OP-TEE notification to Linux in case of event.

3.2 Linux configuration [ edit ]

Linux does not handle wake-up pin, but it can handle an OP-TEE notification as an interrupt. This is configured via device-tree.

4 Example with wake-up pin 2 [ edit ]

In the example below, the wake-up pin number 2 is configured by OP-TEE , forwarded as notification number 4 to Linux , and used by «gpio-keys» driver in Linux to generate a key-press.

wakeup_button: wakeup-button < compatible = "st,stm32mp1,pwr-irq-user"; st,wakeup-pin-number = ; st,notif-it-id = ; status = "okay"; >;
wake_up < compatible = "gpio-keys"; status = "okay"; button < label = "wake-up"; linux,code = ; interrupts-extended = ; status = "okay"; >; >;

5 References [ edit ]

Linux ® is a registered trademark of Linus Torvalds.

Open portable trusted execution environment

Power management integrated circuit

General-purpose input/output (A realization of open ended transmission between devices on an embedded level. These pins available on a processor can be programmed to be used to either accept input or provide output to external devices depending on user desires and applications requirements.)

Источник

How to configure PWR Wake-up pins

This article describes the configuration of the PWR wake-up pins for a usage in Linux , based on OP-TEE driver.
The PWR Wake-up pins are used to wake-up from Standby from an external device.
This article does not describe how to configure a wake-up pin to use it internally in OP-TEE .

This article is applicable only if the PWR peripherals is assigned only to OP-TEE , for STM32MP13x lines .

For STM32MP15x lines , the PWR Wake-up is handled in EXTI_pwr irqchip driver.

2 Overview [ edit ]

Alternate text

  • Button: one external device plugged to a wake-up pin. Could also be a PMIC .
  • PWR: PWR internal peripheral
  • OP-TEE PWR IRQ driver: driver in charge of PWR peripheral that provides access to the wake-up pin via an interrupts interface.
  • OP-TEE PWR IRQ user driver: PWR IRQ consumer used to enable one wake-up pin and forward events as notifications to the non-secure world.
  • OP-TEE notification: stack in charge of communication with the non secure world.
  • Linux Linaro optee driver: stack in charge of communication with secure world. Transform OP-TEE notifications to interrupts.
  • GPIO keys: Linux driver using a wake-up pin handled by OP-TEE . Could be any driver able to handle Linux interrupts.

3 Wake-up pin configuration [ edit ]

3.1 OP-TEE configuration [ edit ]

Wake-up pins are configured in OP-TEE via device-tree. A pwr-irq-user can be instantiated to handle the desired wake-up pin and send a OP-TEE notification to Linux in case of event.

3.2 Linux configuration [ edit ]

Linux does not handle wake-up pin, but it can handle an OP-TEE notification as an interrupt. This is configured via device-tree.

4 Example with wake-up pin 2 [ edit ]

In the example below, the wake-up pin number 2 is configured by OP-TEE , forwarded as notification number 4 to Linux , and used by «gpio-keys» driver in Linux to generate a key-press.

wakeup_button: wakeup-button < compatible = "st,stm32mp1,pwr-irq-user"; st,wakeup-pin-number = ; st,notif-it-id = ; status = "okay"; >;
wake_up < compatible = "gpio-keys"; status = "okay"; button < label = "wake-up"; linux,code = ; interrupts-extended = ; status = "okay"; >; >;

5 References [ edit ]

Linux ® is a registered trademark of Linus Torvalds.

Open portable trusted execution environment

Power management integrated circuit

General-purpose input/output (A realization of open ended transmission between devices on an embedded level. These pins available on a processor can be programmed to be used to either accept input or provide output to external devices depending on user desires and applications requirements.)

Источник

Читайте также:  Renaming user in linux
Оцените статью
Adblock
detector