Last edited 4 weeks ago

PMIC hardware components

Applicable for STM32MP13x lines  STM32MP15x lines    STM32MP23x lines  STM32MP25x lines


1. Article purpose[edit | edit source]

The purpose of this article is to:

  • list the Power Management Integrated Circuit (PMIC) hardware components that might be integrated in the different boards
  • link these components to the corresponding software framework(s)
  • point to the datasheet(s) of these components
  • explain, when necessary, how to configure these components.

The STPMIC documentations are available from www.st.com [1].

2. Software frameworks[edit | edit source]

Domain Peripheral Software components Comment
OP-TEE Linux STM32Cube
PMIC STPMIC1 STM32 MPU OP-TEE overview
SCMI overview
SCMI overview
Regulator overview
Watchdog overview
U-Boot
stm32mp13xx_disco_stpmic1.c

stm32mp15xx_disco_stpmic1.c
stm32mp15xx_eval_stpmic1.c

for STM32MP1 series
PMIC STPMIC1L SCMI overview
PMIC STPMIC25 PMIC driver in BSP of
STM32Cube MPU Packages

stpmic2 directory

for STM32MP2 series
PMIC STPMIC2L

3. STPMIC1[edit | edit source]

3.1. Description[edit | edit source]

The STPMIC1 is a device that handles the power supplies for some STM32MP boards. The STPMIC1 main features are:

  • configuration via I²C bus,
  • 10 regulators of different kinds with over-current protection,
  • 3 power switches for USB supplies,
  • a power-on key input,
  • a watchdog,
  • a thermal protection,
  • a NORMAL mode and an ALTERNATE mode that is used for system suspend.

The STPMIC1 documentation is available from www.st.com [2] STPMIC1 datasheet.

It is supported only for STM32MP1 series products.

When using a PMIC on a board, it is recommended to use a secure I²C (for example I2C4 or I2C6 on STM32MP15x lines More info.png) protected by ETPZC and the PMIC is handle only in OP-TEE, exported with SCMI.

It is the default configuration of all STMicroelectronics STM32MP13x lines More info.png boards.

For STMicroelectronics STM32MP15x lines More info.png boards, it is not the case because the used I2C is shared with other devices.

3.2. Support in Linux Kernel[edit | edit source]

The PMIC can be accessed via SCMI protocol. If this option is chosen, the kernel does not instantiate any linux STPMIC1 driver but instead it uses SCMI regulators to control power supplies. As the PMIC driver is fully handled in OP-TEE the I2C bus can be secured.

It is the default configuration for STM32MP13x lines More info.png .

3.2.1. STMPIC1 MFD driver[edit | edit source]

The STPMIC1 Multi-Function Devices (MFD) driver is composed of several parts:

  • The core driver
  • The regulator driver
  • The watchdog driver
  • The input driver

The thermal feature is not supported.

It is used only for STM32MP15x lines More info.png .

Bindings are described in: Documentation/devicetree/bindings/mfd/st,stpmic1.yaml

3.2.1.1. Core driver[edit | edit source]

The core implements the Multi-Function Devices Framework API.

  • It is probed by the I²C framework.
  • It handles communication with the PMIC via I²C.
  • It probes the others STPMIC1 drivers (input, watchdog....).
  • It acts as an interrupt controller for the other drivers.

Source code:

3.2.1.2. Regulator driver[edit | edit source]

The driver implements the Regulator framework API

  • Each BUCK, LDO or POWER SWITCH inside the STPMIC1 device is presented as a voltage regulator.
  • Power switches are presented as fixed voltage sources. Voltage can not be set.
  • The driver does not handle the suspend configuration. This is done by the Secure Monitor.

Source code:

3.2.1.3. Watchdog driver[edit | edit source]

The driver implements the Watchdog framework API

When enabled, a watchdog device is available for the user-land. As soon as a user has started to write in the watchdog it is armed in the PMIC. When the watchdog timer expires, the PMIC shuts down.

Source code:

3.2.1.4. Input driver[edit | edit source]

The driver implements the Input framework API.

The driver exposes a single key (KEY_POWER) that can be used as any standard input device in /dev/input/eventX

Source code:

3.2.1.5. Kernel Configuration[edit | edit source]

