summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Clear OWNERS for factory/firmware branchfactory-3004.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/+/3155029 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Owners-Override: Jora Jacobi <jora@google.com> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* Cherry-Pick: Add 'unprotect' flag for flashing link ec.Dave Parker2013-01-222-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | BRANCH=link BUG=chromium-os:37967 TEST=Remove write protect, reflash without 'unprotect', flag and verify the write protect flag is stil enabled with flashrom -p internal:bus=lpc --wp-status. Power down, then reflash with the --unprotect flag. Now verify the write protect status flag is disabled. Original-Change-Id: Ie05b5dc85dd31d29ab43a392fe948a52d547fff3 Signed-off-by: Dave Parker <dparker@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41477 Reviewed-by: Randall Spangler <rspangler@chromium.org> Conflicts: util/flash_ec Change-Id: Id25104f40cfcccc4c53cbf1b8d02346f7f1322c6 Reviewed-on: https://gerrit.chromium.org/gerrit/41663 Reviewed-by: Walter Murphy <wmurphy@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Dave Parker <dparker@chromium.org> Tested-by: Dave Parker <dparker@chromium.org>
* temp_metrics: tmp006 calibration updateSameer Nanda2012-10-231-4/+3
| | | | | | | | | | | | | | | | | | | | | | | Updated S0 calibration settings based on DVT3 systems. De-activate the PCH sensor in the thermal loop as its accuracy is poor. BUG=chrome-os-partner:9599 TEST=run "for i in {0..3}; do echo $i: && ectool tmp006cal $i; done" and make sure the S0 values are the same as those programmed by temp_metrics.conf. BRANCH=none Change-Id: I2b4395d3c74ce4610f57ee90f6cd3f0d7467d31b Signed-off-by: Sameer Nanda <snanda@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36000 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 7cd4d4391d3abbd2272bf9b7459677a4fa99cd0c) Reviewed-on: https://gerrit.chromium.org/gerrit/36405 Reviewed-by: Jon Salz <jsalz@chromium.org> Tested-by: Jon Salz <jsalz@chromium.org>
* temp_metrics: disable ACPI thermal zone 1Sameer Nanda2012-10-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | ACPI thermal zone 0 is used for critical thermal events while thermal zone 1 is used for asserting (internal) prochot and duty cycling. Since the equivalent of thermal zone 1 functionality exists in temp_metrics, disable ACPI's thermal zone 1 in order to prevent conflicts between ACPI and temp_metrics. BUG=chrome-os-partner:9193 TEST='cat /sys/class/thermal/thermal_zone1/mode' and check that it is disabled. BRANCH=none Original-Change-Id: I689e8e5c1747c5f259f4a72a9f86396f4aa5c0b2 Signed-off-by: Sameer Nanda <snanda@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35593 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 4dd3940d19196fc3f872f08ec30d6d5a6ad8ef28) Change-Id: Ib286cab8fad0323df72198467e2c7e5ddcbcdf09 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35800
* temp_metrics: tmp006 calibration and fan loop updatesSameer Nanda2012-10-161-22/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | With the recent changes that have gone into the EC, the TMP006 calibration data is no longer present in the EC by default. Push it down to the EC via the newly added ectool tmp006cal command. Also added couple of changes to the fan loop: - hand back fan control loop to the EC if none of the TMP006 sensors report valid temperatures. - handle S0->S3->S0 transition where the EC sets the fan to 0 RPM. BUG=chrome-os-partner:9193 TEST=run "ectool tmp006cal" command for sensors 0, 1, 2 and 3 and ensure that they return non-zero calibration values. BRANCH=none Original-Change-Id: Iaf91216a4d3353f15489b39aba9acb34055551cf Signed-off-by: Sameer Nanda <snanda@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35469 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> (cherry picked from commit dd300b5baf1d6eff7f53b8a94c8574cfece52685) Change-Id: Ic514f98c5c77c26174bc7cc175a5f5091de79c0a Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35799
* Fix lightbar bug, add more tweaks.Bill Richardson2012-10-163-10/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I introduced a glitch in the parameterization CL. This fixes it, and makes the choice between the gentle throbbing and occasional pulse something that can be selected as a parameter. Default is the new pulsey style. BUG=chrome-os-partner:8039 BRANCH=Link TEST=manual Using the ectool that's part of this change, run these commands to flip between suspend and active displays: ectool lightbar seq s3s0 ectool lightbar seq s0s3 Change the "new_s0" value (0/1) and reload the params with ectool lightbar params | tee /tmp/w vi /tmp/w ectool lightbar params /tmp/w In each case you'll see some pretty patterns. Pass/Fail is an artistic decision. No QA required. Original-Change-Id: I8de0b1b3cc77f65879befe95e110bbbce18846d9 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35620 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit aadfab96c0ccff88aefc161d07537604c9be4ba1) Change-Id: I11993108cd622bd167149b341b9b0bd35ba83c11 Reviewed-on: https://gerrit.chromium.org/gerrit/35681 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link:re-enable fan RPM controller when neededRandall Spangler2012-10-164-38/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, any command which set the fan duty manually would leave the PWM RPM controller disabled. Setting the fan back to auto mode via 'ectool autofanctrl' or 'autofan' or 'ectool pwmsetfanrpm' wouldn't turn the controller back on. Now it does. BUG=chrome-os-partner:14307 BRANCH=link TEST=manual - Reboot in recovery mode and wait for INSERT screen - From EC console fanduty 100 -> fan turns on all the way faninfo -> mode is duty fanset 6000 -> fan turns down to a lower level faninfo -> mode is rpm fanduty 0 -> fan turns off all the way faninfo -> mode is duty (wait a min or so for the system to heat up) autofan -> fan turns on faninfo -> mode is rpm - Reboot normally - From root shell ectool fanduty 100 -> fan turns on all the way ectool pwmsetfanrpm 6000 -> fan turns down to a lower level Original-Change-Id: I3b07e8b49500f5f8a42f20909d2869cf63987d6d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35335 Reviewed-by: Sameer Nanda <snanda@chromium.org> (cherry picked from commit e764bdbb03780d1e4c879edd046923c5c2d409a5) Change-Id: I16a97b0cbc61e03ccde754552c9713950118a319 Reviewed-on: https://gerrit.chromium.org/gerrit/35680 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link: thermal controls ignore case temp by defaultRandall Spangler2012-10-161-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The remote temperature sensors for case temps are now not used until they're calibrated by the host. But the EC still tries to control the fan based on case temps. At best this has no effect because the sensors haven't been enabled by host calibration. At worst, the host calibrates them, but doesn't set up the temerature thresholds to match, so the EC spins up the fan briefly during boot before the host takes over (annoying), or potentially asserts prochot, shuts the system down, or triggers a bunch of SMIs (really annoying). It's safer just to leave these thresholds disabled by default; if the host wants the EC to use them, it can easily set them at the same time it sets the remote sensor calibration data. Also, adjust overheated thresholds up based on snanda's recommendations. BUG=chrome-os-partner:9193 BRANCH=link TEST=thermalconf 2 --> should print 0 K for all levels Original-Change-Id: I5bd1ea65eaefc4d39238b22363176d32663434a0 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35449 Reviewed-by: Sameer Nanda <snanda@chromium.org> (cherry picked from commit b3fa69f17f4fec6cbe9cdc34e3b8abff367050f1) Change-Id: Iaaf80052b0ea72b422599010f23bf65c228c4576 Reviewed-on: https://gerrit.chromium.org/gerrit/35679 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* Replace pulsing with sweeping.Bill Richardson2012-10-161-23/+15
| | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:8039 BRANCH=Link TEST=none More cosmetic changes. Original-Change-Id: If33e39d3cea1e3930d630ad84a156e9afb4c57fd Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35485 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 814d0d227f599228761f5f95a618b4b63b05c66b) Change-Id: I0f8361efa206b66616d4bcfe62ec031af66c1c70 Reviewed-on: https://gerrit.chromium.org/gerrit/35678 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* Set minimum brightness to 35%, variable osc settings.Bill Richardson2012-10-164-48/+77
| | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:8039 BRANCH=Link TEST=none More cosmetic changes. Signed-off-by: Bill Richardson <wfrichar@chromium.org> Original-Change-Id: I1fd9318131ce55541d845ac8be5faa9334c3953f Reviewed-on: https://gerrit.chromium.org/gerrit/35484 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit eb59ac66bd2af435315d371ff45b09b2283e5fac) Change-Id: I5bc088c3b275bf03c73d95e1871ea82d2677046e Reviewed-on: https://gerrit.chromium.org/gerrit/35677 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link: Ignore keyboard when lid is closedRandall Spangler2012-10-162-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lid is flexible enough that it's possible to press keys by squeezing the laptop. To keep this from waking the device from suspend or powering it on, don't scan the keyboard or power button when the lid is closed. BUG=chrome-os-partner:15252 BRANCH=link TEST=manual - boot system - use a magnet near the search key to trigger the lid-closed switch - press space, then power. neither one should trigger resume - remove magnet. system resumes - space and power should work as expected again - log out - use magnet to trigger lid-closed switch (looking at EC console output is handy here). system should shut down - pressing power should not boot the system - remove magnet; system will boot - pressing power should work as expected again Original-Change-Id: I92080237b0a2f21774301df3d8e866878697b793 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35425 Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit 8c742b2fc33a7182034fad6166a4953b79161052) Change-Id: I4bebaa77e83e718e5911a60f4d4296fcbd5e6952 Reviewed-on: https://gerrit.chromium.org/gerrit/35676 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* Parameterize the lightbar behavior as much as possible.Bill Richardson2012-10-164-99/+378
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change replaces most of the hard-coded lightbar constants with values that can be updated at run-time, so that if we change our minds about colors and timing we can tweak some of the values without requiring an EC/BIOS update. It also adds the "ectool lightbar params" command to get and set those values from the host. You can see the values from the EC console ("lightbar params"), but there's no way to set them. BUG=chrome-os-partner:8039 BRANCH=Link TEST=manual From the EC console, run lightbar params It should display the current values that can be changed. Log in to the host and run this to see the same values: ectool lightbar params Or edit and change them with this: ectool lightbar params > /tmp/vals.txt vi /tmp/vals.txt ectool lightbar params /tmp/vals.txt The updated parameters are persistent across EC jumps (RO->RW), but are lost when/if the EC reboots (as it will after the AP is off for 24 hours, for example). Original-Change-Id: Ic2a3fd6f8062673432b48904933e0c7239b8658b Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35289 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit d6f05e0d616e4004b0bb0404b6c8dbe9f9198db4) Change-Id: I201ffbe9351a06b1d7daabe62161a862f0e0cc3c Reviewed-on: https://gerrit.chromium.org/gerrit/35675 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link: EC reclaims fan control on AP shutdownRandall Spangler2012-10-165-27/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if the AP took fan control, the EC would never take it back. This meant the EC would leave the fan off even if the system was sitting at the INSERT screen or booted an alternate OS. BUG=chrome-os-partner:15189 BRANCH=link TEST=manual - boot system - from EC console, fanset 0 - faninfo shows fan at 0rpm - from root shell, crossystem recovery_request=123 && reboot - wait a few mins - faninfo should show fan spinning again Original-Change-Id: I534c9978194085467f1df6eae971c55d4e8083be Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35309 (cherry picked from commit b00a446ec57323f84002722523783351f19e41b1) Change-Id: Ic339a7fffab46f103aee3d56c63d68570d66a1a5 Reviewed-on: https://gerrit.chromium.org/gerrit/35674 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link: Reset fan target RPM when suspendingRandall Spangler2012-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This prevents the fan from coming on loudly during resume. BUG=chrome-os-partner:15187 BRANCH=link TEST=manual - power on system - wait for it to heat up; type faninfo periodically from ec console - when faninfo reports non-zero, type 'powerd_suspend' at root shell - faninfo should now report Target: 0 rpm Enable: no Original-Change-Id: Ia5ee93c0f5c6626afd54a22d2996ab65cf8e3b18 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35303 Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit ceb696a20896511aa233b1f59227a6edaeda3157) Change-Id: I68cd6850205000fdbaf11e4d6c35c24874a08b69 Reviewed-on: https://gerrit.chromium.org/gerrit/35673 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link: TMP006 S0 param is uncalibrated by defaultRandall Spangler2012-10-164-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | S0 values are incorrect and may even need to be calibrated on a per-system basis. Set them to 0 by default so that the EC doesn't return inaccurate remote temperature readings before calibration data is sent. BUG=chrome-os-partner:15174 BRANCH=link TEST=manual - temps -> remote temps are all not calibrated - t6cal 1 s0 9301 - temps -> PCH D-Object temp now returns a temperature Original-Change-Id: I43facc60cf947ebd9441a8a629a76f7ffc8f3959 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35302 Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit 25c6574da67335b0a6ab36429cc2e3c7fe87afc0) Change-Id: I866251e0b8d886e1c531ee5a211674a8e16dc217 Reviewed-on: https://gerrit.chromium.org/gerrit/35672 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link: Added sensor-not-calibrated error for TMP006Randall Spangler2012-10-164-4/+18
| | | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:15174 BRANCH=link TEST=manual, from root shell - ectool temps all -> prints all temps - ectool tmp006cal 1 0 0 0 0 - ectool temps all -> sensor 3 not calibrated Original-Change-Id: I16ee818c948fe90ac7c18b230c5d9f9a0ec83ded Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35288 Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit 23fe5ed867b2811a84171755137021608dda5777) Change-Id: I39235eee38c2e9c0847d16cc4e350daf4506756d Reviewed-on: https://gerrit.chromium.org/gerrit/35671 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link: Temp sensors can return not-powered error codeRandall Spangler2012-10-167-58/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the need for a separate method to check sensor power, and gets rid of temp_sensor.c knowledge of what powers each sensor. BUG=chrome-os-partner:15174 BRANCH=link TEST=manual - reboot - within a second, type 'temps'; I2C sensors should return error 1 - type 'temps' again; all sensors should return data - power off system - type 'temps' again; I2C sensors and PECI should return error 8 - 'gpioset enable_vs 1' - type 'temps' again; I2C sensors should return valid data; PECI should still return error 8. Original-Change-Id: I17c353b3c483bc320769307c7715008ec729089b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35287 Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit 22e03a1de6d525e84e511f4b25531caf6f1a93fd) Change-Id: Iad6a0691beabfed6185d22e4ce89d49d8c90fd7e Reviewed-on: https://gerrit.chromium.org/gerrit/35670 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link: Temp sensor read can return an error codeRandall Spangler2012-10-169-55/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will be used in a follow-up CL to return specific error codes (not powered, not calibrated, etc.) BUG=chrome-os-partner:15174 BRANCH=link TEST=manual Power on system. 'temps' should return all good temps. Power off system (into S5) Only ECInternal temp should work; others should return Error 1 'gpioset enable_vs 1' and wait a second Now all the I2C temps should display good data, but PECI will still be error 1. Original-Change-Id: I925434e71653ad53ad76bad992a7a8fdeadb088c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35286 Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit 8f2e99da75152c428c6c92b20a13a62a5fcb40d1) Change-Id: Ic94dc410cbcd180091f7ca982c37c4eff5b55fb8 Reviewed-on: https://gerrit.chromium.org/gerrit/35669 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* Add host command to get/set TMP006 calibration dataRandall Spangler2012-10-163-22/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needed for host-based thermal control and tweaking. BUG=chrome-os-partner:14955 BRANCH=link TEST=manual From a root shell, ectool tmp006cal 0 3.5e-14 -2.8e-5 -5.5e-7 4.5e-9 ectool tmp006cal 2 3.6e-14 -2.9e-5 -5.6e-7 4.6e-9 ectool tmp006cal 0 S0: 3.500000e-14 b0: -2.800000e-05 b1: -5.500000e-07 b2: 4.500000e-09 ectool tmp006cal 2 S0: 3.600000e-14 b0: -2.900000e-05 b1: -5.600000e-07 b2: 4.600000e-09 At the ec console, "t6cal" should show the settings took effect as well. Original-Change-Id: If43b11e1e827483f0a20db1a2e5644f3475fd95e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35215 (cherry picked from commit d1bebbbe66f78d2dcfb9380456a80e7c2f26a662) Change-Id: I10c456fdc68e82b19a5fd04832ca165d7a6b1de6 Reviewed-on: https://gerrit.chromium.org/gerrit/35668 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* Add t6cal console command to set/print TMP006 calibrationRandall Spangler2012-10-161-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that radix must be specified as an integer, because we don't have floating-point parsing. So to set the first sensor's S0 to 3.600e-14, do: t6cal 0 S0 3600 BUG=chrome-os-partner:14955 BRANCH=link TEST=manual From EC console, t6cal 0 s0 3500 t6cal 1 b0 -3000 t6cal 1 b1 -5600 t6cal 2 b2 4700 t6cal The final t6cal should show the changes from the previous commands Original-Change-Id: I2f8f71890e8e64a427cc29c3ef86ca991ce6b039 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35204 (cherry picked from commit bea56570f3105830a9df92cc7c9ea1185bf0dbef) Change-Id: I18293b4c6205d57742bc19794bfa80f1cf18f455 Reviewed-on: https://gerrit.chromium.org/gerrit/35667 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* Refactor TMP006 moduleRandall Spangler2012-10-163-171/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Use floating-point more freely, since it's on all the time now, and the old fixed-point code no longer compiled. 2) Sensitivity and Bn values are now in a RAM-based struct in preparation for setting them at runtime. No changes from current values. 3) If a sensor fails to read good data, is initialized, or loses power, its die temperature history will be set to the next good temperature, rather than persisting an arbitrary start value or old state. This fixes reading wildly inaccurate object temperatures for the first few seconds following boot/resume. 4) If a sensor loses power, wait for the sensor to report data-ready before reading temperature/voltage. Otherwise, those read as 0, which again throws off the first few seconds of data. BUG=chrome-os-partner:14955 BRANCH=link TEST=Boot system and set at login screen for a minute to reach thermal equilibrium. Then reboot system, type 'temps' repeatedly. Data from TMP006's should initially be Error; after a second or so it should be good, and shouldn't change more than a few degrees. Original-Change-Id: Id0b42b9b18e94978ba7d3a1ee33194e44b1904bc Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35188 (cherry picked from commit 0b6b6b7754359546d4fd6684156bc7b120328721) Change-Id: I3b6e5d21a5452c5bebcdd1c06217759fd753ca10 Reviewed-on: https://gerrit.chromium.org/gerrit/35666 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* Add console channel for thermal outputRandall Spangler2012-10-162-0/+2
| | | | | | | | | | | | | | | | | | | Needed for debugging upcoming TMP006 calibration changes BUG=none TEST=boot; EC console output should appear as before BRANCH=link Original-Change-Id: I93a18949888533ecefd226fdc64e1fab7d52a8f1 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35187 Reviewed-by: Bill Richardson <wfrichar@chromium.org> (cherry picked from commit 678e649240ed950b08bffa254e994e1f867673d0) Change-Id: I61307ceef7536e10148f451afde945a34ea4fae9 Reviewed-on: https://gerrit.chromium.org/gerrit/35665 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* temp_metrics: remove prochot and TCC modificationsSameer Nanda2012-10-161-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | External prochot input was disabled due to board issues. Re-enable it since those board issues are now fixed. Remove modification of TCC offset. Changes to TCC offset from this script are ineffective since they need to happen before the BIOS sets the BIOS_RESET_CPL bit way early in the initialization sequence. BUG=chrome-os-partner:9193 TEST=from shell run "rdmsr 0 0x1fc" and check that bit 0 is set to 1. BRANCH=link Original-Change-Id: Ida2a090539d7e074794e13a90f251babb6c4ade9 Signed-off-by: Sameer Nanda <snanda@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35067 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> (cherry picked from commit 3af7bc4335d7f6e8e16306603c54cf4fc2f502e3) Change-Id: I39e251e514cfff803915af23a0d5161b4ae9a134 Reviewed-on: https://gerrit.chromium.org/gerrit/35664 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* Fix lightbar test patternBill Richardson2012-10-161-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | An earlier commit made the lightbar test sequence run much too quickly. This puts it back. I'm not sure if the factory still looks at this, but I think they did at one time, so we might as well keep it working. It's helpful for debugging anyway. BUG=chrome-os-partner:8039 BRANCH=link TEST=manual Log in, run "ectool lightbar seq test". You should see the lightbar colors pulse in various colors, then go back to whatever they were doing before. Original-Change-Id: I11c24a448bf40f0c0c82456fcf6e0415a0392c28 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35190 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit f874e2a1cab4921e16387f8c53e673d2949cbec0) Change-Id: I4aad2dc28afe4a72403874ec5af9a84df4d3f5d5 Reviewed-on: https://gerrit.chromium.org/gerrit/35663 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link: Revive under voltage protection battery packRong Chang2012-10-162-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Experiments showed that some UVP batteries took ~30 seconds to restart its gas gauge IC. This change adds 30 seconds polling check to determine the condition. Signed-off-by: Rong Chang <rongchang@chromium.org> BRANCH=link BUG=chrome-os-partner:13923 BUG=chrome-os-partner:14094 TEST=manual Disconnect battery and plug in charger. The charging LED should turn red after 30 seconds. Original-Change-Id: I425e63c428aeeaf1468bc2f9886457de1145cada Reviewed-on: https://gerrit.chromium.org/gerrit/34886 Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org> (cherry picked from commit e679d8504d6d34aa8e9d7d7fb9a78b38f35e9415) Change-Id: I954393c9055c1b412bb3c79a8ef0c328f92b21ba Reviewed-on: https://gerrit.chromium.org/gerrit/35662 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* link: Hibernate EC when battery level drops below 2%Randall Spangler2012-10-052-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | We already shut down the main processor below 3%. Hibernating the EC below 2% will further cut power draw and minimize the risk of deep-discharging the battery. BUG=chrome-os-partner:14839 BRANCH=link TEST=manual 1) discharge battery below 3%; system should shut down. when powered on again it should shut back down within ~10 sec. 2) discharge battery below 2%; when system shuts down it should also hibernate. (I've also tested this with a hacked smart_battery.c which lies about the battery state of charge, since that's faster than waiting for my battery to discharge.) Change-Id: I504ba927012430db5cf10b895a36e6cd6fdf4c8b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34793 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* stm32: Implement keyboard debouncingSimon Glass2012-10-051-54/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | This brings Randall's key debounce logic into STM32. We need to rationalize the code, but for this morning... This should fix problems with double keypresses and missing keypresses. BUG=chrome-os-partner:12179 BRANCH=snow TEST=manual - type quickly; should work - run your finger really quickly over the keyboard; should be able to see keys which don't show up because you didn't press them long enough - run your finger quickly from 1 to 0; numbers should show up in order (some may be missing if you sweep too fast. there is a point where if two keys are hit within 1.7ms of each other they can be swapped, but any slower than that and they should never be out of order) - mash your face into the keyboard to cause ghosting; should see only a few keys pressed Change-Id: I6b164a17de1b4dd698f9b45a3852fd3b6c084e0a Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34765 Commit-Ready: Randall Spangler <rspangler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
* stm32: Implement keyscan configuration commandSimon Glass2012-10-052-0/+239
| | | | | | | | | | | | | | | | | | | | | Implement a command to allow getting and setting the keyboard configuration. BUG=chrome-os-partner:12179 TEST=manual - use ectool to read all keyscan paramters - use ectool to update flags to 0, see that keyboard stops working, then set flags to 1 and see that it starts working again. - use ectool to update scanning period to 100ms, see that it drops lots of keys when typing - use ectool to set fifo size to 1, see that the fifo no longer fills up Change-Id: I5afb3b48b1262a1570d7411ffd8b2e6ea3a65f6b BRANCH=snow,link Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34635 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* stm32: Reduce keyboard scan period from 10ms to 3msSimon Glass2012-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | Experimentally it is possible to press a key on snow for only 4.8ms. We should aim to scan more frequently to catch those who only just touch the keys, or type very quickly. It takes a little over 2ms to complete a keyboard scan at present. We shold aim to reduce this, but for now, it seems safe to reduce the default scanning frequency to 3ms. BUG=chrome-os-partner:12179 TEST=manual Type on keyboard on snow in browser, and see that we still get results and the EC is stable. Change-Id: I60827c33a58c34dd808504e58bca480bd61f5932 BRANCH=snow Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34634 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* stm32: Update keyboard_scan to use run-time configurationSimon Glass2012-10-051-41/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | At present the keyboard scan parameters are hard-coded, so changing them requires a new EC image. This can be problematic if we want to adjust the behavior of keyboard scanning since we must send an EC update. Change stm32's keyboard scan to use run-time config. All parameters and behavior should remain the same with this change. The configuration is defined by ec_commands.h since we intend to create a command to allow access to it. It does not seem worth defining a separate structure within keyboard_scan at present, although if we add a new version of the command in the future then we may want to separate these. BUG=chrome-os-partner:12179 BRANCH=snow TEST=manual Boot snow into U-Boot and Linux, try the keyboard, seeing that it seems to work as before. This is a very subjective test. Change-Id: Ie6160f1d73b983867b96f8ccb421853f6ec99524 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34633 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* stm32: Drop key scan masksSimon Glass2012-10-051-21/+0
| | | | | | | | | | | | | | | The masks were intended to be used to ignore certain keys in the matrix to help with de-ghosting of keys. Since this is done on the AP anyway, there really isn't any need for them. Punt. BUG=chrome-os-partner:12179 BRANCH=snow TEST=manual Build and boot into kernel, see that keyboard still works. Change-Id: I00d1b761d24ab503c66439b095a8336fff5d5db6 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34657
* Define key scan parameters and get/set commandSimon Glass2012-10-051-0/+49
| | | | | | | | | | | | | | | | | | | | | | At present the keyboard scan parameters are hard-coded, so changing them requires a new EC image. This can be problematic if we want to adjust the behavior of keyboard scanning since we must send an EC update. Define the keyboard scan parameters and commands to get/set these parameters. Signed-off-by: Simon Glass <sjg@chromium.org> BUG=chrome-os-partner:12179 BRANCH=snow,link TEST=manual Build for all boards Change-Id: I715755cb5357503723b27ae33053dba1452e48e0 Reviewed-on: https://gerrit.chromium.org/gerrit/34656 Commit-Ready: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* link: fix race condition enabling keyboard interruptRandall Spangler2012-10-051-5/+13
| | | | | | | | | | | | | | | | | | | | | | | Previously, an edge on a keyboard row could be missed if it occurred after the last scan, but before interrupts are enabled. Now we explicitly check if any keys are down before waiting for an interrupt, and if any are, we simply don't wait to scan. BUG=chrome-os-partner:7484 BRANCH=link TEST=the race condition's really tricky to hit The best we can do for testing is to ensure that we ARE sleeping in the normal case where no keys are held down. For that, don't press any keys, and run 'taskinfo' from the EC console twice about 10 sec apart. Both printouts should have virtually identical times for the KEYSCAN task. Change-Id: I4e0ef18a2d71d0a5d3655742bd49fc15afc4aaed Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34709 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
* link: Implement keyboard debouncingRandall Spangler2012-10-051-79/+150
| | | | | | | | | | | | | | | | | | | | | | This should fix problems with double keypresses and missing keypresses. BUG=chrome-os-partner:8826 BRANCH=link TEST=manual - type quickly; should work - run your finger really quickly over the keyboard; should be able to see keys which don't show up because you didn't press them long enough - run your finger quickly from 1 to 0; numbers should show up in order (some may be missing if you sweep too fast. there is a point where if two keys are hit within 1.7ms of each other they can be swapped, but any slower than that and they should never be out of order) - mash your face into the keyboard to cause ghosting; should see only a few keys pressed Change-Id: I66e95c56d94cba16454ee2c37498deeb57f1a2c3 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34697 Reviewed-by: Simon Glass <sjg@chromium.org>
* Remove some extensions from .gitignoreSimon Glass2012-10-041-3/+0
| | | | | | | | | | | | | | | | | | | | Since build output is in build/ we don't really need to have *.bin (and others) excluded throughout the source tree. This change allows us to check in .bin files without warnings. BUG=none BRANCH=snow,link TEST=manual $ git status - see that we still have no stray files reported $ git add test/test-matrix.bin - see that there is no warning given now Change-Id: Ia71c5c2b89c3f0eef5098c86c701cb34f666e164 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34632 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* link: add hibernate option to ectool reboot_ecRandall Spangler2012-10-043-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | This enables the OS to request the EC drop into its lowest-power shutdown state. Targeted at end of factory flow, where the at-shutdown variant is the desired variant because it allows the main processor to shut down cleanly first. BUG=chrome-os-partner:14838 BRANCH=link TEST=from root shell, ectool reboot_ec hibernate at-shutdown shutdown -h now System should shut down, and EC console should be unresponsive (since it's hibernating). Press power button, and system should power back on. ectool reboot_ec hibernate System should shut down immediately. Press power button, and system should power back on. Change-Id: I8084a3a1bca6b7c201e090552b193fe1568708a2 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34569 Reviewed-by: Vic Yang <victoryang@chromium.org>
* link: Pass keyboard state array as a parameterRandall Spangler2012-10-041-36/+49
| | | | | | | | | | | | | | | | | This is a precursor to implementing proper keyboard debouncing, and should have no functional effect; it's just refactoring. BUG=chrome-os-partner:8826 BRANCH=link TEST=manual - power+refresh+esc -> recovery mode - boot normally and type -> yaay, you can type Change-Id: I828d2380c164c92330d725002379b6442894f41d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34567 Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Major rewrite of lightbar using FP math.Bill Richardson2012-10-021-377/+388
| | | | | | | | | | | | | | | | | | | Latest tweaks after working with the UI folks. This changes the S3 and S0 sequences and the transitions between them, using Google colors, smooth fades, and persistent state across EC resets. In S3, we only pulse when the battery is low and is discharging. BUG=chrome-os-partner:8039 BRANCH=Link TEST=none Artistic criticism only, please. Change-Id: Id75b8c2c96e2e9dc9ff27af0bfe126cfad5d490e Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34465 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Fine tuning of temp_metrics thermal loopSameer Nanda2012-10-021-18/+33
| | | | | | | | | | | | | | | | Fine tuned temperature thresholds and added watermark concept to the thermal loop. BUG=chrome-os-partner:9193 TEST=Vary CPU and GPU load on the system. The fan speed and CPU/GPU limits should change as the skin temperature responds to changes in the load. BRANCH=link Change-Id: I43739097e699bc4e724e395c6e830c7c694704cc Signed-off-by: Sameer Nanda <snanda@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34454 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* link: Add charge_near_full stateRandall Spangler2012-10-023-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tell the host the battery is no longer charging when it hits 97%, and set the power adapter LED to green. This solves several problems: 1) The last 3% of charge takes a looong time. Kernel/ACPI/UI already have a hack to show the battery as charged when it's about 3% from full, but the EC still showed a yellow LED. 2) If the system is charged and you briefly unplug the adapter, the LED turned yellow for a long time as it slowly trickle-charged. Now it goes right to green. 3) A fully-charged battery will drop below 100% charge as it settles, but won't accept more current at that time. This caused the LED to turn yellow and stay there until the battery finally settled down to ~96%, at which point it'd accept more current and top itself off. The whole time it did this, the kernel/ACPI/UI hack from (1) would keep reporting "battery full". Now the LED stays green too. BUG=chrome-os-partner:11248 BRANCH=link TEST=manual - Discharge system to <95% full. - Plug adapter in. LED should come on yellow. - At around 97% full, the LED should turn green. - Around that the UI will display "battery full". (Note that due to rounding, the UI may take a few minutes to display "battery full" after the LED goes green; that's ok) - Unplug and replug adapter. LED should come on green. UI still reports "battery full". Change-Id: Ie56fbf3a05239e73d2c765bb98d36aa5cfedc2ef Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34452
* link: Add more info to 'ectool battery'Randall Spangler2012-10-021-0/+29
| | | | | | | | | | | | | Now prints the rest of the memory-mapped battery info. BUG=chrome-os-partner:14630 BRANCH=link TEST=ectool battery, then compare with 'battery' at ec console Change-Id: I3f5222d898bbcb8b79774a5848f9aed0067a0d49 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34424 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Enable FPU support for Link ECBill Richardson2012-10-029-67/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | With this CL, if CONFIG_FPU is defined (only for Link, ATM), the EC task switcher will enable CONTROL.FPCA and expect all stack contexts to include floating point state as well as normal state (an additional 18 words). To support this, we need to increase the allocated stack space for each task. The stack sizes are already chosen empirically, so I'm just rounding them up a bit. BUG=chrome-os-partner:14766 BRANCH=Link TEST=manual There should be no noticeable change. If you run the EC command "taskinfo" you'll see the increased size each thread's stack, but everything that was working before should continue to work just fine. The additional overhead required to load and store another 18 words on each context switch is not really measurable (I tried). Change-Id: Ibaca7d7a2565285f049fda6906f32761e83207af Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34391 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* link: Don't set power LED green until second idleRandall Spangler2012-10-012-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the charge state machine sets the power LED green the first time it hits IDLE. This causes the LED to briefly flash green when the adapter is inserted, because the state machine goes discharging->init->idle->charging. Instead, add a new idle0 state in between init and idle which does not set the power LED. This allows the state machine to go discharging->init->idle0->charging, so the LED only goes from off->yellow. If the system is actually fully charged, it'll go init->idle0->idle and show green. BUG=chrome-os-partner:14630 BRANCH=link TEST=manual - Remove adapter and allow system to discharge a bit - Insert adapter - Should see LED go from off directly to yellow - Wait for charge - Should see LED go green Change-Id: I9b77f01fad27c8574133211c9fe250486609f3c1 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34387 Reviewed-by: Rong Chang <rongchang@chromium.org>
* Update temp_metrics to look at skin temperaturesSameer Nanda2012-10-011-30/+127
| | | | | | | | | | | | | | | | | | Updated temp_metrics to take the skin temperature into account instead of PECI CPU temperature for controlling fan speed as well as Ivy Bridge throttling. BUG=chrome-os-partner:9193 TEST=Vary CPU and GPU load on the system. The fan speed and CPU/GPU limits should change as the skin temperature responds to changes in the load. BRANCH=link Change-Id: Ie3d85112de1043cf5b12a78ca1fc50f5eb6c0497 Signed-off-by: Sameer Nanda <snanda@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34221 Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Re-enable keyboard scanning at end of debounce intervalRandall Spangler2012-09-281-6/+10
| | | | | | | | | | | | | | | | This fixes a problem where a very short power button press would disable scanning, but not debounce to down so we'd never have a debounced release to re-enable scanning. BUG=chrome-os-partner:14678 BRANCH=link TEST=tap power button very quickly, then see if keyboard still works (may need to repeat that a few times to be sure it always works) Change-Id: I3dd3d3f2d892f309a507463d7ad6accf32df30c4 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34225 Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
* link: Re-enable USB ports on resumeRandall Spangler2012-09-263-48/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, ports were only enabled on S5->S3, not S3->S0. Seems like they should always get re-enabled on resume. This also consolidates the USB code into a single file, cleans up the debug output, and prints the current USB charge state when the usbchargemode command is run without args. BUG=chrome-os-partner:12904 BRANCH=link TEST=manual - Boot system - At ec console, 'usb' should print port 0 and 1 are in mode 1. - At a root shell, 'ectool chargemode 0 0' - At a root shell, 'ectool chargemode 1 0' - Suspend system - At ec console, 'usb' should print port are in mode 0. - Resume system - At ec console, 'usb' should print port 0 and 1 are in mode 1. Change-Id: I3875a104338fb64db503929a018b8577d6f970e4 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34062 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Clean up reboot host commandRandall Spangler2012-09-263-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Only send the host response immediately for commands which won't return. This prevents double-sending a response for the disable-jump command. 2) Remove references to the POWER_ON flag. This was never implemented or used, since with EC software sync the EC always powers on after rebooting. 3) Fix help text for reboot_ec command. (Both "A" and "RW" still do the same thing, but "RW" is now the preferred option string.) BUG=chrome-os-partner:12635 BRANCH=link (also applies to snow, but don't pick unless needed) TEST=from a root shell, flashrom -p internal:bus=lpc -r /tmp/ec.bin flashrom -p internal:bus=lpc -w /tmp/ec.bin ectool reboot_ec RW ectool reboot_ec RO ectool disable-jump All commands should succeed. Change-Id: Ibf5b4fb88d93e64fc7361a9f962ec7aa1df0cf3c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34051 Reviewed-by: Yung-Chieh Lo <yjlou@chromium.org>
* stm32f: ADC driverVic Yang2012-09-267-2/+269
| | | | | | | | | | | | | | | This adds basic ADC support for multiple channel conversion. BUG=chrome-os-partner:14316 BRANCH=none TEST=1. Boot on snow. 2. Use keyboard signal as input. Check read value changes as input signal changes. Change-Id: I3c15c37446fa9273d098f6d581573c11ced45b5e Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/33883 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* stm32: Export DMA memory size optionVic Yang2012-09-265-31/+74
| | | | | | | | | | | | | | We need different memory size configuration in different application. Let's export the memory size option to DMA function parameters. BUG=chrome-os-partner:14316 TEST=Boot on snow. Check I2C host command works. BRANCH=none Change-Id: I30481ddf86a1526d517961e009898642ecdd649a Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/33981 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* link: If discharging and system is off, only poll battery once a minuteRandall Spangler2012-09-252-3/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reduces power consumption in S3/S5 because the EC doesn't need to poll the battery every 500ms. BUG=chrome-os-partner:9676 BRANCH=link TEST=manual As much as can be tested with the current debug information: - Boot system with AC adapter in. Charge state machine should go to charging state. - Remove AC adapter. Charge state -> discharging. - Shut system down. - Plug AC adapter in. Charge state -> init -> charging over the course of a few seconds (NOT a minute). - Remove AC adapter. Charge state -> discharging. Really good testing requires a source-level change. Hack in a line of debug output above task_wait_event(sleep_next) in charge_state_machine_task() which prints how long the charge state machine is sleeping. It should sleep for ~250ms when charging, ~500ms when discharging and the system is on, or ~60000ms when discharging and the system is off. (I did this when writing this change, but removed it because it clutters up the debug console output.) Change-Id: I7d3e291fbc40bfcc67d1fb4982d91f0e6bf2e785 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/33921 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Rong Chang <rongchang@chromium.org>