mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 18:35:28 +00:00
6fc214c1e3803703289d62be13e887d2b581fa8e
Implement the state machine for PWRBTN# input and output to PCH. The state begins while power button is pressed and stops while it is released or 8 secs pass. The state machine is maintained inside the infinite loop of gpio_task(). Remember to #define EVT after the board comes back. Also, the power-up sequence is not completed yet. Remember to come back when it is done. Search TODO in code. BUG=none TEST=Manual run on evaluation board (via console printf): #--------------------------- # power button pressed and release after 8s [3070341] New State: START next_ts:3070340 # wait for next pwrbtn_sm_handle() is run. [3071428] set_pwrbtn_to_pch(LOW) [3071482] New State: T0 next_ts:3103426 [3103963] set_pwrbtn_to_pch(HIGH) [3104023] New State: T1 next_ts:7071961 [7072044] set_pwrbtn_to_pch(LOW) [7072103] New State: T2 next_ts:11072042 [11072661] set_pwrbtn_to_pch(HIGH) [11072723] New State: STOPPED next_ts:11072042 # power button released [14336515] New State: STOPPING next_ts:14336514 [14337604] set_pwrbtn_to_pch(HIGH) [14337662] New State: SOPPED next_ts:14336514 #--------------------------- # Power button released during T1 [378324436] New State: START next_ts:378324435 [378325530] set_pwrbtn_to_pch(LOW) [378325589] New State: T0 next_ts:378357528 [378358080] set_pwrbtn_to_pch(HIGH) [378358143] New State: T1 next_ts:382326078 [378889269] New State: STOPPING next_ts:378889268 [378890361] set_pwrbtn_to_pch(HIGH) [378890420] New State: STOPPED next_ts:378889268 #--------------------------- # Power button released during T2 [448592391] New State: START next_ts:448592390 [448593483] set_pwrbtn_to_pch(LOW) [448593542] New State: T0 next_ts:448625481 [448626041] set_pwrbtn_to_pch(HIGH) [448626104] New State: T1 next_ts:452594039 [452594076] set_pwrbtn_to_pch(LOW) [452594138] New State: T2 next_ts:456594074 [453199165] New State: STOPPING next_ts:453199164 [453200257] set_pwrbtn_to_pch(HIGH) [453200316] New State: STOPPED next_ts:453199164 Change-Id: I5a12f3e46fa8086c530123a81ee743d3664b91f4
- EC Lib
This wraps Blizzard driverlib and implements the EC chip interface defined
by Google. See below diagram for architecture.
+--------------------+
| Host BIOS/OS |
+--------------------+
---- host interface ----
+--------------------+
| Google EC features |
+--------------------+
---- chip interface ---- The interface is defined in
src/platform/ec/chip_interface/*.
+--------------------+ But the real implementation is in EC Lib.
| EC Lib |
+--------------------+
| Blizzard low level |
| driver, the |
| driverlib. |
+--------------------+
Description
Languages
C
64.7%
Lasso
20.7%
ASL
3.6%
JavaScript
3.2%
C#
2.9%
Other
4.6%