summaryrefslogtreecommitdiff
path: root/power
Commit message (Collapse)AuthorAgeFilesLines
* rambi: Add duplicate GPIO outputs for proto 2.0 boardRandall Spangler2013-12-161-0/+10
| | | | | | | | | | | | | | | | | | | Proto 2.0 makes these changes: KBD_IRQ# moves from PM4 to PM3. EC_PWROK moves from PH2 to PJ1. Since PM3 and PJ1 are unused on proto 1.5, it's harmless to duplicate the current functionality on those outputs. We can remove the old outputs when we deprecate the 1.5 boards. BUG=chrome-os-partner:24424 BRANCH=none TEST=boot rambi Change-Id: Iff77651ef575a8405878fe75f025a0507b02b771 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/180081 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* Rename mixed-case config constantsRandall Spangler2013-12-162-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This renames constants used in compiler conditionals to uppercase. BOARD_foo CHIP_foo CHIP_FAMILY_foo CHIP_VARIANT_foo CORE_foo Mixed-case constants are still defined by the makefile, but are now no longer used. I will make one more pass in a week or so to catch any that are part of someone else's CL, since otherwise this change might silently merge correctly but result in incorrect compilation. Then I will remove defining the mixed-case constants. BUG=chromium:322144 BRANCH=none TEST=Build all boards. Also, "git grep 'BOARD_[a-z]'" should return no results (similarly for CHIP, CORE, etc.) Change-Id: I6418412e9f7ec604a35c2d426d12475dd83e7076 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/179206 Reviewed-by: Vic Yang <victoryang@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* nyan: propagate EC reset to the AP reset for old boards.Louis Yung-Chieh Lo2013-12-141-0/+16
| | | | | | | | | | | | | | | New boards (rev >= 2.2) are not affected since chipset_force_shutdown() is called. On old boards the power rails of old boards are not removed completely. This CL ensures the AP is warm-reset after EC is reset. BUG=None BRANCH=nyan TEST=nVidia verified on old boards. Change-Id: Ia2c2b243534d8a73b9b4d5320aad4664b1ac8b12 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/179521 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* nyan: bring back set_ap_reset() for old boards.Louis Yung-Chieh Lo2013-12-131-1/+22
| | | | | | | | | | | | | | | | | | Since some folks are still using old boards (rev <= 2.0), bring this back so that they can reset system gracefully. BUG=None BRANCH=nyan TEST=tested on rev 2.0 reboot // EC and AP are rebooted reset button on board // EC and AP are reset power off // AP (rev 2.0) is expected NOT powered off. power on Change-Id: I35dbc5648b092c892dc06ce5676e1e68c695d477 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/179851 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* nyan: re-factor power button to use common/power_button.cLouis Yung-Chieh Lo2013-12-111-20/+31
| | | | | | | | | | | | | | | | | | | | | | This is the first step of tegra power state re-factoring. Move the power button logic to common/power_button.c. Also, the GPIO KB_PWR_ON_L is renamed to POWER_BUTTON_L. BUG=None BRANCH=nyan TEST=tested on nyan rev 3.12, reboot: PASS, power on 2 power off / power on: PASS, power on 5 lid close / power off / lid open: PASS, power on 3 button on / off: PASS, ending loop 3, power on 4 power off / button on: PASS, ending loop 4, power on 4 button off / power on: PASS, ending loop 3, power on 5 button off / lid open: PASS, ending loop 3, power on 3 Change-Id: If07806b9c11cdba2b478a9a74d2b75be1d9f7acf Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/179451
* nyan: force shutdown uses PMIC THERM instead.Louis Yung-Chieh Lo2013-12-051-22/+45
| | | | | | | | | | | | | | | | | | | Add a new pin PMIC_THERM_L (PA1) since AP_RESET_L (PA15) is removed. To force shutdown, drive PMIC_THERM_L to low (default high) for 32us. Also rename set_pmic_pwrok() -> set_pmic_pwron(). And add a debounce time for PMIC_PWRON_L pin. BUG=chrome-os-partner:24206 BRANCH=nyan TEST=Verified on the frank's rework board. 'power off' shutdowns the AP immediately. 'reboot' reboots the EC and resets the AP as well. 'sysjump RW' still keeps AP alive. Change-Id: I8643e19081a824e1f6adc812dfad0269222db8ea Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/178631
* rambi: Remove proto1 workaround which leaves PP5000_EN onRandall Spangler2013-12-031-14/+3
| | | | | | | | | | | | | | | | | proto1.5 boards should not need this workaround. BUG=chrome-os-partner:23673 BRANCH=none TEST=boot a proto1.5 board -> boots apshutdown -> off gpioget PP5000_EN -> 0 powerbtn -> boots gpioget PP5000_EN -> 1 Change-Id: Ie7bb962a9be0934506a6a5d0aefda0282ebb15ec Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/177668 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* nyan: change power button long press timeout to 10.2 secondsYen Lin2013-11-231-2/+2
| | | | | | | | | | | | | | | | The worst case of the ONKEY long press timeout of AS3722 PMIC is 10.08 seconds, according to AMS. Increase of such timeout defines to 10.2 seconds. BUG=nvbug 1372063 BRANCH=nyan TEST=verified on Venice2 boards that were failing to turn off power with 9 seconds timeout Change-Id: I65c8ebaab0523874ceff621cdbda72d8b44f4864 Signed-off-by: Yen Lin <yelin@nvidia.com> Reviewed-on: https://chromium-review.googlesource.com/177611 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Remove bolt, daisy, kirby, puppy, slippy boardsRandall Spangler2013-11-211-24/+3
| | | | | | | | | | | | | | | | | | These boards are unloved and unsupported. They'll never grow up to be laptops, and hardware is increasingly hard to come by. Comparable functionality is available in the other, more-loved boards. Removing these boards speeds up util/make_all.sh by 40%. (If you're not running that before every upload, you should be...) BUG=chrome-os-partner:24062 BRANCH=none TEST=build all remaining platforms and pass unit tests Change-Id: I4d8a49e4d52d7393471f1b1cbef059c8db4a4f77 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/177373
* rambi: Pause between S5 and G3 statesRandall Spangler2013-11-191-1/+1
| | | | | | | | | | | | | This gives the AP a chance to reboot, before the EC kills it by dropping rails. BUG=chrome-os-partner:24120 BRANCH=none TEST=on AP, write 0xe to 0xcf9; system should reboot instead of shutting down Change-Id: I322a1193e90b4de37a4adaf547e1c6bf5be077c3 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/177305 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* nyan: supports immediate 'power off'.Louis Yung-Chieh Lo2013-11-191-11/+30
| | | | | | | | | | | | | | | | | | | Poll down AP_RESET_L pin to shutdown AP immediately, instead of press the power button for 8 secs. BRANCH=nyan BUG=chrome-os-partner:23895 TEST=verified on nyan board 2.0 with follwoing tests: power off / power on: PASS. Tested 5+ times. lid close / power off / lid open: PASS. Tested 5+ times. button on / off: PASS. Test 5+ times. ~20% not boot (HOLD=1). power off / button on: PASS. Tested 5+ times. button off / power on: PASS. Test 5+ times. ~60% not boot (HOLD=1) button off / lid open: PASS. Test 5+ times. ~40% not boot (HOLD=1) Change-Id: Iecc97f38ac7bd923745994594356029836d7b4e6 Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/177241
* rambi: Add low power idle to rambiAlec Berg2013-11-091-0/+15
| | | | | | | | | | | | | | | | | | Added low power idle functionality to rambi but left it off by default. To turn it on, define CONFIG_LOW_POWER_IDLE in rambi's board.h file. BRANCH=none BUG=chrome-os-partner:23947 TEST=Verified that the EC does not go into deep sleep when in S0, and that it does go into deep sleep in S3, S5, and G3. Tested to make sure that flashec works when the EC is in low speed deep sleep. Also verified that the EC console times out after the timeout period and that it wakes up on the next command. Did not measure power usage. Change-Id: I0ab1a2dc7ca7ae4577fe5d0894c1bf82205dfea6 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/176159 Reviewed-by: Todd Broch <tbroch@chromium.org>
* Take XPSHOLD back.Louis Yung-Chieh Lo2013-11-081-17/+1
| | | | | | | | | | | | | | | | | | | | | The XPSHOLD is not floated. It connects to +1.8V_VDDIO, which indicates high when AP is on. So, bring it back. Also remove the duplicated GPIO definition (GPIO_PWR_LED1). Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> BUG=chrome-os-partner:23929 BRANCH=nyan TEST=verified on nyan. successfully boot up the machine. Change-Id: I293a899bcdf255f36f6117627f66ed8231c9a70f Reviewed-on: https://chromium-review.googlesource.com/176046 Reviewed-by: Yen Lin <yelin@nvidia.com> Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add TODO for TODO_XPSHOLD.Louis Yung-Chieh Lo2013-11-051-0/+1
| | | | | | | | | | | | | | | | The TODO line was accidentally removed in the last CL. BUG=None TEST=None BRANCH=None Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Change-Id: Ia37e0f6bf21e072c714512d2eaa7ad69ef5fad93 Reviewed-on: https://chromium-review.googlesource.com/175632 Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-chieh Lo <yjlou@chromium.org> Tested-by: Yung-chieh Lo <yjlou@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Refine GPIO list of Nyan.Louis Yung-Chieh Lo2013-11-041-1/+16
| | | | | | | | | | | | | | Refine the GPIO list according to the schematic. Comment out the XPSHOLD in power/tegra.c for compiling. Will fix later. BUG=None BRANCH=None TEST=emerge-nyan chromeos-ec && make runtests -j 32 && make BOARD=nyan tests -j 32 Change-Id: Id0d682fd5d48e8a8a07785e86c07f45f07d866ab Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/175534
* cleanup: Yes, even more TODO commentsRandall Spangler2013-11-042-6/+17
| | | | | | | | | | | | | Almost done. Comment changes only. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms Change-Id: I974dfc12aa264e2035b3bae35a089c19344e7d45 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/175484 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* cleanup: Even more TODO commentsRandall Spangler2013-11-011-1/+0
| | | | | | | | | | | | | | | Update comments with more info, or remove if no longer applicable. No code changes. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms; pass unit tests Change-Id: I5b56eeb500bc0f00e84e91ef99684f4b1b310972 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/175418 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* cleanup: Update more TODO commentsRandall Spangler2013-11-011-7/+7
| | | | | | | | | | | | | | | Add bug links, reword, or remove as applicable. No code changes, just comments. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all boards; pass unit tests Change-Id: Id55dd530c10091d7ab9d0f942f750168fca793b4 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/175326 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* cleanup: Assorted TODO commentsRandall Spangler2013-10-311-1/+0
| | | | | | | | | | | | | | | Remove comments if no longer applicable, or assign bug numbers if they still are. Tidy some debug output. No code changes other than the debug output. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms, pass unit tests Change-Id: I2277e73fbf8cc93f3b1b35ee115e0f2f52eb8cf9 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/175215 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* rambi: Enable PP5000 at bootRandall Spangler2013-10-301-9/+14
| | | | | | | | | | | | | | | | Due to power topology, PP5000 needs to be enabled as soon after PP3300_DSW as possible. Since PP3300_DSW is what powers the EC, the EC needs to turn on PP5000 by default and leave it on. BUG=chrome-os-partner:23673 BRANCH=none TEST=reboot ap-off (this boots the EC without doing AP power sequencing) gpioget -> shows PP5000_EN=1, PP5000_GOOD=1 Change-Id: I5d493877d330b2543a493f8a2f3411003d5964ca Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/174989 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* lm4: Fixes low power bug after a sysjumpAlec Berg2013-10-291-0/+2
| | | | | | | | | | | | | | | | | | | This fixes a bug in which after a sysjump, the sleep_mask is reset, and the EC is allowed to go into a low power mode even though the AP is still running. This causes numerous problems, must notable of which is that a flashrom write fails with an EC protocol mismatch error. BUG=chrome-os-partner:23645 BRANCH=none TEST=Execute a flashrom write and make sure the system does not use the low power code immediately after. Change-Id: I4d50282da0c5ba5b6488ed14a267a4d8cafe09a7 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/174943 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Move source files to driver/ and power/ subdirsRandall Spangler2013-10-237-0/+2920
The common/ subdir was getting cluttered. Move drivers for external components to a new driver/ tree, and move what used to be called chipset_*.c to a new power/ directory. This does not move/rename header files or CONFIG options. That will be done in subsequent steps, since moving and modifying .c files in the same CL is harder to review. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all boards; pass unit tests Change-Id: I67a3003dc8564783a320335cf0e9620a21982d5e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/173601 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Vic Yang <victoryang@chromium.org>