With kernel menuconfig, enable following configurations:

  • core part: MFD_STPMIC1
  • regulator: REGULATOR_STPMIC1
  • watchdog: STPMIC1_WATCHDOG
  • input: INPUT_STPMIC1_ONKEY

3.3. Support in U-Boot[edit | edit source]

The PMIC can also be accessed via SCMI protocol. If this option is chosen, U-Boot does not instantiate any STPMIC1 driver but instead it uses SCMI regulators to control power supplies.

It is the default configuration for STM32MP13x lines More info.png .

3.3.1. U-Boot STPMIC1 driver[edit | edit source]

STPMIC1 is used by U-Boot for STM32MP15x lines More info.png to:

  • Control regulators used by other drivers (mmc-supply for SDCard for example, usb vbus)
  • Trace pmic startup reason

STMPIC is supported with existing uclass of the 'Driver Model' described in doc/develop/driver-model/pmic-framework.rst or in U-Boot Documentation.

The STPMIC1 is available with the existing commands:

  • pmic (CONFIG_CMD_PMIC)
  • regulator (CONFIG_CMD_REGULATOR)
  • poweroff (CONFIG_CMD_POWEROFF)

STPMIC1 driver supports configuration via device-tree; the bindings, same as kernel, are described in: Documentation/devicetree/bindings/mfd/st,stpmic1.yaml

3.4. Support in Cortex-A7 Secure[edit | edit source]

3.4.1. TF-A[edit | edit source]

STPMIC1 is used by TF-A firmware to configure DDR and storage power supplies.

Driver source code:

STPMIC1 driver supports configuration via device-tree, bindings are described in:

An example of PMIC configuration with device tree can be found in this file, node &i2c4: fdts/stm32mp157f-ed1.dts

When using a PMIC on a board, TF-A is configured to use a secure I²C (I2C4 or I2C6). By default on STMicroelectronics boards, I2C4 is used.

Using another I²C (non-secure) is not supported in the TF-A implementation made by STMicroelectronics. But it is possible to modify the code and device tree files to support it.

Here is an example with I2C2:

  • Copy the chosen I²C node from Linux device tree in the TF-A device tree file for your board, as well as its dependencies (like pinctrl). You can also remove the properties not used by TF-A as done in the example below
