summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Clear OWNERS for factory/firmware branchfirmware-4389.71.BBrian Norris2021-09-101-0/+1
| | | | | | | | | | | | BUG=none TEST=none Change-Id: I0f03f432ada1064ffba9595be78ca7ab4d25ecd1 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3155132 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Owners-Override: Jora Jacobi <jora@google.com> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* CHERRY-PICK: Haswell: Add control for touchscreen resetDave Parker2013-09-191-0/+17
| | | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:22076 BRANCH=peppy TEST=Manual. Verify touchscreen operational in S0. Original-Change-Id: Ife2d4e11142195bddf202933430ec8af243b1309 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167150 Reviewed-by: Randall Spangler <rspangler@chromium.org> Conflicts: common/chipset_haswell.c Change-Id: I8998c2b998d49882e9019942b87f5050369ba64b Reviewed-on: https://chromium-review.googlesource.com/170072 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Dave Parker <dparker@chromium.org> Commit-Queue: Dave Parker <dparker@chromium.org>
* falco: delay LCD VCC enable by 270msDuncan Laurie2013-09-164-17/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | Much like the backlight signal the LCD VCC enable signal needs to be delayed to ensure the panel timings are correct. It's problematic because the LVDS bridge is a black box. The signals need to be scoped to ensure everything eventually matches up. BUG=chrome-os-partner:21234 BRANCH=falco TEST=Built and booted. Panels still come up. Dexter determined the proper delay. Original-Change-Id: I6e61d1dfa9ad03be1735d05d8d8ff2549a7b0db2 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167620 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 06aebc4f95179ba4a642623081168d590ab7700c) Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Change-Id: I401c43ac463f754f064e353099814feae3db2452 Reviewed-on: https://chromium-review.googlesource.com/169651 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Commit-Queue: Duncan Laurie <dlaurie@chromium.org> Tested-by: Duncan Laurie <dlaurie@chromium.org>
* Falco: correct input current limit for 45W adapter, Turbo offBill Richardson2013-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | Change the charger's Input Current Register setting for the 45W adapter to match the latest spec. BUG=chrome-os-partner:20739 BRANCH=Falco,ToT TEST=manual Connect a 45W adapter, run the "battery" and "charger" commands on the EC console. When the battery charge is below 10% (turbo off), the "I_in" value displayed by the "charger" command should be 1536. Before it was 2560. Change-Id: I0483b5408aa2da352cd3aeda58e1656c095d86b2 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169323 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Falco: Always update charger's input current limit.Bill Richardson2013-09-131-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was just updating the input current limit when turbo mode was enabled and disabled. However, it turns out that the charger can decide to change the setting all by itself if the inrush current is too high. This happens pretty much every time that the AC is applied. We didn't notice this while the AP was on, but when the AP was off we were exiting the watch_adapter_closely() function too soon and so we missed the transition. This CL fixes that. But just to be safe, instead of only updating when we think we need to, we're going to just update the value every time we check on the adapter. That way if we happen to miss a change due to a race condition or transient, we'll catch it the next time through the loop. BUG=chrome-os-partner:20739 BRANCH=Falco,ToT TEST=manual Before this CL, you can run "sbc 0x3f" on the EC console while plugging and unplugging the AC adapter. When the AP is off and AC is reapplied, you'd see the reported value mysteriously change. After this CL, it doesn't. Change-Id: I5661c548cccd4eb24ba4d8a0b8cd070acc2e49ef Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/169322 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add mutex around chipset_throttle_cpu() (BRANCH ONLY)Bill Richardson2013-09-091-5/+20
| | | | | | | | | | | | | | | | | This adds a mutex around chipset_throttle_cpu(), so that multiple tasks don't interfere with each other. BUG=chromium:287985 BRANCH=Falco TEST=none We've never observed any problems here, but it could have happened. This should prevent it. Everything should continue to work as before. Change-Id: I2170a1b7af244c894100e525ed73a1b068d21e5b Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/168579 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add command for Haswell to pause in s5 at shutdownBill Richardson2013-09-066-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At normal AP shutdown, Haswell systems skip S5 entirely and go directly to G3. It's sometimes handy to pause in S5 as the other systems do, for things like power-cycle tests that use the RTC to do a delayed wake from S5. This CL adds a console command and a host command to enable/disable that pause in S5. The default is to skip S5, and the override value is not persistent across EC reboots, so whenever the EC hibernates or reboots (Refresh + Power, software sync), you'll have to re-enable it again. BUG=chrome-os-partner:22346 BRANCH=falco,ToT TEST=manual On Haswell systems only. To enable the pause in S5 at shutdown, do either of these: EC console: gsv s5 1 root shell: ectool pause_in_s5 on Shut the AP down politely, and it should pause in S5 for 10 seconds before continuing to G3. You can see this by watching the EC console. To disable the pause in S5 at shutdown, do any of these: EC console: gsv s5 0 root shell: ectool pause_in_s5 off or press Refresh + POWER Boot the system, then politely shut down. This time it should go directly to G3 without pausing in S5. Original-Change-Id: I324e6e2373bc20b61a731b4ef443d7bb8edb6b83 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/168086 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> (cherry picked from commit 2a31e2ac4bc899de7dfbfcca191376ce7063fd2c) Change-Id: Iea1db204e904385e9615e3a379af53810f17ad5a Reviewed-on: https://chromium-review.googlesource.com/168378 Commit-Queue: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add a generic get/set host commandBill Richardson2013-09-066-1/+160
| | | | | | | | | | | | | | | | | | | | | | | | | This adds EC_CMD_GET_SET_VALUE to the list of host commands. We have a bunch of single-value getter/setter commands, which is wasteful. This is a start towards unifying them into a simpler command. BUG=chromium:285358 BRANCH=ToT,falco TEST=none There's nothing to test just yet. This just adds the command and some basic interfaces. A future commit will make use of it. Original-Change-Id: Iee986b9d273b422bb06f3a0c9b7af50617f03d7f Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/168083 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 3f2eba22c5d3e771904f6451a4b63a41cc6964cb) Change-Id: Ifec6597af2cf49497ec885f807a84b996acff21c Reviewed-on: https://chromium-review.googlesource.com/168377 Commit-Queue: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Handle multiple independent sources for CPU throttlingBill Richardson2013-09-0519-34/+907
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When both the thermal task and the power/charger task have different ideas on whether the CPU should be throttled, we need to OR their opinions so that either can start throttling, but both have to agree to stop it. This CL changes the chipset_throttle_cpu() function to also take a "source" argument, so we can handle multiple opinions. As it turns out, this same also problem existed in the Falco-specific power logic by itself, but was largely masked by the threshold settings. We handle that now, too. BUG=chrome-os-partner:20739 BRANCH=falco, ToT TEST=manual This change adds a bunch of tests to ensure that all this works, so try cd src/platform/ec make BOARD=falco runtests And of course, try it on the actual hardware under the appropriate loads. Change-Id: Id651e2cdc8dbd435aad6e21c5d2ce4b932a55f88 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/168088 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Implement emulator clock fast-forwardingVic Yang2013-09-042-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running an unit test, the emulator is sitting in idle task for most of the time. Since we don't have interrupt support now, the emulator is just waiting for the next wake-up timer to fire. To save time, we can actually just figure out which task is the next to wake up, and then fast-forward the system clock to that time. With this, all tests run faster and we can remove time-scaling for all current tests. This improves not only run time but also stability. If one day we have interrupt support, then we will have to modify this to take into account the fact that an interrupt might wake a task before any wake-up timer fires. BUG=chrome-os-partner:19235 TEST=Run all tests in parallel for 1000 times. BRANCH=None Original-Change-Id: I4cd33b041230267c110af015d425dd78d124f963 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167801 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 74b6f7687293b27b276d7bc2a5c0aea9b29a6649) Change-Id: I50152a32b24745b89c8494c71914136e61eef2e4 Reviewed-on: https://chromium-review.googlesource.com/168121 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Peppy: Correct adc calculation of charger currentDave Parker2013-08-301-4/+6
| | | | | | | | | | | | | | | BUG=chrome-os-partner:22405 BRANCH=peppy TEST=Run 'adc' command. Measure charger current reported against actual current. Change-Id: I77b4f23cd945be6e0a6251832e95a9423566604d Original-Change-Id: I1772a781d9d0100e69a5fd1e9a9590252ccd88d6 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167732 Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org> Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org> Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
* Peppy: Set battery pre-charge current to worst case value.Dave Parker2013-08-301-1/+1
| | | | | | | | | | | | | | | | Which in this case is the max across batteries we plan to ship. BUG=chrome-os-partner:20801 BRANCH=peppy TEST=Difficult to test without a deeply discharged battery. Change-Id: I23f8783f9b0188c911a446d8cf5110df48a294d0 Original-Change-Id: Ieeb8fafc1768accb3cd2cd85a919b232aab77343 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167731 Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org> Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org> Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
* CHERRY-PICK:Update Peppy keyboard mask for Japanese keyboardsDave Parker2013-08-301-1/+1
| | | | | | | | | | | | | | BUG=chrome-os-partner:21798 BRANCH=peppy TEST=Run evtest. Verify correct key codes returned. Change-Id: I183d7ad847eb58ab9e6fddbc1c9a18ffdb72ca11 Original-Change-Id: I48b7524608c546d67eb7975de7ff48874df4568b Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/65624 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167661 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* CHERRY-PICK:Update keyboard scanmatrix for Japanese keyboards.Dave Parker2013-08-302-7/+7
| | | | | | | | | | | | | | | | BUG=chrome-os-partner:21798 BRANCH=peppy TEST=Run evtest. Push every key. Verify correct key code reported. Change-Id: Ied22321f0a7d4da9dc82b8b5b1d21e517d8c879a Signed-off-by: Dave Parker <dparker@chromium.org> Original-Change-Id: Ic6e4a38608f4bc8c66f487998912a7921ddb03cb Reviewed-on: https://chromium-review.googlesource.com/65623 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Yung-chieh Lo <yjlou@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167660 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* CHERRY-PICK:Peppy: Make power LED turn amber when entering suspendDave Parker2013-08-301-15/+31
| | | | | | | | | | | | | | | | | | | This fixes some jank in how the power LED works when going into suspend. Previously the power LED could turn off for up to three seconds before flashing amber when entering suspend. BUG=chrome-os-partner:21622 BRANCH=peppy TEST=Manual. Enter suspend and observe that LED goes from blue to amber without turning off first. Change-Id: If6ee19fc13d4c09a514069d97aa9fb0b72385c40 Original-Change-Id: Ib0bf9e998d250b0731405394d3ebb50d90de7cda Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167388 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167578 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* Peppy: Enable PP5000 while checking initial keyboard stateChromeOS Developer2013-08-291-0/+23
| | | | | | | | | | | | | | | | | | | | BRANCH ONLY! Not for ToT. Active ESD components on the keyboard scan matrix require 5V power. These components must be powered to read the keyboard state correctly. Check the keyboard 5mSec after powering the 5V rail to wait for the keyboard state to settle down. BUG=chrome-os-partner:22127 BRANCH=peppy TEST=Manual. Boot normally. Boot normally with Esc + F3 + Power + another key. Boot into recovery with Esc + F3 + Power. Change-Id: I064cf6eb98b47c897079f145e945b4ab3ae4ef23 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/66835
* Falco: LED should flash white when battery is < 12%, not 7%.Bill Richardson2013-08-271-1/+6
| | | | | | | | | | | | | BUG=chrome-os-partner:22159 BRANCH=Falco, ToT TEST=manual Let the battery run down. Below 12%, the LED should blink white. Change-Id: I3be2da69a113134456420b1a305e4a0c159c0022 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/167080
* 8042: Wake the keyboard scan task when keystrokes are enabledDuncan Laurie2013-08-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the keyboard_scan_task is the only place that calls keyboard_raw_enable_interrupt(1) it is possible for the keyboard to be left with interrupts disabled/pending if the keyboard scan task is asleep. This change will wake the keyboard_scan_task when the 8042 keystroke_enable(1) is called, which will wake up the task and it will call into enable the keyboard interrupt and clear pending interrupts. I thought keyboard_enable() might be a better place to do this but that seems to cause a hung task when flashing firmware... This condition happens semi-regularly on resume on Falco and Peppy devices. There may be a better approach here so for now I am only commiting this to the Falco/Peppy firmware branch but a similar or better fix is probably needed in TOT. BUG=chrome-os-partner:22169 BRANCH=falco,peppy TEST=manual: many suspend/resume cycles on falco with the physical lid to ensure that the keyboard is still functional. Change-Id: I2f56f9c07b852c4b03b090d0da6b7128804962ab Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66986 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add abstract "cond_t" type to detect state transitions.Bill Richardson2013-08-233-1/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We often need to watch for transitions between one state and another, so that we can issue warnings or take action ONCE. This abstracts that "have I already reacted to this" stuff into a single set of functions. For example, this code reads a GPIO every time through the loop, but it only generates an event when the GPIO value changes from 0 to 1: cond_t c; cond_init_false(&c); while(1) { int val = read_some_gpio(); cond_set(&c, val); if (cond_went_true(&c)) host_event(SOMETHING_HAPPENED); sleep(1); } BUG=none BRANCH=falco,peppy TEST=manual Note: This doesn't really need cherry-picking from ToT (it was a prerequisite for another CL that we decided NOT to backport), but it doesn't hurt. Other than the tests, nothing uses this. It's easier to just pull it in than to keep treating it as an exception. To test: make BOARD=falco runtests Original-Change-Id: I42393fcf3c4eb71b9551118a0f442d55c0691315 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65071 (cherry picked from commit 0c8c2e453ab3960f315050fbb9808f438398624f) Change-Id: I44fe9a660016f3aa2ea2c7f8eb5c3e698d8f618f Reviewed-on: https://gerrit.chromium.org/gerrit/66838 Commit-Queue: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Falco: throttle if battery current drain is too highBill Richardson2013-08-234-0/+179
| | | | | | | | | | | | | | | | | | | | | | | I missed this requirement the first time. Now it's here. Also adding a test for it as well. BUG=chrome-os-partner:20739 BRANCH=falco TEST=manual make BOARD=falco runtests Original-Change-Id: I88aac8d12d09f7970b04c4aa02b6986b5ea16306 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66684 Reviewed-by: Aaron Durbin <adurbin@chromium.org> (cherry picked from commit 8c7a18616f216fe4c6df2d7fc2b3fc6319c385fd) Change-Id: I868ff17b722d27eb6e86ef9f2fce1ce295ac7760 Reviewed-on: https://gerrit.chromium.org/gerrit/66832 Commit-Queue: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Remove default values for undefined tasks from charge state moduleDuncan Laurie2013-08-221-7/+0
| | | | | | | | | | | | | | | | | | | | | | Due to the order of pre-processing, TASK_ID_CHARGER and TASK_ID_SWITCH aren't defined even if they are in the ec.tasklist for a board. BUG=chrome-os-partner:21565 BRANCH=falco,peppy TEST=Turn device off, remove AC power. Plug AC power back in. Charging LED should light in ~1 second. Original-Change-Id: I20ebbec71ca5e5dc8ab34da946d3dfeb91fc7849 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66466 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 046d6256712e35ea0bc9eae4acf0363a9f8895d4) Change-Id: I21b493e5990aa765ea347afa8bd9187f66596975 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66651
* Change peppy battery led error blink timingDuncan Laurie2013-08-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (led turn on 1 sec and turn off 3 sec) BRANCH=peppy BUG=none TEST=manual Disconnect internal battery to check battery led blink timing. Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Conflicts: common/led_peppy.c Original-Change-Id: I1417073448505aa5dca2e0e999185b5a9b53410e Signed-off-by: David Huang <David.Huang@quantatw.com> Reviewed-on: https://gerrit.chromium.org/gerrit/63891 Reviewed-by: Dave Parker <dparker@chromium.org> Reviewed-by: Hsu Henry <Henry.Hsu@quantatw.com> Tested-by: Dave Parker <dparker@chromium.org> Commit-Queue: Dave Parker <dparker@chromium.org> (cherry picked from commit 3f1380c624a4ece2f5ea131ca63be39d6559b339) Change-Id: I21c73cc20482583b3eca1440e1806276aa0f8546 Reviewed-on: https://gerrit.chromium.org/gerrit/66650 Tested-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Commit-Queue: Duncan Laurie <dlaurie@chromium.org>
* falco: delay backlight enable by 420msDuncan Laurie2013-08-223-2/+90
| | | | | | | | | | | | | | | | | | | | | | | | In order to meet the panel power sequencing requirements the backlight enable needs to be delayed by 420ms. As the EC has direct control over the panel backlight, it's difficult to align with the reset of the panel signals which are controlled by an LVDS bridge. In order to not affect other boards the backlight implementation has been moved within falco's board directory. BUG=chrome-os-partner:21234 BRANCH=falco TEST=Built with a printf to verify rough timing transitions. Original-Change-Id: I5d6cd2989f17cc5c188d307f6ceacb52341a87b4 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66238 Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit 02ec04d215059464cf7acc6accdec720fc4c7c8c) Change-Id: Ia0ae5d3413eee461d522e975685fa9efb95d2bc9 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66649
* Add fan power enable GPIO for PeppyDuncan Laurie2013-08-224-2/+10
| | | | | | | | | | | | | | | | BUG=chrome-os-partner:21847 BRANCH=peppy TEST=Manual. Check state of GPIO_P5000_FAN_EN with lid open and lid closed. Can also check with meter via TP109. Original-Change-Id: I8a64c14d53dd84a5d586c0abb04ccb71de0e78b3 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65674 (cherry picked from commit 39421848c6bfe0881fc8e6eca3a5656a91662638) Change-Id: I6137650ccd33edd85ad213d7b57aa032e9c0ab2c Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66648
* Lock BOOTCFG to safe values for all LM4sBill Richardson2013-08-2210-40/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BOOTCFG register configures a couple of important things: whether to allow jumping into the builtin ROM bootloader at reset, and whether or not to allow JTAG access for programing and debugging. The default is "no" and "yes". But the BOOTCFG register can be locked so that it can't be changed again, which means that if the wrong values are put into it, the system is pretty much bricked. On Link, we wrote a BOOTCFG value that allowed a GPIO to be used as a bypass to optionally trigger the ROM bootloader, but on Slippy and its derivatives that GPIO is not pulled up. If you program the Link values into BOOTCFG on a Slippy, the system is stuck in the ROM bootloader more or less forever. This change disables that GPIO, keeps JTAG enabled, and locks those settings for all LM4 chips (it's a chip config now, not a board config). We've never actually used the GPIO to invoke the ROM bootloader, but we have managed to brick a number of systems just by having it enabled, so we're going to lock it into a safe configuration now. BUG=chrome-os-partner:19247 BRANCH=falco,peppy TEST=manual Reflash, boot, power cycle (actually unplug the EC from AC and battery) a few times. It should continue to work. Original-Change-Id: Iaf1a81d6814104421a56425490e3d5164ea9b617 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66538 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 5d1eeefdbcf16e9eb18540b7b6ed4aff8609c4d9) Change-Id: I755286a6c7855034e7eeeb9ca4c1e33fd8a7c0a5 Reviewed-on: https://gerrit.chromium.org/gerrit/66656 Commit-Queue: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
* Tweak thermal points again.Bill Richardson2013-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Step Fan RPM trigger point (CPU Tj) unit K / 'C Step 1 2700 under 328K / 55'C Step 2 3000 328K / 55'C Step 3 3300 333K / 60'C Step 4 3600 338K / 65'C Step 5 3900 343K / 70'C Step 6 4200 348K / 75'C Step 7 4500 358K / 85'C Step 8 5000 368K / 95'C BUG=chrome-os-partner:20805 BRANCH=falco,peppy ONLY! Not ToT! TEST=manual Heat it up, watch what happens. Change-Id: I4decd46c2ea916d857861a266f95007c39588beb Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66260 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* falco: Use PROCHOT to throttle instead of asking host nicelyDuncan Laurie2013-08-192-2/+9
| | | | | | | | | | | | | | | | | | Rather than trying to be graceful when throttling just use the big PROCHOT hammer. The chipset_throttle_cpu() function is implemented and the falco specific charger code now calls this instead of the host_throttle_cpu() function. BUG=chrome-os-partner:20739 BRANCH=falco TEST=manual: emerge-falco chromeos-ec Change-Id: I2fb80e3b346d700a86f531da23699e5fa37ba881 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66258 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Poll and cache g781 temperature valuesDuncan Laurie2013-08-196-19/+38
| | | | | | | | | | | | | | | | | BUG=chromium:271236 BRANCH=falco,peppy TEST=Run 'ectool temps all' Verify temp. values are present for the g781. Original-Change-Id: I2ea8aff9e256167bf04abc959f971da94fc51e77 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65597 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit e1f20537e52ae2f0725c588ff0caeab5159394a0) Change-Id: I0cd72114d494cb89724528af01f0df5cb0724235 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/66257
* Peppy: set fan/thermal steps (BRANCH ONLY)ChromeOS Developer2013-08-192-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: This CL is for the branch only. It does NOT go into ToT. This sets the thermal steps and fan speeds as requested: Step Fan RPM trigger point (CPU Tj) unit K / 'C Step 1 0 under 320K / 47'C Step 2 3200 320K / 47'C Step 3 3700 330K / 57'C Step 4 4000 337K / 64'C Step 5 4400 344K / 71'C Step 6 4900 351K / 78'C Step 7 5500 358K / 85'C Step 8 6500 368K / 95'C This also sets the CPU hot points to the following: 373K / 100C => assert PROCHOT 378K / 105C => give the CPU three second to cool off, then shutdown 383K / 110C => shutdown immediately BUG=chrome-os-partner:21971 BRANCH=peppy ONLY! Not ToT! TEST=manual Change-Id: I832d4c29aecc96f7b844c41ab8ca698618e592f1 Reviewed-on: https://gerrit.chromium.org/gerrit/66141 Tested-by: Dave Parker <dparker@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Commit-Queue: Dave Parker <dparker@chromium.org>
* Haswell: shutdown directly to G3 without pausing in S5Duncan Laurie2013-08-091-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've been pausing in S5 for ten seconds for various arcane reasons related to clock rates and USB peripherals. We don't need to do that anymore, and there are other arcane reasons why it's better if we don't. BUG=chrome-os-partner:21791 BRANCH=falco,peppy TEST=manual On the EC console, limit the output to just the chipset channel: > chan 4 Now boot the AP, then shut down. Before you'd see a ten-second pause in S5, like this: [29.586858 x86 power state 3 = S0, in 0x00df] [29.587268 x86 power state 7 = S0->S3, in 0x009f] [29.587707 x86 power state 2 = S3, in 0x009f] [29.587959 x86 power state 8 = S3->S5, in 0x009f] [29.588474 x86 power state 1 = S5, in 0x009c] [29.588733 x86 power state 1 = S5, in 0x009c] [29.603317 x86 power state 1 = S5, in 0x0094] [39.603612 x86 power state 9 = S5->G3, in 0x0094] [39.604137 x86 power state 0 = G3, in 0x0000] [39.604376 x86 power state 0 = G3, in 0x0000] With this change the pause is gone: [26.764160 x86 power state 3 = S0, in 0x00df] [26.764570 x86 power state 7 = S0->S3, in 0x009f] [26.765011 x86 power state 2 = S3, in 0x009f] [26.765262 x86 power state 8 = S3->S5, in 0x009f] [26.765777 x86 power state 9 = S5->G3, in 0x009c] [26.766220 x86 power state 0 = G3, in 0x0008] [26.766526 x86 power state 0 = G3, in 0x0008] [26.770517 x86 power state 0 = G3, in 0x0000] Original-Change-Id: I05e19ddfe9dfa1bcc2a29103d120910c4371b88e Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65336 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> (cherry picked from commit 71a3bb0c0746d17e55e1e08322258e555ac80682) Change-Id: Ic6af5a753ae6c76dc7a27c5963bf82ee6400d3bd Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65382
* Hide battery vendor params override behind config optionDuncan Laurie2013-08-098-22/+11
| | | | | | | | | | | | | | | | | | | | | | Only link actually used this function, but all batteries were required to provide an (empty) implementation. Use CONFIG_BATTERY_VENDOR_PARAMS to gate this functionality, so non-link battery code can be simpler. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms and pass unit tests Original-Change-Id: Ic2c6dd1163a981e48873d798f77891cc7de1f8cf Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65257 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Rong Chang <rongchang@chromium.org> (cherry picked from commit d8be5316e6920c0ef0ef85e3a3859c8a64dc6d51) Change-Id: I31d859780a3a75773830177febef7a3ee58bf8ea Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65378
* Console command for g781 temperature sensor.Duncan Laurie2013-08-092-13/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Read status, set temperature alert thresholds, get and set configuration options. I2c offsets and status/config register bits are documented in temp_sensor_g781.h Usage by example: g781 - Print status info g781 settemp 0x0e 12 - Set remote low temp alarm to 12C g781 setbyte 0x09 0x40 - Enable single-shot mode g781 getbyte 0xfe - Read device ID BUG=None BRANCH=falco,peppy TEST=Manual. Run g781 console command Signed-off-by: Dave Parker <dparker@chromium.org> Original-Change-Id: Id051f79ea643255d57c3fc694b7ae685a6611c81 Reviewed-on: https://gerrit.chromium.org/gerrit/65234 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Dave Parker <dparker@chromium.org> Tested-by: Dave Parker <dparker@chromium.org> (cherry picked from commit 2b2f78d9295103a8df550086feeaaaa80aa56a2d) Change-Id: I3408492727b3feba20c10c2a8ddb106bda6a049e Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65377
* Fix leaving keyboard scanning disabled on brief power button pressDuncan Laurie2013-08-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | If the power button is pressed for a shorter period than the debounce timeout, then the debounced state never changes. This was causing the power button state machine to disable scanning (in the interrupt handler) but never re-enable it (in the deferred handler). Easy fix; just re-enable based on whether the current state is released, not whether the debounced state is transitioning to released. BUG=chrome-os-partner:21772 BRANCH=all (falco, pit, etc.) TEST=type on console. briefly flick power button. type more; should work. Original-Change-Id: I9723a6aa10f122fcee62702b85ce7981b1c8103a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65238 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> (cherry picked from commit ffed16cae4c34a4326eead22af690ff101b3780d) Change-Id: Idbeb214c671ecea6725d62d534357b83afecf575 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65376
* Use macros for C <-> K conversionsDuncan Laurie2013-08-098-18/+17
| | | | | | | | | | | | | | | | | | | | This just replaces all the "X - 273", "Y + 273" stuff with a macro. BUG=none BRANCH=falco,peppy TEST=manual Run the EC console command "temps". It should print human-readable things. Original-Change-Id: Icc4284c89fdbc0cd3b206a0faacf121973652a63 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65005 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 6f8e276cc842d0804292d473fe3305295d2e7052) Change-Id: I7dc2459264dbfd3615d513262442663930e83edb Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65375
* ectool: Return non-success exit code on bad EC status.Duncan Laurie2013-08-092-0/+4
| | | | | | | | | | | | | | | | | | | | | When running certain ectool commands, our ioctl may succeed, yet our command may not be successful for a variety of reasons (see ec_status enum). In this case, we should return a non-success exit code so that we can easily detect such failures in scripts. BUG=chrome-os-partner:21171. TEST=Pass FAFT suite on Peppy. Pass factory tests on Peppy. BRANCH=None. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Original-Change-Id: Ia33b8285fb048b256f0668b709573e86c15f1162 Reviewed-on: https://gerrit.chromium.org/gerrit/64686 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit e98bde3fec5e53314a15fd031c83ee630973483f) Change-Id: I64cbb6c2c63ccc77fb750448dd2a68d37f396125 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65374
* Remove proxy config flags for unit testsDuncan Laurie2013-08-095-16/+29
| | | | | | | | | | | | | | | | | | | | This moves per-test config flags from test_config.mk to test_config.h, where one can define/undefine config flags for individual test. BUG=chrome-os-partner:19235 TEST=Pass all tests BRANCH=None Original-Change-Id: I096aded2007881433d3b6414d37f8bfdc6a2c45c Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64367 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 19e30d9c7d1eed48e94952e5e73fdeb7d703656e) Change-Id: I97d5c6ebce2d10a81b7c990d4d39986a702b8499 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65373
* Move onewire bus support from chip/lm4 to commonDuncan Laurie2013-08-093-1/+1
| | | | | | | | | | | | | | | | | | | | No functional changes; just moving file BUG=chrome-os-partner:21612 BRANCH=none TEST=onewire red / onewire green / onewire yellow all set the adapter LED (tested on link, since I don't have a bolt, but the EC chip and adapter are identical) Original-Change-Id: I005abf871caafa39e82e88875b515c842a12d591 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64376 Reviewed-by: Vic Yang <victoryang@chromium.org> (cherry picked from commit 219b02604cea6f5b9d245f49913544eae82b3694) Change-Id: Ic01abdf270ccc1de46c5f8a15eaa9456e79c104c Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65372
* x86: use charge state hook to wake up power button taskDuncan Laurie2013-08-092-13/+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] Original-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> (cherry picked from commit a566d8d9e42d6f25503e8c897a995fef0b6ae42b) Change-Id: I56beec492eb622c4f14263b09fdc8b5cc967606e Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65371
* Change one-wire bus to use normal gpio interfaceDuncan Laurie2013-08-096-38/+9
| | | | | | | | | | | | | | | | | | | | | | There's no need for it to directly access the GPIO registers. That was only necessary at the beginning of link, when gpio_set_flags() didn't exist. BUG=chrome-os-partner:21612 BRANCH=none TEST=onewire red / onewire green / onewire yellow all set the adapter LED (tested on link, since I don't have a bolt, but the EC chip and adapter are identical) Original-Change-Id: I2386962ff039bb2251be38eaadcaeae8ffd1ea7b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64375 Reviewed-by: Vic Yang <victoryang@chromium.org> (cherry picked from commit 93536fbe55d309d335682b1fd5223f5389d0c456) Change-Id: Ic0995f55737f1f01b28921f07d88bd468e3355e8 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65370
* Move input character processing from UART interrupt to console taskDuncan Laurie2013-08-095-497/+453
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, processing of arrow keys and control characters was done in the interrupt handler itself. This increased the impact of UART input on other interrupts and high-priority tasks. It also makes it harder to implement DMA-based UART input on STM32L (in an imminent CL), since the processing affected the circular UART input buffer in-place. This change turns uart_buffering.c back into a dumb I/O buffering module, and puts all the command line editing and history support into console.c. Console history is done via a simple array of input lines instead of a packed circular buffer of characters. This is a little less RAM-efficient, but is easier to implement and read. History depth is controlled via CONFIG_CONSOLE_HISTORY, and is 3 for STM32F and 8 for other platforms. If we really need a greater history depth, we can look into implementing a packed circular buffer again, but this time at task time in console.c. Also added a 'history' command to print the current console history. BUG=chrome-os-partner:20485 BRANCH=none TEST=console_edit unit test passes; 'history' command prints the last commands Original-Change-Id: I142a0be0d67718c58341e4569f4e2908f191d8b0 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64363 Reviewed-by: Vic Yang <victoryang@chromium.org> (cherry picked from commit 889f7bdd3b77151dd5b749974c94a84ae8b2aeb8) Change-Id: I76e6fa79bf2786f33a8381f3e46e09d5aa4be47f Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65369
* Remove unneeded includes of registers.hDuncan Laurie2013-08-094-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | The registers.h file should only be included by code in the chip/ and board/ directories. Code outside those directories should not access chip-specific registers. (This change doesn't completely fix that, because common/extpower_usb.c uses STM32-specific regs, but we'll fix that in a separate CL.) BUG=chrome-os-partner:18343 BRANCH=none TEST=compile all platforms Original-Change-Id: Ic499f56690c38663083423b0593800161a68e6e9 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64382 Reviewed-by: Vic Yang <victoryang@chromium.org> (cherry picked from commit 078dfabb68be3573185bffdd79ef0f079002ee1e) Change-Id: I0882950c7e81e0bd4114dd1b17371cf061504818 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65368
* Host commands don't set the response pointerDuncan Laurie2013-08-096-41/+20
| | | | | | | | | | | | | | | | | | | | | Remove support for allowing host command handlers to set the response pointer. This is just one more thing that can break (and did, on SPI protocol V2). No commands other than the trivial read-memory-map command in host_command.c and flash read made use of this capability, and the savings in performance was negligible. BUG=chrome-os-partner:21576 BRANCH=none TEST=boot pit; still boots Original-Change-Id: I0a9bcf57dbea7155318fc389d7b47d3742a1a00a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64236 (cherry picked from commit c6dfa7e03b4c672e1031b4af9230b9da77e50f1a) Change-Id: Ib14042190989aa32eb32f024d9b616baaf339231 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65367
* Falco: Stop charging after a timeout of 10 hoursDuncan Laurie2013-08-093-0/+20
| | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:20145 BRANCH=falco TEST=Hack it. Add (uint64_t)599 * MINUTE to ctx->curr.ts.val in the timeout comparison. This makes the 10 hour timeout only take 1 minute. Testing this directly is tricky as a healthy battery will charge quickly. If you force it to trickle charge it will give up before 10 hours pass. Original-Change-Id: I69094a07e58c2d65e322ddc6a1b2ced828da0e26 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64309 (cherry picked from commit 0d3bdc690e7ab3ed0ab190b0529e95c2bbba4e7e) Change-Id: Ieaa310f67c0813a40ae71a81d9b42f4e01a68c2b Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65366
* Track the duration of each charge/discharge state.Duncan Laurie2013-08-092-2/+6
| | | | | | | | | | | | | | | BUG=chromium:267146 BRANCH=falco,peppy TEST=Manual. Observe charge state messages on the ec console. Original-Change-Id: I25f04db56bf62394b5bb2e0d56edbda3a0bb5e25 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64280 (cherry picked from commit 33f8086c90b8ecc3289c4c144103eb5c6dc0eea8) Change-Id: I8234d5d0c36716e9e0106eafc720735148c1f02e Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65365
* Pass command line arguments to make from make_all.shDuncan Laurie2013-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | This would allow us to do something like: util/make_all.sh -j32 util/make_all.sh V=1 BUG=None TEST=util/make_all.sh -j TEST=util/make_all.sh V=1 BRANCH=None Original-Change-Id: Ifed0baf6c94fbe8b0296cbdc70ba84f92f04b75b Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64268 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 150f175609ceea03a4da2eafb737484790ac8931) Change-Id: Iaa21698902e31144ff07fc8a0526dd59b00cacd7 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65364
* Fix documentation for lid change and power button hooksDuncan Laurie2013-08-091-2/+2
| | | | | | | | | | | | | | | | | | | | | They're now called from a deferred function call, which is done in the hook task and not the chipset task. No code changes. BUG=none BRANCH=none TEST=compile code Original-Change-Id: I115b6b254bd2b0ddd9688df603621e7ce0c12e1e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64258 Reviewed-by: Vic Yang <victoryang@chromium.org> (cherry picked from commit 9078a1d9b2505fc14bfa863d8a4f4987dca88c31) Change-Id: I3484034c255f1944d0999da2249e092edd339225 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65363
* Word-align the host memory mapDuncan Laurie2013-08-092-3/+12
| | | | | | | | | | | | | | | | | | | This fixes unaligned access exceptions when totally-unrelated code changes happen to move around host_command.c's global variables. BUG=chrome-os-partner:21578 BRANCH=none TEST=add a ccprintf() call to host_command.c; no longer causes an exception Original-Change-Id: I5407e5631a08ea647dc40e5bd9c7bd101868ced0 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/64233 Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit bebfb9431ed973703df03c8e2da11cf280315272) Change-Id: Ifff687a36fdaafce179be3e8b3ab040944712757 Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65362
* Add hook for changes in the charge state machineDuncan Laurie2013-08-096-0/+19
| | | | | | | | | | | | | | | | BUG=chrome-os-partner:20145 BRANCH=falco,peppy TEST=Manual. Tested with charging timeout logic. Original-Change-Id: Iab1c9746dcab5820fcdeb3e0d94bfcb0c47e57f2 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/63537 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 8e28efa7ac4bc6cec969a928d1b34b6d423d582f) Change-Id: Icbf28ff572488f26343fd5a0afac4214c5a1582a Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65361
* console_output: Add commands for saving / restoring print mask.Shawn Nematbakhsh2013-08-091-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | Saving + restoring the channel print mask previously involved running the 'chan' command with no parameters, then parsing the output. This parsing is unreliable if other tasks are also writing to the console. Add commands to save / backup the current channel mask, and later restoring it. Typical method to limit channel mask will now be: chan save chan <mask> ... chan restore BUG=chromium:269758. TEST=Run 'chan save' / 'chan 0' / 'chan restore' on EC console, verify print mask is restored. BRANCH=Peppy/Falco. Change-Id: I039e521c43b9f5b9451ef99c166a390ea03b8da7 Original-Change-Id: I725c7fb5e3ac7e55ed5f435446f8fc5c54af165f Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65208 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65318
* Falco: set fan/thermal steps (BRANCH ONLY)Bill Richardson2013-08-092-3/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: This CL is for the branch only. It does NOT go into ToT. This sets the thermal steps and fan speeds as requested: Step Fan RPM trigger point (CPU Tj) unit K / 'C Step 1 2700 under 333K / 60'C Step 2 3000 333K / 60'C Step 3 3300 338K / 65'C Step 4 3600 343K / 70'C Step 5 3900 348K / 75'C Step 6 4200 353K / 80'C Step 7 4500 358K / 85'C Step 8 5000 363K / 90'C This also sets the CPU hot points to the following: 373K / 100C => assert PROCHOT 378K / 105C => give the CPU three second to cool off, then shutdown 383K / 110C => shutdown immediately BUG=chrome-os-partner:20805 BRANCH=falco,peppy ONLY! Not ToT! TEST=manual To test, I replaced the existing temp_sensor_read() function in common/temp_sensor.c with this: static int mock_temp; int temp_sensor_read(enum temp_sensor_id id, int *temp_ptr) { if (mock_temp >= 999) return EC_ERROR_UNKNOWN; if (mock_temp == 0) return EC_ERROR_NOT_POWERED; *temp_ptr = mock_temp; return EC_SUCCESS; } static int command_faketemp(int argc, char **argv) { if (argc < 2) return EC_ERROR_PARAM_COUNT; mock_temp = strtoi(argv[1], 0, 10); ccprintf("temp set to %dK\n", mock_temp); return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(faketemp, command_faketemp, "TEMP", "Enable thermal fan control", "0 = off, -1 = error, >0 = degrees K"); From the EC console, I could manually set the temps and watch the fan speed change. It followed the correct steps. Change-Id: I9b4b52e622de104ea98528387c359d0f05747426 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/65261 Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Puneet Kumar <puneetster@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>