Commit Graph

2124 Commits

Author SHA1 Message Date
Randall Spangler
2dc1418ccd cleanup: Assorted TODO comments
Remove comments if no longer applicable, or assign bug numbers if they
still are.  Tidy some debug output.  No code changes other than the
debug output.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms, pass unit tests

Change-Id: I2277e73fbf8cc93f3b1b35ee115e0f2f52eb8cf9
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175215
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-31 18:43:39 +00:00
Randall Spangler
d16a246ea9 cleanup: mkbp keyboard module
Rather than compile it by default for host-based tests, only compile
it for the few tests that actually use it.  Since those (and all
boards) now only use if if they also have a keyscan task, we can get
rid of the #ifdefs in keyboard_mkbp.c as well.

And remove a TODO we'll never do...

BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all boards; pass unit tests.  These pass:
     util/make_all.sh
     make BOARD=pit tests

Change-Id: I44d1806cfb375027a7ed0b33a5e9bdbbed8ccddc
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174513
2013-10-30 23:10:13 +00:00
Bill Richardson
e48a9d9c21 Separate fan_t from pwm_t
There is a logical difference between PWM controls for things like
backlights and fan controls for actual fans. This change separates them into
two different data structures, for better abstraction.

BUG=chrome-os-partner:23530
BRANCH=none
TEST=manual

make runtests, make all boards, test on Link and Falco.

Change-Id: Ib63f2d1518fcc2ee367f81bf5d803360c1aa5c76
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175151
2013-10-30 23:10:10 +00:00
Bill Richardson
034e96c128 Rename CONFIG_FAN to CONFIG_FANS
Instead of just configuring fan support as yes/no, we'll use it to specify
the number of fans on the board. Undefined (not zero!) means no fan support
at all.

Syntax change only. No new functionality.

BUG=chrome-os-partner:23530
BRANCH=none
TEST=manual

make runtests, build all platforms, build and test on Link.

Change-Id: Iff65efa69e05f3e1a54fdc2a8da9001b4e8487ca
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175150
2013-10-30 23:10:07 +00:00
Bill Richardson
9dff30d466 Add more descriptive comments to include/fan.h
Just adding some comments.

BUG=chrome-os-partner:23530
BRANCH=none
TEST=none

Change-Id: Ib3955e9d97ad8aa642e6fe298c17e34d2c66fb1c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175139
2013-10-30 23:10:02 +00:00
Bill Richardson
c7b930606b Separate common fan behavior from implementation
This looks like a lot, but it's really just moving the non-board-specific
stuff from chip/lm4/fan.c into common/fan.c, updating the appropriate
headers, and renaming functions to better match the new location.

This is entirely code refactoring and renaming. No new functionality.

BUG=chrome-os-partner:23530
BRANCH=none
TEST=manual

make runtests, build all platforms, build and test on Link.

Change-Id: I7dc03d6732bad83cf838a86600b42a7cff5aa7aa
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175012
2013-10-30 21:51:50 +00:00
Randall Spangler
1d0102ae2c lm4: fix enabling RTC alarm
All hibernate register writes must wait for the WC bit.  When we're
enabling the RTC alarm, it's important to wait for the WC bit
afterwards, too, or else we could go into deep sleep before the write
to HIBIM is committed.

Also make sure that the normal hibernate() path enables the RTC alarm
if it has a timeout.  This bug wasn't noticed until the low-power idle
code called system_reset_rtc_alarm(), since before then HIBIM was
initialized to 1 and just stayed there.

BUG=chrome-os-partner:23678
BRANCH=anywhere we use low power idle (wolf/leon, too)
TEST=with hacked firmware, note that HIBIM=1 just before the wfi
     instruction in chip/lm4/clock.c

Change-Id: Ie01b106ac6a6c5894811f9a333715b22ef896f82
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175013
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2013-10-30 19:45:00 +00:00
Randall Spangler
52ce907d40 lm4: Properly identify TM4 chip used on haswell/baytrail systems
This chip returns ver/family/partno = 0x10de, as indicated by the
datasheet.  Also switch the identification code to use a switch
statement rather than re-reading the DID1 register in if-then-else.

