summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch LPC to use HOOK_TICK instead of taskRandall Spangler2012-10-302-11/+8
| | | | | | | | | | | | BUG=chrome-os-partner:15714 BRANCH=none TEST=taskinfo no longer shows LPC task Change-Id: I693cc8695d89d0207076f12d82bdc1f30d5df7b7 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36910 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add tick taskRandall Spangler2012-10-3011-0/+34
| | | | | | | | | | | | | | | | | | | Adds a new HOOK_TICK event which is called every 250ms (LM4) or 500ms (STM32). This will be used to consolidate a number of tasks which do small amounts of work infrequently, and previously needed their own task functions. This CL adds the tick task; subsequent CLs will consolidate watchdog and other tasks into tick hooks. BUG=chrome-os-partner:15714 BRANCH=none TEST=taskinfo shows TICK task as lowest priority Change-Id: I9068ee99d56a5bf5c12afd86ad51998c013f4954 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36908 Reviewed-by: Simon Glass <sjg@chromium.org>
* Clean up power button moduleRandall Spangler2012-10-302-46/+76
| | | | | | | | | | | | | No functional changes BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system, power off with power button, power on with power button Change-Id: I25aa5c527b7b9f9db6f5c539cecb37ac4bc197f8 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36820 Reviewed-by: Simon Glass <sjg@chromium.org>
* Disable scratchpad commandRandall Spangler2012-10-301-3/+2
| | | | | | | | | | | | | We don't use/need it right now, so reduce code size. BUG=chrome-os-partner:15579 BRANCH=none TEST=help; should not see scratchpad in list Change-Id: I7918882eee02d8c440c58a3ac6cba80acc3d2ac1 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36803 Reviewed-by: Simon Glass <sjg@chromium.org>
* Clean up ADC moduleRandall Spangler2012-10-307-104/+96
| | | | | | | | | | | | | | ADC config structs are now chip-specific; this saves code size (several hundred bytes on LM4, since no need for 24-entry ADC channel to GPIO mapping table). BUG=chrome-os-partner:15579 BRANCH=none TEST='adc' with system on and off; ChargerCurrent should be bigger when on. Change-Id: Ia88b3f043438bec049f2d2ad39fc42dcf86d9424 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36798
* Use SECOND and MSEC constantsRandall Spangler2012-10-2933-211/+231
| | | | | | | | | | | | | | | | | | We'd defined them in a number of different files. This moves definitions to timer.h, and uses them everywhere we have large delays (since 10*SECOND is less typo-prone than 10000000). Also add msleep() and sleep() inline functions. No need for mdelay() or delay(), since any delays that long should use sleep funcs instead of spin-waiting. BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system; taskinfo displays similar numbers to before Change-Id: I2a92a9f10f46b6b7b6571759b1f8ab4ecfbf8259 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36726
* Clean up core routines - cpu, task, watchdogRandall Spangler2012-10-294-130/+185
| | | | | | | | | | | | No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system Change-Id: I55cf9c60e92177fd441614a8f9fce2d3acca3d0e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36706
* Rename POWERSTATE task to CHARGERRandall Spangler2012-10-295-5/+5
| | | | | | | | | | | | | Since POWERSTATE is confusing whether it refers to battery power or system power. BUG=chrome-os-partner:15579 BRANCH=none TEST=taskinfo; see CHARGER task Change-Id: I5a237b1329cace4ce48ae39d8954c08a9912ed4b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36707
* Consolidate emergency debug outputRandall Spangler2012-10-297-182/+79
| | | | | | | | | | | | | | | | | | | This removes the duplicate uart_emergency_printf() vs. panic_printf() / uart_emergency_puts() vs. panic_puts() implementation and saves ~0.5kb of code size. The other significant change is that uart_flush_output() is now smart enough to determine if it's in an interrupt; if so, it will spin-flush the output buffer instead of waiting on the uart interrupt. This removes the need for a separate panic_flush(). BUG=chrome-os-partner:15579 BRANCH=none TEST=crash unaligned; should print well-formatted crash dump Change-Id: Ifae756203dd1881806be563308077c1d68302e1f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36695
* Clean up thermal modulesRandall Spangler2012-10-268-153/+136
| | | | | | | | | | | | No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST='temps' should print good temperatures Change-Id: I20bd2376b86f1e9d2f9a91016ed90bb933235021 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36611
* Clean up x86power moduleRandall Spangler2012-10-262-48/+43
| | | | | | | | | | | | | Code cleanup; no functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system to OS; should still boot Change-Id: Icbb628e60792cbecd073a526cd6f879d9e4b20ab Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36692 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Clean up a few modules in common/Randall Spangler2012-10-264-30/+43
| | | | | | | | | | | | | Just code cleanup; no functional changes BUG=chrome-os-partner:15579 BRANCH=none TEST=build link and snow Change-Id: Ib62f805777994b39cd9f47a721f52529bb9399c5 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36573 Reviewed-by: Simon Glass <sjg@chromium.org>
* Clean up uart buffering codeRandall Spangler2012-10-264-98/+53
| | | | | | | | | | | | | No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=help version -> prints help on version command Change-Id: I79c4b668513b6037aa6cf3fa1a2a8c0fc9856f41 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36612 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Clean up USB charging moduleRandall Spangler2012-10-262-19/+17
| | | | | | | | | | | | | No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=plug in USB mouse; is powered when system is on Change-Id: Icbad3035f384191daa2b6dfae61d78f18ece1d76 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36613 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Clean up pwm moduleRandall Spangler2012-10-254-118/+123
| | | | | | | | | | | | | No functional changes. But hey, I'm having lots of fun reformatting comments. BUG=chrome-os-partner:15579 BRANCH=none TEST=fanset -1; fanset 0; fanset 4000 Change-Id: Iddcea5b8e59fa6668cdd347b6d31155c28991521 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36585 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Clean up vboot hash supportRandall Spangler2012-10-257-49/+254
| | | | | | | | | | | | | | | | | | This copies the parts of sha256.c that we need from vboot_reference, and removes the explicit dependency on vboot_reference. That dependency was a good idea when we were doing full verified boot in the EC, but is now overkill and makes it harder for others to reuse the EC code. This also lets us call EC functions directly instead of needing vboot_stub.cc; that reduces code size by ~100 bytes. BUG=chrome-os-partner:15579 BRANCH=none TEST=vboot_hash ro, then compare with result of sha256sum build/link/ec.RO.flat Change-Id: I0f236174291df3e7f3c75e960fe9ab32af305a61 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36589 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Clean up system moduleRandall Spangler2012-10-254-95/+145
| | | | | | | | | | | | | | No functional changes. (it might look like SYSTEM_HIB_MINIMUM_DURATION is a change, but it's not used at present) BUG=chrome-os-partner:15579 BRANCH=none TEST=version; chip info should print successfully Change-Id: Idd7f60a29528e9f6af4f91cd5a556e7336acee9f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36599 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Clean up LED and onewire modulesRandall Spangler2012-10-255-61/+111
| | | | | | | | | | | | | No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=powerled red, then powerled green Change-Id: I595b725c14d94133f7f151d0b92cabe0e0bcf4ca Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36577 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Clean up printf moduleRandall Spangler2012-10-252-18/+41
| | | | | | | | | | | | | No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system; debug output still shows up on EC console Change-Id: I63f4f9481f5393aaff065b37a274236bd78622d9 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36581 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Clean up I2C moduleRandall Spangler2012-10-252-150/+149
| | | | | | | | | | | | | No functional changes, just cleanup BUG=chrome-os-partner:15579 BRANCH=none TEST=i2cscan; should find all expected devices Change-Id: I8e11d3fa460236e80a0ce1ee923e4413b3202c1e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36569 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Cleanup: flash moduleRandall Spangler2012-10-255-54/+73
| | | | | | | | | | | | | No functional changes; just clean up comments and remove dead code BUG=chrome-os-partner:15579 BRANCH=none TEST=code compiles Change-Id: Id006ae18f2b26cea1720196f696f937811b6ba5b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36448 Reviewed-by: Simon Glass <sjg@chromium.org>
* Clean up GPIO moduleRandall Spangler2012-10-256-103/+138
| | | | | | | | | | | | | Just code cleanup; no functional changes BUG=chrome-os-partner:15579 BRANCH=none TEST=build code; boot link; gpioget still works Change-Id: If0770c1a5ce0d5c51ba528fbe2944a73fafa949b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36556 Reviewed-by: Simon Glass <sjg@chromium.org>
* Clean up host command moduleRandall Spangler2012-10-251-39/+38
| | | | | | | | | | | | | Code cleanup only; no functional changes BUG=chrome-os-partner:15579 BRANCH=none TEST=ectool hello -> success Change-Id: I40391b66efaeab873e99500d4f58a5a779eb2c71 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36557 Reviewed-by: Simon Glass <sjg@chromium.org>
* Clean up fmap.cRandall Spangler2012-10-241-10/+16
| | | | | | | | | | | | | No functional changes; just reformatting. BUG=chrome-os-partner:15579 BRANCH=none TEST=compile code Change-Id: I6b775c835a935be845bc8aea3dd742af91ab2af7 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36455 Reviewed-by: Simon Glass <sjg@chromium.org>
* link: Don't force battery to request currentRandall Spangler2012-10-241-6/+2
| | | | | | | | | | | | | | | | | | Previously, the battery charging algorithm would give the battery current even when it was requesting 0 mA. BUG=chrome-os-partner:15573 BRANCH=link TEST=charge battery and leave AC plugged in Battery will eventually drop to 99% charged. At that point, it should request 0mA, not 84mA or 85mA. (When it drops farther, it will really start requesting charge.) Change-Id: I464a7c8e857c928dbb9f9595f9c947d565b5f5c6 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36526 Reviewed-by: Rong Chang <rongchang@chromium.org>
* Clean up console moduleRandall Spangler2012-10-243-52/+77
| | | | | | | | | | | | Code cleanup and reformatting. No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=compile code; type a debug command like 'help list'. Change-Id: I641215ba3333628f658eec86d9d99718c43b111f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36387
* Clean up charger codeRandall Spangler2012-10-242-83/+94
| | | | | | | | | | BUG=chrome-os-partner:15579 BRANCH=none TEST=discharge and charge battery; should still work Change-Id: I97033e5f5ff4289831f9a4400d18730ece3bd99a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36365
* Cleanup: battery_prechargeRandall Spangler2012-10-241-24/+38
| | | | | | | | | | | | Just code cleanup; no functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=code compiles Change-Id: I9610b7df4b6c621d0a1d5ca0513629ee21626ec4 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36364
* Cleanup: batteryRandall Spangler2012-10-242-54/+48
| | | | | | | | | | | | Tidy code. No functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=discharge battery, then plug AC in and make sure it charges Change-Id: I4cff018940ecb665be96655d6722f74dd6674f6d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36359
* Revert "lm4: Add chip name for lm4fs1gh5bbfig"Jon Salz2012-10-231-2/+0
| | | | | | | | | | This reverts commit db2c527d5cab61af399694cc853d1dfce1bbd3cd Change-Id: I033916921993bffc6a3c0d6bbb70a867b73b25a9 Reviewed-on: https://gerrit.chromium.org/gerrit/36414 Commit-Ready: Jon Salz <jsalz@chromium.org> Reviewed-by: Jon Salz <jsalz@chromium.org> Tested-by: Jon Salz <jsalz@chromium.org>
* Use CONFIG_TASK_VBOOTHASH instead of CONFIG_VBOOTRandall Spangler2012-10-235-16/+6
| | | | | | | | | | | | | | | This fixes build breaks in 'make tests'. BUG=none BRANCH=none TEST=make tests (note that this still fails due to other problems; will fix those in a followup CL) Change-Id: I5b5ce52ed6e44ade6051e0a091a6699c0454d61a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36353 Reviewed-by: Simon Glass <sjg@chromium.org>
* Clean up keyboard_scan moduleRandall Spangler2012-10-233-23/+7
| | | | | | | | | | | | | We only have one scan mask and no capability to change scan masks, so don't reserve space for masks we're not using. BUG=chrome-os-partner:15579 BRANCH=none TEST=type on keyboard; should still work Change-Id: I8ad0c5c894f93c2a79ca646e7666b3279c90a63c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36347
* Clean up i8042 moduleRandall Spangler2012-10-236-231/+162
| | | | | | | | | | | | | | | | | Remove unused code paths. Simplify interfaces. Clarify comments. Split the protocol constants into their own header file (since they're used only by keyboard.c, not i8042.c, which is really keyboard buffering... and will be renamed so in a followup CL.) This cleanup reduces binary size by about 200 bytes. BUG=chrome-os-partner:15579 BRANCH=none TEST=type on the keyboard; it should still work. Change-Id: I6acbab5fe5604b4b0c516ba3622e6f41820985d1 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36271
* Hook functions no longer return valuesRandall Spangler2012-10-2335-243/+134
| | | | | | | | | | | | | | | Previously, all hook functions returned EC_SUCCESS, which was meaningless because nothing ever looked at the return value. Changing the return value to void saves ~100 bytes of code size and an equal amount of source code size. BUG=none BRANCH=none TEST=code still builds; link still boots Change-Id: I2a636339894e5a804831244967a9c9d134df7d13 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36372
* 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>
* lm4: Add chip name for lm4fs1gh5bbfigVic Yang2012-10-221-0/+2
| | | | | | | | | | BUG=chrome-os-partner:15519 TEST=none BRANCH=link Change-Id: I00c27eab4320a95b17c4f18572835fea1fb8cdf7 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36307
* lm4: Report raw DID value when chip name cannot be determinedVic Yang2012-10-221-1/+26
| | | | | | | | | | | | | | | | | We map the raw DID value to chip name in EC. If the raw value is not in the mapping table, EC just returns empty string and we lose this information from host side. Let's return raw DID value like "Unknown-10ea". BUG=chrome-os-partner:15519 TEST=remove 0x10ea from the mapping and check 'mosys -k ec info' shows 'Unknown-10ea'. BRANCH=link Change-Id: I9399f44ab40db02202ee03ba3f988f3ece010d9f Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36305 Reviewed-by: David Hendricks <dhendrix@chromium.org>
* Fix help message for ectoolRandall Spangler2012-10-221-1/+1
| | | | | | | | | | | | | | Not all of the options for reboot_ec were listed. This fixes the text; there are no code changes. BUG=none BRANCH=none TEST=run ectool with no options to print help Change-Id: I65275a007febbd3583f157cc7f8df5634d6eeeda Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36257 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Host commands use correct console channelRandall Spangler2012-10-181-2/+2
| | | | | | | | | | | | | | | | | Previously they reported on the system channel, not the hostcmd channel. BUG=none BRANCH=none (affects all platforms, but only affects use of 'chan' ec console command) TEST=manual - chan 0x40 - x86reset - should see HC debug output. Change-Id: Ie9873db015c94a0198a94ebafad87d51b0f73620 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35953 Reviewed-by: Simon Glass <sjg@chromium.org>
* cleanup: TMP006 constants should be staticRandall Spangler2012-10-181-6/+6
| | | | | | | | | | | BUG=none BRANCH=none TEST=code still builds; this is code cleanup with nothing to test Change-Id: Ibce47a67c8af51c214bb1ef5e31e9afdd8d2dfd3 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35964 Reviewed-by: Simon Glass <sjg@chromium.org>
* link: Fix checking runtime keysRandall Spangler2012-10-181-2/+3
| | | | | | | | | | | | | | | | | This accidentally got disabled when printing keyboard scan state was turned off by default. BUG=chrome-os-partner:15466 BRANCH=link TEST=alt+volup+R should reboot system Then from console, ksstate on Then press keys; KB state should print on console Change-Id: I7d410b56210fda0c73c65d9d76ccc7b4e873516c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35971 Reviewed-by: Simon Glass <sjg@chromium.org>
* link: Increase EC cold reboot time to 150msRandall Spangler2012-10-181-1/+1
| | | | | | | | | | | | | | | | This matches Silego's recommendation as of 10/18. BUG=chrome-os-partner:14687 BRANCH=link TEST='reboot cold' repeatedly from EC console (or 'ectool reboot_ec cold' repeatedly from root shell), then check that Power+Esc still reboots the system. Change-Id: Ief2962bf66a947e83dfe934e45e18dc37d6ba326 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35968 Reviewed-by: Simon Glass <sjg@chromium.org>
* link: host command params must be 32-bit alignedRandall Spangler2012-10-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a problem where flash writes would fail because the source buffer was not 32-bit aligned. BUG=chrome-os-partner:15435 BRANCH=link TEST=from a root shell, localhost ~ # echo 1234567812345678123456781234567 > /tmp/data localhost ~ # ls -l /tmp/data -rw-r--r-- 1 root root 32 Oct 17 17:28 /tmp/data localhost ~ # ectool flasherase 0x3a000 0x4000 Erasing 16384 bytes at offset 237568... done. localhost ~ # ectool flashwrite 0x3a000 /tmp/data Reading 32 bytes from /tmp/data... Writing to offset 237568... done. If that doesn't crash, the fix works (prior to this fix, that would reboot the system). Change-Id: I8d197e7ef7a1c74825916bd788f7d450088a55cc Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35916 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* link: Don't print keyboard state changes by defaultRandall Spangler2012-10-171-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The keyboard scan module generates a lot of debug output when the user is typing on the keyboard - enough so that switching to the console, logging in as root, and typing 'ectool console' flushes the EC's console output buffer of any useful data. Default printing this to off. Add a new 'ksstate' command which will print the current keyboard scan state or toggle printing off/on. This is important for debugging LPC communication failures. BUG=chrome-os-partner:13819 BRANCH=link TEST=manual - Boot system - Type on keyboard. At EC console, should not see KB state: output - Hold down space bar. - At EC console, type 'ksstate'. Should print: ksstate [20.943886 KB debounced : -- -- -- -- -- -- -- -- -- -- -- 20 --] [20.945215 KB prev : -- -- -- -- -- -- -- -- -- -- -- 20 --] [20.945568 KB debouncing: -- -- -- -- -- -- -- -- -- -- -- -- --] Keyboard scan state printing off - Release space bar - At EC console, type 'ksstate on' - Type on keyboard. Should see KB state: output - At EC console, type 'ksstate off' - Type on keyboard. At EC console, should not see KB state: output Change-Id: I4343b7b777fd13057b3222eeba77ed099c5e5a93 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35843 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* link: don't rely on host-write interrupt statusRandall Spangler2012-10-172-36/+56
| | | | | | | | | | | | | | | | | | | | | | | | This works around a potential LM4 chip problem where edges on the FRMH status bit don't always trigger interrupts. The workaround is to look at FRMH for each channel in the interrupt handler rather than the interrupt status, and to trigger the interrupt every 250ms to sweep up any missed writes. We already do this for port 80 writes; this just extends the workaround to all channels. BUG=chrome-os-partner:13965 BRANCH=link TEST=manual - boot system - EC console should show a number of HC lines for host command - EC console should show a number of ACPI queries - switch to root shell; keyboard should work - ectool version should work Change-Id: If02d685519c69ee88c055c8374a6c655a277e637 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35871 Reviewed-by: Simon Glass <sjg@chromium.org>
* stm32: Swallow special keys instead of passing them to APSimon Glass2012-10-171-5/+10
| | | | | | | | | | | | | | | | | | | During the debounce refactor we unintentionally adjusted the behavior of special keys so that they are no longer swallowed (as per commit 9332d76). The LM4's keyboard behaves differently so this code cannot be brought over as is. Bring back the required behavior for STM32. BUG=chrome-os-partner:14496 TEST=hit alt-volume_up-r keys together. See that the AP does not see this keypress in U-Boot by checking the EC console has no 0x60 messages. BRANCH=snow Change-Id: I043fbba4d9be5941e550257b99bdb2137792c133 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35767 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Make S3 red-light flash adjustable.Bill Richardson2012-10-173-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the timing for the S3 low-power indicator adjustable without reflashing. BUG=chrome-os-partner:8039 BRANCH=Link TEST=manual Boot, log in, run this to put the lightbar into demo mode: ectool lightbar demo 1 ectool lightbar seq s3s0 The lightbar should act as though the system is asleep. Then press the left arrow a couple of times and the down-arrow four or five times. You should see the red light pulse every 5 seconds or so. Now run ectool lightbar params > /tmp/w Edit /tmp/w to change the timing lines to this: 100 # .s3_ramp_up 100 # .s3_ramp_down Then run ectool lightbar params /tmp/w After a cycle or two, you should see the lightbar flash instead of pulse. Change-Id: If815ff2fb9a158c0e1f4dbb6a269ad07e122d84c Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35839 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Fix delay loop for battery detectingVic Yang2012-10-171-3/+1
| | | | | | | | | | | | | | | | | The charging voltage and current are not necessary zero. Remove the conditions. BUG=chrome-os-partner:14094 TEST=Remove the battery with AC connected. LED turns red after 30 seconds. Plug in AC with battery disconnected. LED turns red after 30 seconds. BRANCH=link Change-Id: I754383b05af6de0ceeb706612f1cb534254e47e3 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35807 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Rong Chang <rongchang@chromium.org>
* Finally final lightbar tweaks. Really. I think...Bill Richardson2012-10-161-17/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is hopefully the finally final tweak to the lightbar behavior. It does this: * When booting or awakening from sleep, Google colors pulse briefly. * When the chromebook is fully on, lightbar is dim blue. Every 3-5 seconds, a pulse of brighter blue sweeps across. * On battery, the lightbar is not quite as bright, and the sweep goes in the other direction and is slightly slower. If the battery charge drops below 10%, the lightbar changes from blue to red (but only on battery, not AC). * When going to sleep (close lid while logged in), lightbar fades to black, then pulses Google colors, then off. * While asleep, lightbar does nothing, UNLESS on battery and battery charge is under 10%. Then it pulses red every 5-8 seconds. * When shutting off, it just goes black with no special effects. Other than the slight dimming on battery power, there is no ambient light or dynamic brightness control. BUG=chrome-os-partner:8039 BRANCH=Link TEST=manual Turn it on, watch the blinky lights. Log in, close the lid, open the lid. Connect/disconnect AC. The lights should change as described above. Ta Da. Change-Id: Id174a452639decc4b5eefb9e21b28cf3643529f5 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/35742 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* link: increase time in hibernate for EC cold resetRandall Spangler2012-10-161-2/+10
| | | | | | | | | | | | | | | This works around a problem where the Silego chip doesn't cleanly reset for short hibernate durations. BUG=chrome-os-partner:14687 BRANCH=link TEST=ectool reboot_ec cold (~100 times), then check if power+refresh still reboots the system Change-Id: I14098940da9331856dd061a56a60a47c9a1cf1f8 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/34832 Reviewed-by: Bill Richardson <wfrichar@chromium.org>