| 1 |
.. SPDX-License-Identifier: GPL-2.0 |
| 2 |
|
| 3 |
===================================== |
| 4 |
Texas Instruments TPS6594 PFSM driver |
| 5 |
===================================== |
| 6 |
|
| 7 |
Author: Julien Panis ([email protected]) |
| 8 |
|
| 9 |
Overview |
| 10 |
======== |
| 11 |
|
| 12 |
Strictly speaking, PFSM (Pre-configurable Finite State Machine) is not |
| 13 |
hardware. It is a piece of code. |
| 14 |
|
| 15 |
The TPS6594 PMIC (Power Management IC) integrates a state machine which |
| 16 |
manages operational modes. Depending on the current operational mode, |
| 17 |
some voltage domains remain energized while others can be off. |
| 18 |
|
| 19 |
The PFSM driver can be used to trigger transitions between configured |
| 20 |
states. It also provides R/W access to the device registers. |
| 21 |
|
| 22 |
Supported chips |
| 23 |
--------------- |
| 24 |
|
| 25 |
- tps6594-q1 |
| 26 |
- tps6593-q1 |
| 27 |
- lp8764-q1 |
| 28 |
|
| 29 |
Driver location |
| 30 |
=============== |
| 31 |
|
| 32 |
drivers/misc/tps6594-pfsm.c |
| 33 |
|
| 34 |
Driver type definitions |
| 35 |
======================= |
| 36 |
|
| 37 |
include/uapi/linux/tps6594_pfsm.h |
| 38 |
|
| 39 |
Driver IOCTLs |
| 40 |
============= |
| 41 |
|
| 42 |
:c:macro:`PMIC_GOTO_STANDBY` |
| 43 |
All device resources are powered down. The processor is off, and |
| 44 |
no voltage domains are energized. |
| 45 |
|
| 46 |
:c:macro:`PMIC_GOTO_LP_STANDBY` |
| 47 |
The digital and analog functions of the PMIC, which are not |
| 48 |
required to be always-on, are turned off (low-power). |
| 49 |
|
| 50 |
:c:macro:`PMIC_UPDATE_PGM` |
| 51 |
Triggers a firmware update. |
| 52 |
|
| 53 |
:c:macro:`PMIC_SET_ACTIVE_STATE` |
| 54 |
One of the operational modes. |
| 55 |
The PMICs are fully functional and supply power to all PDN loads. |
| 56 |
All voltage domains are energized in both MCU and Main processor |
| 57 |
sections. |
| 58 |
|
| 59 |
:c:macro:`PMIC_SET_MCU_ONLY_STATE` |
| 60 |
One of the operational modes. |
| 61 |
Only the power resources assigned to the MCU Safety Island are on. |
| 62 |
|
| 63 |
:c:macro:`PMIC_SET_RETENTION_STATE` |
| 64 |
One of the operational modes. |
| 65 |
Depending on the triggers set, some DDR/GPIO voltage domains can |
| 66 |
remain energized, while all other domains are off to minimize |
| 67 |
total system power. |
| 68 |
|
| 69 |
Driver usage |
| 70 |
============ |
| 71 |
|
| 72 |
See available PFSMs:: |
| 73 |
|
| 74 |
# ls /dev/pfsm* |
| 75 |
|
| 76 |
Dump the registers of pages 0 and 1:: |
| 77 |
|
| 78 |
# hexdump -C /dev/pfsm-0-0x48 |
| 79 |
|
| 80 |
See PFSM events:: |
| 81 |
|
| 82 |
# cat /proc/interrupts |
| 83 |
|
| 84 |
Userspace code example |
| 85 |
---------------------- |
| 86 |
|
| 87 |
samples/pfsm/pfsm-wakeup.c |