BUG=chrome-os-partner:23679
BRANCH=none (maybe haswell branches, but it's largely cosmetic)
TEST=version command on rambi identifies the chip as ti tm4e1g31h6zrb B1

Change-Id: I4a3748413de65d3116feb7c444f5a2af5953eecd
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175008
Reviewed-by: Vic Yang <victoryang@chromium.org>
2013-10-30 19:44:56 +00:00
Bill Richardson
ea71b8c2a7 samus: set max input current to something safe
If the input current limit is too high the EC sees the AC_PRESENT signal
toggle rapidly, probably due to the adapter browning out. By
trial-and-error, we found a value that seems to stop that happening.

BUG=chrome-os-partner:23449
BRANCH=samus
TEST=emerge-samus chromeos-ec

Let the battery run down a bit, plug the adapter in, watch the EC console to
see what happens. Make sure it doesn't go nuts.

Change-Id: I812685efd312fce82eb117bb722425ae6276fdd1
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175037
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-10-30 19:44:40 +00:00
Randall Spangler
8eacb8ffe2 rambi: Enable PP5000 at boot
Due to power topology, PP5000 needs to be enabled as soon after
PP3300_DSW as possible.  Since PP3300_DSW is what powers the EC, the
EC needs to turn on PP5000 by default and leave it on.

BUG=chrome-os-partner:23673
BRANCH=none
TEST=reboot ap-off (this boots the EC without doing AP power sequencing)
     gpioget -> shows PP5000_EN=1, PP5000_GOOD=1

Change-Id: I5d493877d330b2543a493f8a2f3411003d5964ca
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174989
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-10-30 01:04:43 +00:00
Bill Richardson
497e292542 Start separating LM4 pwm logic from fan logic.
On the LM4, all pwm functions are implemented through hardware "fan"
modules. This change abstracts the hardware fan stuff from the higher level
pwm and fan control logic. Those are still chip-specific at the moment, but
may be moved into common with a future CL.

BUG=chrome-os-partner:23530
BRANCH=none
TEST=manual

Code refactoring only, no new behavior. All tests build and pass, and I
tested on Link with some manual pwm and fan commands on the EC console.

> fanduty 30
> faninfo

Should report ~4500 RPM

> fanset 7000
> faninfo

Should report ~48% duty cycle.

> fanauto

Back to automatic control.

> kblight 0
> kblight 10
> kblight 50
> kblight 100

Keyboard backlight should glow appropriately.

Change-Id: I7558f36b2626e555fc8dabdd12660fa484a93b7f
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174991
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-30 01:03:43 +00:00
Alec Berg
7e78087a91 lm4: Fixes low power bug after a sysjump
This fixes a bug in which after a sysjump, the sleep_mask is
reset, and the EC is allowed to go into a low power mode even
though the AP is still running. This causes numerous problems,
must notable of which is that a flashrom write fails with an
EC protocol mismatch error.

BUG=chrome-os-partner:23645
BRANCH=none
TEST=Execute a flashrom write and make sure the system does not
use the low power code immediately after.

Change-Id: I4d50282da0c5ba5b6488ed14a267a4d8cafe09a7
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174943
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-10-29 19:14:55 +00:00
Randall Spangler
fea89f9cd9 rambi: Change WAKE and SCI lines to open-drain
These were being driven push-pull, causing leakage.

BUG=chrome-os-partner:23639
BRANCH=none
TEST=rambi still boots main processor out of reset

Change-Id: I39a18e48307b66fc767ce2c8256d828d4e6962e0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174897
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-29 17:10:22 +00:00
Vic Yang
e589e87b48 Remove QEMU tests
QEMU tests served us well, but it has been more and more difficult to
maintain as we now have more chips and use more functionality from each
EC chip. With emulator tests in place to test common code and hardware
test to test per-chip/per-board drivers, it's time to remove QEMU tests
to simplify our code base.

QEMU tests that are covered by other emulator tests are removed
completely; tests that are not covered are left alone for now to
preserve the test logic.

BUG=chrome-os-partner:18343
TEST=util/make_all.sh
BRANCH=None

Change-Id: I5a4dd2f5ac42f7f66f86fdce0b62dbd2c65bf66a
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174669
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-29 03:55:35 +00:00
ChromeOS Developer
718f4bb5e3 Allow "ectool gpioget" to run on write protected machines
BRANCH=none
BUG=chrome-os-partner:23608
TEST=Run "ectool gpioget GPIO_LID_OPEN" on a write protected machine

Change-Id: I578ca2828f66d6f4463150f5e108484115a977e8
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174821
Reviewed-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-29 02:59:12 +00:00
Bill Richardson
f20ed63c17 Rename pwm_data.h to pwm_chip.h
To conform to our mutating naming conventions, let's rename the
chip-specific PWM header file to have the string "_chip" in it.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms; pass unit tests

Change-Id: I6584be8e54fd24c8638559817e150c707bc0edb5
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174884
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-28 23:38:16 +00:00
Randall Spangler
6aaab6ab0b rambi: Implement battery cutoff command
Needed for shipping systems.  Puts battery into shutdown mode until AC
reapplied.

BUG=chrome-os-partner:23634
BRANCH=none
TEST=With system on battery power, 'battcutoff'.  System will shut off
     after a few seconds.  Power button will not turn it on.  Plugging
     AC power in will turn system back on.

Change-Id: I10a28c3c21623508dc8e4dee1cc5dc8d6fb9a6af
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174888
Reviewed-by: Dave Parker <dparker@chromium.org>
2013-10-28 23:38:12 +00:00
Bill Richardson
7d9ee9a4e9 Fix comments regarding PWM GPIO use
Update the comments in several board.c files to accurately describe which
pwm control circuit is being used for what purpose.

BUG=chrome-os-partner:23530
BRANCH=none
TEST=none

No code changes, comments only.

Change-Id: I29cef5a2bfee4d7d44bedd092783d9f1d2ea5ef3
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174901
2013-10-28 21:13:08 +00:00
Randall Spangler
9f4c652d40 rambi: Set LED colors based on battery and chipset state
Picked some reasonable values.  Subject to later tweaking.

BUG=chrome-os-partner:23634
BRANCH=none
TEST=On AC power, charging = yellow
     On AC power, done charging = green
     No battery = blinking red
     On battery, AP on = dim green
     On battery, AP off = off

Change-Id: I2eb901ea4de98fec8cd83e403d6ed8a06a2a9ca9
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174778
Reviewed-by: Dave Parker <dparker@chromium.org>
2013-10-28 21:13:05 +00:00
Randall Spangler
02a770d5a5 rambi: Enable battery charging
Using best-guess numbers for input current limit.  Battery voltage and
temperature limits are set from actual battery spec.

BUG=chrome-os-partner:23597
BRANCH=none
TEST=battery and charger commands print reasonable info
     battery charges when system plugged in

Change-Id: I812276cbe46c8463a855c7ba3e0bfec4852e6f97
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174766
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-28 21:13:02 +00:00
Randall Spangler
685c45ef46 cleanup: comments in adc modules
No code changes, other than renaming a couple of static functions.

BUG=none
BRANCH=none
TEST=build falco

Change-Id: I29b835d273aa1aba66d9d40536eae2eb12207f66
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174530
2013-10-25 20:12:54 +00:00
Randall Spangler
17ea6d50f0 cleanup: eeprom and option comments
No code changes, just updating comments.

BUG=chrome-os-partner:23558
BRANCH=none
TEST=compile bds project

Change-Id: I819244acafcf89a1e983bddecd82f770b0374ee1
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174512
2013-10-25 20:12:49 +00:00
Vincent Palatin
a88b237729 stm32l: fix ADC all channels conversion
Reset the DMA status after the end of the conversions,
else we will exit too early at the next call of the function and the
values before they are actually transfered.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=none
TEST=run "adc" command several times and always see proper value for
each ADC.

Change-Id: I7ad335fffa2da34a4b715e9f0c9927bf06baef8f
Reviewed-on: https://chromium-review.googlesource.com/174397
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
2013-10-25 18:20:15 +00:00
Randall Spangler
5ef2054c38 cleanup: Consolidate module IDs into a single shared enum
This is tidier than every board defining its own module_id enum, and
encourages standard naming of modules.

A subsequent CL will do more cleanup (standardizing on MODULE_LED
instead of MODULE_POWER_LED and MODULE_LED_KIRBY), but it's easier to
do that as a separate CL than part of this one.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms; pass unit tests

Change-Id: If0fcef284fb3aa2fa145bc9ff3d1f3f2d25a2e47
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174382
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-25 03:09:51 +00:00
Randall Spangler
235a735f7a cleanup: Add bug number to TODO comment in charger driver
And tidy the code a little.

BUG=chrome-os-partner:22238
BRANCH=none
TEST=compile kirby

Change-Id: Ib424e66c5068297cc48ee3d3b8f900baea432bbc
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174570
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-25 01:33:48 +00:00
Randall Spangler
c8bcc57aac cleanup: Re-enable keyboard console channel for ARM boards
Originally, the ARM boards printed the keyboard scan matrix whenever
it changed.  This generated a lot of output, so we filtered that at
the console channel level.  When we refactored the keyboard scan
module, that changed so that the scan matrix was not printed by
default, and the 'ksstate' debug command was used to enable printing
it.  But on ARM boards, 'ksstate on' wouldn't do anything without ALSO
using 'chan -1' to turn the keyboard console channel back on.  And
without the scan matrix printing by default, there's no reason to keep
the keyboard channel off by default.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all boards
     bang on keyboard on pit and don't see much debug output
     ksstate on
     now bang on keyboard and see matrix changes

Change-Id: I554b42e7582d507530cdecad7b35df71ca0e634f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174373
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-25 01:33:10 +00:00
Randall Spangler
5e19f9c5d5 cleanup: Comments in console_output.c
No code changes, just tidying some comments and moving a TODO to a bug.

BUG=chrome-os-partner:23557
BRANCH=none
TEST=compile any project; hey, this is just a change in comments.

Change-Id: Ib1e3190ac9abdc90fb04c785e1f20b9cc66b1bc3
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174447
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-25 01:32:41 +00:00
Alec Berg
55abd0b93c lm4: Disable ADC module when not in use.
Changed ADC clock gating to disable the ADC module to conserve power,
and only enable it when needed. This saves about 15% of the power
consumed by the EC when the AP is running.

BUG=none
BRANCH=none
TEST=Run the ADC stress test. This runs 2000 consecutive ADC
reads of all the channels and verifies that the ADC module
successfully records the samples. Note that when running this
test make sure all other calls to read an ADC channel are
disabled because the ADC read function does not protect
against different tasks accesses.

Change-Id: I9ca3671d8cf68e09d21c9c2594856f9c08476398
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174580
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-10-25 01:32:36 +00:00
Randall Spangler
c0fbbaefed cleanup: comments in i2c modules
No code changes; just update comments with bug links

BUG=none
BRANCH=none
TEST=build all platforms

Change-Id: I8b845f9c43315b7db5a746a16c6618c3ee96979d
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174614
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-25 01:32:31 +00:00
Randall Spangler
870b7ebb78 cleanup: charge state header
Remove old TODO and function which no longer exists.

BUG=none
BRANCH=none
TEST=compile all platforms

Change-Id: I81c5ddb3d0e156d455be1af82f12d8d4f30e1bc8
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174393
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-25 01:32:21 +00:00
Randall Spangler
df541c6ffd cleanup: rename I2C_PORT_HOST to I2C_PORT_MASTER
Previously, it was really confusing whether I2C_PORT_HOST meant the
port where the EC was the master, or the port used to talk to the AP.

No functional changes, just a global find/replace and some tidying of
unused comments.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms; pass unit tests

Change-Id: Ia591ba4577d3399729556e0234ba0db3a0e3c5ea
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174546
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2013-10-25 01:32:15 +00:00
Randall Spangler
4a1ecb67f9 pit: Fix battery cutoff command to use deferred function call
Rather than hackily sending a host response before sending the battery
cutoff command, just put the cutoff command in a deferred function
call and respond normally to the host command.

BUG=chrome-os-partner:23568
BRANCH=none
TEST=On battery power, 'ectool batterycutoff' prints success, then the
     system loses power due to battery cutoff.

Change-Id: Ic42d08ef94a10f89d093290cda63da01fca985a5
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174573
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-25 00:29:00 +00:00
Paul Stewart
0f3a14def8 samus: Leave WiFi power on in S3
This improves WiFi stability after resume since powering down may
erase or otherwise stymy the firmware.

Signed-off-by: Paul Stewart <pstew@chromium.org>

BUG=chrome-os-partner:22175
BRANCH=none
TEST=Suspend and resume samus, make sure WiFi is still operable

Change-Id: I91914482c2040abe0feecd94891fca01a176f667
Reviewed-on: https://chromium-review.googlesource.com/174258
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
2013-10-24 06:34:14 +00:00
Bill Richardson
9a6e464502 cleanup: remove obsolete declaration from header
When we cleaned up the alternate function GPIO initialization, we left a
declaration for configure_fan_gpios() in fan.h. That function doesn't exist
anywhere, so there's no point in declaring it.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=manual

Build everything. Nothing fails.

Change-Id: I3d1fe1ff62e523aa7c87d57c5e838b01a0c6e899
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174334
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-23 23:53:27 +00:00
Randall Spangler
251a80add3 throttle_ap.c should only be compiled if there's a chipset/power task
It doesn't need to be compiled if there would be nothing for it to talk to.

BUG=chrome-os-partner:20739
BRANCH=none
TEST=build all platforms, pass unit tests
     comment out chipset task in Rambi ec.tasklist; code still compiles

Change-Id: I004364b8c1fdf02c420162b5ad2843068a26b452
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174302
2013-10-23 23:53:23 +00:00
Randall Spangler
2ad076f8a0 cleanup: Rename and move header files
Device-specific headers belong in driver/ or chip/.  The include/
directory should be for common interfaces.

Code should not normally need to include driver-specific headers.  If
it does, it should use the full relative path from the EC project root
(for example, drivers/charger/bq24715.h).

Change-Id: Id23db37a431e2d802a74ec601db6f69b613352ba
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173746
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-23 21:27:40 +00:00
Randall Spangler
8cf03ac056 Move source files to driver/ and power/ subdirs
The common/ subdir was getting cluttered.  Move drivers for external
components to a new driver/ tree, and move what used to be called
chipset_*.c to a new power/ directory.

This does not move/rename header files or CONFIG options.  That will
be done in subsequent steps, since moving and modifying .c files in
the same CL is harder to review.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all boards; pass unit tests

Change-Id: I67a3003dc8564783a320335cf0e9620a21982d5e
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173601
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
2013-10-23 20:07:25 +00:00
Paul Stewart
2464d08e4d bolt: Leave WiFi power on in S3
This improves WiFi stability after resume since powering down may
erase or otherwise stymy the firmware.

Signed-off-by: Paul Stewart <pstew@chromium.org>

BUG=chrome-os-partner:22175
BRANCH=none
TEST=Suspend and resume bolt, make sure WiFi is still operable

Change-Id: Ia9e39464955b373e6f03a36ca5af5c475e957208
Reviewed-on: https://chromium-review.googlesource.com/174257
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
2013-10-23 20:07:02 +00:00
Randall Spangler
2d4ece9b69 daisy: Clean up pmu initialization
CG_CTRL0 is already set to 2 by pmu_init_registers(), and the battery
charge rate hack was temporary.

BUG=chrome-os-partner:23425
BRANCH=none
TEST=build daisy

Change-Id: I863c8d6d5d5f30375dce14b7d2a30e9e710ef969
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173915
Reviewed-by: Jeremy Thorpe <jeremyt@chromium.org>
2013-10-23 20:06:57 +00:00
Randall Spangler
bbf6b9b076 lpc: No need to scan entire host command I/O space for detection
The EC LPC implementation guarantees that the status byte will have at
least one zero bit, so there's no need to scan the parameter space as
well.  Removing this unneeded check will slightly speed up ectool.

BUG=chrome-os-partner:10963
BRANCH=none
TEST=on an x86 chromebook (e.g. link), ectool hello still works
     iotools io_read8 0x200 && iotools io_read8 0x204 -> not both 0xff

Change-Id: Ic02ca0ee686ab10e50093807717ec638aaa468c6
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174059
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-23 04:09:50 +00:00
Randall Spangler
5f26987366 cleanup: Comments about PMU powerinfo module
Document some Pit-platform-specific assumptions.

No code changes.

BUG=none
BRANCH=none
TEST=build pit

Change-Id: I601ca4a57645ba45e7db01e271556a30d334f9cd
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174056
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-22 23:18:13 +00:00
Randall Spangler
a27fb9cfdc cleanup: Remove obsolete comment in STM32 GPIO module
USB A-A cable works fine downloading firmware on pit now, so this
comment no longer applies.

BUG=none
BRANCH=none
TEST=build pit

Change-Id: I4f07108357ffcab590fd95ffb50955f60698a39e
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174047
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-22 23:18:05 +00:00
Randall Spangler
87af5f257c cleanup: More detail in todo comments for mccroskey
This dev board hasn't seen much love.  Add bug links for the unloved
bits and remove an empty interrupt handler.

BUG=chrome-os-partner:23494
BRANCH=none
TEST=build mccroskey

Change-Id: Ic521c6cba4ca438bf54f9ce77eb0cba99be57602
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174082
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-22 23:17:27 +00:00
Randall Spangler
9ccd9668a2 cleanup: update comments with existing bug numbers
Some of the comments no longer apply.  Others needed more info.

No code changes; just comment changes.

BUG=none
BRANCH=none
TEST=build all platforms

Change-Id: I1d52aa9a98427a78c9d9a8cf44934fb04c3c00c8
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174084
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2013-10-22 22:23:53 +00:00
Randall Spangler
7f3ca9fb65 rambi: Remove internal pullup from write protect pin
The pin has a 100k series resistor, which is overwhelmed by the
internal pullup.

BUG=chrome-os-partner:23489
BRANCH=none
TEST=gpioget wp_l, with screw present and removed.  With screw present,
     signal should read 0; with it removed it should read 1.

Change-Id: I35ee867111d0d7e8626dd3ac8010e9a10f46ccf7
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174094
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2013-10-22 22:18:40 +00:00
Randall Spangler
ba0b7bf32d puppy: remove temporary workaround in pmu chipset startup
This was temporary until bug 18778 was fixed - which it was, a while ago.

BUG=chrome-os-partner:23425
BRANCH=none
TEST=build puppy

Change-Id: I053867dcb1c3e74d0c09ac98a5c218bdca925317
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173799
Reviewed-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
2013-10-22 21:41:33 +00:00
Bill Richardson
2f327fbfa6 samus: Use analog BAT_TEMP as presence indicator
There is an analog temperature line on the Samus battery connector. We don't
yet know what it means, but there's a pull-up on it, so if it's reading
close to ADC_READ_MAX, we can probably assume there's no battery.

This change says that any reading within 90% of ADC_READ_MAX means the
battery pack is not present, so we can go ahead and boot without trying to
wake it up first.

BUG=chrome-os-partner:23449
BRANCH=none
TEST=manual

Connect the battery, boot. It should happen quickly.
Disconnect the battery, boot. It should STILL happen quickly.

Running "adc" on the EC console should show an entry for "BatteryTemp". If
no battery is connected, it should read somewhere close to 4095.

Change-Id: I1e41bccb2a988d34de09192ebb0a68b91b1b0b24
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174046
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2013-10-22 21:41:09 +00:00
Randall Spangler
99d52c8874 cleanup: FIFO comment in MKBP driver
A 16-element FIFO consumes 208 bytes of RAM, which isn't too horrible.

No code changes, just expanding on a comment.

BUG=none
BRANCH=none
TEST=build spring

Change-Id: Ibb51970b6fc72623435d21bd0b368c3e60da24da
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173922
Reviewed-by: Vic Yang <victoryang@chromium.org>
2013-10-22 17:56:20 +00:00
Randall Spangler
a318cc9068 cleanup: Remove fixme from ec_commands.h
The fixme was just a feature request.  I've moved it to a new bug.

Comment change only; no code changes.

BUG=chrome-os-partner:23457
BRANCH=none
TEST=build rambi

Change-Id: Ie3fc0482b6697c12040b868ba837073929cf5b82
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173921
Reviewed-by: Vic Yang <victoryang@chromium.org>
2013-10-22 17:55:42 +00:00
Randall Spangler
600e36d664 bolt: Implement prochot
This code is pretty much the same across all x86 chipsets.  In the
long run, maybe it should be moved to x86_common.c, but for now,
simply implement on bolt what we did on samus and all the other
haswell systems.

BUG=chrome-os-partner:20372
BRANCH=none
TEST=build bolt; don't have a bolt to test on

Change-Id: I01c2795192fcbd3980ed464c1e3e1dfb64fdb228
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173798
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2013-10-22 01:13:40 +00:00