summaryrefslogtreecommitdiff
path: root/docs/zephyr/zephyr_ap_power.md
blob: 0b95e375d6a879fbd5544ae55812a590c03b20a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Zephyr EC AP Power Requirements

[TOC]

## Overview

[AP] power configures the minimum amount of power needed to boot the Application
Processor.

## Kconfig Options

The Kconfig option `CONFIG_PLATFORM_EC_BOOT_AP_POWER_REQUIREMENTS` enables checking power
thresholds before booting the AP.  See the file [Kconfig.ap_power] for all Kconfig
options related to this feature.

## Devicetree Nodes

None required.

## Board Specific Code

None required.

## Threads

AP_POWER support does not enable any threads.

## Testing and Debugging

Use the battfake  command to force the battery level, independent of the actual battery charge.
To verify the AP power thresholds, force the battery level below the
`CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON` setting and reboot the EC.
The EC should prevent the AP from powering up.

`battfake` usage: battfake <percent> (-1 = use real level)

```
battfake 2
reboot
/* Verify that AP does ot boot */
battfak3 3
/* Verify that AP boots */
/* Restore normal operation */
battfake -1
```
## Example

For Herobrine, the minimum battery level to boot the AP without AC is 2 percent
of the battery capacity and the minimum AC power to boot the AP with a battery
is set to 10000 milliwats.

```
CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON=2
CONFIG_PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON=10000
```

[AP]: ../ec_terms.md#ap
[Kconfig.ap_power]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/Kconfig.ap_power