summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Add x86shutdown console commandRandall Spangler2012-06-291-50/+94
| | | | | | | | | | | | | | | Now that the EC powers on the AP unconditionally on startup, we need a way to quickly shut the AP down if it's running without a heatsink. (Also cleaned up comments and line spacing to kernel style) BUG=none TEST=boot system; when x86 is booting, type 'x86shutdown'. Change-Id: I4dd5a2d5d27b624d0d0f9228baac257587b4808a Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26274 Reviewed-by: Simon Glass <sjg@chromium.org>
* Include board and config headers in common.hRandall Spangler2012-06-291-0/+9
| | | | | | | | | | | | This ensures they get included everywhere, and fixes a common bug where we forget one of them and then code which is supposed to be BUG=none TEST=build the code Change-Id: Ic9208f946a3aea4b0b08f546f1919602befa76d4 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26365
* dma: Deprecate dma_start_tx() in favor of dma_prepare_tx()Simon Glass2012-06-292-11/+21
| | | | | | | | | | | | This allows us to prepare a dma transaction in advance, and quickly start it when needed. BUG=chrome-os-partner:10533 TEST=build and boot on snow Change-Id: Ib7d843b2d3a5cd94b6025b9741db1794ebbcfda0 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26449
* Fix a bug in battery temperature cut offVic Yang2012-06-281-1/+2
| | | | | | | | | | | | | When battery temperature is too low, charging should be paused. BUG=none TEST=none Change-Id: I0de87143f5da810cee70c14ee3c52614b5cf3d3b Reviewed-on: https://gerrit.chromium.org/gerrit/26380 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org>
* Revert "dma: Deprecate dma_start_tx() in favor of dma_prepare_tx()"davidjames2012-06-282-22/+11
| | | | | | | | | | | | | | | This reverts commit 7af4172be4afad9d576549721a82b3a47d701647 / Iac605b879b3556f33af5585b298ada6bc4f52c90. This change bypassed the commit queue and broke daisy as a result. BUG=chrome-os-partner:10533 TEST=build and boot on snow Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I7a05ab42f71a901d167bde977f8a025c7ef62dfc Reviewed-on: https://gerrit.chromium.org/gerrit/26379 Reviewed-by: David James <davidjames@chromium.org> Tested-by: David James <davidjames@chromium.org>
* dma: Deprecate dma_start_tx() in favor of dma_prepare_tx()Simon Glass2012-06-282-11/+22
| | | | | | | | | | | | | | | | This allows us to prepare a dma transaction in advance, and quickly start it when needed. BUG=chrome-os-partner:10533 TEST=build and boot on snow Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Iac605b879b3556f33af5585b298ada6bc4f52c90 Reviewed-on: https://gerrit.chromium.org/gerrit/26166 Reviewed-by: David Hendricks <dhendrix@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Commit-Ready: Simon Glass <sjg@chromium.org>
* Use __packed instead of __attribute__((packed))Randall Spangler2012-06-284-55/+66
| | | | | | | | | | | The presubmit script for linux kernel style prefers the former. BUG=none TEST=none Change-Id: I0a0a1eb039f45975ada075c1302d868071a7cfb1 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26361
* dma: Adjust prepare_channel() to use a channel pointerSimon Glass2012-06-281-15/+16
| | | | | | | | | | | | | Rather than a channel number, use a pointer. Also we don't need a return value, since this function cannot fail. BUG=chrome-os-partner:10533 TEST=build and boot on snow Change-Id: I9d7e567a9f3d496184fd28f0820ad798b1c43a28 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26165 Reviewed-by: David Hendricks <dhendrix@chromium.org>
* dma: Export dma_get_channel()Simon Glass2012-06-282-11/+13
| | | | | | | | | | | | | | | | | | Access to dma is currently via a channel number. It is more efficient to export a pointer to the dma channel since it avoids the conversion on every API call. This helps, because dma is often on the critical path. Export the function to provide a pointer to a dma channel given its number. BUG=chrome-os-parter:10533 TEST=manual: build for all boards Change-Id: I0318e59dbb1b9077f0445804692ca7ea99cf6581 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26164 Reviewed-by: David Hendricks <dhendrix@chromium.org>
* Add time_since32() to return microseconds since a start timeSimon Glass2012-06-281-0/+17
| | | | | | | | | | | | | | | | | | | | | | It is useful to implement timeouts like this: start = get_time(); while (time_since32(start) < 1000) ... Add a function to make this easy. Note that for efficiency we only support a 32-bit return value which limits the timeouts to about an hour. BUG=chrome-os-partner:10888 TEST=manual: build for all boards boot on snow Change-Id: I200cb04f5a76b4c76a9bc314d927e4bab1f08a56 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26289 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add flash_link_ro command to openocdRandall Spangler2012-06-281-0/+4
| | | | | | | | | | | | | This is ~4x as fast as flashing the entire EC image, and is similar to the existing flash_link_a command. BUG=none TEST=from openocd prompt, flash_link_ro Change-Id: I04160af3d7d70028f8d2789480094c283a1ce2ab Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26268 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* i2c: Tidy up common code for i2c masterSimon Glass2012-06-281-48/+37
| | | | | | | | | | | | | | At present there is quite a bit of duplicated code. Create a new i2c_transfer() function to take care of this. BUG=chrome-os-partner:10888 TEST=manual: build for all boards boot on snow (cannot test i2c as it is broken) Change-Id: I3672cc4ff9de4e2e0deaec2997590ee892ef09aa Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26140
* stm32: Use SPI ports for i2c arbitrationSimon Glass2012-06-284-17/+6
| | | | | | | | | | | | | | | We plan to use two of the SPI ports (NSS and MISO) for arbitration on the i2c host interface. In preparation for this, add the extra GPIO to the table, and change NSS to a pull-up. BUG=chrome-os-partner:10888 TEST=manual: build for all boards boot on snow Change-Id: I70962b25f371a4ca54f0ce67dcf0bc33b1cc8c47 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26139
* Do not trickle charge when battery ask for no currentVic Yang2012-06-281-1/+2
| | | | | | | | | | | | | | When battery ask for no current, we should go back to init state to determine what to do next. BUG=chrome-os-partner:10946 TEST=none Change-Id: Idf3ac7554a0774655138c5efe9c5e6de7f6cb7a0 Reviewed-on: https://gerrit.chromium.org/gerrit/26310 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org>
* Fix a bug of temperature unit mismatchVic Yang2012-06-271-2/+2
| | | | | | | | | | | | | | We set battery temperature limit in deci-Kelvin but use them as Celsius. Let's fix this so that battery is cut off correctly. BUG=chrome-os-partner:10942 TEST=none Change-Id: I2320b5e9f19ccc17f0cec7664133544c25a745f8 Reviewed-on: https://gerrit.chromium.org/gerrit/26302 Reviewed-by: Rong Chang <rongchang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org>
* Add an option flag to intentionally shift binary codeVic Yang2012-06-271-0/+4
| | | | | | | | | | | | | | | | We need a simple way to build an EC image that is binary-wise much different from the original one, so that we can test EC update as much thoroughly as possible. By padding useless space, we can have an image with exactly same functionality but binary-wise different. BUG=chrome-os-partner:10264 TEST=Build and run without error. Change-Id: I070bec7cec71db1662238ca6af10e864c82ba428 Reviewed-on: https://gerrit.chromium.org/gerrit/26083 Reviewed-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com> Tested-by: Vic Yang <victoryang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org>
* Stub smart battery read/write functionsVic Yang2012-06-274-14/+46
| | | | | | | | | | | | | | For better testability, let's move smart battery read/write functions to a stub so that we can easily mock them. BUG=chrome-os-partner:10270 TEST=build success Change-Id: I416580c6dc7911e376bc232e5f0560117d9353c2 Reviewed-on: https://gerrit.chromium.org/gerrit/26227 Reviewed-by: Rong Chang <rongchang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* Add a test of keyboard debouncingVic Yang2012-06-273-1/+132
| | | | | | | | | | | | | This test checks keyboard debouncing works correctly. BUG=chrome-os-partner:10284 TEST=Test passed Change-Id: I0c984ecc9444b149da580ff0775cc81245b21a1e Reviewed-on: https://gerrit.chromium.org/gerrit/26021 Commit-Ready: Vic Yang <victoryang@chromium.org> Reviewed-by: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* Add a test of keyboard typematicVic Yang2012-06-273-1/+97
| | | | | | | | | | | | | | This test checks when holding down a key for different length, typematic works correctly. BUG=chrome-os-partner:10287 TEST=Test passed. Change-Id: I401db73098a98dc3367cedde31f8ec1c5d5f047b Reviewed-on: https://gerrit.chromium.org/gerrit/26086 Commit-Ready: Vic Yang <victoryang@chromium.org> Reviewed-by: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* Add a test of i8042 scancode setVic Yang2012-06-274-2/+64
| | | | | | | | | | | | | | This test check correct scan code is sent when I8042_XLATE is enabled or disabled. BUG=chrome-os-partner:10286 TEST=Test passed Change-Id: I939963cbecddb22506e64cb374667c7c2e5b4f8b Reviewed-on: https://gerrit.chromium.org/gerrit/26096 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* stm32: fix race condition in I2C responseVincent Palatin2012-06-261-20/+25
| | | | | | | | | | | | | | | | | | When we are transmitting a response to the EC, we don't want to race with the TX empty interrupt handler. So just disable I2C interrupt during the transmission. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=on Lucas DVT, use the keyboard and see we are no longer getting "bad checksum" in the kernel log. Change-Id: Ic59532d1ac0a3eabb67ba0d498940986282bd87f Reviewed-on: https://gerrit.chromium.org/gerrit/26162 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
* stm32: fix I2C waveforms and statesVincent Palatin2012-06-261-7/+17
| | | | | | | | | | | | | | | | | | | | - most events happen in the first 100us, we don't want to sleep to 2ms. This introduces big delays. Just poll the 150us, then fall back to sleep. - restore properly the port state after master transfers. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=On Lucas DVT, probe I2C signals with logic analyzer and manually check them. Verify that the keyboard is still working with the charging code enabled. Change-Id: Ic0afde081d070ff6720d924469ecc7166bbc9e4c Reviewed-on: https://gerrit.chromium.org/gerrit/26161 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
* stm32mon: set flash_size to 128KB for chip ID 0x420David Hendricks2012-06-261-1/+1
| | | | | | | | | | | | | | | | | This updates the flash_size to match 128KB parts. Unfortunately there does not seem to be an easy way to differentiate between the 64KB and 128KB parts at runtime. BUG=none TEST=tested on Snow Signed-off-by: David Hendricks <dhendrix@chromium.org> Change-Id: Ie1ca6f6d04753e91d937f67dec193fcf5566251e Reviewed-on: https://gerrit.chromium.org/gerrit/26188 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: David Hendricks <dhendrix@chromium.org> Tested-by: David Hendricks <dhendrix@chromium.org>
* tpschrome: skip bad I2C readVincent Palatin2012-06-262-5/+7
| | | | | | | | | | | | | | | | | | | When an I2C read fails, we don't want to switch off the system or even print verbose warnings. Indeed, we are failing all I2C reads and writes to the charger and battery when they are on the same bus as the AP and the AP is ON. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:9724 TEST=on Lucas DVT, run the system and see we have no spurious switch off or verbose EC traces. Change-Id: Ieb2f7836c70a0d2ad2c4a0f775aa190ce81a6932 Reviewed-on: https://gerrit.chromium.org/gerrit/26064 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
* TPSChrome charging loopRong Chang2012-06-266-110/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change contains a basic charging loop that follows Chromium battery charging flow. The temperature range constants, loop delay time will be move to battery pack later. Signed-off-by: Rong Chang <rongchang@chromium.org> BUG=chrome-os-partner:9724,9757,9759 TEST=manual, uart console Plug AC adapter: > pmu event: 0000000000001110 [batt] state discharging -> idle [batt] state idle -> charging > battery I: 0x04fd = 1277 mA(CHG)a Unplug AC adapter: > pmu event: 0000000000000110 [batt] state charging -> idle [batt] state idle -> discharging > battery I: 0xffcb = -53 mA(DISCHG) Change-Id: Ifed594d78c0ed08c5e4821a9c8581c1a87526729 Reviewed-on: https://gerrit.chromium.org/gerrit/25618 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
* flash-stm32f100: Fix unaligned castSimon Glass2012-06-261-6/+2
| | | | | | | | | | | | | | | There isn't a good reason for doing things this way, so tidy up the code and remove the TODO. BUG=chrome-os-partner:10533 TEST=manual: build and boot on snow Test writing of flash still works using U-Boot command Change-Id: I66a8f16072dc28f24c493af7674f7be5d838529c Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26163 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Power on AP every EC reboot.Randall Spangler2012-06-261-57/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needed for EC software sync so the AP can verify the EC's RW code and tell the EC to jump to RW when necessary. If the AP then decides it doesn't need to stay booted, the AP can shut back down. (The AP verifying the EC's code and/or shutting back down are NOT part of this CL...) Also add a Power+Refresh+DownArrow key combination which causes the EC to reset WITHOUT powering on the AP; this will be needed for debugging the AP power-on sequence. BUG=chrome-os-partner:10892 TEST=manual 1) power+refresh+down -> ec reboots, system stays down 2) power+refresh+esc -> ec reboots, system to recovery 3) power+refresh -> ec reboots, system boots 4) hibernate, then open lid -> ec reboots, system boots 5) hibernate, then power button -> ec reboots, system boots 6) yank battery, then reconnect -> ec reboots, system boots 7) reboot ec -> system boots 8) 'sysjump A' when AP already booted -> system stays on 9) 'sysjump A' when AP shut down -> system boots Change-Id: I65d2f7d9cca3acb84b76302cdcd8c8a800f03253 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26158
* Only check for boot key on the first boot after keyboard resetRandall Spangler2012-06-261-1/+2
| | | | | | | | | | | | | | | | Don't check if we've jumped to this image (which preserves the reboot reason, so was causing us to re-check). BUG=chrome-os-partner:10890 TEST=manual 1) power+refresh; should see EC print [KB boot key 0] 2) sysjump A; should NOT see [KB boot key 0] Change-Id: I46cc60358e1d1952484f52147787fee06e4ff69f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26155 Reviewed-by: Simon Glass <sjg@chromium.org>
* Refactor boot key detectionRandall Spangler2012-06-265-101/+143
| | | | | | | | | | | | | | | | | | | | | Keyboard scan module now owns the recovery key state on all platforms. And clean up a few comments to linux kernel style BUG=chrome-os-partner:10890 TEST=manual - Power on system. Should boot normally. - Power+Refresh+D. Should turn dev switch on. - Power+Refresh+F. Should turn dev switch off. - Power+Esc. Should reboot system. Power button should power on normally. - Power+Refresh+Esc. Should power on into recovery mode. - Then press power to shut system down. - Power button should power on normally (not back into recovery mode). Change-Id: I4d16e1e8b039efeacbd41e8acec115844bc8457d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/26147 Reviewed-by: Simon Glass <sjg@chromium.org>
* Only one RW image is now the defaultRandall Spangler2012-06-2613-30/+58
| | | | | | | | | | | | And if RW B isn't enabled, it's not even linked. BUG=chrome-os-partner:10881 TEST=on link, should be no B image, and 'sysjump B' should fail On BDS, still should be A and B images Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: Icb2af07881cc7e28b9b877f45824486a22fde8d7 Reviewed-on: https://gerrit.chromium.org/gerrit/26116
* Strip out vboot signature code and stay in RO for linkRandall Spangler2012-06-269-223/+265
| | | | | | | | | | | | | | BUG=chrome-os-partner:10880 TEST=boot EC; should stay in RO and not do signature check (verify via debug console output) Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I831aa91f8273bc7fb1a624cf36d9f21d52d8f3d8 Reviewed-on: https://gerrit.chromium.org/gerrit/26115 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Randall Spangler <rspangler@chromium.org>
* fix panic serial codeVincent Palatin2012-06-251-2/+1
| | | | | | | | | | | | | | | | | panic_putc was doing an infinite loop on platforms with a UART FIFO. (e.g. LM4F) Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:10825 TEST=on Link EVT and Lucas DVT, type "rw 1" in the EC serial console and see the panic trace. Change-Id: I47f43183e6e938b88874c80244430ddf88c5a567 Reviewed-on: https://gerrit.chromium.org/gerrit/26052 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
* Add hash supportRandall Spangler2012-06-257-4/+478
| | | | | | | | | | | | | | | | | | | | | | EC computes a SHA-256 hash of its RW code on boot. Also adds host and console commands to tell the EC to recompute the hash, or hash a different section of flash memory. BUG=chrome-os-partner:10777 TEST=manual 1) ectool echash -> should match what the EC precomputed 2a) ectool echash recalc 0 0x10000 5 2b) on EC console, 'hash 0 0x10000 5' 2c) results should agree 3a) on ec console, 'hash 0 0x3e000' then quickly 'hash abort' 3b) ectool echash -> status should be unavailable 4) ectool echash start 0 0x3e000 6 && ectool echash && ectool echash abort && sleep 2 && ectool echash status should be busy, then unavailable Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I6806d7b4d4dca3a74f476092551b4dba875d558e Reviewed-on: https://gerrit.chromium.org/gerrit/26023
* Shut off keyboard backlight at chipset shutdownRandall Spangler2012-06-251-26/+26
| | | | | | | | | | | | | | | | | | | | This ensures the keyboard backlight will go off even if the chipset shuts down due to overheating (or some other unclean shutdown). (Also fixes inter-function line spacing to linux kernel coding style and reformats a few comments.) BUG=chrome-os-partner:10718 TEST=manual 1. power on system 2. turn on keyboard backlight (kblight 100 at EC console) 3. power off system (for example, via power button) 4. keyboard backlight should turn off Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I5bbcd1681ae9c972c9875e9c720617bdf51e3d64 Reviewed-on: https://gerrit.chromium.org/gerrit/26039
* Remove proto1 workaroundsRandall Spangler2012-06-255-68/+16
| | | | | | | | | | | | | | | | | | | | | | | At this point, EC code requires EVT. If you still have a proto1, here's what'll break: 1) Keyboard recovery mode checks refresh key, and may read unreliably due to proto1 silego reset circuit. 2) Lightbar may not start in the correct state. 3) EC 'hibernate' command will not work. 4) Board version may read incorrectly. BUG=chrome-os-partner:9661 TEST=manual 1) powerbtn -> system powers on, lightbar displays proper sequence 2) version -> board version 1 (EVT) 3) power+refresh+esc -> system boots into recovery mode 4) power+refresh, then power button -> system reboots, then boots normally Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I699946e365d15ae38622b69da1a0241e72d05f61 Reviewed-on: https://gerrit.chromium.org/gerrit/26053 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Align .data section in flashVincent Palatin2012-06-251-0/+1
| | | | | | | | | | | | | | | | | | When copying .data section from flash to internal RAM at startup, we assume the content of the section is aligned on a word size in flash. Force the alignment in the linker file. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:10823 TEST=on Link EVT, type "sysjump RO" in EC console and see you are jumping to RO partition and not getting a watchdog reset. Change-Id: I1a1387ef8bff01d287d85ee2a660811c9e4620c6 Reviewed-on: https://gerrit.chromium.org/gerrit/26032 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
* Add a test of checking keyboard de-ghostingVic Yang2012-06-254-1/+205
| | | | | | | | | | | | | This test check when a ghost key appears, it is correctly ignored. BUG=chrome-os-partner:10285 TEST=Test passed. Change-Id: Ic5a6a9b5c78a969899df7c7a82f1c9d0c01b1325 Reviewed-on: https://gerrit.chromium.org/gerrit/25831 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org>
* Fix unit test compilation errorVic Yang2012-06-251-0/+7
| | | | | | | | | | | | | | | A host command to set fan duty cycle is recently added and mock PWM module doesn't provide the implementation. This breaks our unit test. Let's fix this. BUG=chrome-os-partner:10820 TEST='thermal' unit test passed. Change-Id: I8644742cfec7d2112d7ff1e266b5ac3429c46945 Reviewed-on: https://gerrit.chromium.org/gerrit/26019 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* Add a test of checking power button handlingVic Yang2012-06-257-0/+436
| | | | | | | | | | | | | | | This test checks power button is correctly debounced, and also check power button press of different length are handled correctly. BUG=chrome-os-partner:10273 TEST=Test passed Change-Id: I18595c60896255d36326731d28bab55e64c6bca2 Reviewed-on: https://gerrit.chromium.org/gerrit/25505 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org>
* Thermal engine unit testVic Yang2012-06-257-1/+388
| | | | | | | | | | | | | | | This test checks for the functionality of thermal engine. BUG=chrome-os-partner:10241 TEST=Test passed Disable thermal engine overheating warning and test failed Change-Id: Ideb0ff9ee4bd1617b11c56dfa2578a3f406381ff Reviewed-on: https://gerrit.chromium.org/gerrit/25370 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org>
* Add 'fanduty' command both EC console and ectool.Bill Richardson2012-06-226-21/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This forces the fan PWM duty cycle to a fixed percentage (0-100). It's only used for airflow testing. BUG=chrome-os-partner:10747 TEST=manual Using this ectool, try ectool fanduty 0 ectool pwmgetfanrpm ectool fanduty 50 ectool pwmgetfanrpm ectool fanduty 100 ectool pwmgetfanrpm You should see (and hear) the fan speed up. If you have an EC console, you can run faninfo and it should show that the 'Target:' is unrelated to the 'Actual:' value. Change-Id: Iac332fb3ba63f96726cf7f64061b3ce22d2e76fd Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/25965 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* link: update VR settingsVincent Palatin2012-06-221-2/+2
| | | | | | | | | | | | | | | | | | Update a couple of IR3571 settings : - remove the PS override bit which is a leftover from the debug session. - modify VR_READY and CODE REV Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:10171 TEST=run several Link EVT with this EC and check we have no kernel warnings. Change-Id: I873dc23ddb3ff8ac9fcdf24cd769414cb12689e5 Reviewed-on: https://gerrit.chromium.org/gerrit/25967 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
* stm32: don't try to use the AP I2C connection when the CPU is runningVincent Palatin2012-06-223-1/+15
| | | | | | | | | | | | | | | | | | If the EC shares the I2C-2 bus with the battery and the charger, we don't want to be a master on that bus when the AP is ON and can send us I2C messages. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=none TEST=on Lucas DVT, check we can read battery info when AP is OFF and we cannot when AP is ON. Change-Id: I920a10ae9eff31bd00e4d3a5aec19d6f03b65a33 Reviewed-on: https://gerrit.chromium.org/gerrit/25959 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
* IR357x core/gfx regulator supportVincent Palatin2012-06-223-0/+193
| | | | | | | | | | | | | | | | | | | | | | add function read/write the IR3570/71 voltage regulator settings. This includes new settings for the IR3571 to avoid the freeze observed on new Link boards. Currently, these settings are not flashed permanently inside the IR3571, they are just applied at CPU startup (when the VR powered). Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:10171 TEST=on Link EVT, check in the kernel log that we are longer seeing the warnings from the GPU driver and the jankyness. on Link proto-1, check the IR chip version detection. Change-Id: I0781f5285aac7a9f03c7c4eb953bf97273c6d404 Reviewed-on: https://gerrit.chromium.org/gerrit/24674 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
* stm32: drive the keyboard power LEDVincent Palatin2012-06-227-8/+90
| | | | | | | | | | | | | | | | | | | | Put the power LED in the right state (off, on, breathing) depending on the AP state (off, running, suspending). The power LED is connected to GPIO B3. The AP suspend detection is done through GPIO A7. (so we no longer configure it as SPI alternate function) Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:10647 TEST=on Lucas DVT, boot/stop the board and see the LED on and off. Change-Id: I42121aacab35e9da7a751dc9f56bcc5af7850783 Reviewed-on: https://gerrit.chromium.org/gerrit/25880 Reviewed-by: David Hendricks <dhendrix@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
* Revise EEPROM init and write routinesRandall Spangler2012-06-222-22/+53
| | | | | | | | | | | | | | | | | | | | | They now more closely resemble TI's recommended flow. BUG=chrome-os-partner:10764 TEST=manual: eewrite 1 12 0x1000 eeread 1 12 --> should be 0x1000 eewrite 1 12 0 eewrite 1 12 1 ... eewrite 1 12 100 eewrite 1 12 0xabcd eeread 1 12 --> should be 0xabcd Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I309caea2774615518e68a0d01d33b052d6945c0f Reviewed-on: https://gerrit.chromium.org/gerrit/25941 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Disable thermal thresholds for TMP006 sensor near CPUVic Yang2012-06-223-2/+9
| | | | | | | | | | | | | | | | This sensor doesn't provide accurate case temperature. Let's disable thermal thresholds for the object tempearture reading from this sensor. BUG=chrome-os-partner:9599 TEST=Build success. System works fine. Change-Id: I9408de59a3349f944c5e215085da93f23965ebc9 Reviewed-on: https://gerrit.chromium.org/gerrit/25824 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Ready: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* snow: Enable command help and task profilingSimon Glass2012-06-221-0/+3
| | | | | | | | | | | | | These options are useful for devs, so enable them. BUG=none TEST=manual: build and boot on snow; See that the taskinfo command now shows non-zero data. Type help and see command help. Change-Id: I6bba1cc22498924ea6f151f2fe7e819ae7560e3c Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/25414
* Add a dedicated panic() functionSimon Glass2012-06-222-0/+13
| | | | | | | | | | | | | | | | | | In addition to ASSERT(), it might be useful to panic() sometimes, so add a tidy way of doing it which will print a message and reset. BUG=chrome-os-partner:10149 TEST=manual Build a special version for snow where the 'rw' command calls panic() See that a message is produced: > rw 0 read 0x0 = 0x20001048 ** PANIC: Address is 0 Change-Id: I4512c0193f4c1d52d0c256b2deefacf551056fd9 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/25413
* snow: Turn on CONFIG_ASSERT_HELPSimon Glass2012-06-221-0/+1
| | | | | | | | | | | | | We want our friendly ASSERT() messages. BUG=chrome-os-partner:10149 TEST=manual Enable the option for snow, add a failing ASSERT() to the rw command and see the a nice message is printed now. Change-Id: I84587b209dc4a9d72310456ed2aca178256c5811 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/25412