/ {
...
	soc {
	...
 +		i2c2: i2c@40013000 {
 +			compatible = "st,stm32mp15-i2c";
 +			reg = <0x40013000 0x400>;
 +			clocks = <&rcc I2C2_K>;
 +			resets = <&rcc I2C2_R>;
 +			#address-cells = <1>;
 +			#size-cells = <0>;
 +			status = "disabled";
 +		};
  • change pmic node parent to this newly added I²C
& i2c2 {
	...
	pmic: stpmic@33 {   # You may also require to change this I²C address (33)
	...
};
  • remove in PMIC node the property:
secure-status = "okay";
#define I2C2_BASE			U(0x40013000)
	case UART7_BASE:
	case UART8_BASE:
	case IWDG2_BASE:
+	case I2C2_BASE:
		/* Allow drivers to register some non secure resources */
		VERBOSE("IO for non secure resource 0x%x\n",
			(unsigned int)base);
+	_CLK_SC_SELEC(RCC_MP_APB1ENSETR, 22, I2C2_K, _I2C12_SEL),
  • Regarding the GPIO ports used by I2C2: in this stm32mp1_clk_gate[] table, remove the #ifdef IMAGE_BL2 around GPIO banks entries if present

3.4.2. OP-TEE[edit | edit source]

STPMIC1 is used by OP-TEE OS to configure the regulators for system suspend and system shutdown.

Driver source code:

3.4.2.1. SCMI Driver[edit | edit source]

As most of regulators handled by OP-TEE, the STPMIC1 regulators can be shared via SCMI voltage domains protocol to the non secure world.

It is the default configuration for STM32MP13x lines More info.png.

4. STPMIC1L[edit | edit source]

4.1. Description[edit | edit source]

The STPMIC1L is a simplified version of the STPMIC25, the implementation is done in stpmic2 drivers. It has less BUCKs and LDOs than STPMIC25 but 2 brand new GPOs. A GPO is an output port that can be used to control an external regulator. The state of the GPO is can be also managed by the PWRCTRL input signals.

It can replace STPMIC1 for STM32MP1 series products.

4.2. Support in Linux Kernel and U-Boot[edit | edit source]

The PMIC is accessed via SCMI protocol. The kernel or U-Boot use SCMI regulators to control power supplies. As the PMIC driver is fully handled in OP-TEE the I2C bus is secured.

4.3. Support in Cortex-A7 Secure[edit | edit source]

4.3.1. TF-A[edit | edit source]

STPMIC1L is used by TF-A firmware to configure DDR and storage power supplies.

Driver source code is the same as STPMIC25.

The STM32MP_STPMIC1L configuration flag as to be set to select stpmic2 driver instead of stpmic1 driver for STM32MP1 series.

In the device tree, the PMIC1L is selected with compatible = "st,stpmic1l":

 &i2c4 {
 	pmic1l: stpmic@33 {
 		compatible = "st,stpmic1l";
 		reg = <0x33>;
 		status = "okay";
 
 		regulators {
 			compatible = "st,stpmic2-regulators";
 
 			vddcore: buck1 {
 				regulator-name = "vddcore";
 				regulator-min-microvolt = <1250000>;
 				regulator-max-microvolt = <1250000>;
 				regulator-always-on;
 			};

4.3.2. OP-TEE[edit | edit source]

STPMIC1L is used by OP-TEE OS to configure the regulators for system suspend and system shutdown.

In the device tree, the PMIC1L is selected with compatible = "st,stpmic1l":

Driver source code is the same as STPMIC25 except adaptation for STM32MP1 series, compiled when CFG_STPMIC2 flag is activated:

5. STPMIC25[edit | edit source]

5.1. Description[edit | edit source]

The STPMIC25 is a device that handles the power supplies for some STM32MP boards. The STPMIC25 main features are:

  • configuration via I²C bus,
  • many regulators of different kinds with over-current protection,
  • a power-on key input,
  • a watchdog,
  • a thermal protection,
  • 3 inputs pins named PWRCTRL that can be used to control the regulator states.

The main differences with the STPMIC1 are:

  • More regulators,
  • Each regulator can be assigned to any one of the 3 PWRCTRLs or none,
  • A regulator can be reset on a PWRCTRL event,
  • No USB dedicated power supply. (TBC)

The STPMIC25 documentation is available from www.st.com [3], for example STPMIC25 datasheet.

5.2. Support in Linux Kernel and U-Boot[edit | edit source]

The PMIC is accessed via SCMI protocol. The kernel or U-Boot use SCMI regulators to control power supplies. As the PMIC driver is fully handled in OP-TEE the I2C bus is secured.

5.3. Support in Cortex-A35 Secure[edit | edit source]

5.3.1. TF-A[edit | edit source]

STPMIC25 is used by TF-A firmware to configure DDR and storage power supplies.

Driver source code:

STPMIC25 driver supports configuration via device-tree, bindings are described in:

An example of PMIC configuration with device tree can be found in this file, node &i2c7: fdts/stm32mp257f-ev1.dts

5.3.2. OP-TEE[edit | edit source]

STPMIC25 is used by OP-TEE OS to configure the regulators for system suspend and system shutdown, and provide SCMI service to kernel and U-Boot.

Driver source code:

STPMIC25 driver supports configuration via device-tree, bindings are described in:

6. STPMIC2L[edit | edit source]

The STPMIC2L is a simplified version of the STPMIC25, the implementation is done in stpmic2 drivers.

6.1. Support in Linux Kernel and U-Boot[edit | edit source]

The PMIC is accessed via SCMI protocol. The kernel or U-Boot use SCMI regulators to control power supplies. As the PMIC driver is fully handled in OP-TEE the I2C bus is secured.

6.2. Support in Cortex-A35 Secure[edit | edit source]

6.2.1. TF-A[edit | edit source]

STPMIC2L is used by TF-A firmware to configure DDR and storage power supplies.

Driver source code is the same as for STPMIC25. In the device tree, the PMIC2L is selected with compatible = "st,stpmic2l":

6.2.2. OP-TEE[edit | edit source]

STPMIC2L is used by OP-TEE OS to configure the regulators for system suspend and system shutdown.

In the device tree, the PMIC1L is selected with compatible = "st,stpmic2l":

Driver source code is the same as STPMIC25.

7. References[edit | edit source]

Please refer to the following links for additional information: