summaryrefslogtreecommitdiff
path: root/common/power_button_x86.c
Commit message (Collapse)AuthorAgeFilesLines
* power_button_x86: Ensure INIT_ON presses button for 200 msEdward Hill2019-01-111-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PWRBTN_STATE_INIT_ON should assert GPIO_PCH_PWRBTN_L for PWRBTN_INITIAL_US (200 milliseconds). It was sometimes releasing it too soon, so then the AP would fail to go to S0. In the failing case: 1) PWRBTN_STATE_INIT_ON calls set_pwrbtn_to_pch(). 2) The user has just released the physical button. 3) I2C activity (for battery_get_disconnect_state() from charge_prevent_power_on() in set_pwrbtn_to_pch()) allows power_button_change_deferred() to run to process the release. 4) set_pwrbtn_to_pch() finishes, setting GPIO_PCH_PWRBTN_L to 0. 5) PWRBTN_STATE_INIT_ON checks power_button_is_pressed(), which returns 0, because power_button_change_deferred() ran at 3. 6) PWRBTN_STATE_INIT_ON sets pwrbtn_state to PWRBTN_STATE_RELEASED instead of PWRBTN_STATE_BOOT_KB_RESET. 7) powerbtn_x86_changed() runs (via HOOK_POWER_BUTTON_CHANGE from 3), sets pwrbtn_state to PWRBTN_STATE_RELEASED (again) and also tnext_state to now. 8) state_machine() runs, PWRBTN_STATE_RELEASED sets GPIO_PCH_PWRBTN_L to 1. This is too soon. Change to always set the next state to PWRBTN_STATE_BOOT_KB_RESET after asserting GPIO_PCH_PWRBTN_L to fix this. This ensures powerbtn_x86_changed() will ignore all physical button changes during the initial 200 ms pulse. BUG=b:121066727 BRANCH=grunt TEST=Press Power+F3 many times. AP always boots. Change-Id: I29828f25793bb35fd75efea28de2af9fc2e85ce5 Signed-off-by: Edward Hill <ecgh@chromium.org> Previous-Reviewed-on: https://chromium-review.googlesource.com/1395759 (cherry picked from commit acaa2c5b54d774c937805395b9643ed433bff5b2) Reviewed-on: https://chromium-review.googlesource.com/c/1405405
* grunt: Increase PWR_BTN_L shutdown delay to 5 secondsEdward Hill2018-10-231-1/+2
| | | | | | | | | | | | | | | | | A falling edge on PWR_BTN_L causes the AP to wake back up from S5. Avoid this by increasing the delay before we assert PWR_BTN_L to be longer than the time it takes to reach S5. BUG=b:117676579 BRANCH=grunt TEST=In S0; powerb 12000; S0->S5->G3 Change-Id: Idbfcb8a8d7dc7069a0f61d4b9e8f337ad60db405 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1294949 Tested-by: Martin Roth <martinroth@chromium.org> Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Martin Roth <martinroth@chromium.org>
* power_button_x86: Check init-on timeout since PB task start timeFurquan Shaikh2018-09-251-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When PB state machine is in PWRBTN_STATE_INIT_ON, it first checks if current time (i.e. time since EC reset) is greater than CONFIG_POWER_BUTTON_INIT_TIMEOUT (which is typically 1 second). If yes, then it assumes that it is not okay to bring the AP out of reset (possibly because battery, charger and PD are not initialized in time). However, in case of manual recovery using power and volume buttons, user could be holding the buttons for > 30 seconds. This is required to allow user to request recovery with hardware reinitialization. In such cases, it is not right to check for current time against the timeout value of 1 second. Instead, the timeout should be considered since EC started all the tasks. This change records the timestamp when power button task starts and then uses that time to calculate the actual timeout in PWRBTN_STATE_INIT_ON. BUG=b:113165243 BRANCH=nocturne TEST=None Change-Id: Ifd5211cbd1a2fa56c9affcf656df65b11192c519 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1226228 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> (cherry picked from commit de0629592aef6e9d77821bb89b62d2a733675e2b) Reviewed-on: https://chromium-review.googlesource.com/1242208 Reviewed-by: Martin Roth <martinroth@chromium.org> Commit-Queue: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* Nami: Delay and repeat gas gauge detectionElmo_Lan2018-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, battery gas gauges are detected only once at HOOK_INIT. This is too early when a battery wakes up from cutoff. This patch makes EC detect gas gauges when needed. On Nami this is when the power button task checks power readiness. The power button task then repeatedly performs this check until a gauge wakes up. BUG=b:111990386 BRANCH=none TEST=Verify the following on Sona, Vayne, Pantheon, Akali: 1. Write protect EC SPI flash 2. Unplug AC charger 3. Run 'ectool batterycutoff' on AP console 4. After system shuts down, plug in AC charger. 5. System boots automatically. Change-Id: I50b295bdc7bb048de1d191e1c6964acc8b348b5b Signed-off-by: Elmo_Lan <elmo_lan@compal.corp-partner.google.com> Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1160869 (cherry picked from commit 586bf283695e6a9312016ca67e15febcdfd3572f) Reviewed-on: https://chromium-review.googlesource.com/1156530 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* power button: Ignore lid open in PWRBTN_STATE_INIT_ONEdward Hill2018-04-271-1/+2
| | | | | | | | | | | | | | | | | | Normally on lid open, if chipset is off, we pulse the power button to wake the AP. If we are in PWRBTN_STATE_INIT_ON, then we are already waiting to power on the AP so ignore the lid open to avoid turning on the AP too soon. BUG=b:77455171 BRANCH=none TEST=Plug power into Grunt with no battery. Change-Id: Ie57e998725af0ace525f9f2102a0f5a282382a57 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1031565 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* power button: Wait for charger and battery initializationEdward Hill2018-03-131-5/+16
| | | | | | | | | | | | | | | | | | | | | | | For PWRBTN_STATE_INIT_ON, before attempting to power the system on, we need to wait for charger and battery to be ready to supply sufficient power. Check every 100 milliseconds, and give up after 1 second. This allows time for charger, battery and USB-C PD initialization. Previously, init-on would fail because it called set_pwrbtn_to_pch too soon (before charge current had been initialized, and before the USB-C 3A current was detected). BUG=b:72645441,b:74017044 BRANCH=none TEST=cold reset Grunt with ac/battery connected/disconnected Change-Id: I0413e7f2d7b19a99c994b51b22f28a2f993137de Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/900049 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com>
* power_button_x86: Honor power_button_pulse setting on sysjumpFurquan Shaikh2018-02-121-2/+7
| | | | | | | | | | | | | | | | | | | On sysjump, if power button is held down, first check power_button_pulse_enabled setting to decide if powerbtn to pch should be asserted. This is important to prevent accidental shutdowns when user is attempting to do an EC reset with Vup+Pwr held down. BUG=b:73129177 BRANCH=None TEST=Verified following: 1. Reset EC by holding Vup+Pwr. 2. Keep holding Vup+Pwr until AP reaches depthcharge. 3. Ensure that AP does not shutdown. Change-Id: I0375fc8e8baabb40807dfdc6d4c9fa70c9b3b87d Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/912364 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* Fix inconsistent task function declarationsStefan Reinauer2017-08-081-1/+1
| | | | | | | | | | | | | | | Tasks are defined inconsistently across the code base. Signed-off-by: Stefan Reinauer <reinauer@google.com> BRANCH=none TEST=make buildall -j, also verify kevin boots to OS BUG=none Change-Id: I19a076395a9a8ee1e457e67a89d80d2f70277c97 Reviewed-on: https://chromium-review.googlesource.com/602739 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* npcx: Make system stay off after clean shutdownDaisuke Nojiri2017-06-281-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets/clears RESET_FLAG_AP_OFF on S5<->S3 transitions. It's set when the system gracefully shuts down and cleared when the system boots up. The result is EC tries to go back to the previous state upon AC plug-in on battery-less systems. This is required for digital signage and kiosk. This also reverts: CL 514209, 486946, and 486945. BUG=b:37536389 BRANCH=none TEST=Tested as follows: A. Boot to S0 A.1. Unplug AC while system is in S0 then plug in - PASS A.2. Unplug AC while system is in S3 then plug in - PASS A.3. Press recovery+power in S0 - PASS A.4. Press recovery+power in G3 - FAIL (To be fixed) A.5. Execute reboot console command - PASS A.6. Execute reboot OS command - PASS A.7. Execute reboot console command in G3 - PASS B. Boot to G3 B.1 Unplug AC while system is in G3 then plug in - PASS B.2 Unplug AC after B.1 then plug in - PASS B.3 Shutdown by power button on recovery screen then unplug plug in AC - PASS B.4 Execute reboot ap-off console command - PASS B.5 Execute shutdown command from OS then plug in AC - PASS Change-Id: Iaa6f930585050fdd3511c711b449dff47525066d Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/517287 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* KBL/SKL: Add wait between DSW_PWROK and PWRBTNDaisuke Nojiri2017-06-191-0/+10
| | | | | | | | | | | | | | | | This patch adds wait between DSW_PWROK and PWRBTN assert. It is required to be 95 msec or longer for Kaby Lake and Sky Lake. Refer to the timing diagram for G3 to S0 on Sky Lake or Kaby Lake platform design guide for details. BUG=b:62584658 BRANCH=none TEST=On Fizz, measured time between DSW_PWROK high and PWRBTN assert for 1:AC plug-in, 2:recovery+power press, 3: reboot ec command. Change-Id: I89a14ac9a49e20a332bd662d90be62f8ea23b003 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/534901
* power_button_x86: Save and restore power button pulse settingFurquan Shaikh2017-06-141-0/+28
| | | | | | | | | | | | | | | | | | | | | | This change ensures that the power button pulse setting is saved and restored across a sysjump. It uses the SYSJUMP_TAG "PB" (0x5042). BUG=b:62445190 BRANCH=None TEST=The condition mentioned in the bug could be reproduced using following steps: 1. reboot on EC console 2. Use Vup/Vdn to select any option other than Power off. 3. Press power button After step #3 above, device would shut down instead of selecting the option. Verified that with this change, the device does not power off anymore at step #3. Change-Id: Icebe9c17d39a82fc3854dd75cc3a1dea032a234a Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/533921 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* power_button_x86: Set PB state to ON in recovery modeDaisuke Nojiri2017-05-301-13/+10
| | | | | | | | | | | | | | | This patch sets the initial power button state to on if recovery mode is requested. BUG=b:37274183 BRANCH=none TEST=Verify EC boots AP immediately in recovery mode on Fizz. Verify EC doesn't boot AP immediately in normal mode. Change-Id: Ib24eb6c6b7e9200cf7ba6af3e486337da3c68355 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/514209 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* power_button_x86: Initialize to on if button is pressedDaisuke Nojiri2017-05-231-0/+3
| | | | | | | | | | | | | | This change sets the initial power button state to init-on if the power button is pressed. BUG=b:37274183 BRANCH=none TEST=Enter recovery mode by power+recovery button press. Change-Id: I6ed849bc303e7cdbcb975ae2a6ff278093c86088 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/486946 Reviewed-by: Duncan Laurie <dlaurie@google.com>
* power_button: Allow PB to be idle at power-onDaisuke Nojiri2017-05-181-1/+1
| | | | | | | | | | | | | | | | This change adds CONFIG_POWER_BUTTON_INIT_IDLE. When it's set, the system starts with the power button state idle. It means when the board boots from power-off, it stays at G3. BUG=b:37536389 BRANCH=none TEST=Power on Fizz. Verify it stays at G3. Verify it boots by pressing power button. Change-Id: I09a62a69d9f201b2dc261838cc9b4425fe3a8dc1 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/486945 Reviewed-by: Duncan Laurie <dlaurie@google.com>
* Allow lid-less configurationDaisuke Nojiri2017-05-091-0/+2
| | | | | | | | | | | | | | | | | | | power_button_x86.c and switch.c assume there is a lid switch. This patch separate them so that a board with power button but with no lid can be configured properly. This patch also moves backlight control to the board directory so that only the boards with a backlight turn it on/off when power state changes. BUG=none BRANCH=none TEST=boot fizz. make buildall. Change-Id: If4070cdc4b1221fae68b35ec3497335d81f192fd Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/489602 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* power_button_x86: Reset power button setting on chipset transitionsFurquan Shaikh2017-04-171-0/+21
| | | | | | | | | | | | | | | | | Power button pulse is disabled by the host whenever it wants to treat the power button as an input and not trigger SMI. Clear this setting whenever there is a chipset state transition to default pulse enabled. BUG=b:37277943 BRANCH=None TEST=make -j buildall Change-Id: Id0cb3748bf7e25ad9111170116113151d9bed69e Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/476090 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* power_button_x86: Fix power button pulse enabling/disablingFurquan Shaikh2017-04-171-2/+2
| | | | | | | | | | | | | BUG=b:37277943 BRANCH=None TEST=Verified that wake from power button works in S3. Also, verified that menu selection works fine with this change. Change-Id: I8e644af3fb7fbc0147f1acb12b6df945815b5e73 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/475974 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cleanup: Remove charge_state_v1Sam Hurst2017-02-061-14/+0
| | | | | | | | | | | | | | | | All boards have been transitioned to charge_state_v2.c So charge_state_v1.c, HOOK_CHARGE_STATE_CHANGE, and CONFIG_CHARGER_TIMEOUT_HOURS can be removed BUG=chrome-os-partner:36272 TEST=make -j buildall BRANCH=none Change-Id: I3f20c5198ea75185f9894deb792575a1be31432a Reviewed-on: https://chromium-review.googlesource.com/435467 Commit-Ready: Sam Hurst <shurst@google.com> Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* poppy: updating variable name to power_button_pulse_enableShelley Chen2017-01-181-3/+4
| | | | | | | | | | | | | | | | | Updating variable name from smi_enabled to power_button_pulse_enabled, which is a more accurate description of the intended functionality. BUG=chrome-os-partner:61275 BRANCH=None TEST=reboot reef and try using power button for selection during the detachable menus and ensure that the DUT doesn't turn off. Change-Id: Ia04e032818c73439d2aeacdb8fcabbe3bce7c151 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/429070 Reviewed-by: Duncan Laurie <dlaurie@google.com>
* poppy: host command for configuring power buttonShelley Chen2017-01-131-4/+29
| | | | | | | | | | | | | | | | | Specifically, we are using a bit to disable the SMI pulse on x86 systems so that we can use the power button for menu selection. BUG=chrome-os-partner:61275 BRANCH=None TEST=Try running with depthcharge sending the host command during detachable FW menus and making sure power button select doesn't turn off device on reef. Change-Id: I4a68cf514d514a4abe98beb99e7934d6fb0f44bd Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/427413 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* common: Add new recovery mode button combinationFurquan Shaikh2016-11-081-1/+1
| | | | | | | | | | | | | | | | | | This adds new key combination (Left_Shift+Esc+Refresh+Power) that triggers recovery mode by setting a new host event EC_HOST_EVENT_KEYBOARD_RECOVERY_HW_REINIT. This host event can be used whenever user wants to request entry into recovery mode by reinitializing all the hardware state (e.g. memory retraining). BUG=chrome-os-partner:56643,chrome-os-partner:59352 BRANCH=None TEST=Verified that device retrains memory in recovery mode with (Left_Shift+Esc+Refresh+Power) on reef. Change-Id: I2e08997acfd9e22270b8ce7a5b589cd5630645f8 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/407827 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* charger: Change unlocked battery level ignore conditionsShawn Nematbakhsh2016-01-061-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | x86 systems will auto-power-on when power is applied to the EC. When the battery level is critically low, power-on is prevented, except when the system is unlocked. So, when unlocked, some systems will auto-power-on regardless of battery level, overcurrent the charger / battery, and then repeat forever. Prevent this reboot loop by ignoring auto-power-up when the battery is critically low, regardless of system unlocked status. BUG=chrome-os-partner:48339 TEST=Verify power-up is prevented on no-battery chell w/ donette. Then, run 'powerbtn' on EC console and verify system powers on (and overcurrents). BRANCH=None Change-Id: Ia631b5a8c45b42ec805e4a0c3f827929a0efd236 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/319187 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* skylake: Use a simulated power button press to force-shutdown the APShawn Nematbakhsh2015-06-041-0/+9
| | | | | | | | | | | | | | | | Holding the power button is currently the best known way to bring the AP back to a state where it is shutdown and not powered. BUG=chrome-os-partner:40826, chrome-os-partner:40677 TEST=Run `apshutdown` on glados, verify that power state machine transitions to G3 after several seconds. Run `powerbtn`, verify that state machine transitions back to S0. BRANCH=None Change-Id: Ia799c5f199127f31bd24907b93946c6289d381f8 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/275060 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* power_button_x86: Don't inhibit power button in S0stabilize-6736.BShawn Nematbakhsh2015-01-291-1/+2
| | | | | | | | | | | | | | | Allow power button presses which turn the AP off. TEST=Manual on Samus. Boot system with depleted battery, hit power button at dev screen and verify AP powers off. BUG=None BRANCH=Samus Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I68c9b6c07520992ebba9dcbeccc60ebfb41ca112 Reviewed-on: https://chromium-review.googlesource.com/243710 Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* power_button_x86: Inhibit AP power-on if battery level is too lowShawn Nematbakhsh2014-12-171-2/+4
| | | | | | | | | | | | | | | | | | | | Allow CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON to be defined at the board level to be the minimum battery percentage required for power-on. If the battery level is below the threshold, or if the battery is missing, power button presses will be ignored. BUG=chrome-os-partner:31127 TEST=Manual on Samus with subsequent commit. Verify that AP continues to boot normally when charge level exceeds CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON. Verify that power button presses are ignored when the charge level is below the threshold, and we return to G3. BRANCH=Samus Change-Id: I0ff3f7ddabf38080332470e172c8b2e307bf1655 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/236021 Reviewed-by: Alec Berg <alecaberg@chromium.org>
* Strago: Initial Version of Strago Board added.Divya Jyothi2014-11-061-1/+2
| | | | | | | | | | | | | | | | | | | Modules that are enabled are listed below: - Power Sequencing - Keyboard Scan and Protocol - LPC to support Keyboard - Power Button Task ec.spi.bin has to be generated manualy using pack_ec.py BUG=None BRANCH=None TEST=Tested on Stargo-Proto board Change-Id: Ic5d504c3d6e9c7c5f3482fb7e9e37800b6274824 Signed-off-by: Divya Jyothi <divya.jyothi@intel.com> Reviewed-on: https://chromium-review.googlesource.com/226303 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Add CONFIG_BRINGUP option to help debug signals for bringupBill Richardson2014-06-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When this option is configured, two changes take place. First, the AP doesn't power on by default when the EC reboots. To boot it, you can run the "powerbtn" command, or poke the power button manually, or any of the normal things. Second, we watch for power-related signal changes (anything that's connected to the power_signal_interrupt() function) and keep track of them as they happen. After a second with no further changes, we print the time and value of each change. For example: [19.939212 Port 80: 0x29] [19.967971 HC 0x23] [19.976236 Port 80: 0x3a] [19.995700 HC 0x87] [20.567884 Port 80: 0x73] 11 signal changes: 19.638241 +0.000000 PCH_SLP_SUS_L => 1 19.654378 +0.016137 PCH_SLP_S5_L => 1 19.654457 +0.000079 PCH_SLP_A_L => 1 19.654535 +0.000078 PCH_SLP_S3_L => 1 19.654587 +0.000052 PCH_SLP_S4_L => 1 19.659630 +0.005043 PGOOD_1_5V_DDR => 1 19.663199 +0.003569 PGOOD_1_5V_PCH => 1 19.664751 +0.001552 PGOOD_1_8VS => 1 19.668735 +0.003984 PGOOD_VCCP => 1 19.671883 +0.003148 PGOOD_VCCSA => 1 19.868406 +0.196523 PGOOD_CPU_CORE => 1 [21.908551 Port 80: 0xf0] [21.908855 HC 0x48] BUG=none BRANCH=ToT TEST=manual Build with CONFIG_BRINGUP, notice those two changes. Change-Id: I55fd2021a0eae7dbfd1aaf5d93971f65bf2367b9 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/202574 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* Add cprints() and ccprints()Vic Yang2014-05-211-16/+16
| | | | | | | | | | | | | | | | | | | | | Our code base contains a lot of debug messages in this pattern: CPRINTF("[%T xxx]\n") or ccprintf("[%T xxx]\n") The strings are taking up spaces in the EC binaries, so let's refactor this by adding cprints() and ccprints(). cprints() is just like cprintf(), except that it adds the brackets and the timestamp. ccprints() is equivalent to cprints(CC_CONSOLE, ...) This saves us hundreds of bytes in EC binaries. BUG=chromium:374575 TEST=Build and check flash size BRANCH=None Change-Id: Ifafe8dc1b80e698b28ed42b70518c7917b49ee51 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/200490 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* baytrail: Workaround for stuck boot processRandall Spangler2014-04-301-12/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases, the system will boot to S0 from the point of view of the EC, but PLTRST# will never deassert. Work around this by waiting 50 ms for PLTRST# to deassert. If it doesn't, force the chipset all the way down by deasserting RSMRST#, then pulse the power button to turn it back on. Also add a powerfail debug command to simulate this failure event, so that the recovery process can be tested. Add API to the LPC module to get the state of PLTRST#, and to the power button state machine to force it released when we shut down the chipset and and force another power button pulse as we reset the chipset. BUG=chrome-os-partner:28422 BRANCH=baytrail TEST=1. Boot system. Should boot normally. Shut system down. 2. powerfail 3. Boot system. On the EC console, should see the system come up, go back down through G3S5, then come back up. From the user's point of view, it just boots. 1. Boot system. Should boot normally. (That is, powerfail is not sticky) Change-Id: Ia57f196606f79b9f2fce7d9cd109ab932c3571aa Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/197523 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* cleanup: Still more TODO commentsRandall Spangler2013-11-021-3/+15
| | | | | | | | | | | | | More of same. Comment changes only; no code changes. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms; pass unit tests Change-Id: I8c42ed7d332cd9d461067e1aeac670855106cbcd Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/175405 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* x86: use charge state hook to wake up power button taskRandall Spangler2013-08-021-0/+14
| | | | | | | | | | | | | | | | | | | | This is cleaner than having the charge state machine explicitly know about the power button task. BUG=chrome-os-partner:21610 BRANCH=none TEST=reboot EC; see that power button task does not leave init-on state until just after the charge state initializes: [0.022646 Charge state init -> idle0 after 0.005908 sec] [0.022956 PB task 8 = init-on] [0.023147 PB PCH pwrbtn=LOW] [0.023303 PB task 6 = released, wait 199996] Change-Id: I11d70103e3ee545512efe621f53d999680a7ad56 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64366 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Split x86 power button logic out of switch.cRandall Spangler2013-07-171-0/+399
Power button logic is common across all platforms and is not LM4-specific, so move it to its own module. Switch.c will eventually be moving to common/ and will common across all platforms (not just x86), and splitting out the x86 power button logic is needed before that too. BUG=chrome-os-partner:18343 BRANCH=none TEST=manual 1) power on system with both lid and power button. 2) power+refresh -> reboots 3) power+refresh+esc -> recovery mode 4) power+refresh+downarrow -> reboots, AP stays off 5) toggling recovery GPIO via servo should generate SW debug output showing bit 0x10 toggling Change-Id: I07714e2c035dceece66f90407983397d2697e7d5 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/61780